From: <txm...@us...> - 2013-03-28 12:29:28
|
Revision: 11321 http://sourceforge.net/p/xoops/svn/11321 Author: txmodxoops Date: 2013-03-28 12:29:24 +0000 (Thu, 28 Mar 2013) Log Message: ----------- Updated Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/users.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/forms.php Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2013-03-28 11:54:58 UTC (rev 11320) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2013-03-28 12:29:24 UTC (rev 11321) @@ -21,30 +21,30 @@ $adminmenu = array(); $i = 0; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU1; -$adminmenu[$i]['link'] = "admin/index.php"; +$adminmenu[$i]['link'] = 'admin/index.php'; $adminmenu[$i]['icon'] = 'dashboard.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU2; -$adminmenu[$i]['link'] = "admin/modules.php"; +$adminmenu[$i]['link'] = 'admin/modules.php'; $adminmenu[$i]['icon'] = 'addmodule.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU3; -$adminmenu[$i]['link'] = "admin/tables.php"; +$adminmenu[$i]['link'] = 'admin/tables.php'; $adminmenu[$i]['icon'] = 'addtable.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU4; -$adminmenu[$i]['link'] = "admin/fields.php"; +$adminmenu[$i]['link'] = 'admin/fields.php'; $adminmenu[$i]['icon'] = 'editfields.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU5; -$adminmenu[$i]['link'] = "admin/import.php"; +$adminmenu[$i]['link'] = 'admin/import.php'; $adminmenu[$i]['icon'] = 'import.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU6; -$adminmenu[$i]['link'] = "admin/building.php"; +$adminmenu[$i]['link'] = 'admin/building.php'; $adminmenu[$i]['icon'] = 'builder.png'; $i++; -$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU7; +$adminmenu[$i]['title'] = XoopsLocale::ABOUT; $adminmenu[$i]['link'] = 'admin/about.php'; $adminmenu[$i]['icon'] = 'about.png'; unset( $i ); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes.php 2013-03-28 11:54:58 UTC (rev 11320) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes.php 2013-03-28 12:29:24 UTC (rev 11321) @@ -36,4 +36,228 @@ $this->text = $text; } } + + /** + * @param string $module + * @param string $module_name + * @return $this->text + */ + public function classFile($module = null, $module_name = null) + { + $this->text[] = '<?php'; + $this->text[] = TDMCreateCommon::getCommonHeader($module); + return $this->text; + } + + /** + * + * @param string $var + * @param object $data_type + * @param boolean $required + * @param integer $maxlength + * @param string $options + */ + public function classInitVar($key, $data_type = 'INT', $required = false, $maxlength = null, $options = '') + { + $r = $required == true ? ', ' . $required : ''; + $m = ($maxlength != null) ? ', ' . $maxlength : $maxlength; + $o = ($options != '') ? ', ' . $options : $options; + return '$this->initVar(\''.$key.'\', XOBJ_DTYPE_'. $data_type .', null' . $r . $m . $o .');'; + } + + /** + * @param string $caption + * @param string $name + * @param integer $width + * @param integer $byte + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormText($caption, $name, $width = 50, $byte = 255, $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $this->addElement(new XoopsFormText('.$caption.', "'.$name.'", '.$width.', '.$byte.', $obj->getVar(\''.$name.'\'))'.$req.');'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $name + * @param string $value + * @param integer $rows + * @param integer $cols + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormTextArea($caption, $name, $value = '', $rows = 5, $cols = 50, $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $this->addElement(new XoopsFormTextArea('.$caption.', "'.$name.'", $obj->getVar(\''.$value.'\'), '.$rows.', '.$cols.')'.$req.');'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $name + * @param string $value + * @param integer $rows + * @param integer $cols + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormDhtmlTextArea($caption, $name, $value = '', $rows = 10, $cols = 80, $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $editor_configs = array(); + $editor_configs["name"] = \''.$name.'\'; + $editor_configs["value"] = $obj->getVar(\''.$value.'\', \'e\'); + $editor_configs["rows"] = '.$rows.'; + $editor_configs["cols"] = '.$cols.'; + $editor_configs["width"] = "100%"; + $editor_configs["height"] = "400px"; + $editor_configs["editor"] = $xoops->getModuleConfig(\'editor\'); + $form->addElement( new XoopsFormEditor('.$caption.', \''.$name.'\', $editor_configs)'.$req.' );'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $name + * @param string $value + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormCheckBox($caption, $name, $value = '', $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $'.$name.' = $obj->isNew() ? 0 : $obj->getVar(\''.$value.'\'); + $check_'.$name.' = new XoopsFormCheckBox('.$caption.', \''.$name.'\', $'.$name.'); + $check_'.$name.'->addOption(1, \' \'); + $this->addElement($check_'.$name.$req.');'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $name + * @param string $value + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormRadioYN($caption, $name, $value = '', $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $'.$name.' = $obj->isNew() ? 0 : $obj->getVar(\''.$value.'\'); + $form->addElement(new XoopsFormRadioYN('.$caption.', \''.$name.'\', $'.$name.')'.$req.');'.PHP_EOL; + return $this->text; + } + + /** + * @param string $name + * @param string $value + * @return $this->text + */ + public function classXoopsFormHidden($name, $value = '') + { + $this->text[] = '// '.ucfirst($name).' + $this->addElement(new XoopsFormHidden(\''.$name.'\', $obj->getVar(\''.$value.'\')));'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $module + * @param string $table + * @param string $name + * @param string $value + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormUploadImage($caption, $module, $table, $name, $value = '', $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $'.$name.' = $obj->getVar(\''.$value.'\') ? $obj->getVar(\''.$value.'\') : \'blank.gif\'; + $uploadir = \'/uploads/'.$module.'/'.$table.'/'.$name.'\'; + $imgtray = new XoopsFormElementTray(XoopsLocale::A_, \'<br />\'); + $imgpath = sprintf('.$caption.'FORMIMAGE_PATH, $uploadir); + $imageselect = new XoopsFormSelect($imgpath, \''.$name.'\', $'.$name.'); + $image_array = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH.$uploadir ); + foreach( $image_array as $image ) { + $imageselect->addOption("{$image}", $image); + } + $imageselect->setExtra( "onchange=\'showImgSelected(\"image_'.$name.'\", \"'.$name.'\", \"".$uploadir."\", \"\", \"".XOOPS_URL."\")\'" ); + $imgtray->addElement($imageselect); + $imgtray->addElement( new XoopsFormLabel( \'\', "<br /><img src=\'".XOOPS_URL."/".$uploadir."/".$'.$name.'."\' name=\'image_'.$name.'\' id=\'image_'.$name.'\' alt=\'\' />" ) ); + $fileseltray = new XoopsFormElementTray(\'\',\'<br />\'); + $fileseltray->addElement(new XoopsFormFile('.$caption.'FORMUPLOAD , "'.$name.'", $xoops->getModuleConfig(\'maxsize\'))); + $fileseltray->addElement(new XoopsFormLabel(\'\')); + $imgtray->addElement($fileseltray); + $this->addElement($imgtray);'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $name + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormUploadFile($caption, $name, $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $this->addElement(new XoopsFormFile('.$caption.', \''.$name.'\', $xoops->getModuleConfig(\'maxsize\'))'.$req.');'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $name + * @param string $value + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormColorPicker($caption, $name, $value = '', $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $this->addElement(new XoopsFormColorPicker('.$caption.', \''.$name.'\', $obj->getVar(\''.$value.'\'))'.$req.');'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $name + * @param string $value + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormSelectUser($caption, $name, $value = '', $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $this->addElement(new XoopsFormSelectUser('.$caption.', \''.$name.'\', false, $obj->getVar(\''.$value.'\'), 1, false)'.$req.');'.PHP_EOL; + return $this->text; + } + + /** + * @param string $caption + * @param string $name + * @param string $value + * @param boolean $required + * @return $this->text + */ + public function classXoopsFormTextDateSelect($caption, $name, $value = '', $required = false) + { + $req = $required == true ? ', true' : ''; + $this->text[] = '// '.ucfirst($name).' + $this->addElement(new XoopsFormTextDateSelect('.$caption.', \''.$name.'\', $obj->getVar(\''.$value.'\'))'.$req.');'.PHP_EOL; + return $this->text; + } } \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/users.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/users.php 2013-03-28 11:54:58 UTC (rev 11320) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/users.php 2013-03-28 12:29:24 UTC (rev 11321) @@ -232,7 +232,7 @@ $this->text[] = '// Preferences'; $this->text[] = '$i = 0;'; $this->text[] = '$editors = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . \'/class/xoopseditor\');'; - $this->text[] = '$modversion[\'config\'][$i][\'name\'] = \''.strtolower($module_name).'_editor\';'; + $this->text[] = '$modversion[\'config\'][$i][\'name\'] = \'editor\';'; $this->text[] = '$modversion[\'config\'][$i][\'title\'] = '.ucfirst($module_name).'Locale::CONF_EDITOR;'; $this->text[] = '$modversion[\'config\'][$i][\'description\'] = \'\';'; $this->text[] = '$modversion[\'config\'][$i][\'formtype\'] = \'select\';'; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php 2013-03-28 11:54:58 UTC (rev 11320) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php 2013-03-28 12:29:24 UTC (rev 11321) @@ -239,26 +239,10 @@ public function __construct($class) { $this->_class = $class; - } + } /** * - * @param string $var - * @param object $data_type - * @param boolean $required - * @param integer $maxlength - * @param string $options - */ - public function tdmc_initVar($key, $data_type = 'INT', $required = false, $maxlength = null, $options = '') - { - $r = $required == true ? ', ' . $required : ''; - $m = ($maxlength != null) ? ', ' . $maxlength : $maxlength; - $o = ($options != '') ? ', ' . $options : $options; - return '$this->initVar(\''.$key.'\', XOBJ_DTYPE_'. $data_type .', null' . $r . $m . $o .');'; - } - - /** - * * @param string $key * @param mixed $value * @param boolean $not_gpc Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/forms.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/forms.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/forms.php 2013-03-28 12:29:24 UTC (rev 11321) @@ -0,0 +1,56 @@ +<?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.6.0 + * @author Timgno <txm...@gm...> + * @version $Id$ + */ + +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +/** + * Get {@link XoopsThemeForm} for editing a user + * + * @param bool $action + * @return XoopsThemeForm + */ +function tdmcreate_getBuildingForm( $action = false ) +{ + $xoops = Xoops::getInstance(); + + if ($action === false) { + $action = $_SERVER['REQUEST_URI']; + } + + $modules_Handler = $xoops->getModuleHandler('modules'); + $extensions_Handler = $xoops->getModuleHandler('extensions'); + $form = new XoopsSimpleForm(_AM_TDMCREATE_BUILDING_TITLE, 'building', $action, 'post', true); + + $mods_select = new XoopsFormSelect(_AM_TDMCREATE_MODULES, 'mod_name', 'mod_name'); + $mods_select->addOption(0, _AM_TDMCREATE_SELMODDEF); + $mods_select->addOptionArray($modules_Handler->getList()); + $form->addElement($mods_select, false); + + $exts_select = new XoopsFormSelect(_AM_TDMCREATE_EXTENSIONS, 'ext_name', 'ext_name'); + $exts_select->addOption(0, _AM_TDMCREATE_SELEXTDEF); + $exts_select->addOptionArray($extensions_Handler->getList()); + $form->addElement($exts_select, false); + + $form->addElement(new XoopsFormHidden('op', 'build')); + $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + return $form; +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/forms.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property |