From: <txm...@us...> - 2012-12-29 09:39:18
|
Revision: 10600 http://sourceforge.net/p/xoops/svn/10600 Author: txmodxoops Date: 2012-12-29 09:39:14 +0000 (Sat, 29 Dec 2012) Log Message: ----------- Updated Added more files Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/modinfo.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2012-12-29 02:36:38 UTC (rev 10599) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2012-12-29 09:39:14 UTC (rev 10600) @@ -20,11 +20,124 @@ * @version $Id: extensions.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; +// Get main instance +$system = System::getInstance(); +$xoops = Xoops::getInstance(); // Get Action type -//$op = $system->cleanVars($_REQUEST, 'op', 'default', 'string'); -$adminModule->renderNavigation('extensions.php'); -/*switch ($op) +$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +// heaser +$xoops->header(); +// Get handler +/* @var $extensions_handler TDMCreateExtensionsHandler */ +$extensions_Handler = $xoops->getModuleHandler('extensions'); + +$admin_page = new XoopsModuleAdmin(); +$admin_page->renderNavigation('extensions.php'); +switch ($op) { + case "list": + default: + $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); + $admin_page->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("module_id ASC, module_name"); + $criteria->setOrder("ASC"); + $numrows = $modules_Handler->getCount(); + if (isset($_REQUEST['limit'])) { + $criteria->setLimit($_REQUEST['limit']); + $limit = $_REQUEST['limit']; + } else { + $criteria->setLimit($GLOBALS['xoopsModuleConfig']['adminperpage']); + $limit = $GLOBALS['xoopsModuleConfig']['adminperpage']; + } + if (isset($_REQUEST['start'])) { + $criteria->setStart($_REQUEST['start']); + $start = $_REQUEST['start']; + } else { + $criteria->setStart(0); + $start = 0; + } + $mods_arr = $modules_Handler->getall($criteria); + if ( $numrows > $limit ) { + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit); + $pagenav = $pagenav->renderNav(4); + } else { + $pagenav = ''; + } + //Display modules list + if ($numrows>0) + { + $yes = "<img src='../images/16/green.png' alt='"._YES."' title='"._YES."' />"; + $no = "<img src='../images/16/red.png' alt='"._NO."' title='"._NO."' />"; + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th class='center'>"._AM_TDMCREATE_MODULE_ID."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_NAME."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_VERSION."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_IMAGE."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_RELEASE."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_STATUS."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST."</th> + <th class='center' width='5%'>"._AM_TDMCREATE_FORMACTION."</th> + </tr>"; + $class = "odd"; + foreach (array_keys($mods_arr) as $i) + { + echo "<tr class='".$class."'>"; + $class = ($class == "even") ? "odd" : "even"; + echo "<td class='center'>".$i."</td>"; + echo "<td class='center'>".$mods_arr[$i]->getVar("module_name")."</td>"; + echo "<td class='center'>".$mods_arr[$i]->getVar("module_version")."</td>"; + echo "<td class='center'><img src='".TDMC_UPLOAD_URL."/images/modules/".$mods_arr[$i]->getVar("module_image")."' height='30px' title='module_image' alt='module_image'></td>"; + echo "<td class='center'>".$mods_arr[$i]->getVar("module_release")."</td>"; + echo "<td class='center'>".$mods_arr[$i]->getVar("module_status")."</td>"; + + $verif_module_display_admin = ( $mods_arr[$i]->getVar("module_display_admin") == 1 ) ? $yes : $no; + echo "<td class='center'>".$verif_module_display_admin."</td>"; + $verif_module_display_user = ( $mods_arr[$i]->getVar("module_display_user") == 1 ) ? $yes : $no; + echo "<td class='center'>".$verif_module_display_user."</td>"; + $verif_module_display_submenu = ( $mods_arr[$i]->getVar("module_display_submenu") == 1 ) ? $yes : $no; + echo "<td class='center'>".$verif_module_display_submenu."</td>"; + $verif_module_active_search = ( $mods_arr[$i]->getVar("module_active_search") == 1 ) ? $yes : $no; + echo "<td class='center'>".$verif_module_active_search."</td>"; + $verif_module_active_coms = ( $mods_arr[$i]->getVar("module_active_comments") == 1 ) ? $yes : $no; + echo "<td class='center'>".$verif_module_active_coms."</td>"; + $verif_module_active_notify = ( $mods_arr[$i]->getVar("module_active_notifies") == 1 ) ? $yes : $no; + echo "<td class='center'>".$verif_module_active_notify."</td>"; + + echo "<td class='center' width='5%'> + <a href='modules.php?op=edit_module&module_id=".$i."'><img src='".$pathIcon16."/edit.png' alt='"._EDIT."' title='"._EDIT."'></a> + <a href='modules.php?op=delete_module&module_id=".$i."'><img src='".$pathIcon16."/delete.png' alt='"._DELETE."' title='"._DELETE."'></a> + </td>"; + echo "</tr>"; + } + echo "</table><br><br>"; + echo "<div class='center'>".$pagenav."</div>"; + } else { + echo "<table width='100%' cellspacing='1' class='outer'> + <tr> + <th class='center'>"._AM_TDMCREATE_MODULE_NAME."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_VERSION."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_IMAGE."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_RELEASE."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_STATUS."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST."</th> + <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST."</th> + <th class='center' width='5%'>"._AM_TDMCREATE_FORMACTION."</th> + </tr><tr><td class='errorMsg' colspan='12'>No Modules</td></tr>"; + echo "</table><br><br>"; + } + break; case "new": $obj =& $extensions_Handler->create(); $form = $obj->getExtensionsForm(); @@ -32,8 +145,8 @@ break; case "save": - if ( !$GLOBALS["xoopsSecurity"]->check() ) { - redirect_header("fields.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + if (!$xoops->security()->check()) { + $xoops->redirect('extensions.php', 3, implode(',', $xoops->security()->getErrors())); } if (isset($_REQUEST["field_id"])) { $obj =& $extensions_Handler->get($_REQUEST["field_id"]); @@ -69,5 +182,32 @@ $form = $obj->getForm(); $form->display(); break; -}*/ + + case "delete": + $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); + $admin_page->addItemButton(_AM_TDMCREATE_EXTENSION_LIST, 'extensions.php', 'application-view-detail'); + $admin_page->renderButton(); + $id = $system->cleanVars($_REQUEST, 'id', 0, 'int'); + if ($id > 0) { + $obj = $extensions_Handler->get($id); + if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + if (!$xoops->security()->check()) { + $xoops->redirect("extensions.php", 3, implode(",", $xoops->security()->getErrors())); + } + if ($extensions_Handler->deleteFields($obj)) { + $xoops->redirect("extensions.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_CATEGORY)); + } else { + $xoops->error($obj->getHtmlErrors()); + } + } else { + // Define Stylesheet + $xoops->theme()->addStylesheet('modules/system/css/admin.css'); + $xoops->tpl()->assign('form', false); + $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'extensions.php', sprintf(_PROFILE_AM_RUSUREDEL, $obj->getVar('field_title')) . '<br />'); + } + } else { + $xoops->redirect('extensions.php', 1, _AM_SYSTEM_DBERROR); + } + break; +} $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2012-12-29 02:36:38 UTC (rev 10599) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2012-12-29 09:39:14 UTC (rev 10600) @@ -21,15 +21,5 @@ */ require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; // Get XoopsLoad -XoopsLoad::load('system', 'system'); -// Get main instance -//$system = System::getInstance(); $xoops = Xoops::getInstance(); -// Get tdmcreate handler -//$modules_Handler = $xoops->getModuleHandler('modules'); -//$tables_Handler = $xoops->getModuleHandler('tables'); -//$fields_Handler = $xoops->getModuleHandler('fields'); -// heaser -$xoops->header(); -// admin menu -$adminModule = new XoopsModuleAdmin(); \ No newline at end of file +XoopsLoad::load('system', 'system'); \ No newline at end of file Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2012-12-29 09:39:14 UTC (rev 10600) @@ -0,0 +1,52 @@ +<?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 TDM Xoops (AKA Developers) + * @version $Id: import.php 10665 2012-12-27 10:14:15Z timgno $ + */ +include dirname(__FILE__) . '/header.php'; +// Get main instance +$system = System::getInstance(); +$xoops = Xoops::getInstance(); +// Get Action type +$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +// heaser +$xoops->header(); +// Get handler +/* @var $import_handler TDMCreateImportHandler */ +$import_Handler = $xoops->getModuleHandler('import'); + +$admin_page = new XoopsModuleAdmin(); +$admin_page->renderNavigation('import.php'); +switch ($op) +{ + case "list": + default: + // Import old modules by sql + break; + + case "save": + break; + + case "edit": + break; + + case "delete": + break; +} +$xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2012-12-29 02:36:38 UTC (rev 10599) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2012-12-29 09:39:14 UTC (rev 10600) @@ -19,7 +19,6 @@ * @author TDM Xoops (AKA Developers) * @version $Id: menu.php 10665 2012-12-27 10:14:15Z timgno $ */ - $adminmenu = array(); $i = 0; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1; @@ -43,10 +42,14 @@ $adminmenu[$i]['icon'] = 'editfields.png'; $i++; $adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6; +$adminmenu[$i]['link'] = "admin/import.php"; +$adminmenu[$i]['icon'] = 'import.png'; +$i++; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU7; $adminmenu[$i]['link'] = "admin/building.php"; $adminmenu[$i]['icon'] = 'builder.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU7; +$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU8; $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/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2012-12-29 02:36:38 UTC (rev 10599) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2012-12-29 09:39:14 UTC (rev 10600) @@ -24,9 +24,16 @@ $system = System::getInstance(); $xoops = Xoops::getInstance(); // Get Action type -//$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); -$adminModule->renderNavigation("modules.php"); -/*switch ($op) +$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +// heaser +$xoops->header(); +// Get handler +/* @var $extensions_handler TDMCreateExtensionsHandler */ +$extensions_Handler = $xoops->getModuleHandler('modules'); + +$admin_page = new XoopsModuleAdmin(); +$admin_page->renderNavigation('modules.php'); +switch ($op) { case "list": default: @@ -133,7 +140,7 @@ break; case "new": - $adminModule->addItemButton(_AM_TDMCREATE_MODULESLIST, 'modules.php?op=list', 'list'); + $adminModule->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list'); $adminModule->renderButton(); $obj =& $modules_Handler->create(); @@ -235,5 +242,5 @@ $xoops->redirect('modules.php', 1, _AM_SYSTEM_DBERROR); } break; -}*/ +} $xoops->footer(); \ No newline at end of file Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php 2012-12-29 09:39:14 UTC (rev 10600) @@ -0,0 +1,76 @@ +<?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 TDM Xoops (AKA Developers) + * @version $Id: extensions.php 10665 2012-12-27 10:14:15Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +class TDMCreateExtensions extends XoopsObject +{ + /** + * Constructor + */ + public function __construct() + { + $this->XoopsObject(); + $this->initVar("ext_id", XOBJ_DTYPE_INT, null, false, 5); + $this->initVar("ext_name",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_name"],false); + $this->initVar("ext_version",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_version"],false); + $this->initVar("ext_description",XOBJ_DTYPE_TXTAREA, $GLOBALS['xoopsModuleConfig']["ext_description"], false); + $this->initVar("ext_author",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_author"], false); + $this->initVar("ext_author_mail",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_author_email"],false); + $this->initVar("ext_author_website_url",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_author_website_url"],false); + $this->initVar("ext_author_website_name",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_author_website"],false); + $this->initVar("ext_credits",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_credits"], false); + $this->initVar("ext_license",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_license"], false); + $this->initVar("ext_release_info",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_release_info"], false); + $this->initVar("ext_release_file",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_release_file"], false); + $this->initVar("ext_manual",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_manual"], false); + $this->initVar("ext_manual_file",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_manual_file"], false); + $this->initVar("ext_image",XOBJ_DTYPE_TXTBOX, null, false); + $this->initVar("ext_demo_site_url",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_demo_site_url"], false); + $this->initVar("ext_demo_site_name",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_demo_site_name"], false); + $this->initVar("ext_forum_site_url",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_forum_site_url"], false); + $this->initVar("ext_forum_site_name",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_forum_site_name"], false); + $this->initVar("ext_website_url",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_website_url"], false); + $this->initVar("ext_website_name",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_website_name"], false); + $this->initVar("ext_release",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_release"], false); + $this->initVar("ext_status",XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_ext_status"], false); + $this->initVar("ext_display_admin",XOBJ_DTYPE_INT,$GLOBALS['xoopsModuleConfig']["ext_display_admin"], false, 1); + $this->initVar("ext_display_user",XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']["ext_display_user"], false, 1); + $this->initVar("ext_display_submenu", XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']["ext_display_submenu"], false, 1); + $this->initVar("ext_active_search",XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']["ext_active_search"], false, 1); + $this->initVar("ext_active_comments",XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']["ext_active_comments"], false, 1); + $this->initVar("ext_active_notifies", XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']["ext_active_notifies"], false, 1); + $this->initVar("ext_paypal_button", XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_paypal_button"], false, 20); + $this->initVar("ext_subversion", XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']["ext_subversion"], false, 5); + } +} + +class TDMCreateExtensionsHandler extends XoopsPersistableObjectHandler +{ + /** + * @param null|XoopsDatabase $db + */ + public function __construct(XoopsDatabase $db = null) + { + parent::__construct($db, "tdmcreate_extensions", 'tdmcreateextensions', 'ext_id', 'ext_name'); + } +} +?> \ No newline at end of file Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php 2012-12-29 09:39:14 UTC (rev 10600) @@ -0,0 +1,50 @@ +<?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 TDM Xoops (AKA Developers) + * @version $Id: import.php 10665 2012-12-27 10:14:15Z timgno $ + */ +defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); + +class TDMCreateImport extends XoopsObject +{ + /** + * Constructor + */ + public function __construct() + { + $this->XoopsObject(); + $this->initVar("import_id",XOBJ_DTYPE_INT, null, false, 5); + $this->initVar("import_module",XOBJ_DTYPE_INT, null, false, 5); + $this->initVar("import_name",XOBJ_DTYPE_TXTBOX, null, false, 255); + $this->initVar("import_nbfields",XOBJ_DTYPE_INT, null, false, 5); + $this->initVar("import_fieldname",XOBJ_DTYPE_TXTBOX, null, false, 255); + } +} + +class TDMCreateImportHandler extends XoopsPersistableObjectHandler +{ + /** + * @param null|XoopsDatabase $db + */ + public function __construct(XoopsDatabase $db = null) + { + parent::__construct($db, "tdmcreate_import", 'tdmcreateimport', 'import_id', 'import_name'); + } +} +?> \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/modinfo.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/modinfo.php 2012-12-29 02:36:38 UTC (rev 10599) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/modinfo.php 2012-12-29 09:39:14 UTC (rev 10600) @@ -27,8 +27,9 @@ define("_MI_TDMCREATE_ADMENU3", "Extensions"); define("_MI_TDMCREATE_ADMENU4", "Tables"); define("_MI_TDMCREATE_ADMENU5", "Fields"); -define("_MI_TDMCREATE_ADMENU6", "Building"); -define("_MI_TDMCREATE_ADMENU7", "Information"); +define("_MI_TDMCREATE_ADMENU6", "Import"); +define("_MI_TDMCREATE_ADMENU7", "Building"); +define("_MI_TDMCREATE_ADMENU8", "Information"); // 1.37 define("_MI_TDMCREATE_PREFERENCE_EDITOR", "Editor"); define("_MI_TDMCREATE_PREFERENCE_EDITOR_DESC", "Select an editor to write"); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql 2012-12-29 02:36:38 UTC (rev 10599) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql 2012-12-29 09:39:14 UTC (rev 10600) @@ -9,41 +9,81 @@ # CREATE TABLE `tdmcreate_modules` ( -`module_id` int (8) unsigned NOT NULL auto_increment, -`module_name` varchar (255) NOT NULL default '', -`module_version` char (5) NOT NULL default '1.00', -`module_description` text NOT NULL , -`module_author` varchar (100) NOT NULL default '', -`module_author_mail` varchar (200) NOT NULL default '', -`module_author_website_url` varchar (255) NOT NULL default 'http://', -`module_author_website_name` varchar (255) NOT NULL default '', -`module_credits` varchar (255) NOT NULL default '', -`module_license` varchar (100) NOT NULL default '', -`module_release_info` varchar (100) NOT NULL default '', -`module_release_file` varchar (100) NOT NULL default '', -`module_manual` varchar (255) NOT NULL default '', -`module_manual_file` varchar (255) NOT NULL default '', -`module_image` varchar (50) NOT NULL default '', -`module_demo_site_url` varchar (255) NOT NULL default 'http://', -`module_demo_site_name` varchar (255) NOT NULL default '', -`module_forum_site_url` varchar (255) NOT NULL default 'http://', -`module_forum_site_name` varchar (255) NOT NULL default '', -`module_website_url` varchar (255) NOT NULL default 'http://', -`module_website_name` varchar (255) NOT NULL default '', -`module_release` varchar (11) NOT NULL default '', -`module_status` varchar (100) NOT NULL default '', -`module_display_admin` tinyint (1) unsigned NOT NULL default '0', -`module_display_user` tinyint (1) unsigned NOT NULL default '0', -`module_display_submenu` tinyint (1) unsigned NOT NULL default '0', -`module_active_search` tinyint (1) unsigned NOT NULL default '0', -`module_active_comments` tinyint (1) unsigned NOT NULL default '0', -`module_active_notifies` tinyint (1) unsigned NOT NULL default '0', -`module_paypal_button` varchar (20) NOT NULL default 'YDRUY5QZQHAHS', -`module_subversion` varchar (10) NOT NULL default '000000', -PRIMARY KEY (`module_id`), -KEY `module_name` (`module_name`(40)) +`mod_id` int (8) unsigned NOT NULL auto_increment, +`mod_name` varchar (255) NOT NULL default '', +`mod_version` char (5) NOT NULL default '1.00', +`mod_description` text NOT NULL , +`mod_author` varchar (100) NOT NULL default '', +`mod_author_mail` varchar (200) NOT NULL default '', +`mod_author_website_url` varchar (255) NOT NULL default 'http://', +`mod_author_website_name` varchar (255) NOT NULL default '', +`mod_credits` varchar (255) NOT NULL default '', +`mod_license` varchar (100) NOT NULL default '', +`mod_release_info` varchar (100) NOT NULL default '', +`mod_release_file` varchar (100) NOT NULL default '', +`mod_manual` varchar (255) NOT NULL default '', +`mod_manual_file` varchar (255) NOT NULL default '', +`mod_image` varchar (50) NOT NULL default '', +`mod_demo_site_url` varchar (255) NOT NULL default 'http://', +`mod_demo_site_name` varchar (255) NOT NULL default '', +`mod_forum_site_url` varchar (255) NOT NULL default 'http://', +`mod_forum_site_name` varchar (255) NOT NULL default '', +`mod_website_url` varchar (255) NOT NULL default 'http://', +`mod_website_name` varchar (255) NOT NULL default '', +`mod_release` varchar (11) NOT NULL default '', +`mod_status` varchar (100) NOT NULL default '', +`mod_display_admin` tinyint (1) unsigned NOT NULL default '0', +`mod_display_user` tinyint (1) unsigned NOT NULL default '0', +`mod_display_submenu` tinyint (1) unsigned NOT NULL default '0', +`mod_active_search` tinyint (1) unsigned NOT NULL default '0', +`mod_active_comments` tinyint (1) unsigned NOT NULL default '0', +`mod_active_notifies` tinyint (1) unsigned NOT NULL default '0', +`mod_paypal_button` varchar (20) NOT NULL default 'YDRUY5QZQHAHS', +`mod_subversion` varchar (10) NOT NULL default '000000', +PRIMARY KEY (`mod_id`), +KEY `mod_name` (`mod_name`(40)) ) ENGINE=MyISAM; + +# +# Table structure for table `tdmcreate_extensions` 31 +# +CREATE TABLE `tdmcreate_extensions` ( +`ext_id` int (8) unsigned NOT NULL auto_increment, +`ext_name` varchar (255) NOT NULL default '', +`ext_version` char (5) NOT NULL default '1.00', +`ext_description` text NOT NULL , +`ext_author` varchar (100) NOT NULL default '', +`ext_author_mail` varchar (200) NOT NULL default '', +`ext_author_website_url` varchar (255) NOT NULL default 'http://', +`ext_author_website_name` varchar (255) NOT NULL default '', +`ext_credits` varchar (255) NOT NULL default '', +`ext_license` varchar (100) NOT NULL default '', +`ext_release_info` varchar (100) NOT NULL default '', +`ext_release_file` varchar (100) NOT NULL default '', +`ext_manual` varchar (255) NOT NULL default '', +`ext_manual_file` varchar (255) NOT NULL default '', +`ext_image` varchar (50) NOT NULL default '', +`ext_demo_site_url` varchar (255) NOT NULL default 'http://', +`ext_demo_site_name` varchar (255) NOT NULL default '', +`ext_forum_site_url` varchar (255) NOT NULL default 'http://', +`ext_forum_site_name` varchar (255) NOT NULL default '', +`ext_website_url` varchar (255) NOT NULL default 'http://', +`ext_website_name` varchar (255) NOT NULL default '', +`ext_release` varchar (11) NOT NULL default '', +`ext_status` varchar (100) NOT NULL default '', +`ext_display_admin` tinyint (1) unsigned NOT NULL default '0', +`ext_display_user` tinyint (1) unsigned NOT NULL default '0', +`ext_display_submenu` tinyint (1) unsigned NOT NULL default '0', +`ext_active_search` tinyint (1) unsigned NOT NULL default '0', +`ext_active_comments` tinyint (1) unsigned NOT NULL default '0', +`ext_active_notifies` tinyint (1) unsigned NOT NULL default '0', +`ext_paypal_button` varchar (20) NOT NULL default 'YDRUY5QZQHAHS', +`ext_subversion` varchar (10) NOT NULL default '000000', +PRIMARY KEY (`ext_id`), +KEY `ext_name` (`ext_name`(40)) +) ENGINE=MyISAM; + # # Table structure for table `tdmcreate_tables` 13 # @@ -93,6 +133,21 @@ ) ENGINE=MyISAM; # +# Table structure for table `tdmcreate_import` 5 +# + +CREATE TABLE `tdmcreate_import` ( +`import_id` int (8) unsigned NOT NULL auto_increment, +`import_module` int (5) unsigned NOT NULL default '0', +`import_name` varchar (255) NOT NULL default '', +`import_nbfields` int (5) unsigned NOT NULL default '0', +`import_fieldname` varchar (50) NOT NULL default '', +PRIMARY KEY (`import_id`), +KEY `import_module` (`import_module`), +KEY `import_name` (`import_name`(40)) +) ENGINE=MyISAM; + +# # Table structure for table `tdmcreate_fieldtype` 2 # |
From: <txm...@us...> - 2013-01-09 17:43:17
|
Revision: 10720 http://sourceforge.net/p/xoops/svn/10720 Author: txmodxoops Date: 2013-01-09 17:43:10 +0000 (Wed, 09 Jan 2013) Log Message: ----------- Updated Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/modinfo.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-01-09 06:24:03 UTC (rev 10719) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-01-09 17:43:10 UTC (rev 10720) @@ -26,206 +26,27 @@ // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); // heaser -$xoops->header(); +$xoops->header('tdmcreate_building.html'); // Get handler +/* @var $modules_handler TDMCreateModulesHandler */ +$modules_Handler = $xoops->getModuleHandler('modules'); /* @var $extensions_handler TDMCreateExtensionsHandler */ +$extensions_Handler = $xoops->getModuleHandler('extensions'); +/* @var $tables_handler TDMCreateExtensionsHandler */ $tables_Handler = $xoops->getModuleHandler('tables'); $admin_page = new XoopsModuleAdmin(); $admin_page->renderNavigation('building.php'); -/*switch ($op) { - case "creation": - $mods =& $modulesHandler->get($_REQUEST['module_name']); - $mods_name = $mods->getVar('module_name'); - //$mods_fname = $mods->getVar('module_fname'); - $mods_desc = $mods->getVar('module_description'); - $mods_a_w_name = $mods->getVar('module_author_website_name'); - $mods_a_w_url = $mods->getVar('module_author_website_url'); - $mods_image = $mods->getVar('module_image'); - $mods_display_admin = $mods->getVar('module_display_admin'); - $mods_display_user = $mods->getVar('module_display_user'); - $mods_display_submenu = $mods->getVar('module_display_submenu'); - //Remove the new module directory if it exists - TDMCreate_clearDir($modPath.'/modules/'.$mods_name); - - //Nom des tables et combien de tables - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('table_module', $_REQUEST['module_name'])); - $nb_tables = $tablesHandler->getCount($criteria); - $tbls_arr = $tablesHandler->getall($criteria); - - //Debut - OpenTable();*/ - /************************************************/ - /*Structure*/ - /************************************************/ - //Creation de l'architecture - /*const_architecture($mods_name, $mods_image); - //Creation du changelog.txt - const_changelog($mods, $mods_name); - - // Files cicles - foreach (array_keys($tbls_arr) as $i) - { - //Variables - $tbls_id = $tbls_arr[$i]->getVar('table_id'); - $tbls_name = $tbls_arr[$i]->getVar('table_name'); - $tbls_module = $tbls_arr[$i]->getVar('table_module'); - $tbls_field = $tbls_arr[$i]->getVar('table_field'); - $tbls_img = $tbls_arr[$i]->getVar('table_img'); - $tbls_nbfields = $tbls_arr[$i]->getVar('table_nbfields'); - $tbls_blocks = $tbls_arr[$i]->getVar('table_blocks'); - $tbls_display_admin = $tbls_arr[$i]->getVar('table_display_admin'); - $tbls_display_user = $tbls_arr[$i]->getVar('table_display_user'); - $tbls_online = $tbls_arr[$i]->getVar('table_online'); - $tbls_submenu = $tbls_arr[$i]->getVar('table_submenu'); - $tbls_search = $tbls_arr[$i]->getVar('table_search'); - $tbls_coms = $tbls_arr[$i]->getVar('table_coms'); - - //Creation of the file mysql.sql - const_sql($mods_name, $tbls_module_table, $tbls_name, $tbls_champs); - $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE table_name = ".$mods_name."'_topic'"); - list( $topic ) = $xoopsDB->fetchRow($result); - - //Fabrication - //Copie of images tables - $tbls_img1 = $modPath."/images/uploads/tables/".$tbls_img; - if (file_exists($tbls_img1)) { - copy($tbls_img1, $modPath."/modules/".$mods_name."/images/deco/".$tbls_img); - } - //Creation des classes - const_class($mods, $mods_name, $tbls_module_table, $tbls_name, $tbls_champs, $tbls_parametres); - - //Creation of pages admin - if ( $mods_display_admin == 1 ) { - const_admin_pages($mods, $mods_name, $tbls_id, $tbls_module_table, $tbls_name, $tbls_img, $tbls_champs, $tbls_parametres, $topic); - } - //Creation of pages and templates user - if ( $mods_display_user == 1 ) { - const_user_pages($mods, $mods_name, $tbls_name, $tbls_champs, $tbls_parametres, $topic); - // Creation of templates pages - const_templates_pages($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); - } - //Creation of search - if ( $tbls_search == 1 ) { - const_include_search($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres, $tbls_img); - } - //Creation of the comments - if ( $tbls_coms == 1 ) { - const_user_comments($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); - } - - //Creation of the blocks - if ( $tbls_blocks != 1 ) { - const_blocks($mods, $mods_name, $tbls_module_table, $tbls_name, $tbls_champs, $tbls_parametres, $topic); - //Creation of template blocks - const_blocks_templates($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); - } - } - //Variables - $tbls_id = $tablesHandler->getVar('table_id'); - $tbls_name = $tablesHandler->getVar('table_name'); - $tbls_module_table = $tablesHandler->getVar('table_module_table'); - $tbls_img = $tablesHandler->getVar('table_img'); - $tbls_champs = $tablesHandler->getVar('table_champ'); - $tbls_parametres = $tablesHandler->getVar('table_parametres'); - $tbls_blocks = $tablesHandler->getVar('table_blocks'); - $tbls_display_admin = $tablesHandler->getVar('table_display_admin'); - $tbls_display_user = $tablesHandler->getVar('table_display_user'); - $tbls_online = $tablesHandler->getVar('table_online'); - $tbls_submenu = $tablesHandler->getVar('table_submenu'); - $tbls_search = $tablesHandler->getVar('table_search'); - $tbls_coms = $tablesHandler->getVar('table_coms'); - //Creation of xoopsversion.php file - //Xoops version set to integrate the end of the block, etc. - const_xoopsversion($mods, $mods_name, $tbls_arr, $tbls_module_table, $tbls_blocks, $tbls_submenu, $tbls_search, $tbls_coms); - if($mods_display_user == 1){ - // Creation of template index - const_templates_index($mods, $mods_name, $tbls_name, $tbls_module_table, $tbls_champs, $tbls_parametres); - // Creation of template header - const_templates_header($mods, $mods_name, $mods_desc); - // Creation of template footer - const_templates_footer($mods, $mods_name, $tbls_module_table); - } - //Creation of the file permissions - $topic = 0; - if ( $topic == 1 || $tbls_module_table != null) { // - const_admin_permissions($mods, $mods_name, $tbls_name, $topic); - } - - //Include - const_js_jquery($mods, $mods_name); - //Configs - const_include_configs($mods, $mods_name, $mods_a_w_name, $mods_a_w_url); // a_w = author_website - //Style - //const_css_admin($mods, $mods_name); - const_css_style($mods, $mods_name); - //Functions - const_include_functions($mods, $mods_name); - //Creation of the install file for uploads - const_include_install($mods, $mods_name, $tbls_arr); - //Language - /////////////////////////////////////////////////////////////////////// - //Creation of language main.php - const_main_language($mods, $mods_name, $mods_desc, $tbls_arr); - //Creation of language modinfo.php - const_modinfo_language($mods, $mods_name, $mods_desc, $tbls_arr, $topic); - //Creation of language admin.php - const_admin_language($mods, $mods_name, $tbls_arr, $topic); - //Creation of language blocks.php - const_blocks_language($mods, $mods_name, $tbls_arr); - //Creation of language help.php - const_help_language($mods, $mods_name, $mods_desc);*/ - //Creation of language - //const_language($mods, $mods_name); - /////////////////////////////////////////////////////////////////////// - /************************************************/ - /*Admin*/ - /************************************************/ - /*if ( $mods_display_admin == 1 ) { - //Creation of admin file admin_header.php - const_admin_header($mods, $mods_name, $tbls_arr); - //Creation of admin file admin_footer.php - const_admin_footer($mods, $mods_name, $tbls_arr); - //Creation of admin file menu.php - const_admin_menu($mods, $mods_name, $tbls_arr, $topic); - //Creation of admin file about.php - const_admin_about($mods, $mods_name); - //Creation of admin file index.php - const_admin_index($mods, $mods_name, $tbls_arr); - } - /************************************************/ - //*User*/ - /************************************************/ - /*if ( $mods_display_user == 1 ) { - const_user_header($mods, $mods_name, $tbls_arr, $tbls_name, $tbls_module_table); - const_user_index($mods, $mods_name); - } - CloseTable(); - +switch ($op) { + case "default": + default: + //tdmcreate_getBuildingForm(); break; - case "default": - default: - $mod_arr = $modulesHandler->getall(); - $numrowsmod = count( $mod_arr ); - // Redirect if there aren't modules - if ( $numrowsmod == 0 ) { - redirect_header('modules.php?op=add_module', 3, _AM_TDMCREATE_NOTMODULES ); - } + case "build": + $mods =& $modules_Handler->get($_REQUEST['mod_name']); + $mods_name = $mods->getVar('mod_name'); - include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php"); - $action = $_SERVER['REQUEST_URI']; - - $form = new XoopsThemeForm(_AM_TDMCREATE_ADMIN_CONST, 'form_creation', $action, 'post', true); - - $mods_select = new XoopsFormSelect(_AM_TDMCREATE_CONST_MODULES, 'module_name', 'module_name'); - $mods_select->addOptionArray($modulesHandler->getList()); - $form->addElement($mods_select, true); - - $form->addElement(new XoopsFormHidden('op', 'creation')); - $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); - $form->display(); - break; -}*/ + break; +} $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-01-09 06:24:03 UTC (rev 10719) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-01-09 17:43:10 UTC (rev 10720) @@ -10,7 +10,7 @@ */ /** - * tdmcreate module + * tdmcreate extension * * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) @@ -23,10 +23,16 @@ // Get main instance $system = System::getInstance(); $xoops = Xoops::getInstance(); +// Preferences Limit +$nb_pager = $xoops->getModuleConfig('pager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +// Get limit pager +$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); +// Get start pager +$start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // heaser -$xoops->header(); +$xoops->header('tdmcreate_extensions.html'); // Get handler /* @var $extensions_handler TDMCreateExtensionsHandler */ $extensions_Handler = $xoops->getModuleHandler('extensions'); @@ -40,174 +46,127 @@ $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); $admin_page->renderButton(); $criteria = new CriteriaCompo(); - $criteria->setSort("module_id ASC, module_name"); + $criteria->setSort("ext_name"); $criteria->setOrder("ASC"); - $numrows = $extensions_Handler->getCount(); - if (isset($_REQUEST['limit'])) { - $criteria->setLimit($_REQUEST['limit']); - $limit = $_REQUEST['limit']; - } else { - $criteria->setLimit($GLOBALS['xoopsModuleConfig']['pager']); - $limit = $GLOBALS['xoopsModuleConfig']['pager']; - } - if (isset($_REQUEST['start'])) { - $criteria->setStart($_REQUEST['start']); - $start = $_REQUEST['start']; - } else { - $criteria->setStart(0); - $start = 0; - } - $mods_arr = $extensions_Handler->getall($criteria); - if ( $numrows > $limit ) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit); - $pagenav = $pagenav->renderNav(4); - } else { - $pagenav = ''; - } - //Display modules list - if ($numrows>0) - { - $yes = "<img src='../images/16/green.png' alt='"._YES."' title='"._YES."' />"; - $no = "<img src='../images/16/red.png' alt='"._NO."' title='"._NO."' />"; - echo "<table width='100%' cellspacing='1' class='outer'> - <tr> - <th class='center'>"._AM_TDMCREATE_MODULE_ID."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_NAME."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_VERSION."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_IMAGE."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_RELEASE."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_STATUS."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST."</th> - <th class='center' width='5%'>"._AM_TDMCREATE_FORMACTION."</th> - </tr>"; - $class = "odd"; - foreach (array_keys($mods_arr) as $i) - { - echo "<tr class='".$class."'>"; - $class = ($class == "even") ? "odd" : "even"; - echo "<td class='center'>".$i."</td>"; - echo "<td class='center'>".$mods_arr[$i]->getVar("module_name")."</td>"; - echo "<td class='center'>".$mods_arr[$i]->getVar("module_version")."</td>"; - echo "<td class='center'><img src='".TDMC_UPLOAD_URL."/images/modules/".$mods_arr[$i]->getVar("module_image")."' height='30px' title='module_image' alt='module_image'></td>"; - echo "<td class='center'>".$mods_arr[$i]->getVar("module_release")."</td>"; - echo "<td class='center'>".$mods_arr[$i]->getVar("module_status")."</td>"; - - $verif_module_display_admin = ( $mods_arr[$i]->getVar("module_display_admin") == 1 ) ? $yes : $no; - echo "<td class='center'>".$verif_module_display_admin."</td>"; - $verif_module_display_user = ( $mods_arr[$i]->getVar("module_display_user") == 1 ) ? $yes : $no; - echo "<td class='center'>".$verif_module_display_user."</td>"; - $verif_module_display_submenu = ( $mods_arr[$i]->getVar("module_display_submenu") == 1 ) ? $yes : $no; - echo "<td class='center'>".$verif_module_display_submenu."</td>"; - $verif_module_active_search = ( $mods_arr[$i]->getVar("module_active_search") == 1 ) ? $yes : $no; - echo "<td class='center'>".$verif_module_active_search."</td>"; - $verif_module_active_coms = ( $mods_arr[$i]->getVar("module_active_comments") == 1 ) ? $yes : $no; - echo "<td class='center'>".$verif_module_active_coms."</td>"; - $verif_module_active_notify = ( $mods_arr[$i]->getVar("module_active_notifies") == 1 ) ? $yes : $no; - echo "<td class='center'>".$verif_module_active_notify."</td>"; - - echo "<td class='center' width='5%'> - <a href='modules.php?op=edit_module&module_id=".$i."'><img src='".$pathIcon16."/edit.png' alt='"._EDIT."' title='"._EDIT."'></a> - <a href='modules.php?op=delete_module&module_id=".$i."'><img src='".$pathIcon16."/delete.png' alt='"._DELETE."' title='"._DELETE."'></a> - </td>"; - echo "</tr>"; - } - echo "</table><br><br>"; - echo "<div class='center'>".$pagenav."</div>"; - } else { - echo "<table width='100%' cellspacing='1' class='outer'> - <tr> - <th class='center'>"._AM_TDMCREATE_MODULE_NAME."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_VERSION."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_IMAGE."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_RELEASE."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_STATUS."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST."</th> - <th class='center'>"._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST."</th> - <th class='center' width='5%'>"._AM_TDMCREATE_FORMACTION."</th> - </tr><tr><td class='errorMsg' colspan='12'>No Modules</td></tr>"; - echo "</table><br><br>"; - } + $criteria->setStart($start); + $criteria->setLimit($limit); + $numrows = $extensions_Handler->getCount($criteria); + $xoops->tpl()->assign('eimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/extensions/'); + $xoops->tpl()->assign('extensions', $extensions_Handler->getObjects($criteria, true, false)); + $xoops->tpl()->assign('extensions_list', true); + $xoops->tpl()->assign('extension', true); + unset($criteria); + // Display Page Navigation + if ($numrows > $nb_pager) { + $nav = new XoopsPageNav($numrows, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } break; case "new": - $obj =& $extensions_Handler->create(); - $form = $obj->getExtensionsForm(); - $form->display(); + $admin_page->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); + $admin_page->renderButton(); + + $obj = $extensions_Handler->create(); + $form = $xoops->getModuleForm($obj, 'extensions'); + $xoops->tpl()->assign('form', $form->render()); break; case "save": if (!$xoops->security()->check()) { - $xoops->redirect('extensions.php', 3, implode(',', $xoops->security()->getErrors())); - } - if (isset($_REQUEST["field_id"])) { - $obj =& $extensions_Handler->get($_REQUEST["field_id"]); + $xoops->redirect('extensions.php', 3, implode(',', $xoops->security()->getErrors())); + } + $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); + if ($id > 0) { + $obj = $extensions_Handler->get($id); } else { - $obj =& $extensions_Handler->create(); + $obj = $extensions_Handler->create(); + } + //Form extension save + $obj->setVars(array("ext_name" => $_POST["ext_name"], "ext_version" => $_POST["ext_version"], + "ext_description" => $_POST["ext_description"], "ext_author" => $_POST["ext_author"], + "ext_author_mail" => $_POST["ext_author_mail"], "ext_author_website_url" => $_POST["ext_author_website_url"], + "ext_author_website_name" => $_POST["ext_author_website_name"], "ext_credits" => $_POST["ext_credits"], + "ext_license" => $_POST["ext_license"], "ext_release_info" => $_POST["ext_release_info"], + "ext_release_file" => $_POST["ext_release_file"], "ext_manual" => $_POST["ext_manual"], + "ext_manual_file" => $_POST["ext_manual_file"])); + + //Form extension_image + $uploaddir = XOOPS_UPLOAD_PATH."/tdmcreate/images/extensions/"; + $uploader_img = new XoopsMediaUploader($uploaddir, $xoops->getModuleConfig('mimetypes'), + $xoops->getModuleConfig('maxsize'), null, null); + if ($uploader_img->fetchMedia("extensions_image")) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["ext_image"]['name']); + $name_img = $_GET['ext_name'].'_slogo.'.$extension; + $uploader_img->setPrefix($name_img); + $uploader_img->fetchMedia("extensions_image"); + if (!$uploader_img->upload()) { + $errors = $uploader_img->getErrors(); + $xoops->redirect("javascript:history.go(-1)", 3, $errors); + } else { + $obj->setVar("extensions_image", $uploaddir . $uploader_img->getSavedFileName()); + } + } else { + if ($_POST["extensions_image"] == 'blank.gif') { + $obj->setVar("ext_image", $_POST["ext_image"]); + } else { + $obj->setVar("ext_image", $uploaddir . $_POST["ext_image"]); + } } - //Form fields - $obj->setVars(array("field_table" => $_POST["field_table"], "field_name" => $_POST["field_name"], "field_type" => $_POST["field_type"], "field_value" => $_POST["field_value"], "field_attribute" => $_POST["field_attribute"], "field_null" => $_POST["field_null"], "field_default" => $_POST["field_default"], "field_key" => $_POST["field_key"], "field_elements" => $_POST["field_elements"])); - //Form field_display_admin - $verif_field_display_admin = ($_REQUEST["field_display_admin"] == 1) ? "1" : "0"; - //Form field_display_user - $verif_field_display_user = ($_REQUEST["field_display_user"] == 1) ? "1" : "0"; - //Form field_display_block - $verif_field_display_block = ($_REQUEST["field_display_block"] == 1) ? "1" : "0"; - //Form field_mainfield - $verif_field_mainfield = ($_REQUEST["field_mainfield"] == 1) ? "1" : "0"; - //Form field_search - $verif_field_search = ($_REQUEST["field_search"] == 1) ? "1" : "0"; - //Form fields - $verif_field_required = ($_REQUEST["field_required"] == 1) ? "1" : "0"; - $obj->setVars(array("field_display_admin" => $verif_field_display_admin, "field_display_user" => $verif_field_display_user, "field_display_block" => $verif_field_display_block, "field_mainfield" => $verif_field_mainfield, "field_search" => $verif_field_search, "field_required" => $verif_field_required)); - + //Form extension save + $obj->setVars(array("ext_demo_site_url" => $_POST["ext_demo_site_url"], "ext_demo_site_name" => $_POST["ext_demo_site_name"], + "ext_forum_site_url" => $_POST["ext_forum_site_url"], "ext_forum_site_name" => $_POST["ext_forum_site_name"], + "ext_website_url" => $_POST["ext_website_url"], "ext_website_name" => $_POST["ext_website_name"], + "ext_release" => $_POST["ext_release"], "ext_status" => $_POST["ext_status"], + "ext_display_admin" => (($_REQUEST["ext_display_admin"] == 1) ? "1" : "0"), + "ext_display_user" => (($_REQUEST["ext_display_user"] == 1) ? "1" : "0"), + "ext_display_submenu" => (($_REQUEST["ext_display_submenu"] == 1) ? "1" : "0"), + "ext_active_search" => (($_REQUEST["ext_active_search"] == 1) ? "1" : "0"), + "ext_active_comments" => (($_REQUEST["ext_active_comments"] == 1) ? "1" : "0"), + "ext_active_notifies" => (($_REQUEST["ext_active_notifies"] == 1) ? "1" : "0"))); + // Insert Data if ($extensions_Handler->insert($obj)) { redirect_header("extensions.php?op=list", 2, _AM_TDMCREATE_FORMOK); } - echo $obj->getHtmlErrors(); - $form =& $obj->getForm(); - $form->display(); + // Form Data + $xoops->error($obj->getHtmlErrors()); + $form = $xoops->getModuleForm($obj, 'extensions'); + $xoops->tpl()->assign('form', $form->render()); break; - case "edit": - $obj = $extensions_Handler->get($_REQUEST["field_id"]); - $form = $obj->getForm(); - $form->display(); - break; - - case "delete": + case "edit": $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); - $admin_page->addItemButton(_AM_TDMCREATE_EXTENSION_LIST, 'extensions.php', 'application-view-detail'); - $admin_page->renderButton(); - $id = $system->cleanVars($_REQUEST, 'id', 0, 'int'); + $admin_page->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); + $admin_page->renderButton(); + + $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); if ($id > 0) { $obj = $extensions_Handler->get($id); - if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + $form = $xoops->getModuleForm($obj, 'extensions'); + $xoops->tpl()->assign('form', $form->render()); + } else { + $xoops->redirect('extensions.php', 1, _AM_SYSTEM_DBERROR); + } + break; + + case "delete": + $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); + if ($id > 0) { + $obj = $extensions_Handler->get($id); + if (isset($_POST["ok"]) && $_POST["ok"] == 1) { if (!$xoops->security()->check()) { $xoops->redirect("extensions.php", 3, implode(",", $xoops->security()->getErrors())); } - if ($extensions_Handler->deleteFields($obj)) { - $xoops->redirect("extensions.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_CATEGORY)); + if ($extensions_Handler->delete($obj)) { + $xoops->redirect("extensions.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_EXTENSION)); } else { $xoops->error($obj->getHtmlErrors()); } - } else { - // Define Stylesheet - $xoops->theme()->addStylesheet('modules/system/css/admin.css'); - $xoops->tpl()->assign('form', false); - $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'extensions.php', sprintf(_PROFILE_AM_RUSUREDEL, $obj->getVar('field_title')) . '<br />'); - } - } else { - $xoops->redirect('extensions.php', 1, _AM_SYSTEM_DBERROR); - } - break; + } else { + $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'extensions.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('ext_name')) . '<br />'); + } + } else { + $xoops->redirect('extensions.php', 1, _AM_SYSTEM_DBERROR); + } + break; } $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-01-09 06:24:03 UTC (rev 10719) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-01-09 17:43:10 UTC (rev 10720) @@ -23,22 +23,67 @@ // Get main instance $system = System::getInstance(); $xoops = Xoops::getInstance(); +// Preferences Limit +$nb_pager = $xoops->getModuleConfig('pager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +// Get limit pager +$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); +// Get start pager +$start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // heaser -$xoops->header(); +$xoops->header('tdmcreate_fields.html'); // Get handler -/* @var $extensions_handler TDMCreateExtensionsHandler */ -$extensions_Handler = $xoops->getModuleHandler('fields'); +/* @var $tables_handler TDMCreateTablesHandler */ +$tables_Handler = $xoops->getModuleHandler('tables'); +/* @var $fields_handler TDMCreateFieldsHandler */ +$fields_Handler = $xoops->getModuleHandler('fields'); $admin_page = new XoopsModuleAdmin(); $admin_page->renderNavigation('fields.php'); -/*switch ($op) +switch ($op) { + case "list": + default: + $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); + $admin_page->renderButton(); + // Get tables list + $criteria = new CriteriaCompo(); + $criteria->setSort('table_name'); + $criteria->setOrder('ASC'); + $criteria->setStart($start); + $criteria->setLimit($nb_pager); + $numrows_tabs = $tables_Handler->getCount($criteria); + // Redirect if there aren't modules + /* if ( $numrows_mods == 0 ) { + redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); + }*/ + $xoops->tpl()->assign('timg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/tables/'); + $xoops->tpl()->assign('tables', $tables_Handler->getObjects($criteria, true, false)); + $xoops->tpl()->assign('table', true); + unset($criteria); + // Get fields list + $criteria = new CriteriaCompo(); + $criteria->setSort("field_name"); + $criteria->setOrder("ASC"); + $xoops->tpl()->assign('fimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/fields/'); + $xoops->tpl()->assign('fields', $fields_Handler->getObjects($criteria, true, false)); + $xoops->tpl()->assign('field', true); + unset($criteria); + // Display Page Navigation + if ($numrows_tabs > $nb_pager) { + $nav = new XoopsPageNav($numrows_tabs, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + break; + case "new": - $obj =& $fieldsHandler->create(); - $form = $obj->getForm(); - $form->display(); + $admin_page->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); + $admin_page->renderButton(); + + $obj = $fields_Handler->create(); + $form = $xoops->getModuleForm($obj, 'fields'); + $xoops->tpl()->assign('form', $form->render()); break; case "save": @@ -51,34 +96,60 @@ $obj =& $fieldsHandler->create(); } //Form fields - $obj->setVars(array("field_table" => $_POST["field_table"], "field_name" => $_POST["field_name"], "field_type" => $_POST["field_type"], "field_value" => $_POST["field_value"], "field_attribute" => $_POST["field_attribute"], "field_null" => $_POST["field_null"], "field_default" => $_POST["field_default"], "field_key" => $_POST["field_key"], "field_elements" => $_POST["field_elements"])); - //Form field_display_admin - $verif_field_display_admin = ($_REQUEST["field_display_admin"] == 1) ? "1" : "0"; - //Form field_display_user - $verif_field_display_user = ($_REQUEST["field_display_user"] == 1) ? "1" : "0"; - //Form field_display_block - $verif_field_display_block = ($_REQUEST["field_display_block"] == 1) ? "1" : "0"; - //Form field_mainfield - $verif_field_mainfield = ($_REQUEST["field_mainfield"] == 1) ? "1" : "0"; - //Form field_search - $verif_field_search = ($_REQUEST["field_search"] == 1) ? "1" : "0"; - //Form fields - $verif_field_required = ($_REQUEST["field_required"] == 1) ? "1" : "0"; - $obj->setVars(array("field_display_admin" => $verif_field_display_admin, "field_display_user" => $verif_field_display_user, "field_display_block" => $verif_field_display_block, "field_mainfield" => $verif_field_mainfield, "field_search" => $verif_field_search, "field_required" => $verif_field_required)); + $obj->setVars(array("field_table" => $_POST["field_table"], "field_name" => $_POST["field_name"], + "field_type" => $_POST["field_type"], "field_value" => $_POST["field_value"], + "field_attribute" => $_POST["field_attribute"], "field_null" => $_POST["field_null"], + "field_default" => $_POST["field_default"], "field_key" => $_POST["field_key"], + "field_elements" => $_POST["field_elements"], + "field_display_admin" => (($_REQUEST["field_display_admin"] == 1) ? "1" : "0"), + "field_display_user" => (($_REQUEST["field_display_user"] == 1) ? "1" : "0"), + "field_display_block" => (($_REQUEST["field_display_block"] == 1) ? "1" : "0"), + "field_mainfield" => (($_REQUEST["field_mainfield"] == 1) ? "1" : "0"), + "field_search" => (($_REQUEST["field_search"] == 1) ? "1" : "0"), + "field_required" => (($_REQUEST["field_required"] == 1) ? "1" : "0"))); if ($fieldsHandler->insert($obj)) { - redirect_header("tables.php?op=list", 2, _AM_TDMCREATE_FORMOK); + redirect_header("fields.php?op=list", 2, _AM_TDMCREATE_FORMOK); } - echo $obj->getHtmlErrors(); - $form =& $obj->getForm(); - $form->display(); - break; + + $xoops->error($obj->getHtmlErrors()); + $form = $xoops->getModuleForm($obj, 'fields'); + $xoops->tpl()->assign('form', $form->render()); + break; - case "edit": - echo $adminMenu->addNavigation('tables.php'); - $obj = $fieldsHandler->get($_REQUEST["field_id"]); - $form = $obj->getForm(); - $form->display(); + case "edit": + $admin_page->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); + $admin_page->renderButton(); + + $id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); + if ($id > 0) { + $obj = $tables_Handler->get($id); + $form = $xoops->getModuleForm($obj, 'fields'); + $xoops->tpl()->assign('form', $form->render()); + } else { + $xoops->redirect('fields.php', 1, _AM_SYSTEM_DBERROR); + } break; -}*/ + + case "delete": + $id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); + if ($id > 0) { + $obj = $fields_Handler->get($id); + if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + if (!$xoops->security()->check()) { + $xoops->redirect("fields.php", 3, implode(",", $xoops->security()->getErrors())); + } + if ($fields_Handler->delete($obj)) { + $xoops->redirect("fields.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_TABLE)); + } else { + $xoops->error($obj->getHtmlErrors()); + } + } else { + $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'fields.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('field_name')) . '<br />'); + } + } else { + $xoops->redirect('fields.php', 1, _AM_SYSTEM_DBERROR); + } + break; +} $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-01-09 06:24:03 UTC (rev 10719) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-01-09 17:43:10 UTC (rev 10720) @@ -26,7 +26,7 @@ // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); // heaser -$xoops->header(); +$xoops->header('tdmcreate_import.html'); // Get handler /* @var $import_handler TDMCreateImportHandler */ $import_Handler = $xoops->getModuleHandler('import'); @@ -34,19 +34,93 @@ $admin_page = new XoopsModuleAdmin(); $admin_page->renderNavigation('import.php'); switch ($op) -{ - case "list": - default: - // Import old modules by sql +{ + case "list": + $admin_page->addItemButton(_AM_TDMCREATE_IMPORT, 'import.php?op=import', 'add'); + $admin_page->renderButton(); + $criteria = new CriteriaCompo(); + $criteria->setSort("import_name"); + $criteria->setOrder("ASC"); + $criteria->setStart($start); + $criteria->setLimit($limit); + $numrows = $import_Handler->getCount($criteria); + $xoops->tpl()->assign('imports', $import_Handler->getObjects($criteria, true, false)); + $xoops->tpl()->assign('import', true); + unset($criteria); + // Display Page Navigation + if ($numrows > $nb_pager) { + $nav = new XoopsPageNav($numrows, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } break; - case "save": + case "import": + $admin_page->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); + $admin_page->renderButton(); + + $obj = $import_Handler->create(); + $form = $xoops->getModuleForm($obj, 'import'); + $xoops->tpl()->assign('form', $form->render()); break; - case "edit": + case "save": + if (!$xoops->security()->check()) { + $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); + } + $id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); + if ($id > 0) { + $obj = $import_Handler->get($id); + } else { + $obj = $import_Handler->create(); + } + //Form module save + $obj->setVars(array("import_mid" => $_POST["import_mid"], "import_name" => $_POST["import_name"], + "import_nbtables" => $_POST["import_nbtables"], "import_tablename" => $_POST["import_tablename"], + "import_nbfields" => $_POST["import_nbfields"], "import_fieldname" => $_POST["import_fieldname"])); + + if ($import_Handler->insert($obj)) { + redirect_header("import.php?op=list", 3, _AM_TDMCREATE_FORMOK); + } + + $xoops->error($obj->getHtmlErrors()); + $form = $xoops->getModuleForm($obj, 'import'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case "edit": + $admin_page->addItemButton(_AM_TDMCREATE_IMPORT, 'import.php?op=import', 'add'); + $admin_page->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); + $admin_page->renderButton(); + + $id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); + if ($id > 0) { + $obj = $import_Handler->get($id); + $form = $xoops->getModuleForm($obj, 'import'); + $xoops->tpl()->assign('form', $form->render()); + } else { + $xoops->redirect('import.php', 2, _AM_SYSTEM_DBERROR); + } break; - case "delete": + case "delete": + $id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); + if ($id > 0) { + $obj = $import_Handler->get($id); + if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + if (!$xoops->security()->check()) { + $xoops->redirect("import.php", 3, implode(",", $xoops->security()->getErrors())); + } + if ($import_Handler->delete($obj)) { + $xoops->redirect("import.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_IMPORT)); + } else { + $xoops->error($obj->getHtmlErrors()); + } + } else { + $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'import.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('import_name')) . '<br />'); + } + } else { + $xoops->redirect('import.php', 1, _AM_SYSTEM_DBERROR); + } break; } $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2013-01-09 06:24:03 UTC (rev 10719) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2013-01-09 17:43:10 UTC (rev 10720) @@ -17,31 +17,44 @@ * @package tdmcreate * @since 2.6.0 * @author TDM Xoops (AKA Developers) - * @version $Id: about.php 10665 2012-12-27 10:14:15Z timgno $ + * @version $Id: index.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; $xoops = Xoops::getInstance(); // Get banners handler -//$modules_Handler = $xoops->getModuleHandler('tdmcreate_modules'); -//$tables_Handler = $xoops->getModuleHandler('tdmcreate_tables'); +$modules_Handler = $xoops->getModuleHandler('modules'); +$extensions_Handler = $xoops->getModuleHandler('extensions'); +$tables_Handler = $xoops->getModuleHandler('tables'); +$import_Handler = $xoops->getModuleHandler('import'); // heaser $xoops->header(); // tdmcreate modules -//$criteria = new CriteriaCompo(); -//$tdmcreate_modules = $modules_Handler->getCount($criteria); +$criteria = new CriteriaCompo(); +$tdmcreate_modules = $modules_Handler->getCount($criteria); +// tdmcreate extensions +$criteria = new CriteriaCompo(); +$tdmcreate_extensions = $extensions_Handler->getCount($criteria); // tdmcreate tables -//$criteria = new CriteriaCompo(); -//$tdmcreate_tables = $tables_Handler->getCount($criteria); +$criteria = new CriteriaCompo(); +$tdmcreate_tables = $tables_Handler->getCount($criteria); +// tdmcreate import +$criteria = new CriteriaCompo(); +$tdmcreate_import = $import_Handler->getCount($criteria); // folder path $folder_path = XOOPS_ROOT_PATH . '/uploads/tdmcreate'; $r = "red"; $g = "green"; -//$modules_color = $tdmcreate_modules == 0 ? $r : $g; -//$tables_color = $tdmcreate_tables == 0 ? $r : $g; +$modules_color = $tdmcreate_modules == 0 ? $r : $g; +$extensions_color = $tdmcreate_extensions == 0 ? $r : $g; +$tables_color = $tdmcreate_tables == 0 ? $r : $g; +$import_color = $tdmcreate_import == 0 ? $r : $g; + $admin_page = new XoopsModuleAdmin(); $admin_page->addInfoBox(_AM_TDMCREATE_STATISTICS); -//$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NMTOTAL, '<span class="'.$modules_color.'">' . $tdmcreate_modules . '</span>')); -//$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NTTOTAL, '<span class="'.$tables_color.'">' . $tdmcreate_tables . '</span>')); +$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NMTOTAL, '<span class="'.$modules_color.'">' . $tdmcreate_modules . '</span>')); +$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NETOTAL, '<span class="'.$extensions_color.'">' . $tdmcreate_extensions . '</span>')); +$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NTTOTAL, '<span class="'.$tables_color.'">' . $tdmcreate_tables . '</span>')); +$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NITOTAL, '<span class="'.$import_color.'">' . $tdmcreate_import . '</span>')); $admin_page->addConfigBoxLine($folder_path, 'folder'); $admin_page->addConfigBoxLine(array($folder_path, '777'), 'chmod'); $admin_page->displayNavigation('index.php'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-01-09 06:24:03 UTC (rev 10719) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-01-09 17:43:10 UTC (rev 10720) @@ -23,8 +23,14 @@ // Get main instance $system = System::getInstance(); $xoops = Xoops::getInstance(); +// Preferences Limit +$nb_pager = $xoops->getModuleConfig('pager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +// Get limit pager +$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); +// Get start pager +$start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // heaser $xoops->header('tdmcreate_modules.html'); // Get handler @@ -40,65 +46,27 @@ $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_MODULE, 'modules.php?op=new', 'add'); $admin_page->renderButton(); $criteria = new CriteriaCompo(); - $criteria->setSort("mod_id ASC, mod_name"); - $criteria->setOrder("ASC"); - $numrows = $modules_Handler->getCount(); - if (isset($_REQUEST['limit'])) { - $criteria->setLimit($_REQUEST['limit']); - $limit = $_REQUEST['limit']; - } else { - $criteria->setLimit($GLOBALS['xoopsModuleConfig']['pager']); - $limit = $GLOBALS['xoopsModuleConfig']['pager']; - } - if (isset($_REQUEST['start'])) { - $criteria->setStart($_REQUEST['start']); - $start = $_REQUEST['start']; - } else { - $criteria->setStart(0); - $start = 0; - } - $mods_arr = $modules_Handler->getall($criteria); - unset($criteria); - $xoops->tpl()->assign('numrows', $numrows); - if ( $numrows > $limit ) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($numrows, $limit, $start, 'start', 'op=list&limit=' . $limit); - $pagenav = $pagenav->renderNav(4); - } else { - $pagenav = ''; - } - //Display modules list - if ($numrows > 0) - { - $yes = "<img src='../images/16/green.png' alt='"._YES."' title='"._YES."' />"; - $no = "<img src='../images/16/red.png' alt='"._NO."' title='"._NO."' />"; - - foreach (array_keys($mods_arr) as $i) - { - $arr_modules['id'] = $i; - $arr_modules['name'] = $mods_arr[$i]->getVar('mod_name'); - $arr_modules['version'] = $mods_arr[$i]->getVar('mod_version'); - $arr_modules['image'] = XOOPS_UPLOAD_URL.'/tdmcreate/images/modules/'.$mods_arr[$i]->getVar('mod_image'); - $arr_modules['release'] = $mods_arr[$i]->getVar('mod_release'); - $arr_modules['status'] = $mods_arr[$i]->getVar('mod_status'); - $arr_modules['display_admin'] = ( $mods_arr[$i]->getVar('mod_display_admin') == 1 ) ? $yes : $no; - $arr_modules['display_user'] = ( $mods_arr[$i]->getVar('mod_display_user') == 1 ) ? $yes : $no; - $arr_modules['display_submenu'] = ( $mods_arr[$i]->getVar("mod_display_submenu") == 1 ) ? $yes : $no; - $arr_modules['active_search'] = ( $mods_arr[$i]->getVar("mod_active_search") == 1 ) ? $yes : $no; - $arr_modules['active_comments'] = ( $mods_arr[$i]->getVar("mod_active_comments") == 1 ) ? $yes : $no; - $arr_modules['active_notifies'] = ( $mods_arr[$i]->getVar("mod_active_notifies") == 1 ) ? $yes : $no; - $arr_modules['edit'] = 'modules.php?op=edit&mod_id='.$i; - $arr_modules['delete'] = 'modules.php?op=delete&mod_id='.$i; - } - $xoops->tpl()->assign('arr_modules', $arr_modules); - $xoops->tpl()->assign('pagenav', $pagenav); - } + $criteria->setSort("mod_name"); + $criteria->setOrder("ASC"); + $criteria->setStart($start); + $criteria->setLimit($limit); + $numrows = $modules_Handler->getCount($criteria); + $xoops->tpl()->assign('mimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/modules/'); + $xoops->tpl()->assign('modules', $modules_Handler->getObjects($criteria, true, false)); + $xoops->tpl()->assign('modules_list', true); + $xoops->tpl()->assign('module', true); + unset($criteria); + // Display Page Navigation + if ($numrows > $nb_pager) { + $nav = new XoopsPageNav($numrows, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } break; case "new": - $admin_page->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list'); + $admin_page->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'application-view-detail'); $admin_page->renderButton(); - + $obj = $modules_Handler->create(); $form = $xoops->getModuleForm($obj, 'modules'); $xoops->tpl()->assign('form', $form->render()); @@ -115,49 +83,55 @@ $obj = $modules_Handler->create(); } //Form module save - $obj->setVars(array("mod_name" => $_POST["mod_name"], "mod_version" => $_POST["mod_version"], "mod_description" => $_POST["mod_description"], "mod_author" => $_POST["mod_author"], "mod_author_mail" => $_POST["mod_author_mail"], "mod_author_website_url" => $_POST["mod_author_website_url"], "mod_author_website_name" => $_POST["mod_author_website_name"], "mod_credits" => $_POST["mod_credits"], "mod_license" => $_POST["mod_license"], "mod_release_info" => $_POST["mod_release_info"], "mod_release_file" => $_POST["mod_release_file"], "mod_manual" => $_POST["mod_manual"], "mod_manual_file" => $_POST["mod_manual_file"])); - //Form module_image - include_once XOOPS_ROOT_PATH . "/class/uploader.php"; - $uploaddir = XOOPS_UPLOAD_PATH."/tdmcreate/images/modules/"; - $uploader = new XoopsMediaUploader($uploaddir, $GLOBALS["xoopsModuleConfig"]["mimetypes"], - $GLOBALS["xoopsModuleConfig"]["maxsize"], null, null); - if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { - $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["mod_image"]['name']); - $name_img = $_GET['module_name'].'_slogo.'.$extension; - $uploader->setPrefix($name_img); - $uploader->fetchMedia($_POST['xoops_upload_file'][0]); - if (!$uploader->upload()) { - $errors = $uploader->getErrors(); - redirect_header("javascript:history.go(-1)",3, $errors); - } else { - $obj->setVar("mod_image", $uploader->getSavedFileName()); - } - } else { - $obj->setVar("mod_image", $_POST["mod_image"]); - } - //Form module save - $obj->setVars(array("mod_demo_site_url" => $_POST["mod_demo_site_url"], "mod_demo_site_name" => $_POST["mod_demo_site_name"], "mod_forum_site_url" => $_POST["mod_forum_site_url"], "mod_forum_site_name" => $_POST["mod_forum_site_name"], "mod_website_url" => $_POST["mod_website_url"], "mod_website_name" => $_POST["mod_website_name"], "mod_release" => $_POST["mod_release"], "mod_status" => $_POST["mod_status"])); - //Form module_display_admin - $verif_module_display_admin = ($_REQUEST["mod_display_admin"] == 1) ? "1" : "0"; - //Form module_display_user - $verif_module_display_user = ($_REQUEST["mod_display_user"] == 1) ? "1" : "0"; - //Form module_display_submenu - $verif_module_display_submenu = ($_REQUEST["mod_display_submenu"] == 1) ? "1" : "0"; - //Form module_active_search - $verif_module_active_search = ($_REQUEST["mod_active_search"] == 1) ? "1" : "0"; - //Form module_active_coms - $verif_module_active_coms = ($_REQUEST["mod_active_comments"] == 1) ? "1" : "0"; - //Form module_active_notify - $verif_module_active_notify = ($_REQUEST["mod_active_notifies"] == 1) ? "1" : "0"; - $obj->setVars(array("mod_display_admin" => $verif_module_display_admin, "mod_display_user" => $verif_module_display_user, "mod_display_submenu" => $verif_module_display_submenu, "mod_active_search" => $verif_module_active_search, "mod_active_comments" => $verif_module_active_coms, "mod_active_notifies" => $verif_module_active_notify)); - + $obj->setVars(array("mod_name" => $_POST["mod_name"], "mod_version" => $_POST["mod_version"], + "mod_description" => $_POST["mod_description"], "mod_author" => $_POST["mod_author"], + "mod_author_mail" => $_POST["mod_author_mail"], "mod_author_website_url" => $_POST["mod_author_website_url"], + "mod_author_website_name" => $_POST["mod_author_website_name"], "mod_credits" => $_POST["mod_credits"], + "mod_license" => $_POST["mod_license"], "mod_release_info" => $_POST["mod_release_info"], + "mod_release_file" => $_POST["mod_release_file"], "mod_manual" => $_POST["mod_manual"], + "mod_manual_file" => $_POST["mod_manual_file"])); + //Form module_image + $uploaddir_url = XOOPS_UPLOAD_URL."/tdmcreate/images/modules/"; + $uploader_img = new XoopsMediaUploader( XOOPS_UPLOAD_PATH."/tdmcreate/images/modules", + $xoops->getModuleConfig('mimetypes'), + $xoops->getModuleConfig('maxsize'), null, null); + if ($uploader_img->fetchMedia("modules_imgurl")) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["module_image"]['name']); + $img_name = 'logo.'.$extension; + $uploader_img->setPrefix($img_name); + $uploader_img->fetchMedia("modules_imgurl"); + if (!$uploader_img->upload()) { + $errors = $uploader_img->getErrors(); + $xoops->redirect("javascript:history.go(-1)", 3, $errors); + } else { + $obj->setVar("mod_image", $uploaddir_url . $uploader_img->getSavedFileName()); + } + } else { + if ($_POST["modules_imgurl"] == 'blank.gif') { + $obj->setVar("mod_image", $_POST["mod_image"]); + } else { + $obj->setVar("mod_image", $uploaddir_url . $_POST["modules_imgurl"]); + } + } + //Form module save + $obj->setVars(array("mod_demo_site_url" => $_POST["mod_demo_site_url"], "mod_demo_site_name" => $_POST["mod_demo_site_name"], + "mod_forum_site_url" => $_POST["mod_forum_site_url"], "mod_forum_site_name" => $_POST["mod_forum_site_name"], + "mod_website_url" => $_POST["mod_website_url"], "mod_website_name" => $_POST["mod_website_name"], + "mod_release" => $_POST["mod_release"], "mod_status" => $_POST["mod_status"], + "mod_display_admin" => (($_REQUEST["mod_display_admin"] == 1) ? "1" : "0"), + "mod_display_user" => (($_REQUEST["mod_display_user"] == 1) ? "1" : "0"), + "mod_display_submenu" => (($_REQUEST["mod_display_submenu"] == 1) ? "1" : "0"), + "mod_active_search" => (($_REQUEST["mod_active_search"] == 1) ? "1" : "0"), + "mod_active_comments" => (($_REQUEST["mod_active_comments"] == 1) ? "1" : "0"), + "mod_active_notifies" => (($_REQUEST["mod_active_notifies"] == 1) ? "1" : "0"))); + // Insert Data if ($modules_Handler->insert($obj)) { redirect_header("modules.php?op=list", 2, _AM_TDMCREATE_FORMOK); } - + // Form Data $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'modules'); - $form->display(); + $xoops->tpl()->assign('form', $form->render()); break; case "edit": Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-01-09 06:24:03 UTC (rev 10719) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-01-09 17:43:10 UTC (rev 10720) @@ -23,10 +23,16 @@ // Get main instance $system = System::getInstance(); $xoops = Xoops::getInstance(); +// Preferences Limit +$nb_pager = $xoops->getModuleConfig('pager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +// Get limit pager +$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); +// Get start pager +$start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // heaser -$xoops->header(); +$xoops->header('tdmcreate_tables.html'); // Get handler /* @var $modules_handler TDMCreateModulesHandler */ $modules_Handler = $xoops->getModuleHandler('modules'); @@ -41,158 +47,95 @@ default: $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); $admin_page->renderButton(); - // Get the list of modules + // Get modules list $criteria = new CriteriaCompo(); - $criteria->setSort('mod_id ASC, mod_name'); - $criteria->setOrder('ASC'); + $criteria->setSort('mod_name'); + $criteria->setOrder('ASC'); + $criteria->setStart($start); + $criteria->setLimit($nb_pager); $numrows_mods = $modules_Handler->getCount($criteria); // Redirect if there aren't modules - if ( $numrows_mods == 0 ) { + /* if ( $numrows_mods == 0 ) { redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); - } - if (isset($_REQUEST['limit'])) { - $criteria->setLimit($_REQUEST['limit']); - $limit = $_REQUEST['limit']; - } else { - $criteria->setLimit($GLOBALS['xoopsModuleConfig']['pager']); - $limit = $GLOBALS['xoopsModuleConfig']['pager']; - } - if (isset($_REQUEST['start'])) { - $criteria->setStart($_REQUEST['start']); - $start = $_REQUEST['start']; - } else { - $criteria->setStart(0); - $start = 0; - } - $mods_arr = $modules_Handler->getall($criteria); + }*/ + $xoops->tpl()->assign('mimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/modules/'); + $xoops->tpl()->assign('modules', $modules_Handler->getObjects($criteria, true, false)); + $xoops->tpl()->assign('module', true); unset($criteria); - $xoops->tpl()->assign('numrows_modules', $numrows_mods); - if ( $numrows_mods > $limit ) { - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($numrows_mods, $limit, $start, 'start', 'op=list&limit=' . $limit); - $pagenav = $pagenav->renderNav(4); - } else { - $pagenav = ''; - } - // Display the list of modules - if ( $numrows_mods > 0 ) - { - $_yes = "<img src='../images/16/yellow.png' alt='"._YES."' title='"._YES."' />"; - $_no = "<img src='../images/16/red.png' alt='"._NO."' title='"._NO."' />"; - - foreach (array_keys($mods_arr) as $m) - { - $arr_modules['id'] = $m; - $arr_modules['name'] = $mods_arr[$m]->getVar('mod_name'); - $arr_modules['version'] = $mods_arr[$m]->getVar('mod_version'); - $arr_modules['image'] = XOOPS_UPLOAD_URL.'/tdmcreate/images/modules/'.$mods_arr[$m]->getVar('mod_image'); - $arr_modules['release'] = $mods_arr[$m]->getVar('mod_release'); - $arr_modules['status'] = $mods_arr[$m]->getVar('mod_status'); - $arr_modules['display_admin'] = ( $mods_arr[$m]->getVar('mod_display_admin') == 1 ) ? $yes : $no; - $arr_modules['display_user'] = ( $mods_arr[$m]->getVar('mod_display_user') == 1 ) ? $yes : $no; - $arr_modules['display_submenu'] = ( $mods_arr[$m]->getVar("mod_display_submenu") == 1 ) ? $yes : $no; - $arr_modules['active_search'] = ( $mods_arr[$m]->getVar("mod_active_search") == 1 ) ? $yes : $no; - $arr_modules['active_comments'] = ( $mods_arr[$m]->getVar("mod_active_comments") == 1 ) ? $yes : $no; - $arr_modules['active_notifies'] = ( $mods_arr[$m]->getVar("mod_active_notifies") == 1 ) ? $yes : $no; - $arr_modules['edit'] = 'modules.php?op=edit&mod_id='.$m; - $arr_modules['delete'] = 'modules.php?op=delete&mod_id='.$m; - - // Get the list of tables - $criteria = new CriteriaCompo(); - $criteria->setSort("table_id ASC, table_name"); - $criteria->setOrder("ASC"); - $numrows_tables = $tables_Handler->getCount(); - $tables_arr = $tables_Handler->getall($cr... [truncated message content] |
From: <txm...@us...> - 2013-01-17 12:56:08
|
Revision: 10827 http://sourceforge.net/p/xoops/svn/10827 Author: txmodxoops Date: 2013-01-17 12:56:05 +0000 (Thu, 17 Jan 2013) Log Message: ----------- Updated Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -38,15 +38,14 @@ $admin_page = new XoopsModuleAdmin(); $admin_page->renderNavigation('building.php'); switch ($op) { + case "build": + $mods =& $modules_Handler->get($_REQUEST['mod_name']); + $mods_name = $mods->getVar('mod_name'); + break; + case "default": default: //tdmcreate_getBuildingForm(); - break; - - case "build": - $mods =& $modules_Handler->get($_REQUEST['mod_name']); - $mods_name = $mods->getVar('mod_name'); - break; } $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -53,8 +53,7 @@ $numrows = $extensions_Handler->getCount($criteria); $xoops->tpl()->assign('eimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/extensions/'); $xoops->tpl()->assign('extensions', $extensions_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('extensions_list', true); - $xoops->tpl()->assign('extension', true); + $xoops->tpl()->assign('extension', true); unset($criteria); // Display Page Navigation if ($numrows > $nb_pager) { @@ -63,9 +62,9 @@ } break; case "new": - $admin_page->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); + $admin_page->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php?op=list', 'list'); $admin_page->renderButton(); - + $obj = $extensions_Handler->create(); $form = $xoops->getModuleForm($obj, 'extensions'); $xoops->tpl()->assign('form', $form->render()); @@ -123,11 +122,11 @@ "ext_active_search" => (($_REQUEST["ext_active_search"] == 1) ? "1" : "0"), "ext_active_comments" => (($_REQUEST["ext_active_comments"] == 1) ? "1" : "0"), "ext_active_notifies" => (($_REQUEST["ext_active_notifies"] == 1) ? "1" : "0"))); - // Insert Data + if ($extensions_Handler->insert($obj)) { redirect_header("extensions.php?op=list", 2, _AM_TDMCREATE_FORMOK); } - // Form Data + $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'extensions'); $xoops->tpl()->assign('form', $form->render()); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -78,7 +78,7 @@ break; case "new": - $admin_page->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); + $admin_page->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list'); $admin_page->renderButton(); $obj = $fields_Handler->create(); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -55,7 +55,7 @@ break; case "import": - $admin_page->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); + $admin_page->addItemButton(_AM_TDMCREATE_IMPORT_LIST, 'import.php?op=list', 'list'); $admin_page->renderButton(); $obj = $import_Handler->create(); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -53,8 +53,7 @@ $numrows = $modules_Handler->getCount($criteria); $xoops->tpl()->assign('mimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/modules/'); $xoops->tpl()->assign('modules', $modules_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('modules_list', true); - $xoops->tpl()->assign('module', true); + $xoops->tpl()->assign('module', true); unset($criteria); // Display Page Navigation if ($numrows > $nb_pager) { @@ -64,9 +63,9 @@ break; case "new": - $admin_page->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'application-view-detail'); + $admin_page->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list'); $admin_page->renderButton(); - + $obj = $modules_Handler->create(); $form = $xoops->getModuleForm($obj, 'modules'); $xoops->tpl()->assign('form', $form->render()); @@ -89,15 +88,16 @@ "mod_author_website_name" => $_POST["mod_author_website_name"], "mod_credits" => $_POST["mod_credits"], "mod_license" => $_POST["mod_license"], "mod_release_info" => $_POST["mod_release_info"], "mod_release_file" => $_POST["mod_release_file"], "mod_manual" => $_POST["mod_manual"], - "mod_manual_file" => $_POST["mod_manual_file"])); + "mod_manual_file" => $_POST["mod_manual_file"])); + //Form module_image + $uploaddir_path = XOOPS_UPLOAD_PATH."/tdmcreate/images/modules"; $uploaddir_url = XOOPS_UPLOAD_URL."/tdmcreate/images/modules/"; - $uploader_img = new XoopsMediaUploader( XOOPS_UPLOAD_PATH."/tdmcreate/images/modules", - $xoops->getModuleConfig('mimetypes'), - $xoops->getModuleConfig('maxsize'), null, null); + $uploader_img = new XoopsMediaUploader($uploaddir_path, $xoops->getModuleConfig('mimetypes'), + $xoops->getModuleConfig('maxsize'), null, null); if ($uploader_img->fetchMedia("modules_imgurl")) { $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["module_image"]['name']); - $img_name = 'logo.'.$extension; + $img_name = $_GET['mod_name'].'_slogo.'.$extension; $uploader_img->setPrefix($img_name); $uploader_img->fetchMedia("modules_imgurl"); if (!$uploader_img->upload()) { @@ -112,7 +112,8 @@ } else { $obj->setVar("mod_image", $uploaddir_url . $_POST["modules_imgurl"]); } - } + } + //Form module save $obj->setVars(array("mod_demo_site_url" => $_POST["mod_demo_site_url"], "mod_demo_site_name" => $_POST["mod_demo_site_name"], "mod_forum_site_url" => $_POST["mod_forum_site_url"], "mod_forum_site_name" => $_POST["mod_forum_site_name"], @@ -124,11 +125,11 @@ "mod_active_search" => (($_REQUEST["mod_active_search"] == 1) ? "1" : "0"), "mod_active_comments" => (($_REQUEST["mod_active_comments"] == 1) ? "1" : "0"), "mod_active_notifies" => (($_REQUEST["mod_active_notifies"] == 1) ? "1" : "0"))); - // Insert Data + if ($modules_Handler->insert($obj)) { redirect_header("modules.php?op=list", 2, _AM_TDMCREATE_FORMOK); } - // Form Data + $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'modules'); $xoops->tpl()->assign('form', $form->render()); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -68,8 +68,7 @@ $criteria->setOrder("ASC"); $xoops->tpl()->assign('timg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/tables/'); $xoops->tpl()->assign('tables', $tables_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('tables_list', true); - $xoops->tpl()->assign('table', true); + $xoops->tpl()->assign('table', true); unset($criteria); // Display Page Navigation if ($numrows_mods > $nb_pager) { @@ -79,9 +78,9 @@ break; case "new": - $admin_page->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); + $admin_page->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list'); $admin_page->renderButton(); - + $obj = $tables_Handler->create(); $form = $xoops->getModuleForm($obj, 'tables'); $xoops->tpl()->assign('form', $form->render()); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -30,14 +30,14 @@ { $xoops = Xoops::getInstance(); - $title = $obj->isNew() ? sprintf(_AM_TDMCREATE_EXTENSION_ADD) : sprintf(_AM_TDMCREATE_EXTENSION_EDIT); + $title = $obj->isNew() ? sprintf(_AM_TDMCREATE_MODULE_ADD) : sprintf(_AM_TDMCREATE_MODULE_EDIT); parent::__construct($title, 'form', 'extensions.php', 'post', true); $this->setExtra('enctype="multipart/form-data"'); - $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_EXTENSION_IMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_NAME, "ext_name", 50, 255, $obj->getVar('ext_name')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_VERSION, "ext_version", 30, 50, $obj->getVar('ext_version')), true); + $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_IMPORTANT.'</b></div>','head'); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, "ext_name", 50, 255, $obj->getVar('ext_name')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, "ext_version", 10, 25, $obj->getVar('ext_version')), true); $editor_configs=array(); $editor_configs["name"] = 'ext_description'; $editor_configs["value"] = $obj->getVar('ext_description', 'e'); @@ -46,39 +46,39 @@ $editor_configs["width"] = "100%"; $editor_configs["height"] = "400px"; $editor_configs["editor"] = $xoops->getModuleConfig('editor'); - $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_EXTENSION_DESCRIPTION, "ext_description", $editor_configs), true ); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR, "ext_author", 50, 255, $obj->getVar('ext_author')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_LICENSE, "ext_license", 50, 255, $obj->getVar('ext_license')), true); + $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, "ext_description", $editor_configs), true ); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, "ext_author", 50, 255, $obj->getVar('ext_author')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, "ext_license", 50, 255, $obj->getVar('ext_license')), true); $option_tray = new XoopsFormElementTray(_OPTIONS, ' '); $display_admin = $obj->isNew() ? 0 : $obj->getVar('ext_display_admin'); $check_display_admin = new XoopsFormCheckBox(" ", "ext_display_admin", $display_admin); - $check_display_admin->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN); + $check_display_admin->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_ADMIN); $option_tray->addElement($check_display_admin); $display_user = $obj->isNew() ? 0 : $obj->getVar('ext_display_user'); $check_display_user = new XoopsFormCheckBox(" ", "ext_display_user", $display_user); - $check_display_user->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_USER); + $check_display_user->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_USER); $option_tray->addElement($check_display_user); $display_submenu = $obj->isNew() ? 0 : $obj->getVar('ext_display_submenu'); $check_display_submenu = new XoopsFormCheckBox(" ", "ext_display_submenu", $display_submenu); - $check_display_submenu->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU); + $check_display_submenu->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_SUBMENU); $option_tray->addElement($check_display_submenu); $active_search = $obj->isNew() ? 0 : $obj->getVar('ext_active_search'); $check_active_search = new XoopsFormCheckBox(" ", "ext_active_search", $active_search); - $check_active_search->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH); + $check_active_search->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_SEARCH); $option_tray->addElement($check_active_search); $active_comments = $obj->isNew() ? 0 : $obj->getVar('ext_active_comments'); $check_active_comments = new XoopsFormCheckBox(" ", "ext_active_comments", $active_comments); - $check_active_comments->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS); + $check_active_comments->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_COMMENTS); $option_tray->addElement($check_active_comments); $active_notifies = $obj->isNew() ? 0 : $obj->getVar('ext_active_notifies'); $check_active_notifies = new XoopsFormCheckBox(" ", "ext_active_notifies", $active_notifies); - $check_active_notifies->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES); + $check_active_notifies->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_NOTIFIES); $option_tray->addElement($check_active_notifies); $this->addElement($option_tray); $ext_image = $obj->getVar("ext_image") ? $obj->getVar("ext_image") : 'default_slogo.png'; $uploadir = 'uploads/tdmcreate/images/extensions'; - $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_EXTENSION_IMAGE,'<br />'); + $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE,'<br />'); $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './'.$uploadir.'/'); $imageselect = new XoopsFormSelect($imgpath, 'extensions_image', $ext_image); $image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH."/".$uploadir ); @@ -94,26 +94,26 @@ $imgtray->addElement($fileseltray); $this->addElement($imgtray); - $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_EXTENSION_NOTIMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_MAIL, "ext_author_mail", 50, 255, $obj->getVar('ext_author_mail'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_WEBSITE_URL, "ext_author_website_url", 50, 255, $obj->getVar('ext_author_website_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_WEBSITE_NAME, "ext_author_website_name", 50, 255, $obj->getVar('ext_author_website_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_CREDITS, "ext_credits", 50, 255, $obj->getVar('ext_credits'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE_INFO, "ext_release_info", 50, 255, $obj->getVar('ext_release_info'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE_FILE, "ext_release_file", 50, 255, $obj->getVar('ext_release_file'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_MANUAL, "ext_manual", 50, 255, $obj->getVar('ext_manual'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_MANUAL_FILE, "ext_manual_file", 50, 255, $obj->getVar('ext_manual_file'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_DEMO_SITE_URL, "ext_demo_site_url", 50, 255, $obj->getVar('ext_demo_site_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_DEMO_SITE_NAME, "ext_demo_site_name", 50, 255, $obj->getVar('ext_demo_site_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_FORUM_SITE_URL, "ext_forum_site_url", 50, 255, $obj->getVar('ext_forum_site_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_FORUM_SITE_NAME, "ext_forum_site_name", 50, 255, $obj->getVar('ext_forum_site_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_WEBSITE_URL, "ext_website_url", 50, 255, $obj->getVar('ext_website_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_WEBSITE_NAME, "ext_website_name", 50, 255, $obj->getVar('ext_website_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE, "ext_release", 50, 255, $obj->getVar('ext_release'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_STATUS, "ext_status", 50, 255, $obj->getVar('ext_status'))); + $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_NOTIMPORTANT.'</b></div>','head'); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, "ext_author_mail", 50, 255, $obj->getVar('ext_author_mail'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, "ext_author_website_url", 50, 255, $obj->getVar('ext_author_website_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, "ext_author_website_name", 50, 255, $obj->getVar('ext_author_website_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, "ext_credits", 50, 255, $obj->getVar('ext_credits'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, "ext_release_info", 50, 255, $obj->getVar('ext_release_info'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, "ext_release_file", 50, 255, $obj->getVar('ext_release_file'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, "ext_manual", 50, 255, $obj->getVar('ext_manual'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, "ext_manual_file", 50, 255, $obj->getVar('ext_manual_file'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, "ext_demo_site_url", 50, 255, $obj->getVar('ext_demo_site_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, "ext_demo_site_name", 50, 255, $obj->getVar('ext_demo_site_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_FORUM_SITE_URL, "ext_forum_site_url", 50, 255, $obj->getVar('ext_forum_site_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_FORUM_SITE_NAME, "ext_forum_site_name", 50, 255, $obj->getVar('ext_forum_site_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, "ext_website_url", 50, 255, $obj->getVar('ext_website_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, "ext_website_name", 50, 255, $obj->getVar('ext_website_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, "ext_release", 50, 255, $obj->getVar('ext_release'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, "ext_status", 50, 255, $obj->getVar('ext_status'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_PAYPALBTN, "ext_paypal_button", 50, 255, $obj->getVar('ext_paypal_button'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_SVN, "ext_subversion", 50, 255, $obj->getVar('ext_subversion'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPALBTN, "ext_paypal_button", 50, 255, $obj->getVar('ext_paypal_button'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SVN, "ext_subversion", 50, 255, $obj->getVar('ext_subversion'))); if (!$obj->isNew()) { $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('ext_id') ) ); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -40,7 +40,7 @@ $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('mod_id') ) ); } $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, "mod_name", 50, 255, $obj->getVar('mod_name')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, "mod_version", 30, 50, $obj->getVar('mod_version')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, "mod_version", 10, 25, $obj->getVar('mod_version')), true); $editor_configs=array(); $editor_configs["name"] = 'mod_description'; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -34,39 +34,40 @@ parent::__construct($title, 'form', false, 'post', true); $this->setExtra('enctype="multipart/form-data"'); - - if (!$obj->isNew()) { - $this->addElement(new XoopsFormHidden('id', $obj->getVar('table_id'))); - } $modules_Handler =& $xoops->getModuleHandler('modules'); - $mods_select = new XoopsFormSelect(_AM_TDMCREATE_MODULES_LIST, 'table_mid', $obj->getVar('table_mid')); + $mods_select = new XoopsFormSelect(_AM_TDMCREATE_MODULES, 'table_mid', $obj->getVar('table_mid')); $mods_select->addOptionArray($modules_Handler->getList()); $this->addElement($mods_select, true); - $table_name = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, "table_name", 50, 255, $obj->getVar('table_name')); - //$table_name->setDescription(_AM_TDMCREATE_TABLENAME_DESC); + $table_name = new XoopsFormText(_AM_TDMCREATE_NAME, "table_name", 50, 255, $obj->getVar('table_name')); + $table_name->setDescription(_AM_TDMCREATE_NAME_DESC); $this->addElement($table_name, true); - $table_fieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, "table_fieldname", 30, 50, $obj->getVar('table_fieldname')); - //$table_fieldname->setDescription(_AM_TDMCREATE_FIELDNAME_DESC); + $table_fieldname = new XoopsFormText(_AM_TDMCREATE_FIELDNAME, "table_fieldname", 30, 50, $obj->getVar('table_fieldname')); + $table_fieldname->setDescription(_AM_TDMCREATE_FIELDNAME_DESC); $this->addElement($table_fieldname); - $table_nbfield = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, "table_nbfields", 30, 50, $obj->getVar('table_nbfields')); - //$table_nbfield->setDescription(_AM_TDMCREATE_NBFIELDS_DESC); + $table_nbfield = new XoopsFormText(_AM_TDMCREATE_NBFIELDS, "table_nbfields", 10, 25, $obj->getVar('table_nbfields')); + $table_nbfield->setDescription(_AM_TDMCREATE_NBFIELDS_DESC); $this->addElement($table_nbfield, true); $table_image = $obj->getVar('table_image') ? $obj->getVar('table_image') : 'blank.gif'; - $dirFrame = "Frameworks/moduleclasses/icons/32"; - $dirMedia = "media/xoops/images/icons/32"; + $uploadirFrame = "Frameworks/moduleclasses/icons/32"; + $uploadirMedia = "media/xoops/images/icons/32"; $uploads_dir = "uploads/tdmcreate/images/tables"; - if(is_dir(XOOPS_ROOT_PATH . $dirFrame)){ - $uploadirectory = $dirFrame; - }elseif(is_dir(XOOPS_ROOT_PATH . $dirMedia)){ - $uploadirectory = $dirMedia; + if(is_dir(XOOPS_ROOT_PATH . $uploadirFrame)){ + $uploadirectory = $uploadirFrame; + }elseif(is_dir(XOOPS_ROOT_PATH . $uploadirMedia)){ + $uploadirectory = $uploadirMedia; }else{ - $uploadirectory = $uploads_dir;/**/ + $uploadirectory = $uploads_dir; } // - $imgtray1 = new XoopsFormElementTray(_AM_TDMCREATE_IMAGE,'<br />'); + $imgtray1 = new XoopsFormElementTray(_AM_TDMCREATE_IMAGE,'<br />'); + if(is_dir(XOOPS_ROOT_PATH . $uploadir)) { + $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, '.'.$uploadir.'/'); + }else{ + $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, $uploads_dir); + } $imgpath_img = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './'.$uploadirectory.'/'); $imageselect1 = new XoopsFormSelect($imgpath_img, 'table_image', $table_image, 4); $image_array1 = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH.'/'.$uploadirectory ); @@ -82,7 +83,7 @@ $imgtray1->addElement($fileseltray1); $this->addElement($imgtray1); - $options_tray = new XoopsFormElementTray(_OPTIONS, ''); + $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />'); $table_blocks = $obj->isNew() ? 0 : $obj->getVar('table_blocks'); $check_blocks = new XoopsFormCheckBox(' ', "table_blocks", $table_blocks); $check_blocks->addOption(1, _AM_TDMCREATE_BLOCKS); @@ -109,10 +110,13 @@ $options_tray->addElement($check_comments); $table_notify = $obj->isNew() ? 0 : $obj->getVar('table_notify'); $check_notify = new XoopsFormCheckBox(' ', "table_notify", $table_notify); - $check_notify->addOption(1, _AM_TDMCREATE_NOTIFIES); + $check_notify->addOption(1, _AM_TDMCREATE_NOTIFY); $options_tray->addElement($check_notify); - $this->addElement($options_tray); - + $this->addElement($options_tray); + + if (!$obj->isNew()) { + $this->addElement(new XoopsFormHidden('id', $obj->getVar('table_id'))); + } $this->addElement(new XoopsFormHidden('op', 'save')); //$sendAction $this->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -45,14 +45,14 @@ //Creation of the "repository/modules" folder in uploads $repository_modules = $repository_uploads."/modules"; - if(!is_dir($repository_modules)) + if(!is_dir$repository_modules)) mkdir($repository_modules, 0777); chmod($repository_modules, 0777); copy($indexFile, $repository_modules."/index.html"); //Creation of the "repository/extensions" folder in uploads $repository_extensions = $repository_uploads."/extensions"; - if(!is_dir($repository_extensions)) + if(!is_dir$repository_extensions)) mkdir($repository_extensions, 0777); chmod($repository_extensions, 0777); copy($indexFile, $repository_extensions."/index.html"); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php 2013-01-17 12:56:05 UTC (rev 10827) @@ -108,9 +108,6 @@ define("_AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST", "Comments"); define("_AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST", "Notifications"); -define("_AM_TDMCREATE_EXTENSION_ADD", "Add a new extension"); -define("_AM_TDMCREATE_EXTENSION_EDIT", "Edit extension"); - define("_AM_TDMCREATE_EXTENSION_IMPORTANT", "Information"); define("_AM_TDMCREATE_EXTENSION_NOTIMPORTANT", "Optional Information"); define("_AM_TDMCREATE_EXTENSION_ID", "Id"); @@ -140,7 +137,6 @@ define("_AM_TDMCREATE_EXTENSION_SVN", "Subversion module"); define("_AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN", "Visible Admin"); define("_AM_TDMCREATE_EXTENSION_DISPLAY_USER", "Visible User"); -define("_AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU", "Visible Submenu"); define("_AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH", "Enable Search"); define("_AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS", "Enable Comments"); define("_AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES", "Enable Notifies"); @@ -151,13 +147,13 @@ define("_AM_TDMCREATE_EXTENSION_DISPLAY_USER_LIST", "User"); define("_AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU_LIST", "Submenu"); define("_AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH_LIST", "Search"); -define("_AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS_LIST", "Comments"); -define("_AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES_LIST", "Notifications"); +define("_AM_TDMCREATE_EXTENSION_ACTIVE_COMS_LIST", "Comments"); +define("_AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFY_LIST", "Notifications"); define("_AM_TDMCREATE_EXTENSIONS_LIST", "Extension List"); //Tables.php //Form1 -define("_AM_TDMCREATE_TABLE_ADD", "Add a new table"); +define("_AM_TDMCREATE_TABLE_ADD", "Add Table"); define("_AM_TDMCREATE_TABLE_EDIT", "Edit Table"); define("_AM_TDMCREATE_TABLE_MODULES", "Choose a module"); define("_AM_TDMCREATE_TABLE_NAME", "Table Name"); @@ -293,10 +289,6 @@ define("_AM_TDMCREATE_DELETE", "Delete"); define("_AM_TDMCREATE_UPLOADS", "Uploads"); define("_AM_TDMCREATE_IMAGE_PATH", "Image Path: %s"); -define("_AM_TDMCREATE_SUBMENU", "Submenu"); -define("_AM_TDMCREATE_SEARCH", "Search"); -define("_AM_TDMCREATE_COMMENTS", "Comments"); -define("_AM_TDMCREATE_NOTIFIES", "Notifies"); //Error NoFrameworks define('_AM_MODULEADMIN_MISSING', "Error: You don't use the Frameworks \"admin module\". Please install this Frameworks"); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html 2013-01-17 12:56:05 UTC (rev 10827) @@ -1,76 +1,73 @@ <{includeq file="admin:system|admin_navigation.html"}> <{includeq file="admin:system|admin_buttons.html"}> -<{if $extensions_list}> - <{if $extension}> - <table width='100%' cellspacing='1' class='outer'> - <thead> - <tr> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ID}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_NAME}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_VERSION}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_IMAGE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_RELEASE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES_LIST}></th> - <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> +<{if $extension}> +<table width='100%' cellspacing='1' class='outer'> + <thead> + <tr> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ID}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_NAME}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_VERSION}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_IMAGE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_RELEASE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_STATUS}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_COMS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFY_LIST}></th> + <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> + </tr> + </thead> + <tbody> + <{foreach item=extension from=$extensions}> + <tr class='<{cycle values='even,odd'}>'> + <td class='center'><{$extension.ext_id}></td> + <td class='center'><{$extension.ext_name}></td> + <td class='center'><{$extension.ext_version}></td> + <td class='center'><img src='<{$eimg_path}><{$extension.ext_image}>' height='25px' title='<{$extension.ext_name}>' alt='<{$extension.ext_name}>' /></td> + <td class='center'><{$extension.ext_release}></td> + <td class='center'><{$extension.ext_status}></td> + <td class='center'><{$extension.ext_display_admin}></td> + <td class='center'><{$extension.ext_display_user}></td> + <td class='center'><{$extension.ext_display_submenu}></td> + <td class='center'><{$extension.ext_active_search}></td> + <td class='center'><{$extension.ext_active_comments}></td> + <td class='center'><{$extension.ext_active_notifies}></td> + <td class='xo-actions txtcenter width5'> + <a href='extensions.php?op=edit&id=<{$extension.ext_id}>' title='<{$smarty.const._EDIT}>'> + <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> + <a href='extensions.php?op=delete&id=<{$extension.ext_id}>' title='<{$smarty.const._DELETE}>'> + <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> + </td> </tr> - </thead> - <tbody> - <{foreach item=extension from=$extensions}> - <tr class='<{cycle values='even,odd'}>'> - <td class='center'><{$extension.ext_id}></td> - <td class='center'><{$extension.ext_name}></td> - <td class='center'><{$extension.ext_version}></td> - <td class='center'><img src='<{$eimg_path}><{$extension.ext_image}>' height='25px' title='<{$extension.ext_name}>' alt='<{$extension.ext_name}>' /></td> - <td class='center'><{$extension.ext_release}></td> - <td class='center'><{$extension.ext_status}></td> - <td class='center'><{$extension.ext_display_admin}></td> - <td class='center'><{$extension.ext_display_user}></td> - <td class='center'><{$extension.ext_display_submenu}></td> - <td class='center'><{$extension.ext_active_search}></td> - <td class='center'><{$extension.ext_active_comments}></td> - <td class='center'><{$extension.ext_active_notifies}></td> - <td class='xo-actions txtcenter width5'> - <a href='extensions.php?op=edit&id=<{$extension.ext_id}>' title='<{$smarty.const._EDIT}>'> - <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> - <a href='extensions.php?op=delete&id=<{$extension.ext_id}>' title='<{$smarty.const._DELETE}>'> - <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> - </td> - </tr> - <{/foreach}> - </tbody> - </table><br /> - <{$pagenav}> - <{else}> - <table width='100%' cellspacing='1' class='outer'> - <thead> - <tr> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ID}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_NAME}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_VERSION}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_IMAGE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_RELEASE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES_LIST}></th> - <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> - </tr> - </thead> - <tbody> - <tr><td class='errorMsg center' colspan='12'>No Extensions</td></tr> - </tbody> - </table><br /> - <{/if}> + <{/foreach}> + </tbody> +</table><br /> + <{$pagenav}> <{else}> +<table width='100%' cellspacing='1' class='outer'> + <thead> + <tr> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ID}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_NAME}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_VERSION}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_IMAGE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_RELEASE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_STATUS}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_COMS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFY_LIST}></th> + <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> + </tr> + </thead> + <tbody> + <tr><td class='errorMsg center' colspan='12'>No Extensions</td></tr> + </tbody> +</table><br /> +<{/if}> <!-- Display form (add,edit) --> -<{$form}> -<{/if}> \ No newline at end of file +<{$form}> \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html 2013-01-17 12:56:05 UTC (rev 10827) @@ -1,76 +1,73 @@ <{includeq file="admin:system|admin_navigation.html"}> <{includeq file="admin:system|admin_buttons.html"}> -<{if $modules_list}> - <{if $module}> - <table width='100%' cellspacing='1' class='outer'> - <thead> - <tr> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> - <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> - </tr> - </thead> - <tbody> - <{foreach item=module from=$modules}> - <tr class='<{cycle values='even,odd'}>'> - <td class='center'><{$module.mod_id}></td> +<{if $module}> +<table width='100%' cellspacing='1' class='outer'> + <thead> + <tr> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> + <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> + </tr> + </thead> + <tbody> + <{foreach item=module from=$modules}> + <tr class='<{cycle values='even,odd'}>'> + <td class='center'><{$module.mod_id}></td> <td class='center'><{$module.mod_name}></td> - <td class='center'><{$module.mod_version}></td> - <td class='center'><img src='<{$mimg_path}><{$module.mod_image}>' height='25px' title='<{$module.mod_name}>' alt='<{$module.mod_name}>' /></td> - <td class='center'><{$module.mod_release}></td> - <td class='center'><{$module.mod_status}></td> - <td class='center'><{$module.mod_display_admin}></td> - <td class='center'><{$module.mod_display_user}></td> - <td class='center'><{$module.mod_display_submenu}></td> - <td class='center'><{$module.mod_active_search}></td> - <td class='center'><{$module.mod_active_comments}></td> - <td class='center'><{$module.mod_active_notifies}></td> - <td class='xo-actions txtcenter width5'> - <a href='modules.php?op=edit&mod_id=<{$module.mod_id}>' title='<{$smarty.const._EDIT}>'> - <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> - <a href='modules.php?op=delete&mod_id=<{$module.mod_id}>' title='<{$smarty.const._DELETE}>'> - <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> - </td> - </tr> - <{/foreach}> - </tbody> - </table><br /> - <{$pagenav}> - <{else}> - <table width='100%' cellspacing='1' class='outer'> - <thead> - <tr> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> - <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> + <td class='center'><{$module.mod_version}></td> + <td class='center'><img src='<{$mimg_path}><{$module.mod_image}>' height='25px' title='<{$module.mod_name}>' alt='<{$module.mod_name}>' /></td> + <td class='center'><{$module.mod_release}></td> + <td class='center'><{$module.mod_status}></td> + <td class='center'><{$module.mod_display_admin}></td> + <td class='center'><{$module.mod_display_user}></td> + <td class='center'><{$module.mod_display_submenu}></td> + <td class='center'><{$module.mod_active_search}></td> + <td class='center'><{$module.mod_active_comments}></td> + <td class='center'><{$module.mod_active_notifies}></td> + <td class='xo-actions txtcenter width5'> + <a href='modules.php?op=edit&mod_id=<{$module.mod_id}>' title='<{$smarty.const._EDIT}>'> + <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> + <a href='modules.php?op=delete&mod_id=<{$module.mod_id}>' title='<{$smarty.const._DELETE}>'> + <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> + </td> </tr> - </thead> - <tbody> - <tr><td class='errorMsg center' colspan='12'>No Modules</td></tr> - </tbody> - </table><br /> - <{/if}> + <{/foreach}> + </tbody> +</table><br /> + <{$pagenav}> <{else}> +<table width='100%' cellspacing='1' class='outer'> + <thead> + <tr> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> + <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> + </tr> + </thead> + <tbody> + <tr><td class='errorMsg center' colspan='12'>No Modules</td></tr> + </tbody> +</table><br /> +<{/if}> <!-- Display form (add,edit) --> -<{$form}> -<{/if}> \ No newline at end of file +<{$form}> \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-01-17 12:13:03 UTC (rev 10826) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-01-17 12:56:05 UTC (rev 10827) @@ -1,102 +1,99 @@ <{includeq file="admin:system|admin_navigation.html"}> <{includeq file="admin:system|admin_buttons.html"}> -<{if $tables_list}> - <{if $module}> - <table width='100%' cellspacing='1' class='outer'> - <thead> - <tr> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> - <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> +<{if $module}> +<table width='100%' cellspacing='1' class='outer'> + <thead> + <tr> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> + <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> + </tr> + </thead> + <tbody> + <{foreach item=module from=$modules}> + <tr class='<{cycle values='even,odd'}>'> + <td class='center'><{$module.mod_id}></td> + <td class='center'><{$module.mod_name}></td> + <td class='center'><{$module.mod_version}></td> + <td class='center'><img src='<{$mimg_path}><{$module.mod_image}>' height='25px' title='<{$module.mod_name}>' alt='<{$module.mod_name}>' /></td> + <td class='center'><{$module.mod_release}></td> + <td class='center'><{$module.mod_status}></td> + <td class='center'><{$module.mod_display_admin}></td> + <td class='center'><{$module.mod_display_user}></td> + <td class='center'><{$module.mod_display_submenu}></td> + <td class='center'><{$module.mod_active_search}></td> + <td class='center'><{$module.mod_active_comments}></td> + <td class='center'><{$module.mod_active_notifies}></td> + <td class='xo-actions txtcenter width5'> + <a href='modules.php?op=edit&id=<{$module.mod_id}>' title='<{$smarty.const._EDIT}>'> + <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> + <a href='modules.php?op=delete&id=<{$module.mod_id}>' title='<{$smarty.const._DELETE}>'> + <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> + </td> </tr> - </thead> - <tbody> - <{foreach item=module from=$modules}> - <tr class='<{cycle values='even,odd'}>'> - <td class='center'><{$module.mod_id}></td> - <td class='center'><{$module.mod_name}></td> - <td class='center'><{$module.mod_version}></td> - <td class='center'><img src='<{$mimg_path}><{$module.mod_image}>' height='25px' title='<{$module.mod_name}>' alt='<{$module.mod_name}>' /></td> - <td class='center'><{$module.mod_release}></td> - <td class='center'><{$module.mod_status}></td> - <td class='center'><{$module.mod_display_admin}></td> - <td class='center'><{$module.mod_display_user}></td> - <td class='center'><{$module.mod_display_submenu}></td> - <td class='center'><{$module.mod_active_search}></td> - <td class='center'><{$module.mod_active_comments}></td> - <td class='center'><{$module.mod_active_notifies}></td> - <td class='xo-actions txtcenter width5'> - <a href='modules.php?op=edit&id=<{$module.mod_id}>' title='<{$smarty.const._EDIT}>'> - <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> - <a href='modules.php?op=delete&id=<{$module.mod_id}>' title='<{$smarty.const._DELETE}>'> - <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> - </td> - </tr> - <{if $table}> - <{foreach item=table from=$tables}> - <tr class='<{cycle values='even,odd'}>'> - <td class='center'><{$table.table_id}></td> - <td class='center'><{$table.table_name}></td> - <td class='center'><{$table.table_mid}></td> - <td class='center'><img src='<{$timg_path}><{$table.table_image}>' height='25px' title='<{$table.table_name}>' alt='<{$table.table_name}>' /></td> - <td class='center'><{$table.table_nbfields}></td> - <td class='center'><{$table.table_blocks}></td> - <td class='center'><{$table.table_admin}></td> - <td class='center'><{$table.table_user}></td> - <td class='center'><{$table.table_submenu}></td> - <td class='center'><{$table.table_search}></td> - <td class='center'><{$table.table_comments}></td> - <td class='center'><{$table.table_notifies}></td> - <td class='xo-actions txtcenter width5'> - <a href='tables.php?op=edit&id=<{$table.table_id}>' title='<{$smarty.const._EDIT}>'> - <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> - <a href='fields.php?op=edit&id=<{$table.table_id}>' title='<{$smarty.const._EDITFIELDS}>'> - <img src='<{xoAdminIcons fields.png}>' alt='<{$smarty.const._EDITFIELDS}>' /></a> - <a href='tables.php?op=delete&id=<{$table.table_id}>' title='<{$smarty.const._DELETE}>'> - <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> - </td> - </tr> - <{/foreach}> - <{/if}> - <{/foreach}> - </tbody> - </table><br /> - <{$pagenav}> - <{else}> - <table width='100%' cellspacing='1' class='outer'> - <thead> - <tr> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> - <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> - </tr> - </thead> - <tbody> - <tr><td class='errorMsg center' colspan='12'>No Tables</td></tr> - </tbody> - </table><br /> - <{/if}> + <{if $table}> + <{foreach item=table from=$tables}> + <tr class='<{cycle values='even,odd'}>'> + <td class='center'><{$table.table_id}></td> + <td class='center'><{$table.table_name}></td> + <td class='center'><{$table.table_mid}></td> + <td class='center'><img src='<{$timg_path}><{$table.table_image}>' height='25px' title='<{$table.table_name}>' alt='<{$table.table_name}>' /></td> + <td class='center'><{$table.table_nbfields}></td> + <td class='center'><{$table.table_blocks}></td> + <td class='center'><{$table.table_admin}></td> + <td class='center'><{$table.table_user}></td> + <td class='center'><{$table.table_submenu}></td> + <td class='center'><{$table.table_search}></td> + <td class='center'><{$table.table_comments}></td> + <td class='center'><{$table.table_notifies}></td> + <td class='xo-actions txtcenter width5'> + <a href='tables.php?op=edit&id=<{$table.table_id}>' title='<{$smarty.const._EDIT}>'> + <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> + <a href='fields.php?op=edit&id=<{$table.table_id}>' title='<{$smarty.const._EDITFIELDS}>'> + <img src='<{xoAdminIcons fields.png}>' alt='<{$smarty.const._EDITFIELDS}>' /></a> + <a href='tables.php?op=delete&id=<{$table.table_id}>' title='<{$smarty.const._DELETE}>'> + <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> + </td> + </tr> + <{/foreach}> + <{/if}> + <{/foreach}> + </tbody> +</table><br /> + <{$pagenav}> <{else}> +<table width='100%' cellspacing='1' class='outer'> + <thead> + <tr> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ID}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NAME}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_VERSION}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> + <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> + </tr> + </thead> + <tbody> + <tr><td class='errorMsg center' colspan='12'>No Tables</td></tr> + </tbody> +</table><br /> +<{/if}> <!-- Display form (add,edit) --> -<{$form}> -<{/if}> \ No newline at end of file +<{$form}> \ No newline at end of file |
From: <txm...@us...> - 2013-02-05 21:20:48
|
Revision: 10991 http://sourceforge.net/p/xoops/svn/10991 Author: txmodxoops Date: 2013-02-05 21:20:43 +0000 (Tue, 05 Feb 2013) Log Message: ----------- Review all files with minor modifications Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -38,14 +38,15 @@ $admin_page = new XoopsModuleAdmin(); $admin_page->renderNavigation('building.php'); switch ($op) { + case "default": + default: + //tdmcreate_getBuildingForm(); + break; + case "build": $mods =& $modules_Handler->get($_REQUEST['mod_name']); $mods_name = $mods->getVar('mod_name'); - break; - - case "default": - default: - //tdmcreate_getBuildingForm(); + break; } $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -53,7 +53,8 @@ $numrows = $extensions_Handler->getCount($criteria); $xoops->tpl()->assign('eimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/extensions/'); $xoops->tpl()->assign('extensions', $extensions_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('extension', true); + $xoops->tpl()->assign('extensions_list', true); + $xoops->tpl()->assign('extension', true); unset($criteria); // Display Page Navigation if ($numrows > $nb_pager) { @@ -62,9 +63,9 @@ } break; case "new": - $admin_page->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php?op=list', 'list'); + $admin_page->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); $admin_page->renderButton(); - + $obj = $extensions_Handler->create(); $form = $xoops->getModuleForm($obj, 'extensions'); $xoops->tpl()->assign('form', $form->render()); @@ -122,11 +123,11 @@ "ext_active_search" => (($_REQUEST["ext_active_search"] == 1) ? "1" : "0"), "ext_active_comments" => (($_REQUEST["ext_active_comments"] == 1) ? "1" : "0"), "ext_active_notifies" => (($_REQUEST["ext_active_notifies"] == 1) ? "1" : "0"))); - + // Insert Data if ($extensions_Handler->insert($obj)) { redirect_header("extensions.php?op=list", 2, _AM_TDMCREATE_FORMOK); } - + // Form Data $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'extensions'); $xoops->tpl()->assign('form', $form->render()); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -78,7 +78,7 @@ break; case "new": - $admin_page->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list'); + $admin_page->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); $admin_page->renderButton(); $obj = $fields_Handler->create(); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -20,6 +20,12 @@ * @version $Id: header.php 10665 2012-12-27 10:14:15Z timgno $ */ require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; -// Get XoopsLoad +include_once dirname(dirname(__FILE__)) . '/include/common.php'; +include_once dirname(dirname(__FILE__)) . '/include/functions.php'; +// Get XoopsLoad system +XoopsLoad::load('system', 'system'); +// Get main instance +$system = System::getInstance(); $xoops = Xoops::getInstance(); -XoopsLoad::load('system', 'system'); \ No newline at end of file +// Get admin menu istance +$admin_menu = new XoopsModuleAdmin(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -23,8 +23,14 @@ // Get main instance $system = System::getInstance(); $xoops = Xoops::getInstance(); +// Preferences Limit +$nb_pager = $xoops->getModuleConfig('pager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +// Get limit pager +$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); +// Get start pager +$start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // heaser $xoops->header('tdmcreate_import.html'); // Get handler @@ -44,7 +50,8 @@ $criteria->setStart($start); $criteria->setLimit($limit); $numrows = $import_Handler->getCount($criteria); - $xoops->tpl()->assign('imports', $import_Handler->getObjects($criteria, true, false)); + $xoops->tpl()->assign('imports', $import_Handler->getObjects($criteria, true, false)); + $xoops->tpl()->assign('imports_list', true); $xoops->tpl()->assign('import', true); unset($criteria); // Display Page Navigation @@ -55,7 +62,7 @@ break; case "import": - $admin_page->addItemButton(_AM_TDMCREATE_IMPORT_LIST, 'import.php?op=list', 'list'); + $admin_page->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); $admin_page->renderButton(); $obj = $import_Handler->create(); @@ -73,14 +80,66 @@ } else { $obj = $import_Handler->create(); } - //Form module save - $obj->setVars(array("import_mid" => $_POST["import_mid"], "import_name" => $_POST["import_name"], + + // File recovery + $file = $_FILES['import_oldmod']; + // Temporary file name + $filename = $file['tmp_name']; + // File size + $filesize = $file['size']; + + // Check that the file was inserted and that there is + if ( ($handle = fopen($filename, "r") ) !== false) { + // Use a counter to see what line are comments + $counts = 0; + // Use the fgets function to retrieve the information in the sql file + // The second parameter is the size of the file, we have recovered over + while ( ( $data = fget($handle, $filesize) ) !== false ) { + if ( preg_match( '/\#/', $data ) ) { + $counts++; + // Check for a $fields_table variable, the first row of the field name of the sql + $fields_table = $data; + } else { + // Recupero i nomi dei campi + $campo_nome = $fields_table[0]; + $campo_cognome = $fields_table[1]; + $campo_indirizzo = $fields_table[2]; + $campo_mail = $fields_table[3]; + $campo_telefono = $fields_table[4]; + + // Recupero i valori dei campi + $nome = $data[0]; + $cognome = $data[1]; + $indirizzo = $data[2]; + $mail = $data[3]; + $telefono = $data[4]; + + // Creo una query di inserimento e la eseguo + $sql = " + INSERT INTO utenti SET + $campo_nome = '$nome', + $campo_cognome = '$cognome', + $campo_indirizzo = '$indirizzo', + $campo_mail = '$mail', + $campo_telefono = '$telefono' + "; + $rssql = mysql_query( $sql ); + // Controllo che l'importazione sia avvenuta con successo + //Form imported save + $obj->setVars(array("import_mid" => $_POST["import_mid"], "import_name" => $_POST["import_name"], "import_nbtables" => $_POST["import_nbtables"], "import_tablename" => $_POST["import_tablename"], - "import_nbfields" => $_POST["import_nbfields"], "import_fieldname" => $_POST["import_fieldname"])); - + "import_nbfields" => $_POST["import_nbfields"], "import_fieldname" => $_POST["import_fieldname"])); + } + } + } + else + redirect_header("import.php?op=list", 3, "Nessun file inserito"); + + fclose($handle); + if ($import_Handler->insert($obj)) { redirect_header("import.php?op=list", 3, _AM_TDMCREATE_FORMOK); - } + } $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'import'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** * tdmcreate module * @@ -20,58 +19,73 @@ * @version $Id: modules.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; -// Get main instance -$system = System::getInstance(); -$xoops = Xoops::getInstance(); // Preferences Limit -$nb_pager = $xoops->getModuleConfig('pager'); +$nb_pager = $xoops->getModuleConfig('adminpager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); // Get limit pager $limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); // Get start pager $start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); -// heaser +// Get handler $xoops->header('tdmcreate_modules.html'); -// Get handler -/* @var $extensions_handler TDMCreateExtensionsHandler */ +/* @var $modules_handler TDMCreateModulesHandler */ $modules_Handler = $xoops->getModuleHandler('modules'); -$admin_page = new XoopsModuleAdmin(); -$admin_page->renderNavigation('modules.php'); +$admin_menu->renderNavigation('modules.php'); switch ($op) { - case "list": + case 'list': default: - $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_MODULE, 'modules.php?op=new', 'add'); - $admin_page->renderButton(); - $criteria = new CriteriaCompo(); - $criteria->setSort("mod_name"); - $criteria->setOrder("ASC"); + $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_MODULE, 'modules.php?op=new', 'add'); + $admin_menu->renderButton(); + // Get modules list + $criteria = new CriteriaCompo(); + $criteria->setSort('mod_name'); + $criteria->setOrder('ASC'); $criteria->setStart($start); - $criteria->setLimit($limit); - $numrows = $modules_Handler->getCount($criteria); - $xoops->tpl()->assign('mimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/modules/'); - $xoops->tpl()->assign('modules', $modules_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('module', true); - unset($criteria); - // Display Page Navigation - if ($numrows > $nb_pager) { - $nav = new XoopsPageNav($numrows, $nb_pager, $start, 'start'); - $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); - } + $criteria->setLimit($nb_pager); + $numrows_mods = $modules_Handler->getCount($criteria); + $mod_arr = $modules_Handler->getAll($criteria); + // Assign Template variables + $xoops->tpl()->assign('modules_count', $numrows_mods); + unset($criteria); + if ($numrows_mods > 0) { + foreach (array_keys($mod_arr) as $i) { + $mod['id'] = $mod_arr[$i]->getVar('mod_id'); + $mod['name'] = $mod_arr[$i]->getVar('mod_name'); + $mod['version'] = $mod_arr[$i]->getVar('mod_version'); + $mod['release'] = $mod_arr[$i]->getVar('mod_release'); + $mod['status'] = $mod_arr[$i]->getVar('mod_status'); + $mod['admin'] = $mod_arr[$i]->getVar('mod_admin'); + $mod['user'] = $mod_arr[$i]->getVar('mod_user'); + $mod['submenu'] = $mod_arr[$i]->getVar('mod_submenu'); + $mod['search'] = $mod_arr[$i]->getVar('mod_search'); + $mod['comments'] = $mod_arr[$i]->getVar('mod_comments'); + $mod['notifications'] = $mod_arr[$i]->getVar('mod_notifications'); + $xoops->tpl()->append_by_ref('modules', $mod); + unset($mod); + } + // Display Page Navigation + if ($numrows_mods > $nb_pager) { + $nav = new XoopsPageNav($numrows_mods, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', _AM_TDMCREATE_TABLE_ERROR_NOMODULES); + } break; - case "new": - $admin_page->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list'); - $admin_page->renderButton(); - + case 'new': + $admin_menu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'application-view-detail'); + $admin_menu->renderButton(); + $obj = $modules_Handler->create(); $form = $xoops->getModuleForm($obj, 'modules'); $xoops->tpl()->assign('form', $form->render()); break; - case "save": + case 'save': if (!$xoops->security()->check()) { $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); } @@ -82,63 +96,60 @@ $obj = $modules_Handler->create(); } //Form module save - $obj->setVars(array("mod_name" => $_POST["mod_name"], "mod_version" => $_POST["mod_version"], - "mod_description" => $_POST["mod_description"], "mod_author" => $_POST["mod_author"], - "mod_author_mail" => $_POST["mod_author_mail"], "mod_author_website_url" => $_POST["mod_author_website_url"], - "mod_author_website_name" => $_POST["mod_author_website_name"], "mod_credits" => $_POST["mod_credits"], - "mod_license" => $_POST["mod_license"], "mod_release_info" => $_POST["mod_release_info"], - "mod_release_file" => $_POST["mod_release_file"], "mod_manual" => $_POST["mod_manual"], - "mod_manual_file" => $_POST["mod_manual_file"])); - + $obj->setVars(array('mod_name' => $_POST['mod_name'], 'mod_version' => $_POST['mod_version'], + 'mod_description' => $_POST['mod_description'], 'mod_author' => $_POST['mod_author'], + 'mod_author_mail' => $_POST['mod_author_mail'], 'mod_author_website_url' => $_POST['mod_author_website_url'], + 'mod_author_website_name' => $_POST['mod_author_website_name'], 'mod_credits' => $_POST['mod_credits'], + 'mod_license' => $_POST['mod_license'], 'mod_release_info' => $_POST['mod_release_info'], + 'mod_release_file' => $_POST['mod_release_file'], 'mod_manual' => $_POST['mod_manual'], + 'mod_manual_file' => $_POST['mod_manual_file'])); //Form module_image - $uploaddir_path = XOOPS_UPLOAD_PATH."/tdmcreate/images/modules"; - $uploaddir_url = XOOPS_UPLOAD_URL."/tdmcreate/images/modules/"; - $uploader_img = new XoopsMediaUploader($uploaddir_path, $xoops->getModuleConfig('mimetypes'), - $xoops->getModuleConfig('maxsize'), null, null); - if ($uploader_img->fetchMedia("modules_imgurl")) { - $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["module_image"]['name']); - $img_name = $_GET['mod_name'].'_slogo.'.$extension; - $uploader_img->setPrefix($img_name); - $uploader_img->fetchMedia("modules_imgurl"); + $uploader_img = new XoopsMediaUploader( TDMC_MODULES_PATH_IMG, $xoops->getModuleConfig('mimetypes'), + $xoops->getModuleConfig('maxsize'), null, null); + if ($uploader_img->fetchMedia('modules_imgurl')) { + $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['module_image']['name']); + $img_name = 'logo.'.$extension; $uploader_img->setPrefix($img_name); + $uploader_img->fetchMedia('modules_imgurl'); if (!$uploader_img->upload()) { $errors = $uploader_img->getErrors(); - $xoops->redirect("javascript:history.go(-1)", 3, $errors); + $xoops->redirect('javascript:history.go(-1)', 3, $errors); } else { - $obj->setVar("mod_image", $uploaddir_url . $uploader_img->getSavedFileName()); + $obj->setVar('mod_image', TDMC_MODULES_URL_IMG . '/' . $uploader_img->getSavedFileName()); } } else { - if ($_POST["modules_imgurl"] == 'blank.gif') { - $obj->setVar("mod_image", $_POST["mod_image"]); + if ($_POST['modules_imgurl'] == 'blank.gif') { + $obj->setVar('mod_image', $_POST['mod_image']); } else { - $obj->setVar("mod_image", $uploaddir_url . $_POST["modules_imgurl"]); + $obj->setVar('mod_image', TDMC_MODULES_URL_IMG . '/' . $_POST['modules_imgurl']); } - } - + } //Form module save - $obj->setVars(array("mod_demo_site_url" => $_POST["mod_demo_site_url"], "mod_demo_site_name" => $_POST["mod_demo_site_name"], - "mod_forum_site_url" => $_POST["mod_forum_site_url"], "mod_forum_site_name" => $_POST["mod_forum_site_name"], - "mod_website_url" => $_POST["mod_website_url"], "mod_website_name" => $_POST["mod_website_name"], - "mod_release" => $_POST["mod_release"], "mod_status" => $_POST["mod_status"], - "mod_display_admin" => (($_REQUEST["mod_display_admin"] == 1) ? "1" : "0"), - "mod_display_user" => (($_REQUEST["mod_display_user"] == 1) ? "1" : "0"), - "mod_display_submenu" => (($_REQUEST["mod_display_submenu"] == 1) ? "1" : "0"), - "mod_active_search" => (($_REQUEST["mod_active_search"] == 1) ? "1" : "0"), - "mod_active_comments" => (($_REQUEST["mod_active_comments"] == 1) ? "1" : "0"), - "mod_active_notifies" => (($_REQUEST["mod_active_notifies"] == 1) ? "1" : "0"))); - + $obj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'], 'mod_demo_site_name' => $_POST['mod_demo_site_name'], + 'mod_forum_site_url' => $_POST['mod_forum_site_url'], 'mod_forum_site_name' => $_POST['mod_forum_site_name'], + 'mod_website_url' => $_POST['mod_website_url'], 'mod_website_name' => $_POST['mod_website_name'], + 'mod_release' => $_POST['mod_release'], 'mod_status' => $_POST['mod_status'], + 'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'), + 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'), + 'mod_submenu' => (($_REQUEST['mod_submenu'] == 1) ? '1' : '0'), + 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'), + 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'), + 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'), + 'mod_paypal' => $_REQUEST['mod_paypal'], + 'mod_subversion' => $_REQUEST['mod_subversion'])); + // Insert Data if ($modules_Handler->insert($obj)) { - redirect_header("modules.php?op=list", 2, _AM_TDMCREATE_FORMOK); + redirect_header('modules.php?op=list', 2, _AM_TDMCREATE_FORMOK); } - + // Form Data $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'modules'); $xoops->tpl()->assign('form', $form->render()); break; - case "edit": - $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_MODULE, 'modules.php?op=new', 'add'); - $admin_page->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'application-view-detail'); - $admin_page->renderButton(); + case 'edit': + $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_MODULE, 'modules.php?op=new', 'add'); + $admin_menu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'application-view-detail'); + $admin_menu->renderButton(); $id = $system->cleanVars($_REQUEST, 'mod_id', 0, 'int'); if ($id > 0) { @@ -150,21 +161,21 @@ } break; - case "delete": + case 'delete': $id = $system->cleanVars($_REQUEST, 'mod_id', 0, 'int'); if ($id > 0) { $obj = $modules_Handler->get($id); - if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { - $xoops->redirect("modules.php", 3, implode(",", $xoops->security()->getErrors())); + $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); } if ($modules_Handler->delete($obj)) { - $xoops->redirect("modules.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_MODULE)); + $xoops->redirect('modules.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_MODULE)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'modules.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('mod_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'modules.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('mod_name')) . '<br />'); } } else { $xoops->redirect('modules.php', 1, _AM_SYSTEM_DBERROR); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -20,15 +20,10 @@ * @version $Id: tables.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; -// Get main instance -$system = System::getInstance(); -$xoops = Xoops::getInstance(); // Preferences Limit -$nb_pager = $xoops->getModuleConfig('pager'); +$nb_pager = $xoops->getModuleConfig('adminpager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); -// Get limit pager -$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); // Get start pager $start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // heaser @@ -39,14 +34,13 @@ /* @var $tables_handler TDMCreateTablesHandler */ $tables_Handler = $xoops->getModuleHandler('tables'); -$admin_page = new XoopsModuleAdmin(); -$admin_page->renderNavigation('tables.php'); +$admin_manu->renderNavigation('tables.php'); switch ($op) { case "list": default: - $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); - $admin_page->renderButton(); + $admin_manu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); + $admin_manu->renderButton(); // Get modules list $criteria = new CriteriaCompo(); $criteria->setSort('mod_name'); @@ -54,33 +48,67 @@ $criteria->setStart($start); $criteria->setLimit($nb_pager); $numrows_mods = $modules_Handler->getCount($criteria); + $module_arr = $modules_Handler->getAll($criteria); + $xoops->tpl()->assign('modules_count', $numrows_mods); + unset($criteria); // Redirect if there aren't modules /* if ( $numrows_mods == 0 ) { redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); }*/ - $xoops->tpl()->assign('mimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/modules/'); - $xoops->tpl()->assign('modules', $modules_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('module', true); - unset($criteria); - // Get tables list $criteria = new CriteriaCompo(); - $criteria->setSort("table_name"); - $criteria->setOrder("ASC"); - $xoops->tpl()->assign('timg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/tables/'); - $xoops->tpl()->assign('tables', $tables_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('table', true); - unset($criteria); - // Display Page Navigation - if ($numrows_mods > $nb_pager) { - $nav = new XoopsPageNav($numrows_mods, $nb_pager, $start, 'start'); - $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); - } + $criteria->setSort('table_name'); + $criteria->setOrder('ASC'); + $criteria->setStart($start); + $criteria->setLimit($nb_pager); + $numrows_tables = $tables_Handler->getCount($criteria); + $table_arr = $tables_Handler->getAll($criteria); + $xoops->tpl()->assign('mods_count', $numrows_tables); + unset($criteria); + + // Assign Template variables + $xoops->tpl()->assign('mods_count', $numrows); + $mytree = new XoopsObjectTree($table_arr, 'table_id', 'table_mid'); + if ($numrows_mods > 0) { + foreach (array_keys($module_arr) as $i) { + $mod['id'] = $mod_arr[$i]->getVar('mod_id'); + $mod['name'] = $mod_arr[$i]->getVar('mod_name'); + $mod['version'] = $mod_arr[$i]->getVar('mod_version'); + $mod['release'] = $mod_arr[$i]->getVar('mod_release'); + $mod['status'] = $mod_arr[$i]->getVar('mod_status'); + $mod['admin'] = $mod_arr[$i]->getVar('mod_admin'); + $mod['user'] = $mod_arr[$i]->getVar('mod_user'); + $mod['submenu'] = $mod_arr[$i]->getVar('mod_submenu'); + $mod['search'] = $mod_arr[$i]->getVar('mod_search'); + $mod['comments'] = $mod_arr[$i]->getVar('mod_comments'); + $mod['notifications'] = $mod_arr[$i]->getVar('mod_notifications'); + $xoops->tpl()->append_by_ref('modules', $mod); + unset($mod); + if ($numrows_tables > 0) { + foreach (array_keys($table_arr) as $i) { + $tables['id'] = $table_arr[$i]->getVar('table_id'); + $tables['name'] = $table_arr[$i]->getVar('table_name'); + $tables['modname'] = TDMCreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); + $tables['image'] = $table_arr[$i]->getVar('table_image'); + $tables['submenu'] = $table_arr[$i]->getVar('mod_submenu'); + $xoops->tpl()->append_by_ref('tables', $tables); + unset($tables); + } + } + } + // Display Page Navigation + if ($numrows_mods > $nb_pager) { + $nav = new XoopsPageNav($numrows_mods, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', _AM_TDMCREATE_TABLE_ERROR_NOMODULES); + } break; case "new": - $admin_page->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=list', 'list'); - $admin_page->renderButton(); - + $admin_manu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); + $admin_manu->renderButton(); + $obj = $tables_Handler->create(); $form = $xoops->getModuleForm($obj, 'tables'); $xoops->tpl()->assign('form', $form->render()); @@ -99,7 +127,8 @@ //Form tables $obj->setVars(array("table_module" => $_POST["table_module"], "table_name" => $_POST["table_name"], "table_nbfields" => $_POST["table_nbfields"], "table_fieldname" => $_POST["table_fieldname"])); - //Form table_image + //Form table_image + $pathIcon32 = XOOPS_ROOT_PATH . "/media/xoops/images/icons/32"; if(is_dir($pathIcon32)){ $uploaddir = $pathIcon32; }else{ @@ -117,7 +146,7 @@ $errors = $uploader_img->getErrors(); $xoops->redirect("javascript:history.go(-1)", 3, $errors); } else { - $obj->setVar("tables_image", $uploaddir . $uploader_img->getSavedFileName()); + $obj->setVar("table_image", $uploaddir . $uploader_img->getSavedFileName()); } } else { if ($_POST["tables_image"] == 'blank.gif') { @@ -136,11 +165,10 @@ "table_comments" => (($_REQUEST["table_comments"] == 1) ? "1" : "0"), "table_notify" => (($_REQUEST["table_notify"] == 1) ? "1" : "0"))); - if( $tables_Handler->insert($obj) ) { - // if( $tables_Handler->isNew() ) - redirect_header("fields.php?op=add_fields", 3, _AM_TDMCREATE_FORMOK); - //else - // redirect_header("tables.php?op=list", 3, _AM_TDMCREATE_FORMOK); + if( $tables_Handler->insert($obj) && $obj->isNew() ) { + redirect_header("fields.php?op=new", 3, _AM_TDMCREATE_FORMOK); + } else { + redirect_header("tables.php?op=list", 3, _AM_TDMCREATE_FORMOK); } $xoops->error($obj->getHtmlErrors()); @@ -149,9 +177,9 @@ break; case "edit": - $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); - $admin_page->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); - $admin_page->renderButton(); + $admin_manu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); + $admin_manu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); + $admin_manu->renderButton(); $id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); if ($id > 0) { Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -19,23 +19,69 @@ * @author Timgno <txm...@gm...> * @version $Id: architecture.php 10665 2012-12-27 10:14:15Z timgno $ */ -if (!defined('XOOPS_ROOT_PATH')) { - die('XOOPS root path not defined'); -} +defined('XOOPS_ROOT_PATH') or die('Restricted access'); class TDMCreateFolder extends XoopsFolderHandler { - + /** + * Constructor. + * + * @param string $path Path to folder + * @param bool $create Create folder if not found + * @param mixed $mode Mode (CHMOD) to apply to created folder, false to ignore + */ + public function __construct($path = '', $create = true, $mode = false) + { + parent::__construct($path, $create, $mode); + } + + /** + * Create a directory. + * + * @param string $path The directory structure to create + * @param int|bool $mode octal value 0755 + * @access public + */ + public function create($path = '', $mode = false) + { + $this->create($path, $mode); + } + + /** + * Change the mode on a directory structure recursively. + * + * @param string $path The path to chmod + * @param int|bool $mode octal value 0755 + * @param bool $recursive chmod recursively + * @param array $exceptions array of files, directories to skip + * @return bool Returns TRUE on success, FALSE on failure + * @access public + */ + public function chmod($path, $mode) + { + $this->chmod($path, $mode); + } } class TDMCreateFile extends XoopsFileHandler { - + /** + * Constructor + * + * @param string $path Path to file + * @param boolean $create Create file if it does not exist (if true) + * @param integer $mode Mode to apply to the folder holding the file + * @access private + */ + function __construct($path, $create = false, $mode = 0755) + { + parent::__construct($path, $create, $mode); + } } -class TDMCreateStructure +class TDMCreateStructure extends TDMCreateFile { - /** + /** * folder object of the File * * @var XoopsFolderHandler @@ -43,23 +89,15 @@ */ public $mod_name = null; - /** + /** * folder object of the File * * @var XoopsFolderHandler * @access public - */ - public $folder_name = null; - - /** - * folder object of the File - * - * @var XoopsFolderHandler - * @access public */ public $file_name = null; - /** + /** * folder object of the File * * @var XoopsFolderHandler @@ -67,7 +105,7 @@ */ public $path = null; - /** + /** * folder object of the File * * @var XoopsFolderHandler @@ -75,7 +113,7 @@ */ public $copyFile = null; - /** + /** * Constructor. * * @param string $path Path to folder @@ -86,10 +124,11 @@ $this->path = $path; } - /* - * @pubblic function makeDir - * @param string $path - */ + /** + * + * @pubblic function makeDir + * @param string $path + */ public function makeDir($path) { $this->path = $path; @@ -98,37 +137,38 @@ chmod($this->path, 0705); } } - /* - * @pubblic function makeDirModule - * @param string $folder_name - */ + /** + * + * @pubblic function makeDirModule + * @param string $folder_name + */ public function makeDirInModule($folder_name) { - $this->folder_name = $folder_name; - $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name; + $this->folder = $folder_name; + $fname = $this->path . "/" .$this->mod_name. "/" .$this->folder; if(!is_dir($fname)) { mkdir($fname, 0705); chmod($fname, 0705); } } - /* - * @pubblic function makeDir & copy file - * @param string $folder_name - * @param string $copyFile - * @param string $file - */ + /** + * @pubblic function makeDir & copy file + * @param string $folder_name + * @param string $copyFile + * @param string $file + */ public function makeDirAndCopyFile($folder_name, $copyFile, $file) { $this->file_name = $file; - $this->folder_name = $folder_name; + $this->folder = $folder_name; $this->copyFile = $copyFile; - $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name; + $fname = $this->path . "/" .$this->mod_name. "/" .$this->folder; if(!is_dir($fname)) { mkdir($fname, 0705); chmod($fname, 0705); - $this->copyFile($this->folder_name, $this->copyFile, $this->file_name); + $this->copyFile($this->folder, $this->copyFile, $this->file_name); } else { - $this->copyFile($this->folder_name, $this->copyFile, $this->file_name); + $this->copyFile($this->folder, $this->copyFile, $this->file_name); } } /* @@ -140,9 +180,9 @@ public function copyFile($folder_name, $copyFile, $file) { $this->file_name = $file; - $this->folder_name = $folder_name; + $this->folder = $folder_name; $this->copyFile = $copyFile; - $fname = $this->path . "/" .$this->module_name. "/" .$this->folder_name. "/". $this->file_name; + $fname = $this->path . "/" .$this->mod_name. "/" .$this->folder. "/". $this->file_name; /*if(!file_exists($fname)) { chmod($fname, 0777); copy($this->copieFile, $fname); @@ -150,4 +190,31 @@ copy($this->copyFile, $fname); //} } +} + +class TDMCreateXoopsVersion extends TDMCreateFile +{ + /** + * Constructor + * + * @param string $path Path to file + * @param boolean $create Create file if it does not exist (if true) + * @param integer $mode Mode to apply to the folder holding the file + * @access private + */ + function __construct($path, $create = false, $mode = 0755) + { + parent::__construct($path, $create, $mode); + } + + /* + * @pubblic function createXoopsVersion + * @param string $folder + * @param string $file + */ + public function createXoopsVersion($folder, $file, $elements = array()) + { + $this->file = $file; + $this->folder = $folder; + } } \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -30,14 +30,14 @@ { $xoops = Xoops::getInstance(); - $title = $obj->isNew() ? sprintf(_AM_TDMCREATE_MODULE_ADD) : sprintf(_AM_TDMCREATE_MODULE_EDIT); + $title = $obj->isNew() ? sprintf(_AM_TDMCREATE_EXTENSION_ADD) : sprintf(_AM_TDMCREATE_EXTENSION_EDIT); parent::__construct($title, 'form', 'extensions.php', 'post', true); $this->setExtra('enctype="multipart/form-data"'); - $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_IMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, "ext_name", 50, 255, $obj->getVar('ext_name')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, "ext_version", 10, 25, $obj->getVar('ext_version')), true); + $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_EXTENSION_IMPORTANT.'</b></div>','head'); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_NAME, "ext_name", 50, 255, $obj->getVar('ext_name')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_VERSION, "ext_version", 30, 50, $obj->getVar('ext_version')), true); $editor_configs=array(); $editor_configs["name"] = 'ext_description'; $editor_configs["value"] = $obj->getVar('ext_description', 'e'); @@ -46,39 +46,39 @@ $editor_configs["width"] = "100%"; $editor_configs["height"] = "400px"; $editor_configs["editor"] = $xoops->getModuleConfig('editor'); - $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, "ext_description", $editor_configs), true ); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, "ext_author", 50, 255, $obj->getVar('ext_author')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, "ext_license", 50, 255, $obj->getVar('ext_license')), true); + $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_EXTENSION_DESCRIPTION, "ext_description", $editor_configs), true ); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR, "ext_author", 50, 255, $obj->getVar('ext_author')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_LICENSE, "ext_license", 50, 255, $obj->getVar('ext_license')), true); $option_tray = new XoopsFormElementTray(_OPTIONS, ' '); $display_admin = $obj->isNew() ? 0 : $obj->getVar('ext_display_admin'); $check_display_admin = new XoopsFormCheckBox(" ", "ext_display_admin", $display_admin); - $check_display_admin->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_ADMIN); + $check_display_admin->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN); $option_tray->addElement($check_display_admin); $display_user = $obj->isNew() ? 0 : $obj->getVar('ext_display_user'); $check_display_user = new XoopsFormCheckBox(" ", "ext_display_user", $display_user); - $check_display_user->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_USER); + $check_display_user->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_USER); $option_tray->addElement($check_display_user); $display_submenu = $obj->isNew() ? 0 : $obj->getVar('ext_display_submenu'); $check_display_submenu = new XoopsFormCheckBox(" ", "ext_display_submenu", $display_submenu); - $check_display_submenu->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_SUBMENU); + $check_display_submenu->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU); $option_tray->addElement($check_display_submenu); $active_search = $obj->isNew() ? 0 : $obj->getVar('ext_active_search'); $check_active_search = new XoopsFormCheckBox(" ", "ext_active_search", $active_search); - $check_active_search->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_SEARCH); + $check_active_search->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH); $option_tray->addElement($check_active_search); $active_comments = $obj->isNew() ? 0 : $obj->getVar('ext_active_comments'); $check_active_comments = new XoopsFormCheckBox(" ", "ext_active_comments", $active_comments); - $check_active_comments->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_COMMENTS); + $check_active_comments->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS); $option_tray->addElement($check_active_comments); $active_notifies = $obj->isNew() ? 0 : $obj->getVar('ext_active_notifies'); $check_active_notifies = new XoopsFormCheckBox(" ", "ext_active_notifies", $active_notifies); - $check_active_notifies->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_NOTIFIES); + $check_active_notifies->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES); $option_tray->addElement($check_active_notifies); $this->addElement($option_tray); $ext_image = $obj->getVar("ext_image") ? $obj->getVar("ext_image") : 'default_slogo.png'; $uploadir = 'uploads/tdmcreate/images/extensions'; - $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE,'<br />'); + $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_EXTENSION_IMAGE,'<br />'); $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './'.$uploadir.'/'); $imageselect = new XoopsFormSelect($imgpath, 'extensions_image', $ext_image); $image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH."/".$uploadir ); @@ -94,26 +94,26 @@ $imgtray->addElement($fileseltray); $this->addElement($imgtray); - $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_NOTIMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, "ext_author_mail", 50, 255, $obj->getVar('ext_author_mail'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, "ext_author_website_url", 50, 255, $obj->getVar('ext_author_website_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, "ext_author_website_name", 50, 255, $obj->getVar('ext_author_website_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, "ext_credits", 50, 255, $obj->getVar('ext_credits'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, "ext_release_info", 50, 255, $obj->getVar('ext_release_info'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, "ext_release_file", 50, 255, $obj->getVar('ext_release_file'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, "ext_manual", 50, 255, $obj->getVar('ext_manual'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, "ext_manual_file", 50, 255, $obj->getVar('ext_manual_file'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, "ext_demo_site_url", 50, 255, $obj->getVar('ext_demo_site_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, "ext_demo_site_name", 50, 255, $obj->getVar('ext_demo_site_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_FORUM_SITE_URL, "ext_forum_site_url", 50, 255, $obj->getVar('ext_forum_site_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_FORUM_SITE_NAME, "ext_forum_site_name", 50, 255, $obj->getVar('ext_forum_site_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, "ext_website_url", 50, 255, $obj->getVar('ext_website_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, "ext_website_name", 50, 255, $obj->getVar('ext_website_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, "ext_release", 50, 255, $obj->getVar('ext_release'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, "ext_status", 50, 255, $obj->getVar('ext_status'))); + $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_EXTENSION_NOTIMPORTANT.'</b></div>','head'); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_MAIL, "ext_author_mail", 50, 255, $obj->getVar('ext_author_mail'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_WEBSITE_URL, "ext_author_website_url", 50, 255, $obj->getVar('ext_author_website_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_WEBSITE_NAME, "ext_author_website_name", 50, 255, $obj->getVar('ext_author_website_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_CREDITS, "ext_credits", 50, 255, $obj->getVar('ext_credits'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE_INFO, "ext_release_info", 50, 255, $obj->getVar('ext_release_info'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE_FILE, "ext_release_file", 50, 255, $obj->getVar('ext_release_file'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_MANUAL, "ext_manual", 50, 255, $obj->getVar('ext_manual'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_MANUAL_FILE, "ext_manual_file", 50, 255, $obj->getVar('ext_manual_file'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_DEMO_SITE_URL, "ext_demo_site_url", 50, 255, $obj->getVar('ext_demo_site_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_DEMO_SITE_NAME, "ext_demo_site_name", 50, 255, $obj->getVar('ext_demo_site_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_FORUM_SITE_URL, "ext_forum_site_url", 50, 255, $obj->getVar('ext_forum_site_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_FORUM_SITE_NAME, "ext_forum_site_name", 50, 255, $obj->getVar('ext_forum_site_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_WEBSITE_URL, "ext_website_url", 50, 255, $obj->getVar('ext_website_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_WEBSITE_NAME, "ext_website_name", 50, 255, $obj->getVar('ext_website_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE, "ext_release", 50, 255, $obj->getVar('ext_release'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_STATUS, "ext_status", 50, 255, $obj->getVar('ext_status'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPALBTN, "ext_paypal_button", 50, 255, $obj->getVar('ext_paypal_button'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SVN, "ext_subversion", 50, 255, $obj->getVar('ext_subversion'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_PAYPALBTN, "ext_paypal_button", 50, 255, $obj->getVar('ext_paypal_button'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_SVN, "ext_subversion", 50, 255, $obj->getVar('ext_subversion'))); if (!$obj->isNew()) { $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('ext_id') ) ); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -40,7 +40,7 @@ $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('mod_id') ) ); } $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, "mod_name", 50, 255, $obj->getVar('mod_name')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, "mod_version", 10, 25, $obj->getVar('mod_version')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, "mod_version", 30, 50, $obj->getVar('mod_version')), true); $editor_configs=array(); $editor_configs["name"] = 'mod_description'; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -34,40 +34,39 @@ parent::__construct($title, 'form', false, 'post', true); $this->setExtra('enctype="multipart/form-data"'); + + if (!$obj->isNew()) { + $this->addElement(new XoopsFormHidden('id', $obj->getVar('table_id'))); + } $modules_Handler =& $xoops->getModuleHandler('modules'); - $mods_select = new XoopsFormSelect(_AM_TDMCREATE_MODULES, 'table_mid', $obj->getVar('table_mid')); + $mods_select = new XoopsFormSelect(_AM_TDMCREATE_MODULES_LIST, 'table_mid', $obj->getVar('table_mid')); $mods_select->addOptionArray($modules_Handler->getList()); $this->addElement($mods_select, true); - $table_name = new XoopsFormText(_AM_TDMCREATE_NAME, "table_name", 50, 255, $obj->getVar('table_name')); - $table_name->setDescription(_AM_TDMCREATE_NAME_DESC); + $table_name = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, "table_name", 50, 255, $obj->getVar('table_name')); + //$table_name->setDescription(_AM_TDMCREATE_TABLENAME_DESC); $this->addElement($table_name, true); - $table_fieldname = new XoopsFormText(_AM_TDMCREATE_FIELDNAME, "table_fieldname", 30, 50, $obj->getVar('table_fieldname')); - $table_fieldname->setDescription(_AM_TDMCREATE_FIELDNAME_DESC); + $table_fieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, "table_fieldname", 30, 50, $obj->getVar('table_fieldname')); + //$table_fieldname->setDescription(_AM_TDMCREATE_FIELDNAME_DESC); $this->addElement($table_fieldname); - $table_nbfield = new XoopsFormText(_AM_TDMCREATE_NBFIELDS, "table_nbfields", 10, 25, $obj->getVar('table_nbfields')); - $table_nbfield->setDescription(_AM_TDMCREATE_NBFIELDS_DESC); + $table_nbfield = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, "table_nbfields", 30, 50, $obj->getVar('table_nbfields')); + //$table_nbfield->setDescription(_AM_TDMCREATE_NBFIELDS_DESC); $this->addElement($table_nbfield, true); $table_image = $obj->getVar('table_image') ? $obj->getVar('table_image') : 'blank.gif'; - $uploadirFrame = "Frameworks/moduleclasses/icons/32"; - $uploadirMedia = "media/xoops/images/icons/32"; + $dirFrame = "Frameworks/moduleclasses/icons/32"; + $dirMedia = "media/xoops/images/icons/32"; $uploads_dir = "uploads/tdmcreate/images/tables"; - if(is_dir(XOOPS_ROOT_PATH . $uploadirFrame)){ - $uploadirectory = $uploadirFrame; - }elseif(is_dir(XOOPS_ROOT_PATH . $uploadirMedia)){ - $uploadirectory = $uploadirMedia; + if(is_dir(XOOPS_ROOT_PATH . $dirFrame)){ + $uploadirectory = $dirFrame; + }elseif(is_dir(XOOPS_ROOT_PATH . $dirMedia)){ + $uploadirectory = $dirMedia; }else{ - $uploadirectory = $uploads_dir; + $uploadirectory = $uploads_dir;/**/ } // - $imgtray1 = new XoopsFormElementTray(_AM_TDMCREATE_IMAGE,'<br />'); - if(is_dir(XOOPS_ROOT_PATH . $uploadir)) { - $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, '.'.$uploadir.'/'); - }else{ - $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, $uploads_dir); - } + $imgtray1 = new XoopsFormElementTray(_AM_TDMCREATE_IMAGE,'<br />'); $imgpath_img = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './'.$uploadirectory.'/'); $imageselect1 = new XoopsFormSelect($imgpath_img, 'table_image', $table_image, 4); $image_array1 = XoopsLists :: getImgListAsArray( XOOPS_ROOT_PATH.'/'.$uploadirectory ); @@ -83,7 +82,7 @@ $imgtray1->addElement($fileseltray1); $this->addElement($imgtray1); - $options_tray = new XoopsFormElementTray(_OPTIONS, '<br />'); + $options_tray = new XoopsFormElementTray(_OPTIONS, ''); $table_blocks = $obj->isNew() ? 0 : $obj->getVar('table_blocks'); $check_blocks = new XoopsFormCheckBox(' ', "table_blocks", $table_blocks); $check_blocks->addOption(1, _AM_TDMCREATE_BLOCKS); @@ -110,13 +109,10 @@ $options_tray->addElement($check_comments); $table_notify = $obj->isNew() ? 0 : $obj->getVar('table_notify'); $check_notify = new XoopsFormCheckBox(' ', "table_notify", $table_notify); - $check_notify->addOption(1, _AM_TDMCREATE_NOTIFY); + $check_notify->addOption(1, _AM_TDMCREATE_NOTIFIES); $options_tray->addElement($check_notify); - $this->addElement($options_tray); - - if (!$obj->isNew()) { - $this->addElement(new XoopsFormHidden('id', $obj->getVar('table_id'))); - } + $this->addElement($options_tray); + $this->addElement(new XoopsFormHidden('op', 'save')); //$sendAction $this->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/modules.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/modules.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** * tdmcreate module * @@ -53,12 +52,12 @@ $this->initVar('mod_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_name')); $this->initVar('mod_release',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release')); $this->initVar('mod_status',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('status')); - $this->initVar('mod_display_admin',XOBJ_DTYPE_INT,$xoops->getModuleConfig('display_admin')); - $this->initVar('mod_display_user',XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_user')); - $this->initVar('mod_display_submenu', XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_submenu')); - $this->initVar('mod_active_search',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_search')); - $this->initVar('mod_active_comments',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_comments')); - $this->initVar('mod_active_notifies', XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_notifies')); + $this->initVar('mod_admin',XOBJ_DTYPE_INT,$xoops->getModuleConfig('display_admin')); + $this->initVar('mod_user',XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_user')); + $this->initVar('mod_submenu', XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_submenu')); + $this->initVar('mod_search',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_search')); + $this->initVar('mod_comments',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_comments')); + $this->initVar('mod_notifies', XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_notifies')); $this->initVar('mod_paypal_button', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('paypal_button')); $this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('subversion')); } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php 2013-02-05 21:11:19 UTC (rev 10990) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php 2013-02-05 21:20:43 UTC (rev 10991) @@ -28,19 +28,19 @@ */ public function __construct() { - $this->initVar("table_id", XOBJ_DTYPE_INT, null, true); - $this->initVar("table_mid", XOBJ_DTYPE_INT, null); - $this->initVar("table_name", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("table_nbfields", XOBJ_DTYPE_INT, null); - $this->initVar("table_fieldname", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("table_image", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("table_blocks", XOBJ_DTYPE_INT, null); - $this->initVar("table_display_admin", XOBJ_DTYPE_INT, null); - $this->initVar("table_display_user", XOBJ_DTYPE_INT, null); - $this->initVar("table_submenu", XOBJ_DTYPE_INT, null); - $this->initVar("table_search", XOBJ_DTYPE_INT, null); - $this->initVar("table_comments", XOBJ_DTYPE_INT, null); - $this->initVar("table_notify", XOBJ_DTYPE_INT, null); + $this->initVar('table_id', XOBJ_DTYPE_INT, null, true); + $this->initVar('table_mid', XOBJ_DTYPE_INT, null); + $this->initVar('table_name', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('table_nbfields', XOBJ_DTYPE_INT, null); + $this->initVar('table_fieldname', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('table_image', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('table_blocks', XOBJ_DTYPE_INT, null); + $this->initVar('table_display_admin', XOBJ_DTYPE_INT, null); + $this->initVar('table_display_user', XOBJ_DTYPE_INT, null); + $this->initVar('table_submenu', XOBJ_DTYPE_INT, null); + $this->initVar('table_search', XOBJ_DTYPE_INT, null); + $this->initVar('table_comments', XOBJ_DTYPE_INT, null); + $this->initVar('table_notify', XOBJ_DTYPE_INT, null); } } @@ -51,7 +51,6 @@ */ public function __construct(XoopsDatabase $db = null) { - parent::__construct($db, "tdmcreate_tables", "tdmcreatetables", "table_id", "table_name"); + parent::__construct($db, 'tdmcreate_tables', 'tdmcreatetables', 'table_id', 'table_name'); } -} -?> \ No newline at en... [truncated message content] |
From: <txm...@us...> - 2013-02-07 21:28:27
|
Revision: 11008 http://sourceforge.net/p/xoops/svn/11008 Author: txmodxoops Date: 2013-02-07 21:28:19 +0000 (Thu, 07 Feb 2013) Log Message: ----------- Added more files Updated all Added Locale folder and files Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/common.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/forms.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/functions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/templates/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/templates/help.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/templates/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/index.html Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -8,21 +8,17 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** - * tdmcreate extension + * 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 TDM Xoops (AKA Developers) - * @version $Id: extensions.php 10665 2012-12-27 10:14:15Z timgno $ + * @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 XOOPS Development Team + * @version $Id: extensions.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; -// Get main instance -$system = System::getInstance(); -$xoops = Xoops::getInstance(); // Preferences Limit $nb_pager = $xoops->getModuleConfig('pager'); // Get Action type @@ -37,41 +33,59 @@ /* @var $extensions_handler TDMCreateExtensionsHandler */ $extensions_Handler = $xoops->getModuleHandler('extensions'); -$admin_page = new XoopsModuleAdmin(); -$admin_page->renderNavigation('extensions.php'); +$admin_menu->renderNavigation('extensions.php'); switch ($op) { - case "list": + case 'list': default: - $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); - $admin_page->renderButton(); + $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); + $admin_menu->renderButton(); $criteria = new CriteriaCompo(); - $criteria->setSort("ext_name"); - $criteria->setOrder("ASC"); + $criteria->setSort('ext_name'); + $criteria->setOrder('ASC'); $criteria->setStart($start); $criteria->setLimit($limit); - $numrows = $extensions_Handler->getCount($criteria); - $xoops->tpl()->assign('eimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/extensions/'); - $xoops->tpl()->assign('extensions', $extensions_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('extensions_list', true); - $xoops->tpl()->assign('extension', true); - unset($criteria); - // Display Page Navigation - if ($numrows > $nb_pager) { - $nav = new XoopsPageNav($numrows, $nb_pager, $start, 'start'); - $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + $numrows_exts = $extensions_Handler->getCount($criteria); + $exts_arr = $extensions_Handler->getAll($criteria); + $xoops->tpl()->assign('eimg_path', TDMC_EXTENSIONS_URL_IMG); + $xoops->tpl()->assign('extensions_count', $numrows_exts); + unset($criteria); + if ($numrows_mods > 0) { + foreach (array_keys($exts_arr) as $i) { + $ext['id'] = $exts_arr[$i]->getVar('ext_id'); + $ext['name'] = $exts_arr[$i]->getVar('ext_name'); + $ext['version'] = $exts_arr[$i]->getVar('ext_version'); + $ext['release'] = $exts_arr[$i]->getVar('ext_release'); + $ext['status'] = $exts_arr[$i]->getVar('ext_status'); + $ext['admin'] = $exts_arr[$i]->getVar('ext_admin'); + $ext['user'] = $exts_arr[$i]->getVar('ext_user'); + $ext['submenu'] = $exts_arr[$i]->getVar('ext_submenu'); + $ext['search'] = $exts_arr[$i]->getVar('ext_search'); + $ext['comments'] = $exts_arr[$i]->getVar('ext_comments'); + $ext['notifications'] = $exts_arr[$i]->getVar('ext_notifications'); + $xoops->tpl()->append_by_ref('extensions', $ext); + unset($ext); + } + // Display Page Navigation + if ($numrows_exts > $nb_pager) { + $nav = new XoopsPageNav($numrows_exts, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', _AM_TDMCREATE_EXTENSION_ERROR_NOEXTENSIONS); } break; - case "new": - $admin_page->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); - $admin_page->renderButton(); + + case 'new': + $admin_menu->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); + $admin_menu->renderButton(); $obj = $extensions_Handler->create(); $form = $xoops->getModuleForm($obj, 'extensions'); $xoops->tpl()->assign('form', $form->render()); break; - case "save": + case 'save': if (!$xoops->security()->check()) { $xoops->redirect('extensions.php', 3, implode(',', $xoops->security()->getErrors())); } @@ -82,50 +96,51 @@ $obj = $extensions_Handler->create(); } //Form extension save - $obj->setVars(array("ext_name" => $_POST["ext_name"], "ext_version" => $_POST["ext_version"], - "ext_description" => $_POST["ext_description"], "ext_author" => $_POST["ext_author"], - "ext_author_mail" => $_POST["ext_author_mail"], "ext_author_website_url" => $_POST["ext_author_website_url"], - "ext_author_website_name" => $_POST["ext_author_website_name"], "ext_credits" => $_POST["ext_credits"], - "ext_license" => $_POST["ext_license"], "ext_release_info" => $_POST["ext_release_info"], - "ext_release_file" => $_POST["ext_release_file"], "ext_manual" => $_POST["ext_manual"], - "ext_manual_file" => $_POST["ext_manual_file"])); + $obj->setVars(array('ext_name' => $_POST['ext_name'], 'ext_version' => $_POST['ext_version'], + 'ext_description' => $_POST['ext_description'], 'ext_author' => $_POST['ext_author'], + 'ext_author_mail' => $_POST['ext_author_mail'], 'ext_author_website_url' => $_POST['ext_author_website_url'], + 'ext_author_website_name' => $_POST['ext_author_website_name'], 'ext_credits' => $_POST['ext_credits'], + 'ext_license' => $_POST['ext_license'], 'ext_release_info' => $_POST['ext_release_info'], + 'ext_release_file' => $_POST['ext_release_file'], 'ext_manual' => $_POST['ext_manual'], + 'ext_manual_file' => $_POST['ext_manual_file'])); //Form extension_image - $uploaddir = XOOPS_UPLOAD_PATH."/tdmcreate/images/extensions/"; - $uploader_img = new XoopsMediaUploader($uploaddir, $xoops->getModuleConfig('mimetypes'), + $uploader_img = new XoopsMediaUploader(TDMC_EXTENSIONS_PATH_IMG, $xoops->getModuleConfig('mimetypes'), $xoops->getModuleConfig('maxsize'), null, null); - if ($uploader_img->fetchMedia("extensions_image")) { - $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["ext_image"]['name']); - $name_img = $_GET['ext_name'].'_slogo.'.$extension; + if ($uploader_img->fetchMedia('extensions_image')) { + $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['ext_image']['name']); + $name_img = 'logo.'.$extension; $uploader_img->setPrefix($name_img); - $uploader_img->fetchMedia("extensions_image"); + $uploader_img->fetchMedia('extensions_image'); if (!$uploader_img->upload()) { $errors = $uploader_img->getErrors(); - $xoops->redirect("javascript:history.go(-1)", 3, $errors); + $xoops->redirect('javascript:history.go(-1)', 3, $errors); } else { - $obj->setVar("extensions_image", $uploaddir . $uploader_img->getSavedFileName()); + $obj->setVar('extensions_image', TDMC_EXTENSIONS_URL_IMG . '/' . $uploader_img->getSavedFileName()); } } else { - if ($_POST["extensions_image"] == 'blank.gif') { - $obj->setVar("ext_image", $_POST["ext_image"]); + if ($_POST['extensions_image'] == 'blank.gif') { + $obj->setVar('ext_image', $_POST['ext_image']); } else { - $obj->setVar("ext_image", $uploaddir . $_POST["ext_image"]); + $obj->setVar('ext_image', TDMC_EXTENSIONS_URL_IMG . '/' . $_POST['ext_image']); } } //Form extension save - $obj->setVars(array("ext_demo_site_url" => $_POST["ext_demo_site_url"], "ext_demo_site_name" => $_POST["ext_demo_site_name"], - "ext_forum_site_url" => $_POST["ext_forum_site_url"], "ext_forum_site_name" => $_POST["ext_forum_site_name"], - "ext_website_url" => $_POST["ext_website_url"], "ext_website_name" => $_POST["ext_website_name"], - "ext_release" => $_POST["ext_release"], "ext_status" => $_POST["ext_status"], - "ext_display_admin" => (($_REQUEST["ext_display_admin"] == 1) ? "1" : "0"), - "ext_display_user" => (($_REQUEST["ext_display_user"] == 1) ? "1" : "0"), - "ext_display_submenu" => (($_REQUEST["ext_display_submenu"] == 1) ? "1" : "0"), - "ext_active_search" => (($_REQUEST["ext_active_search"] == 1) ? "1" : "0"), - "ext_active_comments" => (($_REQUEST["ext_active_comments"] == 1) ? "1" : "0"), - "ext_active_notifies" => (($_REQUEST["ext_active_notifies"] == 1) ? "1" : "0"))); + $obj->setVars(array('ext_demo_site_url' => $_POST['ext_demo_site_url'], 'ext_demo_site_name' => $_POST['ext_demo_site_name'], + 'ext_forum_site_url' => $_POST['ext_forum_site_url'], 'ext_forum_site_name' => $_POST['ext_forum_site_name'], + 'ext_website_url' => $_POST['ext_website_url'], 'ext_website_name' => $_POST['ext_website_name'], + 'ext_release' => $_POST['ext_release'], 'ext_status' => $_POST['ext_status'], + 'ext_admin' => (($_REQUEST['ext_admin'] == 1) ? '1' : '0'), + 'ext_user' => (($_REQUEST['ext_user'] == 1) ? '1' : '0'), + 'ext_submenu' => (($_REQUEST['ext_submenu'] == 1) ? '1' : '0'), + 'ext_search' => (($_REQUEST['ext_search'] == 1) ? '1' : '0'), + 'ext_comments' => (($_REQUEST['ext_comments'] == 1) ? '1' : '0'), + 'ext_notifications' => (($_REQUEST['ext_notifications'] == 1) ? '1' : '0'), + 'ext_paypal' => $_POST['ext_paypal'], + 'ext_subversion' => $_POST['ext_subversion'])); // Insert Data if ($extensions_Handler->insert($obj)) { - redirect_header("extensions.php?op=list", 2, _AM_TDMCREATE_FORMOK); + redirect_header('extensions.php?op=list', 2, _AM_TDMCREATE_FORMOK); } // Form Data $xoops->error($obj->getHtmlErrors()); @@ -133,10 +148,10 @@ $xoops->tpl()->assign('form', $form->render()); break; - case "edit": - $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); - $admin_page->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); - $admin_page->renderButton(); + case 'edit': + $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); + $admin_menu->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); + $admin_menu->renderButton(); $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); if ($id > 0) { @@ -148,21 +163,21 @@ } break; - case "delete": + case 'delete': $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); if ($id > 0) { $obj = $extensions_Handler->get($id); - if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { - $xoops->redirect("extensions.php", 3, implode(",", $xoops->security()->getErrors())); + $xoops->redirect('extensions.php', 3, implode(',', $xoops->security()->getErrors())); } if ($extensions_Handler->delete($obj)) { - $xoops->redirect("extensions.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_EXTENSION)); + $xoops->redirect('extensions.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_EXTENSION)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'extensions.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('ext_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'extensions.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('ext_name')) . '<br />'); } } else { $xoops->redirect('extensions.php', 1, _AM_SYSTEM_DBERROR); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -39,77 +39,110 @@ /* @var $fields_handler TDMCreateFieldsHandler */ $fields_Handler = $xoops->getModuleHandler('fields'); -$admin_page = new XoopsModuleAdmin(); -$admin_page->renderNavigation('fields.php'); +$admin_menu->renderNavigation('fields.php'); switch ($op) { - case "list": + case 'list': default: - $admin_page->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); - $admin_page->renderButton(); - // Get tables list + $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); + $admin_menu->renderButton(); + // Get modules list $criteria = new CriteriaCompo(); - $criteria->setSort('table_name'); + $criteria->setSort('mod_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); $criteria->setLimit($nb_pager); - $numrows_tabs = $tables_Handler->getCount($criteria); + $numrows_tables = $tables_Handler->getCount($criteria); + $table_arr = $tables_Handler->getAll($criteria); + $xoops->tpl()->assign('tables_count', $numrows_tables); + $xoops->tpl()->assign('timg_path', TDMC_TABLES_URL_IMG); + unset($criteria); // Redirect if there aren't modules /* if ( $numrows_mods == 0 ) { redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); - }*/ - $xoops->tpl()->assign('timg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/tables/'); - $xoops->tpl()->assign('tables', $tables_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('table', true); - unset($criteria); - // Get fields list + }*/ $criteria = new CriteriaCompo(); - $criteria->setSort("field_name"); - $criteria->setOrder("ASC"); - $xoops->tpl()->assign('fimg_path', XOOPS_UPLOAD_URL.'/tdmcreate/images/fields/'); - $xoops->tpl()->assign('fields', $fields_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('field', true); - unset($criteria); - // Display Page Navigation - if ($numrows_tabs > $nb_pager) { - $nav = new XoopsPageNav($numrows_tabs, $nb_pager, $start, 'start'); - $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); - } + $criteria->setSort('table_name'); + $criteria->setOrder('ASC'); + $criteria->setStart($start); + $criteria->setLimit($limit); + $numrows_fields = $fields_Handler->getCount($criteria); + $field_arr = $fields_Handler->getAll($criteria); + unset($criteria); + // Assign Template variables + $xoops->tpl()->assign('fields_count', $numrows_fields); + $mytree = new XoopsObjectTree($table_arr, 'table_id', 'table_mid'); + if ($numrows_tables > 0) { + foreach (array_keys($table_arr) as $i) { + $tables['id'] = $table_arr[$i]->getVar('table_id'); + $tables['name'] = $table_arr[$i]->getVar('table_name'); + $tables['modname'] = TDMCreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); + $tables['image'] = $table_arr[$i]->getVar('table_image'); + $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); + $xoops->tpl()->append_by_ref('tables', $tables); + unset($tables); + if ($numrows_fields > 0) { + foreach (array_keys($field_arr) as $i) { + $field['id'] = $field_arr[$i]->getVar('field_id'); + $field['name'] = $field_arr[$i]->getVar('field_name'); + $field['version'] = $field_arr[$i]->getVar('field_version'); + $field['image'] = $field_arr[$i]->getVar('field_image'); + $field['nbfields'] = $field_arr[$i]->getVar('field_nbfields'); + $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); + $field['admin'] = $field_arr[$i]->getVar('field_admin'); + $field['user'] = $field_arr[$i]->getVar('field_user'); + $field['submenu'] = $field_arr[$i]->getVar('field_submenu'); + $field['search'] = $field_arr[$i]->getVar('field_search'); + $field['comments'] = $field_arr[$i]->getVar('field_comments'); + $field['notifies'] = $field_arr[$i]->getVar('field_notifies'); + $xoops->tpl()->append_by_ref('fields', $field); + unset($field); + } + } + } + // Display Page Navigation + if ($numrows_mods > $nb_pager) { + $nav = new XoopsPageNav($numrows_mods, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', _AM_TDMCREATE_FIELD_ERROR_NOFIELDS); + } break; - case "new": - $admin_page->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); - $admin_page->renderButton(); + case 'new': + $admin_menu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); + $admin_menu->renderButton(); $obj = $fields_Handler->create(); $form = $xoops->getModuleForm($obj, 'fields'); $xoops->tpl()->assign('form', $form->render()); break; - case "save": - if ( !$GLOBALS["xoopsSecurity"]->check() ) { - redirect_header("fields.php", 3, implode(",", $GLOBALS["xoopsSecurity"]->getErrors())); + case 'save': + if ( !$GLOBALS['xoopsSecurity']->check() ) { + redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } - if (isset($_REQUEST["field_id"])) { - $obj =& $fieldsHandler->get($_REQUEST["field_id"]); + if (isset($_REQUEST['field_id'])) { + $obj =& $fieldsHandler->get($_REQUEST['field_id']); } else { $obj =& $fieldsHandler->create(); } //Form fields - $obj->setVars(array("field_table" => $_POST["field_table"], "field_name" => $_POST["field_name"], - "field_type" => $_POST["field_type"], "field_value" => $_POST["field_value"], - "field_attribute" => $_POST["field_attribute"], "field_null" => $_POST["field_null"], - "field_default" => $_POST["field_default"], "field_key" => $_POST["field_key"], - "field_elements" => $_POST["field_elements"], - "field_display_admin" => (($_REQUEST["field_display_admin"] == 1) ? "1" : "0"), - "field_display_user" => (($_REQUEST["field_display_user"] == 1) ? "1" : "0"), - "field_display_block" => (($_REQUEST["field_display_block"] == 1) ? "1" : "0"), - "field_mainfield" => (($_REQUEST["field_mainfield"] == 1) ? "1" : "0"), - "field_search" => (($_REQUEST["field_search"] == 1) ? "1" : "0"), - "field_required" => (($_REQUEST["field_required"] == 1) ? "1" : "0"))); + $obj->setVars(array('field_table' => $_POST['field_table'], 'field_name' => $_POST['field_name'], + 'field_type' => $_POST['field_type'], 'field_value' => $_POST['field_value'], + 'field_attribute' => $_POST['field_attribute'], 'field_null' => $_POST['field_null'], + 'field_default' => $_POST['field_default'], 'field_key' => $_POST['field_key'], + 'field_elements' => $_POST['field_elements'], + 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'), + 'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'), + 'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'), + 'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'), + 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'), + 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0'))); if ($fieldsHandler->insert($obj)) { - redirect_header("fields.php?op=list", 2, _AM_TDMCREATE_FORMOK); + redirect_header('fields.php?op=list', 2, _AM_TDMCREATE_FORMOK); } $xoops->error($obj->getHtmlErrors()); @@ -117,9 +150,9 @@ $xoops->tpl()->assign('form', $form->render()); break; - case "edit": - $admin_page->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); - $admin_page->renderButton(); + case 'edit': + $admin_menu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); + $admin_menu->renderButton(); $id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); if ($id > 0) { @@ -131,21 +164,21 @@ } break; - case "delete": + case 'delete': $id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); if ($id > 0) { $obj = $fields_Handler->get($id); - if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { - $xoops->redirect("fields.php", 3, implode(",", $xoops->security()->getErrors())); + $xoops->redirect('fields.php', 3, implode(',', $xoops->security()->getErrors())); } if ($fields_Handler->delete($obj)) { - $xoops->redirect("fields.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_TABLE)); + $xoops->redirect('fields.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_TABLE)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'fields.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('field_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'fields.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('field_name')) . '<br />'); } } else { $xoops->redirect('fields.php', 1, _AM_SYSTEM_DBERROR); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** * tdmcreate module * @@ -16,7 +15,7 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package tdmcreate * @since 2.6.0 - * @author TDM Xoops (AKA Developers) + * @author XOOPS Development Team * @version $Id: import.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; @@ -37,40 +36,53 @@ /* @var $import_handler TDMCreateImportHandler */ $import_Handler = $xoops->getModuleHandler('import'); -$admin_page = new XoopsModuleAdmin(); -$admin_page->renderNavigation('import.php'); +$admin_menu->renderNavigation('import.php'); switch ($op) { - case "list": - $admin_page->addItemButton(_AM_TDMCREATE_IMPORT, 'import.php?op=import', 'add'); - $admin_page->renderButton(); - $criteria = new CriteriaCompo(); - $criteria->setSort("import_name"); - $criteria->setOrder("ASC"); + case 'list': + $admin_menu->addItemButton(_AM_TDMCREATE_IMPORT, 'import.php?op=import', 'add'); + $admin_menu->renderButton(); + // Get modules list + $criteria = new CriteriaCompo(); + $criteria->setSort('import_name'); + $criteria->setOrder('ASC'); $criteria->setStart($start); - $criteria->setLimit($limit); - $numrows = $import_Handler->getCount($criteria); - $xoops->tpl()->assign('imports', $import_Handler->getObjects($criteria, true, false)); - $xoops->tpl()->assign('imports_list', true); - $xoops->tpl()->assign('import', true); - unset($criteria); - // Display Page Navigation - if ($numrows > $nb_pager) { - $nav = new XoopsPageNav($numrows, $nb_pager, $start, 'start'); - $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); - } + $criteria->setLimit($nb_pager); + $numrows = $import_Handler->getCount($criteria); + $import_arr = $import_Handler->getAll($criteria); + // Assign Template variables + $xoops->tpl()->assign('import_count', $numrows); + unset($criteria); + if ($numrows > 0) { + foreach (array_keys($import_arr) as $i) { + $import['id'] = $import_arr[$i]->getVar('import_id'); + $import['mid'] = $import_arr[$i]->getVar('import_mid'); + $import['name'] = $import_arr[$i]->getVar('import_name'); + $import['nbtables'] = $import_arr[$i]->getVar('import_nbtables'); + $import['nbfields'] = $import_arr[$i]->getVar('import_nbfields'); + $xoops->tpl()->append_by_ref('imports', $import); + unset($import); + } + // Display Page Navigation + if ($numrows > $nb_pager) { + $nav = new XoopsPageNav($numrows, $nb_pager, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', _AM_TDMCREATE_IMPORT_ERROR_NOIMPORTS); + } break; - case "import": - $admin_page->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); - $admin_page->renderButton(); + case 'import': + $admin_menu->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); + $admin_menu->renderButton(); $obj = $import_Handler->create(); $form = $xoops->getModuleForm($obj, 'import'); $xoops->tpl()->assign('form', $form->render()); break; - case "save": + case 'save': if (!$xoops->security()->check()) { $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); } @@ -81,64 +93,90 @@ $obj = $import_Handler->create(); } - // File recovery - $file = $_FILES['import_oldmod']; - // Temporary file name - $filename = $file['tmp_name']; - // File size - $filesize = $file['size']; + // If incoming data have been entered correctly + if($_POST['upload'] == _SUBMIT && isset($_FILES['importfile']['tmp_name']) && (substr($_FILES['importfile']['name'], -4) == '.sql')) + { + $uploads_dir = TDMC_UPLOAD_PATH_FILES; + // File recovery + $filename = $_FILES['importfile']['name']; + $tmp_file = $_FILES['importfile']['tmp_name']; + if (is_uploaded_file($tmp_file)) { // Copy files to the server + $xoops->redirect('import.php', 1, 'File ' . $filename . ' uploaded successfully.'); + readfile($tmp_file); + // The directory where you saved the file + if ($_FILES['importfile']['error'] == UPLOAD_ERR_OK) { + $tmp_name = $tmp_file; + $name = $filename; + move_uploaded_file($tmp_name, $uploads_dir.'/'.$name); + } + } else { + $xoops->redirect('import.php', 1, 'Error in file upload.'); + } + // File size + $filesize = $_FILES['importfile']['size']; + + // Check that the file was inserted and that there is + if ( ($handle = fopen($filename, 'r') ) !== false) + { + $separator = $_POST['separator']; // data separator + $row = ''; // clear line + // Use a counter to see what line are comments + $comments = 0; + // Use the fgets function to retrieve the information in the sql file + // The second parameter is the size of the file, we have recovered over + while ( !feof( $handle )) // file reading until the end + { + $row = fgets($handle, $filesize); // reads the entire row for the whole file + if ( preg_match( '/\#/', $row ) ) { // if this row is a comment + $comments++; + // Check for a $fields_table variable, the first row of the field name of the sql + $fields_table = $row; + } else { + if(strlen($row) > 1) + { + // Remove spaces at the beginning and end + $row = trim($row); + // change the ' and ; in null + $search = array ( "'&(apostrophe|#39);'i", "'&(semicolon|#59);'i", "'([\r\n])[\s]+'" ); + // replace in null + $replace = array ( "", "", "" ); + $riga = preg_replace($search, $replace, $riga); + // I'll put your details in the row into an array divided by separator + $arrayrow = explode( ',', $row); + // number of elements in the array + $num_elements = count($arrayrow); + // Insert query + if($num_elements == 9 && strlen($arrayrow[0]) > 0) { + // per tutti i campi all'interno della stessa riga... + for ($c = 0; $c < $num_elements; $c++) + { + //Form imported save + $obj->setVars(array('import_mid' => $arrayrow[0][$c], 'import_name' => $arrayrow[1][$c], + 'import_nbtables' => $arrayrow[2][$c], 'import_tablename' => $arrayrow[3][$c], + 'import_nbfields' => $arrayrow[4][$c], 'import_fieldname' => $arrayrow[5][$c], + 'import_fieldtype' => $arrayrow[6][$c], 'import_fieldvalue' => $arrayrow[7][$c], + 'import_nbfieldefault' => $arrayrow[8][$c])); + } + } else { + $xoops->redirect('import.php?op=list', 3, 'Error: data in text file do not match. Row: '.$row); + } + } + } + // reset for the next insertion + $arrayrow = array_slice($arrayrrow, 0, 0); + $row = ''; + } + } else { + $xoops->redirect('import.php', 3, 'Could not open file for reading!'); + } + $xoops->redirect('import.php', 3, 'Data entered successfull!'); + fclose($handle); + } else { + $xoops->redirect('import.php', 3, 'Not sql file or data entered!'); + } - // Check that the file was inserted and that there is - if ( ($handle = fopen($filename, "r") ) !== false) { - // Use a counter to see what line are comments - $counts = 0; - // Use the fgets function to retrieve the information in the sql file - // The second parameter is the size of the file, we have recovered over - while ( ( $data = fget($handle, $filesize) ) !== false ) { - if ( preg_match( '/\#/', $data ) ) { - $counts++; - // Check for a $fields_table variable, the first row of the field name of the sql - $fields_table = $data; - } else { - // Recupero i nomi dei campi - $campo_nome = $fields_table[0]; - $campo_cognome = $fields_table[1]; - $campo_indirizzo = $fields_table[2]; - $campo_mail = $fields_table[3]; - $campo_telefono = $fields_table[4]; - - // Recupero i valori dei campi - $nome = $data[0]; - $cognome = $data[1]; - $indirizzo = $data[2]; - $mail = $data[3]; - $telefono = $data[4]; - - // Creo una query di inserimento e la eseguo - $sql = " - INSERT INTO utenti SET - $campo_nome = '$nome', - $campo_cognome = '$cognome', - $campo_indirizzo = '$indirizzo', - $campo_mail = '$mail', - $campo_telefono = '$telefono' - "; - $rssql = mysql_query( $sql ); - // Controllo che l'importazione sia avvenuta con successo - //Form imported save - $obj->setVars(array("import_mid" => $_POST["import_mid"], "import_name" => $_POST["import_name"], - "import_nbtables" => $_POST["import_nbtables"], "import_tablename" => $_POST["import_tablename"], - "import_nbfields" => $_POST["import_nbfields"], "import_fieldname" => $_POST["import_fieldname"])); - } - } - } - else - redirect_header("import.php?op=list", 3, "Nessun file inserito"); - - fclose($handle); - if ($import_Handler->insert($obj)) { - redirect_header("import.php?op=list", 3, _AM_TDMCREATE_FORMOK); + $xoops->redirect('import.php', 3, _AM_TDMCREATE_FORMOK); } $xoops->error($obj->getHtmlErrors()); @@ -146,10 +184,10 @@ $xoops->tpl()->assign('form', $form->render()); break; - case "edit": - $admin_page->addItemButton(_AM_TDMCREATE_IMPORT, 'import.php?op=import', 'add'); - $admin_page->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); - $admin_page->renderButton(); + case 'edit': + $admin_menu->addItemButton(_AM_TDMCREATE_IMPORT, 'import.php?op=import', 'add'); + $admin_menu->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); + $admin_menu->renderButton(); $id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); if ($id > 0) { @@ -161,21 +199,21 @@ } break; - case "delete": + case 'delete': $id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); if ($id > 0) { $obj = $import_Handler->get($id); - if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { - $xoops->redirect("import.php", 3, implode(",", $xoops->security()->getErrors())); + $xoops->redirect('import.php', 3, implode(',', $xoops->security()->getErrors())); } if ($import_Handler->delete($obj)) { - $xoops->redirect("import.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_IMPORT)); + $xoops->redirect('import.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_IMPORT)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'import.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('import_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'import.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('import_name')) . '<br />'); } } else { $xoops->redirect('import.php', 1, _AM_SYSTEM_DBERROR); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -11,12 +11,12 @@ /** * 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 TDM Xoops (AKA Developers) - * @version $Id: modules.php 10665 2012-12-27 10:14:15Z timgno $ + * @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 XOOPS Development Team + * @version $Id: modules.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; // Preferences Limit @@ -48,6 +48,7 @@ $numrows_mods = $modules_Handler->getCount($criteria); $mod_arr = $modules_Handler->getAll($criteria); // Assign Template variables + $xoops->tpl()->assign('mimg_path', TDMC_MODULES_URL_IMG); $xoops->tpl()->assign('modules_count', $numrows_mods); unset($criteria); if ($numrows_mods > 0) { @@ -72,7 +73,7 @@ $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { - $xoops->tpl()->assign('error_message', _AM_TDMCREATE_TABLE_ERROR_NOMODULES); + $xoops->tpl()->assign('error_message', _AM_TDMCREATE_MODULE_ERROR_NOMODULES); } break; @@ -134,8 +135,8 @@ 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'), 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'), 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'), - 'mod_paypal' => $_REQUEST['mod_paypal'], - 'mod_subversion' => $_REQUEST['mod_subversion'])); + 'mod_paypal' => $_POST['mod_paypal'], + 'mod_subversion' => $_POST['mod_subversion'])); // Insert Data if ($modules_Handler->insert($obj)) { redirect_header('modules.php?op=list', 2, _AM_TDMCREATE_FORMOK); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -34,13 +34,13 @@ /* @var $tables_handler TDMCreateTablesHandler */ $tables_Handler = $xoops->getModuleHandler('tables'); -$admin_manu->renderNavigation('tables.php'); +$admin_menu->renderNavigation('tables.php'); switch ($op) { - case "list": + case 'list': default: - $admin_manu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); - $admin_manu->renderButton(); + $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); + $admin_menu->renderButton(); // Get modules list $criteria = new CriteriaCompo(); $criteria->setSort('mod_name'); @@ -48,8 +48,9 @@ $criteria->setStart($start); $criteria->setLimit($nb_pager); $numrows_mods = $modules_Handler->getCount($criteria); - $module_arr = $modules_Handler->getAll($criteria); + $mod_arr = $modules_Handler->getAll($criteria); $xoops->tpl()->assign('modules_count', $numrows_mods); + $xoops->tpl()->assign('mimg_path', TDMC_MODULES_URL_IMG); unset($criteria); // Redirect if there aren't modules /* if ( $numrows_mods == 0 ) { @@ -62,14 +63,15 @@ $criteria->setLimit($nb_pager); $numrows_tables = $tables_Handler->getCount($criteria); $table_arr = $tables_Handler->getAll($criteria); - $xoops->tpl()->assign('mods_count', $numrows_tables); + $xoops->tpl()->assign('tables_count', $numrows_tables); + $xoops->tpl()->assign('timg_path', TDMC_TABLES_URL_IMG); unset($criteria); // Assign Template variables - $xoops->tpl()->assign('mods_count', $numrows); + $xoops->tpl()->assign('mods_count', $numrows_mods); $mytree = new XoopsObjectTree($table_arr, 'table_id', 'table_mid'); if ($numrows_mods > 0) { - foreach (array_keys($module_arr) as $i) { + foreach (array_keys($mod_arr) as $i) { $mod['id'] = $mod_arr[$i]->getVar('mod_id'); $mod['name'] = $mod_arr[$i]->getVar('mod_name'); $mod['version'] = $mod_arr[$i]->getVar('mod_version'); @@ -89,7 +91,7 @@ $tables['name'] = $table_arr[$i]->getVar('table_name'); $tables['modname'] = TDMCreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); $tables['image'] = $table_arr[$i]->getVar('table_image'); - $tables['submenu'] = $table_arr[$i]->getVar('mod_submenu'); + $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); $xoops->tpl()->append_by_ref('tables', $tables); unset($tables); } @@ -105,16 +107,16 @@ } break; - case "new": - $admin_manu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); - $admin_manu->renderButton(); + case 'new': + $admin_menu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); + $admin_menu->renderButton(); $obj = $tables_Handler->create(); $form = $xoops->getModuleForm($obj, 'tables'); $xoops->tpl()->assign('form', $form->render()); break; - case "save": + case 'save': if (!$xoops->security()->check()) { $xoops->redirect('tables.php', 3, implode(',', $xoops->security()->getErrors())); } @@ -125,50 +127,50 @@ $obj = $tables_Handler->create(); } //Form tables - $obj->setVars(array("table_module" => $_POST["table_module"], "table_name" => $_POST["table_name"], - "table_nbfields" => $_POST["table_nbfields"], "table_fieldname" => $_POST["table_fieldname"])); + $obj->setVars(array('table_module' => $_POST['table_module'], 'table_name' => $_POST['table_name'], + 'table_nbfields' => $_POST['table_nbfields'], 'table_fieldname' => $_POST['table_fieldname'])); //Form table_image - $pathIcon32 = XOOPS_ROOT_PATH . "/media/xoops/images/icons/32"; + $pathIcon32 = XOOPS_ROOT_PATH . '/media/xoops/images/icons/32'; if(is_dir($pathIcon32)){ $uploaddir = $pathIcon32; }else{ - $uploaddir = XOOPS_UPLOAD_PATH."/tdmcreate/images/tables"; + $uploaddir = XOOPS_UPLOAD_PATH.'/tdmcreate/images/tables'; } $uploader_img = new XoopsMediaUploader($uploaddir, $xoops->getModuleConfig('mimetypes'), $xoops->getModuleConfig('maxsize'), null, null); - if ($uploader_img->fetchMedia("tables_image")) { - $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["mod_image"]['name']); - $name_img = $_GET['mod_name'].'_slogo.'.$extension; + if ($uploader_img->fetchMedia('tables_image')) { + $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['table_image']['name']); + $name_img = $_GET['table_name'].'.'.$extension; $uploader_img->setPrefix($name_img); - $uploader_img->fetchMedia("tables_image"); + $uploader_img->fetchMedia('tables_image'); if (!$uploader_img->upload()) { $errors = $uploader_img->getErrors(); - $xoops->redirect("javascript:history.go(-1)", 3, $errors); + $xoops->redirect('javascript:history.go(-1)', 3, $errors); } else { - $obj->setVar("table_image", $uploaddir . $uploader_img->getSavedFileName()); + $obj->setVar('table_image', $uploaddir . $uploader_img->getSavedFileName()); } } else { - if ($_POST["tables_image"] == 'blank.gif') { - $obj->setVar("table_image", $_POST["table_image"]); + if ($_POST['tables_image'] == 'blank.gif') { + $obj->setVar('table_image', $_POST['table_image']); } else { - $obj->setVar("table_image", $uploaddir . $_POST["table_image"]); + $obj->setVar('table_image', $uploaddir . $_POST['table_image']); } } //Form tables - $obj->setVars(array("table_blocks" => (($_REQUEST["table_blocks"] == 1) ? "1" : "0"), - "table_display_admin" => (($_REQUEST["table_display_admin"] == 1) ? "1" : "0"), - "table_display_user" => (($_REQUEST["table_display_user"] == 1) ? "1" : "0"), - "table_submenu" => (($_REQUEST["table_submenu"] == 1) ? "1" : "0"), - "table_search" => (($_REQUEST["table_search"] == 1) ? "1" : "0"), - "table_comments" => (($_REQUEST["table_comments"] == 1) ? "1" : "0"), - "table_notify" => (($_REQUEST["table_notify"] == 1) ? "1" : "0"))); + $obj->setVars(array('table_blocks' => (($_REQUEST['table_blocks'] == 1) ? '1' : '0'), + 'table_display_admin' => (($_REQUEST['table_display_admin'] == 1) ? '1' : '0'), + 'table_display_user' => (($_REQUEST['table_display_user'] == 1) ? '1' : '0'), + 'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'), + 'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'), + 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'), + 'table_notify' => (($_REQUEST['table_notify'] == 1) ? '1' : '0'))); if( $tables_Handler->insert($obj) && $obj->isNew() ) { - redirect_header("fields.php?op=new", 3, _AM_TDMCREATE_FORMOK); + redirect_header('fields.php?op=new', 3, _AM_TDMCREATE_FORMOK); } else { - redirect_header("tables.php?op=list", 3, _AM_TDMCREATE_FORMOK); + redirect_header('tables.php?op=list', 3, _AM_TDMCREATE_FORMOK); } $xoops->error($obj->getHtmlErrors()); @@ -176,10 +178,10 @@ $xoops->tpl()->assign('form', $form->render()); break; - case "edit": - $admin_manu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); - $admin_manu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); - $admin_manu->renderButton(); + case 'edit': + $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); + $admin_menu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); + $admin_menu->renderButton(); $id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); if ($id > 0) { @@ -191,21 +193,21 @@ } break; - case "delete": + case 'delete': $id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); if ($id > 0) { $obj = $tables_Handler->get($id); - if (isset($_POST["ok"]) && $_POST["ok"] == 1) { + if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { - $xoops->redirect("tables.php", 3, implode(",", $xoops->security()->getErrors())); + $xoops->redirect('tables.php', 3, implode(',', $xoops->security()->getErrors())); } if ($tables_Handler->delete($obj)) { - $xoops->redirect("tables.php", 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_TABLE)); + $xoops->redirect('tables.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_TABLE)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array("ok" => 1, "id" => $id, "op" => "delete"), 'tables.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('table_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'tables.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('table_name')) . '<br />'); } } else { $xoops->redirect('tables.php', 1, _AM_SYSTEM_DBERROR); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -28,32 +28,32 @@ */ public function __construct() { - $this->initVar("field_id", XOBJ_DTYPE_INT, null); - $this->initVar("field_table", XOBJ_DTYPE_INT, null); - $this->initVar("field_name", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("field_type", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("field_value", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("field_attribute", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("field_null", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("field_default", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("field_key", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("field_auto_increment", XOBJ_DTYPE_INT); - $this->initVar("field_display_admin", XOBJ_DTYPE_INT); - $this->initVar("field_display_user", XOBJ_DTYPE_INT); - $this->initVar("field_display_block", XOBJ_DTYPE_INT); - $this->initVar("field_mainfield", XOBJ_DTYPE_INT); - $this->initVar("field_search", XOBJ_DTYPE_INT); - $this->initVar("field_required", XOBJ_DTYPE_INT); + $this->initVar('field_id', XOBJ_DTYPE_INT, null); + $this->initVar('field_tid', XOBJ_DTYPE_INT, null); + $this->initVar('field_name', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('field_type', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('field_value', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('field_null', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('field_default', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('field_key', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('field_auto_increment', XOBJ_DTYPE_INT); + $this->initVar('field_admin', XOBJ_DTYPE_INT); + $this->initVar('field_user', XOBJ_DTYPE_INT); + $this->initVar('field_block', XOBJ_DTYPE_INT); + $this->initVar('field_mainfield', XOBJ_DTYPE_INT); + $this->initVar('field_search', XOBJ_DTYPE_INT); + $this->initVar('field_required', XOBJ_DTYPE_INT); // For relationship - $this->initVar("table_id", XOBJ_DTYPE_INT, null); - $this->initVar("table_module", XOBJ_DTYPE_INT, null); - $this->initVar("table_name", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("table_nbfields", XOBJ_DTYPE_INT, null); - $this->initVar("table_fieldname", XOBJ_DTYPE_TXTBOX, null); + $this->initVar('table_id', XOBJ_DTYPE_INT, null); + $this->initVar('table_module', XOBJ_DTYPE_INT, null); + $this->initVar('table_name', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('table_nbfields', XOBJ_DTYPE_INT, null); + $this->initVar('table_fieldname', XOBJ_DTYPE_TXTBOX, null); - $this->initVar("fieldtype_id", XOBJ_DTYPE_INT, null); - $this->initVar("fieldtype_value", XOBJ_DTYPE_TXTBOX, null); - $this->initVar("fieldtype_name", XOBJ_DTYPE_TXTBOX, null); + $this->initVar('fieldtype_id', XOBJ_DTYPE_INT, null); + $this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX, null); } } @@ -64,7 +64,6 @@ */ public function __construct(XoopsDatabase $db = null) { - parent::__construct($db, "tdmcreate_fields", "tdmcreatefields", "field_id", "field_name"); + parent::__construct($db, 'tdmcreate_fields', 'tdmcreatefields', 'field_id', 'field_name'); } -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/import.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/import.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -19,7 +19,7 @@ * @author Timgno <txm...@gm...> * @version $Id$ */ -defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); +defined('XOOPS_ROOT_PATH') or die('XOOPS root path not defined'); class TDMCreateImportForm extends XoopsThemeForm { @@ -33,14 +33,14 @@ parent::__construct(_AM_TDMCREATE_MODULE_IMPORT_TITLE, 'form', false, 'post', true); $this->setExtra('enctype="multipart/form-data"'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, "import_name", 50, 255, $obj->getVar('import_name')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, 'import_name', 50, 255, $obj->getVar('import_name')), true); $filetray = new XoopsFormElementTray('','<br />'); - $filetray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD , "import_oldmod", $xoops->getModuleConfig("maxsize"))); + $filetray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD , 'importfile', $xoops->getModuleConfig('maxsize'))); $filetray->addElement(new XoopsFormLabel('')); $this->addElement($filetray); $this->addElement(new XoopsFormHidden('op', 'save' ) ); - $this->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit' ) ); + $this->addElement(new XoopsFormButton('', 'upload', _SUBMIT, 'submit' ) ); } } \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -39,18 +39,18 @@ $this->addElement(new XoopsFormHidden('id', $obj->getVar('table_id'))); } - $modules_Handler =& $xoops->getModuleHandler('modules'); + $modules_Handler = $xoops->getModuleHandler('modules'); $mods_select = new XoopsFormSelect(_AM_TDMCREATE_MODULES_LIST, 'table_mid', $obj->getVar('table_mid')); $mods_select->addOptionArray($modules_Handler->getList()); $this->addElement($mods_select, true); - $table_name = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, "table_name", 50, 255, $obj->getVar('table_name')); + $table_name = new XoopsFormText(_AM_TDMCREATE_TABLE_NAME, 'table_name', 50, 255, $obj->getVar('table_name')); //$table_name->setDescription(_AM_TDMCREATE_TABLENAME_DESC); $this->addElement($table_name, true); - $table_fieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, "table_fieldname", 30, 50, $obj->getVar('table_fieldname')); + $table_fieldname = new XoopsFormText(_AM_TDMCREATE_TABLE_FIELDNAME, 'table_fieldname', 3, 50, $obj->getVar('table_fieldname')); //$table_fieldname->setDescription(_AM_TDMCREATE_FIELDNAME_DESC); $this->addElement($table_fieldname); - $table_nbfield = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, "table_nbfields", 30, 50, $obj->getVar('table_nbfields')); + $table_nbfield = new XoopsFormText(_AM_TDMCREATE_TABLE_NBFIELDS, 'table_nbfields', 2, 50, $obj->getVar('table_nbfields')); //$table_nbfield->setDescription(_AM_TDMCREATE_NBFIELDS_DESC); $this->addElement($table_nbfield, true); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php 2013-02-07 21:07:43 UTC (rev 11007) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php 2013-02-07 21:28:19 UTC (rev 11008) @@ -28,13 +28,16 @@ */ public function __construct() { - $this->initVar("import_id",XOBJ_DTYPE_INT, null, true); - $this->initVar("import_mid",XOBJ_DTYPE_INT, null); - $this->initVar("import_name",XOBJ_DTYPE_TXTBOX, null); - $this->initVar("import_nbtables",XOBJ_DTYPE_INT, null); - $this->initVar("import_tablename",XOBJ_DTYPE_TXTBOX, null); - $this->initVar("import_nbfields",XOBJ_DTYPE_INT, null); - $this->initVar("import_fieldname",XOBJ_DTYPE_TXTBOX, null); + $this->initVar('import_id',XOBJ_DTYPE_INT, null, true); + $this->initVar('import_mid',XOBJ_DTYPE_INT, null); + $this->initVar('import_name',XOBJ_DTYPE_TXTBOX, null); + $this->initVar('import_nbtables',XOBJ_DTYPE_INT, null); + $this->initVar('import_tablename',XOBJ_DTYPE_TXTBOX, null); + $this->initVar('import_nbfields',XOBJ_DTYPE_INT, null); + $this->initVar('import_fieldname',XOBJ_DTYPE_TXTBOX, null); + $this->initVar('import_fieldtype',XOBJ_DTYPE_TXTBOX, null); + $this->initVar('import_fieldvalue',XOBJ_DTYPE_INT, null); + $this->initVar('import_fieldefault',XOBJ_DTYPE_TXTBOX, null); } } @@ -45,6 +48,6 @@ */ public function __construct(XoopsDatabase $db = null) { - parent::__construct($db, "tdmcreate_import", 'tdmcreateimport', 'import_id', 'import_name'); + parent::__construct($db, 'tdmcreate_import', 'tdmcreateimport', 'import_id', 'import_name'); } } \ No newline at end of file Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/common.php ==================================... [truncated message content] |
From: <txm...@us...> - 2013-02-11 15:33:37
|
Revision: 11013 http://sourceforge.net/p/xoops/svn/11013 Author: txmodxoops Date: 2013-02-11 15:33:32 +0000 (Mon, 11 Feb 2013) Log Message: ----------- Updated Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-11 15:33:32 UTC (rev 11013) @@ -93,74 +93,63 @@ $obj = $import_Handler->create(); } + $files = $_FILES['importfile']; // If incoming data have been entered correctly - if($_POST['upload'] == _SUBMIT && isset($_FILES['importfile']['tmp_name']) && (substr($_FILES['importfile']['name'], -4) == '.sql')) + if($_POST['upload'] == _SUBMIT && isset($files['tmp_name']) && (substr($files['name'], -4) == '.sql')) { - $uploads_dir = TDMC_UPLOAD_PATH_FILES; // File recovery - $filename = $_FILES['importfile']['name']; - $tmp_file = $_FILES['importfile']['tmp_name']; - if (is_uploaded_file($tmp_file)) { // Copy files to the server - $xoops->redirect('import.php', 1, 'File ' . $filename . ' uploaded successfully.'); - readfile($tmp_file); - // The directory where you saved the file - if ($_FILES['importfile']['error'] == UPLOAD_ERR_OK) { - $tmp_name = $tmp_file; - $name = $filename; - move_uploaded_file($tmp_name, $uploads_dir.'/'.$name); - } - } else { - $xoops->redirect('import.php', 1, 'Error in file upload.'); - } + $dir = TDMC_UPLOAD_PATH_FILES; + $file = $_FILES['importfile']; + $tmp_name = $file['tmp_name']; + // Copy files to the server + if (is_uploaded_file($tmp_name)) { + readfile($tmp_name); + // The directory where you saved the file + if ($file['error'] == UPLOAD_ERR_OK) { + $name = $file['name']; + move_uploaded_file($tmp_name, $dir.'/'.$name); + } + } else { + $xoops->redirect('import.php', 3, 'Error in file upload:'. $file['tmp_name']); + } + + // Copies data in the db + $filename = $dir.'/'.$name; // File size - $filesize = $_FILES['importfile']['size']; - + $filesize = $files['size']; // Check that the file was inserted and that there is if ( ($handle = fopen($filename, 'r') ) !== false) - { - $separator = $_POST['separator']; // data separator - $row = ''; // clear line - // Use a counter to see what line are comments - $comments = 0; - // Use the fgets function to retrieve the information in the sql file - // The second parameter is the size of the file, we have recovered over - while ( !feof( $handle )) // file reading until the end + { + // File reading until at the end + while ( !feof( $handle )) { + // Use the fgets function to retrieve the information in the sql file + // The second parameter is the size of the file, we have recovered over $row = fgets($handle, $filesize); // reads the entire row for the whole file - if ( preg_match( '/\#/', $row ) ) { // if this row is a comment - $comments++; - // Check for a $fields_table variable, the first row of the field name of the sql - $fields_table = $row; - } else { - if(strlen($row) > 1) - { - // Remove spaces at the beginning and end - $row = trim($row); - // change the ' and ; in null - $search = array ( "'&(apostrophe|#39);'i", "'&(semicolon|#59);'i", "'([\r\n])[\s]+'" ); - // replace in null - $replace = array ( "", "", "" ); - $riga = preg_replace($search, $replace, $riga); - // I'll put your details in the row into an array divided by separator - $arrayrow = explode( ',', $row); - // number of elements in the array - $num_elements = count($arrayrow); - // Insert query - if($num_elements == 9 && strlen($arrayrow[0]) > 0) { - // per tutti i campi all'interno della stessa riga... - for ($c = 0; $c < $num_elements; $c++) - { - //Form imported save - $obj->setVars(array('import_mid' => $arrayrow[0][$c], 'import_name' => $arrayrow[1][$c], - 'import_nbtables' => $arrayrow[2][$c], 'import_tablename' => $arrayrow[3][$c], - 'import_nbfields' => $arrayrow[4][$c], 'import_fieldname' => $arrayrow[5][$c], - 'import_fieldtype' => $arrayrow[6][$c], 'import_fieldvalue' => $arrayrow[7][$c], - 'import_nbfieldefault' => $arrayrow[8][$c])); - } - } else { - $xoops->redirect('import.php?op=list', 3, 'Error: data in text file do not match. Row: '.$row); - } - } + if(strlen($row) > 1) + { + // change the ' and ; in null + $search = array ( '/\/\*.*(\n)*.*(\*\/)?/', '/\s*--.*\n/', '/\s*#.*\n/' ); + // replace in null + $replace = array ( "\n" ); + $row = preg_replace($search, $replace, $row); + // I'll put your details in the row into an array divided by separator + $arrayrow = explode( ',\n', $row); + $arrayrow = preg_replace('/\s/', ' ', $arrayrow); + // Insert query + if(strlen($arrayrow[0]) > 0) { + preg_match_all('/([A-Za-z0-9_=]+?[^\,\;\(\)$])/Ui', $row, $matches); + for ($i = 0; $i < count($matches[0]); $i++) { + //Form imported save + $obj->setVars(array('import_mid' => $_POST['import_mid'], 'import_name' => $_POST['import_name'], + 'import_nbtables' => $i, 'import_tablename' => $matches[0][$i], + 'import_nbfields' => $matches[0][$i], 'import_fieldname' => $matches[0][$i], + 'import_fieldtype' => $matches[0][$i], 'import_fieldvalue' => $matches[0][$i], + 'import_nbfieldefault' => $matches[0][$i])); + }///**/ + } else { + $xoops->redirect('import.php?op=list', 3, 'Error: data in sql file do not match. Row: '.$row); + } } // reset for the next insertion $arrayrow = array_slice($arrayrrow, 0, 0); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-11 15:33:32 UTC (rev 11013) @@ -35,7 +35,7 @@ $admin_menu->renderNavigation('modules.php'); switch ($op) { - case 'list': + case 'list': http://localhost/xoops-2.6.0-alpha2/htdocs/uploads/tdmcreate/images/modules/ default: $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_MODULE, 'modules.php?op=new', 'add'); $admin_menu->renderButton(); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-11 15:33:32 UTC (rev 11013) @@ -89,9 +89,16 @@ foreach (array_keys($table_arr) as $i) { $tables['id'] = $table_arr[$i]->getVar('table_id'); $tables['name'] = $table_arr[$i]->getVar('table_name'); - $tables['modname'] = TDMCreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); + $tables['mid'] = TDMCreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); $tables['image'] = $table_arr[$i]->getVar('table_image'); - $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); + $tables['nbfields'] = $table_arr[$i]->getVar('table_nbfields'); + $tables['blocks'] = $table_arr[$i]->getVar('table_blocks'); + $tables['admin'] = $table_arr[$i]->getVar('table_admin'); + $tables['user'] = $table_arr[$i]->getVar('table_user'); + $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); + $tables['search'] = $table_arr[$i]->getVar('table_search'); + $tables['comments'] = $table_arr[$i]->getVar('table_comments'); + $tables['notifications'] = $table_arr[$i]->getVar('table_notifications'); $xoops->tpl()->append_by_ref('tables', $tables); unset($tables); } @@ -160,12 +167,12 @@ //Form tables $obj->setVars(array('table_blocks' => (($_REQUEST['table_blocks'] == 1) ? '1' : '0'), - 'table_display_admin' => (($_REQUEST['table_display_admin'] == 1) ? '1' : '0'), - 'table_display_user' => (($_REQUEST['table_display_user'] == 1) ? '1' : '0'), + 'table_admin' => (($_REQUEST['table_admin'] == 1) ? '1' : '0'), + 'table_user' => (($_REQUEST['table_user'] == 1) ? '1' : '0'), 'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'), 'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'), 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'), - 'table_notify' => (($_REQUEST['table_notify'] == 1) ? '1' : '0'))); + 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0'))); if( $tables_Handler->insert($obj) && $obj->isNew() ) { redirect_header('fields.php?op=new', 3, _AM_TDMCREATE_FORMOK); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php 2013-02-11 15:33:32 UTC (rev 11013) @@ -19,7 +19,7 @@ * @author Timgno <txm...@gm...> * @version $Id: architecture.php 10665 2012-12-27 10:14:15Z timgno $ */ -defined('XOOPS_ROOT_PATH') or die('Restricted access'); +defined('XOOPS_ROOT_PATH') or die("Restricted access"); class TDMCreateFolder extends XoopsFolderHandler { @@ -116,43 +116,42 @@ /** * Constructor. * - * @param string $path Path to folder - * @param bool $create Create folder if not found - * @param mixed $mode Mode (CHMOD) to apply to created folder, false to ignore + * @param string $path */ - function __construct($path) { + public function __construct($path) + { $this->path = $path; } /** * - * @pubblic function makeDir * @param string $path */ public function makeDir($path) { $this->path = $path; if(!is_dir($this->path)) { - mkdir($this->path, 0705); - chmod($this->path, 0705); + mkdir($this->path, 0777); + chmod($this->path, 0777); } } + /** * - * @pubblic function makeDirModule * @param string $folder_name */ public function makeDirInModule($folder_name) { $this->folder = $folder_name; - $fname = $this->path . "/" .$this->mod_name. "/" .$this->folder; + $fname = $this->path . '/' .$this->mod_name. '/' .$this->folder; if(!is_dir($fname)) { - mkdir($fname, 0705); - chmod($fname, 0705); + mkdir($fname, 0777); + chmod($fname, 0777); } } + /** - * @pubblic function makeDir & copy file + * * @param string $folder_name * @param string $copyFile * @param string $file @@ -162,37 +161,38 @@ $this->file_name = $file; $this->folder = $folder_name; $this->copyFile = $copyFile; - $fname = $this->path . "/" .$this->mod_name. "/" .$this->folder; + $fname = $this->path . '/' .$this->mod_name. '/' .$this->folder; if(!is_dir($fname)) { - mkdir($fname, 0705); - chmod($fname, 0705); + mkdir($fname, 0777); + chmod($fname, 0777); $this->copyFile($this->folder, $this->copyFile, $this->file_name); } else { $this->copyFile($this->folder, $this->copyFile, $this->file_name); } } - /* - * @pubblic function copy file - * @param string $folder_name - * @param string $copyFile - * @param string $file - */ + + /** + * + * @param string $folder_name + * @param string $copyFile + * @param string $file + */ public function copyFile($folder_name, $copyFile, $file) { $this->file_name = $file; $this->folder = $folder_name; $this->copyFile = $copyFile; - $fname = $this->path . "/" .$this->mod_name. "/" .$this->folder. "/". $this->file_name; - /*if(!file_exists($fname)) { + $fname = $this->path . '/' .$this->mod_name. '/' .$this->folder. '/'. $this->file_name; + if(is_dir($this->folder) && XoopsLoad::fileExists($fname)) { chmod($fname, 0777); copy($this->copieFile, $fname); - } else {*/ + } else { copy($this->copyFile, $fname); - //} + } } } -class TDMCreateXoopsVersion extends TDMCreateFile +class TDMCreateFileVersion extends TDMCreateFile { /** * Constructor @@ -202,19 +202,216 @@ * @param integer $mode Mode to apply to the folder holding the file * @access private */ - function __construct($path, $create = false, $mode = 0755) + private function __construct($path, $create = false, $mode = 0755) { parent::__construct($path, $create, $mode); } /* - * @pubblic function createXoopsVersion - * @param string $folder - * @param string $file - */ - public function createXoopsVersion($folder, $file, $elements = array()) + * + * @param string $folder + * @param string $file + */ + public function createFileXoopsVersion($folder, $file, $elements = array()) { $this->file = $file; $this->folder = $folder; } +} + +class TDMCreateFileClasses +{ + /** + * @var null|array + */ + public $_class = null; + + /** + * @var bool + */ + public $is_form = false; + + /** + * Constructor + * + * @param obj $class + */ + 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 : $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 + */ + public function tdmc_setVar($key, $value, $not_gpc = false) + { + return '$this->setVar(\''.$key.'\', '. $value .', ' . $not_gpc .');'; + } + + /** + * + * @param array $var_arr + * @param boolean $not_gpc + */ + public function tdmc_setVars($var_arr, $not_gpc = false) + { + foreach ($var_arr as $key => $value) { + $results = $key.'\', '. $value; + } + return '$this->setVars(\''. $results .', ' . $not_gpc .');'; + } + + /** + * + * @param int $i + * @param string $modname + * @param string $tablename + * @param string $fieldname + * @param string $fieldelements + * @param string $langform + * @param array $structure + */ + public function tdmc_formElements($i, $modname, $tablename, $fieldname, $fieldelements, $langform, $structure) + { + return null; + } +} + +class TDMCreateFileDb +{ + /** + * @var null|array + */ + public $_class = null; + + /** + * Constructor + * + * @param obj $class + */ + public function __construct($class) + { + $this->_class = $class; + } + + /** + * + * @param string $var + * @param integer $nb_champs + * @param mixed $data_type + * @param boolean $required + * @param mixed $handler + * @param string $options + * + * @return string + */ + public function tdmc_dbTable($tablename, $nb_champs = null, $data_type = 'int', $handler = null, $options = '') + { + $ret = '# +# Structure for table `'.strtolower($tablename).'` '.$nb_champs.' +# + +CREATE TABLE `'.strtolower($tablename).'` ('; + + $j = 0; + for ($i = 0; $i < $nb_champs; $i++) + { + $structure = explode(":", $champs[$i]); + + //Debut + if ( $structure[0] != ' ' ) + { + //If as text, (not value) + if ( $structure[1] == 'text' || $structure[1] == 'date' || $structure[1] == 'timestamp' ) { + $type = $structure[1]; + } else { + $type = $structure[1].' ('.$structure[2].')'; + } + //If as empty is default not string(not value), if as text not default, if as numeric default is 0 or 0.0000 + if ( empty($structure[5]) ) { + $default = "default ''"; + } elseif ( $structure[1] == 'text' ) { + $default = ""; + } elseif ( $structure[1] == 'int' || $structure[1] == 'tinyint' || $structure[1] == 'mediumint' || $structure[1] == 'smallint') { + $default = "default '0'"; + } elseif ( $structure[1] == 'decimal' || $structure[1] == 'double' || $structure[1] == 'float' ) { + $default = "default '0.0000'"; + } elseif ( $structure[1] == 'date' ) { + $default = "default '0000-00-00'"; + } elseif ( $structure[1] == 'datetime' || $structure[1] == 'timestamp') { + $default = "default '0000-00-00 00:00:00'"; + } elseif ( $structure[1] == 'time' ) { + $default = "default '00:00:00'"; + } elseif ( $structure[1] == 'year' ) { + $default = "default '0000'"; + } else { + $default = "default '".$structure[5]."'"; + } + + if ( $i == 0 ) { + $comma[$j] = 'PRIMARY KEY (`'.$structure[0].'`)'; + $j++; + $ret .= '`'.$structure[0].'` '.$type.' '.$structure[3].' '.$structure[4].' auto_increment, +'; + } else { + if ( $structure[6] == 'unique' || $structure[6] == 'index' || $structure[6] == 'fulltext') + { + if ( $structure[6] == 'unique' ) { + $ret .= '`'.$structure[0].'` '.$type.' '.$structure[3].' '.$structure[4].' '.$default.', +'; + $comma[$j] = 'KEY `'.$structure[0].'` (`'.$structure[0].'`)'; + } else if ( $structure[6] == 'index' ) { + $ret .= '`'.$structure[0].'` '.$type.' '.$structure[3].' '.$structure[4].' '.$default.', +'; + $comma[$j] = 'INDEX (`'.$structure[0].'`)'; + } else if ( $structure[6] == 'fulltext' ) { + $ret .= '`'.$structure[0].'` '.$type.' '.$structure[3].' '.$structure[4].' '.$default.', +'; + $comma[$j] = 'FULLTEXT KEY `'.$structure[0].'` (`'.$structure[0].'`)'; + } + $j++; + } else { + $ret .= '`'.$structure[0].'` '.$type.' '.$structure[3].' '.$structure[4].' '.$default.', +'; + } + } + } + } + + //Problem comma + $key = ''; + for ($i = 0; $i < $j; $i++) + { + if ( $i != $j - 1 ) { + $key .= ''.$comma[$i].', +'; + } else { + $key .= ''.$comma[$i].' +'; + } + } + $ret .= $key; +$ret .= ') ENGINE=MyISAM;'; + return $ret; + } } \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php 2013-02-11 15:33:32 UTC (rev 11013) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** * tdmcreate module * @@ -30,37 +29,37 @@ { $xoops = Xoops::getInstance(); - $this->initVar("ext_id", XOBJ_DTYPE_INT, null, false, 5); - $this->initVar("ext_name",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('name'),false); - $this->initVar("ext_version",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('version'),false); - $this->initVar("ext_description",XOBJ_DTYPE_TXTAREA, $xoops->getModuleConfig('description'), false); - $this->initVar("ext_author",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author'), false); - $this->initVar("ext_author_mail",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_email'),false); - $this->initVar("ext_author_website_url",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website_url'),false); - $this->initVar("ext_author_website_name",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website'),false); - $this->initVar("ext_credits",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('credits'), false); - $this->initVar("ext_license",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('license'), false); - $this->initVar("ext_release_info",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_info'), false); - $this->initVar("ext_release_file",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_file'), false); - $this->initVar("ext_manual",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual'), false); - $this->initVar("ext_manual_file",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual_file'), false); - $this->initVar("ext_image",XOBJ_DTYPE_TXTBOX, null, false); - $this->initVar("ext_demo_site_url",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_url'), false); - $this->initVar("ext_demo_site_name",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_name'), false); - $this->initVar("ext_forum_site_url",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_url'), false); - $this->initVar("ext_forum_site_name",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_name'), false); - $this->initVar("ext_website_url",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_url'), false); - $this->initVar("ext_website_name",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_name'), false); - $this->initVar("ext_release",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release'), false); - $this->initVar("ext_status",XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('status'), false); - $this->initVar("ext_display_admin",XOBJ_DTYPE_INT,$xoops->getModuleConfig('display_admin'), false, 1); - $this->initVar("ext_display_user",XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_user'), false, 1); - $this->initVar("ext_display_submenu", XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_submenu'), false, 1); - $this->initVar("ext_active_search",XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_search'), false, 1); - $this->initVar("ext_active_comments",XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_comments'), false, 1); - $this->initVar("ext_active_notifies", XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_notifies'), false, 1); - $this->initVar("ext_paypal_button", XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('paypal_button'), false, 20); - $this->initVar("ext_subversion", XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('subversion'), false, 5); + $this->initVar('ext_id', XOBJ_DTYPE_INT, null, false, 5); + $this->initVar('ext_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('name'),false); + $this->initVar('ext_version',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('version'),false); + $this->initVar('ext_description',XOBJ_DTYPE_TXTAREA, $xoops->getModuleConfig('description'), false); + $this->initVar('ext_author',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author'), false); + $this->initVar('ext_author_mail',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_email'),false); + $this->initVar('ext_author_website_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website_url'),false); + $this->initVar('ext_author_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website'),false); + $this->initVar('ext_credits',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('credits'), false); + $this->initVar('ext_license',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('license'), false); + $this->initVar('ext_release_info',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_info'), false); + $this->initVar('ext_release_file',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_file'), false); + $this->initVar('ext_manual',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual'), false); + $this->initVar('ext_manual_file',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual_file'), false); + $this->initVar('ext_image',XOBJ_DTYPE_TXTBOX, null, false); + $this->initVar('ext_demo_site_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_url'), false); + $this->initVar('ext_demo_site_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_name'), false); + $this->initVar('ext_forum_site_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_url'), false); + $this->initVar('ext_forum_site_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_name'), false); + $this->initVar('ext_website_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_url'), false); + $this->initVar('ext_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_name'), false); + $this->initVar('ext_release',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release'), false); + $this->initVar('ext_status',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('status'), false); + $this->initVar('ext_admin',XOBJ_DTYPE_INT,$xoops->getModuleConfig('display_admin'), false, 1); + $this->initVar('ext_user',XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_user'), false, 1); + $this->initVar('ext_submenu', XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_submenu'), false, 1); + $this->initVar('ext_search',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_search'), false, 1); + $this->initVar('ext_comments',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_comments'), false, 1); + $this->initVar('ext_notifications', XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_notifies'), false, 1); + $this->initVar('ext_paypal_button', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('paypal_button'), false, 20); + $this->initVar('ext_subversion', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('subversion'), false, 5); } } @@ -71,7 +70,6 @@ */ public function __construct(XoopsDatabase $db = null) { - parent::__construct($db, "tdmcreate_extensions", 'tdmcreateextensions', 'ext_id', 'ext_name'); + parent::__construct($db, 'tdmcreate_extensions', 'tdmcreateextensions', 'ext_id', 'ext_name'); } -} -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-11 15:33:32 UTC (rev 11013) @@ -37,7 +37,7 @@ $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_EXTENSION_IMPORTANT.'</b></div>','head'); $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_NAME, "ext_name", 50, 255, $obj->getVar('ext_name')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_VERSION, "ext_version", 30, 50, $obj->getVar('ext_version')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_VERSION, "ext_version", 2, 5, $obj->getVar('ext_version')), true); $editor_configs=array(); $editor_configs["name"] = 'ext_description'; $editor_configs["value"] = $obj->getVar('ext_description', 'e'); @@ -50,29 +50,29 @@ $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR, "ext_author", 50, 255, $obj->getVar('ext_author')), true); $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_LICENSE, "ext_license", 50, 255, $obj->getVar('ext_license')), true); $option_tray = new XoopsFormElementTray(_OPTIONS, ' '); - $display_admin = $obj->isNew() ? 0 : $obj->getVar('ext_display_admin'); - $check_display_admin = new XoopsFormCheckBox(" ", "ext_display_admin", $display_admin); - $check_display_admin->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN); + $display_admin = $obj->isNew() ? 0 : $obj->getVar('ext_admin'); + $check_display_admin = new XoopsFormCheckBox(" ", "ext_admin", $display_admin); + $check_display_admin->addOption(1, _AM_TDMCREATE_EXTENSION_ADMIN); $option_tray->addElement($check_display_admin); - $display_user = $obj->isNew() ? 0 : $obj->getVar('ext_display_user'); - $check_display_user = new XoopsFormCheckBox(" ", "ext_display_user", $display_user); - $check_display_user->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_USER); + $display_user = $obj->isNew() ? 0 : $obj->getVar('ext_user'); + $check_display_user = new XoopsFormCheckBox(" ", "ext_user", $display_user); + $check_display_user->addOption(1, _AM_TDMCREATE_EXTENSION_USER); $option_tray->addElement($check_display_user); - $display_submenu = $obj->isNew() ? 0 : $obj->getVar('ext_display_submenu'); - $check_display_submenu = new XoopsFormCheckBox(" ", "ext_display_submenu", $display_submenu); - $check_display_submenu->addOption(1, _AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU); + $display_submenu = $obj->isNew() ? 0 : $obj->getVar('ext_submenu'); + $check_display_submenu = new XoopsFormCheckBox(" ", "ext_submenu", $display_submenu); + $check_display_submenu->addOption(1, _AM_TDMCREATE_EXTENSION_SUBMENU); $option_tray->addElement($check_display_submenu); - $active_search = $obj->isNew() ? 0 : $obj->getVar('ext_active_search'); - $check_active_search = new XoopsFormCheckBox(" ", "ext_active_search", $active_search); - $check_active_search->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH); + $active_search = $obj->isNew() ? 0 : $obj->getVar('ext_search'); + $check_active_search = new XoopsFormCheckBox(" ", "ext_search", $active_search); + $check_active_search->addOption(1, _AM_TDMCREATE_EXTENSION_SEARCH); $option_tray->addElement($check_active_search); - $active_comments = $obj->isNew() ? 0 : $obj->getVar('ext_active_comments'); - $check_active_comments = new XoopsFormCheckBox(" ", "ext_active_comments", $active_comments); - $check_active_comments->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS); + $active_comments = $obj->isNew() ? 0 : $obj->getVar('ext_comments'); + $check_active_comments = new XoopsFormCheckBox(" ", "ext_comments", $active_comments); + $check_active_comments->addOption(1, _AM_TDMCREATE_EXTENSION_COMMENTS); $option_tray->addElement($check_active_comments); - $active_notifies = $obj->isNew() ? 0 : $obj->getVar('ext_active_notifies'); - $check_active_notifies = new XoopsFormCheckBox(" ", "ext_active_notifies", $active_notifies); - $check_active_notifies->addOption(1, _AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES); + $active_notifies = $obj->isNew() ? 0 : $obj->getVar('ext_notifications'); + $check_active_notifies = new XoopsFormCheckBox(" ", "ext_notifications", $active_notifies); + $check_active_notifies->addOption(1, _AM_TDMCREATE_EXTENSION_NOTIFICATIONS); $option_tray->addElement($check_active_notifies); $this->addElement($option_tray); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php 2013-02-11 15:33:32 UTC (rev 11013) @@ -35,12 +35,12 @@ $this->initVar('table_fieldname', XOBJ_DTYPE_TXTBOX, null); $this->initVar('table_image', XOBJ_DTYPE_TXTBOX, null); $this->initVar('table_blocks', XOBJ_DTYPE_INT, null); - $this->initVar('table_display_admin', XOBJ_DTYPE_INT, null); - $this->initVar('table_display_user', XOBJ_DTYPE_INT, null); + $this->initVar('table_admin', XOBJ_DTYPE_INT, null); + $this->initVar('table_user', XOBJ_DTYPE_INT, null); $this->initVar('table_submenu', XOBJ_DTYPE_INT, null); $this->initVar('table_search', XOBJ_DTYPE_INT, null); $this->initVar('table_comments', XOBJ_DTYPE_INT, null); - $this->initVar('table_notify', XOBJ_DTYPE_INT, null); + $this->initVar('table_notifications', XOBJ_DTYPE_INT, null); } } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php 2013-02-11 15:33:32 UTC (rev 11013) @@ -93,20 +93,20 @@ define("_AM_TDMCREATE_MODULE_STATUS", "Status"); define("_AM_TDMCREATE_MODULE_PAYPALBTN", "Button for Donations"); define("_AM_TDMCREATE_MODULE_SVN", "Subversion module"); -define("_AM_TDMCREATE_MODULE_DISPLAY_ADMIN", "Visible Admin"); -define("_AM_TDMCREATE_MODULE_DISPLAY_USER", "Visible User"); -define("_AM_TDMCREATE_MODULE_ACTIVE_SEARCH", "Enable Search"); -define("_AM_TDMCREATE_MODULE_ACTIVE_COMMENTS", "Enable Comments"); -define("_AM_TDMCREATE_MODULE_ACTIVE_NOTIFIES", "Enable Notifies"); +define("_AM_TDMCREATE_MODULE_ADMIN", "Visible Admin"); +define("_AM_TDMCREATE_MODULE_USER", "Visible User"); +define("_AM_TDMCREATE_MODULE_SEARCH", "Enable Search"); +define("_AM_TDMCREATE_MODULE_COMMENTS", "Enable Comments"); +define("_AM_TDMCREATE_MODULE_NOTIFICATIONS", "Enable Notifications"); // Added in version 1.39 define("_AM_TDMCREATE_MODULE_NBFIELDS", "Fields Number"); define("_AM_TDMCREATE_MODULE_BLOCKS", "Blocks"); -define("_AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST", "Admin"); -define("_AM_TDMCREATE_MODULE_DISPLAY_USER_LIST", "User"); -define("_AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST", "Submenu"); -define("_AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST", "Search"); -define("_AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST", "Comments"); -define("_AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST", "Notifications"); +define("_AM_TDMCREATE_MODULE_ADMIN_LIST", "Admin"); +define("_AM_TDMCREATE_MODULE_USER_LIST", "User"); +define("_AM_TDMCREATE_MODULE_SUBMENU_LIST", "Submenu"); +define("_AM_TDMCREATE_MODULE_SEARCH_LIST", "Search"); +define("_AM_TDMCREATE_MODULE_COMMENTS_LIST", "Comments"); +define("_AM_TDMCREATE_MODULE_NOTIFICATIONS_LIST", "Notifications"); define("_AM_TDMCREATE_EXTENSION_ADD", "Add a new extension"); define("_AM_TDMCREATE_EXTENSION_EDIT", "Edit extension"); @@ -138,21 +138,21 @@ define("_AM_TDMCREATE_EXTENSION_STATUS", "Status"); define("_AM_TDMCREATE_EXTENSION_PAYPALBTN", "Button for Donations"); define("_AM_TDMCREATE_EXTENSION_SVN", "Subversion module"); -define("_AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN", "Visible Admin"); -define("_AM_TDMCREATE_EXTENSION_DISPLAY_USER", "Visible User"); -define("_AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU", "Visible Submenu"); -define("_AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH", "Enable Search"); -define("_AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS", "Enable Comments"); -define("_AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES", "Enable Notifies"); +define("_AM_TDMCREATE_EXTENSION_ADMIN", "Visible Admin"); +define("_AM_TDMCREATE_EXTENSION_USER", "Visible User"); +define("_AM_TDMCREATE_EXTENSION_SUBMENU", "Visible Submenu"); +define("_AM_TDMCREATE_EXTENSION_SEARCH", "Enable Search"); +define("_AM_TDMCREATE_EXTENSION_COMMENTS", "Enable Comments"); +define("_AM_TDMCREATE_EXTENSION_NOTIFICATIONS", "Enable Notifications"); // Added in version 2.01 define("_AM_TDMCREATE_EXTENSION_NBFIELDS", "Fields Number"); define("_AM_TDMCREATE_EXTENSION_BLOCKS", "Blocks"); -define("_AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN_LIST", "Admin"); -define("_AM_TDMCREATE_EXTENSION_DISPLAY_USER_LIST", "User"); -define("_AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU_LIST", "Submenu"); -define("_AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH_LIST", "Search"); -define("_AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS_LIST", "Comments"); -define("_AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES_LIST", "Notifications"); +define("_AM_TDMCREATE_EXTENSION_ADMIN_LIST", "Admin"); +define("_AM_TDMCREATE_EXTENSION_USER_LIST", "User"); +define("_AM_TDMCREATE_EXTENSION_SUBMENU_LIST", "Submenu"); +define("_AM_TDMCREATE_EXTENSION_SEARCH_LIST", "Search"); +define("_AM_TDMCREATE_EXTENSION_COMMENTS_LIST", "Comments"); +define("_AM_TDMCREATE_EXTENSION_NOTIFICATIONS_LIST", "Notifications"); define("_AM_TDMCREATE_EXTENSIONS_LIST", "Extension List"); //Tables.php @@ -177,12 +177,12 @@ define("_AM_TDMCREATE_TABLE_COMMENTS", "Enable Comments for this table"); define("_AM_TDMCREATE_TABLE_ID", "Id"); -define("_AM_TDMCREATE_TABLE_DISPLAY_ADMIN_LIST", "Display Admin"); -define("_AM_TDMCREATE_TABLE_DISPLAY_USER_LIST", "Display User"); -define("_AM_TDMCREATE_TABLE_DISPLAY_SUBMENU_LIST", "Display Submenu"); -define("_AM_TDMCREATE_TABLE_ACTIVE_SEARCH_LIST", "Active Search"); -define("_AM_TDMCREATE_TABLE_ACTIVE_COMMENTS_LIST", "Active Comments"); -define("_AM_TDMCREATE_TABLE_ACTIVE_NOTIFIES_LIST", "Active Notifies"); +define("_AM_TDMCREATE_TABLE_ADMIN_LIST", "Display Admin"); +define("_AM_TDMCREATE_TABLE_USER_LIST", "Display User"); +define("_AM_TDMCREATE_TABLE_SUBMENU_LIST", "Display Submenu"); +define("_AM_TDMCREATE_TABLE_SEARCH_LIST", "Active Search"); +define("_AM_TDMCREATE_TABLE_COMMENTS_LIST", "Active Comments"); +define("_AM_TDMCREATE_TABLE_NOTIFICATIONS_LIST", "Active Notifies"); // v1.38 define("_AM_TDMCREATE_TABLE_IMAGE_DESC", "<span class='red bold'>Attention</span>: If you want to choose a new image, is best to name it with the module name before and follow with the name of the image so as not to overwrite any images with the same name, in the <span class='bold'>Frameworks/moduleclasses/moduleadmin/icons/32/</span>. Otherwise an other solution, would be to insert the images in the module, a new folder is created, with the creation of the same module - <span class='bold'>images/32</span>."); // Added in version 1.39 Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql 2013-02-11 15:33:32 UTC (rev 11013) @@ -79,7 +79,7 @@ `ext_comments` tinyint (1) unsigned NOT NULL default '0', `ext_notifications` tinyint (1) unsigned NOT NULL default '0', `ext_paypal` varchar (20) NOT NULL default 'YDRUY5QZQHAHS', -`ext_subversion` varchar (10) NOT NULL default '000000', +`ext_subversion` varchar (20) NOT NULL default '0', PRIMARY KEY (`ext_id`), KEY `ext_name` (`ext_name`(40)) ) ENGINE=MyISAM; @@ -96,12 +96,12 @@ `table_fieldname` varchar (50) NOT NULL default '', `table_image` varchar (100) NOT NULL default '', `table_blocks` tinyint (1) unsigned NOT NULL default '0', -`table_display_admin` tinyint (1) unsigned NOT NULL default '0', -`table_display_user` tinyint (1) unsigned NOT NULL default '0', +`table_admin` tinyint (1) unsigned NOT NULL default '0', +`table_user` tinyint (1) unsigned NOT NULL default '0', `table_submenu` tinyint (1) unsigned NOT NULL default '0', `table_search` tinyint (1) unsigned NOT NULL default '0', `table_comments` tinyint (1) unsigned NOT NULL default '0', -`table_notify` tinyint (1) unsigned NOT NULL default '0', +`table_notifications` tinyint (1) unsigned NOT NULL default '0', PRIMARY KEY (`table_id`), KEY `table_mid` (`table_mid`), KEY `table_name` (`table_name`(40)) Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html 2013-02-11 15:33:32 UTC (rev 11013) @@ -10,34 +10,34 @@ <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_IMAGE}></th> <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_RELEASE}></th> <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_COMMENTS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ACTIVE_NOTIFIES_LIST}></th> - <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_COMMENTS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_EXTENSION_NOTIFICATIONS_LIST}></th> + <th class='xo-actions txtcenter width6'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> </tr> </thead> <tbody> <{foreach item=extension from=$extensions}> <tr class='<{cycle values='even,odd'}>'> - <td class='center'><{$extension.ext_id}></td> - <td class='center'><{$extension.ext_name}></td> - <td class='center'><{$extension.ext_version}></td> - <td class='center'><img src='<{$eimg_path}>/<{$extension.ext_image}>' height='25px' title='<{$extension.ext_name}>' alt='<{$extension.ext_name}>' /></td> - <td class='center'><{$extension.ext_release}></td> - <td class='center'><{$extension.ext_status}></td> - <td class='center'><{$extension.ext_display_admin}></td> - <td class='center'><{$extension.ext_display_user}></td> - <td class='center'><{$extension.ext_display_submenu}></td> - <td class='center'><{$extension.ext_active_search}></td> - <td class='center'><{$extension.ext_active_comments}></td> - <td class='center'><{$extension.ext_active_notifies}></td> + <td class='center'><{$extension.id}></td> + <td class='center'><{$extension.name}></td> + <td class='center'><{$extension.version}></td> + <td class='center'><img src='<{$eimg_path}>/<{$extension.image}>' height='25px' title='<{$extension.name}>' alt='<{$extension.name}>' /></td> + <td class='center'><{$extension.release}></td> + <td class='center'><{$extension.status}></td> + <td class='center'><{$extension.admin}></td> + <td class='center'><{$extension.user}></td> + <td class='center'><{$extension.submenu}></td> + <td class='center'><{$extension.search}></td> + <td class='center'><{$extension.comments}></td> + <td class='center'><{$extension.notifications}></td> <td class='xo-actions txtcenter width6'> - <a href='extensions.php?op=edit&id=<{$extension.ext_id}>' title='<{$smarty.const._EDIT}>'> + <a href='extensions.php?op=edit&id=<{$extension.id}>' title='<{$smarty.const._EDIT}>'> <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> - <a href='extensions.php?op=delete&id=<{$extension.ext_id}>' title='<{$smarty.const._DELETE}>'> + <a href='extensions.php?op=delete&id=<{$extension.id}>' title='<{$smarty.const._DELETE}>'> <img src='<{xoAdminIcons delete.png}>' alt='<{$smarty.const._DELETE}>' /></a> </td> </tr> Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html 2013-02-11 15:33:32 UTC (rev 11013) @@ -11,30 +11,30 @@ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_COMMENTS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NOTIFICATIONS_LIST}></th> <th class='xo-actions txtcenter width5'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> </tr> </thead> <tbody> <{foreach item=module from=$modules}> <tr class='<{cycle values='even,odd'}>'> - <td class='center'><{$module.mod_id}></td> - <td class='center'><{$module.mod_name}></td> - <td class='center'><{$module.mod_version}></td> + <td class='center'><{$module.id}></td> + <td class='center'><{$module.name}></td> + <td class='center'><{$module.version}></td> <td class='center'><img src='<{$mimg_path}>/<{$module.mod_image}>' height='25px' title='<{$module.mod_name}>' alt='<{$module.mod_name}>' /></td> - <td class='center'><{$module.mod_release}></td> - <td class='center'><{$module.mod_status}></td> - <td class='center'><{$module.mod_admin}></td> - <td class='center'><{$module.mod_user}></td> - <td class='center'><{$module.mod_submenu}></td> - <td class='center'><{$module.mod_search}></td> - <td class='center'><{$module.mod_comments}></td> - <td class='center'><{$module.mod_notifications}></td> + <td class='center'><{$module.release}></td> + <td class='center'><{$module.status}></td> + <td class='center'><{$module.admin}></td> + <td class='center'><{$module.user}></td> + <td class='center'><{$module.submenu}></td> + <td class='center'><{$module.search}></td> + <td class='center'><{$module.comments}></td> + <td class='center'><{$module.notifications}></td> <td class='xo-actions txtcenter width6'> <a href='modules.php?op=edit&mod_id=<{$module.mod_id}>' title='<{$smarty.const._EDIT}>'> <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-02-10 00:51:04 UTC (rev 11012) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-02-11 15:33:32 UTC (rev 11013) @@ -10,30 +10,30 @@ <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_IMAGE}></th> <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_RELEASE}></th> <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_STATUS}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_ADMIN_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_USER_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_DISPLAY_SUBMENU_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_SEARCH_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_COMS_LIST}></th> - <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ACTIVE_NOTIFY_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_ADMIN_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_USER_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SUBMENU_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_SEARCH_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_COMMENTS_LIST}></th> + <th class='center'><{$smarty.const._AM_TDMCREATE_MODULE_NOTIFICATIONS_LIST}></th> <th class='xo-actions txtcenter width6'><{$smarty.const._AM_TDMCREATE_FORMACTION}></th> </tr> </thead> <tbody> <{foreach item=module from=$modules}> <tr class='<{cycle values='even,odd'}>'> - <td class='center'><{$module.mod_id}></td> - <td class='center'><{$module.mod_name}></td> - <td class='center'><{$module.mod_version}></td> - <td class='center'><img src='<{$mimg_path}><{$module.mod_image}>' height='25px' title='<{$module.mod_name}>' alt='<{$module.mod_name}>' /></td> - <td class='center'><{$module.mod_release}></td> - <td class='center'><{$module.mod_status}></td> - <td class='center'><{$module.mod_display_admin}></td> - <td class='center'><{$module.mod_display_user}></td> - <td class='center'><{$module.mod_display_submenu}></td> - <td class='center'><{$module.mod_active_search}></td> - <td class='center'><{$module.mod_active_comments}></td> - <td class='center'><{$module.mod_active_notifies}></td> + <td class='center'><{$module.id}></td> + <td class='center'><{$module.name}></td> + <td class='center'><{$module.version}></td> + <td class='center'><img src='<{$mimg_path}>/<{$module.mod_image}>' height='25px' title='<{$module.mod_name}>' alt='<{$module.mod_name}>' /></td> + <td class='center'><{$module.release}></td> + <td class='center'><{$module.status}></td> + <td class='center'><{$module.admin}></td> + <td class='center'><{$module.user}></td> + <td class='center'><{$module.submenu}></td> + <td class='center'><{$module.search}></td> + <td class='center'><{$module.comments}></td> + <td class='center'><{$module.notifications}></td> <td class='xo-actions txtcenter width6'> <a href='modules.php?op=edit&id=<{$module.mod_id}>' title='<{$smarty.const._EDIT}>'> <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> @@ -44,18 +44,18 @@ <{if $tables_count}> <{foreach item=table from=$tables}> <tr class='<{cycle values='even,odd'}>'> - <td class='center'><{$table.table_id}></td> - <td class='center'><{$table.table_name}></td> - <td class='center'><{$table.table_mid}></td> - <td class='center'><img src='<{$timg_path}><{$table.table_image}>' height='25px' title='<{$table.table_name}>' alt='<{$table.table_name}>' /></td> - <td class='center'><{$table.table_nbfields}></td> - <td class='center'><{$table.table_blocks}></td> - <td class='center'><{$table.table_admin}></td> - <td class='center'><{$table.table_user}></td> - <td class='center'><{$table.table_submenu}></td> - <td class='center'><{$table.table_search}></td> - <td class='center'><{$table.table_comments}></td> - <td class='center'><{$table.table_notifies}></td> + <td class='center'><{$table.id}></td> + <td class='center'><{$table.name}></td> + <td class='center'><{$table.mid}></td> + <td class='center'><img src='<{$timg_path}>/<{$table.image}>' height='25px' title='<{$table.name}>' alt='<{$table.table_name}>' /></td> + <td class='center'><{$table.nbfields}></td> + <td class='center'><{$table.blocks}></td> + <td class='center'><{$table.admin}></td> + <td class='center'><{$table.user}></td> + <td class='center'><{$table.submenu}></td> + <td class='center'><{$table.search}></td> + <td class='center'><{$table.comments}></td> + <td class='center'><{$table.notifications}></td> <td class='xo-actions txtcenter width5'> <a href='tables.php?op=edit&id=<{$table.table_id}>' title='<{$smarty.const._EDIT}>'> <img src='<{xoAdminIcons edit.png}>' alt='<{$smarty.const._EDIT}>' /></a> |
From: <txm...@us...> - 2013-02-12 00:20:23
|
Revision: 11023 http://sourceforge.net/p/xoops/svn/11023 Author: txmodxoops Date: 2013-02-12 00:20:20 +0000 (Tue, 12 Feb 2013) Log Message: ----------- Added plugin folder Updated Test re-install Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_building.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_import.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/locale.txt Removed Paths: ------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.0 to 1.1.txt XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.1 to 1.15.txt XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.1 to 1.37.txt XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.15 to 1.37.txt XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.37 to 1.38.txt Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-02-12 00:20:20 UTC (rev 11023) @@ -20,11 +20,8 @@ * @version $Id: building.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; -// Get main instance -$system = System::getInstance(); -$xoops = Xoops::getInstance(); // Get Action type -$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +$op = $system->cleanVars($_REQUEST, 'op', 'default', 'string'); // heaser $xoops->header('tdmcreate_building.html'); // Get handler @@ -35,18 +32,34 @@ /* @var $tables_handler TDMCreateExtensionsHandler */ $tables_Handler = $xoops->getModuleHandler('tables'); -$admin_page = new XoopsModuleAdmin(); -$admin_page->renderNavigation('building.php'); -switch ($op) { - case "default": +$admin_menu->renderNavigation('building.php'); +switch ($op) +{ + case 'default': default: - //tdmcreate_getBuildingForm(); + $form = new XoopsSimpleForm(_AM_TDMCREATE_BUILDING_TITLE, 'building', 'building.php', 'post', true); + + $mods_select = new XoopsFormSelect(_AM_TDMCREATE_BUILDING_MODULES, 'mod_name', 'mod_name'); + $mods_select->addOption(0, _AM_TDMCREATE_SELDEFMOD); + $mods_select->addOptionArray($modules_Handler->getList()); + $form->addElement($mods_select); + + $exts_select = new XoopsFormSelect(_AM_TDMCREATE_BUILDING_EXTENSIONS, 'ext_name', 'ext_name'); + $exts_select->addOption(0, _AM_TDMCREATE_SELDEFEXT); + $exts_select->addOptionArray($extensions_Handler->getList()); + $form->addElement($exts_select); + + $form->addElement(new XoopsFormHidden('op', 'build')); + $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $xoops->tpl()->assign('form', $form->render()); break; - case "build": + case 'build': + $admin_menu->addItemButton(_AM_TDMCREATE_BUILDING_FORM, 'building.php', 'application-view-detail'); + $admin_menu->renderButton(); + $mods =& $modules_Handler->get($_REQUEST['mod_name']); - $mods_name = $mods->getVar('mod_name'); - + $mods_name = $mods->getVar('mod_name'); break; } $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-12 00:20:20 UTC (rev 11023) @@ -47,14 +47,14 @@ $criteria->setLimit($limit); $numrows_exts = $extensions_Handler->getCount($criteria); $exts_arr = $extensions_Handler->getAll($criteria); - $xoops->tpl()->assign('eimg_path', TDMC_EXTENSIONS_URL_IMG); $xoops->tpl()->assign('extensions_count', $numrows_exts); unset($criteria); - if ($numrows_mods > 0) { + if ($numrows_exts > 0) { foreach (array_keys($exts_arr) as $i) { $ext['id'] = $exts_arr[$i]->getVar('ext_id'); $ext['name'] = $exts_arr[$i]->getVar('ext_name'); $ext['version'] = $exts_arr[$i]->getVar('ext_version'); + $ext['image'] = $exts_arr[$i]->getVar('ext_image'); $ext['release'] = $exts_arr[$i]->getVar('ext_release'); $ext['status'] = $exts_arr[$i]->getVar('ext_status'); $ext['admin'] = $exts_arr[$i]->getVar('ext_admin'); @@ -104,27 +104,27 @@ 'ext_release_file' => $_POST['ext_release_file'], 'ext_manual' => $_POST['ext_manual'], 'ext_manual_file' => $_POST['ext_manual_file'])); - //Form extension_image - $uploader_img = new XoopsMediaUploader(TDMC_EXTENSIONS_PATH_IMG, $xoops->getModuleConfig('mimetypes'), - $xoops->getModuleConfig('maxsize'), null, null); - if ($uploader_img->fetchMedia('extensions_image')) { - $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['ext_image']['name']); + //Form extension_image + $uploader = new XoopsMediaUploader( TDMC_EXTENSIONS_PATH_IMG, $xoops->getModuleConfig('mimetypes'), + $xoops->getModuleConfig('maxuploadsize'), null, null); + if ($uploader->fetchMedia($_POST['extensions_image'][0])) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['extensions_image']['name']); $name_img = 'logo.'.$extension; - $uploader_img->setPrefix($name_img); - $uploader_img->fetchMedia('extensions_image'); - if (!$uploader_img->upload()) { - $errors = $uploader_img->getErrors(); - $xoops->redirect('javascript:history.go(-1)', 3, $errors); - } else { - $obj->setVar('extensions_image', TDMC_EXTENSIONS_URL_IMG . '/' . $uploader_img->getSavedFileName()); - } - } else { - if ($_POST['extensions_image'] == 'blank.gif') { + $uploader->setPrefix($name_img); + $uploader->fetchMedia($_POST['extensions_image'][0]); + if (!$uploader->upload()) { + redirect_header('javascript:history.go(-1)',3, $uploader->getErrors()); + } else { + $obj->setVar('ext_image', $uploader->getSavedFileName()); + } + } else { + if ($_POST['extensions_image'] == 'blank.gif') { $obj->setVar('ext_image', $_POST['ext_image']); } else { - $obj->setVar('ext_image', TDMC_EXTENSIONS_URL_IMG . '/' . $_POST['ext_image']); + $obj->setVar('ext_image', $_POST['extensions_image']); } - } + } + //Form extension save $obj->setVars(array('ext_demo_site_url' => $_POST['ext_demo_site_url'], 'ext_demo_site_name' => $_POST['ext_demo_site_name'], 'ext_forum_site_url' => $_POST['ext_forum_site_url'], 'ext_forum_site_name' => $_POST['ext_forum_site_name'], @@ -153,14 +153,9 @@ $admin_menu->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); $admin_menu->renderButton(); - $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); - if ($id > 0) { - $obj = $extensions_Handler->get($id); - $form = $xoops->getModuleForm($obj, 'extensions'); - $xoops->tpl()->assign('form', $form->render()); - } else { - $xoops->redirect('extensions.php', 1, _AM_SYSTEM_DBERROR); - } + $obj = $extensions_Handler->get($system->cleanVars($_REQUEST, 'ext_id', 0, 'int')); + $form = $xoops->getModuleForm($obj, 'extensions'); + $xoops->tpl()->assign('form', $form->render()); break; case 'delete': Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-12 00:20:20 UTC (rev 11023) @@ -178,14 +178,9 @@ $admin_menu->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); $admin_menu->renderButton(); - $id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); - if ($id > 0) { - $obj = $import_Handler->get($id); - $form = $xoops->getModuleForm($obj, 'import'); - $xoops->tpl()->assign('form', $form->render()); - } else { - $xoops->redirect('import.php', 2, _AM_SYSTEM_DBERROR); - } + $obj = $import_Handler->get($system->cleanVars($_REQUEST, 'import_id', 0, 'int')); + $form = $xoops->getModuleForm($obj, 'import'); + $xoops->tpl()->assign('form', $form->render()); break; case 'delete': Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-12 00:20:20 UTC (rev 11023) @@ -48,7 +48,6 @@ $numrows_mods = $modules_Handler->getCount($criteria); $mod_arr = $modules_Handler->getAll($criteria); // Assign Template variables - $xoops->tpl()->assign('mimg_path', TDMC_MODULES_URL_IMG); $xoops->tpl()->assign('modules_count', $numrows_mods); unset($criteria); if ($numrows_mods > 0) { @@ -56,6 +55,7 @@ $mod['id'] = $mod_arr[$i]->getVar('mod_id'); $mod['name'] = $mod_arr[$i]->getVar('mod_name'); $mod['version'] = $mod_arr[$i]->getVar('mod_version'); + $mod['image'] = $mod_arr[$i]->getVar('mod_image'); $mod['release'] = $mod_arr[$i]->getVar('mod_release'); $mod['status'] = $mod_arr[$i]->getVar('mod_status'); $mod['admin'] = $mod_arr[$i]->getVar('mod_admin'); @@ -104,26 +104,27 @@ 'mod_license' => $_POST['mod_license'], 'mod_release_info' => $_POST['mod_release_info'], 'mod_release_file' => $_POST['mod_release_file'], 'mod_manual' => $_POST['mod_manual'], 'mod_manual_file' => $_POST['mod_manual_file'])); - //Form module_image - $uploader_img = new XoopsMediaUploader( TDMC_MODULES_PATH_IMG, $xoops->getModuleConfig('mimetypes'), - $xoops->getModuleConfig('maxsize'), null, null); - if ($uploader_img->fetchMedia('modules_imgurl')) { - $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['module_image']['name']); - $img_name = 'logo.'.$extension; $uploader_img->setPrefix($img_name); - $uploader_img->fetchMedia('modules_imgurl'); - if (!$uploader_img->upload()) { - $errors = $uploader_img->getErrors(); - $xoops->redirect('javascript:history.go(-1)', 3, $errors); - } else { - $obj->setVar('mod_image', TDMC_MODULES_URL_IMG . '/' . $uploader_img->getSavedFileName()); - } - } else { - if ($_POST['modules_imgurl'] == 'blank.gif') { + //Form module_image + $uploader = new XoopsMediaUploader( TDMC_MODULES_PATH_IMG, $xoops->getModuleConfig('mimetypes'), + $xoops->getModuleConfig('maxuploadsize'), null, null); + if ($uploader->fetchMedia($_POST['modules_image'][0])) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['modules_image']['name']); + $name_img = 'logo.'.$extension; + $uploader->setPrefix($name_img); + $uploader->fetchMedia($_POST['modules_image'][0]); + if (!$uploader->upload()) { + redirect_header('javascript:history.go(-1)',3, $uploader->getErrors()); + } else { + $obj->setVar('mod_image', $uploader->getSavedFileName()); + } + } else { + if ($_POST['modules_image'] == 'blank.gif') { $obj->setVar('mod_image', $_POST['mod_image']); } else { - $obj->setVar('mod_image', TDMC_MODULES_URL_IMG . '/' . $_POST['modules_imgurl']); + $obj->setVar('mod_image', $_POST['modules_image']); } - } + } + //Form module save $obj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'], 'mod_demo_site_name' => $_POST['mod_demo_site_name'], 'mod_forum_site_url' => $_POST['mod_forum_site_url'], 'mod_forum_site_name' => $_POST['mod_forum_site_name'], @@ -152,14 +153,9 @@ $admin_menu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'application-view-detail'); $admin_menu->renderButton(); - $id = $system->cleanVars($_REQUEST, 'mod_id', 0, 'int'); - if ($id > 0) { - $obj = $modules_Handler->get($id); - $form = $xoops->getModuleForm($obj, 'modules'); - $xoops->tpl()->assign('form', $form->render()); - } else { - $xoops->redirect('modules.php', 1, _AM_SYSTEM_DBERROR); - } + $obj = $modules_Handler->get($system->cleanVars($_REQUEST, 'mod_id', 0, 'int')); + $form = $xoops->getModuleForm($obj, 'modules'); + $xoops->tpl()->assign('form', $form->render()); break; case 'delete': Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-12 00:20:20 UTC (rev 11023) @@ -75,6 +75,7 @@ $mod['id'] = $mod_arr[$i]->getVar('mod_id'); $mod['name'] = $mod_arr[$i]->getVar('mod_name'); $mod['version'] = $mod_arr[$i]->getVar('mod_version'); + $mod['image'] = $mod_arr[$i]->getVar('mod_image'); $mod['release'] = $mod_arr[$i]->getVar('mod_release'); $mod['status'] = $mod_arr[$i]->getVar('mod_status'); $mod['admin'] = $mod_arr[$i]->getVar('mod_admin'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php 2013-02-12 00:20:20 UTC (rev 11023) @@ -29,37 +29,37 @@ { $xoops = Xoops::getInstance(); - $this->initVar('ext_id', XOBJ_DTYPE_INT, null, false, 5); - $this->initVar('ext_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('name'),false); - $this->initVar('ext_version',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('version'),false); - $this->initVar('ext_description',XOBJ_DTYPE_TXTAREA, $xoops->getModuleConfig('description'), false); - $this->initVar('ext_author',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author'), false); - $this->initVar('ext_author_mail',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_email'),false); - $this->initVar('ext_author_website_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website_url'),false); - $this->initVar('ext_author_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website'),false); - $this->initVar('ext_credits',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('credits'), false); - $this->initVar('ext_license',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('license'), false); - $this->initVar('ext_release_info',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_info'), false); - $this->initVar('ext_release_file',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_file'), false); - $this->initVar('ext_manual',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual'), false); - $this->initVar('ext_manual_file',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual_file'), false); - $this->initVar('ext_image',XOBJ_DTYPE_TXTBOX, null, false); - $this->initVar('ext_demo_site_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_url'), false); - $this->initVar('ext_demo_site_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_name'), false); - $this->initVar('ext_forum_site_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_url'), false); - $this->initVar('ext_forum_site_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_name'), false); - $this->initVar('ext_website_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_url'), false); - $this->initVar('ext_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_name'), false); - $this->initVar('ext_release',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release'), false); - $this->initVar('ext_status',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('status'), false); - $this->initVar('ext_admin',XOBJ_DTYPE_INT,$xoops->getModuleConfig('display_admin'), false, 1); - $this->initVar('ext_user',XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_user'), false, 1); - $this->initVar('ext_submenu', XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_submenu'), false, 1); - $this->initVar('ext_search',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_search'), false, 1); - $this->initVar('ext_comments',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_comments'), false, 1); - $this->initVar('ext_notifications', XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_notifies'), false, 1); - $this->initVar('ext_paypal_button', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('paypal_button'), false, 20); - $this->initVar('ext_subversion', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('subversion'), false, 5); + $this->initVar('ext_id', XOBJ_DTYPE_INT, null, true); + $this->initVar('ext_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('name')); + $this->initVar('ext_version',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('version')); + $this->initVar('ext_description',XOBJ_DTYPE_TXTAREA, $xoops->getModuleConfig('description')); + $this->initVar('ext_author',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author')); + $this->initVar('ext_author_mail',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_email')); + $this->initVar('ext_author_website_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website_url')); + $this->initVar('ext_author_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website')); + $this->initVar('ext_credits',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('credits')); + $this->initVar('ext_license',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('license')); + $this->initVar('ext_release_info',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_info')); + $this->initVar('ext_release_file',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_file')); + $this->initVar('ext_manual',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual')); + $this->initVar('ext_manual_file',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual_file')); + $this->initVar('ext_image',XOBJ_DTYPE_TXTBOX, null); + $this->initVar('ext_demo_site_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_url')); + $this->initVar('ext_demo_site_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_name')); + $this->initVar('ext_forum_site_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_url')); + $this->initVar('ext_forum_site_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_name')); + $this->initVar('ext_website_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_url')); + $this->initVar('ext_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_name')); + $this->initVar('ext_release',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release')); + $this->initVar('ext_status',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('status')); + $this->initVar('ext_admin',XOBJ_DTYPE_INT,$xoops->getModuleConfig('display_admin')); + $this->initVar('ext_user',XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_user')); + $this->initVar('ext_submenu', XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_submenu')); + $this->initVar('ext_search',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_search')); + $this->initVar('ext_comments',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_comments')); + $this->initVar('ext_notifications', XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_notifies')); + $this->initVar('ext_paypal_button', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('paypal_button')); + $this->initVar('ext_subversion', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('subversion')); } } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-12 00:20:20 UTC (rev 11023) @@ -36,84 +36,84 @@ $this->setExtra('enctype="multipart/form-data"'); $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_EXTENSION_IMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_NAME, "ext_name", 50, 255, $obj->getVar('ext_name')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_VERSION, "ext_version", 2, 5, $obj->getVar('ext_version')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_NAME, 'ext_name', 50, 255, $obj->getVar('ext_name')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_VERSION, 'ext_version', 2, 5, $obj->getVar('ext_version')), true); $editor_configs=array(); - $editor_configs["name"] = 'ext_description'; - $editor_configs["value"] = $obj->getVar('ext_description', 'e'); - $editor_configs["rows"] = 5; - $editor_configs["cols"] = 80; - $editor_configs["width"] = "100%"; - $editor_configs["height"] = "400px"; - $editor_configs["editor"] = $xoops->getModuleConfig('editor'); - $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_EXTENSION_DESCRIPTION, "ext_description", $editor_configs), true ); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR, "ext_author", 50, 255, $obj->getVar('ext_author')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_LICENSE, "ext_license", 50, 255, $obj->getVar('ext_license')), true); + $editor_configs['name'] = 'ext_description'; + $editor_configs['value'] = $obj->getVar('ext_description', 'e'); + $editor_configs['rows'] = 5; + $editor_configs['cols'] = 80; + $editor_configs['width'] = '100%'; + $editor_configs['height'] = '400px'; + $editor_configs['editor'] = $xoops->getModuleConfig('editor'); + $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_EXTENSION_DESCRIPTION, 'ext_description', $editor_configs), true ); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR, 'ext_author', 50, 255, $obj->getVar('ext_author')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_LICENSE, 'ext_license', 50, 255, $obj->getVar('ext_license')), true); $option_tray = new XoopsFormElementTray(_OPTIONS, ' '); $display_admin = $obj->isNew() ? 0 : $obj->getVar('ext_admin'); - $check_display_admin = new XoopsFormCheckBox(" ", "ext_admin", $display_admin); + $check_display_admin = new XoopsFormCheckBox(' ', 'ext_admin', $display_admin); $check_display_admin->addOption(1, _AM_TDMCREATE_EXTENSION_ADMIN); $option_tray->addElement($check_display_admin); $display_user = $obj->isNew() ? 0 : $obj->getVar('ext_user'); - $check_display_user = new XoopsFormCheckBox(" ", "ext_user", $display_user); + $check_display_user = new XoopsFormCheckBox(' ', 'ext_user', $display_user); $check_display_user->addOption(1, _AM_TDMCREATE_EXTENSION_USER); $option_tray->addElement($check_display_user); $display_submenu = $obj->isNew() ? 0 : $obj->getVar('ext_submenu'); - $check_display_submenu = new XoopsFormCheckBox(" ", "ext_submenu", $display_submenu); + $check_display_submenu = new XoopsFormCheckBox(' ', 'ext_submenu', $display_submenu); $check_display_submenu->addOption(1, _AM_TDMCREATE_EXTENSION_SUBMENU); $option_tray->addElement($check_display_submenu); $active_search = $obj->isNew() ? 0 : $obj->getVar('ext_search'); - $check_active_search = new XoopsFormCheckBox(" ", "ext_search", $active_search); + $check_active_search = new XoopsFormCheckBox(' ', 'ext_search', $active_search); $check_active_search->addOption(1, _AM_TDMCREATE_EXTENSION_SEARCH); $option_tray->addElement($check_active_search); $active_comments = $obj->isNew() ? 0 : $obj->getVar('ext_comments'); - $check_active_comments = new XoopsFormCheckBox(" ", "ext_comments", $active_comments); + $check_active_comments = new XoopsFormCheckBox(' ', 'ext_comments', $active_comments); $check_active_comments->addOption(1, _AM_TDMCREATE_EXTENSION_COMMENTS); $option_tray->addElement($check_active_comments); $active_notifies = $obj->isNew() ? 0 : $obj->getVar('ext_notifications'); - $check_active_notifies = new XoopsFormCheckBox(" ", "ext_notifications", $active_notifies); + $check_active_notifies = new XoopsFormCheckBox(' ', 'ext_notifications', $active_notifies); $check_active_notifies->addOption(1, _AM_TDMCREATE_EXTENSION_NOTIFICATIONS); $option_tray->addElement($check_active_notifies); $this->addElement($option_tray); - $ext_image = $obj->getVar("ext_image") ? $obj->getVar("ext_image") : 'default_slogo.png'; + $ext_image = $obj->getVar('ext_image') ? $obj->getVar('ext_image') : 'default_slogo.png'; $uploadir = 'uploads/tdmcreate/images/extensions'; $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_EXTENSION_IMAGE,'<br />'); $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './'.$uploadir.'/'); $imageselect = new XoopsFormSelect($imgpath, 'extensions_image', $ext_image); - $image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH."/".$uploadir ); + $image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH.'/'.$uploadir ); foreach( $image_array as $image ) { $imageselect->addOption("$image", $image); } - $imageselect->setExtra( "onchange='showImgSelected(\"xo-tdmcreate-img\", \"extensions_image\", \"".$uploadir."\", \"\", \"".XOOPS_URL."\")'" ); + $imageselect->setExtra( "onchange='showImgSelected(\"image3\", \"extensions_image\", \"".$uploadir."\", \"\", \"".XOOPS_URL."\")'" ); $imgtray->addElement($imageselect); - $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadir."/".$ext_image."' name='xo-tdmcreate-img' id='xo-tdmcreate-img' alt='' />" ) ); + $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadir."/".$ext_image."' name='image3' id='image3' alt='' />" ) ); $fileseltray = new XoopsFormElementTray('','<br />'); - $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD , "extensions_image", $xoops->getModuleConfig("maxsize")),false); + $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD , 'extensions_image', $xoops->getModuleConfig('maxuploadsize'))); $fileseltray->addElement(new XoopsFormLabel('')); $imgtray->addElement($fileseltray); $this->addElement($imgtray); $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_EXTENSION_NOTIMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_MAIL, "ext_author_mail", 50, 255, $obj->getVar('ext_author_mail'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_WEBSITE_URL, "ext_author_website_url", 50, 255, $obj->getVar('ext_author_website_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_WEBSITE_NAME, "ext_author_website_name", 50, 255, $obj->getVar('ext_author_website_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_CREDITS, "ext_credits", 50, 255, $obj->getVar('ext_credits'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE_INFO, "ext_release_info", 50, 255, $obj->getVar('ext_release_info'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE_FILE, "ext_release_file", 50, 255, $obj->getVar('ext_release_file'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_MANUAL, "ext_manual", 50, 255, $obj->getVar('ext_manual'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_MANUAL_FILE, "ext_manual_file", 50, 255, $obj->getVar('ext_manual_file'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_DEMO_SITE_URL, "ext_demo_site_url", 50, 255, $obj->getVar('ext_demo_site_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_DEMO_SITE_NAME, "ext_demo_site_name", 50, 255, $obj->getVar('ext_demo_site_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_FORUM_SITE_URL, "ext_forum_site_url", 50, 255, $obj->getVar('ext_forum_site_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_FORUM_SITE_NAME, "ext_forum_site_name", 50, 255, $obj->getVar('ext_forum_site_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_WEBSITE_URL, "ext_website_url", 50, 255, $obj->getVar('ext_website_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_WEBSITE_NAME, "ext_website_name", 50, 255, $obj->getVar('ext_website_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE, "ext_release", 50, 255, $obj->getVar('ext_release'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_STATUS, "ext_status", 50, 255, $obj->getVar('ext_status'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_MAIL, 'ext_author_mail', 50, 255, $obj->getVar('ext_author_mail'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_WEBSITE_URL, 'ext_author_website_url', 50, 255, $obj->getVar('ext_author_website_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR_WEBSITE_NAME, 'ext_author_website_name', 50, 255, $obj->getVar('ext_author_website_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_CREDITS, 'ext_credits', 50, 255, $obj->getVar('ext_credits'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE_INFO, 'ext_release_info', 50, 255, $obj->getVar('ext_release_info'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE_FILE, 'ext_release_file', 50, 255, $obj->getVar('ext_release_file'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_MANUAL, 'ext_manual', 50, 255, $obj->getVar('ext_manual'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_MANUAL_FILE, 'ext_manual_file', 50, 255, $obj->getVar('ext_manual_file'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_DEMO_SITE_URL, 'ext_demo_site_url', 50, 255, $obj->getVar('ext_demo_site_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_DEMO_SITE_NAME, 'ext_demo_site_name', 50, 255, $obj->getVar('ext_demo_site_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_FORUM_SITE_URL, 'ext_forum_site_url', 50, 255, $obj->getVar('ext_forum_site_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_FORUM_SITE_NAME, 'ext_forum_site_name', 50, 255, $obj->getVar('ext_forum_site_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_WEBSITE_URL, 'ext_website_url', 50, 255, $obj->getVar('ext_website_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_WEBSITE_NAME, 'ext_website_name', 50, 255, $obj->getVar('ext_website_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_RELEASE, 'ext_release', 50, 255, $obj->getVar('ext_release'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_STATUS, 'ext_status', 50, 255, $obj->getVar('ext_status'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_PAYPALBTN, "ext_paypal_button", 50, 255, $obj->getVar('ext_paypal_button'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_SVN, "ext_subversion", 50, 255, $obj->getVar('ext_subversion'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_PAYPALBTN, 'ext_paypal_button', 50, 255, $obj->getVar('ext_paypal_button'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_SVN, 'ext_subversion', 5, 25, $obj->getVar('ext_subversion'))); if (!$obj->isNew()) { $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('ext_id') ) ); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-02-12 00:20:20 UTC (rev 11023) @@ -36,91 +36,92 @@ $this->setExtra('enctype="multipart/form-data"'); $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_IMPORTANT.'</b></div>','head'); - if (!$obj->isNew()) { - $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('mod_id') ) ); - } - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, "mod_name", 50, 255, $obj->getVar('mod_name')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, "mod_version", 30, 50, $obj->getVar('mod_version')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_NAME, 'mod_name', 50, 255, $obj->getVar('mod_name')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_VERSION, 'mod_version', 30, 50, $obj->getVar('mod_version')), true); + $editor_configs=array(); - $editor_configs["name"] = 'mod_description'; - $editor_configs["value"] = $obj->getVar('mod_description', 'e'); - $editor_configs["rows"] = 5; - $editor_configs["cols"] = 80; - $editor_configs["width"] = "100%"; - $editor_configs["height"] = "400px"; - $editor_configs["editor"] = $xoops->getModuleConfig('editor'); - $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, "mod_description", $editor_configs), true ); + $editor_configs['name'] = 'mod_description'; + $editor_configs['value'] = $obj->getVar('mod_description', 'e'); + $editor_configs['rows'] = 5; + $editor_configs['cols'] = 80; + $editor_configs['width'] = '100%'; + $editor_configs['height'] = '400px'; + $editor_configs['editor'] = $xoops->getModuleConfig('editor'); + $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_MODULE_DESCRIPTION, 'mod_description', $editor_configs), true ); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, "mod_author", 50, 255, $obj->getVar('mod_author')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, "mod_license", 50, 255, $obj->getVar('mod_license')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR, 'mod_author', 50, 255, $obj->getVar('mod_author')), true); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_LICENSE, 'mod_license', 50, 255, $obj->getVar('mod_license')), true); $option_tray = new XoopsFormElementTray(_OPTIONS, ' '); $display_admin = $obj->isNew() ? 0 : $obj->getVar('mod_display_admin'); - $check_display_admin = new XoopsFormCheckBox(" ", "mod_display_admin", $display_admin); + $check_display_admin = new XoopsFormCheckBox(' ', 'mod_display_admin', $display_admin); $check_display_admin->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_ADMIN); $option_tray->addElement($check_display_admin); $display_user = $obj->isNew() ? 0 : $obj->getVar('mod_display_user'); - $check_display_user = new XoopsFormCheckBox(" ", "mod_display_user", $display_user); + $check_display_user = new XoopsFormCheckBox(' ', 'mod_display_user', $display_user); $check_display_user->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_USER); $option_tray->addElement($check_display_user); $display_submenu = $obj->isNew() ? 0 : $obj->getVar('mod_display_submenu'); - $check_display_submenu = new XoopsFormCheckBox(" ", "mod_display_submenu", $display_submenu); + $check_display_submenu = new XoopsFormCheckBox(' ', 'mod_display_submenu', $display_submenu); $check_display_submenu->addOption(1, _AM_TDMCREATE_MODULE_DISPLAY_SUBMENU); $option_tray->addElement($check_display_submenu); $active_search = $obj->isNew() ? 0 : $obj->getVar('mod_active_search'); - $check_active_search = new XoopsFormCheckBox(" ", "mod_active_search", $active_search); + $check_active_search = new XoopsFormCheckBox(' ', 'mod_active_search', $active_search); $check_active_search->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_SEARCH); $option_tray->addElement($check_active_search); $active_comments = $obj->isNew() ? 0 : $obj->getVar('mod_active_comments'); - $check_active_comments = new XoopsFormCheckBox(" ", "mod_active_comments", $active_comments); + $check_active_comments = new XoopsFormCheckBox(' ', 'mod_active_comments', $active_comments); $check_active_comments->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_COMMENTS); $option_tray->addElement($check_active_comments); $active_notifies = $obj->isNew() ? 0 : $obj->getVar('mod_active_notifies'); - $check_active_notifies = new XoopsFormCheckBox(" ", "mod_active_notifies", $active_notifies); + $check_active_notifies = new XoopsFormCheckBox(' ', 'mod_active_notifies', $active_notifies); $check_active_notifies->addOption(1, _AM_TDMCREATE_MODULE_ACTIVE_NOTIFIES); $option_tray->addElement($check_active_notifies); $this->addElement($option_tray); - $module_image = $obj->getVar("mod_image") ? $obj->getVar("mod_image") : 'default_slogo.png'; + $module_image = $obj->getVar('mod_image') ? $obj->getVar('mod_image') : 'default_slogo.png'; $uploadir = 'uploads/tdmcreate/images/modules'; $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_MODULE_IMAGE,'<br />'); $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './'.$uploadir.'/'); - $imageselect = new XoopsFormSelect($imgpath, 'module_image', $module_image); - $image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH."/".$uploadir ); + $imageselect = new XoopsFormSelect($imgpath, 'modules_image', $module_image); + $image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH.'/'.$uploadir ); foreach( $image_array as $image ) { $imageselect->addOption("$image", $image); } - $imageselect->setExtra( "onchange='showImgSelected(\"image\", \"module_image\", \"".$uploadir."\", \"\", \"".XOOPS_URL."\")'" ); + $imageselect->setExtra( "onchange='showImgSelected(\"image3\", \"modules_image\", \"".$uploadir."\", \"\", \"".XOOPS_URL."\")'" ); $imgtray->addElement($imageselect); - $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadir."/".$module_image."' name='image' id='image' alt='' />" ) ); + $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadir."/".$module_image."' name='image3' id='image3' alt='' />" ) ); $fileseltray = new XoopsFormElementTray('','<br />'); - $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD , "module_image", $xoops->getModuleConfig("maxsize")),false); + $fileseltray->addElement(new XoopsFormFile(_AM_TDMCREATE_FORMUPLOAD , 'modules_image', $xoops->getModuleConfig('maxuploadsize'))); $fileseltray->addElement(new XoopsFormLabel('')); $imgtray->addElement($fileseltray); $this->addElement($imgtray); $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_MODULE_NOTIMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, "mod_author_mail", 50, 255, $obj->getVar('mod_author_mail'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, "mod_author_website_url", 50, 255, $obj->getVar('mod_author_website_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, "mod_author_website_name", 50, 255, $obj->getVar('mod_author_website_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, "mod_credits", 50, 255, $obj->getVar('mod_credits'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, "mod_release_info", 50, 255, $obj->getVar('mod_release_info'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, "mod_release_file", 50, 255, $obj->getVar('mod_release_file'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, "mod_manual", 50, 255, $obj->getVar('mod_manual'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, "mod_manual_file", 50, 255, $obj->getVar('mod_manual_file'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, "mod_demo_site_url", 50, 255, $obj->getVar('mod_demo_site_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, "mod_demo_site_name", 50, 255, $obj->getVar('mod_demo_site_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_FORUM_SITE_URL, "mod_forum_site_url", 50, 255, $obj->getVar('mod_forum_site_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_FORUM_SITE_NAME, "mod_forum_site_name", 50, 255, $obj->getVar('mod_forum_site_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, "mod_website_url", 50, 255, $obj->getVar('mod_website_url'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, "mod_website_name", 50, 255, $obj->getVar('mod_website_name'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, "mod_release", 50, 255, $obj->getVar('mod_release'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, "mod_status", 50, 255, $obj->getVar('mod_status'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $obj->getVar('mod_author_mail'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $obj->getVar('mod_author_website_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $obj->getVar('mod_author_website_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_CREDITS, 'mod_credits', 50, 255, $obj->getVar('mod_credits'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_INFO, 'mod_release_info', 50, 255, $obj->getVar('mod_release_info'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE_FILE, 'mod_release_file', 50, 255, $obj->getVar('mod_release_file'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL, 'mod_manual', 50, 255, $obj->getVar('mod_manual'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_MANUAL_FILE, 'mod_manual_file', 50, 255, $obj->getVar('mod_manual_file'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $obj->getVar('mod_demo_site_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $obj->getVar('mod_demo_site_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_FORUM_SITE_URL, 'mod_forum_site_url', 50, 255, $obj->getVar('mod_forum_site_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_FORUM_SITE_NAME, 'mod_forum_site_name', 50, 255, $obj->getVar('mod_forum_site_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_URL, 'mod_website_url', 50, 255, $obj->getVar('mod_website_url'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_WEBSITE_NAME, 'mod_website_name', 50, 255, $obj->getVar('mod_website_name'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_RELEASE, 'mod_release', 50, 255, $obj->getVar('mod_release'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_STATUS, 'mod_status', 50, 255, $obj->getVar('mod_status'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPALBTN, "mod_paypal_button", 50, 255, $obj->getVar('mod_paypal_button'))); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SVN, "mod_subversion", 50, 255, $obj->getVar('mod_subversion'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_PAYPALBTN, 'mod_paypal_button', 50, 255, $obj->getVar('mod_paypal_button'))); + $this->addElement(new XoopsFormText(_AM_TDMCREATE_MODULE_SVN, 'mod_subversion', 50, 255, $obj->getVar('mod_subversion'))); - $this->addElement(new XoopsFormHidden('op', 'save' ) ); + if (!$obj->isNew()) { + $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('mod_id') ) ); + } + $this->addElement(new XoopsFormHidden('op', 'save' ) ); $this->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit' ) ); } } \ No newline at end of file Index: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin 2013-02-12 00:20:20 UTC (rev 11023) Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin ___________________________________________________________________ Added: tsvn:autoprops ## -0,0 +1 ## +*.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; \ No newline at end of property Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin/index.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin/index.html (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/plugin/index.html 2013-02-12 00:20:20 UTC (rev 11023) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt 2013-02-12 00:20:20 UTC (rev 11023) @@ -1,4 +0,0 @@ -Read Me First -============= - -Please make sure that you download the XOOPS Icon Set, and upload it to uploads/images directory \ No newline at end of file Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/locale.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/locale.txt (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/locale.txt 2013-02-12 00:20:20 UTC (rev 11023) @@ -0,0 +1,4 @@ +Read Me First +============= + +Please make sure that you download the XOOPS Icon Set, and upload it to uploads/images directory \ No newline at end of file Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.0 to 1.1.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.0 to 1.1.txt 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.0 to 1.1.txt 2013-02-12 00:20:20 UTC (rev 11023) @@ -1,33 +0,0 @@ -admin.php - -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_ELEMENTS","Form : Elements"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_DISPLAY_ADMIN","Page : Display admin"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_DISPLAY_USER","Page :Display user"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_BLOC","Bloc : Display"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_MAIN_FIELD","Table : Main Field"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_SEARCH","Search : Index"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_REQUIRED","Form : Required field"); - -define("_AM_TDMCREATE_FORMEDIT","Edit"); -define("_AM_TDMCREATE_FORMDEL","Delete"); -define("_AM_TDMCREATE_FORMCHAMPS","Edit fields"); -define("_AM_TDMCREATE_FORM_INFO_TABLE","Information on the table"); -define("_AM_TDMCREATE_FORM_INFO_TABLE_FIELD","There are 3 fields added automatically on each tables : table_submitter, table_date_created, table_online"); - -define("_AM_TDMCREATE_CONST_OK_COMS","Creation files for the coms"); -define("_AM_TDMCREATE_CONST_NOTOK_COMS","Problems : Creation files for the coms"); - -define("_AM_TDMCREATE_TABLES_COMS","Activer les commentaires pour cette table <br><i>Le module peut gerer pour l'instant les coms que sur une table<br>L'option commentaire sera desactivee si vous validez</i>"); - -modinfo.php - -//Menu -define("_MI_TDMCREATE_ADMIN_INDEX","Index"); -define("_MI_TDMCREATE_ADMIN_MODULES","Add a module"); -define("_MI_TDMCREATE_ADMIN_TABLES","Add a table"); -define("_MI_TDMCREATE_ADMIN_CONST","Build the module"); -define("_MI_TDMCREATE_ADMIN_ABOUT","Short About"); -define("_MI_TDMCREATE_ADMIN_PREFERENCES","Preferences"); -define("_MI_TDMCREATE_ADMIN_UPDATE","Update"); - -define("_MI_TDMCREATE_DESC","Module create of module made by TDM"); \ No newline at end of file Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.1 to 1.15.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.1 to 1.15.txt 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.1 to 1.15.txt 2013-02-12 00:20:20 UTC (rev 11023) @@ -1,40 +0,0 @@ -admin.php - -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_ELEMENTS","Form : Elements"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_DISPLAY_ADMIN","Page : Display admin"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_DISPLAY_USER","Page :Display user"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_BLOC","Bloc : Display"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_MAIN_FIELD","Table : Main Field"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_SEARCH","Search : Index"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_REQUIRED","Form : Required field"); - -define("_AM_TDMCREATE_FORMEDIT","Edit"); -define("_AM_TDMCREATE_FORMDEL","Delete"); -define("_AM_TDMCREATE_FORMCHAMPS","Edit fields"); -define("_AM_TDMCREATE_FORM_INFO_TABLE","Information on the table"); -define("_AM_TDMCREATE_FORM_INFO_TABLE_FIELD","There are 3 fields added automatically on each tables : table_submitter, table_date_created, table_online"); -// 1.15 -define("_AM_TDMCREATE_MODULES_AUTHOR_MAIL", "Author Email"); -define("_AM_TDMCREATE_MODULES_FORUM_SITE_URL","Topic URL"); -define("_AM_TDMCREATE_MODULES_FORUM_SITE_NAME","Topic URL title"); - -define("_AM_TDMCREATE_CONST_OK_COMS","Creation files for the coms"); -define("_AM_TDMCREATE_CONST_NOTOK_COMS","Problems : Creation files for the coms"); -// 1.15 -define("_AM_TDMCREATE_CONST_OK_MAIN_LANGUAGE", "Creation of main.php file into language folder"); -define("_AM_TDMCREATE_CONST_NOTOK_MAIN_LANGUAGE", "Problemes: Creation of main.php file into language folder"); - -define("_AM_TDMCREATE_TABLES_COMS","Activer les commentaires pour cette table <br><i>Le module peut gerer pour l'instant les coms que sur une table<br>L'option commentaire sera desactivee si vous validez</i>"); - -modinfo.php - -//Menu -define("_MI_TDMCREATE_ADMIN_INDEX","Index"); -define("_MI_TDMCREATE_ADMIN_MODULES","Add a module"); -define("_MI_TDMCREATE_ADMIN_TABLES","Add a table"); -define("_MI_TDMCREATE_ADMIN_CONST","Build the module"); -define("_MI_TDMCREATE_ADMIN_ABOUT","Short About"); -define("_MI_TDMCREATE_ADMIN_PREFERENCES","Preferences"); -define("_MI_TDMCREATE_ADMIN_UPDATE","Update"); - -define("_MI_TDMCREATE_DESC","Module create of module made by TDM"); \ No newline at end of file Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.1 to 1.37.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.1 to 1.37.txt 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.1 to 1.37.txt 2013-02-12 00:20:20 UTC (rev 11023) @@ -1,51 +0,0 @@ -admin.php - -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_ELEMENTS","Form : Elements"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_DISPLAY_ADMIN","Page : Display admin"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_DISPLAY_USER","Page :Display user"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_BLOC","Bloc : Display"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_MAIN_FIELD","Table : Main Field"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_SEARCH","Search : Index"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_REQUIRED","Form : Required field"); - -define("_AM_TDMCREATE_FORMEDIT","Edit"); -define("_AM_TDMCREATE_FORMDEL","Delete"); -define("_AM_TDMCREATE_FORMCHAMPS","Edit fields"); -define("_AM_TDMCREATE_FORM_INFO_TABLE","Information on the table"); -define("_AM_TDMCREATE_FORM_INFO_TABLE_FIELD","There are 3 fields added automatically on each tables : table_submitter, table_date_created, table_online"); -// 1.15 -define("_AM_TDMCREATE_MODULES_AUTHOR_MAIL", "Author Email"); -define("_AM_TDMCREATE_MODULES_FORUM_SITE_URL","Topic URL"); -define("_AM_TDMCREATE_MODULES_FORUM_SITE_NAME","Topic URL title"); - -define("_AM_TDMCREATE_CONST_OK_COMS","Creation files for the coms"); -define("_AM_TDMCREATE_CONST_NOTOK_COMS","Problems : Creation files for the coms"); -// 1.15 -define("_AM_TDMCREATE_CONST_OK_MAIN_LANGUAGE", "Creation of main.php file into language folder"); -define("_AM_TDMCREATE_CONST_NOTOK_MAIN_LANGUAGE", "Problemes: Creation of main.php file into language folder"); - -define("_AM_TDMCREATE_TABLES_COMS","Activer les commentaires pour cette table <br><i>Le module peut gerer pour l'instant les coms que sur une table<br>L'option commentaire sera desactivee si vous validez</i>"); - -// 1.37 -define("_AM_TDMCREATE_MODULES_LIST", "Modules List"); -define("_AM_TDMCREATE_MODULES_NEW", "New Module"); - -define("_AM_TDMCREATE_MODULES_ACTIVE_COMMENTS", "Enable comments"); - -modinfo.php - -//Menu -define("_MI_TDMCREATE_ADMIN_INDEX","Index"); -define("_MI_TDMCREATE_ADMIN_MODULES","Add a module"); -define("_MI_TDMCREATE_ADMIN_TABLES","Add a table"); -define("_MI_TDMCREATE_ADMIN_CONST","Build the module"); -define("_MI_TDMCREATE_ADMIN_ABOUT","Short About"); -define("_MI_TDMCREATE_ADMIN_PREFERENCES","Preferences"); -define("_MI_TDMCREATE_ADMIN_UPDATE","Update"); - -define("_MI_TDMCREATE_DESC","Module create of module made by TDM"); - -define("_MI_TDMCREATE_EDITOR", "Editor"); -define("_MI_TDMCREATE_EDITORDSC", "Select an editor to write"); -define("_MI_TDMCREATE_IDPAYPAL", "Paypal ID"); -define("_MI_TDMCREATE_IDPAYPAL_DESC", "ID Paypal for donations."); \ No newline at end of file Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.15 to 1.37.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.15 to 1.37.txt 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.15 to 1.37.txt 2013-02-12 00:20:20 UTC (rev 11023) @@ -1,53 +0,0 @@ -admin.php - -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_ELEMENTS","Form : Elements"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_DISPLAY_ADMIN","Page : Display admin"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_DISPLAY_USER","Page :Display user"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_BLOC","Bloc : Display"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_MAIN_FIELD","Table : Main Field"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_SEARCH","Search : Index"); -define("_AM_TDMCREATE_TABLES_CHAMPS_MORE_REQUIRED","Form : Required field"); - -define("_AM_TDMCREATE_FORMEDIT","Edit"); -define("_AM_TDMCREATE_FORMDEL","Delete"); -define("_AM_TDMCREATE_FORMCHAMPS","Edit fields"); -define("_AM_TDMCREATE_FORM_INFO_TABLE","Information on the table"); -define("_AM_TDMCREATE_FORM_INFO_TABLE_FIELD","There are 3 fields added automatically on each tables : table_submitter, table_date_created, table_online"); -// 1.15 -define("_AM_TDMCREATE_MODULES_AUTHOR_MAIL", "Author Email"); -define("_AM_TDMCREATE_MODULES_FORUM_SITE_URL","Topic URL"); -define("_AM_TDMCREATE_MODULES_FORUM_SITE_NAME","Topic URL title"); - -define("_AM_TDMCREATE_CONST_OK_COMS","Creation files for the coms"); -define("_AM_TDMCREATE_CONST_NOTOK_COMS","Problems : Creation files for the coms"); -// 1.15 -define("_AM_TDMCREATE_CONST_OK_MAIN_LANGUAGE", "Creation of main.php file into language folder"); -define("_AM_TDMCREATE_CONST_NOTOK_MAIN_LANGUAGE", "Problemes: Creation of main.php file into language folder"); - -define("_AM_TDMCREATE_TABLES_COMS","Activer les commentaires pour cette table <br><i>Le module peut gerer pour l'instant les coms que sur une table<br>L'option commentaire sera desactivee si vous validez</i>"); - -// 1.37 -define("_AM_TDMCREATE_MODULES_LIST", "Modules List"); -define("_AM_TDMCREATE_MODULES_NEW", "New Module"); - -define("_AM_TDMCREATE_TABLES_SUBMITTER", "Add submitter"); -define("_AM_TDMCREATE_TABLES_DATE_CREATED", "Add date created"); -define("_AM_TDMCREATE_TABLES_ONLINE", "Add online"); - -modinfo.php - -//Menu -define("_MI_TDMCREATE_ADMIN_INDEX","Index"); -define("_MI_TDMCREATE_ADMIN_MODULES","Add a module"); -define("_MI_TDMCREATE_ADMIN_TABLES","Add a table"); -define("_MI_TDMCREATE_ADMIN_CONST","Build the module"); -define("_MI_TDMCREATE_ADMIN_ABOUT","Short About"); -define("_MI_TDMCREATE_ADMIN_PREFERENCES","Preferences"); -define("_MI_TDMCREATE_ADMIN_UPDATE","Update"); - -define("_MI_TDMCREATE_DESC","Module create of module made by TDM"); - -define("_MI_TDMCREATE_EDITOR", "Editor"); -define("_MI_TDMCREATE_EDITORDSC", "Select an editor to write"); -define("_MI_TDMCREATE_IDPAYPAL", "Paypal ID"); -define("_MI_TDMCREATE_IDPAYPAL_DESC", "ID Paypal for donations."); \ No newline at end of file Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.37 to 1.38.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.37 to 1.38.txt 2013-02-11 23:34:38 UTC (rev 11022) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/update language 1.37 to 1.38.txt 2013-02-12 00:20:20 UTC (rev 11023) @@ -1,143 +0,0 @@ -// 1.37 -admin.php - -define("_AM_TDMCREATE_MODULES_LIS... [truncated message content] |
From: <txm...@us...> - 2013-02-12 00:36:12
|
Revision: 11024 http://sourceforge.net/p/xoops/svn/11024 Author: txmodxoops Date: 2013-02-12 00:36:10 +0000 (Tue, 12 Feb 2013) Log Message: ----------- Updated Removed not necessary code and db table Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php 2013-02-12 00:20:20 UTC (rev 11023) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php 2013-02-12 00:36:10 UTC (rev 11024) @@ -109,17 +109,5 @@ copy($indexFile, $extensions_uploads.'/index.html'); copy($blankFile, $extensions_uploads.'/blank.gif'); - //tdmcreate_install_initializeTDMCreates(); return true; -} - -function tdmcreate_install_initializeTDMCreates() -{ - $xoops = Xoops::getInstance(); - $module_id = $xoops->registry()->get('tdmcreate_id'); - - $xoops->db()->queryF('INSERT INTO ' . $xoops->db()->prefix('tdmcreate_tdmcreate') . ' (tdmcreate_id) ' . ' SELECT mid ' . ' FROM ' . $xoops->db()->prefix('modules')); - - $sql = 'INSERT INTO ' . $xoops->db()->prefix('group_permission') . ' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) ' . ' VALUES ' . ' (' . XOOPS_GROUP_ADMIN . ', ' . XOOPS_GROUP_ADMIN . ', {$module_id}, 'tdmcreate_access'), ' . ' (' . XOOPS_GROUP_ADMIN . ', ' . XOOPS_GROUP_USERS . ', {$module_id}, 'tdmcreate_access'), ' . ' (' . XOOPS_GROUP_USERS . ', ' . XOOPS_GROUP_USERS . ', {$module_id}, 'tdmcreate_access'), ' . ' (' . XOOPS_GROUP_ANONYMOUS . ', ' . XOOPS_GROUP_USERS . ', {$module_id}, 'tdmcreate_access') ' . ' '; - $xoops->db()->queryF($sql); } \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php 2013-02-12 00:20:20 UTC (rev 11023) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php 2013-02-12 00:36:10 UTC (rev 11024) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** * tdmcreate module * @@ -19,7 +18,6 @@ * @author TDM Xoops (AKA Developers) * @version $Id: xoops_version.php 10665 2012-12-27 10:14:15Z timgno $ */ - /* General settings */ @@ -36,7 +34,6 @@ $modversion['help'] = 'page=help'; $modversion['image'] = 'images/logo.png'; $modversion['dirname'] = 'tdmcreate'; - /* Settings for configs */ @@ -47,67 +44,49 @@ $modversion['min_php'] = '5.2'; $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); - // paypal $modversion['paypal'] = array(); $modversion['paypal']['business'] = 'xoo...@gm...'; $modversion['paypal']['item_name'] = 'Donation : ' . _MI_TDMCREATE_DESC; $modversion['paypal']['amount'] = 0; $modversion['paypal']['currency_code'] = 'USD'; - /* Admin menu Set to 1 if you want to display menu generated by system module */ $modversion['system_menu'] = 1; - /* Manage extension */ $modversion['extension'] = 0; $modversion['extension_module'][] = 'system'; - /* Admin things */ $modversion['hasAdmin'] = 1; $modversion['adminindex'] = 'admin/index.php'; $modversion['adminmenu'] = 'admin/menu.php'; - // Scripts to run upon installation or update $modversion['onInstall'] = 'include/install.php'; - // JQuery $modversion['jquery'] = 1; - // Menu $modversion['hasMain'] = 0; - -/* - Admin Templates -*/ -$modversion['templates'][] = array( 'file' => 'tdmcreate_modules.html', 'description' => '', 'type' => 'admin' ); -$modversion['templates'][] = array( 'file' => 'tdmcreate_extensions.html', 'description' => '', 'type' => 'admin' ); -$modversion['templates'][] = array( 'file' => 'tdmcreate_tables.html', 'description' => '', 'type' => 'admin' ); -$modversion['templates'][] = array( 'file' => 'tdmcreate_fields.html', 'description' => '', 'type' => 'admin' ); -$modversion['templates'][] = array( 'file' => 'tdmcreate_import.html', 'description' => '', 'type' => 'admin' ); -$modversion['templates'][] = array( 'file' => 'tdmcreate_building.html', 'description' => '', 'type' => 'admin' ); - // Mysql file $modversion['sqlfile']['mysql'] = 'sql/mysql.sql'; // Tables created by sql file (without prefix!) -$modversion['tables'][0] = 'tdmcreate_modules'; -$modversion['tables'][1] = 'tdmcreate_extensions'; -$modversion['tables'][2] = 'tdmcreate_tables'; -$modversion['tables'][3] = 'tdmcreate_fields'; -$modversion['tables'][4] = 'tdmcreate_import'; -$modversion['tables'][5] = 'tdmcreate_fieldtype'; -$modversion['tables'][6] = 'tdmcreate_fieldattributes'; -$modversion['tables'][7] = 'tdmcreate_fieldnull'; -$modversion['tables'][8] = 'tdmcreate_fieldkey'; -$modversion['tables'][9] = 'tdmcreate_fieldelements'; -$modversion['tables'][10] = 'tdmcreate_tdmcreate'; - +$i = 1; +$modversion['tables'][$i] = 'tdmcreate_modules'; $i++; +$modversion['tables'][$i] = 'tdmcreate_extensions'; $i++; +$modversion['tables'][$i] = 'tdmcreate_tables'; $i++; +$modversion['tables'][$i] = 'tdmcreate_fields'; $i++; +$modversion['tables'][$i] = 'tdmcreate_import'; $i++; +$modversion['tables'][$i] = 'tdmcreate_fieldtype'; $i++; +$modversion['tables'][$i] = 'tdmcreate_fieldattributes'; $i++; +$modversion['tables'][$i] = 'tdmcreate_fieldnull'; $i++; +$modversion['tables'][$i] = 'tdmcreate_fieldkey'; $i++; +$modversion['tables'][$i] = 'tdmcreate_fieldelements'; +unset($i); /* Preferences */ @@ -122,7 +101,7 @@ $modversion['config'][$i]['options'] = $editors; $i++; //Uploads : maxsize img -$modversion['config'][$i]['name'] = 'maxsize'; +$modversion['config'][$i]['name'] = 'maxuploadsize'; $modversion['config'][$i]['title'] = '_MI_TDMCREATE_PREFERENCE_MAXSIZE'; $modversion['config'][$i]['description'] = '_MI_TDMCREATE_PREFERENCE_MAXSIZE_DESC'; $modversion['config'][$i]['formtype'] = 'textbox'; |
From: <txm...@us...> - 2013-02-13 22:37:15
|
Revision: 11050 http://sourceforge.net/p/xoops/svn/11050 Author: txmodxoops Date: 2013-02-13 22:37:10 +0000 (Wed, 13 Feb 2013) Log Message: ----------- Updated Needed re-installaction Test Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/functions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_building.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_import.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/_admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/_modinfo.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields_form.html Removed Paths: ------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/forms.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/language/english/modinfo.php Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -37,25 +37,25 @@ { case 'default': default: - $form = new XoopsSimpleForm(_AM_TDMCREATE_BUILDING_TITLE, 'building', 'building.php', 'post', true); + $form = new XoopsSimpleForm(TDMCreateLocale::BUILDING_TITLE, 'building', 'building.php', 'post', true); - $mods_select = new XoopsFormSelect(_AM_TDMCREATE_BUILDING_MODULES, 'mod_name', 'mod_name'); - $mods_select->addOption(0, _AM_TDMCREATE_SELDEFMOD); + $mods_select = new XoopsFormSelect(TDMCreateLocale::BUILDING_MODULES, 'mod_name', 'mod_name'); + $mods_select->addOption(0, TDMCreateLocale::BUILDING_SELDEFMOD); $mods_select->addOptionArray($modules_Handler->getList()); $form->addElement($mods_select); - $exts_select = new XoopsFormSelect(_AM_TDMCREATE_BUILDING_EXTENSIONS, 'ext_name', 'ext_name'); - $exts_select->addOption(0, _AM_TDMCREATE_SELDEFEXT); + $exts_select = new XoopsFormSelect(TDMCreateLocale::BUILDING_EXTENSIONS, 'ext_name', 'ext_name'); + $exts_select->addOption(0, TDMCreateLocale::BUILDING_SELDEFEXT); $exts_select->addOptionArray($extensions_Handler->getList()); $form->addElement($exts_select); $form->addElement(new XoopsFormHidden('op', 'build')); - $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); + $form->addElement(new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit')); $xoops->tpl()->assign('form', $form->render()); break; case 'build': - $admin_menu->addItemButton(_AM_TDMCREATE_BUILDING_FORM, 'building.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::BUILDING_FORM, 'building.php', 'application-view-detail'); $admin_menu->renderButton(); $mods =& $modules_Handler->get($_REQUEST['mod_name']); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -38,7 +38,7 @@ { case 'list': default: - $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::ADD_EXTENSION, 'extensions.php?op=new', 'add'); $admin_menu->renderButton(); $criteria = new CriteriaCompo(); $criteria->setSort('ext_name'); @@ -72,12 +72,12 @@ $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { - $xoops->tpl()->assign('error_message', _AM_TDMCREATE_EXTENSION_ERROR_NOEXTENSIONS); + $xoops->tpl()->assign('error_message', TDMCreateLocale::E_NO_EXTENSIONS); } break; case 'new': - $admin_menu->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); $admin_menu->renderButton(); $obj = $extensions_Handler->create(); @@ -113,7 +113,7 @@ $uploader->setPrefix($name_img); $uploader->fetchMedia($_POST['extensions_image'][0]); if (!$uploader->upload()) { - redirect_header('javascript:history.go(-1)',3, $uploader->getErrors()); + $xoops->redirect('javascript:history.go(-1)',3, $uploader->getErrors()); } else { $obj->setVar('ext_image', $uploader->getSavedFileName()); } @@ -140,7 +140,7 @@ 'ext_subversion' => $_POST['ext_subversion'])); // Insert Data if ($extensions_Handler->insert($obj)) { - redirect_header('extensions.php?op=list', 2, _AM_TDMCREATE_FORMOK); + $xoops->redirect('extensions.php?op=list', 2, XoopsLocale::S_DATA_INSERTED); } // Form Data $xoops->error($obj->getHtmlErrors()); @@ -149,8 +149,8 @@ break; case 'edit': - $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_EXTENSION, 'extensions.php?op=new', 'add'); - $admin_menu->addItemButton(_AM_TDMCREATE_EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::EXTENSION_ADD, 'extensions.php?op=new', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); $admin_menu->renderButton(); $obj = $extensions_Handler->get($system->cleanVars($_REQUEST, 'ext_id', 0, 'int')); @@ -160,22 +160,22 @@ case 'delete': $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); - if ($id > 0) { + if ($id != 0) { $obj = $extensions_Handler->get($id); if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { $xoops->redirect('extensions.php', 3, implode(',', $xoops->security()->getErrors())); } if ($extensions_Handler->delete($obj)) { - $xoops->redirect('extensions.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_EXTENSION)); + $xoops->redirect('extensions.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::EXTENSION)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'extensions.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('ext_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'extensions.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('ext_name')) . '<br />'); } } else { - $xoops->redirect('extensions.php', 1, _AM_SYSTEM_DBERROR); + $xoops->redirect('extensions.php', 1, TDMCreateLocale::E_DATABASE_ERROR); } break; } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** * tdmcreate module * @@ -20,49 +19,52 @@ * @version $Id: fields.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; -// Get main instance -$system = System::getInstance(); -$xoops = Xoops::getInstance(); // Preferences Limit -$nb_pager = $xoops->getModuleConfig('pager'); +$nb_pager = $xoops->getModuleConfig('adminpager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +$field_id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); +$table_id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); // Get limit pager $limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); // Get start pager $start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); -// heaser -$xoops->header('tdmcreate_fields.html'); // Get handler /* @var $tables_handler TDMCreateTablesHandler */ $tables_Handler = $xoops->getModuleHandler('tables'); /* @var $fields_handler TDMCreateFieldsHandler */ $fields_Handler = $xoops->getModuleHandler('fields'); +$fieldtype_Handler = $xoops->getModuleHandler('fieldtype'); +$fieldattrs_Handler = $xoops->getModuleHandler('fieldattributes'); +$fieldnull_Handler = $xoops->getModuleHandler('fieldnull'); +$fieldkey_Handler = $xoops->getModuleHandler('fieldkey'); +$fieldelements_Handler = $xoops->getModuleHandler('fieldelements'); $admin_menu->renderNavigation('fields.php'); switch ($op) { case 'list': default: - $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); - $admin_menu->renderButton(); + $admin_menu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); + $admin_menu->renderButton(); + // heaser + $xoops->header('tdmcreate_fields.html'); // Get modules list $criteria = new CriteriaCompo(); - $criteria->setSort('mod_name'); + $criteria->setSort('table_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); $criteria->setLimit($nb_pager); $numrows_tables = $tables_Handler->getCount($criteria); $table_arr = $tables_Handler->getAll($criteria); $xoops->tpl()->assign('tables_count', $numrows_tables); - $xoops->tpl()->assign('timg_path', TDMC_TABLES_URL_IMG); unset($criteria); // Redirect if there aren't modules /* if ( $numrows_mods == 0 ) { - redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); + $xoops->redirect('modules.php?op=new', 2, TDMCreateLocale::NOTMODULES ); }*/ $criteria = new CriteriaCompo(); - $criteria->setSort('table_name'); + $criteria->setSort('field_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); $criteria->setLimit($limit); @@ -76,64 +78,155 @@ foreach (array_keys($table_arr) as $i) { $tables['id'] = $table_arr[$i]->getVar('table_id'); $tables['name'] = $table_arr[$i]->getVar('table_name'); - $tables['modname'] = TDMCreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); + $tables['mid'] = tdmcreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); $tables['image'] = $table_arr[$i]->getVar('table_image'); - $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); + $tables['nbfields'] = $table_arr[$i]->getVar('table_nbfields'); + $tables['blocks'] = $table_arr[$i]->getVar('table_blocks'); + $tables['admin'] = $table_arr[$i]->getVar('table_admin'); + $tables['user'] = $table_arr[$i]->getVar('table_user'); + $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); + $tables['search'] = $table_arr[$i]->getVar('table_search'); + $tables['comments'] = $table_arr[$i]->getVar('table_comments'); + $tables['notifications'] = $table_arr[$i]->getVar('table_notifications'); $xoops->tpl()->append_by_ref('tables', $tables); unset($tables); if ($numrows_fields > 0) { foreach (array_keys($field_arr) as $i) { $field['id'] = $field_arr[$i]->getVar('field_id'); - $field['name'] = $field_arr[$i]->getVar('field_name'); - $field['version'] = $field_arr[$i]->getVar('field_version'); - $field['image'] = $field_arr[$i]->getVar('field_image'); - $field['nbfields'] = $field_arr[$i]->getVar('field_nbfields'); + $field['tid'] = $field_arr[$i]->getVar('field_tid'); + $field['name'] = $field_arr[$i]->getVar('field_name'); + $field['type'] = $field_arr[$i]->getVar('field_type'); + $field['value'] = $field_arr[$i]->getVar('field_value'); $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); - $field['admin'] = $field_arr[$i]->getVar('field_admin'); - $field['user'] = $field_arr[$i]->getVar('field_user'); - $field['submenu'] = $field_arr[$i]->getVar('field_submenu'); - $field['search'] = $field_arr[$i]->getVar('field_search'); - $field['comments'] = $field_arr[$i]->getVar('field_comments'); - $field['notifies'] = $field_arr[$i]->getVar('field_notifies'); + $field['attribute'] = $field_arr[$i]->getVar('field_attribute'); + $field['default'] = $field_arr[$i]->getVar('field_default'); + $field['key'] = $field_arr[$i]->getVar('field_key'); + $field['auto_increment'] = $field_arr[$i]->getVar('field_auto_increment'); + $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); + $field['search'] = $field_arr[$i]->getVar('field_search'); + $field['required'] = $field_arr[$i]->getVar('field_required'); $xoops->tpl()->append_by_ref('fields', $field); unset($field); } } } // Display Page Navigation - if ($numrows_mods > $nb_pager) { - $nav = new XoopsPageNav($numrows_mods, $nb_pager, $start, 'start'); + if ($numrows_tables > $nb_pager) { + $nav = new XoopsPageNav($numrows_tables, $nb_pager, $start, 'start'); $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { - $xoops->tpl()->assign('error_message', _AM_TDMCREATE_FIELD_ERROR_NOFIELDS); + $xoops->tpl()->assign('error_message', TDMCreateLocale::FIELD_ERROR_NOFIELDS); } break; case 'new': - $admin_menu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::FIELDS_LIST, 'fields.php', 'application-view-detail'); $admin_menu->renderButton(); - - $obj = $fields_Handler->create(); - $form = $xoops->getModuleForm($obj, 'fields'); - $xoops->tpl()->assign('form', $form->render()); + // heaser + $xoops->header('tdmcreate_fields_form.html'); + + $fobj = $fields_Handler->get($field_id); + $tobj = $tables_Handler->get($table_id); + + $criteria = new CriteriaCompo(new Criteria('table_id', $tobj->getVar('table_id'))); + $criteria->add(new Criteria('table_mid', $tobj->getVar('table_mid'))); + $criteria->setSort('table_name'); + $criteria->setOrder('ASC'); + $tables_arr = $tables_Handler->getAll($criteria); + unset($criteria); + + $criteria = new CriteriaCompo(); + //$criteria->add(new Criteria('field_tid', $tobj->getVar('table_id'))); + //$criteria->add(new Criteria('field_numb', $tobj->getVar('table_nbfields'))); + $field_arr = $fields_Handler->getAll($criteria); + unset($criteria); + $numrows_fields = /*$fobj->getVar('table_nbfields')*/12; + // Assign Template variablesnew Criteria('field_id', $field_id) + $xoops->tpl()->assign('fields_numb_count', $numrows_fields); + $field = array(); + if ($numrows_fields > 0) + { + foreach (array_keys($field_arr) as $i) + { + $field['id'] = $field_arr[$i]->getVar('field_id'); + $field['name'] = new XoopsFormText(TDMCreateLocale::FIELD_NAME, 'field_name', 1, 25, $field_arr[$i]->getVar('field_name')); + $field_type_select = new XoopsFormSelect(TDMCreateLocale::FIELD_TYPE, 'field_type', $field_arr[$i]->getVar('field_type')); + $field_type_select->addOptionArray($fieldtype_Handler->getList()); + $field['type'] = $field_type_select->render(); + $field['value'] = new XoopsFormText(TDMCreateLocale::FIELD_VALUE, 'field_value', 1, 25, $field_arr[$i]->getVar('field_value')); + $field_attrs_select = new XoopsFormSelect(TDMCreateLocale::FIELD_ATTRIBUTE, 'field_attribute', $field_arr[$i]->getVar('field_attribute')); + $field_attrs_select->addOptionArray($fieldattrs_Handler->getList()); + $field['attribute'] = $field_attrs_select->render(); + $field_null_select = new XoopsFormSelect(TDMCreateLocale::FIELD_NULL, 'field_null', $field_arr[$i]->getVar('field_null')); + $field_null_select->addOptionArray($fieldnull_Handler->getList()); + $field['null'] = $field_null_select->render(); + $field['default'] = new XoopsFormText(TDMCreateLocale::FIELD_DEFAULT, 'field_default', 1, 25, $field_arr[$i]->getVar('field_default')); + $field_key_select = new XoopsFormSelect(TDMCreateLocale::FIELD_KEY, 'field_key', $field_arr[$i]->getVar('field_key')); + $field_key_select->addOptionArray($fieldkey_Handler->getList()); + $field['key'] = $field_key_select->render(); + $field_autoincrement = $field_arr[$i]->getVar('field_auto_increment') ? $field_arr[$i]->getVar('field_auto_increment') : 0; + $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_auto_increment', $field_autoincrement); + $check_field_autoincrement->addOption(1, TDMCreateLocale::FIELD_AUTO_INCREMENT); + $field['auto_increment'] = $check_field_autoincrement->render(); + $field_elements_select = new XoopsFormSelect(TDMCreateLocale::FIELD_ELEMENTS, 'field_elements', $field_arr[$i]->getVar('field_elements')); + $field_elements_select->addOptionArray($fieldelements_Handler->getList()); + foreach (array_keys($tables_arr) as $j) + { + $table_name = $tables_arr[$j]->getVar('table_name'); + if ( $j[$i] == 'XoopsFormTables-'.$table_name ) { + $field_elements_select->addOption('XoopsFormTables-'.$table_name, 'Table : '.$table_name); + } + } + $field['elements'] = $field_elements_select->render(); + $field_admin = $field_arr[$i]->getVar('field_admin') ? 0 : $field_arr[$i]->getVar('field_admin'); + $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin', $field_admin); + $check_field_admin->addOption(1, TDMCreateLocale::C_FIELD_ADMIN); + $field['admin'] = $check_field_admin->render(); + $field_user = $field_arr[$i]->getVar('field_user') ? 0 : $field_arr[$i]->getVar('field_user'); + $check_field_user = new XoopsFormCheckBox(' ', 'field_user', $field_user); + $check_field_user->addOption(1, TDMCreateLocale::C_FIELD_USER); + $field['user'] = $check_field_user->render(); + $field_block = $field_arr[$i]->getVar('field_blocks') ? 0 : $field_arr[$i]->getVar('field_blocks'); + $check_field_block = new XoopsFormCheckBox(' ', 'field_block', $field_block); + $check_field_block->addOption(1, TDMCreateLocale::C_FIELD_BLOCK); + $field['blocks'] = $check_field_block->render(); + $field_main = $field_arr[$i]->getVar('field_main') ? 0 : $field_arr[$i]->getVar('field_main'); + $field_main_radio = new XoopsFormRadio(' ', 'field_main', $field_main); + $field_main_radio->addOption( ' ', TDMCreateLocale::C_FIELD_MAINFIELD ); + $field['main'] = $field_main_radio->render(); + $field_search = $field_arr[$i]->getVar('field_search') ? 0 : $field_arr[$i]->getVar('field_search'); + $check_field_search = new XoopsFormCheckBox(' ', 'field_search', $field_search); + $check_field_search->addOption(1, TDMCreateLocale::C_FIELD_SEARCH); + $field['search'] = $check_field_search->render(); + $field_required = $field_arr[$i]->getVar('field_required') ? 0 : $field_arr[$i]->getVar('field_required'); + $check_field_required = new XoopsFormCheckBox(' ', 'field_required', $field_required); + $check_field_required->addOption(1, TDMCreateLocale::C_FIELD_REQUIRED); + $field['required'] = $check_field_required->render(); + $xoops->tpl()->append_by_ref('fields', $field); + unset($field); + } + } else { + $xoops->tpl()->assign('error_message', TDMCreateLocale::E_NO_FIELDS_FORM); + } break; case 'save': if ( !$GLOBALS['xoopsSecurity']->check() ) { - redirect_header('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); + $xoops->redirect('fields.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); } - if (isset($_REQUEST['field_id'])) { - $obj =& $fieldsHandler->get($_REQUEST['field_id']); + + if ($field_id) { + $obj = $fields_Handler->get($field_id); } else { - $obj =& $fieldsHandler->create(); + $obj = $fields_Handler->create(); } //Form fields - $obj->setVars(array('field_table' => $_POST['field_table'], 'field_name' => $_POST['field_name'], - 'field_type' => $_POST['field_type'], 'field_value' => $_POST['field_value'], - 'field_attribute' => $_POST['field_attribute'], 'field_null' => $_POST['field_null'], - 'field_default' => $_POST['field_default'], 'field_key' => $_POST['field_key'], - 'field_elements' => $_POST['field_elements'], + $obj->setVars(array('field_tid' => $_POST['field_tid'], 'field_numb' => $_POST['field_numb'], + 'field_name' => $_POST['field_name'], 'field_type' => $_POST['field_type'], + 'field_value' => $_POST['field_value'], 'field_attribute' => $_POST['field_attribute'], + 'field_null' => $_POST['field_null'], 'field_default' => $_POST['field_default'], + 'field_key' => $_POST['field_key'], 'field_elements' => $_POST['field_elements'], 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'), 'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'), 'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'), @@ -141,47 +234,121 @@ 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'), 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0'))); - if ($fieldsHandler->insert($obj)) { - redirect_header('fields.php?op=list', 2, _AM_TDMCREATE_FORMOK); + if ($fields_Handler->insert($obj)) { + $xoops->redirect('fields.php', 2, TDMCreateLocale::FORMOK); } $xoops->error($obj->getHtmlErrors()); - $form = $xoops->getModuleForm($obj, 'fields'); - $xoops->tpl()->assign('form', $form->render()); break; case 'edit': - $admin_menu->addItemButton(_AM_TDMCREATE_FIELDS_LIST, 'fields.php', 'application-view-detail'); - $admin_menu->renderButton(); + $admin_menu->addItemButton(TDMCreateLocale::FIELDS_LIST, 'fields.php', 'application-view-detail'); + $admin_menu->renderButton(); + // heaser + $xoops->header('tdmcreate_fields_form.html'); - $id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); - if ($id > 0) { - $obj = $tables_Handler->get($id); - $form = $xoops->getModuleForm($obj, 'fields'); - $xoops->tpl()->assign('form', $form->render()); - } else { - $xoops->redirect('fields.php', 1, _AM_SYSTEM_DBERROR); + $fobj = $fields_Handler->get($field_id); + $tobj = $tables_Handler->get($table_id); + + $criteria = new CriteriaCompo(new Criteria('table_id', $tobj->getVar('table_id'))); + $criteria->add(new Criteria('table_mid', $tobj->getVar('table_mid'))); + $criteria->setSort('table_name'); + $criteria->setOrder('ASC'); + $tables_arr = $tables_Handler->getAll($criteria); + unset($criteria); + + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('field_tid', $tobj->getVar('table_id'))); + $field_arr = $fields_Handler->getAll($criteria); + unset($criteria); + + $numrows_fields = $fobj->getVar('table_nbfields'); + // Assign Template variables + $xoops->tpl()->assign('fields_count', $numrows_fields); + + if ($numrows_fields > 0) + { + foreach (array_keys($field_arr) as $i) + { + $field['id'] = $field_arr[$i]->getVar('field_id'); + $field['name'] = new XoopsFormText(TDMCreateLocale::FIELD_NAME, 'field_name', 1, 25, $field_arr[$i]->getVar('field_name')); + $field_type_select = new XoopsFormSelect(TDMCreateLocale::FIELD_TYPE, 'field_type', $field_arr[$i]->getVar('field_type')); + $field_type_select->addOptionArray($fieldtype_Handler->getList()); + $field['type'] = $field_type_select->render(); + $field['value'] = new XoopsFormText(TDMCreateLocale::FIELD_VALUE, 'field_value', 1, 25, $field_arr[$i]->getVar('field_value')); + $field_attrs_select = new XoopsFormSelect(TDMCreateLocale::FIELD_ATTRIBUTE, 'field_attribute', $field_arr[$i]->getVar('field_attribute')); + $field_attrs_select->addOptionArray($fieldattrs_Handler->getList()); + $field['attribute'] = $field_attrs_select->render(); + $field_null_select = new XoopsFormSelect(TDMCreateLocale::FIELD_NULL, 'field_null', $field_arr[$i]->getVar('field_null')); + $field_null_select->addOptionArray($fieldnull_Handler->getList()); + $field['null'] = $field_null_select->render(); + $field['default'] = new XoopsFormText(TDMCreateLocale::FIELD_DEFAULT, 'field_default', 1, 25, $field_arr[$i]->getVar('field_default')); + $field_key_select = new XoopsFormSelect(TDMCreateLocale::FIELD_KEY, 'field_key', $field_arr[$i]->getVar('field_key')); + $field_key_select->addOptionArray($fieldkey_Handler->getList()); + $field['key'] = $field_key_select->render(); + $field_autoincrement = $field_arr[$i]->getVar('field_auto_increment') ? $field_arr[$i]->getVar('field_auto_increment') : 0; + $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_auto_increment', $field_autoincrement); + $check_field_autoincrement->addOption(1, TDMCreateLocale::FIELD_AUTO_INCREMENT); + $field['auto_increment'] = $check_field_autoincrement->render(); + $field_elements_select = new XoopsFormSelect(TDMCreateLocale::FIELD_ELEMENTS, 'field_elements', $field_arr[$i]->getVar('field_elements')); + $field_elements_select->addOptionArray($fieldelements_Handler->getList()); + foreach (array_keys($tables_arr) as $j) + { + $table_name = $tables_arr[$j]->getVar('table_name'); + if ( $j[$i] == 'XoopsFormTables-'.$table_name ) { + $field_elements_select->addOption('XoopsFormTables-'.$table_name, 'Table : '.$table_name); + } + } + $field['elements'] = $field_elements_select->render(); + $field_admin = $field_arr[$i]->getVar('field_admin') ? 0 : $field_arr[$i]->getVar('field_admin'); + $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin', $field_admin); + $check_field_admin->addOption(1, TDMCreateLocale::FIELD_ADMIN); + $field['admin'] = $check_field_admin->render(); + $field_user = $field_arr[$i]->getVar('field_user') ? 0 : $field_arr[$i]->getVar('field_user'); + $check_field_user = new XoopsFormCheckBox(' ', 'field_user', $field_user); + $check_field_user->addOption(1, TDMCreateLocale::FIELD_USER); + $field['user'] = $check_field_user->render(); + $field_block = $field_arr[$i]->getVar('field_blocks') ? 0 : $field_arr[$i]->getVar('field_blocks'); + $check_field_block = new XoopsFormCheckBox(' ', 'field_block', $field_block); + $check_field_block->addOption(1, TDMCreateLocale::FIELD_DISPLAY_BLOCK); + $field['blocks'] = $check_field_block->render(); + $field_main = $field_arr[$i]->getVar('field_main') ? 0 : $field_arr[$i]->getVar('field_main'); + $field_main_radio = new XoopsFormRadio(' ', 'field_main', $field_main); + $field_main_radio->addOption( ' ', TDMCreateLocale::FIELD_MAINFIELD ); + $field['main'] = $field_main_radio->render(); + $field_search = $field_arr[$i]->getVar('field_search') ? 0 : $field_arr[$i]->getVar('field_search'); + $check_field_search = new XoopsFormCheckBox(' ', 'field_search', $field_search); + $check_field_search->addOption(1, TDMCreateLocale::FIELD_SEARCH); + $field['search'] = $check_field_search->render(); + $field_required = $field_arr[$i]->getVar('field_required') ? 0 : $field_arr[$i]->getVar('field_required'); + $check_field_required = new XoopsFormCheckBox(' ', 'field_required', $field_required); + $check_field_required->addOption(1, TDMCreateLocale::FIELD_REQUIRED); + $field['required'] = $check_field_required->render(); + $xoops->tpl()->append_by_ref('fields', $field); + unset($field); + } + } else { + $xoops->tpl()->assign('error_message', TDMCreateLocale::E_NO_FIELDS); } break; - case 'delete': - $id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); - if ($id > 0) { - $obj = $fields_Handler->get($id); + case 'delete': + if ($field_id > 0) { + $obj = $fields_Handler->get($field_id); if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { $xoops->redirect('fields.php', 3, implode(',', $xoops->security()->getErrors())); } if ($fields_Handler->delete($obj)) { - $xoops->redirect('fields.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_TABLE)); + $xoops->redirect('fields.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::TABLE)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'fields.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('field_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $field_id, 'op' => 'delete'), 'fields.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('field_name')) . '<br />'); } } else { - $xoops->redirect('fields.php', 1, _AM_SYSTEM_DBERROR); + $xoops->redirect('fields.php', 1, TDMCreateLocale::E_DATABASE_ERROR); } break; } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -19,9 +19,6 @@ * @version $Id: import.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; -// Get main instance -$system = System::getInstance(); -$xoops = Xoops::getInstance(); // Preferences Limit $nb_pager = $xoops->getModuleConfig('pager'); // Get Action type @@ -40,7 +37,7 @@ switch ($op) { case 'list': - $admin_menu->addItemButton(_AM_TDMCREATE_IMPORT, 'import.php?op=import', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'import.php?op=import', 'add'); $admin_menu->renderButton(); // Get modules list $criteria = new CriteriaCompo(); @@ -69,12 +66,12 @@ $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { - $xoops->tpl()->assign('error_message', _AM_TDMCREATE_IMPORT_ERROR_NOIMPORTS); + $xoops->tpl()->assign('error_message', TDMCreateLocale::IMPORT_ERROR_NOIMPORTS); } break; case 'import': - $admin_menu->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'import.php', 'application-view-detail'); $admin_menu->renderButton(); $obj = $import_Handler->create(); @@ -165,7 +162,7 @@ } if ($import_Handler->insert($obj)) { - $xoops->redirect('import.php', 3, _AM_TDMCREATE_FORMOK); + $xoops->redirect('import.php', 3, TDMCreateLocale::FORM_OK); } $xoops->error($obj->getHtmlErrors()); @@ -174,8 +171,8 @@ break; case 'edit': - $admin_menu->addItemButton(_AM_TDMCREATE_IMPORT, 'import.php?op=import', 'add'); - $admin_menu->addItemButton(_AM_TDMCREATE_IMPORTS_LIST, 'import.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'import.php?op=import', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'import.php', 'application-view-detail'); $admin_menu->renderButton(); $obj = $import_Handler->get($system->cleanVars($_REQUEST, 'import_id', 0, 'int')); @@ -192,15 +189,15 @@ $xoops->redirect('import.php', 3, implode(',', $xoops->security()->getErrors())); } if ($import_Handler->delete($obj)) { - $xoops->redirect('import.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_IMPORT)); + $xoops->redirect('import.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::IMPORT)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'import.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('import_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'import.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('import_name')) . '<br />'); } } else { - $xoops->redirect('import.php', 1, _AM_SYSTEM_DBERROR); + $xoops->redirect('import.php', 1, TDMCreateLocale::E_DATABASE_ERROR); } break; } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -50,11 +50,11 @@ $import_color = $tdmcreate_import == 0 ? $r : $g; $admin_page = new XoopsModuleAdmin(); -$admin_page->addInfoBox(_AM_TDMCREATE_STATISTICS); -$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NMTOTAL, '<span class="'.$modules_color.'">' . $tdmcreate_modules . '</span>')); -$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NETOTAL, '<span class="'.$extensions_color.'">' . $tdmcreate_extensions . '</span>')); -$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NTTOTAL, '<span class="'.$tables_color.'">' . $tdmcreate_tables . '</span>')); -$admin_page->addInfoBoxLine(sprintf(_AM_TDMCREATE_INDEX_NITOTAL, '<span class="'.$import_color.'">' . $tdmcreate_import . '</span>')); +$admin_page->addInfoBox(TDMCreateLocale::INDEX_STATISTICS); +$admin_page->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NMTOTAL, '<span class="'.$modules_color.'">' . $tdmcreate_modules . '</span>')); +$admin_page->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NETOTAL, '<span class="'.$extensions_color.'">' . $tdmcreate_extensions . '</span>')); +$admin_page->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NTTOTAL, '<span class="'.$tables_color.'">' . $tdmcreate_tables . '</span>')); +$admin_page->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NITOTAL, '<span class="'.$import_color.'">' . $tdmcreate_import . '</span>')); $admin_page->addConfigBoxLine($folder_path, 'folder'); $admin_page->addConfigBoxLine(array($folder_path, '777'), 'chmod'); $admin_page->displayNavigation('index.php'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** * tdmcreate module * @@ -21,35 +20,35 @@ */ $adminmenu = array(); $i = 0; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU1; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU1; $adminmenu[$i]['link'] = "admin/index.php"; $adminmenu[$i]['icon'] = 'dashboard.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU2; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU2; $adminmenu[$i]['link'] = "admin/modules.php"; $adminmenu[$i]['icon'] = 'addmodule.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU3; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU3; $adminmenu[$i]['link'] = "admin/extensions.php"; $adminmenu[$i]['icon'] = 'extensions.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU4; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU4; $adminmenu[$i]['link'] = "admin/tables.php"; $adminmenu[$i]['icon'] = 'addtable.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU5; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU5; $adminmenu[$i]['link'] = "admin/fields.php"; $adminmenu[$i]['icon'] = 'editfields.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU6; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU6; $adminmenu[$i]['link'] = "admin/import.php"; $adminmenu[$i]['icon'] = 'import.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU7; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU7; $adminmenu[$i]['link'] = "admin/building.php"; $adminmenu[$i]['icon'] = 'builder.png'; $i++; -$adminmenu[$i]['title'] = _MI_TDMCREATE_ADMENU8; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU8; $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/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -37,7 +37,7 @@ { case 'list': http://localhost/xoops-2.6.0-alpha2/htdocs/uploads/tdmcreate/images/modules/ default: - $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_MODULE, 'modules.php?op=new', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); $admin_menu->renderButton(); // Get modules list $criteria = new CriteriaCompo(); @@ -73,12 +73,12 @@ $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { - $xoops->tpl()->assign('error_message', _AM_TDMCREATE_MODULE_ERROR_NOMODULES); + $xoops->tpl()->assign('error_message', TDMCreateLocale::E_NO_MODULES); } break; case 'new': - $admin_menu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::MODULES_LIST, 'modules.php', 'application-view-detail'); $admin_menu->renderButton(); $obj = $modules_Handler->create(); @@ -106,14 +106,14 @@ 'mod_manual_file' => $_POST['mod_manual_file'])); //Form module_image $uploader = new XoopsMediaUploader( TDMC_MODULES_PATH_IMG, $xoops->getModuleConfig('mimetypes'), - $xoops->getModuleConfig('maxuploadsize'), null, null); + $xoops->getModuleConfig('maxuploadsize'), null, null); if ($uploader->fetchMedia($_POST['modules_image'][0])) { $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['modules_image']['name']); $name_img = 'logo.'.$extension; $uploader->setPrefix($name_img); $uploader->fetchMedia($_POST['modules_image'][0]); if (!$uploader->upload()) { - redirect_header('javascript:history.go(-1)',3, $uploader->getErrors()); + $xoops->redirect('javascript:history.go(-1)',3, $uploader->getErrors()); } else { $obj->setVar('mod_image', $uploader->getSavedFileName()); } @@ -140,7 +140,7 @@ 'mod_subversion' => $_POST['mod_subversion'])); // Insert Data if ($modules_Handler->insert($obj)) { - redirect_header('modules.php?op=list', 2, _AM_TDMCREATE_FORMOK); + $xoops->redirect('modules.php?op=list', 2, XoopsLocale::S_DATA_INSERTED); } // Form Data $xoops->error($obj->getHtmlErrors()); @@ -149,8 +149,8 @@ break; case 'edit': - $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_MODULE, 'modules.php?op=new', 'add'); - $admin_menu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::MODULES_LIST, 'modules.php', 'application-view-detail'); $admin_menu->renderButton(); $obj = $modules_Handler->get($system->cleanVars($_REQUEST, 'mod_id', 0, 'int')); @@ -159,24 +159,24 @@ break; case 'delete': - $id = $system->cleanVars($_REQUEST, 'mod_id', 0, 'int'); - if ($id > 0) { - $obj = $modules_Handler->get($id); + $mid = $system->cleanVars($_REQUEST, 'mod_id', 0, 'int'); + if ($mid > 0) { + $obj = $modules_Handler->get($mid); if (isset($_POST['ok']) && $_POST['ok'] == 1) { - if (!$xoops->security()->check()) { - $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); - } - if ($modules_Handler->delete($obj)) { - $xoops->redirect('modules.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_MODULE)); - } else { - $xoops->error($obj->getHtmlErrors()); - } - } else { - $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'modules.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('mod_name')) . '<br />'); + if (!$xoops->security()->check()) { + $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); + } + if ($modules_Handler->delete($obj)) { + $xoops->redirect('modules.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::MODULE)); + } else { + $xoops->error($obj->getHtmlErrors()); + } + } else { + $xoops->confirm(array('ok' => 1, 'id' => $mid, 'op' => 'delete'), 'modules.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('mod_name')) . '<br />'); } - } else { - $xoops->redirect('modules.php', 1, _AM_SYSTEM_DBERROR); - } + } else { + $xoops->redirect('modules.php', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); + } break; } $xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -24,6 +24,7 @@ $nb_pager = $xoops->getModuleConfig('adminpager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +$table_id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); // Get start pager $start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // heaser @@ -39,7 +40,7 @@ { case 'list': default: - $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); $admin_menu->renderButton(); // Get modules list $criteria = new CriteriaCompo(); @@ -54,7 +55,7 @@ unset($criteria); // Redirect if there aren't modules /* if ( $numrows_mods == 0 ) { - redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES ); + $xoops->redirect('modules.php?op=new', 2, TDMCreateLocale::NOTMODULES ); }*/ $criteria = new CriteriaCompo(); $criteria->setSort('table_name'); @@ -111,15 +112,15 @@ $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { - $xoops->tpl()->assign('error_message', _AM_TDMCREATE_TABLE_ERROR_NOMODULES); + $xoops->tpl()->assign('error_message', TDMCreateLocale::TABLE_ERROR_NOMODULES); } break; case 'new': - $admin_menu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); + $admin_menu->addItemButton(TDMCreateLocale::TABLES_LIST, 'tables.php', 'application-view-detail'); $admin_menu->renderButton(); - $obj = $tables_Handler->create(); + $obj = $tables_Handler->create($table_id); $form = $xoops->getModuleForm($obj, 'tables'); $xoops->tpl()->assign('form', $form->render()); break; @@ -128,9 +129,9 @@ if (!$xoops->security()->check()) { $xoops->redirect('tables.php', 3, implode(',', $xoops->security()->getErrors())); } - $id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); - if ($id > 0) { - $obj = $tables_Handler->get($id); + + if ($table_id > 0) { + $obj = $tables_Handler->get($table_id); } else { $obj = $tables_Handler->create(); } @@ -139,32 +140,26 @@ 'table_nbfields' => $_POST['table_nbfields'], 'table_fieldname' => $_POST['table_fieldname'])); //Form table_image $pathIcon32 = XOOPS_ROOT_PATH . '/media/xoops/images/icons/32'; - if(is_dir($pathIcon32)){ - $uploaddir = $pathIcon32; - }else{ - $uploaddir = XOOPS_UPLOAD_PATH.'/tdmcreate/images/tables'; - } - - $uploader_img = new XoopsMediaUploader($uploaddir, $xoops->getModuleConfig('mimetypes'), - $xoops->getModuleConfig('maxsize'), null, null); - if ($uploader_img->fetchMedia('tables_image')) { - $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['table_image']['name']); + $uploaddir = is_dir($pathIcon32) ? $pathIcon32 : TDMC_TABLES_PATH_IMG; + $uploader = new XoopsMediaUploader( $uploaddir, $xoops->getModuleConfig('mimetypes'), + $xoops->getModuleConfig('maxuploadsize'), null, null); + if ($uploader->fetchMedia($_POST['tables_image'][0])) { + $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['tables_image']['name']); $name_img = $_GET['table_name'].'.'.$extension; - $uploader_img->setPrefix($name_img); - $uploader_img->fetchMedia('tables_image'); - if (!$uploader_img->upload()) { - $errors = $uploader_img->getErrors(); - $xoops->redirect('javascript:history.go(-1)', 3, $errors); - } else { - $obj->setVar('table_image', $uploaddir . $uploader_img->getSavedFileName()); - } - } else { - if ($_POST['tables_image'] == 'blank.gif') { + $uploader->setPrefix($name_img); + $uploader->fetchMedia($_POST['tables_image'][0]); + if (!$uploader->upload()) { + $xoops->redirect('javascript:history.go(-1)',3, $uploader->getErrors()); + } else { + $obj->setVar('table_image', $uploader->getSavedFileName()); + } + } else { + if ($_POST['tables_image'] == 'blank.gif') { $obj->setVar('table_image', $_POST['table_image']); } else { - $obj->setVar('table_image', $uploaddir . $_POST['table_image']); + $obj->setVar('table_image', $_POST['tables_image']); } - } + } //Form tables $obj->setVars(array('table_blocks' => (($_REQUEST['table_blocks'] == 1) ? '1' : '0'), @@ -176,9 +171,9 @@ 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0'))); if( $tables_Handler->insert($obj) && $obj->isNew() ) { - redirect_header('fields.php?op=new', 3, _AM_TDMCREATE_FORMOK); + $xoops->redirect('fields.php?op=new', 3, XoopsLocale::S_DATA_INSERTED); } else { - redirect_header('tables.php?op=list', 3, _AM_TDMCREATE_FORMOK); + $xoops->redirect('tables.php?op=list', 3, XoopsLocale::S_DATABASE_UPDATED); } $xoops->error($obj->getHtmlErrors()); @@ -187,38 +182,32 @@ break; case 'edit': - $admin_menu->addItemButton(_ADD . ' ' . _AM_TDMCREATE_TABLE, 'tables.php?op=new', 'add'); - $admin_menu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'application-view-detail'); - $admin_menu->renderButton(); - - $id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); - if ($id > 0) { - $obj = $tables_Handler->get($id); - $form = $xoops->getModuleForm($obj, 'tables'); - $xoops->tpl()->assign('form', $form->render()); - } else { - $xoops->redirect('tables.php', 1, _AM_SYSTEM_DBERROR); - } + $admin_menu->addItemButton(TDMCreateLocale::TABLE_ADD, 'tables.php?op=new', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::TABLES_LIST, 'tables.php', 'application-view-detail'); + $admin_menu->renderButton(); + + $obj = $tables_Handler->get($table_id); + $form = $xoops->getModuleForm($obj, 'tables'); + $xoops->tpl()->assign('form', $form->render()); break; case 'delete': - $id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); - if ($id > 0) { - $obj = $tables_Handler->get($id); + if ($table_id > 0) { + $obj = $tables_Handler->get($table_id); if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { $xoops->redirect('tables.php', 3, implode(',', $xoops->security()->getErrors())); } if ($tables_Handler->delete($obj)) { - $xoops->redirect('tables.php', 2, sprintf(_AM_TDMCREATE_DELETEDSUCCESS, _AM_TDMCREATE_TABLE)); + $xoops->redirect('tables.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::TABLE)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'tables.php', sprintf(_AM_TDMCREATE_RUSUREDEL, $obj->getVar('table_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $table_id, 'op' => 'delete'), 'tables.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('table_name')) . '<br />'); } } else { - $xoops->redirect('tables.php', 1, _AM_SYSTEM_DBERROR); + $xoops->redirect('tables.php', 1, TDMCreateLocale::E_DATABASE_ERROR); } break; } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -28,9 +28,10 @@ */ public function __construct() { - $this->initVar('field_id', XOBJ_DTYPE_INT, null); + $this->initVar('field_id', XOBJ_DTYPE_INT, null, true); $this->initVar('field_tid', XOBJ_DTYPE_INT, null); $this->initVar('field_name', XOBJ_DTYPE_TXTBOX, null); + $this->initVar('field_numb', XOBJ_DTYPE_INT, null); $this->initVar('field_type', XOBJ_DTYPE_TXTBOX, null); $this->initVar('field_value', XOBJ_DTYPE_TXTBOX, null); $this->initVar('field_attribute', XOBJ_DTYPE_TXTBOX, null); @@ -45,13 +46,13 @@ $this->initVar('field_search', XOBJ_DTYPE_INT); $this->initVar('field_required', XOBJ_DTYPE_INT); // For relationship - $this->initVar('table_id', XOBJ_DTYPE_INT, null); + $this->initVar('table_id', XOBJ_DTYPE_INT, null, true); $this->initVar('table_module', XOBJ_DTYPE_INT, null); $this->initVar('table_name', XOBJ_DTYPE_TXTBOX, null); $this->initVar('table_nbfields', XOBJ_DTYPE_INT, null); $this->initVar('table_fieldname', XOBJ_DTYPE_TXTBOX, null); - $this->initVar('fieldtype_id', XOBJ_DTYPE_INT, null); + $this->initVar('fieldtype_id', XOBJ_DTYPE_INT, null, true); $this->initVar('fieldtype_value', XOBJ_DTYPE_TXTBOX, null); $this->initVar('fieldtype_name', XOBJ_DTYPE_TXTBOX, null); } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-13 21:23:28 UTC (rev 11049) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-13 22:37:10 UTC (rev 11050) @@ -30,14 +30,14 @@ { $xoops = Xoops::getInstance(); - $title = $obj->isNew() ? sprintf(_AM_TDMCREATE_EXTENSION_ADD) : sprintf(_AM_TDMCREATE_EXTENSION_EDIT); + $title = $obj->isNew() ? sprintf(TDMCreateLocale::ADD_EXTENSION) : sprintf(TDMCreateLocale::EDIT_EXTENSION); parent::__construct($title, 'form', 'extensions.php', 'post', true); $this->setExtra('enctype="multipart/form-data"'); - $this->insertBreak('<div class="center"><b>'._AM_TDMCREATE_EXTENSION_IMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_NAME, 'ext_name', 50, 255, $obj->getVar('ext_name')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_VERSION, 'ext_version', 2, 5, $obj->getVar('ext_version')), true); + $this->insertBreak('<div class="center"><b>'.TDMCreateLocale::IMPORTANT.'</b></div>','head'); + $this->addElement(new XoopsFormText(XoopsLocale::C_NAME, 'ext_name', 50, 255, $obj->getVar('ext_name')), true); + $this->addElement(new XoopsFormText(XoopsLocale::C_VERSION, 'ext_version', 2, 5, $obj->getVar('ext_version')), true); $editor_configs=array(); $editor_configs['name'] = 'ext_description'; $editor_configs['value'] = $obj->getVar('ext_description', 'e'); @@ -46,40 +46,40 @@ $editor_configs['width'] = '100%'; $editor_configs['height'] = '400px'; $editor_configs['editor'] = $xoops->getModuleConfig('editor'); - $this->addElement( new XoopsFormEditor(_AM_TDMCREATE_EXTENSION_DESCRIPTION, 'ext_description', $editor_configs), true ); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_AUTHOR, 'ext_author', 50, 255, $obj->getVar('ext_author')), true); - $this->addElement(new XoopsFormText(_AM_TDMCREATE_EXTENSION_LICENSE, 'ext_license', 50, 255, $obj->getVar('ext_license')), true); - $option_tray = new XoopsFormElementTray(_OPTIONS, ' '); + $this->addElement( new XoopsFormEditor(XoopsLocale::C_DESCRIPTION, 'ext_description', $editor_configs), true ); + $this->addElement(new XoopsFormText(XoopsLocale::C_AUTHOR, 'ext_author', 50, 255, $obj->getVar('ext_author')), true); + $this->addElement(new XoopsFormText(TDMCreateLocale::C_LICENSE, 'ext_license', 50, 255, $obj->getVar('ext_license')), true); + $option_tray = new XoopsFormElementTray(XoopsLocale::OPTIONS, ' '); $display_admin = $obj->isNew() ? 0 : $obj->getVar('ext_admin'); $check_display_admin = new XoopsFormCheckBox(' ', 'ext_admin', $display_admin); - $check_display_admin->addOption(1, _AM_TDMCREATE_EXTENSION_ADMIN); + $check_display_admin->addOption(1, TDMCreateLocale::C_ADMIN); $option_tray->addElement($check_display_admin); $display_user = $obj->isNew() ? 0 : $obj->getVar('ext_user'); $check_display_user = new XoopsFormCheckBox(' ', 'ext_user', $display_user); - $check_display_user->addOption(1, _AM_TDMCREATE_EXTENSION_USER); + $check_display_user->addOption(1, TDMCreateLocale::C_USER); $option_tray->addElement($check_display_user); $display_submenu = $obj->isNew() ? 0 : $obj->getVar('ext_submenu'); $check_display_submenu = new XoopsFormCheckBox(' ', 'ext_submenu', $display_submenu); - $check_display_submenu->addOption(1, _AM_TDMCREATE_EXTENSION_SUBMENU); + $check_display_submenu->addOption(1, TDMCreateLocale::C_SUBMENU); $option_tray->addElement($check_display_submenu); $active_search = $obj->isNew() ? 0 : $obj->getVar('ext_search'); $check_active_search = new XoopsFormCheckBox(' ', 'ext_search', $active_search); - $check_active_search->addOption(1, _AM_TDMCREATE_EXTENSION_SEARCH); + $check_active_search->addOption(1, TDMCreateLocale::C_SEARCH); $option_tray->addElement($check_active_search); $active_comments = $obj->isNew() ? 0 : $obj->getVar('ext_comments'); $check_active_comments = new XoopsFormCheckBox(' ', 'ext_comments', $active_comments); - $check_active_comments->addOption(1, _AM_TDMCREATE_EXTENSION_COMMENTS); + $check_active_comments->addOption(1, TDMCreateLocale::C_COMMENTS); $option_tray->addElement($check_active_comments); $active_notifies = $obj->isNew() ? 0 : $obj->getVar('ext_notifications'); $check_active_notifies = new XoopsFormCheckBox(' ', 'ext_notifications', $active_notifies); - $check_active_notifies->addOption(1, _AM_TDMCREATE_EXTENSION_NOTIFICATIONS); + $check_active_notifies->addOption(1, TDMCreateLocale::C_NOTIFICATIONS); $option_tray->addElement($check_active_notifies); $this->addElement($option_tray); $ext_image = $obj->getVar('ext_image') ? $obj->getVar('ext_image') : 'default_slogo.png'; $uploadir = 'uploads/tdmcreate/images/extensions'; - $imgtray = new XoopsFormElementTray(_AM_TDMCREATE_EXTENSION_IMAGE,'<br />'); - $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './'.$uploadir.'/'); + $imgtray = new XoopsFormElementTray(TDMCreateLocale::C_IMAGE,'<br />'); + $imgpath = sprintf(TDMCreateLocale::CF_IMAGE_PATH, './'.$uploadir.'/'); $imageselect = new X... [truncated message content] |
From: <txm...@us...> - 2013-02-20 22:12:14
|
Revision: 11084 http://sourceforge.net/p/xoops/svn/11084 Author: txmodxoops Date: 2013-02-20 22:12:11 +0000 (Wed, 20 Feb 2013) Log Message: ----------- Needed re-installation Updated Test Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/functions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Removed Paths: ------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields_form.html Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/extensions.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -1,182 +0,0 @@ -<?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 XOOPS Development Team - * @version $Id: extensions.php 10665 2012-12-27 10:14:15Z timgno $ - */ -include dirname(__FILE__) . '/header.php'; -// Preferences Limit -$nb_pager = $xoops->getModuleConfig('pager'); -// Get Action type -$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); -// Get limit pager -$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); -// Get start pager -$start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); -// heaser -$xoops->header('tdmcreate_extensions.html'); -// Get handler -/* @var $extensions_handler TDMCreateExtensionsHandler */ -$extensions_Handler = $xoops->getModuleHandler('extensions'); - -$admin_menu->renderNavigation('extensions.php'); -switch ($op) -{ - case 'list': - default: - $admin_menu->addItemButton(TDMCreateLocale::ADD_EXTENSION, 'extensions.php?op=new', 'add'); - $admin_menu->renderButton(); - $criteria = new CriteriaCompo(); - $criteria->setSort('ext_name'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numrows_exts = $extensions_Handler->getCount($criteria); - $exts_arr = $extensions_Handler->getAll($criteria); - $xoops->tpl()->assign('extensions_count', $numrows_exts); - unset($criteria); - if ($numrows_exts > 0) { - foreach (array_keys($exts_arr) as $i) { - $ext['id'] = $exts_arr[$i]->getVar('ext_id'); - $ext['name'] = $exts_arr[$i]->getVar('ext_name'); - $ext['version'] = $exts_arr[$i]->getVar('ext_version'); - $ext['image'] = $exts_arr[$i]->getVar('ext_image'); - $ext['release'] = $exts_arr[$i]->getVar('ext_release'); - $ext['status'] = $exts_arr[$i]->getVar('ext_status'); - $ext['admin'] = $exts_arr[$i]->getVar('ext_admin'); - $ext['user'] = $exts_arr[$i]->getVar('ext_user'); - $ext['submenu'] = $exts_arr[$i]->getVar('ext_submenu'); - $ext['search'] = $exts_arr[$i]->getVar('ext_search'); - $ext['comments'] = $exts_arr[$i]->getVar('ext_comments'); - $ext['notifications'] = $exts_arr[$i]->getVar('ext_notifications'); - $xoops->tpl()->append_by_ref('extensions', $ext); - unset($ext); - } - // Display Page Navigation - if ($numrows_exts > $nb_pager) { - $nav = new XoopsPageNav($numrows_exts, $nb_pager, $start, 'start'); - $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); - } - } else { - $xoops->tpl()->assign('error_message', TDMCreateLocale::E_NO_EXTENSIONS); - } - break; - - case 'new': - $admin_menu->addItemButton(TDMCreateLocale::EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); - $admin_menu->renderButton(); - - $obj = $extensions_Handler->create(); - $form = $xoops->getModuleForm($obj, 'extensions'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'save': - if (!$xoops->security()->check()) { - $xoops->redirect('extensions.php', 3, implode(',', $xoops->security()->getErrors())); - } - $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); - if ($id > 0) { - $obj = $extensions_Handler->get($id); - } else { - $obj = $extensions_Handler->create(); - } - //Form extension save - $obj->setVars(array('ext_name' => $_POST['ext_name'], 'ext_version' => $_POST['ext_version'], - 'ext_description' => $_POST['ext_description'], 'ext_author' => $_POST['ext_author'], - 'ext_author_mail' => $_POST['ext_author_mail'], 'ext_author_website_url' => $_POST['ext_author_website_url'], - 'ext_author_website_name' => $_POST['ext_author_website_name'], 'ext_credits' => $_POST['ext_credits'], - 'ext_license' => $_POST['ext_license'], 'ext_release_info' => $_POST['ext_release_info'], - 'ext_release_file' => $_POST['ext_release_file'], 'ext_manual' => $_POST['ext_manual'], - 'ext_manual_file' => $_POST['ext_manual_file'])); - - //Form extension_image - $uploader = new XoopsMediaUploader( TDMC_EXTENSIONS_PATH_IMG, $xoops->getModuleConfig('mimetypes'), - $xoops->getModuleConfig('maxuploadsize'), null, null); - if ($uploader->fetchMedia($_POST['extensions_image'][0])) { - $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['extensions_image']['name']); - $name_img = 'logo.'.$extension; - $uploader->setPrefix($name_img); - $uploader->fetchMedia($_POST['extensions_image'][0]); - if (!$uploader->upload()) { - $xoops->redirect('javascript:history.go(-1)',3, $uploader->getErrors()); - } else { - $obj->setVar('ext_image', $uploader->getSavedFileName()); - } - } else { - if ($_POST['extensions_image'] == 'blank.gif') { - $obj->setVar('ext_image', $_POST['ext_image']); - } else { - $obj->setVar('ext_image', $_POST['extensions_image']); - } - } - - //Form extension save - $obj->setVars(array('ext_demo_site_url' => $_POST['ext_demo_site_url'], 'ext_demo_site_name' => $_POST['ext_demo_site_name'], - 'ext_forum_site_url' => $_POST['ext_forum_site_url'], 'ext_forum_site_name' => $_POST['ext_forum_site_name'], - 'ext_website_url' => $_POST['ext_website_url'], 'ext_website_name' => $_POST['ext_website_name'], - 'ext_release' => $_POST['ext_release'], 'ext_status' => $_POST['ext_status'], - 'ext_admin' => (($_REQUEST['ext_admin'] == 1) ? '1' : '0'), - 'ext_user' => (($_REQUEST['ext_user'] == 1) ? '1' : '0'), - 'ext_submenu' => (($_REQUEST['ext_submenu'] == 1) ? '1' : '0'), - 'ext_search' => (($_REQUEST['ext_search'] == 1) ? '1' : '0'), - 'ext_comments' => (($_REQUEST['ext_comments'] == 1) ? '1' : '0'), - 'ext_notifications' => (($_REQUEST['ext_notifications'] == 1) ? '1' : '0'), - 'ext_paypal' => $_POST['ext_paypal'], - 'ext_subversion' => $_POST['ext_subversion'])); - // Insert Data - if ($extensions_Handler->insert($obj)) { - $xoops->redirect('extensions.php?op=list', 2, XoopsLocale::S_DATA_INSERTED); - } - // Form Data - $xoops->error($obj->getHtmlErrors()); - $form = $xoops->getModuleForm($obj, 'extensions'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'edit': - $admin_menu->addItemButton(TDMCreateLocale::EXTENSION_ADD, 'extensions.php?op=new', 'add'); - $admin_menu->addItemButton(TDMCreateLocale::EXTENSIONS_LIST, 'extensions.php', 'application-view-detail'); - $admin_menu->renderButton(); - - $obj = $extensions_Handler->get($system->cleanVars($_REQUEST, 'ext_id', 0, 'int')); - $form = $xoops->getModuleForm($obj, 'extensions'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'delete': - $id = $system->cleanVars($_REQUEST, 'ext_id', 0, 'int'); - if ($id != 0) { - $obj = $extensions_Handler->get($id); - if (isset($_POST['ok']) && $_POST['ok'] == 1) { - if (!$xoops->security()->check()) { - $xoops->redirect('extensions.php', 3, implode(',', $xoops->security()->getErrors())); - } - if ($extensions_Handler->delete($obj)) { - $xoops->redirect('extensions.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::EXTENSION)); - } else { - $xoops->error($obj->getHtmlErrors()); - } - } else { - $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'extensions.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('ext_name')) . '<br />'); - } - } else { - $xoops->redirect('extensions.php', 1, TDMCreateLocale::E_DATABASE_ERROR); - } - break; -} -$xoops->footer(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -62,12 +62,14 @@ // Assign Template variables $xoops->tpl()->assign('fields_list', true); $xoops->tpl()->assign('fields_count', $numrows_fields); - $mytree = new XoopsObjectTree($table_arr, 'table_id', 'table_mid'); + /*$mytree = new XoopsObjectTree($table_arr, 'table_id', 'table_mid'); + tdmcreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name');*/ if ($numrows_tables > 0) { foreach (array_keys($table_arr) as $i) { $tables['id'] = $table_arr[$i]->getVar('table_id'); $tables['name'] = $table_arr[$i]->getVar('table_name'); - $tables['mid'] = tdmcreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); + $module_name = $modules_Handler->get($table_arr[$i]->getVar('table_mid')); + $tables['mid'] = $module_name->getVar('mod_name'); $tables['image'] = $table_arr[$i]->getVar('table_image'); $tables['nbfields'] = $table_arr[$i]->getVar('table_nbfields'); $tables['blocks'] = $table_arr[$i]->getVar('table_blocks'); @@ -78,28 +80,28 @@ $tables['comments'] = $table_arr[$i]->getVar('table_comments'); $tables['notifications'] = $table_arr[$i]->getVar('table_notifications'); $xoops->tpl()->append_by_ref('tables', $tables); - unset($tables); - if ($numrows_fields > 0) { - foreach (array_keys($field_arr) as $i) { - $field['id'] = $field_arr[$i]->getVar('field_id'); - $table_name = $tables_Handler->get($field_arr[$i]->getVar('field_tid')); - $field['tid'] = $table_name->getVar('table_name'); - $field['name'] = $field_arr[$i]->getVar('field_name'); - $field['type'] = $field_arr[$i]->getVar('field_type'); - $field['value'] = $field_arr[$i]->getVar('field_value'); - $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); - $field['attribute'] = $field_arr[$i]->getVar('field_attribute'); - $field['default'] = $field_arr[$i]->getVar('field_default'); - $field['key'] = $field_arr[$i]->getVar('field_key'); - $field['auto_increment'] = $field_arr[$i]->getVar('field_auto_increment'); - $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); - $field['search'] = $field_arr[$i]->getVar('field_search'); - $field['required'] = $field_arr[$i]->getVar('field_required'); - $xoops->tpl()->append_by_ref('fields', $field); - unset($field); - } + unset($tables); + } + if ($numrows_fields > 0) { + foreach (array_keys($field_arr) as $i) { + $field['id'] = $field_arr[$i]->getVar('field_id'); + $table_name = $tables_Handler->get($field_arr[$i]->getVar('field_tid')); + $field['tid'] = $table_name->getVar('table_name'); + $field['name'] = $field_arr[$i]->getVar('field_name'); + $field['type'] = $field_arr[$i]->getVar('field_type'); + $field['value'] = $field_arr[$i]->getVar('field_value'); + $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); + $field['attribute'] = $field_arr[$i]->getVar('field_attribute'); + $field['default'] = $field_arr[$i]->getVar('field_default'); + $field['key'] = $field_arr[$i]->getVar('field_key'); + $field['auto_increment'] = $field_arr[$i]->getVar('field_auto_increment'); + $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); + $field['search'] = $field_arr[$i]->getVar('field_search'); + $field['required'] = $field_arr[$i]->getVar('field_required'); + $xoops->tpl()->append_by_ref('fields', $field); + unset($field); } - } + } // Display Page Navigation if ($numrows_tables > $nb_pager) { $nav = new XoopsPageNav($numrows_tables, $nb_pager, $start, 'start'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -16,34 +16,29 @@ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) * @package tdmcreate * @since 2.6.0 - * @author TDM Xoops (AKA Developers) + * @author TXMod Xoops (AKA Timgno) * @version $Id: header.php 10665 2012-12-27 10:14:15Z timgno $ */ require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; include_once dirname(dirname(__FILE__)) . '/include/common.php'; include_once dirname(dirname(__FILE__)) . '/include/functions.php'; -// Get XoopsLoad system +include_once dirname(dirname(__FILE__)) . '/class/helper.php'; +// Get main instance XoopsLoad::load('system', 'system'); -// Get main instance $system = System::getInstance(); +// Get main locale instance $xoops = Xoops::getInstance(); -// Preferences Limit -$nb_pager = $xoops->getModuleConfig('adminpager'); -// Get Action type -$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); -// Get limit pager -$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); -// Get start pager -$start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); +$helper = TDMCreate::getInstance(); +$request = $xoops->request(); // Get handler -$modules_Handler = $xoops->getModuleHandler('modules'); -$tables_Handler = $xoops->getModuleHandler('tables'); -$import_Handler = $xoops->getModuleHandler('import'); -$fields_Handler = $xoops->getModuleHandler('fields'); -$fieldtype_Handler = $xoops->getModuleHandler('fieldtype'); -$fieldattrs_Handler = $xoops->getModuleHandler('fieldattributes'); -$fieldnull_Handler = $xoops->getModuleHandler('fieldnull'); -$fieldkey_Handler = $xoops->getModuleHandler('fieldkey'); -$fieldelements_Handler = $xoops->getModuleHandler('fieldelements'); +$modules_Handler = $helper->getHandlerModules(); +$tables_Handler = $helper->getHandlerTables(); +$import_Handler = $helper->getHandlerImport(); +$fields_Handler = $helper->getHandlerFields(); +// Get $_POST, $_GET, $_REQUEST +$op = $request->asStr('op', 'list'); +$start = $request->asInt('start', 0); +// Parameters +$nb_pager = $helper->getConfig('adminpager'); // Get admin menu istance $admin_menu = new XoopsModuleAdmin(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/import.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -23,6 +23,7 @@ $nb_pager = $xoops->getModuleConfig('pager'); // Get Action type $op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); +$import_id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); // Get limit pager $limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); // Get start pager @@ -37,7 +38,7 @@ switch ($op) { case 'list': - $admin_menu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'import.php?op=import', 'add'); + $admin_menu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'import.php?op=new', 'add'); $admin_menu->renderButton(); // Get modules list $criteria = new CriteriaCompo(); @@ -45,12 +46,12 @@ $criteria->setOrder('ASC'); $criteria->setStart($start); $criteria->setLimit($nb_pager); - $numrows = $import_Handler->getCount($criteria); + $num_imports = $import_Handler->getCount($criteria); $import_arr = $import_Handler->getAll($criteria); // Assign Template variables - $xoops->tpl()->assign('import_count', $numrows); + $xoops->tpl()->assign('imports_count', $num_imports); unset($criteria); - if ($numrows > 0) { + if ($num_imports > 0) { foreach (array_keys($import_arr) as $i) { $import['id'] = $import_arr[$i]->getVar('import_id'); $import['mid'] = $import_arr[$i]->getVar('import_mid'); @@ -70,7 +71,7 @@ } break; - case 'import': + case 'new': $admin_menu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'import.php', 'application-view-detail'); $admin_menu->renderButton(); @@ -83,83 +84,121 @@ if (!$xoops->security()->check()) { $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); } - $id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); - if ($id > 0) { - $obj = $import_Handler->get($id); + + if ($import_id > 0) { + $obj = $import_Handler->get($import_id); + //Form imported edited save + $obj->setVar('import_mid', $_POST['import_mid']); + $obj->setVar('import_name', $_POST['import_name']); + $obj->setVar('import_nbtables', $_POST['import_nbtables']); + $obj->setVar('import_tablename', $_POST['import_mid']); + $obj->setVar('import_nbfields', $_POST['import_nbfields']); + $obj->setVar('import_fieldelements', $_POST['import_fieldelements']); } else { $obj = $import_Handler->create(); - } - - $files = $_FILES['importfile']; - // If incoming data have been entered correctly - if($_POST['upload'] == _SUBMIT && isset($files['tmp_name']) && (substr($files['name'], -4) == '.sql')) - { - // File recovery - $dir = TDMC_UPLOAD_PATH_FILES; - $file = $_FILES['importfile']; - $tmp_name = $file['tmp_name']; - // Copy files to the server - if (is_uploaded_file($tmp_name)) { - readfile($tmp_name); - // The directory where you saved the file - if ($file['error'] == UPLOAD_ERR_OK) { - $name = $file['name']; - move_uploaded_file($tmp_name, $dir.'/'.$name); + //Form imported save + $obj->setVar('import_name', $_POST['import_name']); + $obj->setVar('import_mid', $_POST['import_mid']); + $files = $_FILES['importfile']; + // If incoming data have been entered correctly + if($_POST['upload'] == XoopsLocale::A_SUBMIT && isset($files['tmp_name']) && (substr($files['name'], -4) == '.sql')) + { + // File recovery + $dir = TDMC_UPLOAD_PATH_FILES; + $file = $_FILES['importfile']; + $tmp_name = $file['tmp_name']; + // Copy files to the server + if (is_uploaded_file($tmp_name)) { + readfile($tmp_name); + // The directory where you saved the file + if ($file['error'] == UPLOAD_ERR_OK) { + $name = $file['name']; + move_uploaded_file($tmp_name, $dir.'/'.$name); + } + } else { + $xoops->redirect('import.php', 3, sprintf(TDMCreateLocale::E_FILE_NOT_UPLOADING, $file['tmp_name'])); + } + + // Copies data in the db + $filename = $dir.'/'.$name; + // File size + $filesize = $files['size']; + // Check that the file was inserted and that there is + if ( ($handle = fopen($filename, 'r') ) !== false) + { + // File reading until at the end + while ( !feof( $handle )) + { + $buffer = fgets($handle, filesize($filename)); + if(strlen($buffer) > 1) + { + // search all comments + $search = array ( '/\/\*.*(\n)*.*(\*\/)?/', '/\s*--.*\n/', '/\s*#.*\n/' ); + // and replace with null + $replace = array ( "\n" ); + $buffer = preg_replace($search, $replace, $buffer); + $buffer = str_replace('`', '', $buffer); + $buffer = str_replace(',', '', $buffer); + + preg_match_all('/((\s)*(CREATE TABLE)(\s)+(.*)(\s)+(\())/', $buffer, $tablematch); // table name ... (match) + if(count($tablematch[0]) > 0) + array_push( $res_table, $tablematch[5][0] ); + /*preg_match_all('/((\()(\s)+([a-z_]+)(\s)*(.*)(\())/', $buffer, $fieldsmatch); // fields ... (match) + if(count($fieldsmatch[0]) > 0) + array_push( $res_fields, $fieldsmatch[4][0] ); */ + /*preg_match_all('/((\()(\s)+([a-z_]+)(\s)*(.*)(\())/', $buffer, $typematch); // type ... (match) + if(count($typematch[0]) > 0) + array_push( $res_keys, $typematch[6][0] ); */ + /*preg_match_all('/(\s)(\((.*)\))/', $buffer, $typevmatch); // type value ... (match) + if(count($typevmatch[0]) > 0) + array_push( $res_keys, $typevmatch[4][0] ); */ + /*preg_match_all('/(\s)(\((.*)\))/', $buffer, $unsmatch); // unsigned ... (match) + if(count($unsmatch[0]) > 0) + array_push( $res_unsigned, $unsmatch[4][0] ); */ + /*preg_match_all('/(\s)(\((.*)\))/', $buffer, $nullmatch); // NOT NULL ... (match) + if(count($nullmatch[0]) > 0) + array_push( $res_null, $nullmatch[4][0] ); */ + /*preg_match_all('/(\s)(\((.*)\))/', $buffer, $defaultmatch); // default ... (match) + if(count($defaultmatch[0]) > 0) + array_push( $res_keys, $defaultmatch[4][0] ); */ + /*preg_match_all('/(\s)(\((.*)\))/', $buffer, $defaultvmatch); // default value ... (match) + if(count($defaultvmatch[0]) > 0) + array_push( $res_keys, $defaultvmatch[4][0] ); */ + } else { + $xoops->redirect('import.php', 3, sprintf(TDMCreateLocale::E_SQL_FILE_DATA_NOT_MATCH, $buffer)); + } + } + + // Insert query + if(strlen($res_table[0]) > 0) + { + $t = 0; + foreach(array_keys($res_table) as $table) + { + $obj->setVar('import_tablename', $res_table[$table]); //$_POST['import_tablename'] + $obj->setVar('import_nbtables', $t); $t++; //$_POST['import_nbtables'] + if(strlen($res_table[0]) > 0) + { + $f = 0; + foreach(array_keys($res_fields) as $field) + { + $obj->setVar('import_nbfields', $f); $f++; // $_POST['import_nbfields'] + $obj->setVar('import_fieldelements', $_POST['import_fieldelements']); + } + unset($f); + } + } + unset($t); + } + } else { + $xoops->redirect('import.php', 3, TDMCreateLocale::E_FILE_NOT_OPEN_READING); } + $xoops->redirect('import.php', 3, TDMCreateLocale::S_DATA_ENTERED); + fclose($handle); } else { - $xoops->redirect('import.php', 3, 'Error in file upload:'. $file['tmp_name']); - } - - // Copies data in the db - $filename = $dir.'/'.$name; - // File size - $filesize = $files['size']; - // Check that the file was inserted and that there is - if ( ($handle = fopen($filename, 'r') ) !== false) - { - // File reading until at the end - while ( !feof( $handle )) - { - // Use the fgets function to retrieve the information in the sql file - // The second parameter is the size of the file, we have recovered over - $row = fgets($handle, $filesize); // reads the entire row for the whole file - if(strlen($row) > 1) - { - // change the ' and ; in null - $search = array ( '/\/\*.*(\n)*.*(\*\/)?/', '/\s*--.*\n/', '/\s*#.*\n/' ); - // replace in null - $replace = array ( "\n" ); - $row = preg_replace($search, $replace, $row); - // I'll put your details in the row into an array divided by separator - $arrayrow = explode( ',\n', $row); - $arrayrow = preg_replace('/\s/', ' ', $arrayrow); - // Insert query - if(strlen($arrayrow[0]) > 0) { - preg_match_all('/([A-Za-z0-9_=]+?[^\,\;\(\)$])/Ui', $row, $matches); - for ($i = 0; $i < count($matches[0]); $i++) { - //Form imported save - $obj->setVars(array('import_mid' => $_POST['import_mid'], 'import_name' => $_POST['import_name'], - 'import_nbtables' => $i, 'import_tablename' => $matches[0][$i], - 'import_nbfields' => $matches[0][$i], 'import_fieldname' => $matches[0][$i], - 'import_fieldtype' => $matches[0][$i], 'import_fieldvalue' => $matches[0][$i], - 'import_nbfieldefault' => $matches[0][$i])); - }///**/ - } else { - $xoops->redirect('import.php?op=list', 3, 'Error: data in sql file do not match. Row: '.$row); - } - } - // reset for the next insertion - $arrayrow = array_slice($arrayrrow, 0, 0); - $row = ''; - } - } else { - $xoops->redirect('import.php', 3, 'Could not open file for reading!'); - } - $xoops->redirect('import.php', 3, 'Data entered successfull!'); - fclose($handle); - } else { - $xoops->redirect('import.php', 3, 'Not sql file or data entered!'); - } + $xoops->redirect('import.php', 3, TDMCreateLocale::E_DATABASE_SQL_FILE_NOT_IMPORTED); + } + } if ($import_Handler->insert($obj)) { $xoops->redirect('import.php', 3, TDMCreateLocale::FORM_OK); @@ -175,15 +214,14 @@ $admin_menu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'import.php', 'application-view-detail'); $admin_menu->renderButton(); - $obj = $import_Handler->get($system->cleanVars($_REQUEST, 'import_id', 0, 'int')); + $obj = $import_Handler->get($import_id); $form = $xoops->getModuleForm($obj, 'import'); $xoops->tpl()->assign('form', $form->render()); break; case 'delete': - $id = $system->cleanVars($_REQUEST, 'import_id', 0, 'int'); - if ($id > 0) { - $obj = $import_Handler->get($id); + if ($import_id > 0) { + $obj = $import_Handler->get($import_id); if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { $xoops->redirect('import.php', 3, implode(',', $xoops->security()->getErrors())); @@ -194,7 +232,7 @@ $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $id, 'op' => 'delete'), 'import.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('import_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $import_id, 'op' => 'delete'), 'import.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('import_name')) . '<br />'); } } else { $xoops->redirect('import.php', 1, TDMCreateLocale::E_DATABASE_ERROR); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -19,19 +19,10 @@ * @version $Id: modules.php 10665 2012-12-27 10:14:15Z timgno $ */ include dirname(__FILE__) . '/header.php'; -// Preferences Limit -$nb_pager = $xoops->getModuleConfig('adminpager'); // Get Action type -$op = $system->cleanVars($_REQUEST, 'op', 'list', 'string'); $mod_id = $system->cleanVars($_REQUEST, 'mod_id', 0, 'int'); -// Get limit pager -$limit = $system->cleanVars($_REQUEST, 'limit', 0, 'int'); -// Get start pager -$start = $system->cleanVars($_REQUEST, 'start', 0, 'int'); // Get handler $xoops->header('tdmcreate_modules.html'); -/* @var $modules_handler TDMCreateModulesHandler */ -$modules_Handler = $xoops->getModuleHandler('modules'); $admin_menu->renderNavigation('modules.php'); switch ($op) @@ -91,29 +82,35 @@ if (!$xoops->security()->check()) { $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); } - + $mod_id = $request->asInt('mod_id', 0); if ($mod_id > 0) { $obj = $modules_Handler->get($mod_id); } else { $obj = $modules_Handler->create(); } //Form module save - $obj->setVars(array('mod_name' => $_POST['mod_name'], 'mod_isextension' => (($_REQUEST['mod_isextension'] == 1) ? '1' : '0'), - 'mod_version' => $_POST['mod_version'], 'mod_description' => $_POST['mod_description'], - 'mod_author' => $_POST['mod_author'], 'mod_author_mail' => $_POST['mod_author_mail'], - 'mod_author_website_url' => $_POST['mod_author_website_url'], - 'mod_author_website_name' => $_POST['mod_author_website_name'], 'mod_credits' => $_POST['mod_credits'], - 'mod_license' => $_POST['mod_license'], 'mod_release_info' => $_POST['mod_release_info'], - 'mod_release_file' => $_POST['mod_release_file'], 'mod_manual' => $_POST['mod_manual'], - 'mod_manual_file' => $_POST['mod_manual_file'])); + $obj->setVars(array('mod_name' => $request->asStr('mod_name', ''), + 'mod_isextension' => $request->asInt('mod_isextension', 0), + 'mod_version' => $request->asStr('mod_version', ''), + 'mod_description' => $request->asStr('mod_description', ''), + 'mod_author' => $request->asStr('mod_author', ''), + 'mod_author_mail' => $request->asStr('mod_author_mail', ''), + 'mod_author_website_url' => $request->asStr('mod_author_website_url', ''), + 'mod_author_website_name' => $request->asStr('mod_author_website_name', ''), + 'mod_credits' => $request->asStr('mod_credits', ''), + 'mod_license' => $request->asStr('mod_license', ''), + 'mod_release_info' => $request->asStr('mod_release_info', ''), + 'mod_release_file' => $request->asStr('mod_release_file', ''), + 'mod_manual' => $request->asStr('mod_manual', ''), + 'mod_manual_file' => $request->asStr('mod_manual_file', ''))); //Form module_image - $uploader = new XoopsMediaUploader( TDMC_MODULES_PATH_IMG, $xoops->getModuleConfig('mimetypes'), - $xoops->getModuleConfig('maxuploadsize'), null, null); - if ($uploader->fetchMedia($_POST['modules_image'][0])) { - $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['modules_image']['name']); - $name_img = 'logo.'.$extension; - $uploader->setPrefix($name_img); - $uploader->fetchMedia($_POST['modules_image'][0]); + $uploader = new XoopsMediaUploader( TDMC_MODULES_PATH_IMG, $helper->getConfig('mimetypes'), + $helper->getConfig('maxuploadsize'), null, null); + if ($uploader->fetchMedia('xoops_upload_file')) { + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['xoops_upload_file']['name']); + $img_name = 'logo.'.$extension; + $uploader->setPrefix($img_name); + $uploader->fetchMedia('xoops_upload_file'); if (!$uploader->upload()) { $xoops->redirect('javascript:history.go(-1)',3, $uploader->getErrors()); } else { @@ -128,21 +125,25 @@ } //Form module save - $obj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'], 'mod_demo_site_name' => $_POST['mod_demo_site_name'], - 'mod_support_url' => $_POST['mod_support_url'], 'mod_support_name' => $_POST['mod_support_name'], - 'mod_website_url' => $_POST['mod_website_url'], 'mod_website_name' => $_POST['mod_website_name'], - 'mod_release' => $_POST['mod_release'], 'mod_status' => $_POST['mod_status'], - 'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'), - 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'), - 'mod_submenu' => (($_REQUEST['mod_submenu'] == 1) ? '1' : '0'), - 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'), - 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'), - 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'), - 'mod_paypal' => $_POST['mod_paypal'], - 'mod_subversion' => $_POST['mod_subversion'])); + $obj->setVars(array('mod_demo_site_url' => $request->asStr('mod_demo_site_url', ''), + 'mod_demo_site_name' => $request->asStr('mod_demo_site_name', ''), + 'mod_support_url' => $request->asStr('mod_support_url', ''), + 'mod_support_name' => $request->asStr('mod_support_name', ''), + 'mod_website_url' => $request->asStr('mod_website_url', ''), + 'mod_website_name' => $request->asStr('mod_website_name', ''), + 'mod_release' => $request->asStr('mod_release', ''), + 'mod_status' => $request->asStr('mod_status', ''), + 'mod_admin' => $request->asInt('mod_admin', 0), + 'mod_user' => $request->asInt('mod_user', 0), + 'mod_submenu' => $request->asInt('mod_submenu', 0), + 'mod_search' => $request->asInt('mod_search', 0), + 'mod_comments' => $request->asInt('mod_comments', 0), + 'mod_notifications' => $request->asInt('mod_notifications', 0), + 'mod_paypal' => $request->asStr('mod_paypal', ''), + 'mod_subversion' => $request->asStr('mod_subversion', ''))); // Insert Data if ($modules_Handler->insert($obj)) { - $xoops->redirect('modules.php?op=list', 2, XoopsLocale::S_DATA_INSERTED); + $xoops->redirect('modules.php', 2, XoopsLocale::S_DATA_INSERTED); } // Form Data $xoops->error($obj->getHtmlErrors()); @@ -154,13 +155,18 @@ $admin_menu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); $admin_menu->addItemButton(TDMCreateLocale::MODULES_LIST, 'modules.php', 'application-view-detail'); $admin_menu->renderButton(); - - $obj = $modules_Handler->get($system->cleanVars($_REQUEST, 'mod_id', 0, 'int')); - $form = $xoops->getModuleForm($obj, 'modules'); - $xoops->tpl()->assign('form', $form->render()); + $mod_id = $request->asInt('mod_id', 0); + if ($mod_id > 0) { + $obj = $modules_Handler->get($mod_id); + $form = $helper->getForm($obj, 'modules'); + $xoops->tpl()->assign('form', $form->render()); + } else { + $xoops->redirect('modules.php', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); + } break; - case 'delete': + case 'delete': + $mod_id = $request->asInt('mod_id', 0); if ($mod_id > 0) { $obj = $modules_Handler->get($mod_id); if (isset($_POST['ok']) && $_POST['ok'] == 1) { @@ -173,7 +179,7 @@ $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $mod_id, 'op' => 'delete'), 'modules.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('mod_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), 'modules.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('mod_name')) . '<br />'); } } else { $xoops->redirect('modules.php', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -68,8 +68,7 @@ unset($criteria); // Assign Template variables - $xoops->tpl()->assign('mods_count', $numrows_mods); - $mytree = new XoopsObjectTree($table_arr, 'table_id', 'table_mid'); + $xoops->tpl()->assign('mods_count', $numrows_mods); if ($numrows_mods > 0) { foreach (array_keys($mod_arr) as $i) { $mod['id'] = $mod_arr[$i]->getVar('mod_id'); @@ -85,26 +84,27 @@ $mod['comments'] = $mod_arr[$i]->getVar('mod_comments'); $mod['notifications'] = $mod_arr[$i]->getVar('mod_notifications'); $xoops->tpl()->append_by_ref('modules', $mod); - unset($mod); - if ($numrows_tables > 0) { - foreach (array_keys($table_arr) as $i) { - $tables['id'] = $table_arr[$i]->getVar('table_id'); - $tables['name'] = $table_arr[$i]->getVar('table_name'); - $tables['mid'] = TDMCreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name'); - $tables['image'] = $table_arr[$i]->getVar('table_image'); - $tables['nbfields'] = $table_arr[$i]->getVar('table_nbfields'); - $tables['blocks'] = $table_arr[$i]->getVar('table_blocks'); - $tables['admin'] = $table_arr[$i]->getVar('table_admin'); - $tables['user'] = $table_arr[$i]->getVar('table_user'); - $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); - $tables['search'] = $table_arr[$i]->getVar('table_search'); - $tables['comments'] = $table_arr[$i]->getVar('table_comments'); - $tables['notifications'] = $table_arr[$i]->getVar('table_notifications'); - $xoops->tpl()->append_by_ref('tables', $tables); - unset($tables); - } + unset($mod); + } + if ($numrows_tables > 0) { + foreach (array_keys($table_arr) as $i) { + $tables['id'] = $table_arr[$i]->getVar('table_id'); + $tables['name'] = $table_arr[$i]->getVar('table_name'); + $module_name = $modules_Handler->get($table_arr[$i]->getVar('table_mid')); + $tables['mid'] = $module_name->getVar('mod_name'); + $tables['image'] = $table_arr[$i]->getVar('table_image'); + $tables['nbfields'] = $table_arr[$i]->getVar('table_nbfields'); + $tables['blocks'] = $table_arr[$i]->getVar('table_blocks'); + $tables['admin'] = $table_arr[$i]->getVar('table_admin'); + $tables['user'] = $table_arr[$i]->getVar('table_user'); + $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); + $tables['search'] = $table_arr[$i]->getVar('table_search'); + $tables['comments'] = $table_arr[$i]->getVar('table_comments'); + $tables['notifications'] = $table_arr[$i]->getVar('table_notifications'); + $xoops->tpl()->append_by_ref('tables', $tables); + unset($tables); } - } + } // Display Page Navigation if ($numrows_mods > $nb_pager) { $nav = new XoopsPageNav($numrows_mods, $nb_pager, $start, 'start'); @@ -135,7 +135,7 @@ $obj = $tables_Handler->create(); } //Form tables - $obj->setVars(array('table_mid' => $_POST['table_mid'], 'table_name' => $_POST['table_name'], + $obj->setVars(array('table_mid' => $request->asInt('mod_id', 0), 'table_name' => $_POST['table_name'], 'table_nbfields' => $_POST['table_nbfields'], 'table_fieldname' => $_POST['table_fieldname'])); //Form table_image $pathIcon32 = XOOPS_ROOT_PATH . '/media/xoops/images/icons/32'; @@ -170,7 +170,7 @@ if( $tables_Handler->insert($obj) ) { if( $obj->isNew() ) - $xoops->redirect('fields.php?op=new&fields_tid='.$obj->getVar('table_id'), 3, XoopsLocale::S_DATA_INSERTED); + $xoops->redirect('fields.php?op=new&tid='.$obj->getVar('table_id'), 3, XoopsLocale::S_DATA_INSERTED); else $xoops->redirect('tables.php', 3, XoopsLocale::S_DATABASE_UPDATED); } @@ -190,7 +190,7 @@ $xoops->tpl()->assign('form', $form->render()); break; - case 'delete': + case 'delete': if ($table_id > 0) { $obj = $tables_Handler->get($table_id); if (isset($_POST['ok']) && $_POST['ok'] == 1) { Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/extensions.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -1,75 +0,0 @@ -<?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 TDM Xoops (AKA Developers) - * @version $Id: extensions.php 10665 2012-12-27 10:14:15Z timgno $ - */ -defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); - -class TDMCreateExtensions extends XoopsObject -{ - /** - * Constructor - */ - public function __construct() - { - $xoops = Xoops::getInstance(); - - $this->initVar('ext_id', XOBJ_DTYPE_INT, null, true); - $this->initVar('ext_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('name')); - $this->initVar('ext_version',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('version')); - $this->initVar('ext_description',XOBJ_DTYPE_TXTAREA, $xoops->getModuleConfig('description')); - $this->initVar('ext_author',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author')); - $this->initVar('ext_author_mail',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_email')); - $this->initVar('ext_author_website_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website_url')); - $this->initVar('ext_author_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('author_website')); - $this->initVar('ext_credits',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('credits')); - $this->initVar('ext_license',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('license')); - $this->initVar('ext_release_info',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_info')); - $this->initVar('ext_release_file',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release_file')); - $this->initVar('ext_manual',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual')); - $this->initVar('ext_manual_file',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('manual_file')); - $this->initVar('ext_image',XOBJ_DTYPE_TXTBOX, null); - $this->initVar('ext_demo_site_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_url')); - $this->initVar('ext_demo_site_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('demo_site_name')); - $this->initVar('ext_forum_site_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_url')); - $this->initVar('ext_forum_site_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('forum_site_name')); - $this->initVar('ext_website_url',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_url')); - $this->initVar('ext_website_name',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('website_name')); - $this->initVar('ext_release',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('release')); - $this->initVar('ext_status',XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('status')); - $this->initVar('ext_admin',XOBJ_DTYPE_INT,$xoops->getModuleConfig('display_admin')); - $this->initVar('ext_user',XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_user')); - $this->initVar('ext_submenu', XOBJ_DTYPE_INT, $xoops->getModuleConfig('display_submenu')); - $this->initVar('ext_search',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_search')); - $this->initVar('ext_comments',XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_comments')); - $this->initVar('ext_notifications', XOBJ_DTYPE_INT, $xoops->getModuleConfig('active_notifies')); - $this->initVar('ext_paypal_button', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('paypal_button')); - $this->initVar('ext_subversion', XOBJ_DTYPE_TXTBOX, $xoops->getModuleConfig('subversion')); - } -} - -class TDMCreateExtensionsHandler extends XoopsPersistableObjectHandler -{ - /** - * @param null|XoopsDatabase $db - */ - public function __construct(XoopsDatabase $db = null) - { - parent::__construct($db, 'tdmcreate_extensions', 'tdmcreateextensions', 'ext_id', 'ext_name'); - } -} \ No newline at end of file Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/extensions.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -1,124 +0,0 @@ -<?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 TDM Xoops (AKA Developers) - * @version $Id$ - */ -defined('XOOPS_ROOT_PATH') or die("XOOPS root path not defined"); - -class TDMCreateExtensionsForm extends XoopsThemeForm -{ - /** - * @param TDMCreateExtensions|XoopsObject $obj - */ - public function __construct(TDMCreateExtensions &$obj) - { - $xoops = Xoops::getInstance(); - - $title = $obj->isNew() ? sprintf(TDMCreateLocale::ADD_EXTENSION) : sprintf(TDMCreateLocale::EDIT_EXTENSION); - - parent::__construct($title, 'form', 'extensions.php', 'post', true); - $this->setExtra('enctype="multipart/form-data"'); - - $this->insertBreak('<div class="center"><b>'.TDMCreateLocale::IMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(XoopsLocale::C_NAME, 'ext_name', 50, 255, $obj->getVar('ext_name')), true); - $this->addElement(new XoopsFormText(XoopsLocale::C_VERSION, 'ext_version', 2, 5, $obj->getVar('ext_version')), true); - $editor_configs=array(); - $editor_configs['name'] = 'ext_description'; - $editor_configs['value'] = $obj->getVar('ext_description', 'e'); - $editor_configs['rows'] = 5; - $editor_configs['cols'] = 80; - $editor_configs['width'] = '100%'; - $editor_configs['height'] = '400px'; - $editor_configs['editor'] = $xoops->getModuleConfig('editor'); - $this->addElement( new XoopsFormEditor(XoopsLocale::C_DESCRIPTION, 'ext_description', $editor_configs), true ); - $this->addElement(new XoopsFormText(XoopsLocale::C_AUTHOR, 'ext_author', 50, 255, $obj->getVar('ext_author')), true); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_LICENSE, 'ext_license', 50, 255, $obj->getVar('ext_license')), true); - $option_tray = new XoopsFormElementTray(XoopsLocale::OPTIONS, ' '); - $display_admin = $obj->isNew() ? 0 : $obj->getVar('ext_admin'); - $check_display_admin = new XoopsFormCheckBox(' ', 'ext_admin', $display_admin); - $check_display_admin->addOption(1, TDMCreateLocale::C_ADMIN); - $option_tray->addElement($check_display_admin); - $display_user = $obj->isNew() ? 0 : $obj->getVar('ext_user'); - $check_display_user = new XoopsFormCheckBox(' ', 'ext_user', $display_user); - $check_display_user->addOption(1, TDMCreateLocale::C_USER); - $option_tray->addElement($check_display_user); - $display_submenu = $obj->isNew() ? 0 : $obj->getVar('ext_submenu'); - $check_display_submenu = new XoopsFormCheckBox(' ', 'ext_submenu', $display_submenu); - $check_display_submenu->addOption(1, TDMCreateLocale::C_SUBMENU); - $option_tray->addElement($check_display_submenu); - $active_search = $obj->isNew() ? 0 : $obj->getVar('ext_search'); - $check_active_search = new XoopsFormCheckBox(' ', 'ext_search', $active_search); - $check_active_search->addOption(1, TDMCreateLocale::C_SEARCH); - $option_tray->addElement($check_active_search); - $active_comments = $obj->isNew() ? 0 : $obj->getVar('ext_comments'); - $check_active_comments = new XoopsFormCheckBox(' ', 'ext_comments', $active_comments); - $check_active_comments->addOption(1, TDMCreateLocale::C_COMMENTS); - $option_tray->addElement($check_active_comments); - $active_notifies = $obj->isNew() ? 0 : $obj->getVar('ext_notifications'); - $check_active_notifies = new XoopsFormCheckBox(' ', 'ext_notifications', $active_notifies); - $check_active_notifies->addOption(1, TDMCreateLocale::C_NOTIFICATIONS); - $option_tray->addElement($check_active_notifies); - $this->addElement($option_tray); - - $ext_image = $obj->getVar('ext_image') ? $obj->getVar('ext_image') : 'default_slogo.png'; - $uploadir = 'uploads/tdmcreate/images/extensions'; - $imgtray = new XoopsFormElementTray(TDMCreateLocale::C_IMAGE,'<br />'); - $imgpath = sprintf(TDMCreateLocale::CF_IMAGE_PATH, './'.$uploadir.'/'); - $imageselect = new XoopsFormSelect($imgpath, 'extensions_image', $ext_image); - $image_array = XoopsLists::getImgListAsArray( XOOPS_ROOT_PATH.'/'.$uploadir ); - foreach( $image_array as $image ) { - $imageselect->addOption("$image", $image); - } - $imageselect->setExtra( "onchange='showImgSelected(\"image3\", \"extensions_image\", \"".$uploadir."\", \"\", \"".XOOPS_URL."\")'" ); - $imgtray->addElement($imageselect); - $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadir."/".$ext_image."' name='image3' id='image3' alt='' />" ) ); - $fileseltray = new XoopsFormElementTray('','<br />'); - $fileseltray->addElement(new XoopsFormFile(XoopsLocale::A_UPLOAD, 'extensions_image', $xoops->getModuleConfig('maxuploadsize'))); - $fileseltray->addElement(new XoopsFormLabel('')); - $imgtray->addElement($fileseltray); - $this->addElement($imgtray); - - $this->insertBreak('<div class="center"><b>'.TDMCreateLocale::NOT_IMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_MAIL, 'ext_author_mail', 50, 255, $obj->getVar('ext_author_mail'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_WEBSITE_URL, 'ext_author_website_url', 50, 255, $obj->getVar('ext_author_website_url'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_WEBSITE_NAME, 'ext_author_website_name', 50, 255, $obj->getVar('ext_author_website_name'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_CREDITS, 'ext_credits', 50, 255, $obj->getVar('ext_credits'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE_INFO, 'ext_release_info', 50, 255, $obj->getVar('ext_release_info'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE_FILE, 'ext_release_file', 50, 255, $obj->getVar('ext_release_file'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_MANUAL, 'ext_manual', 50, 255, $obj->getVar('ext_manual'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_MANUAL_FILE, 'ext_manual_file', 50, 255, $obj->getVar('ext_manual_file'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_DEMO_SITE_URL, 'ext_demo_site_url', 50, 255, $obj->getVar('ext_demo_site_url'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_DEMO_SITE_NAME, 'ext_demo_site_name', 50, 255, $obj->getVar('ext_demo_site_name'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_FORUM_SITE_URL, 'ext_forum_site_url', 50, 255, $obj->getVar('ext_forum_site_url'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_FORUM_SITE_NAME, 'ext_forum_site_name', 50, 255, $obj->getVar('ext_forum_site_name'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_WEBSITE_URL, 'ext_website_url', 50, 255, $obj->getVar('ext_website_url'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_WEBSITE_NAME, 'ext_website_name', 50, 255, $obj->getVar('ext_website_name'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE, 'ext_release', 50, 255, $obj->getVar('ext_release'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_STATUS, 'ext_status', 50, 255, $obj->getVar('ext_status'))); - - $this->addElement(new XoopsFormText(TDMCreateLocale::C_PAYPAL_BUTTON, 'ext_paypal_button', 50, 255, $obj->getVar('ext_paypal_button'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_SUBVERSION, 'ext_subversion', 5, 25, $obj->getVar('ext_subversion'))); - - if (!$obj->isNew()) { - $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('ext_id') ) ); - } - $this->addElement(new XoopsFormHidden('op', 'save' ) ); - $this->addElement(new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit' ) ); - } -} \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php 2013-02-20 20:29:40 UTC (rev 11083) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php 2013-02-20 22:12:11 UTC (rev 11084) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - /** * tdmcreate module * @@ -28,144 +27,140 @@ */ public function __construct(TDMCreateFields &$obj) { - $xoops = Xoops::getInstance(); - - $title = $obj->isNew() ? sprintf(TDMCreateLocale::ADD_FIELD) : sprintf(TDMCreateLocale::EDIT_FIELD); - + $system = System::getInstance(); + $xoops = Xoops::getInstance(); + $request = $xoops->request(); + + $title = $obj->isNew() ? sprintf(TDMCreateLocale::ADD_FIELDS) : sprintf(TDMCreateLocale::EDIT_FIELDS); + parent::__construct($title, 'form', false, 'post', true); $this->setExtra('enctype="multipart/form-data"'); - - // New Object HtmlTable - /*$tableForm = new TDMCreate_HtmlTable(null, 'display outer'); - // header row - $tableForm->addRow('center bgblue'); - $cells = array(TDMCreateLocale::FIELD_NUMBER, TDMCreateLocale::FIELD_NAME, TDMCreateLocale::FIELD_TYPE, TDMCreateLocale::FIELD_VALUE, TDMCreateLocale::FIELD_ATTRIBUTE, TDMCreateLocale::FIELD_NULL, TDMCreateLocale::FIELD_DEFAULT, TDMCreateLocale::FIELD_KEY, TDMCreateLocale::FIELD_OTHERS); - $tableForm->addCells($cells, 'first', 'header'); - - $tables_Handler = $xoops->getModuleHandler('tables'); - $criteria = new CriteriaCompo(new Criteria('table_name', $obj->getVar('table_name'))); - $criteria->add(new Criteria('table_nbfields', $obj->getVar('table_nbfields'))); - $nb_fields = $tablesHandler->getAll($criteria); + + $tables_Handler = $xoops->getModuleHandler('tables'); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('table_id', 0, '!=')); + $criteria->setSort('table_name'); + $criteria->setOrder('ASC'); + $tables_arr = $tables_Handler->getAll($criteria); unset($criteria); - for($i = 1; $i <= count($nb_fields); $i++) - { - $field_name = $this->isNew() ? $obj->getVar('table_fieldname') : $obj->getVar('field_name'); - $field_name = new XoopsFormText(TDMCreateLocale::FIELD_NAME, 'field_name', 15, 255, $field_name); - // fieldtype - $fieldtypeHandler=& xoops_getModuleHandler('tdmcreate_fieldtype'); - $fieldtype_select = new XoopsFormSelect(TDMCreateLocale::FIELD_TYPE, 'field_type', $obj->getVar('field_type')); - $fieldtype_select->addOptionArray($fieldtypeHandler->getList()); - // fieldvalue - $field_value = new XoopsFormText(TDMCreateLocale::FIELD_VALUE, 'field_value', 5, 20, $obj->getVar('field_value')); - // fieldattributes - $fieldattrsHandler=& xoops_getModuleHandler('tdmcreate_fieldattributes'); - $field_attributes_select = new XoopsFormSelect(TDMCreateLocale::FIELD_TYPE, 'field_attribute', $obj->getVar('field_attribute')); - $field_attributes_select->addOptionArray($fieldattrsHandler->getList()); - // fieldnull - $fieldnullHandler=& xoops_getModuleHandler('tdmcreate_fieldnull'); - $field_null_select = new XoopsFormSelect(TDMCreateLocale::FIELD_NULL, 'field_null', $obj->getVar('field_null')); - $field_null_select->addOptionArray($fieldnullHandler->getList()); - // fielddefault - $field_default = new XoopsFormText(TDMCreateLocale::FIELD_DEFAULT, 'field_default', 15, 25, $obj->getVar('field_default')); - //... [truncated message content] |
From: <txm...@us...> - 2013-03-17 10:48:07
|
Revision: 11243 http://sourceforge.net/p/xoops/svn/11243 Author: txmodxoops Date: 2013-03-17 10:48:02 +0000 (Sun, 17 Mar 2013) Log Message: ----------- Fixed bugs Added jquery ui tabs on class/form/modules.php Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -21,9 +21,10 @@ include dirname(__FILE__) . '/header.php'; $field_id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); -$field_tid = $system->cleanVars($_REQUEST, 'field_tid', 0, 'int'); -$table_id = $system->cleanVars($_REQUEST, 'table_id', 0, 'int'); -$table_nbfields = $system->cleanVars($_REQUEST, 'table_nbfields', 0, 'int'); +$field_mid = $system->cleanVars($_REQUEST, 'field_mid', 0, 'int'); +$field_tid = $system->cleanVars($_REQUEST, 'field_tid', 0, 'int'); +$field_numb = $system->cleanVars($_REQUEST, 'field_numb', 0, 'int'); +$field_name = $system->cleanVars($_REQUEST, 'field_name', 0, 'int'); // Get handler $xoops->header('tdmcreate_fields.html'); @@ -36,8 +37,8 @@ $admin_menu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); $admin_menu->renderButton(); // Get modules list - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('table_id', 0, '!=')); + $criteria = new CriteriaCompo(new Criteria('table_mid', $field_mid)); + $criteria->add(new Criteria('table_id', $field_tid)); $criteria->setSort('table_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); @@ -51,7 +52,7 @@ $xoops->redirect('modules.php?op=new', 2, TDMCreateLocale::NOTMODULES ); }*/ $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('field_tid', 0, '!=')); + $criteria->add(new Criteria('field_tid', $field_tid)); $criteria->setSort('field_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); @@ -61,9 +62,7 @@ unset($criteria); // Assign Template variables $xoops->tpl()->assign('fields_list', true); - $xoops->tpl()->assign('fields_count', $numrows_fields); - /*$mytree = new XoopsObjectTree($table_arr, 'table_id', 'table_mid'); - tdmcreate_getPathTree($mytree, $table_arr[$i]->getVar('table_mid'), $table_arr, 'table_name');*/ + $xoops->tpl()->assign('fields_count', $numrows_fields); if ($numrows_tables > 0) { foreach (array_keys($table_arr) as $i) { $tables['id'] = $table_arr[$i]->getVar('table_id'); @@ -129,20 +128,21 @@ $obj = $fields_Handler->get($field_id); } else { $obj = $fields_Handler->create(); - } + } //Form fields - $obj->setVars(array('field_tid' => $_POST['field_tid'], 'field_name' => $_POST['field_name'], - 'field_type' => $_POST['field_type'], 'field_value' => $_POST['field_value'], - 'field_attribute' => $_POST['field_attribute'], 'field_null' => $_POST['field_null'], - 'field_default' => $_POST['field_default'], 'field_key' => $_POST['field_key'], - 'field_elements' => $_POST['field_elements'], - 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'), + $obj->setVars(array('field_mid' => $field_mid, 'field_tid' => $field_tid, 'field_name' => $field_name, + 'field_numb' => $field_numb, 'field_type' => $_POST['field_type'], + 'field_value' => $_POST['field_value'], 'field_attribute' => $_POST['field_attribute'], + 'field_null' => $_POST['field_null'], 'field_default' => $_POST['field_default'], + 'field_key' => $_POST['field_key'], 'field_elements' => $_POST['field_elements'], + 'field_auto_increment' => (($_REQUEST['field_auto_increment'] == 1) ? '1' : '0'), + 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'), 'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'), 'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'), 'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'), - 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'), - 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0'))); - + 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'), + 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0'))); + // Save data if ($fields_Handler->insert($obj)) { $xoops->redirect('fields.php', 2, TDMCreateLocale::FORMOK); } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -61,7 +61,7 @@ $admin_menu->addConfigBoxLine(array($folder, '777'), 'chmod'); } // extension -$extensions = array('xtraslator' => 'extension'); +$extensions = array('xtranslator' => 'extension'); foreach ($extensions as $module => $type) { $admin_menu->addConfigBoxLine(array($module, 'warning'), $type); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -134,8 +134,9 @@ } else { $obj = $tables_Handler->create(); } + $mid = $request->asInt('mod_id', 0); //Form tables - $obj->setVars(array('table_mid' => $request->asInt('mod_id', 0), 'table_name' => $_POST['table_name'], + $obj->setVars(array('table_mid' => $_POST['table_mid'], 'table_name' => $_POST['table_name'], 'table_nbfields' => $_POST['table_nbfields'], 'table_fieldname' => $_POST['table_fieldname'])); //Form table_image $pathIcon32 = XOOPS_ROOT_PATH . '/media/xoops/images/icons/32'; @@ -169,10 +170,12 @@ 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0'))); if( $tables_Handler->insert($obj) ) { - if( $obj->isNew() ) - $xoops->redirect('fields.php?op=new&tid='.$obj->getVar('table_id'), 3, XoopsLocale::S_DATA_INSERTED); - else + if( $obj->isNew() ) { + $table_id = $xoops->db->getInsertId(); + $xoops->redirect('fields.php?op=new&field_mid='.$mid.'&field_tid='.$table_id.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, XoopsLocale::S_DATA_INSERTED); + } else { $xoops->redirect('tables.php', 3, XoopsLocale::S_DATABASE_UPDATED); + } } $xoops->error($obj->getHtmlErrors()); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/architecture.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -192,7 +192,7 @@ } } -class TDMCreateFileVersion extends TDMCreateFile +class TDMCreateXoopsVersionFile extends TDMCreateFile { /** * Constructor @@ -212,14 +212,14 @@ * @param string $folder * @param string $file */ - public function createFileXoopsVersion($folder, $file, $elements = array()) + public function createXoopsVersionFile($folder, $file, $elements = array()) { $this->file = $file; $this->folder = $folder; } } -class TDMCreateFileClasses +class TDMCreateClassesFile { /** * @var null|array @@ -251,7 +251,7 @@ */ public function tdmc_initVar($key, $data_type = 'INT', $required = false, $maxlength = null, $options = '') { - $r = $required == true ? ', ' . $required : $required; + $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 .');'; @@ -264,8 +264,14 @@ * @param boolean $not_gpc */ public function tdmc_setVar($key, $value, $not_gpc = false) - { - return '$this->setVar(\''.$key.'\', '. $value .', ' . $not_gpc .');'; + { + $res = ''; + if ( $not_gpc ) { + $res .= '$this->setVar(\''.$key.'\', '. $value .', ' . $not_gpc .');'; + } else { + $res .= '$this->setVar(\''.$key.'\', '. $value .');'; + } + return $res; } /** @@ -274,11 +280,27 @@ * @param boolean $not_gpc */ public function tdmc_setVars($var_arr, $not_gpc = false) - { - foreach ($var_arr as $key => $value) { - $results = $key.'\', '. $value; + { + $comma = ', '; $c = 0; + foreach ($var_arr as $key => $value) { + $_array[$c] = $key.'\' => '. $value; + $c++; } - return '$this->setVars(\''. $results .', ' . $not_gpc .');'; + $res = ''; + for ($i = 0; $i < $c; $i++) + { + if ( $i != $c - 1 ) { + $res .= $_array[$i] . $comma; + } else { + $res .= $_array[$i]; + } + } + if ( $not_gpc ) { + $res .= '$this->setVars(array(\''. $res .'), ' . $not_gpc .');'; + } else { + $res .= '$this->setVars(array(\''. $res .'));'; + } + return $res; } /** @@ -295,9 +317,35 @@ { return null; } + + /** + * + * @param string $key + * @param string $value + * @param string $sort + * @param string $order + * @param int $tree + * @param int $id + */ + public function tdmc_Criteria($key, $value, $sort = '', $order = '', $id = null) + { + $criteria = '$criteria = new CriteriaCompo();'; + if($id) { + $criteria = '$criteria->add(new Criteria(\''.$key.'\', '.$value.')));'; + } else { + $criteria = '$criteria->add(new Criteria(\''.$key.'\', '.$id.', '.$value.')));'; + } + if($sort != '') { + $criteria = '$criteria->setSort(\''.$sort.'\');'; + } + if($order != '') { + $criteria = '$criteria->setOrder(\''.$order.'\');'; + } + return $criteria; + } } -class TDMCreateFileDb +class TDMCreateDbFile { /** * @var null|array @@ -317,7 +365,7 @@ /** * * @param string $var - * @param integer $nb_champs + * @param integer $nb_fields * @param mixed $data_type * @param boolean $required * @param mixed $handler @@ -325,18 +373,18 @@ * * @return string */ - public function tdmc_dbTable($tablename, $nb_champs = null, $data_type = 'int', $handler = null, $options = '') + public function tdmc_dbTable($tablename, $nb_fields = null, $data_type = 'int', $handler = null, $options = '') { $ret = '# -# Structure for table `'.strtolower($tablename).'` '.$nb_champs.' +# Structure for table `'.strtolower($tablename).'` '.$nb_fields.' # CREATE TABLE `'.strtolower($tablename).'` ('; $j = 0; - for ($i = 0; $i < $nb_champs; $i++) + for ($i = 0; $i < $nb_fields; $i++) { - $structure = explode(":", $champs[$i]); + $structure = explode(":", $fields[$i]); //Debut if ( $structure[0] != ' ' ) @@ -403,10 +451,10 @@ for ($i = 0; $i < $j; $i++) { if ( $i != $j - 1 ) { - $key .= ''.$comma[$i].', + $key .= $comma[$i].', '; } else { - $key .= ''.$comma[$i].' + $key .= $comma[$i].' '; } } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -29,7 +29,9 @@ public function __construct() { $this->initVar('field_id', XOBJ_DTYPE_INT, null, true); + $this->initVar('field_mid', XOBJ_DTYPE_INT, null); $this->initVar('field_tid', XOBJ_DTYPE_INT, null); + $this->initVar('field_numb', XOBJ_DTYPE_INT, null); $this->initVar('field_name', XOBJ_DTYPE_TXTBOX, null); $this->initVar('field_type', XOBJ_DTYPE_TXTBOX, null); $this->initVar('field_value', XOBJ_DTYPE_TXTBOX, null); @@ -43,12 +45,7 @@ $this->initVar('field_block', XOBJ_DTYPE_INT); $this->initVar('field_mainfield', XOBJ_DTYPE_INT); $this->initVar('field_search', XOBJ_DTYPE_INT); - $this->initVar('field_required', XOBJ_DTYPE_INT); - // For relationship - $this->initVar('table_id', XOBJ_DTYPE_INT, null, true); - $this->initVar('table_mid', XOBJ_DTYPE_INT, null); - $this->initVar('table_name', XOBJ_DTYPE_TXTBOX, null); - $this->initVar('table_nbfields', XOBJ_DTYPE_INT, null); + $this->initVar('field_required', XOBJ_DTYPE_INT); } } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -25,7 +25,7 @@ /** * @param TDMCreateFields|XoopsObject $obj */ - public function __construct(TDMCreateFields &$obj) + public function __construct(TDMCreateFields &$obj, $field_mid = 0, $field_tid = 0, $field_numb = null, $field_name = '') { $system = System::getInstance(); $xoops = Xoops::getInstance(); @@ -37,21 +37,31 @@ $this->setExtra('enctype="multipart/form-data"'); $tables_Handler = $xoops->getModuleHandler('tables'); - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('table_id', 0, '!=')); + $criteria = new CriteriaCompo(new Criteria('table_mid', $field_mid))); + $criteria->add(new Criteria('table_id', $field_tid)); $criteria->setSort('table_name'); $criteria->setOrder('ASC'); $tables_arr = $tables_Handler->getAll($criteria); - unset($criteria); + unset($criteria); + + if (!$obj->isNew()) { + $this->addElement(new XoopsFormHidden('field_mid', $obj->getVar('field_mid'))); + } else { + $this->addElement(new XoopsFormHidden('field_mid', $field_mid)); + } - // Count fields - $fields_Handler = $xoops->getModuleHandler('fields'); - /*$criteria = new CriteriaCompo(); - $criteria->add(new Criteria('field_tid', $request->asInt('table_id', 0))); - $numb_fields = $fields_Handler->getCount($criteria); - unset($criteria);*/ - $numb_fields = $fields_Handler->get($request->asInt('table_nbfields', 0)); - + if (!$obj->isNew()) { + $this->addElement(new XoopsFormHidden('field_tid', $obj->getVar('field_tid'))); + } else { + $this->addElement(new XoopsFormHidden('field_tid', $field_tid)); + } + + if (!$obj->isNew()) { + $numb_fields = $obj->getVar('field_numb'); + } else { + $numb_fields = $field_numb; + } + if ($numb_fields > 0) { $main_tray = new XoopsFormElementTray(' '); @@ -77,13 +87,15 @@ { $id = $i + 1; $main_tray->addElement(new XoopsFormRaw('<tr class=\'top\'>')); - $main_tray->addElement(new XoopsFormRaw('<td>'.$id.'</td>')); - $field_name = new XoopsFormText(TDMCreateLocale::FIELD_NAME, 'field_name', 1, 25, $obj->getVar('field_name')); + $main_tray->addElement(new XoopsFormRaw('<td>'.$id.'</td>')); + $field_value = ( $i == 1 ) ? '8' : $obj->getVar('field_value'); + $fieldname = $obj->isNew() ? $field_name : $obj->getVar('field_name'); + $field_name = new XoopsFormText(TDMCreateLocale::FIELD_NAME, 'field_name', 1, 25, $field_name); $main_tray->addElement(new XoopsFormRaw('<td>'.$field_name->render().'</td>')); $field_type_select = new XoopsFormSelect(TDMCreateLocale::FIELD_TYPE, 'field_type', $obj->getVar('field_type')); $field_type_select->addOptionArray($fieldtype_Handler->getList()); $main_tray->addElement(new XoopsFormRaw('<td>'.$field_type_select->render().'</td>')); - $field_value = new XoopsFormText(TDMCreateLocale::FIELD_VALUE, 'field_value', 1, 25, $obj->getVar('field_value')); + $field_value = new XoopsFormText(TDMCreateLocale::FIELD_VALUE, 'field_value', 1, 10, $field_value); $main_tray->addElement(new XoopsFormRaw('<td>'.$field_value->render().'</td>')); $field_attrs_select = new XoopsFormSelect(TDMCreateLocale::FIELD_ATTRIBUTE, 'field_attribute', $obj->getVar('field_attribute')); $field_attrs_select->addOptionArray($fieldattrs_Handler->getList()); @@ -150,12 +162,12 @@ unset($id); if (!$obj->isNew()) { - $field_tid = new XoopsFormHidden('id', $obj->getVar('field_tid')); + $ftid = new XoopsFormHidden('field_tid', $obj->getVar('field_tid')); } else { - $field_tid = new XoopsFormHidden('tid', $obj->getVar('field_tid')); + $ftid = new XoopsFormHidden('field_tid', $field_tid); } - $main_tray->addElement(new XoopsFormRaw('<tr><td colspan=\'7\'>'.$field_tid->render().'</td>'));/**/ + $main_tray->addElement(new XoopsFormRaw('<tr><td colspan=\'7\'>'.$ftid->render().'</td>')); $main_tray->addElement(new XoopsFormHidden('op', 'save')); $submit = new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit'); $submit->setExtra('style="text-align: right;"'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -32,10 +32,12 @@ $title = $obj->isNew() ? sprintf(TDMCreateLocale::ADD_MODULE) : sprintf(TDMCreateLocale::EDIT_MODULE); - parent::__construct($title, 'form', false, 'post', true); - $this->setExtra('enctype="multipart/form-data"'); + parent::__construct($title, 'form', 'modules.php', 'post', true, 'raw'); + //$this->setExtra('enctype="multipart/form-data"'); + $tabtray = new XoopsFormTabTray('', 'uniqueid'); // First Break - $this->insertBreak('<div class="center"><b>'.TDMCreateLocale::IMPORTANT.'</b></div>','head'); + //$this->insertBreak('<div class="center"><b>'.TDMCreateLocale::IMPORTANT.'</b></div>', 'head'); + $tab1 = new XoopsFormTab(TDMCreateLocale::IMPORTANT, 'important'); // Name of Module $mod_tray = new XoopsFormElementTray(TDMCreateLocale::C_MODULE_OR_EXTENSION, "\t"); $mod_tray->setDescription(TDMCreateLocale::C_MODULE_OR_EXTENSION_DESC); @@ -44,9 +46,9 @@ $check_is_extension = new XoopsFormCheckBox(' ', 'isextension', $is_extension); $check_is_extension->addOption(1, TDMCreateLocale::QC_ISEXTENSION); $mod_tray->addElement($check_is_extension); - $this->addElement($mod_tray); + $tab1->addElement($mod_tray); // Version module - $this->addElement(new XoopsFormText(XoopsLocale::VERSION, 'mod_version', 30, 50, $obj->getVar('mod_version')), true); + $tab1->addElement(new XoopsFormText(XoopsLocale::VERSION, 'mod_version', 30, 50, $obj->getVar('mod_version')), true); // Editor $editor_configs=array(); $editor_configs['name'] = 'mod_description'; @@ -56,10 +58,10 @@ $editor_configs['width'] = '100%'; $editor_configs['height'] = '400px'; $editor_configs['editor'] = $xoops->getModuleConfig('editor'); - $this->addElement( new XoopsFormEditor(XoopsLocale::DESCRIPTION, 'mod_description', $editor_configs), true ); + $tab1->addElement( new XoopsFormEditor(XoopsLocale::DESCRIPTION, 'mod_description', $editor_configs), true ); // Author module - $this->addElement(new XoopsFormText(XoopsLocale::AUTHOR, 'mod_author', 50, 255, $obj->getVar('mod_author')), true); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_LICENSE, 'mod_license', 50, 255, $obj->getVar('mod_license')), true); + $tab1->addElement(new XoopsFormText(XoopsLocale::AUTHOR, 'mod_author', 50, 255, $obj->getVar('mod_author')), true); + $tab1->addElement(new XoopsFormText(TDMCreateLocale::C_LICENSE, 'mod_license', 50, 255, $obj->getVar('mod_license')), true); $option_tray = new XoopsFormElementTray(XoopsLocale::OPTIONS, ' '); $display_admin = $obj->isNew() ? 0 : $obj->getVar('mod_admin'); $check_display_admin = new XoopsFormCheckBox(' ', 'mod_admin', $display_admin); @@ -85,7 +87,7 @@ $check_active_notifies = new XoopsFormCheckBox(' ', 'mod_notifications', $active_notifies); $check_active_notifies->addOption(1, TDMCreateLocale::C_NOTIFICATIONS); $option_tray->addElement($check_active_notifies); - $this->addElement($option_tray); + $tab1->addElement($option_tray); $module_image = $obj->getVar('mod_image') ? $obj->getVar('mod_image') : 'default_slogo.png'; $uploadir = 'uploads/tdmcreate/images/modules'; @@ -103,36 +105,52 @@ $fileseltray->addElement(new XoopsFormFile(XoopsLocale::A_UPLOAD , 'modules_image', $xoops->getModuleConfig('maxuploadsize'))); $fileseltray->addElement(new XoopsFormLabel('')); $imgtray->addElement($fileseltray); - $this->addElement($imgtray);/**/ - /*$uploadir = 'uploads/tdmcreate/images/modules'; - $this->addElement(new XoopsFormImage(XoopsLocale::IMAGE , 'modules', $uploadir, $obj->getVar('mod_image')));*/ + $tab1->addElement($imgtray); + $tabtray->addElement($tab1); + + /** + * Not important + */ + $tab2 = new XoopsFormTab(TDMCreateLocale::NOT_IMPORTANT, 'not_important'); // Second Break - $this->insertBreak('<div class="center"><b>'.TDMCreateLocale::NOT_IMPORTANT.'</b></div>','head'); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $obj->getVar('mod_author_mail'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $obj->getVar('mod_author_website_url'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $obj->getVar('mod_author_website_name'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_CREDITS, 'mod_credits', 50, 255, $obj->getVar('mod_credits'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE_INFO, 'mod_release_info', 50, 255, $obj->getVar('mod_release_info'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE_FILE, 'mod_release_file', 50, 255, $obj->getVar('mod_release_file'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_MANUAL, 'mod_manual', 50, 255, $obj->getVar('mod_manual'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_MANUAL_FILE, 'mod_manual_file', 50, 255, $obj->getVar('mod_manual_file'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $obj->getVar('mod_demo_site_url'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $obj->getVar('mod_demo_site_name'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_SUPPORT_URL, 'mod_support_url', 50, 255, $obj->getVar('mod_support_url'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_SUPPORT_NAME, 'mod_support_name', 50, 255, $obj->getVar('mod_support_name'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_WEBSITE_URL, 'mod_website_url', 50, 255, $obj->getVar('mod_website_url'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_WEBSITE_NAME, 'mod_website_name', 50, 255, $obj->getVar('mod_website_name'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE, 'mod_release', 50, 255, $obj->getVar('mod_release'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_STATUS, 'mod_status', 50, 255, $obj->getVar('mod_status'))); + //$this->insertBreak('<div class="center"><b>'.TDMCreateLocale::NOT_IMPORTANT.'</b></div>','head'); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_MAIL, 'mod_author_mail', 50, 255, $obj->getVar('mod_author_mail'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_WEBSITE_URL, 'mod_author_website_url', 50, 255, $obj->getVar('mod_author_website_url'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_AUTHOR_WEBSITE_NAME, 'mod_author_website_name', 50, 255, $obj->getVar('mod_author_website_name'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_CREDITS, 'mod_credits', 50, 255, $obj->getVar('mod_credits'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE_INFO, 'mod_release_info', 50, 255, $obj->getVar('mod_release_info'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE_FILE, 'mod_release_file', 50, 255, $obj->getVar('mod_release_file'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_MANUAL, 'mod_manual', 50, 255, $obj->getVar('mod_manual'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_MANUAL_FILE, 'mod_manual_file', 50, 255, $obj->getVar('mod_manual_file'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_DEMO_SITE_URL, 'mod_demo_site_url', 50, 255, $obj->getVar('mod_demo_site_url'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_DEMO_SITE_NAME, 'mod_demo_site_name', 50, 255, $obj->getVar('mod_demo_site_name'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_SUPPORT_URL, 'mod_support_url', 50, 255, $obj->getVar('mod_support_url'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_SUPPORT_NAME, 'mod_support_name', 50, 255, $obj->getVar('mod_support_name'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_WEBSITE_URL, 'mod_website_url', 50, 255, $obj->getVar('mod_website_url'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_WEBSITE_NAME, 'mod_website_name', 50, 255, $obj->getVar('mod_website_name'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_RELEASE, 'mod_release', 50, 255, $obj->getVar('mod_release'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_STATUS, 'mod_status', 50, 255, $obj->getVar('mod_status'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_PAYPAL_BUTTON, 'mod_paypal_button', 50, 255, $obj->getVar('mod_paypal_button'))); - $this->addElement(new XoopsFormText(TDMCreateLocale::C_SUBVERSION, 'mod_subversion', 50, 255, $obj->getVar('mod_subversion'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_PAYPAL_BUTTON, 'mod_paypal_button', 50, 255, $obj->getVar('mod_paypal_button'))); + $tab2->addElement(new XoopsFormText(TDMCreateLocale::C_SUBVERSION, 'mod_subversion', 50, 255, $obj->getVar('mod_subversion'))); - if (!$obj->isNew()) { + /** + * Button submit + */ + $button_tray = new XoopsFormElementTray('', ''); + $button_tray->addElement(new XoopsFormHidden('op', 'save')); + + $button_2 = new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit' ); + $button_2->setClass('btn'); + $button_tray->addElement($button_2); + $tab2->addElement($button_tray); + $tabtray->addElement($tab2); + + if (!$obj->isNew()) { $this->addElement(new XoopsFormHidden( 'id', $obj->getVar('mod_id') ) ); - } - $this->addElement(new XoopsFormHidden('op', 'save' ) ); - $this->addElement(new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit' ) ); + } + + $this->addElement($tabtray); } } \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/import.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -23,6 +23,21 @@ class TDMCreateImport extends XoopsObject { + /* + * @public regexp $search + */ + public $search = array ( '/\/\*.*(\n)*.*(\*\/)?/', '/\s*--.*\n/', '/\s*#.*\n/' ); + + /* + * @public regexp $replace + */ + public $replace = array ( "\n" ); + + /* + * @public regexp + */ + public $regexp = '/((\s)*(CREATE TABLE)(\s)*([a-z_]+)(\s)*(\()(\s)*([a-z_]+)(\s)*([a-z]+)(\()([0-9]{1,4})(\))(\s)*([a-z]+)(\s)*(NOT NULL)(\s)*([a-z_]+)(\s)*(\w+))/'; + /** * Constructor */ @@ -47,12 +62,12 @@ * @param integer $_2 * @return array */ - public function getWord($regex, $text, $matches, $_1, $_2) + public function getWordMatched($regex, $text, $matches, $_1, $_2) { preg_match_all($regex, $text, $matches); - if(count($matches[0]) > 0) - array_push( $result, $matches[$_1][$_2] ); - + if(count($matches[0]) > 0) { + $result[] = $matches[$_1][$_2]; + } return $result; } @@ -82,8 +97,8 @@ public function getStrReplace($search, $replace, $text, $char = '') { $pos = strpos($text, $char); - $result = str_replace($search, $replace, $text); - return $result; + $res = str_replace($search, $replace, $text); + return $res; } } Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -158,25 +158,7 @@ const DISPLAY_USER = "Visible User"; const IMPORTANT = "Information"; - const NOT_IMPORTANT = "Optional Information"; - - const L_ADMIN = "Admin"; - const L_USER = "User"; - const L_SUBMENU = "Submenu"; - const L_SEARCH = "Search"; - const L_COMMENTS = "Comments"; - const L_NOTIFICATIONS = "Notifications"; - const L_LIST = "List"; - const L_ID = "N&176; ID"; - const L_NAME = "Name"; - const L_TYPE = "Type"; - const L_VALUE = "Value"; - const L_ATTRIBUTES = "Attributes"; - const L_NOTNULL = "Not Null"; - const L_DEFAULT = "Default"; - const L_KEY = "Key"; - const L_ARGUMENTS = "Arguments"; - const L_EXTRA = "Extra fields"; + const NOT_IMPORTANT = "Optional Information"; const E_NO_EXTENSIONS = "There are no extensions"; const E_NO_FIELDS = "There are no fields"; @@ -192,12 +174,8 @@ const FIELDS_NUMBER = "Number of fields"; - const S_SAVED = "Successfully saved"; - const S_DELETED = "Successfully deleted"; - const QF_ARE_YOU_SURE_TO_DELETE = "Are you sure you want to delete: <span class='red bold'>%s</span>?"; - const QF_ARE_YOU_SURE_TO_RENEW = "Are you sure you want to renew: <span class='red bold'>%s</span>?"; - const QC_ISEXTENSION = "Is an Extension?"; + const F_FILES_PATH = "Files in %s "; const F_EDIT = "Modification"; const F_DEL = "Clear"; @@ -220,6 +198,12 @@ const MODULE_FIELDS_NUMBER = "Fields Number"; const MODULE_BLOCKS = "Blocks"; + const QF_ARE_YOU_SURE_TO_DELETE = "Are you sure you want to delete: <span class='red bold'>%s</span>?"; + const QF_ARE_YOU_SURE_TO_RENEW = "Are you sure you want to renew: <span class='red bold'>%s</span>?"; + const QC_ISEXTENSION = "Is an Extension?"; + + const S_SAVED = "Successfully saved"; + const S_DELETED = "Successfully deleted"; const S_DELETED_SUCCESS = "Deleted Successfully"; const S_DATA_ENTERED = "Data entered successfull!"; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql 2013-03-17 10:48:02 UTC (rev 11243) @@ -74,7 +74,9 @@ CREATE TABLE `tdmcreate_fields` ( `field_id` int (5) unsigned NOT NULL auto_increment, +`field_mid` int (5) unsigned NOT NULL default '0', `field_tid` int (5) unsigned NOT NULL default '0', +`field_numb` int (10) unsigned NOT NULL default '0', `field_name` varchar (255) NOT NULL default '', `field_type` varchar (100) NOT NULL default '', `field_value` char (4) NOT NULL default '', Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-03-17 10:48:02 UTC (rev 11243) @@ -31,20 +31,20 @@ <td class='center'><img src='<{xoAppUrl uploads/tdmcreate/images/modules}>/<{$module.image}>' height='20px' title='<{$module.name}>' alt='<{$module.name}>' /></td> <td class='center'><{$module.release}></td> <td class='center'><{$module.status}></td> - <td class='center'> </td> - <td class='center'> </td> - <td class='center'><img src='<{if $module.admin}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $module.user}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $module.submenu}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $module.search}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $module.comments}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $module.notifications}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> + <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/16/fields.png}>' /></td> + <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/16/blocks.png}>' /></td> + <td class='center'><img src='<{if $module.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $module.user}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $module.submenu}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $module.search}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $module.comments}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $module.notifications}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> <td class='xo-actions txtcenter width6'> <a href='modules.php?op=edit&mod_id=<{$module.id}>' title='<{translate key="A_EDIT"}>'> <img src='<{xoAdminIcons edit.png}>' alt='<{translate key="A_EDIT"}>' /></a> @@ -58,25 +58,24 @@ <td class='center'><{$table.id}></td> <td class='center'><{$table.name}></td> <td class='center'><{$table.mid}></td> <!-- uploads/tdmcreate/images/tables --> - <td class='center'><img src='<{xoAppUrl media/xoops/images/icons/32}>/<{$table.image}>' height='20px' title='<{$table.name}>' alt='<{$table.name}>' /></td> + <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/32}>/<{$table.image}>' height='20px' title='<{$table.name}>' alt='<{$table.name}>' /></td> <td class='center'> </td> <td class='center'> </td> <td class='center'><{$table.nbfields}></td> - <td class='center'><img src='<{if $table.blocks}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.admin}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.user}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.submenu}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.search}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.comments}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'> - <img src='<{if $table.notifications}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /> + <td class='center'><img src='<{if $table.blocks}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $table.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $table.user}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $table.submenu}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $table.search}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $table.comments}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='center'><img src='<{if $table.notifications}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /> </td> <td class='xo-actions txtcenter width5'> <a href='tables.php?op=edit&table_id=<{$table.id}>' title='<{translate key="A_EDIT"}>'> Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php 2013-03-17 06:32:26 UTC (rev 11242) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php 2013-03-17 10:48:02 UTC (rev 11243) @@ -41,7 +41,7 @@ $modversion['module_website_url'] = 'http://www.xoops.org/'; $modversion['module_website_name'] = 'XOOPS'; $modversion['module_status'] = 'ALPHA'; -$modversion['min_php'] = '5.3'; +$modversion['min_php'] = '5.2'; $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); // paypal |
From: <txm...@us...> - 2013-03-19 10:16:45
|
Revision: 11253 http://sourceforge.net/p/xoops/svn/11253 Author: txmodxoops Date: 2013-03-19 10:16:42 +0000 (Tue, 19 Mar 2013) Log Message: ----------- Added classes files Modified some files Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_blocks.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_class.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_include.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_templates.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/index.html Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-03-19 09:22:26 UTC (rev 11252) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -62,7 +62,7 @@ $criteria->setStart($start); $criteria->setLimit($nb_pager); $numrows_tables = $tables_Handler->getCount($criteria); - $table_arr = $tables_Handler->getAll($criteria); + $tables_arr = $tables_Handler->getAll($criteria); $xoops->tpl()->assign('tables_count', $numrows_tables); $xoops->tpl()->assign('timg_path', TDMC_TABLES_URL_IMG); unset($criteria); @@ -86,22 +86,29 @@ $xoops->tpl()->append_by_ref('modules', $mod); unset($mod); } + /*if (is_dir($timage = XOOPS_URL ."/uploads/tdmcreate/images/tables/".$table_image)) { + $table['image'] = $timage; + } elseif (is_dir($timage = XOOPS_URL ."/media/xoops/images/icons/32/".$table_image)) { + $table['image'] = $timage; + }*/ if ($numrows_tables > 0) { - foreach (array_keys($table_arr) as $i) { - $tables['id'] = $table_arr[$i]->getVar('table_id'); - $tables['name'] = $table_arr[$i]->getVar('table_name'); - $module_name = $modules_Handler->get($table_arr[$i]->getVar('table_mid')); - $tables['mid'] = $module_name->getVar('mod_name'); - $tables['image'] = $table_arr[$i]->getVar('table_image'); - $tables['nbfields'] = $table_arr[$i]->getVar('table_nbfields'); - $tables['blocks'] = $table_arr[$i]->getVar('table_blocks'); - $tables['admin'] = $table_arr[$i]->getVar('table_admin'); - $tables['user'] = $table_arr[$i]->getVar('table_user'); - $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); - $tables['search'] = $table_arr[$i]->getVar('table_search'); - $tables['comments'] = $table_arr[$i]->getVar('table_comments'); - $tables['notifications'] = $table_arr[$i]->getVar('table_notifications'); - $xoops->tpl()->append_by_ref('tables', $tables); + foreach (array_keys($tables_arr) as $i) + { + $table['id'] = $tables_arr[$i]->getVar('table_id'); + $table['name'] = $tables_arr[$i]->getVar('table_name'); + $module_name = $modules_Handler->get($tables_arr[$i]->getVar('table_mid')); + $mod_name = $module_name->getVar('mod_name'); + $table['mid'] = $mod_name; + $table['image'] = $tables_arr[$i]->getVar('table_image'); + $table['nbfields'] = $tables_arr[$i]->getVar('table_nbfields'); + $table['blocks'] = $tables_arr[$i]->getVar('table_blocks'); + $table['admin'] = $tables_arr[$i]->getVar('table_admin'); + $table['user'] = $tables_arr[$i]->getVar('table_user'); + $table['submenu'] = $tables_arr[$i]->getVar('table_submenu'); + $table['search'] = $tables_arr[$i]->getVar('table_search'); + $table['comments'] = $tables_arr[$i]->getVar('table_comments'); + $table['notifications'] = $tables_arr[$i]->getVar('table_notifications'); + $xoops->tpl()->append_by_ref('tables', $table); unset($tables); } } @@ -169,13 +176,11 @@ 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'), 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0'))); - if( $tables_Handler->insert($obj) ) { - if( $obj->isNew() ) { - $table_id = $xoops->db->getInsertId(); - $xoops->redirect('fields.php?op=new&field_mid='.$mid.'&field_tid='.$table_id.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, XoopsLocale::S_DATA_INSERTED); - } else { - $xoops->redirect('tables.php', 3, XoopsLocale::S_DATABASE_UPDATED); - } + if( $tables_Handler->insert($obj) && $obj->isNew() ) { + $tid = $xoops->db()->getInsertId(); + $xoops->redirect('fields.php?op=new&field_mid='.$mid.'&field_tid='.$tid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, XoopsLocale::S_DATA_INSERTED); + } elseif($tables_Handler->insert($obj) && !$obj->isNew() ) { + $xoops->redirect('tables.php', 3, XoopsLocale::S_DATABASE_UPDATED); } $xoops->error($obj->getHtmlErrors()); Index: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files 2013-03-19 09:22:26 UTC (rev 11252) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files 2013-03-19 10:16:42 UTC (rev 11253) Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files ___________________________________________________________________ Added: tsvn:autoprops ## -0,0 +1 ## +*.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; \ No newline at end of property Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -0,0 +1,27 @@ +<?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("Restricted access"); + +class TDMCreateClassesAdmin extends TDMCreateFile +{ + +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.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 Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_blocks.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_blocks.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_blocks.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -0,0 +1,27 @@ +<?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("Restricted access"); + +class TDMCreateClassesBlocks extends TDMCreateFile +{ + +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_blocks.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 Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_class.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_class.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_class.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -0,0 +1,27 @@ +<?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("Restricted access"); + +class TDMCreateClassesClass extends TDMCreateFile +{ + +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_class.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 Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_include.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_include.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_include.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -0,0 +1,27 @@ +<?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("Restricted access"); + +class TDMCreateClassesInclude extends TDMCreateFile +{ + +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_include.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 Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_locale.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_locale.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_locale.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -0,0 +1,27 @@ +<?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("Restricted access"); + +class TDMCreateClassesLocale extends TDMCreateFile +{ + +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_locale.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 Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_templates.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_templates.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_templates.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -0,0 +1,27 @@ +<?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("Restricted access"); + +class TDMCreateClassesTemplates extends TDMCreateFile +{ + +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_templates.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 Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -0,0 +1,27 @@ +<?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("Restricted access"); + +class TDMCreateClassesUser extends TDMCreateFile +{ + +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.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 Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/index.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/index.html (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/index.html 2013-03-19 10:16:42 UTC (rev 11253) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-03-19 09:22:26 UTC (rev 11252) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -102,7 +102,7 @@ $imgtray->addElement($imageselect); $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadir."/".$module_image."' name='image3' id='image3' alt='' />" ) ); $fileseltray = new XoopsFormElementTray('','<br />'); - $fileseltray->addElement(new XoopsFormFile(XoopsLocale::A_UPLOAD , 'modules_image', $xoops->getModuleConfig('maxuploadsize'))); + $fileseltray->addElement(new XoopsFormFile(XoopsLocale::A_UPLOAD , 'modules_image', $xoops->getModuleConfig('maxuploadsize')), true); $fileseltray->addElement(new XoopsFormLabel('')); $imgtray->addElement($fileseltray); $tab1->addElement($imgtray); @@ -141,9 +141,9 @@ $button_tray = new XoopsFormElementTray('', ''); $button_tray->addElement(new XoopsFormHidden('op', 'save')); - $button_2 = new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit' ); - $button_2->setClass('btn'); - $button_tray->addElement($button_2); + $button = new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit' ); + $button->setClass('btn'); + $button_tray->addElement($button); $tab2->addElement($button_tray); $tabtray->addElement($tab2); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php 2013-03-19 09:22:26 UTC (rev 11252) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -86,6 +86,8 @@ const CONF_AUTHOR_WEBSITE_URL = "Author's Website URL"; const CONF_AUTHOR_WEBSITE_NAME = "Author's Website Name"; const CONF_ACTIVE_NOTIFICATIONS = "Allow Notifications"; + const CONF_BREAK_GENERAL = "General settings"; + const CONF_BREAK_MODULE = "Module settings"; const CONF_CREDITS = "Credits"; const CONF_DEMO_SITE_URL = "Demo Website URL"; const CONF_DEMO_SITE_NAME = "Demo Website Name"; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.html 2013-03-19 09:22:26 UTC (rev 11252) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.html 2013-03-19 10:16:42 UTC (rev 11253) @@ -25,20 +25,20 @@ <td class='txtcenter'><{$table.id}></td> <td class='txtcenter'><{$table.name}></td> <td class='txtcenter'><{$table.nbfields}></td> <!-- uploads/tdmcreate/images/tables --> - <td class='txtcenter'><img src='<{xoAppUrl media/xoops/images/icons/32}>/<{$table.image}>' height='25px' title='<{$table.name}>' alt='<{$table.name}>' /></td> - <td class='center'><img src='<{if $table.admin}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.user}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.submenu}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.search}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='center'><img src='<{if $table.comments}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> + <td class='txtcenter'><img src='<{xoAppUrl modules/tdmcreate/icons/32}>/<{$table.image}>' height='25px' title='<{$table.name}>' alt='<{$table.name}>' /></td> + <td class='center'><img src='<{if $table.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /></td> + <td class='center'><img src='<{if $table.user}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /></td> + <td class='center'><img src='<{if $table.submenu}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /></td> + <td class='center'><img src='<{if $table.search}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /></td> + <td class='center'><img src='<{if $table.comments}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /></td> <td class='center'> - <img src='<{if $table.notifications}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /> + <img src='<{if $table.notifications}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /> </td> <td class='xo-actions txtcenter width6'> <a href='tables.php?op=edit&id=<{$table.id}>' title='<{translate key="A_EDIT"}>'> @@ -55,12 +55,12 @@ <td class='txtcenter'><{$field.name}></td> <td class='txtcenter' colspan='3'> </td> <td class='txtcenter'><{$field.nbfields}></td> - <td class='txtcenter'><img src='<{if $mod.admin}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /><{$field.blocks}></td> - <td class='txtcenter'><img src='<{if $mod.admin}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /><{$field.admin}></td> - <td class='txtcenter'><img src='<{if $mod.admin}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /><{$field.user}></td> + <td class='txtcenter'><img src='<{if $mod.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /><{$field.blocks}></td> + <td class='txtcenter'><img src='<{if $mod.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /><{$field.admin}></td> + <td class='txtcenter'><img src='<{if $mod.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.gif}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.gif}><{/if}>' /><{$field.user}></td> <td class='xo-actions txtcenter width6'> <a href='fields.php?op=edit&id=<{$field.id}>' title='<{translate key="A_EDIT"}>'> <img src='<{xoAdminIcons edit.png}>' alt='<{translate key="A_EDIT"}>' /></a> Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html 2013-03-19 09:22:26 UTC (rev 11252) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html 2013-03-19 10:16:42 UTC (rev 11253) @@ -29,18 +29,18 @@ <td class='txtcenter'><img src='<{xoAppUrl uploads/tdmcreate/images/modules}>/<{$mod.image}>' height='15px' title='<{$mod.name}>' alt='<{$mod.name}>' /></td> <td class='txtcenter'><{$mod.release}></td> <td class='txtcenter'><{$mod.status}></td> - <td class='txtcenter'><img src='<{if $mod.admin}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='txtcenter'><img src='<{if $mod.user}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='txtcenter'><img src='<{if $mod.submenu}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='txtcenter'><img src='<{if $mod.search}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='txtcenter'><img src='<{if $mod.comments}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> - <td class='txtcenter'><img src='<{if $mod.notifications}><{xoAppUrl media/xoops/images/icons/16/green.gif}> - <{else}><{xoAppUrl media/xoops/images/icons/16/red.gif}><{/if}>' /></td> + <td class='txtcenter'><img src='<{if $mod.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='txtcenter'><img src='<{if $mod.user}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='txtcenter'><img src='<{if $mod.submenu}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='txtcenter'><img src='<{if $mod.search}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='txtcenter'><img src='<{if $mod.comments}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> + <td class='txtcenter'><img src='<{if $mod.notifications}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> + <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> <td class='xo-actions txtcenter width6'> <a href='modules.php?op=edit&mod_id=<{$mod.id}>' title='<{translate key="A_EDIT"}>'> <img src='<{xoAdminIcons edit.png}>' alt='<{translate key="A_EDIT"}>' /></a> Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-03-19 09:22:26 UTC (rev 11252) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-03-19 10:16:42 UTC (rev 11253) @@ -28,7 +28,7 @@ <td class='center'><{$module.id}></td> <td class='center'><{$module.name}></td> <td class='center'><{$module.version}></td> - <td class='center'><img src='<{xoAppUrl uploads/tdmcreate/images/modules}>/<{$module.image}>' height='20px' title='<{$module.name}>' alt='<{$module.name}>' /></td> + <td class='center'><img src='<{xoAppUrl uploads/tdmcreate/images/modules}>/<{$module.image}>' height='20px' title='<{$module.name}>' alt='<{$module.name}>' /></td> <td class='center'><{$module.release}></td> <td class='center'><{$module.status}></td> <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/16/fields.png}>' /></td> @@ -58,7 +58,7 @@ <td class='center'><{$table.id}></td> <td class='center'><{$table.name}></td> <td class='center'><{$table.mid}></td> <!-- uploads/tdmcreate/images/tables --> - <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/32}>/<{$table.image}>' height='20px' title='<{$table.name}>' alt='<{$table.name}>' /></td> + <td class='center'><img src='<{xoAppUrl media/xoops/images/icons/32}>/<{$table.image}>' title='<{$table.name}>' alt='<{$table.name}>' height='20px' /></td> <td class='center'> </td> <td class='center'> </td> <td class='center'><{$table.nbfields}></td> Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php 2013-03-19 09:22:26 UTC (rev 11252) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php 2013-03-19 10:16:42 UTC (rev 11253) @@ -40,8 +40,8 @@ $modversion['release_date'] = '2012/12/27'; $modversion['module_website_url'] = 'http://www.xoops.org/'; $modversion['module_website_name'] = 'XOOPS'; -$modversion['module_status'] = 'ALPHA'; -$modversion['min_php'] = '5.2'; +$modversion['module_status'] = 'Alpha'; +$modversion['min_php'] = '5.3'; $modversion['min_xoops'] = '2.6.0'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); // paypal @@ -89,7 +89,14 @@ /* Preferences */ -$i = 0;/* */ +$i = 1; +$modversion['config'][$i]['name'] = 'break' . $i; +$modversion['config'][$i]['title'] = TDMCreateLocale::CONF_BREAK_GENERAL; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'line_break'; +$modversion['config'][$i]['valuetype'] = 'textbox'; +$modversion['config'][$i]['default'] = 'head'; +$i++; $editors = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/class/xoopseditor'); $modversion['config'][$i]['name'] = 'editor'; $modversion['config'][$i]['title'] = TDMCreateLocale::CONF_EDITOR; @@ -124,6 +131,13 @@ $modversion['config'][$i]['valuetype'] = 'int'; $modversion['config'][$i]['default'] = 20; $i++; +$modversion['config'][$i]['name'] = 'break' . $i; +$modversion['config'][$i]['title'] = TDMCreateLocale::CONF_BREAK_MODULE; +$modversion['config'][$i]['description'] = ''; +$modversion['config'][$i]['formtype'] = 'line_break'; +$modversion['config'][$i]['valuetype'] = 'textbox'; +$modversion['config'][$i]['default'] = 'head'; +$i++; $modversion['config'][$i]['name'] = 'name'; $modversion['config'][$i]['title'] = TDMCreateLocale::CONF_NAME; $modversion['config'][$i]['description'] = ''; @@ -241,7 +255,7 @@ $modversion['config'][$i]['description'] = ''; $modversion['config'][$i]['formtype'] = 'textbox'; $modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = 'www.xoops.org'; +$modversion['config'][$i]['default'] = 'http://xoops.org/forums/newbb'; $i++; $modversion['config'][$i]['name'] = 'support_name'; $modversion['config'][$i]['title'] = TDMCreateLocale::CONF_SUPPORT_NAME; @@ -255,7 +269,7 @@ $modversion['config'][$i]['description'] = ''; $modversion['config'][$i]['formtype'] = 'textbox'; $modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = 'http://xoops.org/forums/newbb'; +$modversion['config'][$i]['default'] = 'www.xoops.org'; $i++; $modversion['config'][$i]['name'] = 'website_name'; $modversion['config'][$i]['title'] = TDMCreateLocale::CONF_WEBSITE_NAME; |
From: <txm...@us...> - 2013-03-19 10:18:05
|
Revision: 11254 http://sourceforge.net/p/xoops/svn/11254 Author: txmodxoops Date: 2013-03-19 10:18:02 +0000 (Tue, 19 Mar 2013) Log Message: ----------- Added styles file Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css/styles.css Index: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css 2013-03-19 10:16:42 UTC (rev 11253) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css 2013-03-19 10:18:02 UTC (rev 11254) Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css ___________________________________________________________________ Added: tsvn:autoprops ## -0,0 +1 ## +*.php = svn:executable=*;svn:keywords=Author Date Id Rev URL; \ No newline at end of property Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css/styles.css =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css/styles.css (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css/styles.css 2013-03-19 10:18:02 UTC (rev 11254) @@ -0,0 +1,13 @@ +.form-horizontal .control-label { + float: left; + width: 0; + padding-top: 5px; + text-align: right; +} + +.form-horizontal .controls { + *display: inline-block; + *padding-left: 20px; + margin-left: 0; + *margin-left: 0; +} \ No newline at end of file |
From: <txm...@us...> - 2013-03-20 19:35:45
|
Revision: 11269 http://sourceforge.net/p/xoops/svn/11269 Author: txmodxoops Date: 2013-03-20 19:35:42 +0000 (Wed, 20 Mar 2013) Log Message: ----------- Updated Added classes_common.php Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_common.php Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.php 2013-03-20 15:54:10 UTC (rev 11268) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_admin.php 2013-03-20 19:35:42 UTC (rev 11269) @@ -35,7 +35,7 @@ * * @var array */ - protected $modules = array(); + protected $module = array(); /** * Text @@ -80,7 +80,7 @@ public function create(TDMCreateFile $adminFile, $module = '') { $this->adminFile[] = $adminFile; - $this->modules[] = $module; + $this->module[] = $module; return $this; } @@ -101,19 +101,20 @@ $this->text[] = '$system = System::getInstance();'; $this->text[] = '// Get main locale instance'; $this->text[] = '$xoops = Xoops::getInstance();'; - $this->text[] = '$helper = TDMCreate::getInstance();'; - $this->text[] = '$request = $xoops->request();'; - $this->text[] = '// Get handler'; + $this->text[] = '$helper = '.ucfirst($module_name).'::getInstance();'; + $this->text[] = '$request = $xoops->request();'; foreach (array_keys($tables_arr) as $i) { $table_name = $tables_arr[$i]->getVar("table_name"); + $this->text[] = '// Get handler '.ucfirst($table_name); $this->text[] = '$'.strtolower($table_name).'_Handler = $helper->getHandler'.ucfirst($table_name).'();'; } $this->text[] = '// Get $_POST, $_GET, $_REQUEST'; $this->text[] = '$op = $request->asStr(\'op\', \'list\');'; - $this->text[] = '$start = $request->asInt(\'start\', 0);'; - $this->text[] = '// Parameters'; - if ($this->getAdminPager()) { + $this->text[] = '$start = $request->asInt(\'start\', 0);'; + if ($this->getAdminPager()) + { + $this->text[] = '// Parameters'; $this->text[] = '$nb_pager = $helper->getConfig(\'adminpager\');'; } $this->text[] = '// Get admin menu istance'; Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_common.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_common.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_common.php 2013-03-20 19:35:42 UTC (rev 11269) @@ -0,0 +1,73 @@ +<?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("Restricted access"); + +class TDMCreateClassesCommon /*extends TDMCreateFile*/ +{ + /** + * Constructor + * + * @param string $module + * @param string $text + */ + public function __construct($module = '', $text = '') + { + $this->module = $module; + $this->text = $text; + } + + /** + * @param string $module + */ + public function getCommonHeader($module) + { + $name = $module->getVar('mod_name'); + $version = $module->getVar('mod_version'); + $author = $module->getVar('mod_author'); + $mail = $module->getVar('mod_author_mail'); + $nickname = $module->getVar('mod_credits'); + $subversion = $module->getVar('mod_subversion'); + $datetime = date('Y/m/d G:i:s'); + + $text = '/* + 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. +*/ + +/** + * '.$module_name.' 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 '.$module_name.' + * @since 2.6.0 + * @author '.$author.' <'.$mail.'> + * @version $Id$ + */'; + return $text; + } +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_common.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 Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.php 2013-03-20 15:54:10 UTC (rev 11268) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/classes_user.php 2013-03-20 19:35:42 UTC (rev 11269) @@ -23,5 +23,259 @@ class TDMCreateClassesUser extends TDMCreateFile { - + /** + * File + * + * @var array of {@link TDMCreateFile} objects + */ + protected $adminFile = array(); + + /** + * Modules + * + * @var array + */ + protected $module = array(); + + /** + * Text + * + * @var array + */ + public $text = array(); + + /** + * Userpager + * + * @var boolean + */ + private $userpager = false; + + /** + * Adminpager + * + * @var boolean + */ + private $adminpager = false; + + /** + * Constructor + * + * @param TDMCreateFile|null $file + * @param string $module + */ + public function __construct(TDMCreateFile $file = null, $module = '', $text = '') + { + if (isset($file)) { + $this->create($file, $module); + $this->text = $text; + } + } + + /** + * @param TDMCreateFile $adminFile + * @param string $module + * @return TDMCreateFile + */ + public function create(TDMCreateFile $adminFile, $module = '') + { + $this->adminFile[] = $adminFile; + $this->module[] = $module; + return $this; + } + + /** + * @param string $module + * @param string $module_name + * @return $this->text + */ + public function userHeader($module = null, $module_name = null, $tables_arr = array()) + { + $this->text[] = '<?php'; + $this->text[] = TDMCreateCommon::getCommonHeader($module); + $this->text[] = 'require_once dirname(dirname(dirname(__FILE__))) . \'/mainfile.php\';'; + $this->text[] = 'include_once dirname(dirname(__FILE__)) . \'/include/common.php\';'; + $this->text[] = 'include_once dirname(dirname(__FILE__)) . \'/include/functions.php\';'; + $this->text[] = '// Get main instance'; + $this->text[] = 'XoopsLoad::load(\'system\', \'system\');'; + $this->text[] = '$system = System::getInstance();'; + $this->text[] = '// Get main locale instance'; + $this->text[] = '$xoops = Xoops::getInstance();'; + $this->text[] = '$helper = '.ucfirst($module_name).'::getInstance();'; + $this->text[] = '$request = $xoops->request();'; + foreach (array_keys($tables_arr) as $i) + { + $table_name = $tables_arr[$i]->getVar("table_name"); + $this->text[] = '// Get handler '.ucfirst($table_name); + $this->text[] = '$'.strtolower($table_name).'_Handler = $helper->getHandler'.ucfirst($table_name).'();'; + } + $this->text[] = '// Get $_POST, $_GET, $_REQUEST'; + $this->text[] = '$start = $request->asInt(\'start\', 0);'; + if ($this->getUserPager()) + { + $this->text[] = '// Parameters'; + $this->text[] = '$nb_pager = $helper->getConfig(\'adminpager\');'; + } + return $this->text; + } + + /** + * @param string $module + * @param string $module_name + * @return $this->text + */ + public function userIndex($module = null, $module_name = null) + { + $this->text[] = '<?php'; + $this->text[] = TDMCreateCommon::getCommonHeader($module); + return $this->text; + } + + /** + * @param string $module + * @param string $module_name + * @return $this->text + */ + public function userFooter($module = null, $module_name = null) + { + $this->text[] = '<?php'; + $this->text[] = TDMCreateCommon::getCommonHeader($module); + $this->text[] = '$xoops->footer();'; + return $this->text; + } + + /** + * @param string $module + * @param string $module_name + * @return $this->text + */ + public function userPages($module = null, $module_name = null) + { + $this->text[] = '<?php'; + $this->text[] = TDMCreateCommon::getCommonHeader($module); + return $this->text; + } + + /** + * @param string $module + * @param string $module_name + * @return $this->text + */ + public function userXoopsVersion($module = null, $module_name = null, $tables_arr = array()) + { + $menu = 1; + $this->text[] = '<?php'; + $this->text[] = TDMCreateCommon::getCommonHeader($module); + $this->text[] = '$modversion = array();'; + $this->text[] = '$modversion[\'name\'] = '.ucfirst($module_name).'Locale::MODULE_NAME;'; + $this->text[] = '$modversion[\'description\'] = '.ucfirst($module_name).'Locale::MODULE_DESC;'; + $this->text[] = '$modversion[\'version\'] = 1;'; + $this->text[] = '$modversion[\'author\'] = \'Xoops Core Development Team\';'; + $this->text[] = '$modversion[\'nickname\'] = \'TXMod Xoops\';'; + $this->text[] = '$modversion[\'credits\'] = \'The XOOPS Project\';'; + $this->text[] = '$modversion[\'license\'] = \'GNU GPL 2.0\';'; + $this->text[] = '$modversion[\'license_url\'] = \'www.gnu.org/licenses/gpl-2.0.html/\';'; + $this->text[] = '$modversion[\'official\'] = 1;'; + $this->text[] = '$modversion[\'help\'] = \'page=help\';'; + $this->text[] = '$modversion[\'image\'] = \'images/logo.png\';'; + $this->text[] = '$modversion[\'dirname\'] = \''.strtolower($module_name).'\';'; + + $this->text[] = '//about'; + $this->text[] = '$modversion[\'release_date\'] = \'2013/01/01\';'; + $this->text[] = '$modversion[\'module_website_url\'] = \'http://www.xoops.org/\';'; + $this->text[] = '$modversion[\'module_website_name\'] = \'XOOPS\';'; + $this->text[] = '$modversion[\'module_status\'] = \'Alpha\';'; + $this->text[] = '$modversion[\'min_php\'] = \'5.3\';'; + $this->text[] = '$modversion[\'min_xoops\'] = \'2.6.0\';'; + $this->text[] = '$modversion[\'min_db\'] = array(\'mysql\'=>\'5.0.7\', \'mysqli\'=>\'5.0.7\');'; + + $this->text[] = '// paypal'; + $this->text[] = '$modversion[\'paypal\'] = array();'; + $this->text[] = '$modversion[\'paypal\'][\'business\'] = \'xoo...@gm...\';'; + $this->text[] = '$modversion[\'paypal\'][\'item_name\'] = \'Donation : \' . '.ucfirst($module_name).'Locale::MODULE_DESC;'; + $this->text[] = '$modversion[\'paypal\'][\'amount\'] = 0;'; + $this->text[] = '$modversion[\'paypal\'][\'currency_code\'] = \'USD\';'; + + $this->text[] = '// Admin menu'; + $this->text[] = '// Set to 1 if you want to display menu generated by system module'; + $this->text[] = '$modversion[\'system_menu\'] = 1;'; + $this->text[] = '// Admin things'; + $this->text[] = '$modversion[\'hasAdmin\'] = 1;'; + $this->text[] = '$modversion[\'adminindex\'] = \'admin/index.php\';'; + $this->text[] = '$modversion[\'adminmenu\'] = \'admin/menu.php\';'; + $this->text[] = '// Scripts to run upon installation or update'; + $this->text[] = '$modversion[\'onInstall\'] = \'include/install.php\';'; + $this->text[] = '// JQuery'; + $this->text[] = '$modversion[\'jquery\'] = 1;'; + $this->text[] = '// Menu'; + $this->text[] = '$modversion[\'hasMain\'] = 1;'; + $this->text[] = '// Mysql file'; + $this->text[] = '$modversion[\'sqlfile\'][\'mysql\'] = \'sql/mysql.sql\';'; + + $this->text[] = '// Tables created by sql file (without prefix!)'; + foreach (array_keys($tables_arr) as $i) + { + $table_name = $tables_arr[$i]->getVar("table_name"); + $this->text[] = '$modversion[\'tables\'][1] = \''.strtolower($module_name).'_'.strtolower($table_name).'\';'; + } + $this->text[] = '// blocks'; + $this->text[] = '$i = 0;'; + $this->text[] = '$modversion[\'blocks\'][$i][\'file\'] = \''.strtolower($module_name).'_blocks.php\';'; + $this->text[] = '$modversion[\'blocks\'][$i][\'name\'] = '.ucfirst($module_name).'Locale::BLOCKS_'.strtoupper($module_name).';'; + $this->text[] = '$modversion[\'blocks\'][$i][\'description\'] = '.ucfirst($module_name).'Locale::BLOCKS_'.strtoupper($module_name).'_DESC;'; + $this->text[] = '$modversion[\'blocks\'][$i][\'show_func\'] = \''.strtolower($module_name).'_blocks_show\';'; + $this->text[] = '$modversion[\'blocks\'][$i][\'edit_func\'] = \''.strtolower($module_name).'_blocks_edit\';'; + $this->text[] = '$modversion[\'blocks\'][$i][\'options\'] = \'1|2|3|4|5\';'; + $this->text[] = '$modversion[\'blocks\'][$i][\'template\'] = \''.strtolower($module_name).'_blocks.html\';'; + $this->text[] = '$i++;'; + + $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][\'title\'] = '.ucfirst($module_name).'Locale::CONF_EDITOR;'; + $this->text[] = '$modversion[\'config\'][$i][\'description\'] = \'\';'; + $this->text[] = '$modversion[\'config\'][$i][\'formtype\'] = \'select\';'; + $this->text[] = '$modversion[\'config\'][$i][\'valuetype\'] = \'text\';'; + $this->text[] = '$modversion[\'config\'][$i][\'default\'] = \'dhtmltextarea\';'; + $this->text[] = '$modversion[\'config\'][$i][\'options\'] = $editors;'; + if ($this->getAdminPager()) + { + $this->text[] = '$i++;'; + $this->text[] = '$modversion[\'config\'][$i][\'name\'] = \''.strtolower($module_name).'_adminpager\';'; + $this->text[] = '$modversion[\'config\'][$i][\'title\'] = '.ucfirst($module_name).'Locale::CONF_ADMINPAGER;'; + $this->text[] = '$modversion[\'config\'][$i][\'description\'] = \'\';'; + $this->text[] = '$modversion[\'config\'][$i][\'formtype\'] = \'textbox\';'; + $this->text[] = '$modversion[\'config\'][$i][\'valuetype\'] = \'int\';'; + $this->text[] = '$modversion[\'config\'][$i][\'default\'] = 20;'; + } + if ($this->getUserPager()) + { + $this->text[] = '$i++;'; + $this->text[] = '$modversion[\'config\'][$i][\'name\'] = \''.strtolower($module_name).'_userpager\';'; + $this->text[] = '$modversion[\'config\'][$i][\'title\'] = '.ucfirst($module_name).'Locale::CONF_USERPAGER;'; + $this->text[] = '$modversion[\'config\'][$i][\'description\'] = \'\';'; + $this->text[] = '$modversion[\'config\'][$i][\'formtype\'] = \'textbox\';'; + $this->text[] = '$modversion[\'config\'][$i][\'valuetype\'] = \'int\';'; + $this->text[] = '$modversion[\'config\'][$i][\'default\'] = 20;'; + } + $this->text[] = 'unset($i);'; + return $this->text; + } + + /** + * @param null + */ + private function getUserPager() + { + return $this->userpager; + } + + /** + * @param null + */ + private function getAdminPager() + { + return $this->adminpager; + } } \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php 2013-03-20 15:54:10 UTC (rev 11268) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php 2013-03-20 19:35:42 UTC (rev 11269) @@ -124,31 +124,31 @@ const CONST_MODULES = "Select the module you want to build"; const CONST_TABLES = "Select the table you want to build"; - const CONST_OK_ARCHITECTURE = "Created structure of module (index.html, icons , languages, admin, ...)"; - const CONST_OK_COMS = "Created files for comments"; - const CONST_OK_DOCS = "Created <b>%s</b> file in the docs"; + const CONST_OK_ARCHITECTURE = "Structure of module (index.html, admin, icons, images, locale, templates, ...)"; + const CONST_OK_COMMENTS = "Created files for comments"; + const CONST_OK_DOCS = "Created <b>%s</b> file in the docs folder"; const CONST_OK_CSS = "Created <b>%s</b> file in the css folder"; - const CONST_OK_ROOTS = "Created <b>%s</b> file in the root of the form"; - const CONST_OK_CLASSES = "Creating the <b>files %s </b> in the class folder"; - const CONST_OK_BLOCKS = "Created the file in the <b>%s</b> blocks folder"; - const CONST_OK_SQL = "Created <b>%s</b> file in your sql"; + const CONST_OK_ROOTS = "Created <b>%s</b> file in the root of this module"; + const CONST_OK_CLASSES = "Created <b>%s</b> file in the class folder"; + const CONST_OK_BLOCKS = "Created <b>%s</b> file in the blocks folder"; + const CONST_OK_SQL = "Created <b>%s</b> file in your sql folder"; const CONST_OK_ADMINS = "Created <b>%s</b> file in the admin folder"; - const CONST_OK_LANGUAGES = "Created <b>%s</b> file in the folder languages"; - const CONST_OK_INCLUDES = "Created <b>%s</b> file in the folder includes"; - const CONST_OK_TEMPLATES = "Created <b>%s</b> file in the templates"; - const CONST_OK_TEMPLATES_BLOCS = "Created <b>%s</b> file in the templates/blocks"; - const CONST_OK_TEMPLATES_ADMIN = "Created <b>%s</b> file in the templates/admin"; + const CONST_OK_LANGUAGES = "Created <b>%s</b> file in the locale folder"; + const CONST_OK_INCLUDES = "Created <b>%s</b> file in the include folder"; + const CONST_OK_TEMPLATES = "Created <b>%s</b> file in the templates folder"; + const CONST_OK_TEMPLATES_BLOCS = "Created <b>%s</b> file in the templates/blocks folder"; + const CONST_OK_TEMPLATES_ADMIN = "Created <b>%s</b> file in the templates/admin folder"; const CONST_NOTOK_ARCHITECTURE = "Problems: Creating the module (index.html, icons ,...)"; - const CONST_NOTOK_COMS = "Problems: Creating files for comments"; + const CONST_NOTOK_COMMENTS = "Problems: Creating files for comments"; const CONST_NOTOK_DOCS = "Problems: Creating <b>%s</b> file in the docs folder"; - const CONST_NOTOK_CSS = "Problems: Creating <b>%s</b> file in the folder css"; - const CONST_NOTOK_ROOTS = "Problems: Creating <b>%s</b> file in the root of the form"; + const CONST_NOTOK_CSS = "Problems: Creating <b>%s</b> file in the css folder"; + const CONST_NOTOK_ROOTS = "Problems: Creating <b>%s</b> file in the root of this module"; const CONST_NOTOK_CLASSES = "Problems: Creating <b>%s</b> file in your class folder"; const CONST_NOTOK_BLOCKS = "Problems: Creating <b>%s</b> file in blocks folder"; const CONST_NOTOK_SQL = "Problems: Creating <b>%s</b> file in sql folder"; const CONST_NOTOK_ADMINS = "Problems: Creating <b>%s</b> file in the admin folder"; - const CONST_NOTOK_LANGUAGES = "Problems: Creating <b>%s</b> file in the language folder"; + const CONST_NOTOK_LANGUAGES = "Problems: Creating <b>%s</b> file in the locale folder"; const CONST_NOTOK_INCLUDES = "Problems: Creating <b>%s</b> file in the include folder"; const CONST_NOTOK_TEMPLATES = "Problems: Creating <b>%s</b> file in the templates folder"; const CONST_NOTOK_TEMPLATES_BLOCS = "Problems: Creating <b>%s</b> file in the templates/blocks folder"; |
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 |
From: <txm...@us...> - 2013-04-03 18:20:29
|
Revision: 11340 http://sourceforge.net/p/xoops/svn/11340 Author: txmodxoops Date: 2013-04-03 18:20:26 +0000 (Wed, 03 Apr 2013) Log Message: ----------- Updated Added more files Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-04-03 02:56:45 UTC (rev 11339) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-04-03 18:20:26 UTC (rev 11340) @@ -73,10 +73,7 @@ foreach (array_keys($mod_arr) as $i) { $mod['id'] = $mod_arr[$i]->getVar('mod_id'); $mod['name'] = $mod_arr[$i]->getVar('mod_name'); - $mod['version'] = $mod_arr[$i]->getVar('mod_version'); $mod['image'] = $mod_arr[$i]->getVar('mod_image'); - $mod['release'] = $mod_arr[$i]->getVar('mod_release'); - $mod['status'] = $mod_arr[$i]->getVar('mod_status'); $mod['admin'] = $mod_arr[$i]->getVar('mod_admin'); $mod['user'] = $mod_arr[$i]->getVar('mod_user'); $mod['submenu'] = $mod_arr[$i]->getVar('mod_submenu'); @@ -95,10 +92,7 @@ foreach (array_keys($tables_arr) as $i) { $table['id'] = $tables_arr[$i]->getVar('table_id'); - $table['name'] = $tables_arr[$i]->getVar('table_name'); - $module_name = $modules_Handler->get($tables_arr[$i]->getVar('table_mid')); - $mod_name = $module_name->getVar('mod_name'); - $table['mid'] = $mod_name; + $table['name'] = $tables_arr[$i]->getVar('table_name'); $table['image'] = $tables_arr[$i]->getVar('table_image'); $table['nbfields'] = $tables_arr[$i]->getVar('table_nbfields'); $table['blocks'] = $tables_arr[$i]->getVar('table_blocks'); @@ -147,7 +141,7 @@ 'table_nbfields' => $_POST['table_nbfields'], 'table_fieldname' => $_POST['table_fieldname'])); //Form table_image $pathIcon32 = XOOPS_ROOT_PATH . '/media/xoops/images/icons/32'; - $uploaddir = is_dir($pathIcon32) ? $pathIcon32 : TDMC_TABLES_PATH_IMG; + $uploaddir = ( is_dir($pathIcon32) && XoopsLoad::fileExists($pathIcon32) ) ? $pathIcon32 : TDMC_TABLES_PATH_IMG; $uploader = new XoopsMediaUploader( $uploaddir, $xoops->getModuleConfig('mimetypes'), $xoops->getModuleConfig('maxuploadsize'), null, null); if ($uploader->fetchMedia($_POST['tables_image'][0])) { Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php 2013-04-03 18:20:26 UTC (rev 11340) @@ -0,0 +1,127 @@ +<?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("Restricted access"); + +class TDMCreateFolder extends XoopsFolderHandler +{ + /** + * Constructor. + * + * @param string $path Path to folder + * @param bool $create Create folder if not found + * @param mixed $mode Mode (CHMOD) to apply to created folder, false to ignore + */ + public function __construct($path = '', $create = true, $mode = false) + { + parent::__construct($path, $create, $mode); + } + + /** + * Create a directory. + * + * @param string $path The directory structure to create + * @param int|bool $mode octal value 0755 + * @access public + */ + public function create($path = '', $mode = false) + { + $this->create($path, $mode); + } + + /** + * Change the mode on a directory structure recursively. + * + * @param string $path The path to chmod + * @param int|bool $mode octal value 0755 + * @param bool $recursive chmod recursively + * @param array $exceptions array of files, directories to skip + * @return bool Returns TRUE on success, FALSE on failure + * @access public + */ + public function chmod($path, $mode) + { + $this->chmod($path, $mode); + } +} + +class TDMCreateFile extends XoopsFileHandler +{ + /** + * Constructor + * + * @param string $path Path to file + * @param boolean $create Create file if it does not exist (if true) + * @param integer $mode Mode to apply to the folder holding the file + * @access private + */ + public function __construct($path, $create = false, $mode = 0755) + { + parent::__construct($path, $create, $mode); + $this->create(); + } + + /** + * + * @param string $path_name + * @param string $module_name + * @param string $dirname + * @param string $file + */ + public function getDirFile($path_name, $module_name, $dirname, $file) + { + return $path_name . '/' . $module_name . '/' . $dirname . '/' . $file; + } + + /** + * + * @param string $path + * @param string $text + * @param string $lng_ok + * @param string $lng_notok + * @param string $file + */ + public function createFile($path, $text, $lng_ok, $lng_notok, $file) + { + $this->path = $path; + $this->open('a+'); + if ($this->writable()) + { + if ($this->write($text) === false) { + echo '<tr> + <td>'.sprintf($lng_notok, $file).'</td> + <td><img src='. $pathIcon16 .'/off.png></td> + </tr>'; + exit; + } + echo '<tr> + <td>'.sprintf($lng_ok, $file).'</td> + <td><img src='. $pathIcon16 .'/on.png></td> + </tr>'; + $this->close(); + } else { + echo '<tr> + <td>'.sprintf($lng_notok, $file).'</td> + <td><img src='. $pathIcon16 .'/off.png></td> + </tr>'; + } + } +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.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 Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php 2013-04-03 02:56:45 UTC (rev 11339) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php 2013-04-03 18:20:26 UTC (rev 11340) @@ -21,64 +21,6 @@ */ defined('XOOPS_ROOT_PATH') or die("Restricted access"); -class TDMCreateFolder extends XoopsFolderHandler -{ - /** - * Constructor. - * - * @param string $path Path to folder - * @param bool $create Create folder if not found - * @param mixed $mode Mode (CHMOD) to apply to created folder, false to ignore - */ - public function __construct($path = '', $create = true, $mode = false) - { - parent::__construct($path, $create, $mode); - } - - /** - * Create a directory. - * - * @param string $path The directory structure to create - * @param int|bool $mode octal value 0755 - * @access public - */ - public function create($path = '', $mode = false) - { - $this->create($path, $mode); - } - - /** - * Change the mode on a directory structure recursively. - * - * @param string $path The path to chmod - * @param int|bool $mode octal value 0755 - * @param bool $recursive chmod recursively - * @param array $exceptions array of files, directories to skip - * @return bool Returns TRUE on success, FALSE on failure - * @access public - */ - public function chmod($path, $mode) - { - $this->chmod($path, $mode); - } -} - -class TDMCreateFile extends XoopsFileHandler -{ - /** - * Constructor - * - * @param string $path Path to file - * @param boolean $create Create file if it does not exist (if true) - * @param integer $mode Mode to apply to the folder holding the file - * @access private - */ - function __construct($path, $create = false, $mode = 0755) - { - parent::__construct($path, $create, $mode); - } -} - class TDMCreateStructure extends TDMCreateFile { /** Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt 2013-04-03 18:20:26 UTC (rev 11340) @@ -0,0 +1,4 @@ +Read Me First +============= + +Please make sure that you download the XOOPS Icon Set, and upload it to uploads/images directory \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-04-03 02:56:45 UTC (rev 11339) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-04-03 18:20:26 UTC (rev 11340) @@ -7,12 +7,9 @@ <tr> <th class='txtcenter'><{translate key="ID"}></th> <th class='txtcenter'><{translate key="NAME"}></th> - <th class='txtcenter'><{translate key="VERSION"}></th> <th class='txtcenter'><{translate key="IMAGE"}></th> - <th class='txtcenter'><{translate key="RELEASE"}></th> - <th class='txtcenter'><{translate key="STATUS"}></th> <th class='txtcenter'><{translate key="FIELDS"}></th> - <th class='txtcenter'><{translate key="BLOCKS"}></th> + <th class='txtcenter'><{translate key="BLOCKS"}></th> <th class='txtcenter'><{translate key="ADMIN"}></th> <th class='txtcenter'><{translate key="USER"}></th> <th class='txtcenter'><{translate key="SUBMENU"}></th> @@ -27,10 +24,7 @@ <tr class='<{cycle values='even,odd'}>'> <td class='center'><{$module.id}></td> <td class='center'><{$module.name}></td> - <td class='center'><{$module.version}></td> <td class='center'><img src='<{xoAppUrl uploads/tdmcreate/images/modules}>/<{$module.image}>' height='20px' title='<{$module.name}>' alt='<{$module.name}>' /></td> - <td class='center'><{$module.release}></td> - <td class='center'><{$module.status}></td> <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/16/fields.png}>' /></td> <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/16/blocks.png}>' /></td> <td class='center'><img src='<{if $module.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> @@ -57,10 +51,8 @@ <tr class='<{cycle values='even,odd'}>'> <td class='center'><{$table.id}></td> <td class='center'><{$table.name}></td> - <td class='center'><{$table.mid}></td> <!-- uploads/tdmcreate/images/tables --> - <td class='center'><img src='<{xoAppUrl media/xoops/images/icons/32}>/<{$table.image}>' title='<{$table.name}>' alt='<{$table.name}>' height='20px' /></td> - <td class='center'> </td> - <td class='center'> </td> + <!-- uploads/tdmcreate/images/tables --> + <td class='center'><img src='<{xoAppUrl media/xoops/images/icons/32}>/<{$table.image}>' title='<{$table.name}>' alt='<{$table.name}>' height='20px' /></td> <td class='center'><{$table.nbfields}></td> <td class='center'><img src='<{if $table.blocks}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> |
From: <txm...@us...> - 2013-04-16 15:20:01
|
Revision: 11387 http://sourceforge.net/p/xoops/svn/11387 Author: txmodxoops Date: 2013-04-16 15:19:57 +0000 (Tue, 16 Apr 2013) Log Message: ----------- Updated Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2013-04-16 15:19:57 UTC (rev 11387) @@ -42,7 +42,7 @@ $criteria->setSort('table_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); - $criteria->setLimit($nb_pager); + $criteria->setLimit($limit); $numrows_tables = $tables_Handler->getCount($criteria); $table_arr = $tables_Handler->getAll($criteria); $xoops->tpl()->assign('tables_count', $numrows_tables); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2013-04-16 15:19:57 UTC (rev 11387) @@ -39,6 +39,6 @@ $op = $request->asStr('op', 'list'); $start = $request->asInt('start', 0); // Parameters -$nb_pager = $helper->getConfig('adminpager'); +$limit = $helper->getConfig('adminpager'); // Get admin menu istance $admin_menu = new XoopsModuleAdmin(); \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2013-04-16 15:19:57 UTC (rev 11387) @@ -23,7 +23,6 @@ $mod_id = $system->cleanVars($_REQUEST, 'mod_id', 0, 'int'); // Get handler $xoops->header('tdmcreate_modules.html'); - $admin_menu->renderNavigation('modules.php'); switch ($op) { @@ -36,7 +35,7 @@ $criteria->setSort('mod_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); - $criteria->setLimit($nb_pager); + $criteria->setLimit($limit); $numrows_mods = $modules_Handler->getCount($criteria); $mod_arr = $modules_Handler->getAll($criteria); // Assign Template variables @@ -60,8 +59,8 @@ unset($mod); } // Display Page Navigation - if ($numrows_mods > $nb_pager) { - $nav = new XoopsPageNav($numrows_mods, $nb_pager, $start, 'start'); + if ($numrows_mods > $limit) { + $nav = new XoopsPageNav($numrows_mods, $limit, $start, 'start'); $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-04-16 15:19:57 UTC (rev 11387) @@ -55,17 +55,7 @@ // Redirect if there aren't modules /* if ( $numrows_mods == 0 ) { $xoops->redirect('modules.php?op=new', 2, TDMCreateLocale::NOTMODULES ); - }*/ - $criteria = new CriteriaCompo(); - $criteria->setSort('table_name'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($nb_pager); - $numrows_tables = $tables_Handler->getCount($criteria); - $tables_arr = $tables_Handler->getAll($criteria); - $xoops->tpl()->assign('tables_count', $numrows_tables); - $xoops->tpl()->assign('timg_path', TDMC_TABLES_URL_IMG); - unset($criteria); + }*/ // Assign Template variables $xoops->tpl()->assign('mods_count', $numrows_mods); @@ -79,32 +69,46 @@ $mod['submenu'] = $mod_arr[$i]->getVar('mod_submenu'); $mod['search'] = $mod_arr[$i]->getVar('mod_search'); $mod['comments'] = $mod_arr[$i]->getVar('mod_comments'); - $mod['notifications'] = $mod_arr[$i]->getVar('mod_notifications'); + $mod['notifications'] = $mod_arr[$i]->getVar('mod_notifications'); + /*if (file_exists($timage = XOOPS_URL ."/uploads/tdmcreate/images/tables/".$table_image)) { + $table['image'] = $timage; + } elseif (file_exists($timage = XOOPS_URL ."/media/xoops/images/icons/32/".$table_image)) { + $table['image'] = $timage; + }*/ + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('table_mid', $i)); + $criteria->setSort('table_name'); + $criteria->setOrder('ASC'); + $criteria->setStart($start); + $criteria->setLimit($nb_pager); + $numrows_tables = $tables_Handler->getCount($criteria); + $tables_arr = $tables_Handler->getAll($criteria); + $xoops->tpl()->assign('tables_count', $numrows_tables); + $xoops->tpl()->assign('timg_path', TDMC_TABLES_URL_IMG); + unset($criteria); + $tables = array(); + if ($numrows_tables > 0) { + foreach (array_keys($tables_arr) as $i) + { + $table['id'] = $tables_arr[$i]->getVar('table_id'); + $table['name'] = $tables_arr[$i]->getVar('table_name'); + $table['image'] = $tables_arr[$i]->getVar('table_image'); + $table['nbfields'] = $tables_arr[$i]->getVar('table_nbfields'); + $table['blocks'] = $tables_arr[$i]->getVar('table_blocks'); + $table['admin'] = $tables_arr[$i]->getVar('table_admin'); + $table['user'] = $tables_arr[$i]->getVar('table_user'); + $table['submenu'] = $tables_arr[$i]->getVar('table_submenu'); + $table['search'] = $tables_arr[$i]->getVar('table_search'); + $table['comments'] = $tables_arr[$i]->getVar('table_comments'); + $table['notifications'] = $tables_arr[$i]->getVar('table_notifications'); + //$xoops->tpl()->append_by_ref('tables', $table); + $tables[] = $table; + unset($table); + } + } + $mod['tables'] = $tables; $xoops->tpl()->append_by_ref('modules', $mod); - unset($mod); - } - /*if (is_dir($timage = XOOPS_URL ."/uploads/tdmcreate/images/tables/".$table_image)) { - $table['image'] = $timage; - } elseif (is_dir($timage = XOOPS_URL ."/media/xoops/images/icons/32/".$table_image)) { - $table['image'] = $timage; - }*/ - if ($numrows_tables > 0) { - foreach (array_keys($tables_arr) as $i) - { - $table['id'] = $tables_arr[$i]->getVar('table_id'); - $table['name'] = $tables_arr[$i]->getVar('table_name'); - $table['image'] = $tables_arr[$i]->getVar('table_image'); - $table['nbfields'] = $tables_arr[$i]->getVar('table_nbfields'); - $table['blocks'] = $tables_arr[$i]->getVar('table_blocks'); - $table['admin'] = $tables_arr[$i]->getVar('table_admin'); - $table['user'] = $tables_arr[$i]->getVar('table_user'); - $table['submenu'] = $tables_arr[$i]->getVar('table_submenu'); - $table['search'] = $tables_arr[$i]->getVar('table_search'); - $table['comments'] = $tables_arr[$i]->getVar('table_comments'); - $table['notifications'] = $tables_arr[$i]->getVar('table_notifications'); - $xoops->tpl()->append_by_ref('tables', $table); - unset($tables); - } + unset($mod); } // Display Page Navigation if ($numrows_mods > $nb_pager) { @@ -135,20 +139,22 @@ } else { $obj = $tables_Handler->create(); } - $mid = $request->asInt('mod_id', 0); - //Form tables - $obj->setVars(array('table_mid' => $_POST['table_mid'], 'table_name' => $_POST['table_name'], - 'table_nbfields' => $_POST['table_nbfields'], 'table_fieldname' => $_POST['table_fieldname'])); + $table_mid = $request->asInt('table_mid', 0); + $table_nbfields = $request->asInt('table_nbfields', 0); + $table_fieldname = $request->asStr('table_fieldname', ''); + //Form tables + $obj->setVars(array('table_mid' => $table_mid, 'table_name' => $_POST['table_name'], + 'table_nbfields' => $table_nbfields, 'table_fieldname' => $table_fieldname)); //Form table_image $pathIcon32 = XOOPS_ROOT_PATH . '/media/xoops/images/icons/32'; $uploaddir = ( is_dir($pathIcon32) && XoopsLoad::fileExists($pathIcon32) ) ? $pathIcon32 : TDMC_TABLES_PATH_IMG; $uploader = new XoopsMediaUploader( $uploaddir, $xoops->getModuleConfig('mimetypes'), $xoops->getModuleConfig('maxuploadsize'), null, null); - if ($uploader->fetchMedia($_POST['tables_image'][0])) { - $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['tables_image']['name']); - $name_img = $_GET['table_name'].'.'.$extension; - $uploader->setPrefix($name_img); - $uploader->fetchMedia($_POST['tables_image'][0]); + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { + $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']); + $img_name = $_GET['table_name'].'.'.$extension; + $uploader->setPrefix($img_name); + $uploader->fetchMedia($_POST['xoops_upload_file'][0]); if (!$uploader->upload()) { $xoops->redirect('javascript:history.go(-1)',3, $uploader->getErrors()); } else { @@ -170,12 +176,14 @@ 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'), 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0'))); - if( $tables_Handler->insert($obj) && $obj->isNew() ) { - $tid = $xoops->db()->getInsertId(); - $xoops->redirect('fields.php?op=new&field_mid='.$mid.'&field_tid='.$tid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, XoopsLocale::S_DATA_INSERTED); - } elseif($tables_Handler->insert($obj) && !$obj->isNew() ) { - $xoops->redirect('tables.php', 3, XoopsLocale::S_DATABASE_UPDATED); - } + if( $tables_Handler->insert($obj) ) { + if( $obj->isNew() ) { + $tid = $xoops->db()->getInsertId(); + $xoops->redirect('fields.php?op=new&field_mid='.$mid.'&field_tid='.$tid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, XoopsLocale::S_DATA_INSERTED); + } else { + $xoops->redirect('tables.php', 3, XoopsLocale::S_DATABASE_UPDATED); + } + } $xoops->error($obj->getHtmlErrors()); $form = $xoops->getModuleForm($obj, 'tables'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php 2013-04-16 15:19:57 UTC (rev 11387) @@ -25,7 +25,7 @@ /** * @param TDMCreateFields|XoopsObject $obj */ - public function __construct(TDMCreateFields &$obj, $field_mid = 0, $field_tid = 0, $field_numb = null, $field_name = '') + public function __construct(TDMCreateFields &$obj, $field_mid = 0, $field_tid = 0, $field_numb = 0, $field_name = '') { $system = System::getInstance(); $xoops = Xoops::getInstance(); @@ -37,7 +37,7 @@ $this->setExtra('enctype="multipart/form-data"'); $tables_Handler = $xoops->getModuleHandler('tables'); - $criteria = new CriteriaCompo(new Criteria('table_mid', $field_mid))); + $criteria = new CriteriaCompo(new Criteria('table_mid', $field_mid)); $criteria->add(new Criteria('table_id', $field_tid)); $criteria->setSort('table_name'); $criteria->setOrder('ASC'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php 2013-04-16 15:19:57 UTC (rev 11387) @@ -48,12 +48,12 @@ $mod_tray->addElement($check_is_extension); $tab1->addElement($mod_tray); // Version module - $tab1->addElement(new XoopsFormText(XoopsLocale::VERSION, 'mod_version', 30, 50, $obj->getVar('mod_version')), true); + $tab1->addElement(new XoopsFormText(XoopsLocale::VERSION, 'mod_version', 2, 4, $obj->getVar('mod_version')), true); // Editor $editor_configs=array(); $editor_configs['name'] = 'mod_description'; $editor_configs['value'] = $obj->getVar('mod_description', 'e'); - $editor_configs['rows'] = 5; + $editor_configs['rows'] = 4; $editor_configs['cols'] = 80; $editor_configs['width'] = '100%'; $editor_configs['height'] = '400px'; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php 2013-04-16 15:19:57 UTC (rev 11387) @@ -66,7 +66,7 @@ $imgtray->addElement($imageselect); $imgtray->addElement( new XoopsFormLabel( '', "<br /><img src='".XOOPS_URL."/".$uploadir."/".$table_image."' name='image3' id='image3' alt='' />" ) ); $fileseltray = new XoopsFormElementTray('','<br />'); - $fileseltray->addElement(new XoopsFormFile(XoopsLocale::A_UPLOAD , 'tables_image', $xoops->getModuleConfig('maxuploadsize'))); + $fileseltray->addElement(new XoopsFormFile(XoopsLocale::A_UPLOAD, 'attachedfile', $xoops->getModuleConfig('maxuploadsize'))); $fileseltray->addElement(new XoopsFormLabel('')); $imgtray->addElement($fileseltray); $this->addElement($imgtray); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html 2013-04-16 15:19:57 UTC (rev 11387) @@ -22,7 +22,7 @@ </thead> <tbody> <{foreach item=mod from=$modules}> - <tr class='<{cycle values='even,odd'}>'> + <tr class="<{cycle values='even,odd'}>"> <td class='txtcenter'><{$mod.id}></td> <td class='txtcenter'><{$mod.name}></td> <td class='txtcenter'><{$mod.version}></td> Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-04-16 12:56:37 UTC (rev 11386) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-04-16 15:19:57 UTC (rev 11387) @@ -47,7 +47,7 @@ </td> </tr> <{if $tables_count > 0}> - <{foreach item=table from=$tables}> + <{foreach item=table from=$module.tables}> <tr class='<{cycle values='even,odd'}>'> <td class='center'><{$table.id}></td> <td class='center'><{$table.name}></td> @@ -83,7 +83,7 @@ </table><br /> <{if $pagenav != ''}> <{$pagenav}> - <{/if}> + <{/if}> <{/if}> <!-- Display form (add,edit) --> <{if $error_message}> |
From: <txm...@us...> - 2015-05-06 14:56:33
|
Revision: 13058 http://sourceforge.net/p/xoops/svn/13058 Author: txmodxoops Date: 2015-05-06 14:56:29 +0000 (Wed, 06 May 2015) Log Message: ----------- Fixings and updates Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/about.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fieldattributes.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fieldelements.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fieldkey.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fieldnull.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fieldtype.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/helper.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/common.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/footer.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/css/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/css/styles.css XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/fonts/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/fonts/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/blocks.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/editfields.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/fields.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/green.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/nb_fields.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/red.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/yellow.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/addmodule.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/addtable.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/builder.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/dashboard.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/editfields.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/edittable.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/extensions.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/32/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/logo_large.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/logo_small.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/images/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/images/default_slogo.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/images/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/images/logo.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/images/naked.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/js/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/js/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/imports.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/imports.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_building.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_imports.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_locale.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.tpl Removed Paths: ------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/css/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/icons/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/images/ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_building.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_import.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/about.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/about.php 2015-05-04 18:50:06 UTC (rev 13057) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/about.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -19,10 +19,10 @@ * @author TDM Xoops (AKA Developers) * @version $Id: about.php 10665 2012-12-27 10:14:15Z timgno $ */ -include dirname(__FILE__) . '/header.php'; -// Header +include __DIR__ . '/header.php'; $xoops->header(); // About -$admin_menu->displayNavigation('about.php'); -$admin_menu->displayAbout('6KJ7RW5DR3VTJ', true); -$xoops->footer(); \ No newline at end of file +$adminMenu->displayNavigation('about.php'); +$adminMenu->displayAbout(true); + +include __DIR__ . '/footer.php'; \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2015-05-04 18:50:06 UTC (rev 13057) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -19,18 +19,11 @@ * @author TDM Xoops (AKA Developers) * @version $Id: building.php 10665 2012-12-27 10:14:15Z timgno $ */ -include dirname(__FILE__) . '/header.php'; -// Get Action type -$op = $system->cleanVars($_REQUEST, 'op', 'default', 'string'); -// heaser -$xoops->header('tdmcreate_building.html'); -// Get handler -/* @var $modules_handler TDMCreateModulesHandler */ -$modules_Handler = $xoops->getModuleHandler('modules'); -/* @var $tables_handler TDMCreateExtensionsHandler */ -$tables_Handler = $xoops->getModuleHandler('tables'); +include __DIR__ . '/header.php'; +// header +$xoops->header('admin:tdmcreate/tdmcreate_building.tpl'); -$admin_menu->renderNavigation('building.php'); +$adminMenu->renderNavigation('building.php'); switch ($op) { case 'default': @@ -39,7 +32,7 @@ $mods_select = new XoopsFormSelect(TDMCreateLocale::BUILDING_MODULES, 'mod_name', 'mod_name'); $mods_select->addOption(0, TDMCreateLocale::BUILDING_SELDEFMOD); - $mods_select->addOptionArray($modules_Handler->getList()); + $mods_select->addOptionArray($modulesHandler->getList()); $form->addElement($mods_select); $form->addElement(new XoopsFormHidden('op', 'build')); @@ -51,8 +44,9 @@ $admin_menu->addItemButton(TDMCreateLocale::BUILDING_FORM, 'building.php', 'application-view-detail'); $admin_menu->renderButton(); - $mods =& $modules_Handler->get($_REQUEST['mod_name']); + $mods =& $modulesHandler->get($_REQUEST['mod_name']); $mods_name = $mods->getVar('mod_name'); break; } -$xoops->footer(); \ No newline at end of file + +include __DIR__ . '/footer.php'; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2015-05-04 18:50:06 UTC (rev 13057) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -18,92 +18,89 @@ * @author TDM Xoops (AKA Developers) * @version $Id: fields.php 10665 2012-12-27 10:14:15Z timgno $ */ -include dirname(__FILE__) . '/header.php'; +include __DIR__ . '/header.php'; +/* +$fieldId = Request::getInt('field_id'); +$fieldMid = Request::getInt('field_mid'); +$fieldTid = Request::getInt('field_tid'); +$fieldNumb = Request::getInt('field_numb'); +$fieldName = Request::getString('field_name', '');*/ -$field_id = $system->cleanVars($_REQUEST, 'field_id', 0, 'int'); -$field_mid = $system->cleanVars($_REQUEST, 'field_mid', 0, 'int'); -$field_tid = $system->cleanVars($_REQUEST, 'field_tid', 0, 'int'); -$field_numb = $system->cleanVars($_REQUEST, 'field_numb', 0, 'int'); -$field_name = $system->cleanVars($_REQUEST, 'field_name', 0, 'int'); - // Get handler -$xoops->header('tdmcreate_fields.html'); +$xoops->header('admin:tdmcreate/tdmcreate_fields.tpl'); -$admin_menu->renderNavigation('fields.php'); +$adminMenu->renderNavigation('fields.php'); switch ($op) { case 'list': default: - $admin_menu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); - $admin_menu->renderButton(); + $adminMenu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); + $adminMenu->renderButton(); // Get modules list - $criteria = new CriteriaCompo(new Criteria('table_mid', $field_mid)); - $criteria->add(new Criteria('table_id', $field_tid)); + $criteria = new CriteriaCompo(new Criteria('table_mid', $fieldMid)); + $criteria->add(new Criteria('table_id', $fieldTid)); $criteria->setSort('table_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); $criteria->setLimit($limit); - $numrows_tables = $tables_Handler->getCount($criteria); - $table_arr = $tables_Handler->getAll($criteria); - $xoops->tpl()->assign('tables_count', $numrows_tables); + $numRowsTables = $tablesHandler->getCount($criteria); + $tablesArray = $tablesHandler->getAll($criteria); + $xoops->tpl()->assign('tables_count', $numRowsTables); unset($criteria); // Redirect if there aren't modules - /* if ( $numrows_mods == 0 ) { - $xoops->redirect('modules.php?op=new', 2, TDMCreateLocale::NOTMODULES ); - }*/ - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('field_tid', $field_tid)); - $criteria->setSort('field_name'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numrows_fields = $fields_Handler->getCount($criteria); - $field_arr = $fields_Handler->getAll($criteria); - unset($criteria); + if ( $numRowsTables == 0 ) { + $xoops->redirect('tables.php?op=new', 2, TDMCreateLocale::E_NO_TABLES ); + } // Assign Template variables $xoops->tpl()->assign('fields_list', true); - $xoops->tpl()->assign('fields_count', $numrows_fields); - if ($numrows_tables > 0) { - foreach (array_keys($table_arr) as $i) { - $tables['id'] = $table_arr[$i]->getVar('table_id'); - $tables['name'] = $table_arr[$i]->getVar('table_name'); - $module_name = $modules_Handler->get($table_arr[$i]->getVar('table_mid')); + $xoops->tpl()->assign('fields_count', $numRowsFields); + if ($numRowsTables > 0) { + foreach (array_keys($tablesArray) as $i) { + $tables['id'] = $tablesArray[$i]->getVar('table_id'); + $tables['name'] = $tablesArray[$i]->getVar('table_name'); + $module_name = $modules_Handler->get($tablesArray[$i]->getVar('table_mid')); $tables['mid'] = $module_name->getVar('mod_name'); - $tables['image'] = $table_arr[$i]->getVar('table_image'); - $tables['nbfields'] = $table_arr[$i]->getVar('table_nbfields'); - $tables['blocks'] = $table_arr[$i]->getVar('table_blocks'); - $tables['admin'] = $table_arr[$i]->getVar('table_admin'); - $tables['user'] = $table_arr[$i]->getVar('table_user'); - $tables['submenu'] = $table_arr[$i]->getVar('table_submenu'); - $tables['search'] = $table_arr[$i]->getVar('table_search'); - $tables['comments'] = $table_arr[$i]->getVar('table_comments'); - $tables['notifications'] = $table_arr[$i]->getVar('table_notifications'); + $tables['image'] = $tablesArray[$i]->getVar('table_image'); + $tables['nbfields'] = $tablesArray[$i]->getVar('table_nbfields'); + $tables['blocks'] = $tablesArray[$i]->getVar('table_blocks'); + $tables['admin'] = $tablesArray[$i]->getVar('table_admin'); + $tables['user'] = $tablesArray[$i]->getVar('table_user'); + $tables['submenu'] = $tablesArray[$i]->getVar('table_submenu'); + $tables['search'] = $tablesArray[$i]->getVar('table_search'); + $tables['comments'] = $tablesArray[$i]->getVar('table_comments'); + $tables['notifications'] = $tablesArray[$i]->getVar('table_notifications'); $xoops->tpl()->append_by_ref('tables', $tables); unset($tables); } - if ($numrows_fields > 0) { - foreach (array_keys($field_arr) as $i) { - $field['id'] = $field_arr[$i]->getVar('field_id'); - $table_name = $tables_Handler->get($field_arr[$i]->getVar('field_tid')); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('field_tid', $fieldTid)); + $criteria->setSort('field_id'); + $criteria->setOrder('ASC'); + $numRowsFields = $fieldsHandler->getCount($criteria); + $fieldsArray = $fieldsHandler->getAll($criteria); + unset($criteria); + if ($numRowsFields > 0) { + foreach (array_keys($fieldsArray) as $i) { + $field['id'] = $fieldsArray[$i]->getVar('field_id'); + $table_name = $tablesHandler->get($fieldsArray[$i]->getVar('field_tid')); $field['tid'] = $table_name->getVar('table_name'); - $field['name'] = $field_arr[$i]->getVar('field_name'); - $field['type'] = $field_arr[$i]->getVar('field_type'); - $field['value'] = $field_arr[$i]->getVar('field_value'); - $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); - $field['attribute'] = $field_arr[$i]->getVar('field_attribute'); - $field['default'] = $field_arr[$i]->getVar('field_default'); - $field['key'] = $field_arr[$i]->getVar('field_key'); - $field['auto_increment'] = $field_arr[$i]->getVar('field_auto_increment'); - $field['blocks'] = $field_arr[$i]->getVar('field_blocks'); - $field['search'] = $field_arr[$i]->getVar('field_search'); - $field['required'] = $field_arr[$i]->getVar('field_required'); + $field['name'] = $fieldsArray[$i]->getVar('field_name'); + $field['type'] = $fieldsArray[$i]->getVar('field_type'); + $field['value'] = $fieldsArray[$i]->getVar('field_value'); + $field['blocks'] = $fieldsArray[$i]->getVar('field_blocks'); + $field['attribute'] = $fieldsArray[$i]->getVar('field_attribute'); + $field['default'] = $fieldsArray[$i]->getVar('field_default'); + $field['key'] = $fieldsArray[$i]->getVar('field_key'); + $field['blocks'] = $fieldsArray[$i]->getVar('field_blocks'); + $field['search'] = $fieldsArray[$i]->getVar('field_search'); + $field['required'] = $fieldsArray[$i]->getVar('field_required'); $xoops->tpl()->append_by_ref('fields', $field); unset($field); } } // Display Page Navigation - if ($numrows_tables > $nb_pager) { - $nav = new XoopsPageNav($numrows_tables, $nb_pager, $start, 'start'); + if ($numRowsTables > $limit) { + $nav = new XoopsPageNav($numRowsTables, $limit, $start, 'start'); $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { @@ -112,10 +109,10 @@ break; case 'new': - $admin_menu->addItemButton(TDMCreateLocale::FIELDS_LIST, 'fields.php', 'application-view-detail'); - $admin_menu->renderButton(); + $adminMenu->addItemButton(TDMCreateLocale::FIELDS_LIST, 'fields.php', 'application-view-detail'); + $adminMenu->renderButton(); - $obj = $fields_Handler->create(); + $obj = $fieldsHandler->create(); $form = $xoops->getModuleForm($obj, 'fields'); $xoops->tpl()->assign('form', $form->render()); break; @@ -124,14 +121,14 @@ if (!$xoops->security()->check()) { $xoops->redirect('fields.php', 3, implode(',', $xoops->security()->getErrors())); } - if ($field_id) { - $obj = $fields_Handler->get($field_id); + if ($fieldId) { + $obj = $fieldsHandler->get($fieldId); } else { - $obj = $fields_Handler->create(); + $obj = $fieldsHandler->create(); } //Form fields - $obj->setVars(array('field_mid' => $field_mid, 'field_tid' => $field_tid, 'field_name' => $field_name, - 'field_numb' => $field_numb, 'field_type' => $_POST['field_type'], + $obj->setVars(array('field_mid' => $fieldMid, 'field_tid' => $fieldTid, 'field_name' => $fieldName, + 'field_numb' => $fieldNumb, 'field_type' => $_POST['field_type'], 'field_value' => $_POST['field_value'], 'field_attribute' => $_POST['field_attribute'], 'field_null' => $_POST['field_null'], 'field_default' => $_POST['field_default'], 'field_key' => $_POST['field_key'], 'field_elements' => $_POST['field_elements'], @@ -143,7 +140,7 @@ 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'), 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0'))); // Save data - if ($fields_Handler->insert($obj)) { + if ($fieldsHandler->insert($obj)) { $xoops->redirect('fields.php', 2, TDMCreateLocale::FORMOK); } @@ -151,29 +148,29 @@ break; case 'edit': - $admin_menu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); - $admin_menu->addItemButton(TDMCreateLocale::FIELDS_LIST, 'fields.php', 'application-view-detail'); - $admin_menu->renderButton(); + $adminMenu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::FIELDS_LIST, 'fields.php', 'application-view-detail'); + $adminMenu->renderButton(); - $obj = $fields_Handler->get($field_tid); + $obj = $fieldsHandler->get($fieldTid); $form = $xoops->getModuleForm($obj, 'fields'); $xoops->tpl()->assign('form', $form->render()); break; case 'delete': - if ($field_id > 0) { - $obj = $fields_Handler->get($field_id); + if ($fieldId > 0) { + $obj = $fieldsHandler->get($fieldId); if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { $xoops->redirect('fields.php', 3, implode(',', $xoops->security()->getErrors())); } - if ($fields_Handler->delete($obj)) { + if ($fieldsHandler->delete($obj)) { $xoops->redirect('fields.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::TABLE)); } else { $xoops->error($obj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $field_id, 'op' => 'delete'), 'fields.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('field_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $fieldId, 'op' => 'delete'), 'fields.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('field_name')) . '<br />'); } } else { $xoops->redirect('fields.php', 1, TDMCreateLocale::E_DATABASE_ERROR); Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/footer.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/footer.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/footer.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -0,0 +1,23 @@ +<?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 TDM Xoops (AKA Developers) + * @version $Id$ + */ + +$xoops->footer(); \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/footer.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 Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2015-05-04 18:50:06 UTC (rev 13057) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -8,7 +8,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - +use Xoops\Core\Request; /** * tdmcreate module * @@ -19,26 +19,33 @@ * @author TXMod Xoops (AKA Timgno) * @version $Id: header.php 10665 2012-12-27 10:14:15Z timgno $ */ -require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php'; -include_once dirname(dirname(__FILE__)) . '/include/common.php'; -include_once dirname(dirname(__FILE__)) . '/include/functions.php'; -include_once dirname(dirname(__FILE__)) . '/class/helper.php'; +require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; // Get main instance XoopsLoad::load('system', 'system'); $system = System::getInstance(); -// Get main locale instance -$xoops = Xoops::getInstance(); -$helper = TDMCreate::getInstance(); -$request = $xoops->request(); +// +$helper = Xoops\Module\Helper::getHelper('tdmcreate'); +$xoops = $helper->xoops(); +// Load local libraries +XoopsLoad::loadFile($xoops->path(dirname(__DIR__) . '/include/common.php')); +XoopsLoad::loadFile($xoops->path(dirname(__DIR__) . '/include/functions.php')); // Get handler -$modules_Handler = $helper->getHandlerModules(); -$tables_Handler = $helper->getHandlerTables(); -$import_Handler = $helper->getHandlerImport(); -$fields_Handler = $helper->getHandlerFields(); +$modulesHandler = $helper->getModulesHandler(); +$tablesHandler = $helper->getTablesHandler(); +$fieldsHandler = $helper->getFieldsHandler(); +$localeHandler = $helper->getLocalesHandler(); +$importHandler = $helper->getImportsHandler(); // Get $_POST, $_GET, $_REQUEST -$op = $request->asStr('op', 'list'); -$start = $request->asInt('start', 0); +$op = Request::getCmd('op'); +$start = Request::getInt('start', 0); // Parameters $limit = $helper->getConfig('adminpager'); +// Add Script +$xoops->theme()->addScript('media/xoops/xoops.js'); +$xoops->theme()->addScript('modules/system/js/admin.js'); +$xoops->theme()->addScript('modules/tdmcreate/assets/js/functions.js'); +// Add Stylesheet +$xoops->theme()->addStylesheet('modules/system/css/admin.css'); +$xoops->theme()->addStylesheet('modules/tdmcreate/assets/css/admin.css'); // Get admin menu istance -$admin_menu = new XoopsModuleAdmin(); \ No newline at end of file +$adminMenu = new \Xoops\Module\Admin(); \ No newline at end of file Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -0,0 +1,213 @@ +<?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 XOOPS Development Team + * @version $Id$ + */ +include __DIR__ . '/header.php'; +// heaser +$xoops->header('admin:tdmcreate/tdmcreate_imports.tpl'); +// +//$importId = Request::getInt('import_id', 0); +// +$adminMenu->renderNavigation('imports.php'); +// +switch ($op) +{ + case 'list': + $adminMenu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'imports.php?op=new', 'add'); + $adminMenu->renderButton(); + // Get modules list + $criteria = new CriteriaCompo(); + $criteria->setSort('import_name'); + $criteria->setOrder('ASC'); + $criteria->setStart($start); + $criteria->setLimit($limit); + $numImports = $importHandler->getCount($criteria); + $importArr = $importHandler->getAll($criteria); + // Assign Template variables + $xoops->tpl()->assign('imports_count', $numImports); + unset($criteria); + if ($numImports > 0) { + foreach (array_keys($importArr) as $i) { + $import['id'] = $importArr[$i]->getVar('import_id'); + $import['mid'] = $importArr[$i]->getVar('import_mid'); + $import['name'] = $importArr[$i]->getVar('import_name'); + $import['nbtables'] = $importArr[$i]->getVar('import_nbtables'); + $import['nbfields'] = $importArr[$i]->getVar('import_nbfields'); + $xoops->tpl()->append_by_ref('imports', $import); + unset($import); + } + // Display Page Navigation + if ($numrows > $limit) { + $nav = new XoopsPageNav($numrows, $limit, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', TDMCreateLocale::IMPORT_ERROR_NOIMPORTS); + } + break; + + case 'new': + $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'imports.php', 'application-view-detail'); + $adminMenu->renderButton(); + + $obj = $importHandler->create(); + $form = $xoops->getModuleForm($obj, 'import'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'save': + if (!$xoops->security()->check()) { + $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); + } + + if ($importId > 0) { + $obj = $importHandler->get($importId); + //Form imported edited save + $obj->setVar('import_mid', $_POST['import_mid']); + $obj->setVar('import_name', $_POST['import_name']); + $obj->setVar('import_nbtables', $_POST['import_nbtables']); + $obj->setVar('import_tablename', $_POST['import_mid']); + $obj->setVar('import_nbfields', $_POST['import_nbfields']); + $obj->setVar('import_fieldelements', $_POST['import_fieldelements']); + } else { + $obj = $importHandler->create(); + //Form imported save + $obj->setVar('import_name', $_POST['import_name']); + $obj->setVar('import_mid', $_POST['import_mid']); + $files = $_FILES['importfile']; + // If incoming data have been entered correctly + if($_POST['upload'] == XoopsLocale::A_SUBMIT && isset($files['tmp_name']) && (substr($files['name'], -4) == '.sql')) + { + // File recovery + $dir = TDMC_UPLOAD_PATH_FILES; + $file = $_FILES['importfile']; + $tmpName = $file['tmp_name']; + // Copy files to the server + if (is_uploaded_file($tmpName)) { + readfile($tmpName); + // The directory where you saved the file + if ($file['error'] == UPLOAD_ERR_OK) { + if (move_uploaded_file($tmpName, $dir.'/'.$file['name'])); + $xoops->redirect('imports.php', 3, sprintf(TDMCreateLocale::E_FILE_UPLOADING, $file['name'])); + } + } else { + $xoops->redirect('imports.php', 3, sprintf(TDMCreateLocale::E_FILE_NOT_UPLOADING, $tmpName)); + } + + // Copies data in the db + $filename = $dir.'/'.$file['name']; + // File size + $filesize = $files['size']; + // Check that the file was inserted and that there is + if ( ($handle = fopen($filename, 'r') ) !== false) { + // File reading until at the end + while ( !feof( $handle )) + { + $buffer = fgets($handle, filesize($filename)); + if(strlen($buffer) > 1) + { + // search all comments + $search = array ( '/\/\*.*(\n)*.*(\*\/)?/', '/\s*--.*\n/', '/\s*#.*\n/' ); + // and replace with null + $replace = array ( "\n" ); + $buffer = preg_replace($search, $replace, $buffer); + $buffer = str_replace('`', '', $buffer); + $buffer = str_replace(',', '', $buffer); + + preg_match_all('/((\s)*(CREATE TABLE)(\s)+(.*)(\s)+(\())/', $buffer, $tableMatch); // table name ... (match) + if(count($tableMatch[0]) > 0) { + array_push( $resultTable, $tableMatch[5][0] ); + } + } else { + $xoops->redirect('imports.php', 3, sprintf(TDMCreateLocale::E_SQL_FILE_DATA_NOT_MATCH, $buffer)); + } + } + + // Insert query + if(strlen($resultTable[0]) > 0) + { + $t = 0; + foreach(array_keys($resultTable) as $table) + { + $obj->setVar('import_tablename', $resultTable[$table]); //$_POST['import_tablename'] + $obj->setVar('import_nbtables', $t); $t++; //$_POST['import_nbtables'] + if(strlen($resultTable[0]) > 0) + { + $f = 0; + foreach(array_keys($resultFields) as $field) + { + $obj->setVar('import_nbfields', $f); $f++; // $_POST['import_nbfields'] + $obj->setVar('import_fieldelements', $_POST['import_fieldelements']); + } + unset($f); + } + } + unset($t); + } + } else { + $xoops->redirect('imports.php', 3, TDMCreateLocale::E_FILE_NOT_OPEN_READING); + } + $xoops->redirect('imports.php', 3, TDMCreateLocale::S_DATA_ENTERED); + fclose($handle); + } else { + $xoops->redirect('imports.php', 3, TDMCreateLocale::E_DATABASE_SQL_FILE_NOT_IMPORTED); + } + } + + if ($importHandler->insert($obj)) { + $xoops->redirect('imports.php', 3, TDMCreateLocale::FORM_OK); + } + + $xoops->error($obj->getHtmlErrors()); + $form = $xoops->getModuleForm($obj, 'import'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'edit': + $adminMenu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'imports.php?op=import', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'imports.php', 'application-view-detail'); + $adminMenu->renderButton(); + + $obj = $importHandler->get($importId); + $form = $xoops->getModuleForm($obj, 'import'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'delete': + if ($importId > 0) { + $obj = $importHandler->get($importId); + if (isset($_POST['ok']) && $_POST['ok'] == 1) { + if (!$xoops->security()->check()) { + $xoops->redirect('imports.php', 3, implode(',', $xoops->security()->getErrors())); + } + if ($importHandler->delete($obj)) { + $xoops->redirect('imports.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::IMPORT)); + } else { + $xoops->error($obj->getHtmlErrors()); + } + } else { + $xoops->confirm(array('ok' => 1, 'id' => $importId, 'op' => 'delete'), 'imports.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('import_name')) . '<br />'); + } + } else { + $xoops->redirect('imports.php', 1, TDMCreateLocale::E_DATABASE_ERROR); + } + break; +} + +include __DIR__ . '/footer.php'; \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.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 Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2015-05-04 18:50:06 UTC (rev 13057) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -19,36 +19,53 @@ * @author TDM Xoops (AKA Developers) * @version $Id: index.php 10665 2012-12-27 10:14:15Z timgno $ */ -include dirname(__FILE__) . '/header.php'; -// Heaser +include __DIR__ . '/header.php'; +// header $xoops->header(); // tdmcreate modules $criteria = new CriteriaCompo(); $criteria->add(new Criteria('mod_id', 0, '!=')); -$tdmcreate_modules = $modules_Handler->getCount($criteria); +$modules = $modulesHandler->getCount($criteria); +unset($criteria); // tdmcreate tables $criteria = new CriteriaCompo(); $criteria->add(new Criteria('table_mid', 0, '!=')); -$tdmcreate_tables = $tables_Handler->getCount($criteria); +$tables = $tablesHandler->getCount($criteria); +unset($criteria); +// tdmcreate tables +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('field_mid', 0, '!=')); +$criteria->add(new Criteria('field_tid', 0, '!=')); +$fields = $fieldsHandler->getCount($criteria); +unset($criteria); +// tdmcreate modules +$criteria = new CriteriaCompo(); +$criteria->add(new Criteria('loc_mid', 0, '!=')); +$locale = $localeHandler->getCount($criteria); +unset($criteria); // tdmcreate import $criteria = new CriteriaCompo(); $criteria->add(new Criteria('import_id', 0, '!=')); -$tdmcreate_import = $import_Handler->getCount($criteria); - +$import = $importHandler->getCount($criteria); +unset($criteria); $r = "red"; $g = "green"; -$modules_color = $tdmcreate_modules == 0 ? $r : $g; -$tables_color = $tdmcreate_tables == 0 ? $r : $g; -$import_color = $tdmcreate_import == 0 ? $r : $g; +$modulesColor = $modules == 0 ? $r : $g; +$tablesColor = $tables == 0 ? $r : $g; +$fieldsColor = $fields == 0 ? $r : $g; +$localeColor = $locale == 0 ? $r : $g; +$importColor = $import == 0 ? $r : $g; -$admin_menu->displayNavigation('index.php'); +$adminMenu->displayNavigation('index.php'); -$admin_menu->addInfoBox(TDMCreateLocale::INDEX_STATISTICS); -$admin_menu->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NMTOTAL, '<span class="'.$modules_color.'">' . $tdmcreate_modules . '</span>')); -$admin_menu->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NTTOTAL, '<span class="'.$tables_color.'">' . $tdmcreate_tables . '</span>')); -$admin_menu->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NITOTAL, '<span class="'.$import_color.'">' . $tdmcreate_import . '</span>')); +$adminMenu->addInfoBox(TDMCreateLocale::INDEX_STATISTICS); +$adminMenu->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NMTOTAL, '<span class="'.$modulesColor.'">' . $modules . '</span>')); +$adminMenu->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NTTOTAL, '<span class="'.$tablesColor.'">' . $tables . '</span>')); +$adminMenu->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NFTOTAL, '<span class="'.$fieldsColor.'">' . $fields . '</span>')); +$adminMenu->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NLTOTAL, '<span class="'.$localeColor.'">' . $locale . '</span>')); +$adminMenu->addInfoBoxLine(sprintf(TDMCreateLocale::F_INDEX_NITOTAL, '<span class="'.$importColor.'">' . $import . '</span>')); // folder path -$folder_path = array( +$folderPath = array( XOOPS_UPLOAD_PATH . '/tdmcreate/', XOOPS_UPLOAD_PATH . '/tdmcreate/files', XOOPS_UPLOAD_PATH . '/tdmcreate/repository', @@ -56,16 +73,17 @@ XOOPS_UPLOAD_PATH . '/tdmcreate/images/modules', XOOPS_UPLOAD_PATH . '/tdmcreate/images/tables' ); -foreach ($folder_path as $folder) { - $admin_menu->addConfigBoxLine($folder, 'folder'); - $admin_menu->addConfigBoxLine(array($folder, '777'), 'chmod'); +foreach ($folderPath as $folder) { + $adminMenu->addConfigBoxLine($folder, 'folder'); + $adminMenu->addConfigBoxLine(array($folder, '777'), 'chmod'); } // extension $extensions = array('xtranslator' => 'extension'); foreach ($extensions as $module => $type) { - $admin_menu->addConfigBoxLine(array($module, 'warning'), $type); + $adminMenu->addConfigBoxLine(array($module, 'warning'), $type); } -$admin_menu->displayIndex(); -$xoops->footer(); \ No newline at end of file +$adminMenu->displayIndex(); + +include __DIR__ . '/footer.php'; Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -0,0 +1,128 @@ +<?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 XOOPS Development Team + * @version $Id$ + */ +include __DIR__ . '/header.php'; +// heaser +$xoops->header('admin:tdmcreate/tdmcreate_locale.tpl'); +// +//$localeId = Request::getInt('import_id', 0); +// +$adminMenu->renderNavigation('locales.php'); +// +switch ($op) +{ + case 'list': + $adminMenu->addItemButton(TDMCreateLocale::ADD_LOCALE, 'locales.php?op=new', 'add'); + $adminMenu->renderButton(); + // Get modules list + $criteria = new CriteriaCompo(); + $criteria->setSort('loc_id'); + $criteria->setOrder('ASC'); + $criteria->setStart($start); + $criteria->setLimit($limit); + $numLocale = $localeHandler->getCount($criteria); + $localeArr = $localeHandler->getAll($criteria); + // Assign Template variables + $xoops->tpl()->assign('locale_count', $numLocale); + unset($criteria); + if ($numLocale > 0) { + foreach (array_keys($localeArr) as $i) { + $locale['id'] = $localeArr[$i]->getVar('loc_id'); + $locale['mid'] = $localeArr[$i]->getVar('loc_mid'); + $locale['name'] = $localeArr[$i]->getVar('loc_file'); + $locale['define'] = $localeArr[$i]->getVar('loc_define'); + $locale['description'] = $localeArr[$i]->getVar('loc_description'); + $xoops->tpl()->append_by_ref('locales', $locale); + unset($locale); + } + // Display Page Navigation + if ($numrows > $limit) { + $nav = new XoopsPageNav($numrows, $limit, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', TDMCreateLocale::IMPORT_ERROR_NOLOCALE); + } + break; + + case 'new': + $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'locales.php', 'application-view-detail'); + $adminMenu->renderButton(); + + $obj = $localeHandler->create(); + $form = $xoops->getModuleForm($obj, 'locales'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'save': + if (!$xoops->security()->check()) { + $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); + } + + if ($localeId > 0) { + $obj = $localeHandler->get($localeId); + //Form imported edited save + $obj->setVar('loc_mid', Request::getInt('loc_mid')); + $obj->setVar('loc_file', Request::getString('loc_file')); + $obj->setVar('loc_define', Request::getString('loc_define')); + $obj->setVar('loc_description', Request::getString('loc_description')); + $xoops->redirect('locales.php', 3, TDMCreateLocale::E_DATABASE_SQL_FILE_NOT_IMPORTED); + } + if ($localeHandler->insert($obj)) { + $xoops->redirect('locales.php', 3, TDMCreateLocale::FORM_OK); + } + + $xoops->error($obj->getHtmlErrors()); + $form = $xoops->getModuleForm($obj, 'locales'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'edit': + $adminMenu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'locales.php?op=import', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'locales.php', 'application-view-detail'); + $adminMenu->renderButton(); + + $obj = $localeHandler->get($localeId); + $form = $xoops->getModuleForm($obj, 'locales'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'delete': + if ($localeId > 0) { + $obj = $localeHandler->get($localeId); + if (isset($_POST['ok']) && $_POST['ok'] == 1) { + if (!$xoops->security()->check()) { + $xoops->redirect('locales.php', 3, implode(',', $xoops->security()->getErrors())); + } + if ($localeHandler->delete($obj)) { + $xoops->redirect('locales.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::IMPORT)); + } else { + $xoops->error($obj->getHtmlErrors()); + } + } else { + $xoops->confirm(array('ok' => 1, 'id' => $localeId, 'op' => 'delete'), 'locales.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('loc_file')) . '<br />'); + } + } else { + $xoops->redirect('locales.php', 1, TDMCreateLocale::E_DATABASE_ERROR); + } + break; +} + +include __DIR__ . '/footer.php'; \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.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 Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2015-05-04 18:50:06 UTC (rev 13057) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -37,10 +37,14 @@ $adminmenu[$i]['icon'] = 'editfields.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU5; -$adminmenu[$i]['link'] = 'admin/import.php'; +$adminmenu[$i]['link'] = 'admin/locales.php'; +$adminmenu[$i]['icon'] = 'languages.png'; +$i++; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU6; +$adminmenu[$i]['link'] = 'admin/imports.php'; $adminmenu[$i]['icon'] = 'import.png'; $i++; -$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU6; +$adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU7; $adminmenu[$i]['link'] = 'admin/building.php'; $adminmenu[$i]['icon'] = 'builder.png'; $i++; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2015-05-04 18:50:06 UTC (rev 13057) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2015-05-06 14:56:29 UTC (rev 13058) @@ -18,49 +18,49 @@ * @author XOOPS Development Team * @version $Id: modules.php 10665 2012-12-27 10:14:15Z timgno $ */ -include dirname(__FILE__) . '/header.php'; +include __DIR__ . '/header.php'; // Get Action type -$mod_id = $system->cleanVars($_REQUEST, 'mod_id', 0, 'int'); +//$modId = Request::getInt('mod_id'); // Get handler -$xoops->header('tdmcreate_modules.html'); -$admin_menu->renderNavigation('modules.php'); +$xoops->header('admin:tdmcreate/tdmcreate_modules.tpl'); +$adminMenu->renderNavigation('modules.php'); switch ($op) { case 'list': default: - $admin_menu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); - $admin_menu->renderButton(); + $adminMenu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); + $adminMenu->renderButton(); // Get modules list $criteria = new CriteriaCompo(); $criteria->setSort('mod_name'); $criteria->setOrder('ASC'); $criteria->setStart($start); $criteria->setLimit($limit); - $numrows_mods = $modules_Handler->getCount($criteria); - $mod_arr = $modules_Handler->getAll($criteria); + $numRowsMods = $modulesHandler->getCount($criteria); + $modulesArray = $modulesHandler->getAll($criteria); // Assign Template variables - $xoops->tpl()->assign('modules_count', $numrows_mods); + $xoops->tpl()->assign('modules_count', $numRowsMods); unset($criteria); - if ($numrows_mods > 0) { - foreach (array_keys($mod_arr) as $i) { - $mod['id'] = $mod_arr[$i]->getVar('mod_id'); - $mod['name'] = $mod_arr[$i]->getVar('mod_name'); - $mod['version'] = $mod_arr[$i]->getVar('mod_version'); - $mod['image'] = $mod_arr[$i]->getVar('mod_image'); - $mod['release'] = $mod_arr[$i]->getVar('mod_release'); - $mod['status'] = $mod_arr[$i]->getVar('mod_status'); - $mod['admin'] = $mod_arr[$i]->getVar('mod_admin'); - $mod['user'] = $mod_arr[$i]->getVar('mod_user'); - $mod['submenu'] = $mod_arr[$i]->getVar('mod_submenu'); - $mod['search'] = $mod_arr[$i]->getVar('mod_search'); - $mod['comments'] = $mod_arr[$i]->getVar('mod_comments'); - $mod['notifications'] = $mod_arr[$i]->getVar('mod_notifications'); + if ($numRowsMods > 0) { + foreach (array_keys($modulesArray) as $i) { + $mod['id'] = $modulesArray[$i]->getVar('mod_id'); + $mod['name'] = $modulesArray[$i]->getVar('mod_name'); + $mod['version'] = $modulesArray[$i]->getVar('mod_version'); + $mod['image'] = $modulesArray[$i]->getVar('mod_image'); + $mod['release'] = $modulesArray[$i]->getVar('mod_release'); + $mod['status'] = $modulesArray[$i]->getVar('mod_status'); + $mod['admin'] = $modulesArray[$i]->getVar('mod_admin'); + $mod['user'] = $modulesArray[$i]->getVar('mod_user'); + $mod['submenu'] = $modulesArray[$i]->getVar('mod_submenu'); + $mod['search'] = $modulesArray[$i]->getVar('mod_search'); + $mod['comments'] = $modulesArray[$i]->getVar('mod_comments'); + $mod['notifications'] = $modulesArray[$i]->getVar('mod_notifications'); $xoops->tpl()->append_by_ref('modules', $mod); unset($mod); } // Display Page Navigation - if ($numrows_mods > $limit) { - $nav = new XoopsPageNav($numrows_mods, $limit, $start, 'start'); + if ($numRowsMods > $limit) { + $nav = new XoopsPageNav($numRowsMods, $limit, $start, 'start'); $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { @@ -69,11 +69,11 @@ break; case 'new': - $admin_menu->addItemButton(TDMCreateLocale::MODULES_LIST, 'modules.php', 'application-view-detail'); - $admin_menu->renderButton(); + $adminMenu->addItemButton(TDMCreateLocale::MODULES_LIST, 'modules.php', 'application-view-detail'); + $adminMenu->renderButton(); - $obj = $modules_Handler->create(); - $form = $xoops->getModuleForm($obj, 'modules'); + $modulesObj = $modulesHandler->create(); + $form = $xoops->getModuleForm($modulesObj, 'modules'); $xoops->tpl()->assign('form', $form->render()); break; @@ -81,83 +81,83 @@ if (!$xoops->security()->check()) { $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); } - $mod_id = $request->asInt('mod_id', 0); - if ($mod_id > 0) { - $obj = $modules_Handler->get($mod_id); + $modId = Request::getInt('mod_id', 0); + if ($modId > 0) { + $modulesObj = $modulesHandler->get($modId); } else { - $obj = $modules_Handler->create(); + $modulesObj = $modulesHandler->create(); } //Form module save - $obj->setVars(array('mod_name' => $request->asStr('mod_name', ''), - 'mod_isextension' => $request->asInt('mod_isextension', 0), - 'mod_version' => $request->asStr('mod_version', ''), - 'mod_description' => $request->asStr('mod_description', ''), - 'mod_author' => $request->asStr('mod_author', ''), - 'mod_author_mail' => $request->asStr('mod_author_mail', ''), - 'mod_author_website_url' => $request->asStr('mod_author_website_url', ''), - 'mod_author_website_name' => $request->asStr('mod_author_website_name', ''), - 'mod_credits' => $request->asStr('mod_credits', ''), - 'mod_license' => $request->asStr('mod_license', ''), - 'mod_release_info' => $request->asStr('mod_release_info', ''), - 'mod_release_file' => $request->asStr('mod_release_file', ''), - 'mod_manual' => $request->asStr('mod_manual', ''), - 'mod_manual_file' => $request->asStr('mod_manual_file', ''))); + $modulesObj->setVars(array('mod_name' => Request::getString('mod_name', ''), + 'mod_isextension' => Request::getInt('mod_isextension', 0), + 'mod_version' => Request::getString('mod_version', ''), + 'mod_description' => Request::getString('mod_description', ''), + 'mod_author' => Request::getString('mod_author', ''), + 'mod_author_mail' => Request::getString('mod_author_mail', ''), + 'mod_author_website_url' => Request::getString('mod_author_website_url', ''), + 'mod_author_website_name' => Request::getString('mod_author_website_name', ''), + 'mod_credits' => Request::getString('mod_credits', ''), + 'mod_license' => Request::getString('mod_license', ''), + 'mod_release_info' => Request::getString('mod_release_info', ''), + 'mod_release_file' => Request::getString('mod_release_file', ''), + 'mod_manual' => Request::getString('mod_manual', ''), + 'mod_manual_file' => Request::getString('mod_manual_file', ''))); //Form module_image $uploader = new XoopsMediaUploader( TDMC_MODULES_PATH_IMG, $helper->getConfig('mimetypes'), $helper->getConfig('maxuploadsize'), null, null); if ($uploader->fetchMedia('xoops_upload_file')) { $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['xoops_upload_file']['name']); - $img_name = 'logo.'.$extension; - $uploader->setPrefix($img_name); + $imageName = 'logo.'.$extension; + $uploader->setPrefix($imageName); $uploader->fetchMedia('xoops_upload_file'); if (!$uploader->upload()) { $xoops->redirect('javascript:history.go(-1)',3, $uploader->getErrors()); } else { - $obj->setVar('mod_image', $uploader->getSavedFileName()); + $modulesObj->setVar('mod_image', $uploader->getSavedFileName()); } } else { if ($_POST['modules_image'] == 'blank.gif') { - $obj->setVar('mod_image', $_POST['mod_image']); + $modulesObj->setVar('mod_image', $_POST['mod_image']); } else { - $obj->setVar('mod_image', $_POST['modules_image']); + $modulesObj->setVar('mod_image', $_POST['modules_image']); } } //Form module save - $obj->setVars(array('mod_demo_site_url' => $request->asStr('mod_demo_site_url', ''), - 'mod_demo_site_name' => $request->asStr('mod_demo_site_name', ''), - 'mod_support_url' => $request->asStr('mod_support_url', ''), - 'mod_support_name' => $request->asStr('mod_support_name', ''), - 'mod_website_url' => $request->asStr('mod_website_url', ''), - 'mod_website_name' => $request->asStr('mod_website_name', ''), - 'mod_release' => $request->asStr('mod_release', ''), - 'mod_status' => $request->asStr('mod_status', ''), - 'mod_admin' => $request->asInt('mod_admin', 0), - 'mod_user' => $request->asInt('mod_user', 0), - 'mod_submenu' => $request->asInt('mod_submenu', 0), - 'mod_search' => $request->asInt('mod_search', 0), - 'mod_comments' => $request->asInt('mod_comments', 0), - 'mod_notifications' => $request->asInt('mod_notifications', 0), - 'mod_paypal' => $request->asStr('mod_paypal', ''), - 'mod_subversion' => $request->asStr('mod_subversion', ''))); + $modulesObj->setVars(array('mod_demo_site_url' => Request::getString('mod_demo_site_url', ''), + 'mod_demo_site_name' => Request::getString('mod_demo_site_name', ''), + 'mod_support_url' => Request::getString('mod_support_url', ''), + 'mod_support_name' => Request::getString('mod_support_name', ''), + 'mod_website_url' => Request::getString('mod_website_url', ''), + 'mod_website_name' => Request::getString('mod_website_name', ''), + 'mod_release' => Request::getString('mod_release', ''), + 'mod_status' => Request::getString('mod_status', ''), + 'mod_admin' => Request::getInt('mod_admin', 0), + 'mod_user' => Request::getInt('mod_user', 0), + 'mod_submenu' => Request::getInt('mod_submenu', 0), + 'mod_search' => Request::getInt('mod_search', 0), + 'mod_comments' => Request::getInt('mod_comments', 0), + 'mod_notifications' => Request::getInt('mod_notifications', 0), + 'mod_paypal' => Request::getString('mod_paypal', ''), + 'mod_subversion' => Request::getString('mod_subversion', ''))); // Insert Data - if ($modules_Handler->insert($obj)) { + if ($modulesHandler->insert($modulesObj)) { $xoops->redirect('modules.php', 2, XoopsLocale::S_DATA_INSERTED); } // Form Data - $xoops->error($obj->getHtmlErrors()); - $form = $xoops->getModuleForm($obj, 'modules'); + $xoops->error($modulesObj->getHtmlErrors()); + $form = $xoops->getModuleForm($modulesObj, 'modules'); $xoops->tpl()->assign('form', $form->render()); break; case 'edit': - $admin_menu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); - $admin_menu->addItemButton(TDMCreateLocale::MODULES_LIST, 'modules.php', 'application-view-detail'); - $admin_menu->renderButton(); - $mod_id = $request->asInt('mod_id', 0); - if ($mod_id > 0) { - $obj = $modules_Handler->get($mod_id); - $form = $helper->getForm($obj, 'modules'); + $adminMenu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::MODULES_LIST, 'modules.php', 'application-view-detail'); + $adminMenu->renderButton(); + $modId = Request::getInt('mod_id', 0); + if ($modId > 0) { + $modulesObj = $modulesHandler->get($modId); + $form = $helper->getForm($modulesObj, 'modules'); $xoops->tpl()->assign('form', $form->render()); } else { $xoops->redirect('modules.php', 1, XoopsLocale::E_DATABASE_NOT_UPDATED); @@ -165,20 +165,20 @@ break; case 'delete': - $mod_id = $request->asInt('mod_id', 0); - if ($mod_id > 0) { - $obj = $modules_Handler->get($mod_id); + $modId = Request::getInt('mod_id', 0); + if ($modId > 0) { + $modulesObj = $modulesHandler->get($modId); if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); } - if ($modules_Handler->delete($obj)) { + if ($modulesHandler->delete($modulesObj)) { ... [truncated message content] |
From: <txm...@us...> - 2015-05-11 13:03:31
|
Revision: 13060 http://sourceforge.net/p/xoops/svn/13060 Author: txmodxoops Date: 2015-05-11 13:03:29 +0000 (Mon, 11 May 2015) Log Message: ----------- Fixings and updates Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/helper.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_locale.tpl Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/schema.yml Removed Paths: ------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locales.php Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.php 2015-05-11 13:03:29 UTC (rev 13060) @@ -0,0 +1,128 @@ +<?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 XOOPS Development Team + * @version $Id$ + */ +include __DIR__ . '/header.php'; +// heaser +$xoops->header('admin:tdmcreate/tdmcreate_locale.tpl'); +// +//$localeId = Request::getInt('import_id', 0); +// +$adminMenu->renderNavigation('locale.php'); +// +switch ($op) +{ + case 'list': + $adminMenu->addItemButton(TDMCreateLocale::ADD_LOCALE, 'locale.php?op=new', 'add'); + $adminMenu->renderButton(); + // Get modules list + $criteria = new CriteriaCompo(); + $criteria->setSort('loc_id'); + $criteria->setOrder('ASC'); + $criteria->setStart($start); + $criteria->setLimit($limit); + $numLocale = $localeHandler->getCount($criteria); + $localeArr = $localeHandler->getAll($criteria); + // Assign Template variables + $xoops->tpl()->assign('locale_count', $numLocale); + unset($criteria); + if ($numLocale > 0) { + foreach (array_keys($localeArr) as $i) { + $locale['id'] = $localeArr[$i]->getVar('loc_id'); + $locale['mid'] = $localeArr[$i]->getVar('loc_mid'); + $locale['name'] = $localeArr[$i]->getVar('loc_file'); + $locale['define'] = $localeArr[$i]->getVar('loc_define'); + $locale['description'] = $localeArr[$i]->getVar('loc_description'); + $xoops->tpl()->append_by_ref('locale', $locale); + unset($locale); + } + // Display Page Navigation + if ($numrows > $limit) { + $nav = new XoopsPageNav($numrows, $limit, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', TDMCreateLocale::IMPORT_ERROR_NOLOCALE); + } + break; + + case 'new': + $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'locale.php', 'application-view-detail'); + $adminMenu->renderButton(); + + $obj = $localeHandler->create(); + $form = $xoops->getModuleForm($obj, 'locale'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'save': + if (!$xoops->security()->check()) { + $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); + } + + if ($localeId > 0) { + $obj = $localeHandler->get($localeId); + //Form imported edited save + $obj->setVar('loc_mid', Request::getInt('loc_mid')); + $obj->setVar('loc_file', Request::getString('loc_file')); + $obj->setVar('loc_define', Request::getString('loc_define')); + $obj->setVar('loc_description', Request::getString('loc_description')); + $xoops->redirect('locale.php', 3, TDMCreateLocale::E_DATABASE_SQL_FILE_NOT_IMPORTED); + } + if ($localeHandler->insert($obj)) { + $xoops->redirect('locale.php', 3, TDMCreateLocale::FORM_OK); + } + + $xoops->error($obj->getHtmlErrors()); + $form = $xoops->getModuleForm($obj, 'locale'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'edit': + $adminMenu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'locale.php?op=import', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'locale.php', 'application-view-detail'); + $adminMenu->renderButton(); + + $obj = $localeHandler->get($localeId); + $form = $xoops->getModuleForm($obj, 'locale'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'delete': + if ($localeId > 0) { + $obj = $localeHandler->get($localeId); + if (isset($_POST['ok']) && $_POST['ok'] == 1) { + if (!$xoops->security()->check()) { + $xoops->redirect('locale.php', 3, implode(',', $xoops->security()->getErrors())); + } + if ($localeHandler->delete($obj)) { + $xoops->redirect('locale.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::IMPORT)); + } else { + $xoops->error($obj->getHtmlErrors()); + } + } else { + $xoops->confirm(array('ok' => 1, 'id' => $localeId, 'op' => 'delete'), 'locale.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('loc_file')) . '<br />'); + } + } else { + $xoops->redirect('locale.php', 1, TDMCreateLocale::E_DATABASE_ERROR); + } + break; +} + +include __DIR__ . '/footer.php'; \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.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 Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php 2015-05-08 09:59:39 UTC (rev 13059) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php 2015-05-11 13:03:29 UTC (rev 13060) @@ -1,128 +0,0 @@ -<?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 XOOPS Development Team - * @version $Id$ - */ -include __DIR__ . '/header.php'; -// heaser -$xoops->header('admin:tdmcreate/tdmcreate_locale.tpl'); -// -//$localeId = Request::getInt('import_id', 0); -// -$adminMenu->renderNavigation('locales.php'); -// -switch ($op) -{ - case 'list': - $adminMenu->addItemButton(TDMCreateLocale::ADD_LOCALE, 'locales.php?op=new', 'add'); - $adminMenu->renderButton(); - // Get modules list - $criteria = new CriteriaCompo(); - $criteria->setSort('loc_id'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numLocale = $localeHandler->getCount($criteria); - $localeArr = $localeHandler->getAll($criteria); - // Assign Template variables - $xoops->tpl()->assign('locale_count', $numLocale); - unset($criteria); - if ($numLocale > 0) { - foreach (array_keys($localeArr) as $i) { - $locale['id'] = $localeArr[$i]->getVar('loc_id'); - $locale['mid'] = $localeArr[$i]->getVar('loc_mid'); - $locale['name'] = $localeArr[$i]->getVar('loc_file'); - $locale['define'] = $localeArr[$i]->getVar('loc_define'); - $locale['description'] = $localeArr[$i]->getVar('loc_description'); - $xoops->tpl()->append_by_ref('locales', $locale); - unset($locale); - } - // Display Page Navigation - if ($numrows > $limit) { - $nav = new XoopsPageNav($numrows, $limit, $start, 'start'); - $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); - } - } else { - $xoops->tpl()->assign('error_message', TDMCreateLocale::IMPORT_ERROR_NOLOCALE); - } - break; - - case 'new': - $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'locales.php', 'application-view-detail'); - $adminMenu->renderButton(); - - $obj = $localeHandler->create(); - $form = $xoops->getModuleForm($obj, 'locales'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'save': - if (!$xoops->security()->check()) { - $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); - } - - if ($localeId > 0) { - $obj = $localeHandler->get($localeId); - //Form imported edited save - $obj->setVar('loc_mid', Request::getInt('loc_mid')); - $obj->setVar('loc_file', Request::getString('loc_file')); - $obj->setVar('loc_define', Request::getString('loc_define')); - $obj->setVar('loc_description', Request::getString('loc_description')); - $xoops->redirect('locales.php', 3, TDMCreateLocale::E_DATABASE_SQL_FILE_NOT_IMPORTED); - } - if ($localeHandler->insert($obj)) { - $xoops->redirect('locales.php', 3, TDMCreateLocale::FORM_OK); - } - - $xoops->error($obj->getHtmlErrors()); - $form = $xoops->getModuleForm($obj, 'locales'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'edit': - $adminMenu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'locales.php?op=import', 'add'); - $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'locales.php', 'application-view-detail'); - $adminMenu->renderButton(); - - $obj = $localeHandler->get($localeId); - $form = $xoops->getModuleForm($obj, 'locales'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'delete': - if ($localeId > 0) { - $obj = $localeHandler->get($localeId); - if (isset($_POST['ok']) && $_POST['ok'] == 1) { - if (!$xoops->security()->check()) { - $xoops->redirect('locales.php', 3, implode(',', $xoops->security()->getErrors())); - } - if ($localeHandler->delete($obj)) { - $xoops->redirect('locales.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::IMPORT)); - } else { - $xoops->error($obj->getHtmlErrors()); - } - } else { - $xoops->confirm(array('ok' => 1, 'id' => $localeId, 'op' => 'delete'), 'locales.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('loc_file')) . '<br />'); - } - } else { - $xoops->redirect('locales.php', 1, TDMCreateLocale::E_DATABASE_ERROR); - } - break; -} - -include __DIR__ . '/footer.php'; \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2015-05-08 09:59:39 UTC (rev 13059) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2015-05-11 13:03:29 UTC (rev 13060) @@ -37,7 +37,7 @@ $adminmenu[$i]['icon'] = 'editfields.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU5; -$adminmenu[$i]['link'] = 'admin/locales.php'; +$adminmenu[$i]['link'] = 'admin/locale.php'; $adminmenu[$i]['icon'] = 'languages.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU6; Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locale.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locale.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locale.php 2015-05-11 13:03:29 UTC (rev 13060) @@ -0,0 +1,41 @@ +<?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$ + */ + +class TDMCreateLocaleForm extends Xoops\Form\ThemeForm +{ + /** + * @param TDMCreateLocale|XoopsObject $obj + */ + public function __construct(TDMCreateLocale &$obj) + { + $xoops = Xoops::getInstance(); + + $title = $obj->isNew() ? TDMCreateLocale::A_ADD_LOCALE : PageLocale::A_EDIT_LOCALE; + parent::__construct($title, 'form', 'locale.php', 'post', true); + + $this->addElement(new XoopsFormText(XoopsLocale::LOCALE_FILE_NAME, 'loc_file', 50, 255, $obj->getVar('loc_file')), true); + $this->addElement(new XoopsFormText(XoopsLocale::LOCALE_DEFINE, 'loc_define', 50, 255, $obj->getVar('loc_define')), true); + $this->addElement(new XoopsFormText(XoopsLocale::LOCALE_DESCRIPTION, 'loc_description', 50, 255, $obj->getVar('loc_description')), true); + + $this->addElement(new XoopsFormHidden('op', 'save' ) ); + $this->addElement(new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit' ) ); + } +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locale.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 Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locales.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locales.php 2015-05-08 09:59:39 UTC (rev 13059) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locales.php 2015-05-11 13:03:29 UTC (rev 13060) @@ -1,41 +0,0 @@ -<?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$ - */ - -class TDMCreateLocalesForm extends Xoops\Form\ThemeForm -{ - /** - * @param TDMCreateLocale|XoopsObject $obj - */ - public function __construct(TDMCreateLocales &$obj) - { - $xoops = Xoops::getInstance(); - - $title = $obj->isNew() ? TDMCreateLocale::A_ADD_LOCALE : PageLocale::A_EDIT_LOCALE; - parent::__construct($title, 'form', 'locales.php', 'post', true); - - $this->addElement(new XoopsFormText(XoopsLocale::LOCALE_FILE_NAME, 'loc_file', 50, 255, $obj->getVar('loc_file')), true); - $this->addElement(new XoopsFormText(XoopsLocale::LOCALE_DEFINE, 'loc_define', 50, 255, $obj->getVar('loc_define')), true); - $this->addElement(new XoopsFormText(XoopsLocale::LOCALE_DESCRIPTION, 'loc_description', 50, 255, $obj->getVar('loc_description')), true); - - $this->addElement(new XoopsFormHidden('op', 'save' ) ); - $this->addElement(new XoopsFormButton('', 'submit', XoopsLocale::A_SUBMIT, 'submit' ) ); - } -} \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/helper.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/helper.php 2015-05-08 09:59:39 UTC (rev 13059) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/helper.php 2015-05-11 13:03:29 UTC (rev 13060) @@ -64,11 +64,11 @@ } /** - * @return TDMCreateTDMCreate_localesHandler + * @return TDMCreateTDMCreate_localeHandler */ - public function getLocalesHandler() + public function getLocaleHandler() { - return $this->getHandler('locales'); + return $this->getHandler('locale'); } /** Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locale.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locale.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locale.php 2015-05-11 13:03:29 UTC (rev 13060) @@ -0,0 +1,51 @@ +<?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. +*/ +use Xoops\Core\Database\Connection; +/** + * 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$ + */ +/** + * Class TDMCreateLocale + */ +class TDMCreateLocale extends XoopsObject +{ + /** + * Constructor + */ + public function __construct() + { + $this->initVar('loc_id',XOBJ_DTYPE_INT); + $this->initVar('loc_mid',XOBJ_DTYPE_INT); + $this->initVar('loc_file',XOBJ_DTYPE_TXTBOX); + $this->initVar('loc_define',XOBJ_DTYPE_TXTBOX); + $this->initVar('loc_description',XOBJ_DTYPE_TXTBOX); + } +} +/** + * Class TDMCreateLocaleHandler + */ +class TDMCreateLocaleHandler extends XoopsPersistableObjectHandler +{ + /** + * @param null|Connection $db + */ + public function __construct(Connection $db = null) + { + parent::__construct($db, 'tdmcreate_locale', 'tdmcreatelocale', 'loc_id', 'loc_mid'); + } +} Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locale.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 Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locales.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locales.php 2015-05-08 09:59:39 UTC (rev 13059) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locales.php 2015-05-11 13:03:29 UTC (rev 13060) @@ -1,51 +0,0 @@ -<?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. -*/ -use Xoops\Core\Database\Connection; -/** - * 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$ - */ -/** - * Class TDMCreateLocales - */ -class TDMCreateLocales extends XoopsObject -{ - /** - * Constructor - */ - public function __construct() - { - $this->initVar('loc_id',XOBJ_DTYPE_INT); - $this->initVar('loc_mid',XOBJ_DTYPE_INT); - $this->initVar('loc_file',XOBJ_DTYPE_TXTBOX); - $this->initVar('loc_define',XOBJ_DTYPE_TXTBOX); - $this->initVar('loc_description',XOBJ_DTYPE_TXTBOX); - } -} -/** - * Class TDMCreateLocalesHandler - */ -class TDMCreateLocalesHandler extends XoopsPersistableObjectHandler -{ - /** - * @param null|Connection $db - */ - public function __construct(Connection $db = null) - { - parent::__construct($db, 'tdmcreate_locales', 'tdmcreatelocales', 'loc_id', 'loc_mid'); - } -} Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql 2015-05-08 09:59:39 UTC (rev 13059) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql 2015-05-11 13:03:29 UTC (rev 13060) @@ -143,7 +143,7 @@ # Table structure for table `tdmcreate_languages` 5 # -CREATE TABLE `tdmcreate_locales` ( +CREATE TABLE `tdmcreate_locale` ( `loc_id` INT(5) UNSIGNED NOT NULL AUTO_INCREMENT, `loc_mid` INT(5) UNSIGNED NOT NULL DEFAULT '0', `loc_file` VARCHAR(255) NOT NULL DEFAULT '', Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/schema.yml =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/schema.yml (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/schema.yml 2015-05-11 13:03:29 UTC (rev 13060) @@ -0,0 +1,456 @@ +tables: + profile_category: + options: { } + columns: + cat_id: + name: cat_id + type: smallint + default: null + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: true + columnDefinition: null + comment: '' + cat_title: + name: cat_title + type: string + default: '' + notnull: true + length: 255 + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + cat_description: + name: cat_description + type: text + default: null + notnull: false + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + cat_weight: + name: cat_weight + type: smallint + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + indexes: + PRIMARY: + name: PRIMARY + columns: [cat_id] + unique: true + primary: true + profile_field: + options: { } + columns: + field_id: + name: field_id + type: integer + default: null + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: true + columnDefinition: null + comment: '' + cat_id: + name: cat_id + type: smallint + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_type: + name: field_type + type: string + default: '' + notnull: true + length: 30 + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + field_valuetype: + name: field_valuetype + type: boolean + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_name: + name: field_name + type: string + default: '' + notnull: true + length: 255 + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + field_title: + name: field_title + type: string + default: '' + notnull: true + length: 255 + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + field_description: + name: field_description + type: text + default: null + notnull: false + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + field_required: + name: field_required + type: boolean + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_maxlength: + name: field_maxlength + type: smallint + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_weight: + name: field_weight + type: smallint + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_default: + name: field_default + type: text + default: null + notnull: false + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + field_notnull: + name: field_notnull + type: boolean + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_edit: + name: field_edit + type: boolean + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_show: + name: field_show + type: boolean + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_config: + name: field_config + type: boolean + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + field_options: + name: field_options + type: text + default: null + notnull: false + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + step_id: + name: step_id + type: smallint + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + indexes: + PRIMARY: + name: PRIMARY + columns: [field_id] + unique: true + primary: true + field_name: + name: field_name + columns: [field_name] + unique: true + primary: false + step: + name: step + columns: [step_id, field_weight] + unique: false + primary: false + profile_profile: + options: { } + columns: + profile_id: + name: profile_id + type: integer + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + indexes: + PRIMARY: + name: PRIMARY + columns: [profile_id] + unique: true + primary: true + profile_regstep: + options: { } + columns: + step_id: + name: step_id + type: smallint + default: null + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: true + columnDefinition: null + comment: '' + step_name: + name: step_name + type: string + default: '' + notnull: true + length: 255 + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + step_desc: + name: step_desc + type: text + default: null + notnull: false + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: false + autoincrement: false + columnDefinition: null + comment: '' + step_order: + name: step_order + type: smallint + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + step_save: + name: step_save + type: boolean + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + indexes: + PRIMARY: + name: PRIMARY + columns: [step_id] + unique: true + primary: true + sort: + name: sort + columns: [step_order, step_name] + unique: false + primary: false + profile_visibility: + options: { } + columns: + field_id: + name: field_id + type: integer + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + user_group: + name: user_group + type: smallint + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + profile_group: + name: profile_group + type: smallint + default: '0' + notnull: true + length: null + precision: 10 + scale: 0 + fixed: false + unsigned: true + autoincrement: false + columnDefinition: null + comment: '' + indexes: + PRIMARY: + name: PRIMARY + columns: [field_id, user_group, profile_group] + unique: true + primary: true + visible: + name: visible + columns: [user_group, profile_group] + unique: false + primary: false Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_locale.tpl =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_locale.tpl 2015-05-08 09:59:39 UTC (rev 13059) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_locale.tpl 2015-05-11 13:03:29 UTC (rev 13060) @@ -14,17 +14,17 @@ </tr> </thead> <tbody> - <{foreach item=locale from=$locales}> + <{foreach item=loc from=$locale}> <tr class="<{cycle values='even,odd'}>"> - <td class='txtcenter'><{$locale.id}></td> - <td class='txtcenter'><{$locale.mid}></td> - <td class='txtcenter'><{$locale.file}></td> - <td class='txtcenter'><{$locale.define}></td> - <td class='txtcenter'><{$locale.description}></td> + <td class='txtcenter'><{$loc.id}></td> + <td class='txtcenter'><{$loc.mid}></td> + <td class='txtcenter'><{$loc.file}></td> + <td class='txtcenter'><{$loc.define}></td> + <td class='txtcenter'><{$loc.description}></td> <td class='xo-actions txtcenter width6'> - <a href='locale.php?op=edit&id=<{$locale.id}>' title='<{translate key="A_EDIT"}>'> + <a href='locale.php?op=edit&id=<{$loc.id}>' title='<{translate key="A_EDIT"}>'> <img src="<{xoAdminIcons 'edit.png'}>" alt='<{translate key="A_EDIT"}>' /></a> - <a href='locale.php?op=delete&id=<{$locale.id}>' title='<{translate key="A_DELETE"}>'> + <a href='locale.php?op=delete&id=<{$loc.id}>' title='<{translate key="A_DELETE"}>'> <img src="<{xoAdminIcons 'delete.png'}>" alt='<{translate key="A_DELETE"}>' /></a> </td> </tr> |
From: <txm...@us...> - 2015-05-15 12:00:29
|
Revision: 13061 http://sourceforge.net/p/xoops/svn/13061 Author: txmodxoops Date: 2015-05-15 12:00:25 +0000 (Fri, 15 May 2015) Log Message: ----------- Jquery ui tab fixed Added and updated Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/css/styles.css XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/fields.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/imports.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/helper.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/imports.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/modules.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/changelog.txt XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/common.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/include/install.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/locale/en_US/en_US.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/sql/mysql.sql XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_building.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_imports.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_modules.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/xoops_version.php Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/css/index.html XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/arrow.gif XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/drag.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/left_right.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/spinner.gif XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/submenu.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/tables.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/icons/16/toggle.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/images/default.png XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/js/functions.js XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/assets/js/sortable.js XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locales.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_extensions.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_fields_item.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_header.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_locales.tpl XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables_item.tpl Removed Paths: ------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/import.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/form/locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/locale.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_locale.tpl Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/building.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -8,7 +8,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - +use Xoops\Core\Request; /** * tdmcreate module * @@ -20,18 +20,23 @@ * @version $Id: building.php 10665 2012-12-27 10:14:15Z timgno $ */ include __DIR__ . '/header.php'; +// Get $_POST, $_GET, $_REQUEST +$op = Request::getCmd('op', 'default'); // header $xoops->header('admin:tdmcreate/tdmcreate_building.tpl'); - +// $adminMenu->renderNavigation('building.php'); +// switch ($op) { case 'default': default: + $adminMenu->addTips(TDMCreateLocale::BUILDING_TIPS); + $adminMenu->renderTips(); $form = new XoopsSimpleForm(TDMCreateLocale::BUILDING_TITLE, 'building', 'building.php', 'post', true); $mods_select = new XoopsFormSelect(TDMCreateLocale::BUILDING_MODULES, 'mod_name', 'mod_name'); - $mods_select->addOption(0, TDMCreateLocale::BUILDING_SELDEFMOD); + $mods_select->addOption(0, TDMCreateLocale::BUILDING_SELECT_DEFAULT); $mods_select->addOptionArray($modulesHandler->getList()); $form->addElement($mods_select); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/fields.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -8,6 +8,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +use Xoops\Core\Request; /** * tdmcreate module * @@ -19,88 +20,72 @@ * @version $Id: fields.php 10665 2012-12-27 10:14:15Z timgno $ */ include __DIR__ . '/header.php'; -/* +// Requests $_POST, $_GET, $_REQUEST +$op = Request::getCmd('op', 'list'); +$start = Request::getInt('start', 0); +// Limit of pages +$limit = $helper->getConfig('adminpager'); +// Get Requests $fieldId = Request::getInt('field_id'); $fieldMid = Request::getInt('field_mid'); $fieldTid = Request::getInt('field_tid'); -$fieldNumb = Request::getInt('field_numb'); -$fieldName = Request::getString('field_name', '');*/ - -// Get handler +$fieldName = Request::getString('field_name', ''); +// Get header template $xoops->header('admin:tdmcreate/tdmcreate_fields.tpl'); - +// $adminMenu->renderNavigation('fields.php'); +// switch ($op) { case 'list': - default: - $adminMenu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); - $adminMenu->renderButton(); - // Get modules list - $criteria = new CriteriaCompo(new Criteria('table_mid', $fieldMid)); - $criteria->add(new Criteria('table_id', $fieldTid)); - $criteria->setSort('table_name'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numRowsTables = $tablesHandler->getCount($criteria); - $tablesArray = $tablesHandler->getAll($criteria); - $xoops->tpl()->assign('tables_count', $numRowsTables); - unset($criteria); + default: + $adminMenu->addTips(TDMCreateLocale::FIELD_TIPS); + $adminMenu->addItemButton(TDMCreateLocale::A_ADD_TABLE, 'tables.php?op=new', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::A_LIST_TABLES, 'tables.php', 'application-view-detail'); + $adminMenu->addItemButton(TDMCreateLocale::A_LIST_FIELDS, 'fields.php', 'application-view-detail'); + $adminMenu->renderTips(); + $adminMenu->renderButton(); + $xoops->theme()->addStylesheet('modules/tdmcreate/assets/css/styles.css'); + $xoops->theme()->addScript('modules/tdmcreate/assets/js/functions.js'); + $xoops->theme()->addScript('modules/tdmcreate/assets/js/sortable.js'); + $xoops->tpl()->assign('modPathIcon16', TDMC_ROOT_PATH . '/assets/icones/16'); + $numbRowsTables = $tablesHandler->getCountTables(); + if ($numbRowsTables == 0) { + $xoops->redirect('tables.php?op=new', 2, TDMCreateLocale::E_NO_TABLES ); + } + // Get modules list + $tablesArray = $tablesHandler->getAllTablesByModuleId($tablesHandler->getVar('table_mid'), $start, $limit); + $xoops->tpl()->assign('tables_count', $numbRowsTables); // Redirect if there aren't modules - if ( $numRowsTables == 0 ) { + if ( $numbRowsTables == 0 ) { $xoops->redirect('tables.php?op=new', 2, TDMCreateLocale::E_NO_TABLES ); } // Assign Template variables - $xoops->tpl()->assign('fields_list', true); - $xoops->tpl()->assign('fields_count', $numRowsFields); - if ($numRowsTables > 0) { - foreach (array_keys($tablesArray) as $i) { - $tables['id'] = $tablesArray[$i]->getVar('table_id'); - $tables['name'] = $tablesArray[$i]->getVar('table_name'); - $module_name = $modules_Handler->get($tablesArray[$i]->getVar('table_mid')); - $tables['mid'] = $module_name->getVar('mod_name'); - $tables['image'] = $tablesArray[$i]->getVar('table_image'); - $tables['nbfields'] = $tablesArray[$i]->getVar('table_nbfields'); - $tables['blocks'] = $tablesArray[$i]->getVar('table_blocks'); - $tables['admin'] = $tablesArray[$i]->getVar('table_admin'); - $tables['user'] = $tablesArray[$i]->getVar('table_user'); - $tables['submenu'] = $tablesArray[$i]->getVar('table_submenu'); - $tables['search'] = $tablesArray[$i]->getVar('table_search'); - $tables['comments'] = $tablesArray[$i]->getVar('table_comments'); - $tables['notifications'] = $tablesArray[$i]->getVar('table_notifications'); - $xoops->tpl()->append_by_ref('tables', $tables); - unset($tables); - } - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('field_tid', $fieldTid)); - $criteria->setSort('field_id'); - $criteria->setOrder('ASC'); - $numRowsFields = $fieldsHandler->getCount($criteria); - $fieldsArray = $fieldsHandler->getAll($criteria); - unset($criteria); - if ($numRowsFields > 0) { - foreach (array_keys($fieldsArray) as $i) { - $field['id'] = $fieldsArray[$i]->getVar('field_id'); - $table_name = $tablesHandler->get($fieldsArray[$i]->getVar('field_tid')); - $field['tid'] = $table_name->getVar('table_name'); - $field['name'] = $fieldsArray[$i]->getVar('field_name'); - $field['type'] = $fieldsArray[$i]->getVar('field_type'); - $field['value'] = $fieldsArray[$i]->getVar('field_value'); - $field['blocks'] = $fieldsArray[$i]->getVar('field_blocks'); - $field['attribute'] = $fieldsArray[$i]->getVar('field_attribute'); - $field['default'] = $fieldsArray[$i]->getVar('field_default'); - $field['key'] = $fieldsArray[$i]->getVar('field_key'); - $field['blocks'] = $fieldsArray[$i]->getVar('field_blocks'); - $field['search'] = $fieldsArray[$i]->getVar('field_search'); - $field['required'] = $fieldsArray[$i]->getVar('field_required'); - $xoops->tpl()->append_by_ref('fields', $field); - unset($field); - } + if ($numbRowsTables > 0) { + foreach (array_keys($tablesArray) as $t) { + $table = $tablesArray[$t]->getValues(); + $numRowsFields = $fieldsHandler->getCountFields($fieldMid, $t); + $fieldsArray = $fieldsHandler->getAllFieldsByTableId($fieldMid, $t); + $xoops->tpl()->assign('fields_count', $numRowsFields); + $fields = array(); + if ($numRowsFields > 0) { + $lid = 1; + foreach (array_keys($fieldsArray) as $f) { + $field = $fieldsArray[$f]->getValues(); + $alid = array('lid' => $lid); + $fields[] = array_merge($field, $alid); + unset($field); + ++$lid; + } + unset($lid); + } + $table['fields'] = $fields; + $xoops->tpl()->appendByRef('tables', $table); + unset($table); } // Display Page Navigation - if ($numRowsTables > $limit) { - $nav = new XoopsPageNav($numRowsTables, $limit, $start, 'start'); + if ($numbRowsTables > $limit) { + $nav = new XoopsPageNav($numbRowsTables, $limit, $start, 'start'); $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { @@ -109,68 +94,102 @@ break; case 'new': - $adminMenu->addItemButton(TDMCreateLocale::FIELDS_LIST, 'fields.php', 'application-view-detail'); - $adminMenu->renderButton(); + $adminMenu->addItemButton(TDMCreateLocale::A_LIST_FIELDS, 'fields.php', 'application-view-detail'); + $adminMenu->renderButton(); - $obj = $fieldsHandler->create(); - $form = $xoops->getModuleForm($obj, 'fields'); + $fieldsObj = $fieldsHandler->create(); + $form = $xoops->getModuleForm($fieldsObj, 'fields'); $xoops->tpl()->assign('form', $form->render()); break; case 'save': if (!$xoops->security()->check()) { $xoops->redirect('fields.php', 3, implode(',', $xoops->security()->getErrors())); - } - if ($fieldId) { - $obj = $fieldsHandler->get($fieldId); - } else { - $obj = $fieldsHandler->create(); - } + } + $fieldOrder = 0; //Form fields - $obj->setVars(array('field_mid' => $fieldMid, 'field_tid' => $fieldTid, 'field_name' => $fieldName, - 'field_numb' => $fieldNumb, 'field_type' => $_POST['field_type'], - 'field_value' => $_POST['field_value'], 'field_attribute' => $_POST['field_attribute'], - 'field_null' => $_POST['field_null'], 'field_default' => $_POST['field_default'], - 'field_key' => $_POST['field_key'], 'field_elements' => $_POST['field_elements'], - 'field_auto_increment' => (($_REQUEST['field_auto_increment'] == 1) ? '1' : '0'), - 'field_admin' => (($_REQUEST['field_admin'] == 1) ? '1' : '0'), - 'field_user' => (($_REQUEST['field_user'] == 1) ? '1' : '0'), - 'field_blocks' => (($_REQUEST['field_blocks'] == 1) ? '1' : '0'), - 'field_mainfield' => (($_REQUEST['field_mainfield'] == 1) ? '1' : '0'), - 'field_search' => (($_REQUEST['field_search'] == 1) ? '1' : '0'), - 'field_required' => (($_REQUEST['field_required'] == 1) ? '1' : '0'))); - // Save data - if ($fieldsHandler->insert($obj)) { - $xoops->redirect('fields.php', 2, TDMCreateLocale::FORMOK); - } - - $xoops->error($obj->getHtmlErrors()); + foreach($_POST['field_id'] as $key => $value) + { + if(isset($value)){ + $fieldsObj =& $fields->get($value); + } else { + $fieldsObj =& $fields->create(); + } + $order = $fieldsObj->isNew() ? $fieldOrder++ : Request::getInt('field_order'); + // Set Data + $fieldsObj->setVar( 'field_mid', $fieldMid ); + $fieldsObj->setVar( 'field_tid', $fieldTid ); + $fieldsObj->setVar( 'field_order', $order ); + $fieldsObj->setVar( 'field_name', $_POST['field_name'][$key]); + $fieldsObj->setVar( 'field_type', $_POST['field_type'][$key]); + $fieldsObj->setVar( 'field_value', $_POST['field_value'][$key]); + $fieldsObj->setVar( 'field_attribute', $_POST['field_attribute'][$key]); + $fieldsObj->setVar( 'field_null', $_POST['field_null'][$key]); + $fieldsObj->setVar( 'field_default', $_POST['field_default'][$key]); + $fieldsObj->setVar( 'field_key', $_POST['field_key'][$key]); + $fieldsObj->setVar( 'field_element', $_POST['field_element'][$key]); + $fieldsObj->setVar( 'field_parent', (1 == $_REQUEST['field_parent'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_inlist', (1 == $_REQUEST['field_inlist'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_inform', (1 == $_REQUEST['field_inform'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_admin', (1 == $_REQUEST['field_admin'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_user', (1 == $_REQUEST['field_user'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_block', (1 == $_REQUEST['field_block'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_main', ($key == $_REQUEST['field_main'] ? 1 : 0)); + $fieldsObj->setVar( 'field_search', (1 == $_REQUEST['field_search'][$key]) ? 1 : 0); + $fieldsObj->setVar( 'field_required', (1 == $_REQUEST['field_required'][$key]) ? 1 : 0); + // Insert Data + $fieldsHandler->insert($fieldsObj); + } + unset($fieldOrder); + // Get table name from field table id + $tables =& $tablesHandler->get($fieldTid); + $tableName = $tables->getVar('table_name'); + // Set field elements + if ($fieldsObj->isNew()) { + // Fields Elements Handler + $fieldelementsHandler = $helper->getFieldElementsHandler(); + $fieldelementObj =& $fieldelementsHandler->create(); + $fieldelementObj->setVar( 'fieldelement_mid', $fieldMid ); + $fieldelementObj->setVar( 'fieldelement_tid', $fieldTid ); + $fieldelementObj->setVar( 'fieldelement_name', 'Table : '.ucfirst($tableName) ); + $fieldelementObj->setVar( 'fieldelement_value', 'XoopsFormTables-'.ucfirst($tableName) ); + // Insert new field element id for table name + if (!$fieldelementsHandler->insert($fieldelementObj) ) { + $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element'); + } + $xoops->redirect('fields.php', 2, sprintf(XoopsLocale::S_DATABASE_SAVED, $tableName)); + } else { + // Needed code from table name by field_tid + $xoops->redirect('fields.php', 2, sprintf(XoopsLocale::S_DATABASE_UPDATED, $tableName)); + } + $xoops->error($fieldsObj->getHtmlErrors()); break; case 'edit': - $adminMenu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); - $adminMenu->addItemButton(TDMCreateLocale::FIELDS_LIST, 'fields.php', 'application-view-detail'); + $adminMenu->addItemButton(TDMCreateLocale::A_ADD_TABLE, 'tables.php?op=new', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::A_LIST_TABLES, 'tables.php', 'application-view-detail'); + $adminMenu->addItemButton(TDMCreateLocale::A_LIST_FIELDS, 'fields.php', 'application-view-detail'); $adminMenu->renderButton(); - $obj = $fieldsHandler->get($fieldTid); - $form = $xoops->getModuleForm($obj, 'fields'); + $fieldsObj = $fieldsHandler->get($fieldTid); + $form = $xoops->getModuleForm($fieldsObj, 'fields'); $xoops->tpl()->assign('form', $form->render()); break; case 'delete': if ($fieldId > 0) { - $obj = $fieldsHandler->get($fieldId); + $fieldsObj = $fieldsHandler->get($fieldId); if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { $xoops->redirect('fields.php', 3, implode(',', $xoops->security()->getErrors())); } - if ($fieldsHandler->delete($obj)) { + if ($fieldsHandler->delete($fieldsObj)) { $xoops->redirect('fields.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::TABLE)); } else { - $xoops->error($obj->getHtmlErrors()); + $xoops->error($fieldsObj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $fieldId, 'op' => 'delete'), 'fields.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('field_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $fieldId, 'op' => 'delete'), 'fields.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $fieldsObj->getVar('field_name')) . '<br />'); } } else { $xoops->redirect('fields.php', 1, TDMCreateLocale::E_DATABASE_ERROR); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/header.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -8,7 +8,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ -use Xoops\Core\Request; /** * tdmcreate module * @@ -31,15 +30,10 @@ XoopsLoad::loadFile($xoops->path(dirname(__DIR__) . '/include/functions.php')); // Get handler $modulesHandler = $helper->getModulesHandler(); -$tablesHandler = $helper->getTablesHandler(); -$fieldsHandler = $helper->getFieldsHandler(); -$localeHandler = $helper->getLocalesHandler(); -$importHandler = $helper->getImportsHandler(); -// Get $_POST, $_GET, $_REQUEST -$op = Request::getCmd('op'); -$start = Request::getInt('start', 0); -// Parameters -$limit = $helper->getConfig('adminpager'); +$tablesHandler = $helper->getTablesHandler(); +$fieldsHandler = $helper->getFieldsHandler(); +$localesHandler = $helper->getLocalesHandler(); +$importsHandler = $helper->getImportsHandler(); // Add Script $xoops->theme()->addScript('media/xoops/xoops.js'); $xoops->theme()->addScript('modules/system/js/admin.js'); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/imports.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -8,6 +8,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +use Xoops\Core\Request; /** * tdmcreate module * @@ -19,46 +20,44 @@ * @version $Id$ */ include __DIR__ . '/header.php'; +// Get $_POST, $_GET, $_REQUEST +$op = Request::getCmd('op', 'list'); +$start = Request::getInt('start', 0); +// Parameters +$limit = $helper->getConfig('adminpager'); // heaser $xoops->header('admin:tdmcreate/tdmcreate_imports.tpl'); // -//$importId = Request::getInt('import_id', 0); +$importId = Request::getInt('import_id'); // $adminMenu->renderNavigation('imports.php'); // switch ($op) { - case 'list': - $adminMenu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'imports.php?op=new', 'add'); + case 'list': + $adminMenu->addTips(TDMCreateLocale::IMPORT_TIPS); + $adminMenu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'imports.php?op=new', 'add'); + $adminMenu->renderTips(); $adminMenu->renderButton(); // Get modules list - $criteria = new CriteriaCompo(); - $criteria->setSort('import_name'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numImports = $importHandler->getCount($criteria); - $importArr = $importHandler->getAll($criteria); + $numbRowsImports = $importsHandler->getCountImports(); + $importArray = $importsHandler->getAllImports($start, $limit); // Assign Template variables - $xoops->tpl()->assign('imports_count', $numImports); + $xoops->tpl()->assign('imports_count', $numbRowsImports); unset($criteria); - if ($numImports > 0) { - foreach (array_keys($importArr) as $i) { - $import['id'] = $importArr[$i]->getVar('import_id'); - $import['mid'] = $importArr[$i]->getVar('import_mid'); - $import['name'] = $importArr[$i]->getVar('import_name'); - $import['nbtables'] = $importArr[$i]->getVar('import_nbtables'); - $import['nbfields'] = $importArr[$i]->getVar('import_nbfields'); - $xoops->tpl()->append_by_ref('imports', $import); + if ($numbRowsImports > 0) { + foreach (array_keys($importArray) as $i) { + $import = $importsHandler[$i]->getValues(); + $xoops->tpl()->appendByRef('imports', $import); unset($import); } - // Display Page Navigation - if ($numrows > $limit) { - $nav = new XoopsPageNav($numrows, $limit, $start, 'start'); + // Display Imports Navigation + if ($numbRowsImports > $limit) { + $nav = new XoopsPageNav($numbRowsImports, $limit, $start, 'start'); $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { - $xoops->tpl()->assign('error_message', TDMCreateLocale::IMPORT_ERROR_NOIMPORTS); + $xoops->tpl()->assign('error_message', TDMCreateLocale::E_NO_IMPORTS); } break; @@ -66,8 +65,8 @@ $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'imports.php', 'application-view-detail'); $adminMenu->renderButton(); - $obj = $importHandler->create(); - $form = $xoops->getModuleForm($obj, 'import'); + $importsObj = $importsHandler->create(); + $form = $xoops->getModuleForm($importsObj, 'imports'); $xoops->tpl()->assign('form', $form->render()); break; @@ -77,26 +76,26 @@ } if ($importId > 0) { - $obj = $importHandler->get($importId); + $importsObj = $importsHandler->get($importId); //Form imported edited save - $obj->setVar('import_mid', $_POST['import_mid']); - $obj->setVar('import_name', $_POST['import_name']); - $obj->setVar('import_nbtables', $_POST['import_nbtables']); - $obj->setVar('import_tablename', $_POST['import_mid']); - $obj->setVar('import_nbfields', $_POST['import_nbfields']); - $obj->setVar('import_fieldelements', $_POST['import_fieldelements']); + $importsObj->setVar('import_mid', $_POST['import_mid']); + $importsObj->setVar('import_name', $_POST['import_name']); + $importsObj->setVar('import_nbtables', $_POST['import_nbtables']); + $importsObj->setVar('import_tablename', $_POST['import_mid']); + $importsObj->setVar('import_nbfields', $_POST['import_nbfields']); + $importsObj->setVar('import_fieldelements', $_POST['import_fieldelements']); } else { - $obj = $importHandler->create(); + $importsObj = $importsHandler->create(); //Form imported save - $obj->setVar('import_name', $_POST['import_name']); - $obj->setVar('import_mid', $_POST['import_mid']); + $importsObj->setVar('import_name', $_POST['import_name']); + $importsObj->setVar('import_mid', $_POST['import_mid']); $files = $_FILES['importfile']; // If incoming data have been entered correctly if($_POST['upload'] == XoopsLocale::A_SUBMIT && isset($files['tmp_name']) && (substr($files['name'], -4) == '.sql')) { // File recovery - $dir = TDMC_UPLOAD_PATH_FILES; - $file = $_FILES['importfile']; + $dir = TDMC_UPLOAD_PATH_FILES; + $file = $_FILES['importfile']; $tmpName = $file['tmp_name']; // Copy files to the server if (is_uploaded_file($tmpName)) { @@ -145,15 +144,15 @@ $t = 0; foreach(array_keys($resultTable) as $table) { - $obj->setVar('import_tablename', $resultTable[$table]); //$_POST['import_tablename'] - $obj->setVar('import_nbtables', $t); $t++; //$_POST['import_nbtables'] + $importsObj->setVar('import_tablename', $resultTable[$table]); //$_POST['import_tablename'] + $importsObj->setVar('import_nbtables', $t); $t++; //$_POST['import_nbtables'] if(strlen($resultTable[0]) > 0) { $f = 0; foreach(array_keys($resultFields) as $field) { - $obj->setVar('import_nbfields', $f); $f++; // $_POST['import_nbfields'] - $obj->setVar('import_fieldelements', $_POST['import_fieldelements']); + $importsObj->setVar('import_nbfields', $f); $f++; // $_POST['import_nbfields'] + $importsObj->setVar('import_fieldelements', $_POST['import_fieldelements']); } unset($f); } @@ -170,12 +169,12 @@ } } - if ($importHandler->insert($obj)) { + if ($importsHandler->insert($importsObj)) { $xoops->redirect('imports.php', 3, TDMCreateLocale::FORM_OK); } - $xoops->error($obj->getHtmlErrors()); - $form = $xoops->getModuleForm($obj, 'import'); + $xoops->error($importsObj->getHtmlErrors()); + $form = $xoops->getModuleForm($importsObj, 'import'); $xoops->tpl()->assign('form', $form->render()); break; @@ -184,25 +183,25 @@ $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'imports.php', 'application-view-detail'); $adminMenu->renderButton(); - $obj = $importHandler->get($importId); - $form = $xoops->getModuleForm($obj, 'import'); + $importsObj = $importsHandler->get($importId); + $form = $xoops->getModuleForm($importsObj, 'import'); $xoops->tpl()->assign('form', $form->render()); break; case 'delete': if ($importId > 0) { - $obj = $importHandler->get($importId); + $importsObj = $importsHandler->get($importId); if (isset($_POST['ok']) && $_POST['ok'] == 1) { if (!$xoops->security()->check()) { $xoops->redirect('imports.php', 3, implode(',', $xoops->security()->getErrors())); } - if ($importHandler->delete($obj)) { + if ($importsHandler->delete($importsObj)) { $xoops->redirect('imports.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::IMPORT)); } else { - $xoops->error($obj->getHtmlErrors()); + $xoops->error($importsObj->getHtmlErrors()); } } else { - $xoops->confirm(array('ok' => 1, 'id' => $importId, 'op' => 'delete'), 'imports.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('import_name')) . '<br />'); + $xoops->confirm(array('ok' => 1, 'id' => $importId, 'op' => 'delete'), 'imports.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $importsObj->getVar('import_name')) . '<br />'); } } else { $xoops->redirect('imports.php', 1, TDMCreateLocale::E_DATABASE_ERROR); Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/index.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -41,12 +41,12 @@ // tdmcreate modules $criteria = new CriteriaCompo(); $criteria->add(new Criteria('loc_mid', 0, '!=')); -$locale = $localeHandler->getCount($criteria); +$locale = $localesHandler->getCount($criteria); unset($criteria); // tdmcreate import $criteria = new CriteriaCompo(); $criteria->add(new Criteria('import_id', 0, '!=')); -$import = $importHandler->getCount($criteria); +$import = $importsHandler->getCount($criteria); unset($criteria); $r = "red"; $g = "green"; $modulesColor = $modules == 0 ? $r : $g; @@ -66,17 +66,21 @@ // folder path $folderPath = array( - XOOPS_UPLOAD_PATH . '/tdmcreate/', - XOOPS_UPLOAD_PATH . '/tdmcreate/files', - XOOPS_UPLOAD_PATH . '/tdmcreate/repository', - XOOPS_UPLOAD_PATH . '/tdmcreate/images', - XOOPS_UPLOAD_PATH . '/tdmcreate/images/modules', - XOOPS_UPLOAD_PATH . '/tdmcreate/images/tables' -); + TDMC_UPLOAD_PATH, + TDMC_UPLOAD_FILES_PATH, + TDMC_UPLOAD_REPOSITORY_PATH, + TDMC_UPLOAD_REPOSITORY_EXTENSIONS_PATH, + TDMC_UPLOAD_REPOSITORY_MODULES_PATH, + TDMC_UPLOAD_IMAGES_PATH, + TDMC_UPLOAD_IMAGES_EXTENSIONS_PATH, + TDMC_UPLOAD_IMAGES_MODULES_PATH, + TDMC_UPLOAD_IMAGES_TABLES_PATH + ); foreach ($folderPath as $folder) { $adminMenu->addConfigBoxLine($folder, 'folder'); $adminMenu->addConfigBoxLine(array($folder, '777'), 'chmod'); } +$adminMenu->addConfigBoxLine('thumbnail', 'service'); // extension $extensions = array('xtranslator' => 'extension'); Deleted: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locale.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -1,128 +0,0 @@ -<?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 XOOPS Development Team - * @version $Id$ - */ -include __DIR__ . '/header.php'; -// heaser -$xoops->header('admin:tdmcreate/tdmcreate_locale.tpl'); -// -//$localeId = Request::getInt('import_id', 0); -// -$adminMenu->renderNavigation('locale.php'); -// -switch ($op) -{ - case 'list': - $adminMenu->addItemButton(TDMCreateLocale::ADD_LOCALE, 'locale.php?op=new', 'add'); - $adminMenu->renderButton(); - // Get modules list - $criteria = new CriteriaCompo(); - $criteria->setSort('loc_id'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numLocale = $localeHandler->getCount($criteria); - $localeArr = $localeHandler->getAll($criteria); - // Assign Template variables - $xoops->tpl()->assign('locale_count', $numLocale); - unset($criteria); - if ($numLocale > 0) { - foreach (array_keys($localeArr) as $i) { - $locale['id'] = $localeArr[$i]->getVar('loc_id'); - $locale['mid'] = $localeArr[$i]->getVar('loc_mid'); - $locale['name'] = $localeArr[$i]->getVar('loc_file'); - $locale['define'] = $localeArr[$i]->getVar('loc_define'); - $locale['description'] = $localeArr[$i]->getVar('loc_description'); - $xoops->tpl()->append_by_ref('locale', $locale); - unset($locale); - } - // Display Page Navigation - if ($numrows > $limit) { - $nav = new XoopsPageNav($numrows, $limit, $start, 'start'); - $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); - } - } else { - $xoops->tpl()->assign('error_message', TDMCreateLocale::IMPORT_ERROR_NOLOCALE); - } - break; - - case 'new': - $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'locale.php', 'application-view-detail'); - $adminMenu->renderButton(); - - $obj = $localeHandler->create(); - $form = $xoops->getModuleForm($obj, 'locale'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'save': - if (!$xoops->security()->check()) { - $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); - } - - if ($localeId > 0) { - $obj = $localeHandler->get($localeId); - //Form imported edited save - $obj->setVar('loc_mid', Request::getInt('loc_mid')); - $obj->setVar('loc_file', Request::getString('loc_file')); - $obj->setVar('loc_define', Request::getString('loc_define')); - $obj->setVar('loc_description', Request::getString('loc_description')); - $xoops->redirect('locale.php', 3, TDMCreateLocale::E_DATABASE_SQL_FILE_NOT_IMPORTED); - } - if ($localeHandler->insert($obj)) { - $xoops->redirect('locale.php', 3, TDMCreateLocale::FORM_OK); - } - - $xoops->error($obj->getHtmlErrors()); - $form = $xoops->getModuleForm($obj, 'locale'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'edit': - $adminMenu->addItemButton(TDMCreateLocale::IMPORT_OLD_MODULE, 'locale.php?op=import', 'add'); - $adminMenu->addItemButton(TDMCreateLocale::IMPORTED_LIST, 'locale.php', 'application-view-detail'); - $adminMenu->renderButton(); - - $obj = $localeHandler->get($localeId); - $form = $xoops->getModuleForm($obj, 'locale'); - $xoops->tpl()->assign('form', $form->render()); - break; - - case 'delete': - if ($localeId > 0) { - $obj = $localeHandler->get($localeId); - if (isset($_POST['ok']) && $_POST['ok'] == 1) { - if (!$xoops->security()->check()) { - $xoops->redirect('locale.php', 3, implode(',', $xoops->security()->getErrors())); - } - if ($localeHandler->delete($obj)) { - $xoops->redirect('locale.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::IMPORT)); - } else { - $xoops->error($obj->getHtmlErrors()); - } - } else { - $xoops->confirm(array('ok' => 1, 'id' => $localeId, 'op' => 'delete'), 'locale.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $obj->getVar('loc_file')) . '<br />'); - } - } else { - $xoops->redirect('locale.php', 1, TDMCreateLocale::E_DATABASE_ERROR); - } - break; -} - -include __DIR__ . '/footer.php'; \ No newline at end of file Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -0,0 +1,127 @@ +<?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. +*/ +use Xoops\Core\Request; +/** + * 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 XOOPS Development Team + * @version $Id$ + */ +include __DIR__ . '/header.php'; +// Get $_POST, $_GET, $_REQUEST +$op = Request::getCmd('op', 'list'); +$start = Request::getInt('start', 0); +// Parameters +$limit = $helper->getConfig('adminpager'); +// heaser +$xoops->header('admin:tdmcreate/tdmcreate_locales.tpl'); +// +$localeId = Request::getInt('loc_id', 0); +// +$adminMenu->renderNavigation('locale.php'); +// +switch ($op) +{ + case 'list': + $adminMenu->addTips(TDMCreateLocale::LOCALE_TIPS); + $adminMenu->addItemButton(TDMCreateLocale::A_ADD_LOCALE, 'locales.php?op=new', 'add'); + $adminMenu->renderTips(); + $adminMenu->renderButton(); + // + $numbRowsLocales = $localesHandler->getCountLocales(); + $localesArray = $localesHandler->getAllLocales($start, $limit); + // Assign Template variables + $xoops->tpl()->assign('locale_count', $numbRowsLocales); + unset($criteria); + if ($numbRowsLocales > 0) { + foreach (array_keys($localesArray) as $i) { + $locale = $localesHandler->getVars(); + $xoops->tpl()->appendByRef('locales', $locale); + unset($locale); + } + // Display Page Navigation + if ($numbRowsLocales > $limit) { + $nav = new XoopsPageNav($numbRowsLocales, $limit, $start, 'start'); + $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); + } + } else { + $xoops->tpl()->assign('error_message', TDMCreateLocale::E_NO_LOCALES); + } + break; + + case 'new': + $adminMenu->addItemButton(TDMCreateLocale::A_LIST_LOCALE, 'locales.php', 'application-view-detail'); + $adminMenu->renderButton(); + + $localesObj = $localesHandler->create(); + $form = $xoops->getModuleForm($localesObj, 'locales'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'save': + if (!$xoops->security()->check()) { + $xoops->redirect('locales.php', 3, implode(',', $xoops->security()->getErrors())); + } + + if ($localeId > 0) { + $localesObj = $localesHandler->get($localeId); + //Form imported edited save + $localesObj->setVar('loc_mid', Request::getInt('loc_mid')); + $localesObj->setVar('loc_file', Request::getString('loc_file')); + $localesObj->setVar('loc_define', Request::getString('loc_define')); + $localesObj->setVar('loc_description', Request::getString('loc_description')); + $xoops->redirect('locales.php', 3, TDMCreateLocale::E_DATABASE_SQL_FILE_NOT_IMPORTED); + } + if ($localesHandler->insert($localesObj)) { + $xoops->redirect('locales.php', 3, TDMCreateLocale::FORM_OK); + } + + $xoops->error($localesObj->getHtmlErrors()); + $form = $xoops->getModuleForm($localesObj, 'locales'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'edit': + $adminMenu->addItemButton(TDMCreateLocale::A_ADD_LOCALE, 'locales.php?op=new', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::A_LIST_LOCALE, 'locales.php', 'application-view-detail'); + $adminMenu->renderButton(); + + $localesObj = $localesHandler->get($localeId); + $form = $xoops->getModuleForm($localesObj, 'locales'); + $xoops->tpl()->assign('form', $form->render()); + break; + + case 'delete': + if ($localeId > 0) { + $localesObj = $localesHandler->get($localeId); + if (isset($_POST['ok']) && $_POST['ok'] == 1) { + if (!$xoops->security()->check()) { + $xoops->redirect('locales.php', 3, implode(',', $xoops->security()->getErrors())); + } + if ($localesHandler->delete($localesObj)) { + $xoops->redirect('locales.php', 2, sprintf(TDMCreateLocale::S_DELETED, TDMCreateLocale::IMPORT)); + } else { + $xoops->error($localesObj->getHtmlErrors()); + } + } else { + $xoops->confirm(array('ok' => 1, 'id' => $localeId, 'op' => 'delete'), 'locales.php', sprintf(TDMCreateLocale::QF_ARE_YOU_SURE_TO_DELETE, $localesObj->getVar('loc_file')) . '<br />'); + } + } else { + $xoops->redirect('locales.php', 1, TDMCreateLocale::E_DATABASE_ERROR); + } + break; +} + +include __DIR__ . '/footer.php'; \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/locales.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 Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/menu.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -37,7 +37,7 @@ $adminmenu[$i]['icon'] = 'editfields.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU5; -$adminmenu[$i]['link'] = 'admin/locale.php'; +$adminmenu[$i]['link'] = 'admin/locales.php'; $adminmenu[$i]['icon'] = 'languages.png'; $i++; $adminmenu[$i]['title'] = TDMCreateLocale::ADMIN_MENU6; Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/modules.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -8,6 +8,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +use Xoops\Core\Request; /** * tdmcreate module * @@ -19,8 +20,13 @@ * @version $Id: modules.php 10665 2012-12-27 10:14:15Z timgno $ */ include __DIR__ . '/header.php'; +// Get $_POST, $_GET, $_REQUEST +$op = Request::getCmd('op', 'list'); +$start = Request::getInt('start', 0); +// Parameters +$limit = $helper->getConfig('adminpager'); // Get Action type -//$modId = Request::getInt('mod_id'); +$modId = Request::getInt('mod_id'); // Get handler $xoops->header('admin:tdmcreate/tdmcreate_modules.tpl'); $adminMenu->renderNavigation('modules.php'); @@ -28,39 +34,31 @@ { case 'list': default: - $adminMenu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); + $adminMenu->addTips(TDMCreateLocale::MODULE_TIPS); + $adminMenu->addItemButton(TDMCreateLocale::A_ADD_MODULE, 'modules.php?op=new', 'add'); + $adminMenu->renderTips(); $adminMenu->renderButton(); + $xoops->theme()->addStylesheet('modules/tdmcreate/assets/css/styles.css'); + $xoops->theme()->addScript('modules/tdmcreate/assets/js/functions.js'); // Get modules list - $criteria = new CriteriaCompo(); - $criteria->setSort('mod_name'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numRowsMods = $modulesHandler->getCount($criteria); - $modulesArray = $modulesHandler->getAll($criteria); + $numbRowsMods = $modulesHandler->getCountModules(); + $modulesArray = $modulesHandler->getAllModules($start, $limit); + // Redirect if there aren't modules + if ( $numbRowsMods == 0 ) { + $xoops->redirect('modules.php?op=new', 2, TDMCreateLocale::NOT_MODULES ); + } // Assign Template variables - $xoops->tpl()->assign('modules_count', $numRowsMods); - unset($criteria); - if ($numRowsMods > 0) { + $xoops->tpl()->assign('modules_count', $numbRowsMods); + $xoops->tpl()->assign('modPathIcon16', TDMC_URL . '/assets/icons/16'); + if ($numbRowsMods > 0) { foreach (array_keys($modulesArray) as $i) { - $mod['id'] = $modulesArray[$i]->getVar('mod_id'); - $mod['name'] = $modulesArray[$i]->getVar('mod_name'); - $mod['version'] = $modulesArray[$i]->getVar('mod_version'); - $mod['image'] = $modulesArray[$i]->getVar('mod_image'); - $mod['release'] = $modulesArray[$i]->getVar('mod_release'); - $mod['status'] = $modulesArray[$i]->getVar('mod_status'); - $mod['admin'] = $modulesArray[$i]->getVar('mod_admin'); - $mod['user'] = $modulesArray[$i]->getVar('mod_user'); - $mod['submenu'] = $modulesArray[$i]->getVar('mod_submenu'); - $mod['search'] = $modulesArray[$i]->getVar('mod_search'); - $mod['comments'] = $modulesArray[$i]->getVar('mod_comments'); - $mod['notifications'] = $modulesArray[$i]->getVar('mod_notifications'); - $xoops->tpl()->append_by_ref('modules', $mod); - unset($mod); + $module = $modulesArray[$i]->getValues(); + $xoops->tpl()->appendByRef('modules', $module); + unset($module); } // Display Page Navigation - if ($numRowsMods > $limit) { - $nav = new XoopsPageNav($numRowsMods, $limit, $start, 'start'); + if ($numbRowsMods > $limit) { + $nav = new XoopsPageNav($numbRowsMods, $limit, $start, 'start'); $xoops->tpl()->assign('pagenav', $nav->renderNav(4)); } } else { @@ -80,33 +78,32 @@ case 'save': if (!$xoops->security()->check()) { $xoops->redirect('modules.php', 3, implode(',', $xoops->security()->getErrors())); - } - $modId = Request::getInt('mod_id', 0); + } if ($modId > 0) { $modulesObj = $modulesHandler->get($modId); } else { $modulesObj = $modulesHandler->create(); } //Form module save - $modulesObj->setVars(array('mod_name' => Request::getString('mod_name', ''), - 'mod_isextension' => Request::getInt('mod_isextension', 0), - 'mod_version' => Request::getString('mod_version', ''), - 'mod_description' => Request::getString('mod_description', ''), - 'mod_author' => Request::getString('mod_author', ''), - 'mod_author_mail' => Request::getString('mod_author_mail', ''), - 'mod_author_website_url' => Request::getString('mod_author_website_url', ''), - 'mod_author_website_name' => Request::getString('mod_author_website_name', ''), - 'mod_credits' => Request::getString('mod_credits', ''), - 'mod_license' => Request::getString('mod_license', ''), - 'mod_release_info' => Request::getString('mod_release_info', ''), - 'mod_release_file' => Request::getString('mod_release_file', ''), - 'mod_manual' => Request::getString('mod_manual', ''), - 'mod_manual_file' => Request::getString('mod_manual_file', ''))); + $modulesObj->setVars(array( 'mod_name' => Request::getString('mod_name', ''), + 'mod_dirname' => Request::getString('mod_dirname', ''), + 'mod_version' => Request::getString('mod_version', ''), + 'mod_description' => Request::getString('mod_description', ''), + 'mod_author' => Request::getString('mod_author', ''), + 'mod_author_mail' => Request::getString('mod_author_mail', ''), + 'mod_author_website_url' => Request::getString('mod_author_website_url', ''), + 'mod_author_website_name' => Request::getString('mod_author_website_name', ''), + 'mod_credits' => Request::getString('mod_credits', ''), + 'mod_license' => Request::getString('mod_license', ''), + 'mod_release_info' => Request::getString('mod_release_info', ''), + 'mod_release_file' => Request::getString('mod_release_file', ''), + 'mod_manual' => Request::getString('mod_manual', ''), + 'mod_manual_file' => Request::getString('mod_manual_file', ''))); //Form module_image - $uploader = new XoopsMediaUploader( TDMC_MODULES_PATH_IMG, $helper->getConfig('mimetypes'), + $uploader = new XoopsMediaUploader( TDMC_UPLOAD_IMAGES_MODULES_PATH, $helper->getConfig('mimetypes'), $helper->getConfig('maxuploadsize'), null, null); if ($uploader->fetchMedia('xoops_upload_file')) { - $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['xoops_upload_file']['name']); + $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES['modules_image']['name']); $imageName = 'logo.'.$extension; $uploader->setPrefix($imageName); $uploader->fetchMedia('xoops_upload_file'); @@ -130,16 +127,19 @@ 'mod_support_name' => Request::getString('mod_support_name', ''), 'mod_website_url' => Request::getString('mod_website_url', ''), 'mod_website_name' => Request::getString('mod_website_name', ''), - 'mod_release' => Request::getString('mod_release', ''), + 'mod_release' => strtotime(Request::getString('mod_release', '')), 'mod_status' => Request::getString('mod_status', ''), + 'mod_isextension' => Request::getInt('mod_isextension', 0), 'mod_admin' => Request::getInt('mod_admin', 0), 'mod_user' => Request::getInt('mod_user', 0), 'mod_submenu' => Request::getInt('mod_submenu', 0), 'mod_search' => Request::getInt('mod_search', 0), 'mod_comments' => Request::getInt('mod_comments', 0), - 'mod_notifications' => Request::getInt('mod_notifications', 0), + 'mod_notifications' => Request::getInt('mod_notifications', 0), + 'mod_permissions' => Request::getInt('mod_permissions', 0), 'mod_paypal' => Request::getString('mod_paypal', ''), - 'mod_subversion' => Request::getString('mod_subversion', ''))); + 'mod_subversion' => Request::getString('mod_subversion', ''), + 'mod_inroot_copy' => Request::getString('mod_inroot_copy', ''))); // Insert Data if ($modulesHandler->insert($modulesObj)) { $xoops->redirect('modules.php', 2, XoopsLocale::S_DATA_INSERTED); @@ -151,10 +151,9 @@ break; case 'edit': - $adminMenu->addItemButton(TDMCreateLocale::ADD_MODULE, 'modules.php?op=new', 'add'); - $adminMenu->addItemButton(TDMCreateLocale::MODULES_LIST, 'modules.php', 'application-view-detail'); + $adminMenu->addItemButton(TDMCreateLocale::A_ADD_MODULE, 'modules.php?op=new', 'add'); + $adminMenu->addItemButton(TDMCreateLocale::A_LIST_MODULES, 'modules.php', 'application-view-detail'); $adminMenu->renderButton(); - $modId = Request::getInt('mod_id', 0); if ($modId > 0) { $modulesObj = $modulesHandler->get($modId); $form = $helper->getForm($modulesObj, 'modules'); @@ -165,7 +164,6 @@ break; case 'delete': - $modId = Request::getInt('mod_id', 0); if ($modId > 0) { $modulesObj = $modulesHandler->get($modId); if (isset($_POST['ok']) && $_POST['ok'] == 1) { Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2015-05-11 13:03:29 UTC (rev 13060) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2015-05-15 12:00:25 UTC (rev 13061) @@ -8,6 +8,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ +use Xoops\Core\Request; /** * tdmcreate module * @@ -19,8 +20,13 @@ * @version $Id: tables.php 10665 2012-12-27 10:14:15Z timgno $ */ include __DIR__ . '/header.php'; +// Get $_POST, $_GET, $_REQUEST +$op = Request::getCmd('op', 'list'); +$start = Request::getInt('start', 0); +// Parameters +$limit = $helper->getConfig('adminpager'); // Preferences Limit -//$tableId = Request::getInt('table_id', 0); +$tableId = Request::getInt('table_id', 0); // header $xoops->header('admin:tdmcreate/tdmcreate_tables.tpl'); // @@ -30,79 +36,52 @@ { case 'list': default: - $adminMenu->addItemButton(TDMCreateLocale::ADD_TABLE, 'tables.php?op=new', 'add'); - $adminMenu->renderButton(); + $adminMenu->addTips(TDMCreateLocale::TABLE_TIPS); + $adminMenu->addItemButton(TDMCreateLocale::A_ADD_TABLE, 'tables.php?op=new', 'add'); + $adminMenu->renderTips(); + $adminMenu->renderButton(); + $xoops->theme()->addStylesheet('modules/tdmcreate/assets/css/styles.css'); + $xoops->theme()->addScript('modules/tdmcreate/assets/js/functions.js'); + $xoops->theme()->addScript('modules/tdmcreate/assets/js/sortable.js'); // Get modules list - $criteria = new CriteriaCompo(); - $criteria->setSort('mod_name'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numRowsMods = $modulesHandler->getCount($criteria); - $moduleArray = $modulesHandler->getAll($criteria); - $xoops->tpl()->assign('modules_count', $numRowsMods); - $xoops->tpl()->assign('mimg_path', TDMC_MODULES_URL_IMG); - unset($criteria); + $numbRowsMods = $modulesHandler->getCountModules(); + $modulesArray = $modulesHandler->getAllModules($start, $limit); + $xoops->tpl()->assign('modules_count', $numbRowsMods); + $xoops->tpl()->assign('modules_images_url', TDMC_UPLOAD_IMAGES_MODULES_URL); + $xoops->tpl()->assign('modPathIcon16', TDMC_URL . '/assets/icons/16'); // Redirect if there aren't modules - /*if ( $numRowsMods == 0 ) { - $xoops->redirect('modules.php?op=new', 2, TDMCreateLocale::NOTMODULES ); - }*/ + if ( $numbRowsMods == 0 ) { + $xoops->redirect('modules.php?op=new', 2, TDMCreateLocale::NOT_MODULES ); + } // Assign Template variables - $xoops->tpl()->assign('mods_count', $numRowsMods); - if ($numRowsMods > 0) { - foreach (array_keys($moduleArray) as $i) { - $mod['id'] = $moduleArray[$i]->getVar('mod_id'); - $mod['name'] = $moduleArray[$i]->getVar('mod_name'); - $mod['image'] = $moduleArray[$i]->getVar('mod_image'); - $mod['admin'] = $moduleArray[$i]->getVar('mod_admin'); - $mod['user'] = $moduleArray[$i]->getVar('mod_user'); - $mod['submenu'] = $moduleArray[$i]->getVar('mod_submenu'); - $mod['search'] = $moduleArray[$i]->getVar('mod_search'); - $mod['comments'] = $moduleArray[$i]->getVar('mod_comments'); - $mod['notifications'] = $moduleArray[$i]->getVar('mod_notifications'); - /*if (file_exists($timage = XOOPS_URL ."/uploads/tdmcreate/images/tables/".$table_image)) { - $table['image'] = $timage; - } elseif (file_exists($timage = XOOPS_URL ."/media/xoops/images/icons/32/".$table_image)) { - $table['image'] = $timage; - }*/ - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('table_mid', $i)); - $criteria->setSort('table_name'); - $criteria->setOrder('ASC'); - $criteria->setStart($start); - $criteria->setLimit($limit); - $numRowsTables = $tablesHandler->getCount($criteria); - $tablesArray = $tablesHandler->getAll($criteria); - $xoops->tpl()->assign('tables_count', $numRowsTables); - $xoops->tpl()->assign('timg_path', TDMC_TABLES_URL_IMG); - unset($criteria); - $tables = array(); - if ($numRowsTables > 0) { - foreach (array_keys($tablesArray) as $i) + if ($numbRowsMods > 0) { + foreach (array_keys($modulesArray) as $m) { + $module = $modulesArray[$m]->getValues(); + $numbRowsTables = $tablesHandler->getCountTables(); + $tablesArray = $tablesHandler->getAllTablesByModuleId($m, $start, $limit); + $xoops->tpl()->assign('tables_count', $numbRowsTables); + $xoops->tpl()->assign('tables_images_url', TDMC_UPLOAD_IMAGES_TABLES_URL); + $tables = array(); + + if ($numbRowsTables > 0) { + $lid = 1; + foreach (array_keys($tablesArr... [truncated message content] |