|
From: <txm...@us...> - 2014-06-10 11:22:53
|
Revision: 12574
http://sourceforge.net/p/xoops/svn/12574
Author: txmodxoops
Date: 2014-06-10 11:22:46 +0000 (Tue, 10 Jun 2014)
Log Message:
-----------
Move files creation, in their subdirectories
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs/docs_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs/docs_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/include_common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/language_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/language_tpl.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/templates_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_notification_update.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_print.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_rss.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_submit.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/user_xoopsversion.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_notification_update.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_objects.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_about.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_about.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,72 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: 1.91 admin_about.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class AdminAbout extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $module_donations = $module->getVar('mod_donations');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= <<<EOT
+include 'header.php';
+echo \$adminMenu->addNavigation('about.php');
+echo \$adminMenu->renderAbout('{$module_donations}', false);
+include 'footer.php';
+EOT;
+ $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_footer.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_footer.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,77 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: 1.91 admin_footer.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class AdminFooter extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param string $filename
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param string $filename
+ */
+ public function write($module, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $support_name = $module->getVar('mod_support_name');
+ $support_url = $module->getVar('mod_support_url');
+ $language = $this->getLanguage($module_name, 'AM');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= <<<EOT
+\necho "<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
+ <img src='".\$sysPathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
+echo "<div class='center smallsmall italic pad5'>
+ <strong>" . \$xoopsModule->getVar('name') . "</strong> ".{$language}MAINTAINEDBY."
+ <a href='{$support_url}' title='Visit {$support_name}' class='tooltip' rel='external'>{$support_name}</a></div>";
+xoops_cp_footer();
+EOT;
+ $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_header.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_header.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,132 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: admin_header.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class AdminHeader extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public function write($module, $table, $tables, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->setTable($table);
+ $this->setTables($tables);
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $tables = $this->getTables();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $stl_mod_name = strtolower($module_name);
+ $ucfmod_name = ucfirst($module_name);
+ $language = $this->getLanguage('AM');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= <<<EOT
+\nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php';
+\$thisPath = dirname(dirname(__FILE__));
+include_once \$thisPath.'/include/common.php';
+include_once \$thisPath.'/include/functions.php';
+//\n
+EOT;
+ if ( $table->getVar('table_name') != '' ) {
+ $content .= <<<EOT
+include_once \$thisPath.'/class/helper.php';
+// Get instance
+\${$stl_mod_name}Helper = {$ucfmod_name}Helper::getInstance();\n
+EOT;
+ }
+ $content .= <<<EOT
+\$thisModule = \$GLOBALS['xoopsModule']->getVar('dirname');
+
+\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16');
+\$sysPathIcon32 = '../' . \$xoopsModule->getInfo('sysicons32');
+\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
+
+\$modPathIcon16 = \$xoopsModule->getInfo('modicons16');
+\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');
+//\n
+EOT;
+ foreach (array_keys($tables) as $i)
+ {
+ $table_name = $tables[$i]->getVar('table_name');
+ $content .= <<<EOT
+\${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', \$thisModule);\n
+EOT;
+ }
+ $content .=<<<EOT
+//
+\$myts =& MyTextSanitizer::getInstance();
+if (!isset(\$xoopsTpl) || !is_object(\$xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH."/class/template.php");
+ \$xoopsTpl = new XoopsTpl();
+}
+// System icons path
+\$xoopsTpl->assign('sysPathIcon16', \$sysPathIcon16);
+\$xoopsTpl->assign('sysPathIcon32', \$sysPathIcon32);
+// Local icons path
+\$xoopsTpl->assign('modPathIcon16', \$modPathIcon16);
+\$xoopsTpl->assign('modPathIcon32', \$modPathIcon32);
+
+//Load languages
+xoops_loadLanguage('admin', \$thisModule);
+xoops_loadLanguage('modinfo', \$thisModule);
+xoops_loadLanguage('main', \$thisModule);
+// Local admin menu class
+if ( file_exists(\$GLOBALS['xoops']->path(\$pathModuleAdmin.'/moduleadmin.php'))){
+ include_once \$GLOBALS['xoops']->path(\$pathModuleAdmin.'/moduleadmin.php');
+}else{
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+}
+xoops_cp_header();
+\$adminMenu = new ModuleAdmin();
+EOT;
+ $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_index.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_index.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,101 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: admin_index.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class AdminIndex extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public function write($module, $table, $tables, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ //$table = $this->getTable();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $language = $this->getLanguage($module_name, 'AM');
+ $language_thereare = $this->getLanguage($module_name, 'AM', 'THEREARE_');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= <<<EOT
+include_once 'header.php';\n
+EOT;
+ foreach (array_keys($this->tables) as $i)
+ {
+ $table_name = $this->tables[$i]->getVar('table_name');
+ $content .= <<<EOT
+//count "{$table_name}"
+\$count_{$table_name} = \${$table_name}Handler->getCount();\n
+EOT;
+ }
+ $content .= <<<EOT
+// InfoBox Statistics
+\$adminMenu->addInfoBox({$language}STATISTICS);
+// InfoBox\n
+EOT;
+ foreach (array_keys($this->tables) as $i)
+ {
+ $table_name = $this->tables[$i]->getVar('table_name');
+ $ta_stutable_name = $language_thereare.strtoupper($table_name);
+ $content .= <<<EOT
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$ta_stutable_name}.'</label>', \$count_{$table_name});\n
+EOT;
+ }
+ $content .= <<<EOT
+// Render Index
+echo \$adminMenu->addNavigation('index.php');
+echo \$adminMenu->renderIndex();
+include_once 'footer.php';
+EOT;
+ $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_menu.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_menu.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,116 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: admin_menu.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class AdminMenu extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param mixed $tables
+ * @param string $filename
+ */
+ public function write($module, $table, $tables, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->tables = $tables;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $module_name = $module->getVar('mod_name');
+ //$table = $this->getTable();
+ $filename = $this->getFileName();
+ $language = $this->getLanguage($module_name, 'MI', 'ADMENU');
+ $menu = 1;
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= <<<EOT
+\n\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+\$module_handler =& xoops_gethandler('module');
+\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
+\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid'));
+\$sysPathIcon32 = \$moduleInfo->getInfo('sysicons32');
+\$adminmenu = array();
+\$i = 1;
+\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/index.php';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/home.png';
+\$i++;
+EOT;
+ foreach (array_keys($this->tables) as $i)
+ {
+ if ( $this->tables[$i]->getVar('table_admin') == 1 )
+ {
+ $menu++;
+ $content .= <<<EOT
+\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/{$this->tables[$i]->getVar('table_name')}.php';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$this->tables[$i]->getVar('table_image')}';
+\$i++;
+EOT;
+ }
+ }
+ if( $this->table->getVar('table_permissions') == 1 ) {
+ $menu++;
+ $content .= <<<EOT
+\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/permissions.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/permissions.png';
+\$i++;
+EOT;
+ }
+ $menu++;
+ $content .= <<<EOT
+\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/about.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/about.png';
+unset( \$i );
+EOT;
+ unset( $menu );
+
+ $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_objects.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_objects.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,122 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: admin_objects.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class AdminObjects
+{
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function getSimpleSetVar
+ * @param string $table_name
+ * @param string $field_name
+ */
+ public function getSimpleSetVar($table_name, $field_name) {
+ $ret = <<<EOT
+ \${$table_name}_obj->setVar('{$field_name}', \$_POST['{$field_name}']);\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getTextDateSelect
+ * @param string $table_name
+ * @param string $field_name
+ */
+ public function getTextDateSelect($table_name, $field_name) {
+ $ret = <<<EOT
+ \${$table_name}_obj->setVar('{$field_name}', strtotime(\$_POST['{$field_name}']));\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getCheckBoxOrRadioYN
+ * @param string $table_name
+ * @param string $field_name
+ */
+ public function getCheckBoxOrRadioYN($table_name, $field_name) {
+ $ret = <<<EOT
+ \${$table_name}_obj->setVar('{$field_name}', ((\$_REQUEST['{$field_name}'] == 1) ? '1' : '0'));\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getUploadImage
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $field_name
+ */
+ public function getUploadImage($module_name, $table_name, $field_name) {
+ $ret = <<<EOT
+ include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+ \$uploaddir = XOOPS_UPLOAD_PATH.'/{$module_name}/images/{$table_name}/';
+ \$uploader = new XoopsMediaUploader(\$uploaddir, xoops_getModuleOption('mimetypes', '{$module_name}'),
+ xoops_getModuleOption('maxsize', '{$module_name}'), null, null);
+ if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
+ \$uploader->setPrefix('{$field_name}_');
+ \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
+ if (!\$uploader->upload()) {
+ \$errors = \$uploader->getErrors();
+ redirect_header('javascript:history.go(-1)', 3, \$errors);
+ } else {
+ \${$table_name}_obj->setVar('{$field_name}', \$uploader->getSavedFileName());
+ }
+ } else {
+ \${$table_name}_obj->setVar('{$field_name}', \$_POST['{$field_name}']);
+ }\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getUploadFile
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $field_name
+ */
+ public function getUploadFile($module_name, $table_name, $field_name) {
+ $ret = <<<EOT
+ include_once XOOPS_ROOT_PATH.'/class/uploader.php';
+ \$uploaddir = XOOPS_UPLOAD_PATH.'/{$module_name}/files/{$table_name}/';
+ \$uploader = new XoopsMediaUploader(\$uploaddir, xoops_getModuleOption('mimetypes', '{$module_name}'),
+ xoops_getModuleOption('maxsize', '{$module_name}'), null, null);
+ if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
+ \$uploader->setPrefix('{$field_name}_') ;
+ \$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
+ if (!\$uploader->upload()) {
+ \$errors = \$uploader->getErrors();
+ redirect_header('javascript:history.go(-1)', 3, \$errors);
+ } else {
+ \${$table_name}_obj->setVar('{$field_name}', \$uploader->getSavedFileName());
+ }
+ }\n
+EOT;
+ return $ret;
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_pages.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_pages.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,309 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: admin_pages.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+require_once 'admin_objects.php';
+class AdminPages extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $adminobjects = null;
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ parent::__construct();
+ $this->adminobjects = AdminObjects::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param string $table
+ */
+ public function write($module, $table) {
+ $this->setModule($module);
+ $this->setTable($table);
+ }
+ /*
+ * @public function getAdminPagesHeader
+ * @param string $mod_name
+ * @param string $table_name
+ */
+ public function getAdminPagesHeader($mod_name, $table_name) {
+
+ $ret = <<<EOT
+\ninclude_once 'header.php';
+//It recovered the value of argument op in URL$
+\$op = {$mod_name}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
+
+echo \$adminMenu->addNavigation('{$table_name}.php');
+switch (\$op)
+{\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPagesList
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getAdminPagesList($table_name, $language, $fields, $fpif, $fpmf) {
+ $stu_table_name = strtoupper($table_name);
+ $ret = <<<EOT
+ case 'list':
+ default:
+ \$limit = xoops_getModuleOption('adminpager');
+ \$start = TDMCreate_CleanVars(\$_REQUEST, 'start', 0);
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ echo \$adminMenu->renderButton();
+ \$criteria = new CriteriaCompo();
+ \$criteria->setSort('{$fpif} ASC, {$fpmf}');
+ \$criteria->setOrder('ASC');
+ \${$table_name}_rows = \${$table_name}Handler->getCount(\$criteria);
+ \${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
+ unset(\$criteria);
+
+ // Table view
+ if (\${$table_name}_rows > 0)
+ {
+ foreach (array_keys(\${$table_name}_arr) as \$i)
+ {\n
+EOT;
+ foreach(array_keys($fields) as $f)
+ {
+ $field_name = $fields[$f]->getVar('field_name');
+ $rp_field_name = $field_name;
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false){
+ $rp_field_name = substr($field_name, $str + 1, strlen($field_name));
+ }
+ }
+ $lp_field_name = substr($field_name, 0, strpos($field_name, '_'));
+ $ret .= <<<EOT
+ \${$lp_field_name}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
+EOT;
+ }
+ $ret .= <<<EOT
+ \$GLOBALS['xoopsTpl']->append('{$table_name}_list', \${$lp_field_name});
+ unset(\${$lp_field_name});
+ }
+ if ( \${$table_name}_rows > \$limit ) {
+ include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
+ \$pagenav = new XoopsPageNav(\${$table_name}_rows, \$limit, \$start, 'start', 'op=list&limit=' . \$limit);
+ \$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4));
+ }
+ } else {
+ \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stu_table_name});
+ }
+ break;\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPagesNew
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getAdminPagesNew($table_name, $language) {
+ $stu_table_name = strtoupper($table_name);
+ $ret = <<<EOT
+ case 'new':
+ \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
+ echo \$adminMenu->renderButton();
+
+ \${$table_name}Obj =& \${$table_name}Handler->create();
+ \$form = \${$table_name}Obj->getForm();
+ \$form->display();
+ break;\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPagesSave
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getAdminPagesSave($module_name, $table_name, $language, $fields, $fpif, $fpmf)
+ {
+ $ret = <<<EOT
+ case 'save':
+ if ( !\$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('{$table_name}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (isset(\$_REQUEST['{$fpif}'])) {
+ \${$table_name}Obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ } else {
+ \${$table_name}Obj =& \${$table_name}Handler->create();
+ }\n
+EOT;
+ foreach (array_keys($fields) as $f)
+ {
+ $field_name = $fields[$f]->getVar('field_name');
+ $field_element = $fields[$f]->getVar('field_element');
+ if($f > 0) {
+ switch($field_element) {
+ case 4:
+ case 5:
+ $ret .= $this->adminobjects->getCheckBoxOrRadioYN($table_name, $field_name);
+ break;
+ case 9:
+ $ret .= $this->adminobjects->getUploadImage($module_name, $table_name, $field_name);
+ break;
+ case 10:
+ $ret .= $this->adminobjects->getUploadFile($module_name, $table_name, $field_name);
+ break;
+ case 11:
+ $ret .= $this->adminobjects->getTextDateSelect($table_name, $field_name);
+ break;
+ default:
+ $ret .= $this->adminobjects->getSimpleSetVar($table_name, $field_name);
+ break;
+ }
+ }
+ }
+
+ $ret .= <<<EOT
+
+ if (\${$table_name}Handler->insert(\${$table_name}Obj)) {
+ redirect_header('{$table_name}.php?op=list', 2, {$language}FORMOK);
+ }
+
+ echo \${$table_name}Obj->getHtmlErrors();
+ \$form =& \${$table_name}Obj->getForm();
+ \$form->display();
+ break;\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPagesEdit
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getAdminPagesEdit($table_name, $language, $fpif) {
+ $stu_table_name = strtoupper($table_name);
+ $ret = <<<EOT
+ case 'edit':
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
+ echo \$adminMenu->renderButton();
+ \${$table_name}Obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ \$form = \${$table_name}Obj->getForm();
+ \$form->display();
+ break;\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPagesDelete
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getAdminPagesDelete($table_name, $language, $fpif, $fpmf) {
+
+ $ret = <<<EOT
+ case 'delete':
+ \${$table_name}Obj =& \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
+ if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) {
+ if ( !\$GLOBALS['xoopsSecurity']->check() ) {
+ redirect_header('{$table_name}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
+ }
+ if (\${$table_name}Handler->delete(\${$table_name}Obj)) {
+ redirect_header('{$table_name}.php', 3, {$language}FORMDELOK);
+ } else {
+ echo \${$table_name}Obj->getHtmlErrors();
+ }
+ } else {
+ xoops_confirm(array('ok' => 1, '{$fpif}' => \$_REQUEST['{$fpif}'], 'op' => 'delete'), \$_SERVER['REQUEST_URI'], sprintf({$language}FORMSUREDEL, \${$table_name}Obj->getVar('{$fpmf}')));
+ }
+ break;\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPagesFooter
+ * @param null
+ */
+ public function getAdminPagesFooter() {
+ $ret = <<<EOT
+}
+include_once 'footer.php';
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function renderFile($filename)
+ {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $table->getVar('table_name');
+ $language = $this->getLanguage($module_name, 'AM');
+ $fpif = ''; $fpmf = '';
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
+ {
+ $field_name = $fields[$f]->getVar('field_name');
+ if($f == 0) {
+ $fpif = $field_name;
+ }
+ if($fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $field_name;
+ }
+ }
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getAdminPagesHeader($module_name, $table_name);
+ $content .= $this->getAdminPagesList($table_name, $language, $fields, $fpif, $fpmf);
+ $content .= $this->getAdminPagesNew($table_name, $language);
+ $content .= $this->getAdminPagesSave($module_name, $table_name, $language, $fields, $fpif, $fpmf);
+ $content .= $this->getAdminPagesEdit($table_name, $language, $fpif);
+ $content .= $this->getAdminPagesDelete($table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesFooter();
+ //
+ $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_permissions.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_permissions.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,222 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: admin_permissions.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class AdminPermissions extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ parent::__construct();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ * @param mixed $tables
+ * @param string $filename
+ */
+ public function write($module, $tables, $filename) {
+ $this->setModule($module);
+ $this->setFileName($filename);
+ $this->setTables($tables);
+ }
+ /*
+ * @public function render
+ * @param string $module_name
+ * @param string $language
+ */
+ public function getHeaderPermissionsCode($module_name, $language)
+ {
+ $ret = <<<PRM
+\ninclude_once 'header.php';
+include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';
+if( !empty(\$_POST['submit']) )
+{
+ redirect_header( XOOPS_URL.'/modules/'.\$xoopsModule->dirname().'/admin/permissions.php', 1, _MP_GPERMUPDATED );
+}
+// Check admin have access to this page
+/*\$group = \$xoopsUser->getGroups ();
+\$groups = xoops_getModuleOption ( 'admin_groups', \$thisDirname );
+if (count ( array_intersect ( \$group, \$groups ) ) <= 0) {
+ redirect_header ( 'index.php', 3, _NOPERM );
+}*/
+
+echo \$adminMenu->addNavigation('permissions.php');
+
+\$permission = {$module_name}_CleanVars(\$_POST, 'permission', 1, 'int');
+\$selected = array('', '', '', '');
+\$selected[\$permission-1] = ' selected';
+
+\$permTableForm = new XoopsTableForm('fselperm', 'permissions.php', 'post');
+\$formSelect = new XoopsFormSelect('', 'permission', onChange='javascript: document.fselperm.submit()');
+\$formSelect->addOption(\$selected[0], {$language}GLOBAL);
+\$formSelect->addOption(\$selected[1], {$language}APPROVE);
+\$formSelect->addOption(\$selected[2], {$language}SUBMIT);
+\$formSelect->addOption(\$selected[3], {$language}VIEW);
+\$permTableForm->addElement(\$formSelect);
+\$permTableForm->display();\n\n
+PRM;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param string $module_name
+ * @param string $language
+ */
+ public function getSwitchPermissionsCode($module_name, $language)
+ {
+ $ret = <<<PRM
+\$module_id = \$xoopsModule->getVar('mid');
+switch(\$permission)
+{
+ case 1:
+ \$formTitle = {$language}GLOBAL;
+ \$permName = '{$module_name}_ac';
+ \$permDesc = {$language}GLOBAL_DESC;
+ \$globalPerms = array( '4' => {$language}GLOBAL_4,
+ '8' => {$language}GLOBAL_8,
+ '16' => {$language}GLOBAL_16 );
+ break;
+ case 2:
+ \$formTitle = {$language}APPROVE;
+ \$permName = '{$module_name}_access';
+ \$permDesc = {$language}APPROVE_DESC;
+ break;
+ case 3:
+ \$formTitle = {$language}SUBMIT;
+ \$permName = '{$module_name}_submit';
+ \$permDesc = {$language}SUBMIT_DESC;
+ break;
+ case 4:
+ \$formTitle = {$language}VIEW;
+ \$permName = '{$module_name}_view';
+ \$permDesc = {$language}VIEW_DESC;
+ break;
+}\n
+PRM;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getBodyPermissionsCode($module_name, $language)
+ {
+ $tables = $this->getTables();
+ foreach(array_keys($tables) as $t)
+ {
+ $table_id = $tables[$t]->getVar('table_id');
+ if($tables[$t]->getVar('table_permissions') == 1) {
+ $table_name = $tables[$t]->getVar('table_name');
+ }
+ }
+ $fields = $this->getTableFields($table_id);
+ foreach(array_keys($fields) as $f)
+ {
+ if($f == 1) {
+ $fpif = $fields[$f]->getVar('field_name');
+ }
+ if($fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $fields[$f]->getVar('field_name');
+ }
+ }
+ $ret = <<<PRM
+\$permform = new XoopsGroupPermForm(\$formTitle, \$module_id, \$permName, \$permDesc, 'admin/permissions.php');
+if (\$permission == 1) {
+ foreach (\$globalPerms as \$perm_id => \$perm_name) {
+ \$permform->addItem(\$perm_id, \$perm_name);
+ }
+ echo \$permform->render();
+ echo '<br /><br />';
+} else {
+ \$criteria = new CriteriaCompo();
+ \$criteria->setSort('{$fpmf}');
+ \$criteria->setOrder('ASC');
+ \${$table_name}_count = \${$table_name}Handler->getCount(\$criteria);
+ \${$table_name}_arr = \${$table_name}Handler->getObjects(\$criteria);
+ unset(\$criteria);
+ foreach (array_keys(\${$table_name}_arr) as \$i) {
+ \$permform->addItem(\${$table_name}_arr[\$i]->getVar('{$fpif}'), \${$table_name}_arr[\$i]->getVar('{$fpmf}'));
+ }
+ // Check if {$table_name} exist before rendering the form and redirect, if there aren't {$table_name}
+ if (\${$table_name}_count > 0) {
+ echo \$permform->render();
+ echo '<br /><br />';
+ } else {
+ redirect_header ( '{$table_name}.php?op=new', 3, {$language}NOPERMSSET );
+ exit ();
+ }\n
+PRM;
+ return $ret;
+ }
+
+ /*
+ * @public function getFooterPermissionsCode
+ * @param null
+ */
+ public function getFooterPermissionsCode() {
+ $ret = <<<PRM
+}
+unset(\$permform);
+include_once 'footer.php';
+PRM;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ $filename = $this->getFileName();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $language = $this->getLanguage($module_name, 'AM');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getHeaderPermissionsCode($module_name, $language);
+ $content .= $this->getSwitchPermissionsCode($module_name, $language);
+ $content .= $this->getBodyPermissionsCode($module_name, $language);
+ $content .= $this->getFooterPermissionsCode();
+ //
+ $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_templates.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/admin_templates.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1,65 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: admin_templates.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+require_once TDMC_PATH . '/class/files/htmlsmartycodes.php';
+class AdminTemplates extends HtmlSmartyCodes
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param mixed $table
+ */
+ public function write($module) {
+ $this->setModule($module);
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function renderFile($filename) {
+ $module = $this->getModule();
+ //$filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $language = $this->getLanguage($module_name, 'AM');
+ $content = 'Under Construction';
+ $this->tdmcfile->create($module_name, 'templates/admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.html 2014-06-10 11:22:46 UTC (rev 12574)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-06-10 11:16:39 UTC (rev 12573)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -1,72 +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.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: 1.91 admin_about.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class AdminAbout extends TDMCreateFile
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param string $filename
- */
- public function write($module, $filename) {
- $this->setModule($module);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $filename = $this->getFileName();
- $module_name = strtolower($module->getVar('mod_name'));
- $module_donations = $module->getVar('mod_donations');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-include 'header.php';
-echo \$adminMenu->addNavigation('about.php');
-echo \$adminMenu->renderAbout('{$module_donations}', false);
-include 'footer.php';
-EOT;
- $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-06-10 11:16:39 UTC (rev 12573)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-06-10 11:22:46 UTC (rev 12574)
@@ -1,78 +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.5.0
- * @author Txmod Xoops http://www.txmodxoops.org
- * @version $Id: 1.91 admin_footer.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class AdminFooter extends TDMCreateFile
-{
- /*
- * @public function constructor
- * @param string $modules
- * @param string $filename
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param string $module
- * @param string $filename
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param string $filename
- */
- public function write($module, $filename) {
- $this->setModule($module);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $filename = $this->getFileName();
- $module_name = strtolower($module->getVar('mod_name'));
- $support_name = $module->getVar('mod_support_name');
- $support_url = $module->getVar('mod_support_url');
- $language = $this->getLanguage($module_name, 'AM');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-\necho "<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
- <img src='".\$sysPathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
-echo "<div class='center smallsmall italic pad5'>
- <strong>" . \$xoopsModule->getVar('name') . "</strong> ".{$language}MAINTAINEDBY."
- <a href='{$support_url}' title='Visit {$support_name}' class='tooltip' rel='external'>{$support_name}</a></div>";
-xoops_cp_footer();
-EOT;
- $this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-06-10 11:16:39 UTC (rev 12573)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-06-10 11:22:46 UTC...
[truncated message content] |