|
From: <txm...@us...> - 2014-06-27 12:03:36
|
Revision: 12657
http://sourceforge.net/p/xoops/svn/12657
Author: txmodxoops
Date: 2014-06-27 12:03:27 +0000 (Fri, 27 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/mail.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/comment_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/update.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-27 09:27:07 UTC (rev 12656)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-27 12:03:27 UTC (rev 12657)
@@ -141,11 +141,11 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
$GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
-
+ // Form Add
$fieldsObj =& $tdmcreate->getHandler('fields')->create();
- $form = $fieldsObj->getForm($field_mid, $field_tid, $field_numb, $field_name);
+ $form = $fieldsObj->getFormAdd($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
-
+ // Test -> Will be removed
var_dump($field_mid);
var_dump($field_tid);
var_dump($field_numb);
@@ -229,14 +229,13 @@
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$adminMenu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'list');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
-
- /*$fieldsObj = $tdmcreate->getHandler('fields')->get( $field_tid );
- $form = $fieldsObj->getForm(null, $field_tid);
- $GLOBALS['xoopsTpl']->assign('form', $form->render());*/
- $form = TDMCreate_getFieldsForm($field_mid, $field_tid);
+ $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
+ // Form Edit
+ $field_id = XoopsRequest::getInt('field_id');
+ $fieldsObj = $tdmcreate->getHandler('fields')->get( $field_id );
+ $form = $fieldsObj->getFormEdit($field_mid, $field_tid);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
-
+ // Test -> Will be removed
var_dump($field_tid);
break;
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif
===================================================================
(Binary files differ)
Index: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif 2014-06-27 09:27:07 UTC (rev 12656)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif 2014-06-27 12:03:27 UTC (rev 12657)
Property changes on: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/assets/images/xoopsdevelopmentteam_logo.gif
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-27 09:27:07 UTC (rev 12656)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-27 12:03:27 UTC (rev 12657)
@@ -88,7 +88,7 @@
}
/*
- * @public function getForm
+ * @public function getFormAdd
*
* @param integer $field_mid
* @param integer $field_tid
@@ -96,7 +96,7 @@
* @param string $f_name
* @param mixed $action
*/
- public function getForm($field_mid = null, $field_tid = null, $field_numb = null, $f_name = null, $action = false)
+ public function getFormAdd($field_mid = null, $field_tid = null, $field_numb = null, $f_name = null, $action = false)
{
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
@@ -239,7 +239,156 @@
$form->addElement(new TDMCreateFormLabel('<td>'.$form_button->render().'</td>'));
$form->addElement(new TDMCreateFormLabel('</tr></tfoot></table>'));
return $form;
- }
+ }
+
+ /*
+ * @public function getFormEdit
+ *
+ * @param integer $field_mid
+ * @param integer $field_tid
+ * @param mixed $action
+ */
+ public function getFormEdit($field_mid = null, $field_tid = null, $action = false)
+ {
+ if ($action === false) {
+ $action = $_SERVER['REQUEST_URI'];
+ }
+
+ $form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
+ $form->setExtra('enctype="multipart/form-data"');
+
+ // New Object HtmlTable
+ $form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
+ $form->addElement(new TDMCreateFormLabel('<thead class="center">'));
+ $form->addElement(new TDMCreateFormLabel('<tr class="head"><th colspan="9">'._AM_TDMCREATE_FIELD_EDIT.'</th></tr>'));
+ $form->addElement(new TDMCreateFormLabel('<tr class="head width5">'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NUMBER.'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NAME.'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_TYPE.'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_VALUE.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_ATTRIBUTE.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NULL.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_DEFAULT.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
+ $form->addElement(new TDMCreateFormLabel('</tr></thead>'));
+ $form->addElement(new TDMCreateFormLabel('<tbody>'));
+ //
+ $class = 'even';
+ // Get the list of fields
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria('field_tid', $field_tid));
+ $fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria);
+ unset($criteria);
+ $id = 1;
+ foreach($fields as $field) {
+ $class = ($class == 'even') ? 'odd' : 'even';
+ $field_id = $field->getVar('field_id');
+ $form->addElement(new XoopsFormHidden('field_id['.$field_id.']', $field_id));
+ $form->addElement(new XoopsFormHidden('field_mid', $field_mid));
+ $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
+
+ $form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
+ // Index ID
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$id.'</td>'));
+ // Field Name
+ $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$field_id.']', 15, 255, $field->getVar('field_name'));
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
+ // Field Type
+ $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$field_id.']', $field->getVar('field_type'));
+ $fieldtype_select->addOptionArray($this->tdmcreate->getHandler('fieldtype')->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
+ // Field Value
+ $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$field_id.']', 5, 20, $field->getVar('field_value'));
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
+ // Field Attributes
+ $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$field_id.']', $field->getVar('field_attribute'));
+ $field_attributes_select->addOptionArray($this->tdmcreate->getHandler('fieldattributes')->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
+ // Field Null
+ $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$field_id.']', $field->getVar('field_null'));
+ $field_null_select->addOptionArray($this->tdmcreate->getHandler('fieldnull')->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
+ // Field Default
+ $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$field_id.']', 15, 25, $field->getVar('field_default'));
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
+ // Field Key
+ $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$field_id.']', $field->getVar('field_key'));
+ $field_key_select->addOptionArray($this->tdmcreate->getHandler('fieldkey')->getList());
+ $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
+ // Field Void
+ $table_autoincrement = $this->tdmcreate->getHandler('tables')->get($field_tid);
+ if( ($id == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)) {
+ $form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
+ } else {
+ // Box header row
+ $parameters_tray = new XoopsFormElementTray('', '<br />');
+ // Field Elements
+ $criteria_element = new CriteriaCompo();
+ $criteria_element->add(new Criteria('fieldelement_tid', 0));
+ $criteria_table = new CriteriaCompo();
+ $criteria_table->add(new Criteria('fieldelement_mid', $field_mid));
+ $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$field_id.']', $field->getVar('field_element'));
+ $field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_element));
+ $field_elements_select->addOptionArray($this->tdmcreate->getHandler('fieldelements')->getList($criteria_table));
+ unset($criteria_element); unset($criteria_table);
+ $parameters_tray->addElement($field_elements_select);
+
+ $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent['.$field_id.']', $field->getVar('field_parent'));
+ $check_field_parent->addOption(1, _AM_TDMCREATE_FIELD_PARENT );
+ $parameters_tray->addElement($check_field_parent);
+
+ $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$field_id.']', $field->getVar('field_inlist'));
+ $check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
+ $parameters_tray->addElement($check_field_inlist);
+
+ $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$field_id.']', $field->getVar('field_inform'));
+ $check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM);
+ $parameters_tray->addElement($check_field_inform);
+
+ $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$field_id.']', $field->getVar('field_admin'));
+ $check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
+ $parameters_tray->addElement($check_field_admin);
+
+ $check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$field_id.']', $field->getVar('field_user'));
+ $check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
+ $parameters_tray->addElement($check_field_user);
+
+ $check_field_block = new XoopsFormCheckBox('', 'field_block['.$field_id.']', $field->getVar('field_block'));
+ $check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
+ $parameters_tray->addElement($check_field_block);
+
+ $field_main = $field->getVar('field_main');
+ if($field_main == 1) {
+ $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']', $field_main);
+ } else {
+ $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']');
+ }
+ $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
+ $parameters_tray->addElement($check_field_main);
+
+ $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$field_id.']', $field->getVar('field_search'));
+ $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
+ $parameters_tray->addElement($check_field_search);
+
+ $check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$field_id.']', $field->getVar('field_required'));
+ $check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
+ $parameters_tray->addElement($check_field_required);
+ $form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">'._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'</div><div class="portlet-content">'.$parameters_tray->render().'</div></div></td></tr>'));
+ }
+ $id++;
+ }
+ unset($id);
+ // Send Form Data
+ $form->addElement(new TDMCreateFormLabel('</tbody>'));
+ $form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
+ $form_hidden = new XoopsFormHidden('op', 'save');
+ $form_button = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
+ $form->addElement(new TDMCreateFormLabel('<td colspan="8">'.$form_hidden->render().'</td>'));
+ $form->addElement(new TDMCreateFormLabel('<td>'.$form_button->render().'</td>'));
+ $form->addElement(new TDMCreateFormLabel('</tr></tfoot></table>'));
+ return $form;
+ }
}
/*
* @Class TDMCreateFieldsHandler
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-27 09:27:07 UTC (rev 12656)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-27 12:03:27 UTC (rev 12657)
@@ -142,7 +142,7 @@
// Creation of "images/icons/32" folder and index.html file
$this->structure->makeDirAndCopyFile('assets/images/icons/32', $indexFile, 'index.html');
// Creation of 'txmodxoops_logo.png' file
- $this->structure->copyFile('assets/images', $upload_images_folder.'/'.$stl_module_author.'_logo.png', $stl_module_author.'_logo.png');
+ $this->structure->copyFile('assets/images', $upload_images_folder.'/'.$stl_module_author.'_logo.gif', $stl_module_author.'_logo.gif');
// Creation of "images" folder and index.html file
$this->structure->makeDirAndCopyFile('assets/js', $indexFile, 'index.html');
// Creation of 'docs' folder and index.html file
@@ -182,6 +182,10 @@
// Creation of "sql" folder and index.html file
$this->structure->makeDirAndCopyFile('sql', $indexFile, 'index.html');
}
+ if ( $table->getVar('table_notifications') == 1 ) {
+ // Creation of "sql" folder and index.html file
+ $this->structure->makeDirAndCopyFile('language/'.$GLOBALS['xoopsConfig']['language'].'/mail_template', $indexFile, 'index.html');
+ }
}
}
@@ -333,6 +337,10 @@
$includeNotifications = IncludeNotifications::getInstance();
$includeNotifications->write($module, $table, 'notifications.php');
$ret[] = $includeNotifications->render();
+ // Language Mail Template Category File
+ $languageMailTpl = LanguageMailTpl::getInstance();
+ $languageMailTpl->write($module, 'category_new_notify.tpl');
+ $ret[] = $languageMailTpl->render();
}
// Include Install File
$includeInstall = IncludeInstall::getInstance();
@@ -373,7 +381,11 @@
// Include Comments File
$includeComments = IncludeComments::getInstance();
$includeComments->write($module, $table);
- $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
+ $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
+ // Include Comment Functions File
+ $includeCommentFunctions = IncludeCommentFunctions::getInstance();
+ $includeCommentFunctions->write($module, $table, 'comment_functions.php');
+ $ret[] = $includeCommentFunctions->renderFile();
}
// Creation of user files
if ( ($table->getVar('table_user') == 1)) {
@@ -429,6 +441,10 @@
$includeFunctions = IncludeFunctions::getInstance();
$includeFunctions->write($module, 'functions.php');
$ret[] = $includeFunctions->render();
+ // Include Update File
+ $includeUpdate = IncludeUpdate::getInstance();
+ $includeUpdate->write($module, 'update.php');
+ $ret[] = $includeUpdate->renderFile();
// Docs Changelog File
$docsChangelog = DocsChangelog::getInstance();
$docsChangelog->write($module, 'changelog.txt');
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/comment_functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/comment_functions.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/comment_functions.php 2014-06-27 12:03:27 UTC (rev 12657)
@@ -0,0 +1,87 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: comment_functions.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class IncludeCommentFunctions extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ */
+ public function write($module, $table, $filename) {
+ $this->setModule($module);
+ $this->setTable($table);
+ $this->setFileName($filename);
+ }
+ /*
+ * @public function renderFile
+ * @param null
+ */
+ public function renderFile()
+ {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $table_name = $table->getVar('table_name');
+ $ucf_module_name = ucfirst($module_name);
+ $ucf_table_name = ucfirst($table_name);
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= <<<EOT
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+function {$module_name}_com_update(\$itemId, \$itemNumb) {
+ \$itemId = intval(\$itemId);
+ \$itemNumb = intval(\$itemNumb);
+ \$article = new {$ucf_module_name}{$ucf_table_name}(\$itemId);
+ if (!\$article->updateComments(\$itemNumb)) {
+ return false;
+ }
+ return true;
+}
+
+function {$module_name}_com_approve(&\$comment){
+ // notification mail here
+}
+EOT;
+ $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/update.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/update.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/update.php 2014-06-27 12:03:27 UTC (rev 12657)
@@ -0,0 +1,72 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: update.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class IncludeUpdate extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= <<<EOT
+\n// ---------- Here your update code ---------- //
+EOT;
+ //
+ $this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/mail.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/mail.php 2014-06-27 09:27:07 UTC (rev 12656)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/mail.php 2014-06-27 12:03:27 UTC (rev 12657)
@@ -16,17 +16,18 @@
* @package tdmcreate
* @since 2.5.0
* @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: 1.91 language_tpl.php 12258 2014-01-02 09:33:29Z timgno $
+ * @version $Id: 1.91 mail.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-class LanguageTpl extends TDMCreateFile
+class LanguageMailTpl extends TDMCreateFile
{
/*
* @public function constructor
* @param null
*/
- public function __construct() {
+ public function __construct() {
+ parent::__construct();
$this->tdmcfile = TDMCreateFile::getInstance();
}
/*
@@ -44,23 +45,41 @@
/*
* @public function write
* @param string $module
- * @param string $filename
*/
- public function write($module, $filename) {
+ public function write($module) {
$this->setModule($module);
- $this->setFileName($filename);
}
/*
- * @public function render
- * @param null
+ * @public function renderFile
+ * @param string $filename
*/
- public function render() {
+ public function renderFile($filename) {
$module = $this->getModule();
$filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $stl_module_name = strtolower($module_name);
+ $module_name = strtolower($module->getVar('mod_name'));
$content = <<<EOT
- <!-- ----- Templates Mail Content ---------- -->
+// ---------- Templates Mail Content Dummy ---------- //
+Hello {X_UNAME},
+
+A new story "{STORY_NAME}" has been added at {X_SITENAME}.
+
+You can view this story here:
+{STORY_URL}
+
+-----------
+
+You are receiving this message because you selected to be notified when new stories are added to our site.
+
+If this is an error or you wish not to receive further such notifications, please update your subscriptions by visiting the link below:
+{X_UNSUBSCRIBE_URL}
+
+Please do not reply to this message.
+
+-----------
+
+{X_SITENAME} ({X_SITEURL})
+webmaster
+{X_ADMINMAIL}
EOT;
$this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'].'/mail_template', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-06-27 09:27:07 UTC (rev 12656)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-06-27 12:03:27 UTC (rev 12657)
@@ -69,15 +69,18 @@
include_once TDMC_PATH . $cfd .'changelog.php';
include_once TDMC_PATH . $cfd .'docs.php';
include_once TDMC_PATH . $cfi .'comments.php';
+include_once TDMC_PATH . $cfi .'comment_functions.php';
include_once TDMC_PATH . $cfi .'common.php';
include_once TDMC_PATH . $cfi .'functions.php';
include_once TDMC_PATH . $cfi .'install.php';
include_once TDMC_PATH . $cfi .'jquery.php';
-include_once TDMC_PATH . $cfi .'notifications.php';
-include_once TDMC_PATH . $cfi .'search.php';
+include_once TDMC_PATH . $cfi .'notifications.inc.php';
+include_once TDMC_PATH . $cfi .'search.inc.php';
+include_once TDMC_PATH . $cfi .'update.php';
include_once TDMC_PATH . $cfl .'admin.php';
include_once TDMC_PATH . $cfl .'blocks.php';
include_once TDMC_PATH . $cfl .'help.php';
+include_once TDMC_PATH . $cfl .'mail.php';
include_once TDMC_PATH . $cfl .'main.php';
include_once TDMC_PATH . $cfl .'modinfo.php';
include_once TDMC_PATH . $cfs .'mysql.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-06-27 09:27:07 UTC (rev 12656)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/functions.php 2014-06-27 12:03:27 UTC (rev 12657)
@@ -129,156 +129,4 @@
function phpFunction($val='')
{ // create php function here
echo $val;
-}*/
-
-/*
-* @function getFieldsForm
-*
-* @param integer $field_mid
-* @param integer $field_tid
-* @param mixed $action
-*/
-function TDMCreate_getFieldsForm($field_mid = null, $field_tid = null, $action = false)
-{
- if ($action === false) {
- $action = $_SERVER['REQUEST_URI'];
- }
- $tdmcreate = TDMCreate::getInstance();
-
- require_once TDMC_PATH . '/class/html/simplelabel.php';
- require_once TDMC_PATH . '/class/form/themeform.php';
- $form = new TDMCreateThemeForm(null, 'form', $action, 'post', true);
- $form->setExtra('enctype="multipart/form-data"');
-
- // New Object HtmlTable
- $form->addElement(new TDMCreateFormLabel('<table border="0" cellspacing="1" class="outer width100">'));
- $form->addElement(new TDMCreateFormLabel('<thead class="center">'));
- $form->addElement(new TDMCreateFormLabel('<tr class="head"><th colspan="9">'._AM_TDMCREATE_FIELD_EDIT.'</th></tr>'));
- $form->addElement(new TDMCreateFormLabel('<tr class="head width5">'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NUMBER.'</td>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NAME.'</td>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_TYPE.'</td>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_VALUE.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_ATTRIBUTE.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_NULL.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_DEFAULT.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_KEY.'</th>'));
- $form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
- $form->addElement(new TDMCreateFormLabel('</tr></thead>'));
- $form->addElement(new TDMCreateFormLabel('<tbody>'));
- //
- $class = 'even';
- // Get the list of fields
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria('field_tid', $field_tid));
- $fields = $tdmcreate->getHandler('fields')->getObjects($criteria);
- unset($criteria);
- $id = 1;
- foreach($fields as $field) {
- $class = ($class == 'even') ? 'odd' : 'even';
- $field_id = $field->getVar('field_id');
- $form->addElement(new XoopsFormHidden('field_id['.$field_id.']', $field_id));
- $form->addElement(new XoopsFormHidden('field_mid', $field_mid));
- $form->addElement(new XoopsFormHidden('field_tid', $field_tid));
-
- $form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
- // Index ID
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$id.'</td>'));
- // Field Name
- $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$field_id.']', 15, 255, $field->getVar('field_name'));
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_name->render().'</td>'));
- // Field Type
- $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$field_id.']', $field->getVar('field_type'));
- $fieldtype_select->addOptionArray($tdmcreate->getHandler('fieldtype')->getList());
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$fieldtype_select->render().'</td>'));
- // Field Value
- $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$field_id.']', 5, 20, $field->getVar('field_value'));
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_value->render().'</td>'));
- // Field Attributes
- $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$field_id.']', $field->getVar('field_attribute'));
- $field_attributes_select->addOptionArray($tdmcreate->getHandler('fieldattributes')->getList());
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_attributes_select->render().'</td>'));
- // Field Null
- $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$field_id.']', $field->getVar('field_null'));
- $field_null_select->addOptionArray($tdmcreate->getHandler('fieldnull')->getList());
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_null_select->render().'</td>'));
- // Field Default
- $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$field_id.']', 15, 25, $field->getVar('field_default'));
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_default->render().'</td>'));
- // Field Key
- $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$field_id.']', $field->getVar('field_key'));
- $field_key_select->addOptionArray($tdmcreate->getHandler('fieldkey')->getList());
- $form->addElement(new TDMCreateFormLabel('<td class="center">'.$field_key_select->render().'</td>'));
- // Field Void
- $table_autoincrement = $tdmcreate->getHandler('tables')->get($field_tid);
- if( ($id == 1) && ($table_autoincrement->getVar('table_autoincrement') == 1)) {
- $form->addElement(new TDMCreateFormLabel('<td> </td></tr>'));
- } else {
- // Box header row
- $parameters_tray = new XoopsFormElementTray('', '<br />');
- // Field Elements
- $criteria_element = new CriteriaCompo();
- $criteria_element->add(new Criteria('fieldelement_tid', 0));
- $criteria_table = new CriteriaCompo();
- $criteria_table->add(new Criteria('fieldelement_mid', $field_mid));
- $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$field_id.']', $field->getVar('field_element'));
- $field_elements_select->addOptionArray($tdmcreate->getHandler('fieldelements')->getList($criteria_element));
- $field_elements_select->addOptionArray($tdmcreate->getHandler('fieldelements')->getList($criteria_table));
- unset($criteria_element); unset($criteria_table);
- $parameters_tray->addElement($field_elements_select);
-
- $check_field_parent = new XoopsFormCheckBox(' ', 'field_parent['.$field_id.']', $field->getVar('field_parent'));
- $check_field_parent->addOption(1, _AM_TDMCREATE_FIELD_PARENT );
- $parameters_tray->addElement($check_field_parent);
-
- $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$field_id.']', $field->getVar('field_inlist'));
- $check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST);
- $parameters_tray->addElement($check_field_inlist);
-
- $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$field_id.']', $field->getVar('field_inform'));
- $check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM);
- $parameters_tray->addElement($check_field_inform);
-
- $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$field_id.']', $field->getVar('field_admin'));
- $check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN);
- $parameters_tray->addElement($check_field_admin);
-
- $check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$field_id.']', $field->getVar('field_user'));
- $check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER);
- $parameters_tray->addElement($check_field_user);
-
- $check_field_block = new XoopsFormCheckBox('', 'field_block['.$field_id.']', $field->getVar('field_block'));
- $check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
- $parameters_tray->addElement($check_field_block);
-
- $field_main = $field->getVar('field_main');
- if($field_main == 1) {
- $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']', $field_main);
- } else {
- $check_field_main = new XoopsFormRadio('', 'field_main['.$field_id.']');
- }
- $check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
- $parameters_tray->addElement($check_field_main);
-
- $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$field_id.']', $field->getVar('field_search'));
- $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH);
- $parameters_tray->addElement($check_field_search);
-
- $check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$field_id.']', $field->getVar('field_required'));
- $check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED);
- $parameters_tray->addElement($check_field_required);
- $form->addElement(new TDMCreateFormLabel('<td><div class="portlet"><div class="portlet-header">'._AM_TDMCREATE_FIELD_PARAMETERS_LIST.'</div><div class="portlet-content">'.$parameters_tray->render().'</div></div></td></tr>'));
- }
- $id++;
- }
- unset($id);
- // Send Form Data
- $form->addElement(new TDMCreateFormLabel('</tbody>'));
- $form->addElement(new TDMCreateFormLabel('<tfoot><tr>'));
- $form_hidden = new XoopsFormHidden('op', 'save');
- $form_button = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
- $form->addElement(new TDMCreateFormLabel('<td colspan="8">'.$form_hidden->render().'</td>'));
- $form->addElement(new TDMCreateFormLabel('<td>'.$form_button->render().'</td>'));
- $form->addElement(new TDMCreateFormLabel('</tr></tfoot></table>'));
- return $form;
-}
\ No newline at end of file
+}*/
\ No newline at end of file
|