|
From: <txm...@us...> - 2014-11-30 21:30:16
|
Revision: 12880
http://sourceforge.net/p/xoops/svn/12880
Author: txmodxoops
Date: 2014-11-30 21:30:00 +0000 (Sun, 30 Nov 2014)
Log Message:
-----------
Added new classes file for autoload
fixed bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/ClassFormElements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/TemplatesAdminPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/common.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserFooter.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserHeader.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserIndex.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserNotificationUpdate.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserObjects.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserPages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserPrint.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserRss.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserSubmit.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/user/UserXoopsVersion.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/form/TDMCreateThemeForm.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/html/TDMCreateFormLabel.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php
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/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/classes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/classes/helper.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/docs.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/include/comment_functions.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/include/update.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/index.html
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/defines.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/language/help.php
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/mysql.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/tablefields.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/admin/permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/header.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/templates/user/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/xoopsversion.php
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreate.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -0,0 +1,173 @@
+<?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 trabis <lus...@gm...>
+ * @version $Id: tdmcreate.php 12258 2014-04-12 23:45:12Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreate
+{
+ /**
+ * @var string
+ */
+ private $dirname = null;
+ /**
+ * @var string
+ */
+ private $module = null;
+ /**
+ * @var string
+ */
+ private $handler = null;
+ /**
+ * @var string
+ */
+ private $config = null;
+ /**
+ * @var string
+ */
+ private $debug = null;
+ /**
+ * @var array
+ */
+ private $debugArray = array();
+ /*
+ * @protected function constructor class
+ * @param mixed $debug
+ */
+ protected function __construct($debug)
+ {
+ $this->debug = $debug;
+ $this->dirname = basename(dirname(dirname(__FILE__)));
+ }
+ /*
+ * @static function &getInstance
+ * @param mixed $debug
+ */
+ public static function &getInstance($debug = false)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($debug);
+ }
+ return $instance;
+ }
+ /*
+ * @static function getModule
+ * @param null
+ */
+ public function &getModule()
+ {
+ if ($this->module == null) {
+ $this->initModule();
+ }
+ return $this->module;
+ }
+ /*
+ * @static function getConfig
+ * @param string $name
+ */
+ public function getConfig($name = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ if (!$name) {
+ $this->addLog("Getting all config");
+ return $this->config;
+ }
+ if (!isset($this->config[$name])) {
+ $this->addLog("ERROR :: CONFIG '{$name}' does not exist");
+ return null;
+ }
+ $this->addLog("Getting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function setConfig
+ * @param string $name
+ * @param mixed $value
+ */
+ public function setConfig($name = null, $value = null)
+ {
+ if ($this->config == null) {
+ $this->initConfig();
+ }
+ $this->config[$name] = $value;
+ $this->addLog("Setting config '{$name}' : " . $this->config[$name]);
+ return $this->config[$name];
+ }
+ /*
+ * @static function getHandler
+ * @param string $name
+ */
+ public function &getHandler($name)
+ {
+ if (!isset($this->handler[$name . '_handler'])) {
+ $this->initHandler($name);
+ }
+ $this->addLog("Getting handler '{$name}'");
+ return $this->handler[$name . '_handler'];
+ }
+ /*
+ * @static function initModule
+ * @param null
+ */
+ public function initModule()
+ {
+ global $xoopsModule;
+ if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) {
+ $this->module = $xoopsModule;
+ } else {
+ $hModule = xoops_gethandler('module');
+ $this->module = $hModule->getByDirname($this->dirname);
+ }
+ $this->addLog('INIT MODULE');
+ }
+ /*
+ * @static function initConfig
+ * @param null
+ */
+ public function initConfig()
+ {
+ $this->addLog('INIT CONFIG');
+ $hModConfig = xoops_gethandler('config');
+ $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid'));
+ }
+ /*
+ * @static function initHandler
+ * @param string $name
+ */
+ public function initHandler($name)
+ {
+ $this->addLog('INIT ' . $name . ' HANDLER');
+ $this->handler[$name . '_handler'] = xoops_getModuleHandler($name, $this->dirname);
+ }
+ /*
+ * @static function addLog
+ * @param string $log
+ */
+ public function addLog($log)
+ {
+ if ($this->debug) {
+ if (is_object($GLOBALS['xoopsLogger'])) {
+ $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log);
+ }
+ }
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/TDMCreateSession.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -0,0 +1,107 @@
+<?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 class
+ *
+ * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/
+ * @license http://www.fsf.org/copyleft/gpl.html GNU public license
+ * @package TDMCreate
+ * @since 1.0
+ * @author trabis <lus...@gm...>
+ * @author Harry Fuecks (PHP Anthology Volume II)
+ * @version $Id: 1.91 session.php 12453 2014-03-28 18:34:46Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreateSession
+{
+ /**
+ * Session constructor<br />
+ * Starts the session with session_start()
+ * <strong>Note:</strong> that if the session has already started,
+ * session_start() does nothing
+ */
+ protected function __construct()
+ {
+ if(!isset($_SESSION)) {
+ session_start();
+ }
+ }
+
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $_sess = false;
+ if (!isset($_sess)) {
+ $_sess = new self();
+ }
+ return $_sess;
+ }
+
+ /**
+ * Sets a session variable
+ *
+ * @param string $name name of variable
+ * @param mixed $value value of variable
+ *
+ * @return void
+ * @access public
+ */
+ public function setSession($name, $value)
+ {
+ $_SESSION[$name] = $value;
+ }
+
+ /**
+ * Fetches a session variable
+ *
+ * @param string $name name of variable
+ *
+ * @return mixed value of session variable
+ * @access public
+ */
+ public function getSession($name)
+ {
+ if (isset($_SESSION[$name])) {
+ return $_SESSION[$name];
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Deletes a session variable
+ *
+ * @param string $name name of variable
+ *
+ * @return void
+ * @access public
+ */
+ public function deleteSession($name)
+ {
+ unset($_SESSION[$name]);
+ }
+
+ /**
+ * Destroys the whole session
+ *
+ * @return void
+ * @access public
+ */
+ public function destroySession()
+ {
+ $_SESSION = array();
+ session_destroy();
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/fields.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -19,8 +19,8 @@
* @version $Id: 1.91 fields.php 12258 2014-01-02 09:33:29Z timgno $
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-require_once 'html/simplelabel.php';
-require_once 'form/themeform.php';
+require_once 'html/TDMCreateFormLabel.php';
+require_once 'form/TDMCreateThemeForm.php';
/*
* @Class TDMCreateFields
* @extends XoopsObject
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/abstract.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,137 +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: abstract.php 12258 2014-01-02 09:33:29Z timgno $
- */
-
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-/**
- * Abstract base class
- */
-abstract class TDMCreateAbstract
-{
- /**
- * "module" attribute fot files
- *
- * @var mixed
- */
- protected $module = null;
-
- /**
- * "table" attribute fot files
- *
- * @var mixed
- */
- protected $table = null;
-
- /**
- * "tables" attribute fot files
- *
- * @var mixed
- */
- protected $tables = null;
-
- /**
- * "fields" attribute fot files
- *
- * @var mixed
- */
- protected $fields = null;
-
- /**
- * public function setFileName
- * @param mixed $module
- */
- public function setModule($module) {
- if (is_object($module) && ($module instanceof TDMCreateModules)) {
- $this->module = $module;
- }
- }
-
- /*
- * @public function getModule
- * @param null
- */
- public function getModule() {
- return $this->module;
- }
-
- /**
- * public function setTable
- * @param mixed $table
- */
- public function setTable($table) {
- if (is_object($table) && ($table instanceof TDMCreateTables)) {
- $this->table = $table;
- }
- }
-
- /*
- * @public function getTable
- * @param null
- */
- public function getTable() {
- return $this->table;
- }
-
- /**
- * public function setTables
- * @param mixed $tables
- */
- public function setTables($tables) {
- if (is_array($tables)) {
- $this->tables = $tables;
- }
- }
-
- /*
- * @public function getTables
- * @param null
- */
- public function getTables() {
- return $this->tables;
- }
-
- /**
- * @public function setFields
- * @param mixed $fields
- */
- public function setFields($fields) {
- if (is_object($fields) && ($fields instanceof TDMCreateFields)) {
- $this->fields = $fields;
- }
- }
-
- /*
- * @public function getFields
- * @param null
- */
- public function getFields() {
- return $this->fields;
- }
-
- /**
- * Generates output for files.
- *
- * This method is abstract and must be overwritten by the child classes.
- *
- * @abstract
- */
- public function render() {}
-}
\ 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-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/about.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,73 +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();
- $moduleDirname = $module->getVar('mod_dirname');
- $moduleDonations = $module->getVar('mod_donations');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-include 'header.php';
-\$template_main = '{$moduleDirname}_admin_about.tpl';
-\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('about.php'));
-\$GLOBALS['xoopsTpl']->assign('about', \$adminMenu->renderAbout('{$moduleDonations}', false));
-include 'footer.php';
-EOT;
- $this->tdmcfile->create($moduleDirname, '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-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/footer.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,73 +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 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();
- $moduleDirname = $module->getVar('mod_dirname');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-if ( isset(\$template_main) ) {
- \$GLOBALS['xoopsTpl']->display("db:{\$template_main}");
-}
-xoops_cp_footer();
-?>
-EOT;
- $this->tdmcfile->create($moduleDirname, '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-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/header.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,126 +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: 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 array $tables
- * @param string $filename
- */
- public function write($module, $table, $tables, $filename) {
- $this->setModule($module);
- $this->setTable($table);
- $this->setTables($tables);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
- $ucfModuleDirname = ucfirst($moduleDirname);
- $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';
-\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16');
-\$sysPathIcon32 = '../' . \$xoopsModule->getInfo('sysicons32');
-\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-//
-\$modPathIcon16 = \$xoopsModule->getInfo('modicons16');
-\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');\n
-EOT;
- if (is_object($table)) {
- if ( $table->getVar('table_name') != '' ) {
- $content .= <<<EOT
-// Get instance of module
-\${$moduleDirname} = {$ucfModuleDirname}Helper::getInstance();\n
-EOT;
- }
- foreach (array_keys($tables) as $t)
- {
- $tableName = $tables[$t]->getVar('table_name');
- $content .= <<<EOT
-// {$tableName}
-\${$tableName}Handler =& \${$moduleDirname}->getHandler('{$tableName}');\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');
-xoops_loadLanguage('modinfo');
-// 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($moduleDirname, '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/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/index.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,114 +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: 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 $tables
- * @param string $filename
- */
- public function write($module, $tables, $filename) {
- $this->setModule($module);
- $this->setTables($tables);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
- $language = $this->getLanguage($moduleDirname, 'AM');
- $language_thereare = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-include_once 'header.php';
-// Count elements\n
-EOT;
- $tableName = null;
- if(is_array($tables)) {
- foreach (array_keys($tables) as $i)
- {
- $tableName = $tables[$i]->getVar('table_name');
- $content .= <<<EOT
-\$count_{$tableName} = \${$tableName}Handler->getCount();\n
-EOT;
- }
- }
- $content .= <<<EOT
-// Template Index
-\$template_main = '{$moduleDirname}_admin_index.tpl';\n
-EOT;
- if(is_array($tables)) {
- $content .= <<<EOT
-// InfoBox Statistics
-\$adminMenu->addInfoBox({$language}STATISTICS);
-// Info elements\n
-EOT;
- foreach (array_keys($tables) as $i)
- {
- $tableName = $tables[$i]->getVar('table_name');
- $stuTableName = $language_thereare.strtoupper($tableName);
- $content .= <<<EOT
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count_{$tableName});\n
-EOT;
- }
- }
- if($tableName == null) {
- $content .= <<<EOT
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>No statistics</label>', 0);\n
-EOT;
- }
- $content .= <<<EOT
-// Render Index
-echo \$adminMenu->addNavigation('index.php');
-echo \$adminMenu->renderIndex();
-include_once 'footer.php';
-EOT;
- $this->tdmcfile->create($moduleDirname, '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/menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/menu.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,165 +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: 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() {
- 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 object $table
- * @param array $tables
- * @param string $filename
- */
- public function write($module, $table, $tables, $filename) {
- $this->setModule($module);
- $this->setTable($table);
- $this->setTables($tables);
- $this->setFileName($filename);
- }
- /*
- * @private function getAdminMenuHeader
- * @param null
- */
- private function getAdminMenuHeader() {
- $ret = <<<EOT
-\$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');\n
-EOT;
- return $ret;
- }
- /*
- * @private function getAdminMenuDashboard
- * @param string $language
- * @param integer $menu
- */
- private function getAdminMenuDashboard($language, $menu) {
- $ret = <<<EOT
-\$i = 1;
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/index.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/dashboard.png';
-\$i++;\n
-EOT;
- return $ret;
- }
- /*
- * @private function getAdminMenuImagesPath
- * @param array $tables
- * @param integer $t
- */
- private function getAdminMenuImagesPath($tables, $t) {
- $fields = $this->getTableFields($tables[$t]->getVar('table_id'));
- foreach (array_keys($fields) as $f)
- {
- $fieldElement = $fields[$f]->getVar('field_element');
- switch( $fieldElement ) {
- case 11:
- $ret = <<<EOT
-\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
-EOT;
- break;
- default:
- $ret = <<<EOT
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n
-EOT;
- break;
- }
- }
- return $ret;
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $moduleDirname = $module->getVar('mod_dirname');
- $language = $this->getLanguage($moduleDirname, 'MI', 'ADMENU');
- $menu = 1;
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getAdminMenuHeader();
- $content .= $this->getAdminMenuDashboard($language, $menu);
- foreach (array_keys($tables) as $t)
- {
- $tablePermissions = $tables[$t]->getVar('table_permissions');
- if ( $tables[$t]->getVar('table_admin') == 1 )
- {
- $menu++;
- $content .= <<<EOT
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
-EOT;
- //$content .= $this->getAdminMenuImagesPath($tables, $t);
- $content .= <<<EOT
-\$i++;\n
-EOT;
- }
- }
- if (is_object($table) && $table->getVar('table_permissions') == 1) {
- $menu++;
- $content .= <<<EOT
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/permissions.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/permissions.png';
-\$i++;\n
-EOT;
- }
- $menu++;
- $content .= <<<EOT
-\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/about.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/about.png';
-unset( \$i );
-EOT;
- unset( $menu );
-
- $this->tdmcfile->create($moduleDirname, '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/objects.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/objects.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,246 +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: 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 $tableName
- * @param string $fieldName
- */
- public function getSimpleSetVar($tableName, $fieldName) {
- $ret = <<<EOT
- // Set Var {$fieldName}
- \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);\n
-EOT;
- return $ret;
- }
- /*
- * @public function getTextDateSelectSetVar
- * @param string $tableName
- * @param string $fieldName
- */
- public function getTextDateSelectSetVar($tableName, $fieldName) {
- $ret = <<<EOT
- // Set Var {$fieldName}
- \${$tableName}Obj->setVar('{$fieldName}', strtotime(\$_POST['{$fieldName}']));\n
-EOT;
- return $ret;
- }
- /*
- * @public function getCheckBoxOrRadioYNSetVar
- * @param string $tableName
- * @param string $fieldName
- */
- public function getCheckBoxOrRadioYNSetVar($tableName, $fieldName) {
- $ret = <<<EOT
- // Set Var {$fieldName}
- \${$tableName}Obj->setVar('{$fieldName}', ((\$_REQUEST['{$fieldName}'] == 1) ? '1' : '0'));\n
-EOT;
- return $ret;
- }
- /*
- * @public function getImageListSetVar
- * @param string $moduleDirname
- * @param string $tableName
- * @param string $fieldName
- */
- public function getImageListSetVar($moduleDirname, $tableName, $fieldName) {
- $ret = <<<EOT
- // Set Var {$fieldName}
- include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- \$uploaddir = XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32';
- \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
- \${$moduleDirname}->getConfig('maxsize'), null, null);
- if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
- //\$uploader->setPrefix('{$fieldName}_');
- //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
- if (!\$uploader->upload()) {
- \$errors = \$uploader->getErrors();
- redirect_header('javascript:history.go(-1)', 3, \$errors);
- } else {
- \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName());
- }
- } else {
- \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);
- }\n
-EOT;
- return $ret;
- }
- /*
- * @public function getUploadImageSetVar
- * @param string $moduleDirname
- * @param string $tableName
- * @param string $fieldName
- */
- public function getUploadImageSetVar($moduleDirname, $tableName, $fieldName) {
- $stuModuleDirname = strtoupper($moduleDirname);
- $ret = <<<EOT
- // Set Var {$fieldName}
- include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/images/{$tableName}';
- \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
- \${$moduleDirname}->getConfig('maxsize'), null, null);
- if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
- //\$uploader->setPrefix('{$fieldName}_');
- //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
- if (!\$uploader->upload()) {
- \$errors = \$uploader->getErrors();
- redirect_header('javascript:history.go(-1)', 3, \$errors);
- } else {
- \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName());
- }
- } else {
- \${$tableName}Obj->setVar('{$fieldName}', \$_POST['{$fieldName}']);
- }\n
-EOT;
- return $ret;
- }
- /*
- * @public function getUploadFileSetVar
- * @param string $moduleDirname
- * @param string $tableName
- * @param string $fieldName
- */
- public function getUploadFileSetVar($moduleDirname, $tableName, $fieldName) {
- $stuModuleDirname = strtoupper($moduleDirname);
- $ret = <<<EOT
- // Set Var {$fieldName}
- include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- \$uploaddir = {$stuModuleDirname}_UPLOAD_PATH.'/files/{$tableName}';
- \$uploader = new XoopsMediaUploader(\$uploaddir, \${$moduleDirname}->getConfig('mimetypes'),
- \${$moduleDirname}->getConfig('maxsize'), null, null);
- if (\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0])) {
- //\$uploader->setPrefix('{$fieldName}_') ;
- //\$uploader->fetchMedia(\$_POST['xoops_upload_file'][0]);
- if (!\$uploader->upload()) {
- \$errors = \$uploader->getErrors();
- redirect_header('javascript:history.go(-1)', 3, \$errors);
- } else {
- \${$tableName}Obj->setVar('{$fieldName}', \$uploader->getSavedFileName());
- }
- }\n
-EOT;
- return $ret;
- }
- /*
- * @public function getSimpleGetVar
- * @param string $lpFieldName
- * @param string $rpFieldName
- * @param string $tableName
- * @param string $fieldName
- */
- public function getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
- $ret = <<<EOT
-\t\t\t\t// Get Var {$fieldName}
-\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$tableName}_arr[\$i]->getVar('{$fieldName}');\n
-EOT;
- return $ret;
- }
- /*
- * @public function getTopicGetVar
- * @param string $lpFieldName
- * @param string $rpFieldName
- * @param string $tableName
- * @param string $tableNameTopic
- * @param string $fieldNameParent
- * @param string $fieldNameTopic
- */
- public function getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $tableNameTopic, $fieldNameParent, $fieldNameTopic) {
- $ret = <<<EOT
-\t\t\t\t// Get Var {$fieldNameParent}
-\t\t\t\t\${$rpFieldName} =& \${$tableNameTopic}Handler->get(\${$tableName}_arr[\$i]->getVar('{$fieldNameParent}'));
-\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \${$rpFieldName}->getVar('{$fieldNameTopic}');\n
-EOT;
- return $ret;
- }
- /*
- * @public function getUploadImageGetVar
- * @param string $lpFieldName
- * @param string $rpFieldName
- * @param string $tableName
- * @param string $fieldName
- */
- public function getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
- $ret = <<<EOT
-\t\t\t\t// Get Var {$fieldName}
-\t\t\t\t\${$fieldName} = \${$tableName}_arr[\$i]->getVar('{$fieldName}');
-\t\t\t\t\$upload_image = \${$fieldName} ? \${$fieldName} : 'blank.gif';
-\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = \$upload_image;\n
-EOT;
- return $ret;
- }
- /*
- * @public function getTextAreaGetVar
- * @param string $lpFieldName
- * @param string $rpFieldName
- * @param string $tableName
- * @param string $fieldName
- */
- public function getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
- $ret = <<<EOT
-\t\t\t\t// Get Var {$fieldName}
-\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = strip_tags(\${$tableName}_arr[\$i]->getVar('{$fieldName}'));\n
-EOT;
- return $ret;
- }
- /*
- * @public function getSelectUserGetVar
- * @param string $lpFieldName
- * @param string $rpFieldName
- * @param string $tableName
- * @param string $fieldName
- */
- public function getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
- $ret = <<<EOT
-\t\t\t\t// Get Var {$fieldName}
-\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = XoopsUser::getUnameFromId(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n
-EOT;
- return $ret;
- }
- /*
- * @public function getTextDateSelectGetVar
- * @param string $lpFieldName
- * @param string $rpFieldName
- * @param string $tableName
- * @param string $fieldName
- */
- public function getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName) {
- $ret = <<<EOT
-\t\t\t\t// Get Var {$fieldName}
-\t\t\t\t\${$lpFieldName}['{$rpFieldName}'] = formatTimeStamp(\${$tableName}_arr[\$i]->getVar('{$fieldName}'), 's');\n
-EOT;
- return $ret;
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-11-27 22:11:13 UTC (rev 12879)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/tdmcreate/class/files/admin/pages.php 2014-11-30 21:30:00 UTC (rev 12880)
@@ -1,380 +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: 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 $moduleDirname
- * @param string $tableName
- */
- public function getAdminPagesHeader($moduleDirname, $table, $fpif) {
-
- $ret = <<<EOT
-include_once 'header.php';
-//It recovered the value of argument op in URL$
-\$op = XoopsRequest::getString('op', 'list');
-// Request {$fpif}
-\${$fpif} = XoopsRequest::getInt('{$fpif}');
-// Switch options
-switch (\$op)
-{\n
-EOT;
- return $ret;
- }
-
- /*
- * @public function getAdminPagesList
- * @param string $moduleDirname
- * @param string $table
- * @param string $tableFieldname
- * @param string $language
- * @param string $fields
- * @param string $fpif
- * @param string $fpmf
- */
- public function getAdminPagesList($moduleDirname, $table, $tableFieldname, $language, $fields, $fpif, $fpmf) {
- $stuModuleDirname = strtoupper($moduleDirname);
- $tableName = $table->getVar('table_name');
- $tableAutoincrement = $table->getVar('table_autoincrement');
- $stuTableName = strtoupper($tableName);
- $stuTableFieldname = strtoupper($tableFieldname);
- $ret = <<<EOT
- case 'list':
- default:
- \$start = XoopsRequest::getInt('start', 0);
- \$limit = XoopsRequest::getInt('limit', \${$moduleDirname}->getConfig('adminpager'));
- \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
- \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
- \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add');
- \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
- \$criteria = new CriteriaCompo();
- \$criteria->setSort('{$fpif} ASC, {$fpmf}');
- \$criteria->setOrder('ASC');
- \${$tableName}_rows = \${$tableName}Handler->getCount(\$criteria);
- \${$tableName}_arr = \${$tableName}Handler->getAll(\$criteria);
- unset(\$criteria);
- \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_url', {$stuModuleDirname}_URL);
- \$GLOBALS['xoopsTpl']->assign('{$moduleDirname}_upload_url', {$stuModuleDirname}_UPLOAD_URL);
- // Table view
- if (\${$tableName}_rows > 0)
- {
- foreach (array_keys(\${$tableName}_arr) as \$i)
- {\n
-EOT;
- foreach(array_keys($fields) as $f)
- {
- $fieldName = $fields[$f]->getVar('field_name');
- $fieldParent = $fields[$f]->getVar('field_parent');
- // Verify if table_fieldname is not empty
- $lpFieldName = !empty($tableFieldname) ? substr($fieldName, 0, strpos($fieldName, '_')) : $tableName;
- $rpFieldName = $this->tdmcfile->getRightString($fieldName);
- //
- $fieldElement = $fields[$f]->getVar('field_element');
- if( ($fields[$f]->getVar('field_admin') == 1) || ($tableAutoincrement == 1) ) {
- switch($fieldElement) {
- case 3:
- case 4:
- $ret .= $this->adminobjects->getTextAreaGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
- break;
- case 8:
- $ret .= $this->adminobjects->getSelectUserGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
- break;
- case 11:
- $ret .= $this->adminobjects->getUploadImageGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
- break;
- case 13:
- $ret .= $this->adminobjects->getTextDateSelectGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
- break;
- default:
- if( ($fieldParent == 1) && !$table->getVar('table_category') ) {
- if($fieldElement > 13) {
- $fieldElements = $this->tdmcreate->getHandler('fieldelements')->get($fieldElement);
- $fieldElementTid = $fieldElements->getVar('fieldelement_tid');
- $fieldElementName = $fieldElements->getVar('fieldelement_name');
- $rpFieldElementName = strtolower(str_replace('Table : ', '', $fieldElementName));
- }
- //
- $fieldNameParent = $fieldName;
- //
- $criteriaFieldsTopic = new CriteriaCompo();
- $criteriaFieldsTopic->add(new Criteria('field_tid', $fieldElementTid));
- $fieldsTopic = $this->tdmcreate->getHandler('fields')->getObjects($criteriaFieldsTopic);
- unset($criteriaFieldsTopic);
- foreach(array_keys($fieldsTopic) as $ft)
- {
- if( $fieldsTopic[$ft]->getVar('field_main') == 1 ) {
- $fieldNameTopic = $fieldsTopic[$ft]->getVar('field_name');
- }
- }
- $ret .= $this->adminobjects->getTopicGetVar($lpFieldName, $rpFieldName, $tableName, $rpFieldElementName, $fieldNameParent, $fieldNameTopic);
- } else {
- $ret .= $this->adminobjects->getSimpleGetVar($lpFieldName, $rpFieldName, $tableName, $fieldName);
- }
- break;
- }
- }
- }
- $ret .= <<<EOT
- \$GLOBALS['xoopsTpl']->append('{$tableName}_list', \${$lpFieldName});
- unset(\${$lpFieldName});
- }\n
-EOT;
- $ret .= <<<EOT
- if ( \${$tableName}_rows > \$limit ) {
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- \$pagenav = new XoopsPageNav(\${$tableName}_rows, \$limit, \$start, 'start', 'op=list&limit=' . \$limit);
- \$GLOBALS['xoopsTpl']->assign('pagenav', \$pagenav->renderNav(4));
- }
- } else {
- \$GLOBALS['xoopsTpl']->assign('error', {$language}THEREARENT_{$stuTableName});
- }
- break;\n
-EOT;
- return $ret;
- }
-
- /*
- * @public function getAdminPagesNew
- * @param string $moduleDirname
- * @param string $tableName
- * @param string $language
- */
- public function getAdminPagesNew($moduleDirname, $tableName, $language) {
- $stuTableName = strtoupper($tableName);
- $ret = <<<EOT
- case 'new':
- \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
- \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list');
- \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
- \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
- // Get Form
- \${$tableName}Obj =& \${$tableName}Handler->create();
- \$form = \${$tableName}Obj->getForm();
- \$GLOBALS['xoopsTpl']->assign('form', \$form->render());
- break;\n
-EOT;
- return $ret;
- }
-
- /*
- * @public function getAdminPagesSave
- * @param string $moduleDirname
- * @param string $tableName
- * @param string $language
- * @param string $fields
- * @param string $fpif
- * @param string $fpmf
- */
- public function getAdminPagesSave($moduleDirname, $tableName, $language, $fields, $fpif, $fpmf)
- {
- $ret = <<<EOT
- case 'save':
- if ( !\$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('{$tableName}.php', 3, implode(',', \$GLOBALS['xoopsSecurity']->getErrors()));
- }
- if (isset(\${$fpif})) {
- \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif});
- } else {
- \${$tableName}Obj =& \${$tableName}Handler->create();
- }
- // Set Vars\n
-EOT;
- foreach (array_keys($fields) as $f)
- {
- $fieldName = $fields[$f]->getVar('field_name');
- $fieldElement = $fields[$f]->getVar('field_element');
- if($f > 0) { // If we want to hide field id
- switch($fieldElement) {
- case 5:
- case 6:
- $ret .= $this->adminobjects->getCheckBoxOrRadioYNSetVar($tableName, $fieldName);
- break;
- case 10:
- $ret .= $this->adminobjects->getImageListSetVar($moduleDirname, $tableName, $fieldName);
- break;
- case 11:
- $ret .= $this->adminobjects->getUploadImageSetVar($moduleDirname, $tableName, $fieldName);
- break;
- case 12:
- $ret .= $this->adminobjects->getUploadFileSetVar($moduleDirname, $tableName, $fieldName);
- break;
- case 13:
- $ret .= $this->adminobjects->getTextDateSelectSetVar($tableName, $fieldName);
- break;
- default:
- $ret .= $this->adminobjects->getSimpleSetVar($tableName, $fieldName);
- break;
- }
- }
- }
-
- $ret .= <<<EOT
- // Insert Data
- if (\${$tableName}Handler->insert(\${$tableName}Obj)) {
- redirect_header('{$tableName}.php?op=list', 2, {$language}FORMOK);
- }
- // Get Form
- \$GLOBALS['xoopsTpl']->assign('error', \${$tableName}Obj->getHtmlErrors());
- \$form =& \${$tableName}Obj->getForm();
- \$GLOBALS['xoopsTpl']->assign('form', \$form->render());
- break;\n
-EOT;
- return $ret;
- }
-
- /*
- * @public function getAdminPagesEdit
- * @param string $moduleDirname
- * @param string $tableName
- * @param string $tableFieldname
- * @param string $language
- * @param string $fpif
- */
- public function getAdminPagesEdit($moduleDirname, $tableName, $tableFieldname, $language, $fpif) {
- $stuTableName = strtoupper($tableName);
- $stuTableFieldname = strtoupper($tableFieldname);
- $ret = <<<EOT
- case 'edit':
- \$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
- \$adminMenu->addItemButton({$language}ADD_{$stuTableFieldname}, '{$tableName}.php?op=new', 'add');
- \$adminMenu->addItemButton({$language}{$stuTableName}_LIST, '{$tableName}.php', 'list');
- \$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
- \$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
- // Get Form
- \${$tableName}Obj = \${$tableName}Handler->get(\${$fpif});
- \$form = \${$tableName}Obj->getForm();
- \$GLOBALS['xoopsTpl']->assign('form', \$form->render());
- break;\n
-EOT;
- return $ret;
- }
-
- /*
- * @public function getAdminPagesDelete
- * @param string $tableName
- * @param string $language
- */
- public function getAdminPagesDelete($tableName, $language, $fpif, $fpmf) {
-
- $ret = <<<EOT
- case 'delete':
- \${$tableName}Obj =& \${$tableName}Handler->get(\${$fpif});
- if (isset(\$_REQUEST['ok']) && \$_REQUEST['ok'] == 1) {
- if ( !\$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('{$tableName}.php', 3, implode(', ', \$GLOBALS['xoopsSecurity']->getErrors()));
- }
- if (\${$tableName}Handler->delete(\${$tableName}Obj)) {
- redirect...
[truncated message content] |