|
From: <txm...@us...> - 2014-06-10 12:15:02
|
Revision: 12575
http://sourceforge.net/p/xoops/svn/12575
Author: txmodxoops
Date: 2014-06-10 12:14:51 +0000 (Tue, 10 Jun 2014)
Log Message:
-----------
prefix removed from the file creation
Modified Paths:
--------------
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/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.html
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/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class/classes.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/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css/styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs/changelog.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs/docs.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/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/index.html
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/
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/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/mail.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/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/index.html
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/
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.html
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/
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.html
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
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/footer.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/footer.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/header.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/header.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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/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 12:14:51 UTC (rev 12575)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/objects.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/objects.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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 '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/permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/permissions.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/permissions.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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/templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/templates.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/templates.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -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/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -0,0 +1,184 @@
+<?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: blocks_pages.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class BlocksFiles 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
+ */
+ public function write($module, $table) {
+ $this->setModule($module);
+ $this->setTable($table);
+ }
+ /*
+ * @public function getBlocksShow
+ * @param null
+ */
+ public function getBlocksShow($module_name, $table_name, $table_fieldname, $table_category, $fields, $fpif, $fpmf) {
+ $mod_name_lowercase = strtolower($module_name);
+ $ret = <<<EOT
+include_once XOOPS_ROOT_PATH.'/modules/{$module_name}/include/functions.php';
+function b_{$mod_name_lowercase}_{$table_name}_show(\$options)
+{
+ include_once XOOPS_ROOT_PATH.'/modules/{$mod_name_lowercase}/class/{$table_name}.php';
+ \$myts =& MyTextSanitizer::getInstance();
+
+ \${$table_fieldname} = array();
+ \$type_block = \$options[0];
+ \$nb_{$table_name} = \$options[1];
+ \$lenght_title = \$options[2];
+
+ \${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
+ \$criteria = new CriteriaCompo();
+ array_shift(\$options);
+ array_shift(\$options);
+ array_shift(\$options);\n
+EOT;
+ if ( $table_category == 1 ) {
+ $ret .= <<<EOT
+ if (!(count(\$options) == 1 && \$options[0] == 0)) {
+ \$criteria->add(new Criteria('{$table_fieldname}_category', {$mod_name_lowercase}_block_addCatSelect(\$options), 'IN'));
+ }\n
+EOT;
+ }
+
+ $ret .= <<<EOT
+ if (\$type_block)
+ {
+ \$criteria->add(new Criteria('{$fpif}', 0, '!='));
+ \$criteria->setSort('{$fpif}');
+ \$criteria->setOrder('ASC');
+ }
+
+ \$criteria->setLimit(\$nb_{$table_name});
+ \${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
+ foreach (array_keys(\${$table_name}_arr) as \$i)
+ {\n
+EOT;
+ foreach(array_keys($fields) as $f)
+ {
+ if( $fields[$f]->getVar('field_block') == 1 ) {
+ $ret .= <<<EOT
+ \${$table_fieldname}['{$fpmf}'] = \${$table_name}_arr[\$i]->getVar('{$fpmf}');\n
+EOT;
+ }
+ }
+ $ret .= <<<EOT
+ }
+ return \${$table_fieldname};
+}\n\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getBlocksEdit
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $fpif
+ * @param string $fpmf
+ * @param string $language
+ */
+ public function getBlocksEdit($module_name, $table_name, $fpif, $fpmf, $language) {
+ $mod_name_lowercase = strtolower($module_name);
+ $ret = <<<EOT
+function b_{$mod_name_lowercase}_{$table_name}_edit(\$options)
+{
+ include_once XOOPS_ROOT_PATH.'/modules/{$module_name}/class/{$table_name}.php';
+ \${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
+ \$form = {$language}DISPLAY;
+ \$form .= "<input type='hidden' name='options[0]' value='".\$options[0]."' />";
+ \$form .= "<input name='options[1]' size='5' maxlength='255' value='".\$options[1]."' type='text' /> <br />";
+ \$form .= {$language}TITLELENGTH." : <input name='options[2]' size='5' maxlength='255' value='".\$options[2]."' type='text' /><br /><br />";
+ array_shift(\$options);
+ array_shift(\$options);
+ array_shift(\$options);
+ \$criteria = new CriteriaCompo();
+ \$criteria->add(new Criteria('{$fpif}', 0, '!='));
+ \$criteria->setSort('{$fpif}');
+ \$criteria->setOrder('ASC');
+ \${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
+ unset(\$criteria)
+ \$form .= {$language}CATTODISPLAY."<br /><select name='options[]' multiple='multiple' size='5'>";
+ \$form .= "<option value='0' " . (array_search(0, \$options) === false ? "" : "selected='selected'") . ">" .{$language}ALLCAT . "</option>";
+ foreach (array_keys(\${$table_name}_arr) as \$i) {
+ \${$fpif} = \${$table_name}_arr[\$i]->getVar('{$fpif}');
+ \$form .= "<option value='" . \${$fpif} . "' " . (array_search(\${$fpif}, \$options) === false ? "" : "selected='selected'") . ">".\${$table_name}_arr[\$i]->getVar('{$fpmf}')."</option>";
+ }
+ \$form .= "</select>";
+ return \$form;
+}
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function renderFile
+ * @param null
+ */
+ public function renderFile($filename)
+ {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $table_name = $table->getVar('table_name');
+ $table_fieldname = $table->getVar('table_fieldname');
+ $table_category = $table->getVar('table_category');
+ $language = $this->getLanguage($module_name, 'MB');
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
+ {
+ if($f == 0) {
+ $fpif = $fields[$f]->getVar('field_name');
+ }
+ if($fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $fields[$f]->getVar('field_name');
+ }
+ }
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getBlocksShow($module_name, $table_name, $table_fieldname, $table_category, $fields, $fpif, $fpmf);
+ $content .= $this->getBlocksEdit($module_name, $table_name, $fpif, $fpmf, $language);
+ //
+ $this->tdmcfile->create($module_name, 'blocks', $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/blocks/index.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/index.html (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/index.html 2014-06-10 12:14:51 UTC (rev 12575)
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/templates.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/templates.php 2014-06-10 12:14:51 UTC (rev 12575)
@@ -0,0 +1,98 @@
+<?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: blocks.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class BlocksTemplates extends HtmlSmartyCodes
+{
+ /*
+ * @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
+ */
+ public function write($module, $table) {
+ $this->setModule($module);
+ $this->setTable($table);
+ }
+ /*
+ * @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');
+ $table_fieldname = $table->getVar('table_fieldname');
+ $language = $this->getLanguage($module_name, 'MB');
+ $content = <<<EOT
+<table class="outer">
+ <tr class="head">\n
+EOT;
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
+ {
+ $lng_field_name = $language.strtoupper($fields[$f]->getVar('field_na...
[truncated message content] |