From: <txm...@us...> - 2015-06-03 12:38:10
|
Revision: 13080 http://sourceforge.net/p/xoops/svn/13080 Author: txmodxoops Date: 2015-06-03 12:38:08 +0000 (Wed, 03 Jun 2015) Log Message: ----------- Added jquery ui tabs Modified Paths: -------------- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-03 10:51:58 UTC (rev 13079) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/fields.php 2015-06-03 12:38:08 UTC (rev 13080) @@ -8,6 +8,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ + /** * tdmcreatereate module * Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-03 10:51:58 UTC (rev 13079) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/modules.php 2015-06-03 12:38:08 UTC (rev 13080) @@ -17,7 +17,6 @@ * @package tdmcreate * @since 2.5.7 * @author TDM TEAM DEV MODULE - * @version $Id: modules.php 12209 2013-10-23 02:49:09Z beckmi $ * @version $Id: modules.php 13040 2015-04-25 15:12:12Z timgno $ */ defined('XOOPS_ROOT_PATH') or die('Restricted access'); @@ -185,36 +184,38 @@ // $form = new XoopsThemeForm($title, 'moduleform', $action, 'post', true); $form->setExtra('enctype="multipart/form-data"'); + // + $tabTray = new TDMCreateFormTabTray('', 'uniqueid', xoops_getModuleOption('jquery_theme', 'system')); + // + $tab1 = new TDMCreateFormTab(_AM_TDMCREATE_IMPORTANT, 'important'); // - $form->insertBreak('<div class="center"><b>' . _AM_TDMCREATE_MODULE_IMPORTANT . '</b></div>', 'head'); - // $modName = $isNew ? $set['name'] : $this->getVar('mod_name'); $modName = new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, 'mod_name', 50, 255, $modName); $modName->setDescription(_AM_TDMCREATE_MODULE_NAME_DESC); - $form->addElement($modName, true); + $tab1->addElement($modName, true); // $modDirname = $isNew ? $set['dirname'] : $this->getVar('mod_dirname'); $modDirname = new XoopsFormText(_AM_TDMCREATE_MODULE_DIRNAME, 'mod_dirname', 25, 255, $modDirname); $modDirname->setDescription(_AM_TDMCREATE_MODULE_DIRNAME_DESC); - $form->addElement($modDirname, true); + $tab1->addElement($modDirname, true); // $modVersion = $isNew ? $set['version'] : $this->getVar('mod_version'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, 'mod_version', 10, 25, $modVersion), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, 'mod_version', 10, 25, $modVersion), true); // $modSince = $isNew ? $set['since'] : $this->getVar('mod_since'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SINCE, 'mod_since', 10, 25, $modSince), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SINCE, 'mod_since', 10, 25, $modSince), true); // $modMinPhp = $isNew ? $set['min_php'] : $this->getVar('mod_min_php'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_PHP, 'mod_min_php', 10, 25, $modMinPhp), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_PHP, 'mod_min_php', 10, 25, $modMinPhp), true); // $modMinXoops = $isNew ? $set['min_xoops'] : $this->getVar('mod_min_xoops'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_XOOPS, 'mod_min_xoops', 10, 25, $modMinXoops), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_XOOPS, 'mod_min_xoops', 10, 25, $modMinXoops), true); // $modMinAdmin = $isNew ? $set['min_admin'] : $this->getVar('mod_min_admin'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_ADMIN, 'mod_min_admin', 10, 25, $modMinAdmin), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_ADMIN, 'mod_min_admin', 10, 25, $modMinAdmin), true); // $modMinMysql = $isNew ? $set['min_mysql'] : $this->getVar('mod_min_mysql'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_MYSQL, 'mod_min_mysql', 10, 25, $modMinMysql), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MIN_MYSQL, 'mod_min_mysql', 10, 25, $modMinMysql), true); // Name description $editor_configs = array(); $editor_configs['name'] = 'mod_description'; @@ -224,12 +225,15 @@ $editor_configs['width'] = '50%'; $editor_configs['height'] = '100px'; $editor_configs['editor'] = $this->tdmcreate->getConfig('tdmcreate_editor'); - $form->addElement(new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true); + $tab1->addElement(new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true); // Author $modAuthor = $isNew ? $set['author'] : $this->getVar('mod_author'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $modAuthor), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $modAuthor), true); $modLicense = $isNew ? $set['license'] : $this->getVar('mod_license'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $modLicense), true); + $tab1->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $modLicense), true); + $tabTray->addElement($tab1); + // + $tab2 = new TDMCreateFormTab(_AM_TDMCREATE_OPTIONS_CHECK, 'options_check'); // $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />'); // @@ -278,9 +282,12 @@ $check_mod_inroot_copy = new XoopsFormCheckBox(' ', 'mod_inroot_copy', $mod_inroot_copy); $check_mod_inroot_copy->addOption(1, _AM_TDMCREATE_MODULE_INROOT_MODULES_COPY); $options_tray->addElement($check_mod_inroot_copy); + + $tab2->addElement($options_tray); + $tabTray->addElement($tab2); + // + $tab3 = new TDMCreateFormTab(_AM_TDMCREATE_CREATE_IMAGE, 'create_image'); // - $form->addElement($options_tray); - // $modImage = $this->getVar('mod_image'); $modImage = $modImage ? $modImage : $set['image']; // @@ -300,7 +307,7 @@ $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', $this->tdmcreate->getConfig('maxsize'))); $fileseltray->addElement(new XoopsFormLabel('')); $imgtray->addElement($fileseltray); - $form->addElement($imgtray); + $tab3->addElement($imgtray); //---------- START LOGO GENERATOR ----------------- $tables_img = $this->getVar('table_image') ?: 'about.png'; $iconsdir = '/Frameworks/moduleclasses/icons/32'; @@ -324,69 +331,73 @@ $buttonLogoGenerator4 = new XoopsFormButton('', 'button4', _AM_TDMCREATE_MODULE_CREATENEWLOGO, 'button'); $buttonLogoGenerator4->setExtra("onclick='createNewModuleLogo(\"" . TDMC_URL . "\")'"); $createLogoTray->addElement($buttonLogoGenerator4); - // - $form->addElement($createLogoTray); + //$options_tray $form->addElement(); + $tab3->addElement($createLogoTray); + $tabTray->addElement($tab3); + // + $tab4 = new TDMCreateFormTab(_AM_TDMCREATE_NOT_IMPORTANT, 'not_important'); //------------ END LOGO GENERATOR -------------------- // - $form->insertBreak('<div class="center"><b>' . _AM_TDMCREATE_MODULE_NOTIMPORTANT . '</b></div>', 'head'); - // $modAuthorMail = $isNew ? $set['author_mail'] : $this->getVar('mod_author_mail'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $modAuthorMail)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $modAuthorMail)); // $modAuthorWebsiteUrl = $isNew ? $set['author_website_url'] : $this->getVar('mod_author_website_url'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $modAuthorWebsiteUrl)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $modAuthorWebsiteUrl)); // $modAuthorWebsiteName = $isNew ? $set['author_website_name'] : $this->getVar('mod_author_website_name'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $modAuthorWebsiteName)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $modAuthorWebsiteName)); // $modCredits = $isNew ? $set['credits'] : $this->getVar('mod_credits'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, 'mod_credits', 50, 255, $modCredits)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, 'mod_credits', 50, 255, $modCredits)); // $modReleaseInfo = $isNew ? $set['release_info'] : $this->getVar('mod_release_info'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, 'mod_release_info', 50, 255, $modReleaseInfo)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, 'mod_release_info', 50, 255, $modReleaseInfo)); // $modReleaseFile = $isNew ? $set['release_file'] : $this->getVar('mod_release_file'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, 'mod_release_file', 50, 255, $modReleaseFile)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, 'mod_release_file', 50, 255, $modReleaseFile)); // $modManual = $isNew ? $set['manual'] : $this->getVar('mod_manual'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, 'mod_manual', 50, 255, $modManual)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, 'mod_manual', 50, 255, $modManual)); // $modManualFile = $isNew ? $set['manual_file'] : $this->getVar('mod_manual_file'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, 'mod_manual_file', 50, 255, $modManualFile)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, 'mod_manual_file', 50, 255, $modManualFile)); // $modDemoSiteUrl = $isNew ? $set['demo_site_url'] : $this->getVar('mod_demo_site_url'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $modDemoSiteUrl)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $modDemoSiteUrl)); // $modDemoSiteName = $isNew ? $set['demo_site_name'] : $this->getVar('mod_demo_site_name'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $modDemoSiteName)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $modDemoSiteName)); // $modSupportUrl = $isNew ? $set['support_url'] : $this->getVar('mod_support_url'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_URL, 'mod_support_url', 50, 255, $modSupportUrl)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_URL, 'mod_support_url', 50, 255, $modSupportUrl)); // $modSupportName = $isNew ? $set['support_name'] : $this->getVar('mod_support_name'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_NAME, 'mod_support_name', 50, 255, $modSupportName)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUPPORT_NAME, 'mod_support_name', 50, 255, $modSupportName)); // $modWebsiteUrl = $isNew ? $set['website_url'] : $this->getVar('mod_website_url'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $modWebsiteUrl)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $modWebsiteUrl)); // $modWebsiteName = $isNew ? $set['website_name'] : $this->getVar('mod_website_name'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $modWebsiteName)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $modWebsiteName)); // $modRelease = $isNew ? $set['release'] : $this->getVar('mod_release'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, 'mod_release', 50, 255, $modRelease)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, 'mod_release', 50, 255, $modRelease)); // $modStatus = $isNew ? $set['status'] : $this->getVar('mod_status'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, 'mod_status', 50, 255, $modStatus)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, 'mod_status', 50, 255, $modStatus)); // $modDonations = $isNew ? $set['donations'] : $this->getVar('mod_donations'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPAL_BUTTON, 'mod_donations', 50, 255, $modDonations)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPAL_BUTTON, 'mod_donations', 50, 255, $modDonations)); // $modSubversion = $isNew ? $set['subversion'] : $this->getVar('mod_subversion'); - $form->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUBVERSION, 'mod_subversion', 50, 255, $modSubversion)); + $tab4->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SUBVERSION, 'mod_subversion', 50, 255, $modSubversion)); // - $form->addElement(new XoopsFormHidden('op', 'save')); - $form->addElement(new XoopsFormButton(_REQUIRED . ' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit')); - + $buttonTray = new XoopsFormElementTray(_REQUIRED . ' <sup class="red bold">*</sup>', ''); + $buttonTray->addElement(new XoopsFormHidden('op', 'save')); + $buttonTray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $tab4->addElement($buttonTray); + $tabTray->addElement($tab4); + $form->addElement($tabTray); return $form; } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-03 10:51:58 UTC (rev 13079) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/class/tables.php 2015-06-03 12:38:08 UTC (rev 13080) @@ -123,214 +123,223 @@ } $isNew = $this->isNew(); - $table_name = $this->getVar('table_name'); - $table_mid = $this->getVar('table_mid'); + $tableName = $this->getVar('table_name'); + $tableMid = $this->getVar('table_mid'); $title = $isNew ? sprintf(_AM_TDMCREATE_TABLE_NEW) : sprintf(_AM_TDMCREATE_TABLE_EDIT); xoops_load('xoopsformloader'); $form = new XoopsThemeForm($title, 'tableform', $action, 'post', true); $form->setExtra('enctype="multipart/form-data"'); + // + $tabTray = new TDMCreateFormTabTray('', 'uniqueid', xoops_getModuleOption('jquery_theme', 'system')); + // + $tab1 = new TDMCreateFormTab(_AM_TDMCREATE_IMPORTANT, 'important'); // - $modules = $this->tdmcreate->getHandler('modules')->getObjects(null); - $mods_select = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $table_mid); - $mods_select->addOption('', _AM_TDMCREATE_TABLE_MODSELOPT); + $modules = $this->tdmcreate->getHandler('modules')->getObjects(null); + $modulesSelect = new XoopsFormSelect(_AM_TDMCREATE_TABLE_MODULES, 'table_mid', $tableMid); + $modulesSelect->addOption('', _AM_TDMCREATE_TABLE_MODSELOPT); foreach ($modules as $mod) { - //$mods_select->addOptionArray(); - $mods_select->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name')); + //$modulesSelect->addOptionArray(); + $modulesSelect->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name')); } - $form->addElement($mods_select, true); + $tab1->addElement($modulesSelect, true); // - $table_name_field = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, 'table_name', 40, 150, $table_name); - $table_name_field->setDescription(_AM_TDMCREATE_TABLE_NAME_DESC); - $form->addElement($table_name_field, true); + $tableNameText = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, 'table_name', 40, 150, $tableName); + $tableNameText->setDescription(_AM_TDMCREATE_TABLE_NAME_DESC); + $tab1->addElement($tableNameText, true); // - $table_solename_field = new XoopsFormText(_AM_TDMCREATE_TABLE_SOLENAME, 'table_solename', 40, 150, $this->getVar('table_solename')); - $table_solename_field->setDescription(_AM_TDMCREATE_TABLE_SOLENAME_DESC); - $form->addElement($table_solename_field, true); + $tableSoleNameText = new XoopsFormText(_AM_TDMCREATE_TABLE_SOLENAME, 'table_solename', 40, 150, $this->getVar('table_solename')); + $tableSoleNameText->setDescription(_AM_TDMCREATE_TABLE_SOLENAME_DESC); + $tab1->addElement($tableSoleNameText, true); // $tablesHandler =& $this->tdmcreate->getHandler('tables'); $criteria = new CriteriaCompo(new Criteria('table_category', 0), 'AND'); - $criteria->add(new Criteria('table_mid', $table_mid), 'AND'); - $criteria->add(new Criteria('table_name', $table_name)); - $table_category = $tablesHandler->getCount($criteria); + $criteria->add(new Criteria('table_mid', $tableMid), 'AND'); + $criteria->add(new Criteria('table_name', $tableName)); + $tableCategory = $tablesHandler->getCount($criteria); unset($criteria); - //if ( ($table_category == 0) || $isNew ) { - $radio_category = $isNew ? 0 : $this->getVar('table_category'); - $category = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_CATEGORY, 'table_category', $radio_category); + //if ( ($tableCategory == 0) || $isNew ) { + $radioCategory = $isNew ? 0 : $this->getVar('table_category'); + $category = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_CATEGORY, 'table_category', $radioCategory); $category->setDescription(_AM_TDMCREATE_TABLE_CATEGORY_DESC); - $form->addElement($category); + $tab1->addElement($category); //} // - $table_fieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, 'table_fieldname', 30, 50, $this->getVar('table_fieldname')); - $table_fieldname->setDescription(_AM_TDMCREATE_TABLE_FIELDNAME_DESC); - $form->addElement($table_fieldname); + $tableFieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, 'table_fieldname', 30, 50, $this->getVar('table_fieldname')); + $tableFieldname->setDescription(_AM_TDMCREATE_TABLE_FIELDNAME_DESC); + $tab1->addElement($tableFieldname); // - $table_nbfield = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, 'table_nbfields', 10, 25, $this->getVar('table_nbfields')); - $table_nbfield->setDescription(_AM_TDMCREATE_TABLE_NBFIELDS_DESC); - $form->addElement($table_nbfield, true); + $tableNumbFileds = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, 'table_nbfields', 10, 25, $this->getVar('table_nbfields')); + $tableNumbFileds->setDescription(_AM_TDMCREATE_TABLE_NBFIELDS_DESC); + $tab1->addElement($tableNumbFileds, true); // if (!$isNew) { - $table_order = new XoopsFormText(_AM_TDMCREATE_TABLE_ORDER, 'table_order', 5, 10, $this->getVar('table_order')); - $table_order->setDescription(_AM_TDMCREATE_TABLE_ORDER_DESC); - $form->addElement($table_order, true); + $tableOrder = new XoopsFormText(_AM_TDMCREATE_TABLE_ORDER, 'table_order', 5, 10, $this->getVar('table_order')); + $tableOrder->setDescription(_AM_TDMCREATE_TABLE_ORDER_DESC); + $tab1->addElement($tableOrder, true); } // - $get_table_image = $this->getVar('table_image'); - $table_image = $get_table_image ?: 'blank.gif'; - $iconsdir = '/Frameworks/moduleclasses/icons/32'; - $uploads_dir = '/uploads/tdmcreate/images/tables'; - $iconsdirectory = is_dir(XOOPS_ROOT_PATH . $iconsdir) ? $iconsdir : $uploads_dir; + $getTableImage = $this->getVar('table_image'); + $tableImage = $getTableImage ?: 'blank.gif'; + $icons32Directory = '/Frameworks/moduleclasses/icons/32'; + $uploadsDirectory = '/uploads/tdmcreate/images/tables'; + $iconsDirectory = is_dir(XOOPS_ROOT_PATH . $icons32Directory) ? $icons32Directory : $uploadsDirectory; // $imgtray1 = new XoopsFormElementTray(_AM_TDMCREATE_TABLE_IMAGE, '<br />'); - $imgpath1 = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, ".{$iconsdirectory}/"); - $imageselect1 = new XoopsFormSelect($imgpath1, 'table_image', $table_image, 10); - $image_array1 = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $iconsdirectory); - foreach ($image_array1 as $image1) { - $imageselect1->addOption("{$image1}", $image1); + $imgpath1 = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, ".{$iconsDirectory}/"); + $imageSelect1 = new XoopsFormSelect($imgpath1, 'table_image', $tableImage, 10); + $imageArray1 = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $iconsDirectory); + foreach ($imageArray1 as $image1) { + $imageSelect1->addOption("{$image1}", $image1); } - $imageselect1->setExtra("onchange='showImgSelected(\"image1\", \"table_image\", \"" . $iconsdirectory . "\", \"\", \"" . XOOPS_URL . "\")'"); - $imgtray1->addElement($imageselect1, false); - $imgtray1->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $iconsdirectory . "/" . $table_image . "' name='image1' id='image1' alt='' />")); + $imageSelect1->setExtra("onchange='showImgSelected(\"image1\", \"table_image\", \"" . $iconsDirectory . "\", \"\", \"" . XOOPS_URL . "\")'"); + $imgtray1->addElement($imageSelect1, false); + $imgtray1->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $iconsDirectory . "/" . $tableImage . "' name='image1' id='image1' alt='' />")); $fileseltray1 = new XoopsFormElementTray('', '<br />'); $fileseltray1->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD, 'attachedfile', $this->tdmcreate->getConfig('maxsize'))); $fileseltray1->addElement(new XoopsFormLabel('')); $imgtray1->addElement($fileseltray1); $imgtray1->setDescription(_AM_TDMCREATE_TABLE_IMAGE_DESC); - $form->addElement($imgtray1); + $tab1->addElement($imgtray1); // - $table_autoincrement = $this->isNew() ? 1 : $this->getVar('table_autoincrement'); - $check_table_autoincrement = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_AUTO_INCREMENT, 'table_autoincrement', $table_autoincrement); - $check_table_autoincrement->setDescription(_AM_TDMCREATE_TABLE_AUTO_INCREMENT_DESC); - //$check_table_autoincrement->addOption(1, _AM_TDMCREATE_TABLE_AUTO_INCREMENT_OPTION); - $form->addElement($check_table_autoincrement); + $tableAutoincrement = $this->isNew() ? 1 : $this->getVar('table_autoincrement'); + $checkTableAutoincrement = new XoopsFormRadioYN(_AM_TDMCREATE_TABLE_AUTO_INCREMENT, 'table_autoincrement', $tableAutoincrement); + $checkTableAutoincrement->setDescription(_AM_TDMCREATE_TABLE_AUTO_INCREMENT_DESC); + $tab1->addElement($checkTableAutoincrement); + $tabTray->addElement($tab1); + // + $tab2 = new TDMCreateFormTab(_AM_TDMCREATE_OPTIONS_CHECK, 'options_check'); // - $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />'); + $optionsTray = new XoopsFormElementTray(_OPTIONS, '<br />'); // - $table_checkbox_all = new XoopsFormCheckBox('', "tablebox", 1); - $table_checkbox_all->addOption('allbox', _AM_TDMCREATE_TABLE_ALL); - $table_checkbox_all->setExtra(" onclick='xoopsCheckAll(\"tableform\", \"tablebox\");' "); - $table_checkbox_all->setClass('xo-checkall'); - $options_tray->addElement($table_checkbox_all); + $tableCheckAll = new XoopsFormCheckBox('', "tablebox", 1); + $tableCheckAll->addOption('allbox', _AM_TDMCREATE_TABLE_ALL); + $tableCheckAll->setExtra(" onclick='xoopsCheckAll(\"tableform\", \"tablebox\");' "); + $tableCheckAll->setClass('xo-checkall'); + $optionsTray->addElement($tableCheckAll); // - $table_index = $isNew ? 0 : $this->getVar('table_index'); - $check_table_index = new XoopsFormCheckBox(' ', 'table_index', $table_index); - $check_table_index->addOption(1, _AM_TDMCREATE_TABLE_INDEX); - $options_tray->addElement($check_table_index); + $tableIndex = $isNew ? 0 : $this->getVar('table_index'); + $checkTableIndex = new XoopsFormCheckBox(' ', 'table_index', $tableIndex); + $checkTableIndex->addOption(1, _AM_TDMCREATE_TABLE_INDEX); + $optionsTray->addElement($checkTableIndex); // - $table_blocks = $isNew ? 0 : $this->getVar('table_blocks'); - $check_table_blocks = new XoopsFormCheckBox(' ', 'table_blocks', $table_blocks); - $check_table_blocks->addOption(1, _AM_TDMCREATE_TABLE_BLOCKS); - $options_tray->addElement($check_table_blocks); + $tableBlocks = $isNew ? 0 : $this->getVar('table_blocks'); + $checkTableBlocks = new XoopsFormCheckBox(' ', 'table_blocks', $tableBlocks); + $checkTableBlocks->addOption(1, _AM_TDMCREATE_TABLE_BLOCKS); + $optionsTray->addElement($checkTableBlocks); // - $table_admin = $isNew ? 0 : $this->getVar('table_admin'); - $check_table_admin = new XoopsFormCheckBox(' ', 'table_admin', $table_admin); - $check_table_admin->addOption(1, _AM_TDMCREATE_TABLE_ADMIN); - $options_tray->addElement($check_table_admin); + $tableAdmin = $isNew ? 0 : $this->getVar('table_admin'); + $checkTableAdmin = new XoopsFormCheckBox(' ', 'table_admin', $tableAdmin); + $checkTableAdmin->addOption(1, _AM_TDMCREATE_TABLE_ADMIN); + $optionsTray->addElement($checkTableAdmin); // $table_user = $isNew ? 0 : $this->getVar('table_user'); - $check_table_user = new XoopsFormCheckBox(' ', 'table_user', $table_user); - $check_table_user->addOption(1, _AM_TDMCREATE_TABLE_USER); - $options_tray->addElement($check_table_user); + $checkTableUser = new XoopsFormCheckBox(' ', 'table_user', $table_user); + $checkTableUser->addOption(1, _AM_TDMCREATE_TABLE_USER); + $optionsTray->addElement($checkTableUser); // - $table_submenu = $isNew ? 0 : $this->getVar('table_submenu'); - $check_table_submenu = new XoopsFormCheckBox(' ', 'table_submenu', $table_submenu); - $check_table_submenu->addOption(1, _AM_TDMCREATE_TABLE_SUBMENU); - $options_tray->addElement($check_table_submenu); + $tableSubmenu = $isNew ? 0 : $this->getVar('table_submenu'); + $checkTableSubmenu = new XoopsFormCheckBox(' ', 'table_submenu', $tableSubmenu); + $checkTableSubmenu->addOption(1, _AM_TDMCREATE_TABLE_SUBMENU); + $optionsTray->addElement($checkTableSubmenu); // - $table_submit = $isNew ? 0 : $this->getVar('table_submit'); - $check_table_submit = new XoopsFormCheckBox(' ', 'table_submit', $table_submit); - $check_table_submit->addOption(1, _AM_TDMCREATE_TABLE_SUBMIT); - $options_tray->addElement($check_table_submit); + $tableSubmit = $isNew ? 0 : $this->getVar('table_submit'); + $checkTableSubmit = new XoopsFormCheckBox(' ', 'table_submit', $tableSubmit); + $checkTableSubmit->addOption(1, _AM_TDMCREATE_TABLE_SUBMIT); + $optionsTray->addElement($checkTableSubmit); // - $table_tag = $isNew ? 0 : $this->getVar('table_tag'); - $check_table_tag = new XoopsFormCheckBox(' ', 'table_tag', $table_tag); - $check_table_tag->addOption(1, _AM_TDMCREATE_TABLE_TAG); - $options_tray->addElement($check_table_tag); + $tableTag = $isNew ? 0 : $this->getVar('table_tag'); + $checkTableTag = new XoopsFormCheckBox(' ', 'table_tag', $tableTag); + $checkTableTag->addOption(1, _AM_TDMCREATE_TABLE_TAG); + $optionsTray->addElement($checkTableTag); // - $table_broken = $isNew ? 0 : $this->getVar('table_broken'); - $check_table_broken = new XoopsFormCheckBox(' ', 'table_broken', $table_broken); - $check_table_broken->addOption(1, _AM_TDMCREATE_TABLE_BROKEN); - $options_tray->addElement($check_table_broken); + $tableBroken = $isNew ? 0 : $this->getVar('table_broken'); + $checkTableBroken = new XoopsFormCheckBox(' ', 'table_broken', $tableBroken); + $checkTableBroken->addOption(1, _AM_TDMCREATE_TABLE_BROKEN); + $optionsTray->addElement($checkTableBroken); // $criteria = new CriteriaCompo(new Criteria('table_search', ($isNew ? 0 : 1)), 'AND'); - $criteria->add(new Criteria('table_mid', $table_mid), 'AND'); - $criteria->add(new Criteria('table_name', $table_name)); - $table_comments = $tablesHandler->getCount($criteria); + $criteria->add(new Criteria('table_mid', $tableMid), 'AND'); + $criteria->add(new Criteria('table_name', $tableName)); + $tableComments = $tablesHandler->getCount($criteria); unset($criteria); - //if( ($table_comments == 0) || $isNew ) { - $table_search = $isNew ? 0 : $this->getVar('table_search'); - $check_table_search = new XoopsFormCheckBox(' ', 'table_search', $table_search); - $check_table_search->addOption(1, _AM_TDMCREATE_TABLE_SEARCH); - $options_tray->addElement($check_table_search); + //if( ($tableComments == 0) || $isNew ) { + $tableSearch = $isNew ? 0 : $this->getVar('table_search'); + $checkTableSearch = new XoopsFormCheckBox(' ', 'table_search', $tableSearch); + $checkTableSearch->addOption(1, _AM_TDMCREATE_TABLE_SEARCH); + $optionsTray->addElement($checkTableSearch); //} // $criteria = new CriteriaCompo(new Criteria('table_comments', ($isNew ? 0 : 1)), 'AND'); - $criteria->add(new Criteria('table_mid', $table_mid), 'AND'); - $criteria->add(new Criteria('table_name', $table_name)); - $table_comments = $tablesHandler->getCount($criteria); + $criteria->add(new Criteria('table_mid', $tableMid), 'AND'); + $criteria->add(new Criteria('table_name', $tableName)); + $tableComments = $tablesHandler->getCount($criteria); unset($criteria); - //if ( ($table_comments == 0) || $isNew ) { - $table_comments = $isNew ? 0 : $this->getVar('table_comments'); - $check_table_comments = new XoopsFormCheckBox(' ', 'table_comments', $table_comments); - $check_table_comments->addOption(1, _AM_TDMCREATE_TABLE_COMMENTS); - $options_tray->addElement($check_table_comments); + //if ( ($tableComments == 0) || $isNew ) { + $tableComments = $isNew ? 0 : $this->getVar('table_comments'); + $checkTableComments = new XoopsFormCheckBox(' ', 'table_comments', $tableComments); + $checkTableComments->addOption(1, _AM_TDMCREATE_TABLE_COMMENTS); + $optionsTray->addElement($checkTableComments); //} // - $table_notifications = $isNew ? 0 : $this->getVar('table_notifications'); - $check_table_notifications = new XoopsFormCheckBox(' ', 'table_notifications', $table_notifications); - $check_table_notifications->addOption(1, _AM_TDMCREATE_TABLE_NOTIFICATIONS); - $options_tray->addElement($check_table_notifications); + $tableNotifications = $isNew ? 0 : $this->getVar('table_notifications'); + $checkTableNotifications = new XoopsFormCheckBox(' ', 'table_notifications', $tableNotifications); + $checkTableNotifications->addOption(1, _AM_TDMCREATE_TABLE_NOTIFICATIONS); + $optionsTray->addElement($checkTableNotifications); // $criteria = new CriteriaCompo(new Criteria('table_permissions', ($isNew ? 0 : 1)), 'AND'); - $criteria->add(new Criteria('table_mid', $table_mid), 'AND'); - $criteria->add(new Criteria('table_name', $table_name)); - $table_permissions = $tablesHandler->getCount($criteria); + $criteria->add(new Criteria('table_mid', $tableMid), 'AND'); + $criteria->add(new Criteria('table_name', $tableName)); + $tablePermissions = $tablesHandler->getCount($criteria); unset($criteria); - //if ( ($table_permissions == 0) && ($table_category == 0) || $isNew ) { - $table_permissions = $isNew ? 0 : $this->getVar('table_permissions'); - $check_table_permissions = new XoopsFormCheckBox(' ', 'table_permissions', $table_permissions); - $check_table_permissions->addOption(1, _AM_TDMCREATE_TABLE_PERMISSIONS); - $options_tray->addElement($check_table_permissions); + //if ( ($tablePermissions == 0) && ($tableCategory == 0) || $isNew ) { + $tablePermissions = $isNew ? 0 : $this->getVar('table_permissions'); + $checkTablePermissions = new XoopsFormCheckBox(' ', 'table_permissions', $tablePermissions); + $checkTablePermissions->addOption(1, _AM_TDMCREATE_TABLE_PERMISSIONS); + $optionsTray->addElement($checkTablePermissions); //} // - $table_rate = $isNew ? 0 : $this->getVar('table_rate'); - $check_table_rate = new XoopsFormCheckBox(' ', 'table_rate', $table_rate); - $check_table_rate->addOption(1, _AM_TDMCREATE_TABLE_RATE); - $options_tray->addElement($check_table_rate); + $tableRate = $isNew ? 0 : $this->getVar('table_rate'); + $checkTableRate = new XoopsFormCheckBox(' ', 'table_rate', $tableRate); + $checkTableRate->addOption(1, _AM_TDMCREATE_TABLE_RATE); + $optionsTray->addElement($checkTableRate); // - $table_print = $isNew ? 0 : $this->getVar('table_print'); - $check_table_print = new XoopsFormCheckBox(' ', 'table_print', $table_print); - $check_table_print->addOption(1, _AM_TDMCREATE_TABLE_PRINT); - $options_tray->addElement($check_table_print); + $tablePrint = $isNew ? 0 : $this->getVar('table_print'); + $checkTablePrint = new XoopsFormCheckBox(' ', 'table_print', $tablePrint); + $checkTablePrint->addOption(1, _AM_TDMCREATE_TABLE_PRINT); + $optionsTray->addElement($checkTablePrint); // - $table_pdf = $isNew ? 0 : $this->getVar('table_pdf'); - $check_table_pdf = new XoopsFormCheckBox(' ', 'table_pdf', $table_pdf); - $check_table_pdf->addOption(1, _AM_TDMCREATE_TABLE_PDF); - $options_tray->addElement($check_table_pdf); + $tablePdf = $isNew ? 0 : $this->getVar('table_pdf'); + $checkTablePdf = new XoopsFormCheckBox(' ', 'table_pdf', $tablePdf); + $checkTablePdf->addOption(1, _AM_TDMCREATE_TABLE_PDF); + $optionsTray->addElement($checkTablePdf); // - $table_rss = $isNew ? 0 : $this->getVar('table_rss'); - $check_table_rss = new XoopsFormCheckBox(' ', 'table_rss', $table_rss); - $check_table_rss->addOption(1, _AM_TDMCREATE_TABLE_RSS); - $options_tray->addElement($check_table_rss); + $tableRss = $isNew ? 0 : $this->getVar('table_rss'); + $checkTableRss = new XoopsFormCheckBox(' ', 'table_rss', $tableRss); + $checkTableRss->addOption(1, _AM_TDMCREATE_TABLE_RSS); + $optionsTray->addElement($checkTableRss); // - $table_single = $isNew ? 0 : $this->getVar('table_single'); - $check_table_single = new XoopsFormCheckBox(' ', 'table_single', $table_single); - $check_table_single->addOption(1, _AM_TDMCREATE_TABLE_SINGLE); - $options_tray->addElement($check_table_single); + $tableSingle = $isNew ? 0 : $this->getVar('table_single'); + $checkTableSingle = new XoopsFormCheckBox(' ', 'table_single', $tableSingle); + $checkTableSingle->addOption(1, _AM_TDMCREATE_TABLE_SINGLE); + $optionsTray->addElement($checkTableSingle); // - $table_visit = $isNew ? 0 : $this->getVar('table_visit'); - $check_table_visit = new XoopsFormCheckBox(' ', 'table_visit', $table_visit); - $check_table_visit->addOption(1, _AM_TDMCREATE_TABLE_VISIT); - $options_tray->addElement($check_table_visit); + $tableVisit = $isNew ? 0 : $this->getVar('table_visit'); + $checkTableVisit = new XoopsFormCheckBox(' ', 'table_visit', $tableVisit); + $checkTableVisit->addOption(1, _AM_TDMCREATE_TABLE_VISIT); + $optionsTray->addElement($checkTableVisit); // - $options_tray->setDescription(_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC); + $optionsTray->setDescription(_AM_TDMCREATE_TABLE_OPTIONS_CHECKS_DESC); // - $form->addElement($options_tray); + $tab2->addElement($optionsTray); // - $form->addElement(new XoopsFormHidden('op', 'save')); - $form->addElement(new XoopsFormHidden('table_id', ($isNew ? 0 : $this->getVar('table_id')))); - $form->addElement(new XoopsFormButton(_REQUIRED . ' <sup class="red bold">*</sup>', 'submit', _SUBMIT, 'submit')); - + $buttonTray = new XoopsFormElementTray(_REQUIRED . ' <sup class="red bold">*</sup>', ''); + $buttonTray->addElement(new XoopsFormHidden('op', 'save')); + $buttonTray->addElement(new XoopsFormHidden('table_id', ($isNew ? 0 : $this->getVar('table_id')))); + $buttonTray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $tab2->addElement($buttonTray); + $tabTray->addElement($tab2); + $form->addElement($tabTray); return $form; } Modified: XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-03 10:51:58 UTC (rev 13079) +++ XoopsModules/TDMCreate/branches/timgno/1.91a3/tdmcreate/language/english/admin.php 2015-06-03 12:38:08 UTC (rev 13080) @@ -369,4 +369,5 @@ define('_AM_TDMCREATE_ABOUT_MAKE_DONATION', "Make a Donation to support this module"); define('_AM_TDMCREATE_IMPORTANT', "Main Settings"); define('_AM_TDMCREATE_OPTIONS_CHECK', "Options Settings"); +define('_AM_TDMCREATE_CREATE_IMAGE', "Create Image Logo"); define('_AM_TDMCREATE_NOT_IMPORTANT', "Secondary Settings"); \ No newline at end of file |