|
From: <txm...@us...> - 2014-03-02 01:52:33
|
Revision: 12337
http://sourceforge.net/p/xoops/svn/12337
Author: txmodxoops
Date: 2014-03-02 01:52:29 +0000 (Sun, 02 Mar 2014)
Log Message:
-----------
Updated
Added separated class HtmlSmartyCodes file for admin & user templates
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/headerfiles.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_pages.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
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-03-02 01:52:29 UTC (rev 12337)
@@ -0,0 +1,48 @@
+<?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 $
+ */
+if (!defined('XOOPS_ROOT_PATH')) {
+ die('XOOPS root path not defined');
+}
+
+class AdminTemplates extends HtmlSmartyCodes
+{
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param mixed $table
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $file_name = null) {
+ $this->module = $module;
+ $this->table = $table;
+ $this->file_name = $file_name;
+ $this->language = $this->geLanguage('_AM_', '_');
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ /*$ret = $this->getUploadImage();
+ $ret = $this->getUploadFile();
+ return $ret;*/
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/headerfiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/headerfiles.php 2014-02-28 21:29:57 UTC (rev 12336)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/headerfiles.php 2014-03-02 01:52:29 UTC (rev 12337)
@@ -29,30 +29,30 @@
/**
* "path" attribute of the files
*
- * @var string
+ * @var mixed
*/
- private $path = '';
+ private $path = XOOPS_ROOT_PATH.'/modules/TDMCreate';
/**
* "module" attribute of the files
*
- * @var string
+ * @var mixed
*/
- private $_module = '';
+ private $module = null;
/**
* "folder" attribute of the files
*
- * @var string
+ * @var mixed
*/
- private $folder = '';
+ private $folder = null;
/**
* "file_name" attribute of the files
*
- * @var string
+ * @var mixed
*/
- private $file_name = '';
+ private $file_name = null;
/**
* Generates output for the files.
@@ -66,14 +66,16 @@
/*
* @public function getHeader
* @param string $path
+ * @param string $module
* @param string $folder
* @param string $file_name
*/
- public function getHeader($path, $folder, $file_name) {
+ public function getHeader($path, $module, $folder, $file_name) {
$this->path = $path;
$this->folder = $folder;
+ $this->module = $module;
$this->file_name = $file_name;
- $ret = $this->path . DIRECTORY_SEPARATOR . $this->_module . DIRECTORY_SEPARATOR . $this->folder . DIRECTORY_SEPARATOR . $this->file_name;
+ $ret = $this->path . DIRECTORY_SEPARATOR . $this->module . DIRECTORY_SEPARATOR . $this->folder . DIRECTORY_SEPARATOR . $this->file_name;
return $ret;
}
@@ -83,19 +85,19 @@
* @param string $file_name
*/
public function getHeaderComment($module, $file_name) {
- $this->_module = $module;
+ $this->module = $module;
$this->file_name = $file_name;
- $mod_name = $this->_module->getVar('mod_name');
- $mod_version = $this->_module->getVar('mod_version');
- $mod_since = $this->_module->getVar('mod_since');
- //$mod_min_xoops = $this->_module->getVar('mod_min_xoops');
- $mod_author = $this->_module->getVar('mod_author');
- $mod_credits = $this->_module->getVar('mod_credits');
- $mod_a_m = $this->_module->getVar('mod_author_mail');
- $mod_a_w_url = $this->_module->getVar('mod_author_website_url');
- $mod_license = $this->_module->getVar('mod_license');
- $mod_subversion = $this->_module->getVar('mod_subversion');
+ $mod_name = $this->module->getVar('mod_name');
+ $mod_version = $this->module->getVar('mod_version');
+ $mod_since = $this->module->getVar('mod_since');
+ $mod_min_xoops = $this->module->getVar('mod_min_xoops');
+ $mod_author = $this->module->getVar('mod_author');
+ $mod_credits = $this->module->getVar('mod_credits');
+ $mod_a_m = $this->module->getVar('mod_author_mail');
+ $mod_a_w_url = $this->module->getVar('mod_author_website_url');
+ $mod_license = $this->module->getVar('mod_license');
+ $mod_subversion = $this->module->getVar('mod_subversion');
$date = date('D Y/m/d G:i:s');
$package = strtolower($mod_name);
@@ -116,8 +118,9 @@
* @license {$mod_license}
* @package {$package}
* @since {$mod_since}
+ * @min_xoops {$mod_min_xoops}
* @author {$mod_author} <{$mod_a_m}> - <{$mod_a_w_url}>
- * @version \$Id: {$mod_version} {$filename} {$mod_subversion} {$date}Z {$mod_credits} \$
+ * @version \$Id: {$mod_version} {$file_name} {$mod_subversion} {$date}Z {$mod_credits} \$
*/
EOT;
return $ret;
@@ -128,7 +131,7 @@
* @param null
*/
public function getModuleName() {
- $ret = strtolower($this->_module->getVar('mod_name'));
+ $ret = strtolower($this->module->getVar('mod_name'));
return $ret;
}
@@ -139,9 +142,9 @@
*/
public function getLanguage($prefix = '', $extra = '') {
if(!empty($extra))
- $ret = $prefix . strtoupper($this->_module->getVar('mod_name')) . $extra;
+ $ret = $prefix . strtoupper($this->module->getVar('mod_name')) . $extra;
else
- $ret = $prefix . strtoupper($this->_module->getVar('mod_name'));
+ $ret = $prefix . strtoupper($this->module->getVar('mod_name'));
return $ret;
}
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/htmlsmartycodes.php 2014-03-02 01:52:29 UTC (rev 12337)
@@ -0,0 +1,227 @@
+<?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: htmlsmartycodes.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) {
+ die('XOOPS root path not defined');
+}
+
+class HtmlSmartyCodes extends HeaderFile
+{
+ /*
+ * @var mixed
+ */
+ public $table = null;
+ /*
+ * @var string
+ */
+ public $language = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param mixed $table
+ * @param string $file_name
+ */
+ public function __construct($module, $table) {
+ $this->module = $module;
+ $this->table = $table;
+ $this->language = $this->geLanguage('_AM_', '_');
+ }
+ /*
+ * @public function getHtmlDiv
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlDiv($class = '', $content = '') {
+ $ret = <<<EOT
+ <div class='{$class}'>
+ {$content}
+ </div>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlSpan
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlSpan($class = '', $content = '') {
+ $ret = <<<EOT
+ <span class='{$class}'>
+ {$content}
+ </span>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTable
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTable($class = '', $content = '') {
+ $ret = <<<EOT
+ <table class='{$class}'>
+ {$content}
+ </table>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTable
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableThead($class = '', $content = '') {
+ $ret = <<<EOT
+ <thead class='{$class}'>
+ {$content}
+ </thead>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTable
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableTbody($class = '', $content = '') {
+ $ret = <<<EOT
+ <tbody class='{$class}'>
+ {$content}
+ </tbody>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableTfoot
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableTfoot($class = '', $content = '') {
+ $ret = <<<EOT
+ <tfoot class='{$class}'>
+ {$content}
+ </tfoot>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableHead
+ * @param string $class
+ * @param mixed $field_name
+ */
+ public function getHtmlTableHead($class = '', $field_name) {
+ $field_name = strtoupper($field_name);
+ $ret = <<<EOT
+ <th class='{$class}'><{{$this->language}{$field_name}}></th>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableRow
+ * @param string $class
+ * @param string $content
+ */
+ public function getHtmlTableRow($class = '', $content = '') {
+ $ret = <<<EOT
+ <tr class='{$class}'>
+ {$content}
+ </tr>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getHtmlTableData
+ * @param string $class
+ * @param mixed $field_name
+ */
+ public function getHtmlTableData($class = '', $field_name) {
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $ret = <<<EOT
+ <td class='{$class}'><{\${$table_fieldname}.{$field_name}}></td>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartyIncludeFile
+ * @param string $name
+ */
+ public function getSmartyIncludeFile($name = 'header') {
+ $module_name = $this->module->getVar('mod_name');
+ $ret = <<<EOT
+ <{include file='db:{$module_name}_{$name}.html'}>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartyConditions
+ * @param string $condition
+ * @param string $operator
+ * @param string $type
+ * @param string $content_if
+ * @param mixed $content_else
+ */
+ public function getSmartyConditions($condition = '', $operator = '==', $type = '1', $content_if = '', $content_else = false) {
+ $ret = '';
+ if(!$content_else) {
+ $ret .= <<<EOT
+ <{if ${$condition} {$operator} {$type}'}>
+ {$content_if}
+ <{/if}>
+EOT;
+ } else {
+ $ret .= <<<EOT
+ <{if ${$condition} {$operator} {$type}'}>
+ {$content_if}
+ <{else}>
+ {$content_else}
+ <{/if}>
+EOT;
+ }
+ return $ret;
+ }
+ /*
+ * @public function getSmartyForeach
+ * @param string $item
+ * @param string $from
+ * @param string $content
+ */
+ public function getSmartyForeach($item = 'item', $from = 'from', $content = 'content') {
+ $ret = <<<EOT
+ <{foreach item={$item} from=${$from}}>
+ {$content}
+ <{/foreach}>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getSmartySection
+ * @param string $name
+ * @param string $loop
+ * @param string $content
+ */
+ public function getSmartySection($name = 'name', $loop = 'loop', $content = 'content') {
+ $ret = <<<EOT
+ <{section name={$name} loop=${$loop}}>
+ {$content}
+ <{/section}>
+EOT;
+ return $ret;
+ }
+}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php 2014-03-02 01:52:29 UTC (rev 12337)
@@ -0,0 +1,57 @@
+<?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: user_footer.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) {
+ die('XOOPS root path not defined');
+}
+
+class UserFooter extends HeaderFile
+{
+ /*
+ * @var string
+ */
+ public $_module = '';
+ /*
+ * @var string
+ */
+ public $file_name = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $file_name
+ */
+ public function __construct($module, $file_name) {
+ $this->_module = $module;
+ $this->file_name = $file_name;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module_name = $this->getModuleName();
+ $language = $this->getLanguage('_MA_');
+ $ret <<<EOT
+\n// User footer
+include_once XOOPS_ROOT_PATH.'/footer.php';
+EOT;
+ return $ret;
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php 2014-02-28 21:29:57 UTC (rev 12336)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php 2014-03-02 01:52:29 UTC (rev 12337)
@@ -31,21 +31,15 @@
/*
* @var string
*/
- public $_table = array();
- /*
- * @var string
- */
public $file_name = null;
/*
* @public function constructor
* @param string $module
* @param string $file_name
*/
- public function __construct($module, $table, $file_name) {
+ public function __construct($module, $file_name) {
$this->_module = $module;
- $this->_table[] = $table;
$this->file_name = $file_name;
- $this->permissions = $permissions;
}
/*
* @public function render
@@ -53,7 +47,8 @@
*/
public function render() {
$module_name = $this->getModuleName();
- $language = $this->getLanguage('_MA_');
+ $language = $this->getLanguage('_MA_');
+ $stu_mod_name = strtoupper($module_name);
$ret <<<EOT
\nrequire_once dirname(dirname(dirname(__FILE__))) . '/mainfile.php';
\$dirname = \$GLOBALS['xoopsModule']->getVar('dirname');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php 2014-02-28 21:29:57 UTC (rev 12336)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php 2014-03-02 01:52:29 UTC (rev 12337)
@@ -45,7 +45,6 @@
$this->_module = $module;
$this->_table[] = $table;
$this->file_name = $file_name;
- $this->permissions = $permissions;
}
/*
* @public function render
@@ -53,7 +52,7 @@
*/
public function render() {
$module_name = $this->getModuleName();
- $language = $this->getLanguage('_MA_');
+ $language = $this->getLanguage('_MA_', '_');
$ret <<<EOT
\ninclude_once 'header.php';
\$xoopsOption['template_main'] = '{$stl_mod_name}_index.html';
@@ -63,7 +62,7 @@
// keywords
{$stl_mod_name}_meta_keywords(xoops_getModuleOption('keywords', \$dirname));
// description
-{$stl_mod_name}_meta_description({$language}_DESC);
+{$stl_mod_name}_meta_description({$language}DESC);
//
\$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', {$stu_mod_name}_URL.'/index.php');
\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_url', {$stu_mod_name}_URL);
@@ -75,7 +74,7 @@
\$GLOBALS['xoopsTpl']->assign('admin', {$stu_mod_name}_ADMIN);
\$GLOBALS['xoopsTpl']->assign('copyright', \$copyright);
//
-include_once XOOPS_ROOT_PATH.'/footer.php';
+include_once 'footer.php';
EOT;
return $ret;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-02-28 21:29:57 UTC (rev 12336)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-03-02 01:52:29 UTC (rev 12337)
@@ -27,7 +27,7 @@
/*
* @var string
*/
- public $_module = ;
+ public $_module = null;
/*
* @var string
*/
|
|
From: <txm...@us...> - 2014-03-05 16:16:30
|
Revision: 12347
http://sourceforge.net/p/xoops/svn/12347
Author: txmodxoops
Date: 2014-03-05 16:16:27 +0000 (Wed, 05 Mar 2014)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_file.php 2014-03-04 19:20:06 UTC (rev 12346)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_file.php 2014-03-05 16:16:27 UTC (rev 12347)
@@ -25,35 +25,222 @@
class SqlFile extends HeaderFile
{
/*
- * @var string
+ * @var mixed
*/
- public $_module = '';
+ public $table = null;
/*
- * @var string
- */
- public $_table = array();
- /*
- * @var string
- */
- public $file_name = null;
- /*
* @public function constructor
* @param string $module
* @param string $file_name
*/
public function __construct($module, $table, $file_name) {
- $this->_module = $module;
- $this->_table[] = $table;
+ $this->module = $module;
+ $this->table = $table;
$this->file_name = $file_name;
- $this->permissions = $permissions;
- }
+ }
/*
+ * @public function getHeadDatabaseTable
+ * @param string $module_name
+ * @param string $table_name
+ * @param integer $nb_fields
+ */
+ public function getHeadDatabaseTable($module_name, $table_name, $nb_fields) {
+ $ret = <<<EOT
+ #
+ # Structure table for `mod_{$module_name}_{$table_name}` {$nb_fields}
+ #
+
+ CREATE TABLE `mod_{$module_name}_{$table_name}` (
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getDatabaseTable
+ * @param array $fields
+ */
+ public function getDatabaseTable($module_name) {
+ $table_name = $this->table->getVar('table_name');
+ $table_fields = $this->table->getVar('table_fields');
+ // Creation of database table
+ $fields = explode('|', $table_fields);
+ $nb_fields = count($fields);
+ $ret = $this->getHeadDatabaseTable($module_name, $table_name, $nb_fields);
+ $j = 0;
+ for ($i=0; $i < $nb_fields; $i++)
+ {
+ $struct = explode(':', $fields[$i]);
+ if ( $struct[0] != ' ' )
+ {
+ //If as text, date or timestamp (not value)
+ switch( $struct[1] ) {
+ case 'text':
+ case 'date':
+ case 'timestamp':
+ $type = $struct[1];
+ break;
+ default:
+ $type = $struct[1].' ('.$struct[2].')';
+ break;
+ }
+ //If as empty is default not string(not value), if as text not default, if as numeric default is 0 or 0.0000
+ if ( $struct[5] == '' ) {
+ $default = "default ''";
+ }
+ switch( $struct[1] ) {
+ case 'text':
+ case 'tinytext':
+ case 'mediumtext':
+ case 'longtext':
+ $default = "";
+ break;
+ case 'int':
+ case 'tinyint':
+ case 'mediumint':
+ case 'smallint':
+ $default = "default '0'";
+ break;
+ case 'decimal':
+ case 'double':
+ case 'float':
+ $default = "default '0.0000'";
+ break;
+ case 'date':
+ $default = "default '0000-00-00'";
+ break;
+ case 'datetime':
+ case 'timestamp':
+ $default = "default '0000-00-00 00:00:00'";
+ break;
+ case 'time':
+ $default = "default '0000-00-00'";
+ break;
+ case 'year':
+ $default = "default '0000-00-00'";
+ break;
+ case 'other':
+ $default = "default '{$struct[5]}'";
+ break;
+ default:
+ $default = "default ''";
+ break;
+ }
+
+ if ( $i == 0 ) {
+ $comma[$j] = $this->getKey(1, $struct);
+ $j++;
+ $ret .= $this->getFieldNameLine($type, $struct, 'auto_increment');
+ } else {
+ switch( $struct[6] ) {
+ case 'unique':
+ case 'index':
+ case 'fulltext':
+ switch( $struct[6] ) {
+ case 'unique':
+ $ret .= $this->getFieldNameLine($type, $struct, $default);
+ $comma[$j] = $this->getKey(2, $struct);
+ break;
+ case 'index':
+ $ret .= $this->getFieldNameLine($type, $struct, $default);
+ $comma[$j] = $this->getKey(3, $struct);
+ break;
+ case 'fulltext':
+ $ret .= $this->getFieldNameLine($type, $struct, $default);
+ $comma[$j] = $this->getKey(4, $struct);
+ break;
+ }
+ break;
+ default:
+ $ret .= $this->getFieldNameLine($type, $struct, $default);
+ break;
+ }
+ $j++;
+ }
+ }
+ }
+ $ret .= $this->getCommaCicle($j);
+ unset($j);
+ $ret .= $this->getFootDatabaseTable();
+ return $ret;
+ }
+ /*
+ * @public function getFootDatabaseTable
+ * @param null
+ */
+ public function getFootDatabaseTable() {
+ $ret = <<<EOT
+ ) ENGINE=MyISAM;
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function constructor
+ * @param integer $key
+ * @param array $struct
+ */
+ public function getKey($key, $struct) {
+ switch( $key ) {
+ case 1:
+ $ret = 'PRIMARY KEY (`'.$struct[0].'`)';
+ break;
+ case 2:
+ $ret = 'KEY `'.$struct[0].'` (`'.$struct[0].'`)';
+ break;
+ case 3:
+ $ret = 'INDEX (`'.$struct[0].'`)';
+ break;
+ case 4:
+ $ret = 'FULLTEXT KEY `'.$struct[0].'` (`'.$struct[0].'`)';
+ break;
+ }
+ return $ret;
+ }
+ /*
+ * @public function getFieldNameLine
+ * @param string $type
+ * @param array $struct
+ * @param string $default
+ */
+ public function getFieldNameLine($type, $struct, $default = '') {
+ $ret = <<<EOT
+ `{$struct[0]}` {$type} {$struct[3]} {$struct[4]} {$default},\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getComma
+ * @param string $array
+ * @param string $comma
+ */
+ public function getComma($array, $comma = '') {
+ $ret = <<<EOT
+ {$array}{$comma}
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getCommaCicle
+ * @param integer $index
+ */
+ public function getCommaCicle($index) {
+ // Comma issue
+ $ret = ''
+ for ($i = 0; $i < $index; $i++)
+ {
+ if ( $i != $index - 1 ) {
+ $ret .= $this->getComma($comma[$i], ',');
+ } else {
+ $ret .= $this->getComma($comma[$i]);
+ }
+ }
+ return $ret;
+ }
+ /*
* @public function render
* @param null
*/
public function render() {
$module_name = $this->getModuleName();
- $ret = $this->fields($module_name, $table_name, $table_fieldname, $table_category, $table_fields, '', 0, 0, 0, 2);
+ $ret = $this->getDatabaseTable($module_name);
return $ret;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php 2014-03-04 19:20:06 UTC (rev 12346)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php 2014-03-05 16:16:27 UTC (rev 12347)
@@ -22,30 +22,21 @@
die('XOOPS root path not defined');
}
-class TemplatesIndex extends HeaderFile
+class TemplatesIndex extends HtmlSmartyCodes
{
/*
- * @var string
+ * @var null
*/
- public $_module = '';
+ public $table = null;
/*
- * @var string
- */
- public $_table = array();
- /*
- * @var string
- */
- public $file_name = null;
- /*
* @public function constructor
* @param string $module
* @param string $file_name
*/
public function __construct($module, $table, $file_name) {
- $this->_module = $module;
- $this->_table[] = $table;
+ $this->module = $module;
+ $this->table = $table;
$this->file_name = $file_name;
- $this->permissions = $permissions;
}
/*
* @public function render
@@ -53,18 +44,14 @@
*/
public function render() {
$module_name = $this->getModuleName();
- $language = $this->getLanguage('_MA_');
- $ret <<<EOT
-<{include file="db:{$stl_mod_name}_header.html"}>
-<table class="outer {$stl_mod_name}" cellspacing="0" cellpadding="0">
- <tbody>
- <tr class="left">
- <td class="pad5"><{\$smarty.const.{$language}INDEX_DESC}></td>
- </tr>
- </tbody>
-</table>
-<{include file="db:{$stl_mod_name}_footer.html"}>
-EOT;
+ $language = $this->getLanguage('_MA_');
+ $ret = $this->getSmartyIncludeFile($module_name);
+ $content = $this->getSmartyConst($language, '_INDEX_DESC');
+ $content = $this->getHtmlTableData('pad5', $content);
+ $content = $this->getHtmlTableRow('left', $content);
+ $content = $this->getHtmlTableTbody('bnone', $content);
+ $ret .= $this->getHtmlTable('outer', $content);
+ $ret .= $this->getSmartyIncludeFile($module_name, 'footer');
return $ret;
}
}
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-05-19 23:23:54
|
Revision: 12540
http://sourceforge.net/p/xoops/svn/12540
Author: txmodxoops
Date: 2014-05-19 23:23:50 +0000 (Mon, 19 May 2014)
Log Message:
-----------
Fix bugs
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/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_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -62,7 +62,7 @@
$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);
+ $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
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -182,8 +182,18 @@
// Admin Install File
$includeInstall = IncludeInstall::getInstance($module, $table, $tables, $fields, 'install.php');
+ $ret[] = $adminAbout->render();
+ $ret[] = $adminFooter->render();
+ $ret[] = $adminHeader->render();
+ $ret[] = $adminIndex->render();
+ $ret[] = $adminMenu->render();
+ $ret[] = $cssStyles->render();
+ $ret[] = $includeCommon->render();
+ $ret[] = $includeFunctions->render();
+ $ret[] = $includeInstall->render();
+
foreach (array_keys($tables) as $i)
- {
+ {
$table_name = $tables[$i]->getVar('table_name');
// Admin Pages File
$adminPages = AdminPages::getInstance($module, $tables, $table_name.'.php');
@@ -192,22 +202,14 @@
$adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
$ret[] = $adminTemplates->render();
// User Pages File
- $userPages = UserPages::getInstance($module, $tables, $table_name.'.php');
+ $userPages = UserPages::getInstance($module, $table, $table_name.'.php');
$ret[] = $userPages->render();
// User Templates File
- $adminTemplates = AdminTemplates::getInstance($module, $tables, $table_name.'.tpl');
- $ret[] = $adminTemplates->render();
+ $userTemplates = UserTemplates::getInstance($module, $table, $table_name.'.tpl');
+ $ret[] = $userTemplates->render();
}
+ //$ret[] = array($admin_pages, $admin_templates, $user_pages, $user_templates);
- $ret[] = $adminAbout->render();
- $ret[] = $adminFooter->render();
- $ret[] = $adminHeader->render();
- $ret[] = $adminIndex->render();
- $ret[] = $adminMenu->render();
- $ret[] = $cssStyles->render();
- $ret[] = $includeCommon->render();
- $ret[] = $includeFunctions->render();
- $ret[] = $includeInstall->render();
return $ret;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -146,7 +146,7 @@
$this->setSubDir($subdir);
}
if((!empty($subsubdir) || $subsubdir != null) && is_string($subsubdir)) {
- $this->setSubSubDir($subdir);
+ $this->setSubSubDir($subsubdir);
}
}
@@ -338,12 +338,12 @@
/*
* @public function getUploadPath
- * @param mixed $subdir
+ * @param null
*/
private function getUploadPath() {
if ($this->getSubDir() != null) {
$ret = $this->getModulePath() . DIRECTORY_SEPARATOR . $this->getSubDir();
- } elseif (strrpos($this->getSubDir(), '/') ) {
+ } elseif ($this->getSubSubDir() != null) {
$ret = $this->getModulePath() . DIRECTORY_SEPARATOR . $this->getSubDir() . DIRECTORY_SEPARATOR . $this->getSubSubDir();
} else {
$ret = $this->getModulePath();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -65,7 +65,7 @@
$module_name = $module->getVar('module_name');
$table_name = $table->getVar('table_name');
- $language = $this->getLanguage('AM', '_');
+ $language = $this->getLanguage($module_name, 'AM', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n//Admin
@@ -80,7 +80,7 @@
\ndefine('{$language}{$stu_table_name}', "There are <span class='bold'>%s</span> {$table_name_nohs} in the database");
EOT;
}
- $this->tdmcfile->create($module_name, 'language/', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'language', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -56,7 +56,6 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath('language');
$module = $this->getModule();
$table = $this->getTable();
$fields = $this->getFields();
@@ -96,7 +95,7 @@
EOT;
}
}
- $this->tdmcfile->create($module_name, 'language/', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'language', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -56,7 +56,6 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath('language');
$module = $this->getModule();
$table = $this->getTable();
$fields = $this->getFields();
@@ -65,7 +64,7 @@
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
$table_nbfields = $table->getVar('table_nbfields');
- $language = $this->getLanguage('MI', '_');
+ $language = $this->getLanguage($module_name, 'MI', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n// Main
@@ -80,7 +79,7 @@
$table_fieldname = $table[$i]->getVar('table_fieldname');
$nb_caracteres = strlen($table_fieldname);
$table_blocks = $table[$i]->getVar('table_blocks');
- $lng_stu_table_name = $language.'_'.strtoupper($table_name);
+ $lng_stu_table_name = $language.strtoupper($table_name);
$ucf_table_name = UcFirstAndToLower($table_name);
$content .= <<<EOT
\n\ndefine('{$lng_stu_table_name}', "{$ucf_table_name}");
@@ -103,7 +102,7 @@
$content .= <<<EOT
\n\ndefine('{$language}ADMIN', "Admin");
EOT;
- $this->tdmcfile->create($module_name, 'language/', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'language', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -57,7 +57,6 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath('language');
$module = $this->getModule();
$table = $this->getTable();
$fields = $this->getFields();
@@ -67,7 +66,7 @@
$table_fieldname = $table->getVar('table_fieldname');
$table_nbfields = $table->getVar('table_nbfields');
$table_notifications = $table->getVar('table_notifications');
- $language = $this->getLanguage('MI', '_');
+ $language = $this->getLanguage($module_name, 'MI', '_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\n// Admin
@@ -198,7 +197,7 @@
define('{$language}ADMINGROUPS_DESC', "Which groups have access to tools and permissions page");
EOT;
}
- $this->tdmcfile->create($module_name, 'language/', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'language', $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -27,6 +27,10 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
* @public function constructor
* @param string $module
* @param string $file_name
@@ -34,8 +38,10 @@
public function __construct($module, $table, $file_name) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($file_name);
+ $this->table = $table;
+ //$this->tables = $tables;
}
/*
* @static function &getInstance
@@ -56,14 +62,13 @@
* @param null
*/
public function render() {
- $path = $this->getLocalPath();
$module = $this->getModule();
- $table = $this->getTable();
+ //$table = $this->getTable();
$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('module_name');
- $table_name = $table->getVar('table_name');
- $table_nbfields = $table->getVar('table_nbfields');
+ $table_name = $this->table->getVar('table_name');
+ $table_nbfields = $this->table->getVar('table_nbfields');
$stu_mod_name = strtoupper($module_name);
$language = $this->getLanguage($module_name, 'MA', '_');
$content = $this->getHeaderFilesComments($module, $filename);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-05-19 18:53:24 UTC (rev 12539)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php 2014-05-19 23:23:50 UTC (rev 12540)
@@ -27,6 +27,10 @@
*/
private $tdmcfile = null;
/*
+ * @var string
+ */
+ private $table = null;
+ /*
* @public function constructor
* @param string $module
* @param string $file_name
@@ -34,8 +38,10 @@
public function __construct($module, $table, $file_name) {
$this->tdmcfile = TDMCreateFile::getInstance();
$this->setModule($module);
- $this->setTable($table);
+ //$this->setTable($table);
$this->setFileName($file_name);
+ $this->table = $table;
+ //$this->tables = $tables;
}
/*
* @static function &getInstance
@@ -57,13 +63,13 @@
*/
public function render() {
$module = $this->getModule();
- $table = $this->getTable();
+ //$table = $this->getTable();
$fields = $this->getFields();
$filename = $this->getFileName();
$module_name = $module->getVar('module_name');
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- $table_nbfields = $table->getVar('table_nbfields');
+ $table_name = $this->table->getVar('table_name');
+ $table_fieldname = $this->table->getVar('table_fieldname');
+ $table_nbfields = $this->table->getVar('table_nbfields');
$stu_module_name = strtoupper($module_name);
$language = $this->getLanguage($module_name, 'MA', '_');
$content = $this->getHeaderFilesComments($module, $filename);
@@ -118,7 +124,7 @@
$content .= <<<EOT
<{include file="db:{$module_name}_footer.html"}>
EOT;
- $this->tdmcfile->create($module_name, null, null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ $this->tdmcfile->create($module_name, 'templates', null, $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
}
\ No newline at end of file
|
|
From: <txm...@us...> - 2014-06-02 20:02:15
|
Revision: 12561
http://sourceforge.net/p/xoops/svn/12561
Author: txmodxoops
Date: 2014-06-02 20:02:11 +0000 (Mon, 02 Jun 2014)
Log Message:
-----------
Added more file
Updated
Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
Added Paths:
-----------
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
Modified: 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-06-02 08:21:11 UTC (rev 12560)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -174,7 +174,7 @@
* @param string $language
*/
public function getAdminPagesSave($module_name, $table_name, $language, $fpif, $fpmf) {
- $stu_table_name = strtoupper($table_name);
+ $stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'save':
if ( !\$GLOBALS['xoopsSecurity']->check() ) {
@@ -190,9 +190,9 @@
{
$field_name = $this->fields[$f]->getVar('field_name');
$field_element = $this->fields[$f]->getVar('field_element');
- if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
+ /*if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
$this->adminobjects->getSimpleSetVar($table_name, $field_name);
- } elseif(($field_element == 4) || ($field_element == 5)) {
+ } else*/if(($field_element == 4) || ($field_element == 5)) {
$this->adminobjects->getCheckBoxOrRadioYN($table_name, $field_name);
} elseif($field_element == 9) {
$this->adminobjects->getUploadImage($module_name, $table_name, $field_name);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-02 08:21:11 UTC (rev 12560)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -384,18 +384,18 @@
*/
public function getHeaderFilesComments($module, $filename) {
- $mod_name = $module->getVar('mod_name');
- $mod_version = $module->getVar('mod_version');
- $mod_since = $module->getVar('mod_since');
- $mod_min_xoops = $module->getVar('mod_min_xoops');
- $mod_author = $module->getVar('mod_author');
- $mod_credits = $module->getVar('mod_credits');
- $mod_author_mail = $module->getVar('mod_author_mail');
- $mod_author_website_url = $module->getVar('mod_author_website_url');
- $mod_license = $module->getVar('mod_license');
- $mod_subversion = $module->getVar('mod_subversion');
+ $name = $module->getVar('mod_name');
+ $version = $module->getVar('mod_version');
+ $since = $module->getVar('mod_since');
+ $min_xoops = $module->getVar('mod_min_xoops');
+ $author = $module->getVar('mod_author');
+ $credits = $module->getVar('mod_credits');
+ $author_mail = $module->getVar('mod_author_mail');
+ $author_website_url = $module->getVar('mod_author_website_url');
+ $license = $module->getVar('mod_license');
+ $subversion = $module->getVar('mod_subversion');
$date = date('D Y/m/d G:i:s');
- $package = strtolower($mod_name);
+ $package = strtolower($name);
$ret = <<<EOT
<?php
@@ -409,15 +409,15 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
- * {$mod_name} module for xoops
+ * {$name} module for xoops
*
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
- * @license {$mod_license}
+ * @license {$license}
* @package {$package}
- * @since {$mod_since}
- * @min_xoops {$mod_min_xoops}
- * @author {$mod_author} - Email:<{$mod_author_mail}> - Website:<{$mod_author_website_url}>
- * @version \$Id: {$mod_version} {$filename} {$mod_subversion} {$date}Z {$mod_credits} \$
+ * @since {$since}
+ * @min_xoops {$min_xoops}
+ * @author {$author} - Email:<{$author_mail}> - Website:<{$author_website_url}>
+ * @version \$Id: {$version} {$filename} {$subversion} {$date}Z {$credits} \$
*/\n
EOT;
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-02 08:21:11 UTC (rev 12560)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -113,29 +113,27 @@
*/
public function getDatabaseTables($module_name)
{
- $ret = '';
+ $ret = null;
foreach(array_keys($this->tables) as $t)
{
$table_name = $this->tables[$t]->getVar('table_name');
$table_autoincrement = $this->tables[$t]->getVar('table_autoincrement');
$nb_fields = $this->tables[$t]->getVar('table_nbfields');
- $ret .= $this->getDatabaseTable($module_name, $table_name, $table_autoincrement, $nb_fields);
+ $ret .= $this->getDatabaseFields($module_name, $table_name, $table_autoincrement, $nb_fields);
}
return $ret;
}
/*
- * @public function getDatabaseTable
+ * @public function getDatabaseFields
* @param string $module_name
* @param string $table_name
* @param boolean $table_autoincrement
* @param integer $nb_fields
*/
- public function getDatabaseTable($module_name, $table_name, $table_autoincrement, $nb_fields)
+ public function getDatabaseFields($module_name, $table_name, $table_autoincrement, $nb_fields)
{
- $ret = '';
- $j = 0;
- $comma = array();
+ $ret = null; $j = 0; $comma = array();
foreach(array_keys($this->fields) as $f)
{
// Creation of database table
@@ -195,38 +193,34 @@
$type = $field_type.'('.$field_value.')';
$default = "DEFAULT '{$field_default}'";
break;
- }
-
- if ( ($f == 1) && ($table_autoincrement == 1) ) {
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default, 'auto_increment');
- $comma[$j] = $this->getKey(1, $field_name);
- $j++;
- } else {
- switch( $field_key ) {
- case 'unique':
- case 'index':
- case 'fulltext':
- switch( $field_key ) {
- case 'unique':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(2, $field_name);
- break;
- case 'index':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(3, $field_name);
- break;
- case 'fulltext':
- $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- $comma[$j] = $this->getKey(4, $field_name);
- break;
- }
- break;
- default:
+ }
+ switch( $field_key ) {
+ case 'PRIMARY':
+ if ( ($f == 1) && ($table_autoincrement == 1) ) {
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, null, 'auto_increment');
+ $comma[$j] = $this->getKey(1, $field_name);
+ } else {
$ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
- break;
- }
- $j++;
+ $comma[$j] = $this->getKey(1, $field_name);
+ }
+ break;
+ case 'UNIQUE':
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = $this->getKey(2, $field_name);
+ break;
+ case 'INDEX':
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = $this->getKey(3, $field_name);
+ break;
+ case 'FULLTEXT':
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ $comma[$j] = $this->getKey(4, $field_name);
+ break;
+ default:
+ $ret .= $this->getFieldRow($field_name, $type, $field_attribute, $field_null, $default);
+ break;
}
+ $j++;
}
}
$ret .= $this->getCommaCicle($j, $comma);
@@ -245,6 +239,39 @@
return $ret;
}
/*
+ * @public function getFieldRow
+ * @param string $field_name
+ * @param string $field_type_value
+ * @param string $field_attribute
+ * @param string $field_null
+ * @param string $field_default
+ * @param string $autoincrement
+ */
+ public function getFieldRow($field_name, $field_type_value, $field_attribute = null, $field_null = null, $field_default = null, $autoincrement = null) {
+ $ret_autoincrement = <<<SQL
+`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$autoincrement},\n
+SQL;
+ $ret_field_attribute = <<<SQL
+`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default},\n
+SQL;
+ $ret_no_field_attribute = <<<SQL
+`{$field_name}` {$field_type_value} {$field_null} {$field_default},\n
+SQL;
+ $ret_slow = <<<SQL
+`{$field_name}` {$field_type_value},\n
+SQL;
+ if(!empty($autoincrement)) {
+ $ret = $ret_autoincrement;
+ } elseif($field_attribute != null) {
+ $ret = $ret_field_attribute;
+ } elseif($field_attribute == null) {
+ $ret = $ret_no_field_attribute;
+ } else {
+ $ret = $ret_slow;
+ }
+ return $ret;
+ }
+ /*
* @public function getKey
* @param integer $key
* @param array $field_name
@@ -274,30 +301,8 @@
}
return $ret;
}
+
/*
- * @public function getFieldRow
- * @param string $field_name
- * @param string $field_type_value
- * @param array $field_attribute
- * @param string $field_null
- * @param string $field_default
- * @param string $autoincrement
- */
- public function getFieldRow($field_name, $field_type_value, $field_attribute, $field_null, $field_default = '', $autoincrement = '')
- {
- if(!empty($autoincrement)) {
- $ret = <<<SQL
-`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default} {$autoincrement},\n
-SQL;
- } else {
- $ret = <<<SQL
-`{$field_name}` {$field_type_value} {$field_attribute} {$field_null} {$field_default},\n
-SQL;
- }
-
- return $ret;
- }
- /*
* @public function getComma
* @param array $array
* @param string $comma
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -0,0 +1,164 @@
+<?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: user_print.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class UserPrint extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $tdmcfile = null;
+ /*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $fields, $filename) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->setModule($module);
+ //$this->setTable($table);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $fields, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $fields, $filename);
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function getUserPrint
+ * @param string $mod_name
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getUserPrint($mod_name, $table_name, $language) {
+ $stu_mod_name = strtoupper($mod_name);
+ $stl_mod_name = strtolower($mod_name);
+ $stu_table_name = strtoupper($table_name);
+
+ $ucf_mod_name = ucfirst($mod_name);
+ $ucf_table_name = ucfirst($table_name);
+
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->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, '_'));
+ if(( $f == 1 ) && ($this->table->getVar('table_autoincrement') == 1)){
+ $fpif = $field_name;
+ } else {
+ if ( $this->fields[$f]->getVar('field_main') == 1 ) {
+ $fpmf = $field_name; // fpmf = fields parameters main field
+ }
+ }
+ }
+ $stu_lp_field_name = strtoupper($lp_field_name);
+ $ret = <<<EOT
+\ninclude_once 'header.php';
+{$lp_field_name} = isset(\$_GET['{$fpif}']) ? intval(\$_GET['{$fpif}']) : 0;
+if ( empty({$fpif}) ) {
+ redirect_header({$stu_mod_name}_URL . '/index.php', 2, {$language}NO{$stu_lp_field_name});
+}
+EOT;
+ if(( $field_name == $lp_field_name.'_published' ) {
+ $ret .= <<<EOT
+// Verify that the article is published
+{$lp_field_name} = new {$ucf_mod_name}{$ucf_table_name}({$fpif});
+// Not yet published
+if ( {$lp_field_name}->getVar('{$lp_field_name}_published') == 0 || {$lp_field_name}->getVar('{$lp_field_name}_published') > time() ) {
+ redirect_header({$stu_mod_name}_URL . '/index.php', 2, {$language}NO{$stu_lp_field_name});
+ exit();
+}
+EOT;
+ }
+ if(( $field_name == $lp_field_name.'_expired' ) {
+ $ret .= <<<EOT
+// Expired
+if ( {$lp_field_name}->getVar('{$lp_field_name}_expired') != 0 && {$lp_field_name}->getVar('{$lp_field_name}_expired') < time() ) {
+ redirect_header({$stu_mod_name}_URL . '/index.php', 2, {$language}NO{$stu_lp_field_name});
+ exit();
+}
+EOT;
+ }
+ $ret .= <<<EOT
+
+// Verify permissions
+\$gperm_handler =& xoops_gethandler('groupperm');
+if (is_object(\$xoopsUser)) {
+ \$groups = \$xoopsUser->getGroups();
+} else {
+ \$groups = XOOPS_GROUP_ANONYMOUS;
+}
+if (!\$gperm_handler->checkRight('{$stl_mod_name}_view', {$lp_field_name}->getVat('{$fpif}'), \$groups, \$xoopsModule->getVar('mid'))) {
+ redirect_header({$stu_mod_name}_URL . '/index.php', 3, _NOPERM);
+ exit();
+}
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $stu_mod_name = strtoupper($module_name);
+ $stl_mod_name = strtolower($module_name);
+ $stu_table_name = strtoupper($table_name);
+ $stl_table_name = strtolower($table_name);
+ $language = $this->getLanguage($module_name, 'MA');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getUserPrint($module_name, $table_name, $language);
+ $this->tdmcfile->create($module_name, '/', $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/user_rss.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -0,0 +1,193 @@
+<?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: user_rss.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class UserRss extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $tdmcfile = null;
+ /*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $fields, $filename) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->setModule($module);
+ //$this->setTable($table);
+ //$this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $fields, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $fields, $filename);
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function getUserRss
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getUserRss($module_name, $table_name, $language) {
+ $stu_table_name = strtoupper($table_name);
+
+ foreach(array_keys($this->fields) as $f)
+ {
+ $field_name = $this->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, '_'));
+ if($f == 1) {
+ $fpif = $field_name;
+ }
+ if($this->fields[$f]->getVar('field_main') == 1) {
+ $fpmf = $field_name;
+ }
+ if($this->fields[$f]->getVar('field_parent') == 1) {
+ $fppf = $field_name;
+ }
+ }
+
+ $ret = <<<EOT
+include_once 'header.php';
+\${$fppf} = {$module_name}_CleanVars(\$_GET, '{$fppf}', 0);
+include_once XOOPS_ROOT_PATH.'/class/template.php';
+\$items_count = \$xoopsModuleConfig['perpagerss'];
+
+if (function_exists('mb_http_output')) {
+ mb_http_output('pass');
+}
+//header ('Content-Type:text/xml; charset=UTF-8');
+\$xoopsModuleConfig["utf8"] = false;
+
+\$tpl = new XoopsTpl();
+\$tpl->xoops_setCaching(2); //1 = Cache global, 2 = Cache individuel (par template)
+\$tpl->xoops_setCacheTime(\$xoopsModuleConfig['timecacherss']*60); // Temps de cache en secondes
+\$categories = {$module_name}_MygetItemIds('{$module_name}_view', '{$module_name}');
+\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria('cat_status', 0, '!='));
+\$criteria->add(new Criteria('{$fppf}', '(' . implode(',', \$categories) . ')','IN'));
+if (\${$fppf} != 0){
+ \$criteria->add(new Criteria('{$fppf}', \${$fppf}));
+ \$cat = \${$table_name}Handler->get(\${$fppf});
+ \$title = \$xoopsConfig['sitename'] . ' - ' . \$xoopsModule->getVar('name') . ' - ' . \$cat->getVar('{$fpmf}');
+}else{
+ \$title = \$xoopsConfig['sitename'] . ' - ' . \$xoopsModule->getVar('name');
+}
+\$criteria->setLimit(\$xoopsModuleConfig['perpagerss']);
+\$criteria->setSort('date');
+\$criteria->setOrder('DESC');
+\${$table_name}_arr = \${$table_name}Handler->getall(\$criteria);
+
+if (!\$tpl->is_cached('db:rss.tpl', \${$fppf})) {
+ \$tpl->assign('channel_title', htmlspecialchars(\$title, ENT_QUOTES));
+ \$tpl->assign('channel_link', XOOPS_URL.'/');
+ \$tpl->assign('channel_desc', htmlspecialchars(\$xoopsConfig['slogan'], ENT_QUOTES));
+ \$tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
+ \$tpl->assign('channel_webmaster', \$xoopsConfig['adminmail']);
+ \$tpl->assign('channel_editor', \$xoopsConfig['adminmail']);
+ \$tpl->assign('channel_category', 'Event');
+ \$tpl->assign('channel_generator', 'XOOPS - ' . htmlspecialchars(\$xoopsModule->getVar('{$fpmf}'), ENT_QUOTES));
+ \$tpl->assign('channel_language', _LANGCODE);
+ if ( _LANGCODE == 'fr' ) {
+ \$tpl->assign('docs', 'http://www.scriptol.fr/rss/RSS-2.0.html');
+ } else {
+ \$tpl->assign('docs', 'http://cyber.law.harvard.edu/rss/rss.html');
+ }
+ \$tpl->assign('image_url', XOOPS_URL . \$xoopsModuleConfig['logorss']);
+ \$dimention = getimagesize(XOOPS_ROOT_PATH . \$xoopsModuleConfig['logorss']);
+ if (empty(\$dimention[0])) {
+ \$width = 88;
+ } else {
+ \$width = (\$dimention[0] > 144) ? 144 : \$dimention[0];
+ }
+ if (empty(\$dimention[1])) {
+ \$height = 31;
+ } else {
+ \$height = (\$dimention[1] > 400) ? 400 : \$dimention[1];
+ }
+ \$tpl->assign('image_width', \$width);
+ \$tpl->assign('image_height', \$height);
+ foreach (array_keys(\${$table_name}_arr) as \$i) {
+ \$description = \${$table_name}_arr[\$i]->getVar('description');
+ //permet d'afficher uniquement la description courte
+ if (strpos(\$description,'[pagebreak]')==false){
+ \$description_short = \$description;
+ }else{
+ \$description_short = substr(\$description,0,strpos(\$description,'[pagebreak]'));
+ }
+ \$tpl->append('items', array('title' => htmlspecialchars(\${$table_name}_arr[\$i]->getVar('{$fpmf}'), ENT_QUOTES),
+ 'link' => XOOPS_URL . '/modules/{$module_name}/singlefile.php?{$fppf}=' . \${$table_name}_arr[\$i]->getVar('{$fppf}') . '&{$fpif}=' . \${$table_name}_arr[\$i]->getVar('{$fpif}'),
+ 'guid' => XOOPS_URL . '/modules/{$module_name}/singlefile.php?{$fppf}=' . \${$table_name}_arr[\$i]->getVar('{$fppf}') . '&{$fpif}=' . \${$table_name}_arr[\$i]->getVar('{$fpif}'),
+ 'pubdate' => formatTimestamp(\${$table_name}_arr[\$i]->getVar('date'), 'rss'),
+ 'description' => htmlspecialchars(\$description_short, ENT_QUOTES)));
+ }
+}
+header("Content-Type:text/xml; charset=" . _CHARSET);
+\$tpl->display('db:rss.tpl', \${$fppf});
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module = $this->getModule();
+ //$table = $this->getTable();
+ //$fields = $this->getFields();
+ $filename = $this->getFileName();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
+ $language = $this->getLanguage($module_name, 'MA');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getUserRss($module_name, $table_name, $language);
+ $this->tdmcfile->create($module_name, '/', $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/user_submit.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php 2014-06-02 20:02:11 UTC (rev 12561)
@@ -0,0 +1,196 @@
+<?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: user_submit.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class UserSubmit extends TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $tdmcfile = null;
+ /*
+ * @var string
+ */
+ private $table = null;
+ /*
+ * @var string
+ */
+ private $fields = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $fields, $filename) {
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->setModule($module);
+ //$this->setTable($table);
+ $this->setFileName($filename);
+ $this->table = $table;
+ $this->fields = $fields;
+ }
+ /*
+ * @static function &getInstance
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public static function &getInstance($module, $table, $fields, $filename)
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self($module, $table, $fields, $filename);
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function getUserSubmitHeader
+ * @param string $module
+ * @param mixed $table
+ * @param string $filename
+ */
+ public function getUserSubmitHeader()
+ {
+ $ret = <<<EOT
+include_once 'header.php';
+\$op = downloads_CleanVars(\$_REQUEST, 'op', 'form', 'string');
+// Template
+\$xoopsOption['template_main'] = 'submit.tpl';
+include_once XOOPS_ROOT_PATH.'/header.php';
+\$xoTheme->addStylesheet( XOOPS_URL . '/modules/' . \$xoopsModule->getVar('dirname', 'n') . '/css/style.css', null );
+//On recupere la valeur de l'argument op dans l'URL$
+// redirection if not permissions
+if (\$perm_submit == false) {
+ redirect_header('index.php', 2, _NOPERM);
+ exit();
+}
+
+//
+switch (\$op)
+{\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getAdminPagesList
+ * @param string $table_name
+ * @param string $language
+ */
+ public function getUserSubmitForm($table_name, $language) {
+ $ret = <<<EOT
+ case 'form':
+ default:
+ // Description
+ \$xoTheme->addMeta( 'meta', 'description', strip_tags({$language}SUBMIT));
+
+ // Create
+ \${$table_name}Obj =& \${$table_name}Handler->create();
+ \$form = \${$table_name}Obj->getForm();
+ \$xoopsTpl->assign('form', \$form->render());\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getUserSubmitSave
+ * @param null
+ */
+ public function getUserSubmitSave($module_name, $table_name)
+ {
+ $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();
+ }
+EOT;
+ foreach (array_keys($this->fields) as $f)
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
+ $field_element = $this->fields[$f]->getVar('field_element');
+ /*if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
+ $this->adminobjects->getSimpleSetVar($table_name, $field_name);
+ } else*/if(($field_element == 4) || ($field_element == 5)) {
+ $this->adminobjects->getCheckBoxOrRadioYN($table_name, $field_name);
+ } elseif($field_element == 9) {
+ $this->adminobjects->getUploadImage($module_name, $table_name, $field_name);
+ } elseif($field_element == 10) {
+ $this->adminobjects->getUploadFile($module_name, $table_name, $field_name);
+ } elseif($field_element == 11) {
+ $this->adminobjects->getTextDateSelect($table_name, $field_name);
+ } else {
+ $this->adminobjects->getSimpleSetVar($table_name, $field_name);
+ }
+ }
+
+ $ret .= <<<EOT
+
+ if (\${$table_name}Handler->insert(\${$table_name}Obj)) {
+ redirect_header('index.php', 2, {$language}FORMOK);
+ }
+
+ echo \${$table_name}Obj->getHtmlErrors();
+ \$form =& \${$table_name}Obj->getForm();
+ \$form->display();
+ break;\n
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getUserSubmitFooter
+ * @param null
+ */
+ public function ...
[truncated message content] |
|
From: <txm...@us...> - 2014-06-04 17:09:11
|
Revision: 12563
http://sourceforge.net/p/xoops/svn/12563
Author: txmodxoops
Date: 2014-06-04 17:09:08 +0000 (Wed, 04 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -50,11 +50,8 @@
* @param string $module
* @param mixed $table
*/
- public function write($module, $table) {
- $this->setModule($module);
- $this->setFileName($filename);
- $this->tables = $tables;
- $this->fields = $fields;
+ public function write($module) {
+ $this->setModule($module);
}
/*
* @public function render
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -94,7 +94,7 @@
$table_name = $tables[$t]->getVar('table_name');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
- $table_block = $tables[$t]->getVar('table_blocks');
+ $table_blocks = $tables[$t]->getVar('table_blocks');
}
//
$indexFile = $this->path.'/index.html';
@@ -113,7 +113,7 @@
// Creation of "admin" folder and index.html file
$this->structure->makeDirAndCopyFile('admin', $indexFile, 'index.html');
}
- if ( $table_block == 1) {
+ if ( $table_blocks == 1) {
// Creation of "blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
}
@@ -168,7 +168,7 @@
// Creation of "templates/admin" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/admin', $indexFile, 'index.html');
}
- if ( $table_block == 1 ) {
+ if ( $table_blocks == 1 ) {
// Creation of "templates/blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('templates/blocks', $indexFile, 'index.html');
}
@@ -200,7 +200,7 @@
$table_name = $tables[$t]->getVar('table_name');
$table_admin = $tables[$t]->getVar('table_admin');
$table_user = $tables[$t]->getVar('table_user');
- $table_block = $tables[$t]->getVar('table_blocks');
+ $table_blocks = $tables[$t]->getVar('table_blocks');
$table_search = $tables[$t]->getVar('table_search');
$table_comments = $tables[$t]->getVar('table_comments');
$table_notifications = $tables[$t]->getVar('table_notifications');
@@ -211,118 +211,21 @@
$fields = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
unset($criteria_fields);
- $table = $this->tdmcreate->getHandler('tables')->get($table_id);
-
+ $table = $this->tdmcreate->getHandler('tables')->get($table_id);
+
// Creation of admin files
- if ( $table_admin == 1) {
- // Admin Aboutr File
- $adminAbout = AdminAbout::getInstance();
- $adminAbout->write($module, 'about.php');
- $ret[] = $adminAbout->render();
- // Admin Footer File
- $adminFooter = AdminFooter::getInstance();
- $adminFooter->write($module, 'footer.php');
- $ret[] = $adminFooter->render();
- // Admin Header File
- $adminHeader = AdminHeader::getInstance();
- $adminHeader->write($module, $table, $tables, 'header.php');
- $ret[] = $adminHeader->render();
- // Admin Index File
- $adminIndex = AdminIndex::getInstance();
- $adminIndex->write($module, $table, $tables, 'index.php');
- $ret[] = $adminIndex->render();
- // Admin Menu File
- $adminMenu = AdminMenu::getInstance();
- $adminMenu->write($module, $table, $tables, 'menu.php');
- $ret[] = $adminMenu->render();
- }
- // Creation of admin permission file
- if (( $table_permissions == 1) && ( $table_admin == 1 )) {
- // Admin Permissions File
- $adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, $fields, 'permissions.php');
- $ret[] = $adminPermissions->render();
- }
- // Css Styles File
- $cssStyles = CssStyles::getInstance($module, 'style.css');
- $cssStyles->write($module, 'style.css');
- $ret[] = $cssStyles->render();
- // Include Common File
- $includeCommon = IncludeCommon::getInstance();
- $includeCommon->write($module, 'common.php');
- $ret[] = $includeCommon->render();
- // Include Functions File
- $includeFunctions = IncludeFunctions::getInstance();
- $includeFunctions->write($module, 'functions.php');
- $ret[] = $includeFunctions->render();
- // Include Install File
- $includeInstall = IncludeInstall::getInstance();
- $includeInstall->write($module, $tables, $fields, 'install.php');
- $ret[] = $includeInstall->render();
- // Include Jquery File
- $includeJquery = IncludeJquery::getInstance();
- $includeJquery->write($module, 'functions.js');
- $ret[] = $includeJquery->render();
- // Creation of search file
- if ( $table_search == 1) {
- // Include Search File
- $includeSearch = IncludeSearch::getInstance();
- $includeSearch->write($module, $table, $fields, 'search.php');
- $ret[] = $includeSearch->render();
- }
- // Creation of comments files
- if ( $table_comments == 1) {
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
- // Include Comments File
- $includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
- $ret[] = $includeComments->getCommentsNew($module, 'comment_new');
- }
- // Creation of notifications files
- if ( $table_notifications == 1 ) {
- // Include Notifications File
- $includeNotifications = IncludeNotifications::getInstance();
- $includeNotifications->write($module, $table, $fields, 'notifications.php');
- $ret[] = $includeNotifications->render();
- }
- // Creation of sql file
- if ( $table_name != null) {
- // Sql File
- $sqlFile = SqlFile::getInstance();
- $sqlFile->write($module, $tables, $fields, 'mysql.sql');
- $ret[] = $sqlFile->render();
- }
- // Creation of admin files
if ( $table_admin == 1) {
// Admin Pages File
$adminPages = AdminPages::getInstance();
- $adminPages->write($module, $table_name, $fields);
- //$ret[] = $adminPages->renderFile($table_name.'.php');
- $ret_admin_page = $adminPages->renderFile($table_name.'.php');
- $ret[] = $ret_admin_page;
- var_dump($ret_admin_page);
+ $adminPages->write($module, $table_name, $fields);
+ $ret[] = $adminPages->renderFile($table_name.'.php');
// Admin Templates File
$adminTemplates = AdminTemplates::getInstance();
- $adminTemplates->write($module, $tables);
+ $adminTemplates->write($module);
$ret[] = $adminTemplates->renderFile($table_name.'.tpl');
}
// Creation of blocks
- if ( $table_block == 1) {
+ if ( $table_blocks == 1) {
// Blocks Files
$blocksFiles = BlocksFiles::getInstance();
$blocksFiles->write($module, $table, $fields);
@@ -344,86 +247,185 @@
// User Pages File
$userPages = UserPages::getInstance();
$userPages->write($module, $table, $fields);
- $ret_user_page = $userPages->renderFile($table_name.'.php');
- $ret[] = $ret_user_page;
- var_dump($ret_user_page);
+ $ret[] = $userPages->renderFile($table_name.'.php');
// User Templates File
$userTemplates = UserTemplates::getInstance();
$userTemplates->write($module, $tables, $fields);
$ret[] = $userTemplates->renderFile($table_name.'.tpl');
}
- var_dump($table_name);
- // Creation of admin language file
- if ( $table_admin == 1) {
- // Language Admin File
- $languageAdmin = LanguageAdmin::getInstance();
- $languageAdmin->write($module, $table, $tables, 'admin.php');
- $ret[] = $languageAdmin->render();
- }
- // Creation of blocks language file
- if ( $table_block == 1) {
- // Language Blocks File
- $languageBlocks = LanguageBlocks::getInstance();
- $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
- $ret[] = $languageBlocks->render();
- }
- // Creation of user language file
- if ( $table_user == 1) {
- // Language Main File
- $languageMain = LanguageMain::getInstance();
- $languageMain->write($module, $table, $tables, $fields, 'main.php');
- $ret[] = $languageMain->render();
- }
- // Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
- $ret[] = $languageModinfo->render();
- // Language Help File
- $languageHelp = LanguageHelp::getInstance();
- $languageHelp->write($module, 'help.html');
- $ret[] = $languageHelp->render();
- // Creation of user files
- if ( $table_user == 1) {
- // Templates Footer File
- $templatesFooter = TemplatesFooter::getInstance();
- $templatesFooter->write($module, $table, 'footer.tpl');
- $ret[] = $templatesFooter->render();
- // Templates Header File
- $templatesHeader = TemplatesHeader::getInstance();
- $templatesHeader->write($module, $tables, 'header.tpl');
- $ret[] = $templatesHeader->render();
- // Templates Index File
- $templatesIndex = TemplatesIndex::getInstance();
- $templatesIndex->write($module, 'index.tpl');
- $ret[] = $templatesIndex->render();
- // User Footer File
- $userFooter = UserFooter::getInstance();
- $userFooter->write($module, 'footer.php');
- $ret[] = $userFooter->render();
- // User Header File
- $userHeader = UserHeader::getInstance();
- $userHeader->write($module, 'header.php');
- $ret[] = $userHeader->render();
- // User Index File
- $userIndex = UserIndex::getInstance();
- $userIndex->write($module, $table, 'index.php');
- $ret[] = $userIndex->render();
- }
- if ( ($table_user == 1) && ($table_notifications == 1)){
- // User Notification Update File
- $userNotificationUpdate = UserNotificationUpdate::getInstance();
- $userNotificationUpdate->write($module, 'notification_update.php');
- $ret[] = $userNotificationUpdate->render();
- }
- // User Xoops Version File
- $userXoopsVersion = UserXoopsVersion::getInstance();
- $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
- $ret[] = $userXoopsVersion->render();
- }
+ var_dump($table_name);
+ }
+ // Creation of admin language file
+ if ( $table_admin == 1) {
+ // Language Admin File
+ $languageAdmin = LanguageAdmin::getInstance();
+ $languageAdmin->write($module, $table, $tables, 'admin.php');
+ $ret[] = $languageAdmin->render();
+ }
+ // Creation of blocks language file
+ if ( $table_blocks == 1) {
+ // Language Blocks File
+ $languageBlocks = LanguageBlocks::getInstance();
+ $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
+ $ret[] = $languageBlocks->render();
+ }
+ // Creation of user language file
+ if ( $table_user == 1) {
+ // Language Main File
+ $languageMain = LanguageMain::getInstance();
+ $languageMain->write($module, $table, $tables, $fields, 'main.php');
+ $ret[] = $languageMain->render();
+ }
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance();
+ $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
+ // Creation of user files
+ if ( $table_user == 1) {
+ // Templates Footer File
+ $templatesFooter = TemplatesFooter::getInstance();
+ $templatesFooter->write($module, $table, 'footer.tpl');
+ $ret[] = $templatesFooter->render();
+ // Templates Header File
+ $templatesHeader = TemplatesHeader::getInstance();
+ $templatesHeader->write($module, $tables, 'header.tpl');
+ $ret[] = $templatesHeader->render();
+ // User Index File
+ $userIndex = UserIndex::getInstance();
+ $userIndex->write($module, $table, 'index.php');
+ $ret[] = $userIndex->render();
+ }
+ // Creation of admin files
+ if ( $table_admin == 1) {
+ // Admin Header File
+ $adminHeader = AdminHeader::getInstance();
+ $adminHeader->write($module, $table, $tables, 'header.php');
+ $ret[] = $adminHeader->render();
+ // Admin Index File
+ $adminIndex = AdminIndex::getInstance();
+ $adminIndex->write($module, $table, $tables, 'index.php');
+ $ret[] = $adminIndex->render();
+ // Admin Menu File
+ $adminMenu = AdminMenu::getInstance();
+ $adminMenu->write($module, $table, $tables, 'menu.php');
+ $ret[] = $adminMenu->render();
+ }
+ // Creation of admin permission file
+ if (( $table_permissions == 1) && ( $table_admin == 1 )) {
+ // Admin Permissions File
+ $adminPermissions = AdminPermissions::getInstance();
+ $adminPermissions->write($module, $tables, $fields, 'permissions.php');
+ $ret[] = $adminPermissions->render();
+ }
+ // Creation of notifications files
+ if ( $table_notifications == 1 ) {
+ // Include Notifications File
+ $includeNotifications = IncludeNotifications::getInstance();
+ $includeNotifications->write($module, $table, $fields, 'notifications.php');
+ $ret[] = $includeNotifications->render();
+ }
+ // Include Install File
+ $includeInstall = IncludeInstall::getInstance();
+ $includeInstall->write($module, $tables, $fields, 'install.php');
+ $ret[] = $includeInstall->render();
+ // Creation of sql file
+ if ( $table_name != null) {
+ // Sql File
+ $sqlFile = SqlFile::getInstance();
+ $sqlFile->write($module, $tables, $fields, 'mysql.sql');
+ $ret[] = $sqlFile->render();
+ }
+ // Creation of search file
+ if ( $table_search == 1) {
+ // Include Search File
+ $includeSearch = IncludeSearch::getInstance();
+ $includeSearch->write($module, $table, $fields, 'search.php');
+ $ret[] = $includeSearch->render();
+ }
+ // Creation of comments files
+ if ( $table->getVar('table_comments') == 1) {
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
+ // Include Comments File
+ $includeComments = IncludeComments::getInstance();
+ $includeComments->write($module, $table, $fields);
+ $ret[] = $includeComments->getCommentsNew($module, 'comment_new');
+ }
+ if ( ($table_user == 1) && ($table_notifications == 1)){
+ // User Notification Update File
+ $userNotificationUpdate = UserNotificationUpdate::getInstance();
+ $userNotificationUpdate->write($module, 'notification_update.php');
+ $ret[] = $userNotificationUpdate->render();
+ }
+ // Creation of admin files
+ if ( $table->getVar('table_admin') == 1 ) {
+ // Admin Aboutr File
+ $adminAbout = AdminAbout::getInstance();
+ $adminAbout->write($module, 'about.php');
+ $ret[] = $adminAbout->render();
+ // Admin Footer File
+ $adminFooter = AdminFooter::getInstance();
+ $adminFooter->write($module, 'footer.php');
+ $ret[] = $adminFooter->render();
+ }
+ // Creation of user files
+ if ( $table->getVar('table_user') == 1 ) {
+ // Templates Index File
+ $templatesIndex = TemplatesIndex::getInstance();
+ $templatesIndex->write($module, 'index.tpl');
+ $ret[] = $templatesIndex->render();
+ // User Footer File
+ $userFooter = UserFooter::getInstance();
+ $userFooter->write($module, 'footer.php');
+ $ret[] = $userFooter->render();
+ // User Header File
+ $userHeader = UserHeader::getInstance();
+ $userHeader->write($module, 'header.php');
+ $ret[] = $userHeader->render();
+ }
+ // Css Styles File
+ $cssStyles = CssStyles::getInstance($module, 'style.css');
+ $cssStyles->write($module, 'style.css');
+ $ret[] = $cssStyles->render();
+ // Include Common File
+ $includeCommon = IncludeCommon::getInstance();
+ $includeCommon->write($module, 'common.php');
+ $ret[] = $includeCommon->render();
+ // Include Functions File
+ $includeFunctions = IncludeFunctions::getInstance();
+ $includeFunctions->write($module, 'functions.php');
+ $ret[] = $includeFunctions->render();
// Docs Changelog File
$docsChangelog = DocsChangelog::getInstance();
$docsChangelog->write($module, 'changelog.txt');
- $ret[] = $docsChangelog->render();
+ $ret[] = $docsChangelog->render();
+ // Language Help File
+ $languageHelp = LanguageHelp::getInstance();
+ $languageHelp->write($module, 'help.html');
+ $ret[] = $languageHelp->render();
+ // Include Jquery File
+ $includeJquery = IncludeJquery::getInstance();
+ $includeJquery->write($module, 'functions.js');
+ $ret[] = $includeJquery->render();
+ // User Xoops Version File
+ $userXoopsVersion = UserXoopsVersion::getInstance();
+ $userXoopsVersion->write($module, $table, $tables, $fields, 'xoops_version.php');
+ $ret[] = $userXoopsVersion->render();
+ // Return Array
return $ret;
}
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -45,11 +45,11 @@
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $table, $fields)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $table, $fields);
+ $instance = new self();
}
return $instance;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -92,7 +92,8 @@
{
$table_name = $this->tables[$t]->getVar('table_name');
foreach (array_keys($this->fields) as $f)
- {
+ {
+ $field_name = $this->fields[$f]->getVar('field_name');
if ( ($f > 1) && ($this->tables[$t]->getVar('table_autoincrement') == 1) ) {
$field_element = $this->fields[$f]->getVar('field_element');
}
@@ -109,7 +110,7 @@
if ( $field_element == 9 )
{
$content .= <<<EOT
-\n// Making of "{$structure_fields[0]}" images folder
+\n// Making of "{$field_name}" images folder
\${$table_name} = \${$module_name}.'/images';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
@@ -117,7 +118,7 @@
copy(\$indexFile, \${$table_name}.'/index.html');
copy(\$blankFile, \${$table_name}.'/blank.gif');
-// Making of "{$structure_fields[0]}" images folder
+// Making of "{$field_name}" images folder
\${$table_name} = \${$module_name}.'/images/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
@@ -127,14 +128,14 @@
EOT;
} elseif ( $field_element == 10 ) {
$content .= <<<EOT
-// Making of "{$structure_fields[0]}" files folder
+// Making of "{$field_name}" files folder
\${$table_name} = \${$module_name}.'/files';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
chmod(\${$table_name}, 0777);
copy(\$indexFile, \${$table_name}.'/index.html');
-// Making of "{$structure_fields[0]}" files folder
+// Making of "{$field_name}" files folder
\${$table_name} = \${$module_name}.'/files/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -38,11 +38,11 @@
* @static function &getInstance
* @param null
*/
- public static function &getInstance($module, $filename)
+ public static function &getInstance()
{
static $instance = false;
if (!$instance) {
- $instance = new self($module, $filename);
+ $instance = new self();
}
return $instance;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -124,7 +124,7 @@
*/
public function getDatabaseTables($module_name)
{
- $ret = null;
+ $ret = null;
foreach(array_keys($this->tables) as $t)
{
$table_mid = $this->tables[$t]->getVar('table_mid');
@@ -132,7 +132,11 @@
$table_name = $this->tables[$t]->getVar('table_name');
$table_autoincrement = $this->tables[$t]->getVar('table_autoincrement');
$nb_fields = $this->tables[$t]->getVar('table_nbfields');
- $ret .= $this->getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $nb_fields);
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ $ret .= $this->getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $fields_all, $nb_fields);
}
return $ret;
}
@@ -144,14 +148,9 @@
* @param boolean $table_autoincrement
* @param integer $nb_fields
*/
- public function getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $nb_fields)
+ public function getDatabaseFields($module_name, $table_mid, $table_id, $table_name, $table_autoincrement, $fields_all, $nb_fields)
{
- $ret = null; $j = 1; $comma = array();
- $criteria_fields = new CriteriaCompo();
- $criteria_fields->add(new Criteria('field_mid', $table_mid));
- $criteria_fields->add(new Criteria('field_tid', $table_id));
- $fields_all = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
- unset($criteria_fields);
+ $ret = null; $j = 1; $comma = array();
foreach(array_keys($fields_all) as $f)
{
// Creation of database table
@@ -187,11 +186,8 @@
$default = "DEFAULT '{$field_default}'";
break;
case 'DATE':
- $type = $field_type;
- $default = "DEFAULT '{$field_default}'";
- break;
case 'DATETIME':
- case 'TIMESTAMP':
+ case 'TIMESTAMP':
$type = $field_type;
$default = "DEFAULT '{$field_default}'";
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-03 23:17:10 UTC (rev 12562)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php 2014-06-04 17:09:08 UTC (rev 12563)
@@ -39,6 +39,10 @@
*/
private $tables = null;
/*
+ * @var string
+ */
+ private $fields = null;
+ /*
* @public function constructor
* @param null
*/
@@ -63,10 +67,11 @@
* @param mixed $table
* @param string $filename
*/
- public function write($module, $table, $fields, $filename) {
+ public function write($module, $table, $tables, $fields, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
+ $this->tables = $tables;
$this->fields = $fields;
}
/*
|
|
From: <txm...@us...> - 2014-06-05 15:12:45
|
Revision: 12565
http://sourceforge.net/p/xoops/svn/12565
Author: txmodxoops
Date: 2014-06-05 15:12:37 +0000 (Thu, 05 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.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_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.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
Modified: 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-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -33,18 +33,15 @@
/*
* @var string
*/
- private $table_name = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->adminobjects = AdminObjects::getInstance();
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -61,16 +58,11 @@
/*
* @public function write
* @param string $module
- * @param string $table_name
- * @param array $fields
- * @param string $filename
+ * @param string $table
*/
- public function write($module, $table_name, $fields) {
+ public function write($module, $table) {
$this->setModule($module);
- //$this->setTable($table);
- //$this->setFileName($filename);
- $this->table_name = $table_name;
- $this->fields = $fields;
+ $this->table = $table;
}
/*
* @public function getAdminPagesHeader
@@ -96,7 +88,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesList($table_name, $language, $fpif, $fpmf) {
+ public function getAdminPagesList($table_name, $language, $fields, $fpif, $fpmf) {
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'list':
@@ -108,7 +100,7 @@
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
\$criteria->setOrder('ASC');
- \${$table_name}_rows = \${$table_name}Handler->getCount();
+ \${$table_name}_rows = \${$table_name}Handler->getCount(\$criteria);
\${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
unset(\$criteria);
@@ -118,9 +110,9 @@
foreach (array_keys(\${$table_name}_arr) as \$i)
{\n
EOT;
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields[$f]->getVar('field_name');
$rp_field_name = $field_name;
if(strpos($field_name, '_')) {
$str = strpos($field_name, '_');
@@ -175,7 +167,7 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesSave($module_name, $table_name, $language, $fpif, $fpmf)
+ public function getAdminPagesSave($module_name, $table_name, $language, $fields, $fpif, $fpmf)
{
$ret = <<<EOT
case 'save':
@@ -188,10 +180,11 @@
\${$table_name}Obj =& \${$table_name}Handler->create();
}
EOT;
- foreach (array_keys($this->fields) as $f)
+
+ foreach (array_keys($fields) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- $field_element = $this->fields[$f]->getVar('field_element');
+ $field_name = $fields[$f]->getVar('field_name');
+ $field_element = $fields[$f]->getVar('field_element');
/*if(($field_element == 1) || ($field_element == 2) || ($field_element == 3) || ($field_element > 11)) {
$this->adminobjects->getSimpleSetVar($table_name, $field_name);
} else*/if(($field_element == 4) || ($field_element == 5)) {
@@ -287,27 +280,33 @@
public function renderFile($filename)
{
$fpif = ''; $fpmf = '';
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
if($f == 1) {
$fpif = $field_name;
}
- if($this->fields[$f]->getVar('field_main') == 1) {
+ if($fields_all[$f]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
}
$module = $this->getModule();
- $module_name = $module->getVar('mod_name');
+ $module_name = $module->getVar('mod_name');
+ $table_name = $this->table->getVar('table_name');
//$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getAdminPagesHeader($module_name, $this->table_name);
- $content .= $this->getAdminPagesList($this->table_name, $language, $fpif, $fpmf);
- $content .= $this->getAdminPagesNew($this->table_name, $language);
- $content .= $this->getAdminPagesSave($module_name, $this->table_name, $language, $fpif, $fpmf);
- $content .= $this->getAdminPagesEdit($this->table_name, $language, $fpif);
- $content .= $this->getAdminPagesDelete($this->table_name, $language, $fpif, $fpmf);
+ $content .= $this->getAdminPagesHeader($module_name, $table_name);
+ $content .= $this->getAdminPagesList($table_name, $language, $fields_all, $fpif, $fpmf);
+ $content .= $this->getAdminPagesNew($table_name, $language);
+ $content .= $this->getAdminPagesSave($module_name, $table_name, $language, $fields_all, $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);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -205,19 +205,14 @@
$table_comments = $tables[$t]->getVar('table_comments');
$table_notifications = $tables[$t]->getVar('table_notifications');
$table_permissions = $tables[$t]->getVar('table_permissions');
- $criteria_fields = new CriteriaCompo();
- $criteria_fields->add(new Criteria('field_mid', $table_mid));
- $criteria_fields->add(new Criteria('field_tid', $table_id));
- $fields = $this->tdmcreate->getHandler('fields')->getAll($criteria_fields);
- unset($criteria_fields);
-
+
$table = $this->tdmcreate->getHandler('tables')->get($table_id);
// Creation of admin files
if ( $table_admin == 1) {
// Admin Pages File
$adminPages = AdminPages::getInstance();
- $adminPages->write($module, $table_name, $fields);
+ $adminPages->write($module, $table);
$ret[] = $adminPages->renderFile($table_name.'.php');
// Admin Templates File
$adminTemplates = AdminTemplates::getInstance();
@@ -228,29 +223,29 @@
if ( $table_blocks == 1) {
// Blocks Files
$blocksFiles = BlocksFiles::getInstance();
- $blocksFiles->write($module, $table, $fields);
+ $blocksFiles->write($module, $table);
$ret[] = $blocksFiles->renderFile($table_name.'.php');
}
// Blocks Templates File
$blocksTemplates = BlocksTemplates::getInstance();
- $blocksTemplates->write($module, $table, $fields);
+ $blocksTemplates->write($module, $table);
$ret[] = $blocksTemplates->renderFile($table_name.'.tpl');
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
// Class Files
$classFiles = ClassFiles::getInstance();
- $classFiles->write($module, $table, $tables, $fields);
+ $classFiles->write($module, $table, $tables);
$ret[] = $classFiles->renderFile($table_name.'.php');
}
// Creation of user files
if ( $table_user == 1) {
// User Pages File
$userPages = UserPages::getInstance();
- $userPages->write($module, $table, $fields);
+ $userPages->write($module, $table);
$ret[] = $userPages->renderFile($table_name.'.php');
// User Templates File
$userTemplates = UserTemplates::getInstance();
- $userTemplates->write($module, $tables, $fields);
+ $userTemplates->write($module, $table, $tables);
$ret[] = $userTemplates->renderFile($table_name.'.tpl');
}
var_dump($table_name);
@@ -266,19 +261,19 @@
if ( $table_blocks == 1) {
// Language Blocks File
$languageBlocks = LanguageBlocks::getInstance();
- $languageBlocks->write($module, $table, $tables, $fields, 'blocks.php');
+ $languageBlocks->write($module, $table, $tables, 'blocks.php');
$ret[] = $languageBlocks->render();
}
// Creation of user language file
if ( $table_user == 1) {
// Language Main File
$languageMain = LanguageMain::getInstance();
- $languageMain->write($module, $table, $tables, $fields, 'main.php');
+ $languageMain->write($module, $table, $tables, 'main.php');
$ret[] = $languageMain->render();
}
// Language Modinfo File
$languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, $fields, 'modinfo.php');
+ $languageModinfo->write($module, $table, $tables, 'modinfo.php');
$ret[] = $languageModinfo->render();
// Creation of user files
if ( $table_user == 1) {
@@ -314,55 +309,55 @@
if (( $table_permissions == 1) && ( $table_admin == 1 )) {
// Admin Permissions File
$adminPermissions = AdminPermissions::getInstance();
- $adminPermissions->write($module, $tables, $fields, 'permissions.php');
+ $adminPermissions->write($module, $tables, 'permissions.php');
$ret[] = $adminPermissions->render();
}
// Creation of notifications files
if ( $table_notifications == 1 ) {
// Include Notifications File
$includeNotifications = IncludeNotifications::getInstance();
- $includeNotifications->write($module, $table, $fields, 'notifications.php');
+ $includeNotifications->write($module, $table, 'notifications.php');
$ret[] = $includeNotifications->render();
}
// Include Install File
$includeInstall = IncludeInstall::getInstance();
- $includeInstall->write($module, $tables, $fields, 'install.php');
+ $includeInstall->write($module, $tables, 'install.php');
$ret[] = $includeInstall->render();
// Creation of sql file
if ( $table_name != null) {
// Sql File
$sqlFile = SqlFile::getInstance();
- $sqlFile->write($module, $tables, $fields, 'mysql.sql');
+ $sqlFile->write($module, $table, $tables, 'mysql.sql');
$ret[] = $sqlFile->render();
}
// Creation of search file
if ( $table_search == 1) {
// Include Search File
$includeSearch = IncludeSearch::getInstance();
- $includeSearch->write($module, $table, $fields, 'search.php');
+ $includeSearch->write($module, $table, 'search.php');
$ret[] = $includeSearch->render();
}
// Creation of comments files
if ( $table->getVar('table_comments') == 1) {
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
// Include Comments File
$includeComments = IncludeComments::getInstance();
- $includeComments->write($module, $table, $fields);
+ $includeComments->write($module, $table);
$ret[] = $includeComments->getCommentsNew($module, 'comment_new');
}
if ( ($table_user == 1) && ($table_notifications == 1)){
@@ -423,7 +418,7 @@
$ret[] = $includeJquery->render();
// User Xoops Version File
$userXoopsVersion = UserXoopsVersion::getInstance();
- $userXoopsVersion->write($module, $table, $tables, $fields, 'xoops_version.php');
+ $userXoopsVersion->write($module, $table, $tables, 'xoops_version.php');
$ret[] = $userXoopsVersion->render();
// Return Array
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -57,18 +54,16 @@
* @public function write
* @param string $module
* @param mixed $table
- * @param mixed $fields
*/
- public function write($module, $table, $fields) {
+ public function write($module, $table) {
$this->setModule($module);
$this->table = $table;
- $this->fields = $fields;
}
/*
* @public function getBlocksShow
* @param null
*/
- public function getBlocksShow($module, $fpif, $fpmf) {
+ public function getBlocksShow($module, $fields_all, $fpif, $fpmf) {
$mod_name = $module->getVar('mod_name');
$mod_name_lowercase = strtolower($mod_name);
$table_name = $this->table->getVar('table_name');
@@ -112,9 +107,9 @@
foreach (array_keys(\${$table_name}_arr) as \$i)
{
EOT;
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields_all) as $f)
{
- if( $this->fields[$f]->getVar('field_block') == 1 ) {
+ if( $fields_all[$f]->getVar('field_block') == 1 ) {
$ret .= <<<EOT
\n\t\t\${$table_fieldname}['{$fpmf}'] = \${$table_name}_arr[\$i]->getVar('{$fpmf}');\n
EOT;
@@ -186,13 +181,18 @@
public function renderFile($filename)
{
$fpif = ''; $fpmf = '';
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
if($f == 1) {
- $fpif = $this->fields[$f]->getVar('field_name');
+ $fpif = $fields_all[$f]->getVar('field_name');
}
- if($this->fields[$f]->getVar('field_main') == 1) {
- $fpmf = $this->fields[$f]->getVar('field_name');
+ if($fields_all[$f]->getVar('field_main') == 1) {
+ $fpmf = $fields_all[$f]->getVar('field_name');
}
}
$module = $this->getModule();
@@ -201,7 +201,7 @@
//$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'MB');
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getBlocksShow($module, $fpif, $fpmf);
+ $content .= $this->getBlocksShow($module, $fields_all, $fpif, $fpmf);
$content .= $this->getBlocksEdit($module, $fpif, $fpmf, $language);
//
$this->tdmcfile->create($module_name, 'blocks', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -57,12 +54,10 @@
* @public function write
* @param string $module
* @param mixed $table
- * @param mixed $fields
*/
- public function write($module, $table, $fields) {
+ public function write($module, $table) {
$this->setModule($module);
$this->table = $table;
- $this->fields = $fields;
}
/*
* @public function render
@@ -78,31 +73,35 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
<table class="outer">
- <tr class="head">
+ <tr class="head">\n
EOT;
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $lng_field_name = $language.strtoupper($this->fields[$f]->getVar('field_name'));
+ $lng_field_name = $language.strtoupper($fields_all[$f]->getVar('field_name'));
$content .= <<<EOT
-\n\t\t<th><{\$smarty.const.{$lng_field_name}}></th>
+ <th><{\$smarty.const.{$lng_field_name}}></th>\n
EOT;
}
$content .= <<<EOT
-\n\t</tr>
+ </tr>
<{foreachq item={$table_fieldname} from=\${$table_fieldname}}>
- <tr class = "<{cycle values = 'even,odd'}>">
- <td>
+ <tr class = "<{cycle values = 'even,odd'}>">\n
+
EOT;
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields_all) as $f)
{
- $table_field_name = $table_fieldname.'.'.strip_tags($this->fields[$f]->getVar('field_name'));
+ $table_field_name = $table_fieldname.'.'.strip_tags($fields_all[$f]->getVar('field_name'));
$content .= <<<EOT
-\n\t\t\t<{\${$table_field_name}}>
+ <td><{\${$table_field_name}}></td>\n
EOT;
}
$content .= <<<EOT
-\n\t\t\t</td>
- </tr>
+ </tr>
<{/foreach}>
</table>
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -37,18 +37,15 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
- $this->formelements = TDMCreateFormElements::getInstance();
+ $this->formelements = TDMCreateFormElements::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -65,15 +62,13 @@
/*
* @public function write
* @param string $module
- * @param mixed $table
+ * @param string $table
* @param mixed $tables
- * @param mixed $fields
*/
- public function write($module, $table, $tables, $fields) {
+ public function write($module, $table, $tables) {
$this->setModule($module);
$this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function getInitVar
@@ -82,59 +77,59 @@
*/
public function getInitVar($field_name, $type = 'INT') {
$ret = <<<EOT
- \$this->initVar('{$field_name}', XOBJ_DTYPE_{$type});
+ \$this->initVar('{$field_name}', XOBJ_DTYPE_{$type});\n
EOT;
return $ret;
}
/*
* @public function getInitVars
- * @param array $table_nbfields
- * @param array $fields
+ * @param array $fields_all
*/
- public function getInitVars($table_nbfields) {
+ public function getInitVars($fields_all) {
$ret = '';
// Creation of the initVar functions list
- foreach (array_keys($this->fields) as $f)
+ foreach (array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- switch($this->fields[$f]->getVar('field_type')) {
- case 'int':
- case 'tinyint':
- case 'mediumint':
- case 'smallint':
+ $field_name = $fields_all[$f]->getVar('field_name');
+ $field_type = $fields_all[$f]->getVar('field_type');
+ switch($field_type) {
+ case 'INT':
+ case 'TINYINT':
+ case 'MEDIUMINT':
+ case 'SMALLINT':
$ret .= $this->getInitVar($field_name, 'INT');
break;
- case 'char':
- case 'varchar':
+ case 'CHAR':
+ case 'VARCHAR':
$ret .= $this->getInitVar($field_name, 'TXTBOX');
break;
- case 'text':
- case 'tinytext':
- case 'mediumtext':
- case 'longtext':
+ case 'TEXT':
+ case 'TINYTEXT':
+ case 'MEDIUMTEXT':
+ case 'LONGTEXT':
$ret .= $this->getInitVar($field_name, 'TXTAREA');
break;
- case 'float':
+ case 'FLOAT':
$ret .= $this->getInitVar($field_name, 'FLOAT');
break;
- case 'decimal':
- case 'double':
+ case 'DECIMAL':
+ case 'DOUBLE':
$ret .= $this->getInitVar($field_name, 'DECIMAL');
break;
- case 'enum':
+ case 'ENUM':
$ret .= $this->getInitVar($field_name, 'ENUM');
break;
- case 'email':
+ case 'EMAIL':
$ret .= $this->getInitVar($field_name, 'EMAIL');
break;
- case 'url':
+ case 'URL':
$ret .= $this->getInitVar($field_name, 'URL');
break;
- case 'date':
- case 'datetime':
- case 'timestamp':
- case 'time':
- case 'year':
+ case 'DATE':
+ case 'DATETIME':
+ case 'TIMESTAMP':
+ case 'TIME':
+ case 'YEAR':
$ret .= $this->getInitVar($field_name, 'LTIME');
break;
}
@@ -145,7 +140,7 @@
* @public function getHeadClass
* @param mixed $constructor
*/
- public function getHeadClass($module_name, $table_name, $initvar_functions) {
+ public function getHeadClass($module_name, $table_name, $fields_all) {
$ucf_module_name = ucfirst($module_name);
$ucf_table_name = ucfirst($table_name);
$ret = <<<EOT
@@ -163,7 +158,7 @@
public function __construct()
{
\$this->XoopsObject();
-{$initvar_functions}
+ {$this->getInitVars($fields_all)}
}\n
EOT;
return $ret;
@@ -293,25 +288,30 @@
$table_name = $this->table->getVar('table_name');
//$fields = $this->getFields();
//$filename = $this->getFileName();
- $module_name = strtolower($module->getVar('mod_name'));
- $initvar = $this->getInitVars($table_nbfields);
+ $module_name = strtolower($module->getVar('mod_name'));
$fpif = ''; $fpmf = '';
$initvar_functions = array();
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- if($f == 1) {
+ $field_name = $fields_all[$f]->getVar('field_name');
+ if(($f == 1) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
- if($this->fields[$f]->getVar('field_main') == 1) {
+ if($fields_all[$f]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
}
- $this->formelements->initForm($module, $this->table, $this->fields);
+ //$initvar = $this->getInitVars($fields_all);
+ $this->formelements->initForm($module, $this->table);
$elements_form = $this->formelements->renderElement();
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getHeadClass($module_name, $table_name, $initvar);
+ $content .= $this->getHeadClass($module_name, $table_name, $fields_all);
$content .= $this->getHeadFunctionForm($module_name, $elements_form);
if ($this->table->getVar('table_permissions') == 1) {
$content .= $this->getPermissionsInFunctionForm($module_name, $fpif);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-05 08:27:03 UTC (rev 12564)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-05 15:12:37 UTC (rev 12565)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $table = null;
+ private $table = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
parent::__construct();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/**
* @param string $method
@@ -66,12 +63,10 @@
* @public function initForm
* @param string $module
* @param array $table
- * @param string $fields
*/
- public function initForm($module, $table, $fields) {
+ public function initForm($module, $table) {
$this->module = $module;
$this->table = $table;
- $this->fields = $fields;
}
/*
* @public function getXoopsFormText
@@ -223,13 +218,13 @@
* @param string $table_name
* @param string $required
*/
- public function getXoopsFormTable($language, $module_name, $table_name, $required = 'false')
+ public function getXoopsFormTable($language, $module_name, $table_name, $fields, $required = 'false')
{
$field_name = '';
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields) as $f)
{
- if(($this->fields[$f]->getVar('field_parent') == 1)) {
- $field_name = $this->fields[$f]->getVar('field_name');
+ if(($fields[$f]->getVar('field_parent') == 1)) {
+ $field_name = $fields[$f]->getVar('field_name');
}
}
$ret = <<<XFT
@@ -247,18 +242,18 @@
* @param string $table_name
* @param string $required
*/
- public function getXoopsFormTopic($language, $module_name, $table_name, $required = 'false')
+ public function getXoopsFormTopic($language, $module_name, $table_name, $fields, $required = 'false')
{
- foreach(array_keys($this->fields) as $f)
+ foreach(array_keys($fields) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
- if($this->fields[$f]->getVar('field_id') == 1) {
+ $field_name = $fields[$f]->getVar('field_name');
+ if($fields[$f]->getVar('field_id') == 1) {
$field_id = $field_name;
}
- if($this->fields[$f]->getVar('field_parent') == 1) {
+ if($fields[$f]->getVar('field_parent') == 1) {
$field_pid = $field_name;
}
- if($this->fields[$f]->getVar('field_main') == 1) {
+ if($fields[$f]->getVar('field_main') == 1) {
$field_main = $field_name;
}
}
@@ -284,13 +279,19 @@
$table_name = $this->table->getVar('table_name');
$language = $this->getLanguage($module_name, 'AM');
$ret = '';
- foreach(array_keys($this->fields) as $f)
+ $table_id = $this->table->getVar('table_id');
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
+ ...
[truncated message content] |
|
From: <txm...@us...> - 2014-06-05 20:34:21
|
Revision: 12566
http://sourceforge.net/p/xoops/svn/12566
Author: txmodxoops
Date: 2014-06-05 20:34:13 +0000 (Thu, 05 Jun 2014)
Log Message:
-----------
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-06-05 15:12:37 UTC (rev 12565)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-06-05 20:34:13 UTC (rev 12566)
@@ -29,17 +29,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -60,11 +57,10 @@
* @param mixed $tables
* @param string $filename
*/
- public function write($module, $tables, $fields, $filename) {
+ public function write($module, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function render
@@ -155,19 +151,24 @@
$table_permissions = ''; $table_name = '';
foreach(array_keys($this->tables) as $t)
{
+ $table_id = $this->tables[$t]->getVar('table_id');
$table_permissions = $this->tables[$t]->getVar('table_permissions');
if($table_permissions == 1) {
$table_name = $this->tables[$t]->getVar('table_name');
}
}
$fpif = ''; $fpmf = '';
- foreach(array_keys($this->fields) as $f)
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach(array_keys($fields_all) as $f)
{
if($f == 1) {
- $fpif = $this->fields[$f]->getVar('field_name');
+ $fpif = $fields_all[$f]->getVar('field_name');
}
- if($this->fields[$f]->getVar('field_main') == 1) {
- $fpmf = $this->fields[$f]->getVar('field_name');
+ if($fields_all[$f]->getVar('field_main') == 1) {
+ $fpmf = $fields_all[$f]->getVar('field_name');
}
}
$ret = <<<PRM
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 15:12:37 UTC (rev 12565)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 20:34:13 UTC (rev 12566)
@@ -201,7 +201,7 @@
$perm_submit = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_SUBMIT');
$perm_view = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_VIEW');
$ret = <<<EOT
- \n//permissions
+ //permissions
\$member_handler = & xoops_gethandler ( 'member' );
\$group_list = &\$member_handler->getGroupList();
\$gperm_handler = &xoops_gethandler ( 'groupperm' );
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-06-05 15:12:37 UTC (rev 12565)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-06-05 20:34:13 UTC (rev 12566)
@@ -33,17 +33,14 @@
/*
* @var string
*/
- private $tables = null;
+ private $tables = null;
/*
- * @var string
- */
- private $fields = null;
- /*
* @public function constructor
* @param null
*/
public function __construct() {
$this->tdmcfile = TDMCreateFile::getInstance();
+ $this->tdmcreate = TDMCreate::getInstance();
}
/*
* @static function &getInstance
@@ -65,12 +62,11 @@
* @param string $fields
* @param string $filename
*/
- public function write($module, $table, $tables, $fields, $filename) {
+ public function write($module, $table, $tables, $filename) {
$this->setModule($module);
$this->setFileName($filename);
$this->table = $table;
$this->tables = $tables;
- $this->fields = $fields;
}
/*
* @public function render
@@ -96,15 +92,20 @@
EOT;
foreach (array_keys($this->tables) as $i)
{
+ $table_id = $this->tables[$i]->getVar('table_id');
$table_name = $this->tables[$i]->getVar('table_name');
$table_fieldname = $this->tables[$i]->getVar('table_fieldname');
$nb_caracteres = strlen($table_fieldname);
$table_blocks = $this->tables[$i]->getVar('table_blocks');
$language1 = $language.strtoupper($table_fieldname);
$fpif = '';
- foreach (array_keys($this->fields) as $f)
+ $criteria_fields = new CriteriaCompo();
+ $criteria_fields->add(new Criteria('field_tid', $table_id));
+ $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
+ unset($criteria_fields);
+ foreach (array_keys($fields_all) as $f)
{
- $field_name = $this->fields[$f]->getVar('field_name');
+ $field_name = $fields_all[$f]->getVar('field_name');
if($f == 1) {
$fpif = $field_name;
}
|
|
From: <txm...@us...> - 2014-06-06 15:19:14
|
Revision: 12567
http://sourceforge.net/p/xoops/svn/12567
Author: txmodxoops
Date: 2014-06-06 15:19:10 +0000 (Fri, 06 Jun 2014)
Log Message:
-----------
Fixed bugs
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -0,0 +1,106 @@
+<?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 of the files
+ *
+ * @var mixed
+ */
+ private $module = null;
+
+ /**
+ * "table" attribute of the files
+ *
+ * @var mixed
+ */
+ private $table = null;
+
+ /**
+ * "field" attribute of the files
+ *
+ * @var mixed
+ */
+ private $fields = null;
+
+ /**
+ * public function setFileName
+ * @param mixed $module
+ */
+ public function setModule($module) {
+ $this->module = $module;
+ }
+
+ /*
+ * @public function getModule
+ * @param null
+ */
+ public function getModule() {
+ return $this->module;
+ }
+
+ /**
+ * public function setTable
+ * @param mixed $table
+ */
+ public function setTable($table) {
+ $this->table = $table;
+ }
+
+ /*
+ * @public function getTable
+ * @param null
+ */
+ public function getTable() {
+ return $this->table;
+ }
+
+ /**
+ * @public function setFields
+ * @param mixed $fields
+ */
+ public function setFields($fields) {
+ $this->fields = $fields;
+ }
+
+ /*
+ * @public function getFields
+ * @param null
+ */
+ public function getFields() {
+ return $this->fields;
+ }
+
+ /**
+ * Generates output for the 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/abstractfiles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstractfiles.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -1,102 +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: abstractfiles.php 12258 2014-01-02 09:33:29Z timgno $
- */
-
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-/**
- * Abstract base class for files
- */
-abstract class TDMCreateAbstractFiles
-{
- /**
- * "path" attribute of the files
- *
- * @var string
- */
- private $path = TDMC_PATH;
-
- /**
- * "upload_path" attribute of the files
- *
- * @var string
- */
- private $upload_path = TDMC_UPLOAD_REPOSITORY_PATH;
-
- /**
- * "module" attribute of the files
- *
- * @var mixed
- */
- private $module = null;
-
- /**
- * "table" attribute of the files
- *
- * @var mixed
- */
- private $table = null;
-
- /**
- * "field" attribute of the files
- *
- * @var mixed
- */
- private $fields = null;
-
- /**
- * "folder" attribute of the files
- *
- * @var mixed
- */
- private $folder = null;
-
- /**
- * "filename" attribute of the files
- *
- * @var mixed
- */
- private $filename = null;
-
- /*
- * @public function getHeader
- * @param string $path
- * @param string $module
- * @param string $folder
- * @param string $file_name
- */
- public function getHeader($path, $module, $folder, $filename) {
- $this->path = $path;
- $this->folder = $folder;
- $this->module = $module;
- $this->filename = $filename;
- $ret = $this->path . DIRECTORY_SEPARATOR . $this->module . DIRECTORY_SEPARATOR . $this->folder . DIRECTORY_SEPARATOR . $this->filename;
- return $ret;
- }
-
- /**
- * Generates output for the files.
- *
- * This method is abstract and must be overwritten by the child classes.
- *
- * @abstract
- */
- public function render() {}
-}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -70,8 +70,8 @@
//$filename = $this->getFileName();
$module_name = $module->getVar('mod_name');
$language = $this->getLanguage($module_name, 'MB');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ //$content = $this->getHeaderFilesComments($module, $filename);
+ $content = <<<EOT
<table class="outer">
<tr class="head">\n
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -299,7 +299,7 @@
foreach(array_keys($fields_all) as $f)
{
$field_name = $fields_all[$f]->getVar('field_name');
- if(($f == 1) && ($this->table->getVar('table_autoincrement') == 1)) {
+ if(($f == 0) && ($this->table->getVar('table_autoincrement') == 1)) {
$fpif = $field_name;
}
if($fields_all[$f]->getVar('field_main') == 1) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -20,37 +20,16 @@
*/
defined('XOOPS_ROOT_PATH') or die('Restricted access');
-require_once 'abstractfiles.php';
+require_once 'abstract.php';
xoops_load('XoopsFile');
-class TDMCreateFile extends TDMCreateAbstractFiles
+class TDMCreateFile extends TDMCreateAbstract
{
/*
* @var string
*/
private $xoopsfile = null;
-
+
/**
- * "module" attribute of the files
- *
- * @var mixed
- */
- private $module = null;
-
- /**
- * "table" attribute of the files
- *
- * @var mixed
- */
- private $table = null;
-
- /**
- * "fields" attribute of the files
- *
- * @var mixed
- */
- private $fields = null;
-
- /**
* "filename" attribute of the files
*
* @var mixed
@@ -103,7 +82,7 @@
* @param null
*/
public function __construct() {
- $this->xoopsfile = XoopsFile::getHandler();
+ $this->xoopsfile = XoopsFile::getHandler();
}
/*
@@ -121,6 +100,7 @@
/*
* @public function create
* @param string $module_name
+ * @param string $subdir
* @param string $filename
* @param string $content
* @param mixed $created
@@ -188,83 +168,8 @@
private function getSubDir() {
return $this->subdir;
}
-
- /**
- * public function setFileName
- * @param mixed $module
- */
- public function setModule($module) {
- $this->module = $module;
- }
- /*
- * @public function getModule
- * @param null
- */
- public function getModule()
- {
- return $this->module;
- }
-
/**
- * public function setTable
- * @param mixed $table
- */
- public function setTable($table) {
- $this->table = null;
- if (!is_object($table) || ($table instanceof TDMCreateTables)) {
- $this->table = (object)$table;
- } elseif (is_array($table)) {
- $this->table[] = $table;
- }
- }
-
- /*
- * @public function getTable
- * @param null
- */
- public function getTable() {
- if (is_array($this->table)) {
- $ret = array();
- foreach($this->table as $table) {
- $ret[] = $table;
- }
- return $ret;
- } elseif (!is_object($this->table)) {
- return (object)$this->table;
- }
- }
-
- /**
- * @public function setFields
- * @param mixed $fields
- */
- public function setFields($fields) {
- $this->fields = null;
- if (is_object($fields) || ($fields instanceof TDMCreateFields)) {
- $this->fields = $fields;
- } elseif (is_array($fields)) {
- $this->fields[] = $fields;
- }
- }
-
- /*
- * @public function getFields
- * @param null
- */
- public function getFields() {
- if (is_array($this->fields)) {
- $ret = array();
- foreach ($this->fields as $fields) {
- $ret[] = $fields;
- }
- return $ret;
- } else {
- return $this->fields;
- }
- }
-
- /**
* public function setFileName
* @param mixed $file_name
*/
@@ -302,9 +207,9 @@
*/
private function getFolderName() {
$path = $this->getUploadPath();
- if(strrpos($path, '/'))
+ if(strrpos($path, '\\'))
{
- $str = strrpos($path, '/');
+ $str = strrpos($path, '\\');
if($str !== false){
return substr($path, $str + 1, strlen($path));
} else {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-05 20:34:13 UTC (rev 12566)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-06 15:19:10 UTC (rev 12567)
@@ -76,7 +76,7 @@
*/
public function getXoopsFormText($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')), {$required});\n
+ \$form->addElement(new XoopsFormText({$language}, '{$field_name}', 50, 255, \$this->getVar('{$field_name}')){$required});\n
EOT;
return $ret;
}
@@ -88,7 +88,7 @@
*/
public function getXoopsFormTextArea($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47), {$required});\n
+ \$form->addElement(new XoopsFormTextArea({$language}, '{$field_name}', \$this->getVar('{$field_name}'), 4, 47){$required});\n
EOT;
return $ret;
}
@@ -109,7 +109,7 @@
\$editor_configs['width'] = '100%';
\$editor_configs['height'] = '400px';
\$editor_configs['editor'] = xoops_getModuleOption('{$module_name}_editor', '{$module_name}');
- \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs), {$required} );\n
+ \$form->addElement( new XoopsFormEditor({$language}, '{$field_name}', \$editor_configs){$required});\n
EOT;
return $ret;
}
@@ -124,7 +124,7 @@
\${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
\$check_{$field_name} = new XoopsFormCheckBox({$language}, '{$field_name}', \${$field_name});
\$check_{$field_name}->addOption(1, " ");
- \$form->addElement(\$check_{$field_name}, {$required});\n
+ \$form->addElement(\$check_{$field_name}{$required});\n
EOT;
return $ret;
}
@@ -146,7 +146,7 @@
*/
public function getXoopsFormUploadFile($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
+ \$form->addElement(new XoopsFormUploadFile({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']){$required});\n
EOT;
return $ret;
}
@@ -158,7 +158,7 @@
*/
public function getXoopsFormUploadImage($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
+ \$form->addElement(new XoopsFormUploadImage({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']){$required});\n
EOT;
return $ret;
}
@@ -170,11 +170,26 @@
*/
public function getXoopsFormColorPicker($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']), {$required});\n
+ \$form->addElement(new XoopsFormColorPicker({$language}, '{$field_name}', \$xoopsModuleConfig['maxsize']){$required});\n
EOT;
return $ret;
}
/*
+ * @public function getXoopsFormSelect
+ * @param string $language
+ * @param string $table_name
+ * @param string $field_name
+ * @param string $required
+ */
+ public function getXoopsFormSelect($language, $table_name, $field_name, $required = 'false') {
+ $ret = <<<EOT
+ \${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
+ \${$field_name}_select->addOptionArray({$table_name}Handler->getList());
+ \$form->addElement(\${$field_name}_select{$required});\n
+EOT;
+ return $ret;
+ }
+ /*
* @public function getXoopsFormSelectUser
* @param string $language
* @param string $field_name
@@ -182,7 +197,7 @@
*/
public function getXoopsFormSelectUser($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false), {$required});\n
+ \$form->addElement(new XoopsFormSelectUser({$language}, '{$field_name}', false, \$this->getVar('{$field_name}'), 1, false){$required});\n
EOT;
return $ret;
}
@@ -195,7 +210,7 @@
public function getXoopsFormRadioYN($language, $field_name, $required = 'false') {
$ret = <<<EOT
${$field_name} = \$this->isNew() ? 0 : \$this->getVar('{$field_name}');
- \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}), {$required});\n
+ \$form->addElement(new XoopsFormRadioYN({$language}, '{$field_name}', ${$field_name}){$required});\n
EOT;
return $ret;
}
@@ -207,7 +222,7 @@
*/
public function getXoopsFormTextDateSelect($language, $field_name, $required = 'false') {
$ret = <<<EOT
- \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')), {$required});\n
+ \$form->addElement(new XoopsFormTextDateSelect({$language}, '{$field_name}', '', \$this->getVar('{$field_name}')){$required});\n
EOT;
return $ret;
}
@@ -216,6 +231,7 @@
* @param string $language
* @param string $module_name
* @param string $table_name
+ * @param string $fields
* @param string $required
*/
public function getXoopsFormTable($language, $module_name, $table_name, $fields, $required = 'false')
@@ -231,7 +247,7 @@
\${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOptionArray(\${$field_name}Handler->getList());
- \$form->addElement(\${$field_name}_select, {$required});\n
+ \$form->addElement(\${$field_name}_select{$required});\n
XFT;
return $ret;
}
@@ -265,7 +281,7 @@
if(\${$table_name}) {
\${$table_name}_tree = new XoopsObjectTree( \${$table_name}, '{$field_id}', '{$field_pid}' );
\${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_main}','--', \$this->getVar('{$field_pid}', 'e' ), true );
- \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ), {$required} );
+ \$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ){$required});
}\n
XFT;
return $ret;
@@ -277,7 +293,8 @@
public function renderElement() {
$module_name = $this->module->getVar('mod_name');
$table_name = $this->table->getVar('table_name');
- $language = $this->getLanguage($module_name, 'AM');
+ $language_funct = $this->getLanguage($module_name, 'AM');
+ $language_table = $language_funct . strtoupper($table_name);
$ret = '';
$table_id = $this->table->getVar('table_id');
$criteria_fields = new CriteriaCompo();
@@ -288,8 +305,8 @@
{
$field_name = $fields_all[$f]->getVar('field_name');
$field_element = $fields_all[$f]->getVar('field_element');
- $language = $language . strtoupper($table_name) . '_' . strtoupper($field_name);
- $required = ( $fields_all[$f]->getVar('field_required') == 1 ) ? 'true' : 'false';
+ $language = $language_funct . strtoupper($field_name);
+ $required = ( $fields_all[$f]->getVar('field_required') == 1 ) ? ', true' : '';
//
switch($field_element)
{
@@ -306,27 +323,28 @@
$ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
break;
case 5:
- $ret .= $this->getXoopsFormHidden($field_name);
+ $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
break;
case 6:
- $ret .= $this->getXoopsFormUploadFile($language, $field_name, $required);
+ $ret .= $this->getXoopsFormSelect($language, $table_name, $field_name, $required);
break;
case 7:
- $ret .= $this->getXoopsFormUploadImage($language, $field_name, $required);
+ $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
break;
case 8:
$ret .= $this->getXoopsFormColorPicker($language, $field_name, $required);
break;
case 9:
- $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
+ $ret .= $this->getXoopsFormUploadImage($language, $field_name, $required);
break;
case 10:
- $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
+ $ret .= $this->getXoopsFormUploadFile($language, $field_name, $required);
break;
case 11:
$ret .= $this->getXoopsFormTextDateSelect($language, $field_name, $required);
break;
- default:
+ default:
+ $ret .= $this->getXoopsFormHidden($field_name);
break;
}
if ($field_element > 11) {
|
|
From: <txm...@us...> - 2014-06-07 10:22:33
|
Revision: 12568
http://sourceforge.net/p/xoops/svn/12568
Author: txmodxoops
Date: 2014-06-07 10:22:26 +0000 (Sat, 07 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Deleted duplicated code
- Updated
- Work in progress
Modified 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_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/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_footer.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_header.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_notification_update.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_print.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_rss.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_submit.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_templates.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user_xoopsversion.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/tablefields.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/tables_fields.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -27,25 +27,32 @@
abstract class TDMCreateAbstract
{
/**
- * "module" attribute of the files
+ * "module" attribute fot files
*
* @var mixed
*/
- private $module = null;
+ protected $module = null;
/**
- * "table" attribute of the files
+ * "table" attribute fot files
*
* @var mixed
*/
- private $table = null;
+ protected $table = null;
/**
- * "field" attribute of the files
+ * "tables" attribute fot files
*
* @var mixed
*/
- private $fields = null;
+ protected $tables = null;
+
+ /**
+ * "fields" attribute fot files
+ *
+ * @var mixed
+ */
+ protected $fields = null;
/**
* public function setFileName
@@ -80,6 +87,22 @@
}
/**
+ * public function setTables
+ * @param mixed $tables
+ */
+ public function setTables($tables) {
+ $this->tables = $tables;
+ }
+
+ /*
+ * @public function getTables
+ * @param null
+ */
+ public function getTables() {
+ return $this->tables;
+ }
+
+ /**
* @public function setFields
* @param mixed $fields
*/
@@ -96,7 +119,7 @@
}
/**
- * Generates output for the files.
+ * Generates output for files.
*
* This method is abstract and must be overwritten by the child classes.
*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_about.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -23,11 +23,6 @@
class AdminAbout extends TDMCreateFile
{
/*
- * @var string
- */
- private $tdmcfile = null;
-
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_footer.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -23,11 +23,6 @@
class AdminFooter extends TDMCreateFile
{
/*
- * @var string
- */
- private $tdmcfile = null;
-
- /*
* @public function constructor
* @param string $modules
* @param string $filename
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_header.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -23,18 +23,6 @@
class AdminHeader extends TDMCreateFile
{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: 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-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_index.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,20 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class AdminIndex extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: 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-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_menu.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,20 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class AdminMenu extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: 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-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_pages.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -25,16 +25,8 @@
/*
* @var string
*/
- private $adminobjects = null;
+ private $adminobjects = null;
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
* @public function constructor
* @param null
*/
@@ -288,7 +280,7 @@
foreach(array_keys($fields_all) as $f)
{
$field_name = $fields_all[$f]->getVar('field_name');
- if($f == 1) {
+ if($f == 0) {
$fpif = $field_name;
}
if($fields_all[$f]->getVar('field_main') == 1) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_permissions.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,16 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class AdminPermissions extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin_templates.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -23,10 +23,6 @@
class AdminTemplates extends HtmlSmartyCodes
{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -342,23 +342,23 @@
// Include Comments File
$includeComments = IncludeComments::getInstance();
$includeComments->write($module, $table);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_edit');
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_edit');
// Include Comments File
$includeComments = IncludeComments::getInstance();
$includeComments->write($module, $table);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_delete');
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_delete');
// Include Comments File
$includeComments = IncludeComments::getInstance();
$includeComments->write($module, $table);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_post');
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_post');
// Include Comments File
$includeComments = IncludeComments::getInstance();
$includeComments->write($module, $table);
- $ret[] = $includeComments->getCommentsIncludes($module, 'comment_reply');
+ $ret[] = $includeComments->renderCommentsIncludes($module, 'comment_reply');
// Include Comments File
$includeComments = IncludeComments::getInstance();
$includeComments->write($module, $table);
- $ret[] = $includeComments->getCommentsNew($module, 'comment_new');
+ $ret[] = $includeComments->renderCommentsNew($module, 'comment_new');
}
if ( ($table_user == 1) && ($table_notifications == 1)){
// User Notification Update File
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,16 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class BlocksFiles extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_templates.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,16 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class BlocksTemplates extends HtmlSmartyCodes
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,24 +21,13 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'formelements.php';
class ClassFiles extends TDMCreateFormElements
-{
+{
/*
* @var string
*/
- private $tdmcfile = null;
+ private $formelements = null;
+
/*
- * @var string
- */
- private $formelements = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/css_styles.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,12 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class CssStyles extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_changelog.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -23,12 +23,8 @@
}
class DocsChangelog extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/docs_files.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,12 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class DocsFiles extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -78,6 +78,16 @@
private $mode = null;
/*
+ * @var string
+ */
+ protected $tdmcfile = null;
+
+ /*
+ * @var string
+ */
+ protected $tdmcreate = null;
+
+ /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,16 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class TDMCreateFormElements extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $module = null;
- /*
- * @var string
- */
- private $table = null;
- /*
* @public function constructor
* @param null
*/
@@ -256,6 +248,7 @@
* @param string $language
* @param string $module_name
* @param string $table_name
+ * @param string $fields
* @param string $required
*/
public function getXoopsFormTopic($language, $module_name, $table_name, $fields, $required = 'false')
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_comments.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,16 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class IncludeComments extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
* @public function constructor
* @param null
*/
@@ -61,9 +53,10 @@
}
/*
* @public function getCommentsIncludes
+ * @param string $module
* @param string $filename
*/
- public function getCommentsIncludes($module, $filename)
+ public function renderCommentsIncludes($module, $filename)
{
$module_name = strtolower($module->getVar('mod_name'));
$content = $this->getHeaderFilesComments($module, $filename.'.php');
@@ -77,9 +70,9 @@
/*
* @public function getCommentsNew
* @param string $module
- * @param string $file_name
+ * @param string $filename
*/
- public function getCommentsNew($module, $filename)
+ public function renderCommentsNew($module, $filename)
{
$module_name = strtolower($module->getVar('mod_name'));
$table_name = $this->table->getVar('table_name');
@@ -116,7 +109,7 @@
* @public function render
* @param null
*/
- public function render() {
+ /*public function render() {
$module = $this->getModule();
//$fields = $this->getFields();
$filename = $this->getFileName();
@@ -150,5 +143,5 @@
return $this->tdmcfile->renderFile();
break;
}
- }
+ }*/
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_common.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,12 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class IncludeCommon extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_functions.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,12 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class IncludeFunctions extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_install.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,16 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class IncludeInstall extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_jquery.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,12 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class IncludeJquery extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_notifications.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,16 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class IncludeNotifications extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include_search.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,16 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class IncludeSearch extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_admin.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,20 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class LanguageAdmin extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_blocks.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,20 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class LanguageBlocks extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_help.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -23,11 +23,6 @@
class LanguageHelp extends TDMCreateFile
{
/*
- * @var string
- */
- private $tdmcfile = null;
-
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_main.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,20 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class LanguageMain extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language_modinfo.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,20 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class LanguageModinfo extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-06 15:19:10 UTC (rev 12567)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql_files.php 2014-06-07 10:22:26 UTC (rev 12568)
@@ -21,24 +21,8 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
class SqlFile extends TDMCreateFile
-{
+{
/*
- * @var string
- */
- private $tdmcfile = null;
- /*
- * @var string
- */
- private $tdmcreate = null;
- /*
- * @var string
- */
- private $table = null;
- /*
- * @var string
- */
- private $tables = null;
- /*
* @public function constructor
* @param null
*/
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/tablefields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/tablefields.php (rev 0)
+++ XoopsMod...
[truncated message content] |
|
From: <txm...@us...> - 2014-06-09 19:09:04
|
Revision: 12570
http://sourceforge.net/p/xoops/svn/12570
Author: txmodxoops
Date: 2014-06-09 19:08:59 +0000 (Mon, 09 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-09 00:03:18 UTC (rev 12569)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks_files.php 2014-06-09 19:08:59 UTC (rev 12570)
@@ -113,41 +113,32 @@
}
/*
* @public function getBlocksEdit
- * @param null
+ * @param string $module_name
+ * @param string $table_name
+ * @param string $fpif
+ * @param string $fpmf
+ * @param string $language
*/
- public function getBlocksEdit($module_name, $table_name, $table_category, $fpif, $fpmf, $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)
-{\n
-EOT;
- if ( $table_category == 1 ) {
- $ret .=<<<EOT
- include_once XOOPS_ROOT_PATH.'/modules/{$module_name}/class/category.php';
-
- \$categoryHandler =& xoops_getModuleHandler('category', "{$module_name}");
- \$criteria = new CriteriaCompo();
- \$criteria->setSort("{$fpmf}");
- \$criteria->setOrder("ASC");
- \${$table_name}_arr = \$categoryHandler->getall(\$criteria);\n
-EOT;
- }
- $ret .= <<<EOT
- include_once XOOPS_ROOT_PATH.'/modules/{$module_name}/class/{$table_name}.php';
-
+{
+ 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 />";
- \${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
- \$criteria = new CriteriaCompo();
+ \$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) {
@@ -161,14 +152,14 @@
return $ret;
}
/*
- * @public function render
+ * @public function renderFile
* @param null
*/
public function renderFile($filename)
{
$module = $this->getModule();
$table = $this->getTable();
- $module_name = $module->getVar('mod_name');
+ $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');
@@ -185,7 +176,7 @@
}
$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, $table_category, $fpif, $fpmf, $language);
+ $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();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-09 00:03:18 UTC (rev 12569)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-06-09 19:08:59 UTC (rev 12570)
@@ -66,7 +66,7 @@
*/
public function getInitVar($field_name, $type = 'INT') {
$ret = <<<EOT
- \$this->initVar('{$field_name}', XOBJ_DTYPE_{$type});\n
+ \n\$this->initVar('{$field_name}', XOBJ_DTYPE_{$type});
EOT;
return $ret;
}
@@ -127,7 +127,9 @@
}
/*
* @public function getHeadClass
- * @param mixed $constructor
+ * @param string $module_name
+ * @param string $table_name
+ * @param array $fields
*/
public function getHeadClass($module_name, $table_name, $fields) {
$ucf_module_name = ucfirst($module_name);
@@ -147,19 +149,35 @@
public function __construct()
{
\$this->XoopsObject();
- {$this->getInitVars($fields)}
- }\n
+{$this->getInitVars($fields)}
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static \$instance = false;
+ if (!\$instance) {
+ \$instance = new self();
+ }
+ return \$instance;
+ }\n
EOT;
return $ret;
}
/*
* @public function getHeadFunctionForm
- * @param string $form
+ * @param string $module
+ * @param string $table
*/
- public function getHeadFunctionForm($module_name, $elements_form) {
+ public function getHeadFunctionForm($module, $table)
+ {
+ $module_name = strtolower($module->getVar('mod_name'));
$lang_add = $this->getLanguage($module_name, 'AM', 'ADD');
$lang_edit = $this->getLanguage($module_name, 'AM', 'EDIT');
+ $this->formelements->initForm($module, $table);
$ret = <<<EOT
/*
* Get form
@@ -177,12 +195,13 @@
xoops_load('XoopsFormLoader');
\$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
\$form->setExtra('enctype="multipart/form-data"');\n
-{$elements_form}\n
+{$this->formelements->renderElements()}\n
EOT;
return $ret;
}
/*
* @public function getPermissionsInFunctionForm
+ * @param string $module_name
* @param string $fpif
*/
public function getPermissionsInFunctionForm($module_name, $fpif) {
@@ -190,7 +209,7 @@
$perm_submit = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_SUBMIT');
$perm_view = $this->getLanguage($module_name, 'AM', 'PERMISSIONS_VIEW');
$ret = <<<EOT
- //permissions
+ // Permissions
\$member_handler = & xoops_gethandler ( 'member' );
\$group_list = &\$member_handler->getGroupList();
\$gperm_handler = &xoops_gethandler ( 'groupperm' );
@@ -220,7 +239,7 @@
\$form->addElement ( \$groups_can_submit_checkbox );
// For view
\$groups_can_view_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_view_checkbox );\n
+ \$form->addElement ( \$groups_can_view_checkbox );\n\n
EOT;
return $ret;
}
@@ -240,6 +259,8 @@
}
/*
* @public function getClassHandler
+ * @param string $module_name
+ * @param string $table_name
* @param string $fpif
* @param string $fpmf
*/
@@ -247,7 +268,6 @@
$ucf_module_name = ucfirst($module_name);
$ucf_table_name = ucfirst($table_name);
$ucf_mod_table_handler = $ucf_module_name . $ucf_table_name;
-
$ret = <<<EOT
/*
* Class Object Handler {$ucf_module_name}{$ucf_table_name}
@@ -268,19 +288,15 @@
return $ret;
}
/*
- * @public function render
- * @param null
+ * @public function renderFile
+ * @param string $filename
*/
public function renderFile($filename) {
$module = $this->getModule();
$table = $this->getTable();
$table_nbfields = $table->getVar('table_nbfields');
$table_name = $table->getVar('table_name');
- //$fields = $this->getFields();
- //$filename = $this->getFileName();
$module_name = strtolower($module->getVar('mod_name'));
- $fpif = ''; $fpmf = '';
- $initvar_functions = array();
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
@@ -291,14 +307,10 @@
if($fields[$f]->getVar('field_main') == 1) {
$fpmf = $field_name;
}
- }
- //$initvar = $this->getInitVars($fields);
- $this->formelements->initForm($module, $table);
- $elements_form = $this->formelements->renderElement();
-
+ }
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getHeadClass($module_name, $table_name, $fields);
- $content .= $this->getHeadFunctionForm($module_name, $elements_form);
+ $content .= $this->getHeadFunctionForm($module, $table);
if ($table->getVar('table_permissions') == 1) {
$content .= $this->getPermissionsInFunctionForm($module_name, $fpif);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-09 00:03:18 UTC (rev 12569)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/formelements.php 2014-06-09 19:08:59 UTC (rev 12570)
@@ -54,11 +54,11 @@
/*
* @public function initForm
* @param string $module
- * @param array $table
+ * @param string $table
*/
public function initForm($module, $table) {
- $this->module = $module;
- $this->table = $table;
+ $this->setModule($module);
+ $this->setTable($table);
}
/*
* @public function getXoopsFormText
@@ -280,26 +280,24 @@
return $ret;
}
/*
- * @public function render
+ * @public function renderElements
* @param null
*/
- public function renderElement() {
- $module_name = $this->module->getVar('mod_name');
- $table_name = $this->table->getVar('table_name');
+ public function renderElements() {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $table->getVar('table_name');
$language_funct = $this->getLanguage($module_name, 'AM');
$language_table = $language_funct . strtoupper($table_name);
$ret = '';
- $table_id = $this->table->getVar('table_id');
- $criteria_fields = new CriteriaCompo();
- $criteria_fields->add(new Criteria('field_tid', $table_id));
- $fields_all = $this->tdmcreate->getHandler('fields')->getObjects($criteria_fields);
- unset($criteria_fields);
- foreach(array_keys($fields_all) as $f)
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
{
- $field_name = $fields_all[$f]->getVar('field_name');
- $field_element = $fields_all[$f]->getVar('field_element');
+ $field_name = $fields[$f]->getVar('field_name');
+ $field_element = $fields[$f]->getVar('field_element');
$language = $language_funct . strtoupper($field_name);
- $required = ( $fields_all[$f]->getVar('field_required') == 1 ) ? ', true' : '';
+ $required = ( $fields[$f]->getVar('field_required') == 1 ) ? ', true' : '';
//
switch($field_element)
{
@@ -341,10 +339,10 @@
break;
}
if ($field_element > 11) {
- if($this->table->getVar('table_category') == 1) {
- $ret .= $this->getXoopsFormTopic($language, $module_name, $table_name, $fields_all, $required);
+ if($table->getVar('table_category') == 1) {
+ $ret .= $this->getXoopsFormTopic($language, $module_name, $table_name, $fields, $required);
} else {
- $ret .= $this->getXoopsFormTable($language, $module_name, $table_name, $fields_all, $required);
+ $ret .= $this->getXoopsFormTable($language, $module_name, $table_name, $fields, $required);
}
}
}
|
|
From: <txm...@us...> - 2014-06-21 17:27:32
|
Revision: 12624
http://sourceforge.net/p/xoops/svn/12624
Author: txmodxoops
Date: 2014-06-21 17:27:22 +0000 (Sat, 21 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php
Modified: 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-06-21 17:07:35 UTC (rev 12623)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-06-21 17:27:22 UTC (rev 12624)
@@ -96,7 +96,7 @@
$content .= <<<EOT
\n\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/permissions.php';
-\$adminmenu[\$i]['icon'] = \$pathIcon32.'/permissions.png';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/permissions.png';
\$i++;
EOT;
}
@@ -104,7 +104,7 @@
$content .= <<<EOT
\n\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/about.php';
-\$adminmenu[\$i]['icon'] = \$pathIcon32.'/about.png';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/about.png';
unset( \$i );
EOT;
unset( $menu );
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-06-21 17:07:35 UTC (rev 12623)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-06-21 17:27:22 UTC (rev 12624)
@@ -186,7 +186,7 @@
public function getForm(\$action = false)
{
if (\$action === false) {
- \$action = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_ENCODED);
+ \$action = \$_SERVER['REQUEST_URI'];
}
\$title = \$this->isNew() ? sprintf({$language}{$stu_table_name}_ADD) : sprintf({$language}{$stu_table_name}_EDIT);
|
|
From: <txm...@us...> - 2014-06-21 18:15:44
|
Revision: 12625
http://sourceforge.net/p/xoops/svn/12625
Author: txmodxoops
Date: 2014-06-21 18:15:34 +0000 (Sat, 21 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php
Modified: 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-06-21 17:27:22 UTC (rev 12624)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-06-21 18:15:34 UTC (rev 12625)
@@ -80,16 +80,17 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesList($module_name, $table_name, $language, $fields, $fpif, $fpmf) {
+ public function getAdminPagesList($module_name, $table_name, $table_fieldname, $language, $fields, $fpif, $fpmf) {
$stu_mod_name = strtoupper($module_name);
$stl_mod_name = strtolower($module_name);
- $stu_table_name = strtoupper($table_name);
+ $stu_table_name = strtoupper($table_name);
+ $stu_table_fieldname = strtoupper($table_fieldname);
$ret = <<<EOT
case 'list':
default:
\$limit = xoops_getModuleOption('adminpager');
\$start = {$module_name}_CleanVars(\$_REQUEST, 'start', 0);
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$table_name}.php?op=new', 'add');
echo \$adminMenu->renderButton();
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
@@ -286,6 +287,7 @@
$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, 'AM');
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
@@ -300,7 +302,7 @@
}
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getAdminPagesHeader($module_name, $table_name);
- $content .= $this->getAdminPagesList($module_name, $table_name, $language, $fields, $fpif, $fpmf);
+ $content .= $this->getAdminPagesList($module_name, $table_name, $table_fieldname, $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);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php 2014-06-21 17:27:22 UTC (rev 12624)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php 2014-06-21 18:15:34 UTC (rev 12625)
@@ -61,7 +61,7 @@
public function getLanguageAdminIndex($language, $tables)
{
$ret = <<<EOT
-// ---------------- Index ----------------
+// ---------------- Admin Index ----------------
define('{$language}STATISTICS', "Statistics");
// There are\n
EOT;
@@ -73,7 +73,56 @@
$ret .= <<<EOT
define('{$language}THEREARE_{$stu_table_name}', "There are <span class='bold'>%s</span> {$stl_table_name} in the database");\n
EOT;
+ }
+ return $ret;
+ }
+ /*
+ * @public function getLanguageAdminPages
+ * @param string $language
+ * @param string $tables
+ */
+ public function getLanguageAdminPages($language, $tables)
+ {
+ $ret = <<<EOT
+// ---------------- Admin Files ----------------
+// There aren't\n
+EOT;
+ foreach (array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+
+ $stu_table_name = strtoupper($table_name);
+ $stl_table_name = strtolower($table_name);
+ $ret .= <<<EOT
+define('{$language}THEREARENT_{$stu_table_name}', "There aren't {$stl_table_name}");\n
+EOT;
}
+ $ret .= <<<EOT
+// Buttons\n
+EOT;
+ foreach (array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ $table_fieldname = $tables[$t]->getVar('table_fieldname');
+ $stu_table_fieldname = strtoupper($table_fieldname);
+ $ucf_table_fieldname = ucfirst($table_fieldname);
+ $ret .= <<<EOT
+define('{$language}ADD_{$stu_table_fieldname}', "Add {$ucf_table_fieldname}");\n
+EOT;
+ }
+ $ret .= <<<EOT
+// Lists\n
+EOT;
+ foreach (array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ $table_fieldname = $tables[$t]->getVar('table_fieldname');
+ $stu_table_name = strtoupper($table_name);
+ $ucf_table_name = ucfirst($table_name);
+ $ret .= <<<EOT
+define('{$language}{$stu_table_name}_LIST', "List of {$ucf_table_name}");\n
+EOT;
+ }
return $ret;
}
/*
@@ -84,7 +133,7 @@
public function getLanguageAdminClass($language, $tables)
{
$ret = <<<EOT
-// ---------------- Class ----------------\n
+// ---------------- Admin Classes ----------------\n
EOT;
foreach (array_keys($tables) as $t)
{
@@ -93,7 +142,7 @@
$stu_table_name = strtoupper($table_name);
$ucf_table_name = ucfirst($table_name);
$ret .= <<<EOT
-// {$ucf_table_name}
+// {$ucf_table_name} add
define('{$language}{$stu_table_name}_ADD', "Add {$table_name}");
define('{$language}{$stu_table_name}_EDIT', "Edit {$table_name}");
// Elements of {$ucf_table_name}\n
@@ -124,7 +173,7 @@
public function getLanguageAdminPermissions($language)
{
$ret = <<<EOT
-// ---------------- Admin ----------------
+// ---------------- Admin Permissions ----------------
// Permissions
define('{$language}GLOBAL', "Permissions global");
define('{$language}GLOBAL_DESC', "Permissions global");
@@ -164,6 +213,7 @@
$language = $this->getLanguage($module_name, 'AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getLanguageAdminIndex($language, $tables);
+ $content .= $this->getLanguageAdminPages($language, $tables);
$content .= $this->getLanguageAdminClass($language, $tables);
$content .= $this->getLanguageAdminPermissions($language);
$content .= $this->getLanguageAdminFoot();
|
|
From: <txm...@us...> - 2014-06-22 12:26:54
|
Revision: 12632
http://sourceforge.net/p/xoops/svn/12632
Author: txmodxoops
Date: 2014-06-22 12:26:45 +0000 (Sun, 22 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php 2014-06-22 09:57:53 UTC (rev 12631)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php 2014-06-22 12:26:45 UTC (rev 12632)
@@ -62,8 +62,9 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
include 'header.php';
-echo \$adminMenu->addNavigation('about.php');
-echo \$adminMenu->renderAbout('{$module_donations}', false);
+\$template_main = 'admin_about.tpl';
+\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('about.php'));
+\$GLOBALS['xoopsTpl']->assign('about', \$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);
Modified: 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-06-22 09:57:53 UTC (rev 12631)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php 2014-06-22 12:26:45 UTC (rev 12632)
@@ -76,6 +76,8 @@
EOT;
}
$content .= <<<EOT
+// Template Index
+\$template_main = 'admin_index.tpl';
// InfoBox Statistics
\$adminMenu->addInfoBox({$language}STATISTICS);
// InfoBox\n
Modified: 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-06-22 09:57:53 UTC (rev 12631)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-06-22 12:26:45 UTC (rev 12632)
@@ -91,6 +91,7 @@
\$limit = xoops_getModuleOption('adminpager');
\$start = {$module_name}_CleanVars(\$_REQUEST, 'start', 0);
\$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$table_name}.php?op=new', 'add');
+ \$template_main = 'admin_{$table_name}.tpl';
echo \$adminMenu->renderButton();
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
@@ -100,6 +101,7 @@
unset(\$criteria);
\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_url', {$stu_mod_name}_URL);
\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_upload_url', {$stu_mod_name}_UPLOAD_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$table_name}_list', true);
// Table view
if (\${$table_name}_rows > 0)
{
@@ -122,7 +124,7 @@
EOT;
}
$ret .= <<<EOT
- \$GLOBALS['xoopsTpl']->append('{$table_name}_list', \${$lp_field_name});
+ \$GLOBALS['xoopsTpl']->append('{$table_name}', \${$lp_field_name});
unset(\${$lp_field_name});
}
if ( \${$table_name}_rows > \$limit ) {
@@ -146,9 +148,11 @@
public function getAdminPagesNew($table_name, $language) {
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
- case 'new':
+ case 'new':
+ \$template_main = 'admin_{$table_name}.tpl';
\$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
+ \$GLOBALS['xoopsTpl']->append('{$table_name}_list', false);
// Get Form
\${$table_name}Obj =& \${$table_name}Handler->create();
\$form = \${$table_name}Obj->getForm();
@@ -226,9 +230,11 @@
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'edit':
+ \$template_main = 'admin_{$table_name}.tpl';
\$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();
+ \$GLOBALS['xoopsTpl']->assign('{$table_name}_list', false);
// Get Form
\${$table_name}Obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
\$form = \${$table_name}Obj->getForm();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php 2014-06-22 09:57:53 UTC (rev 12631)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/admin.php 2014-06-22 12:26:45 UTC (rev 12632)
@@ -209,9 +209,11 @@
* @public function getLanguageAdminFoot
* @param null
*/
- public function getLanguageAdminFoot()
+ public function getLanguageAdminFoot($language)
{
$ret = <<<EOT
+// ---------------- Admin Others ----------------
+define('{$language}MAINTAINEDBY', " is maintained by ");
// ---------------- ----------------
EOT;
return $ret;
@@ -231,7 +233,7 @@
$content .= $this->getLanguageAdminPages($language, $tables);
$content .= $this->getLanguageAdminClass($language, $tables);
$content .= $this->getLanguageAdminPermissions($language);
- $content .= $this->getLanguageAdminFoot();
+ $content .= $this->getLanguageAdminFoot($language);
//
$this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-22 09:57:53 UTC (rev 12631)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-22 12:26:45 UTC (rev 12632)
@@ -64,11 +64,11 @@
$table_fieldname = $table->getVar('table_fieldname');
//
$stu_module_name = strtoupper($module_name);
- $language = $this->getLanguage($module_name, 'MA');
+ $language = $this->getLanguage($module_name, 'AM');
$content = <<<EOT
<{include file="db:admin_header.tpl"}>
-<div class="outer">
- <table class="{$table_name} width100">
+<{if {$table_name}_list}>
+ <table class="outer {$table_name} width100">
<thead>
<tr class="head">\n
EOT;
@@ -83,7 +83,7 @@
}
$content .= <<<EOT
</tr>
- </thead>
+ </thead>
<tbody>
<{foreach item={$table_fieldname} from=\${$table_name}}>
<tr class="<{cycle values='odd, even'}>">\n
@@ -95,22 +95,26 @@
$rp_field_name = $field_name;
if(strpos($field_name, '_')) {
$str = strpos($field_name, '_');
- if($str !== false){
+ if($str !== false) {
$rp_field_name = substr($field_name, $str + 1, strlen($field_name));
}
}
- if( $field_element == 9 ) {
- $content .= <<<EOT
+ switch( $field_element ) {
+ case 9:
+ $content .= <<<EOT
<td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
- } elseif( $field_element == 8 ) {
- $content .= <<<EOT
+ break;
+ case 8:
+ $content .= <<<EOT
<td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
EOT;
- } else {
- $content .= <<<EOT
+ break;
+ default:
+ $content .= <<<EOT
<td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
EOT;
+ break;
}
}
$content .= <<<EOT
@@ -118,11 +122,22 @@
<{/foreach}>
</tbody>
</table>
-</div>
-<div class="outer">
- <div class="center">None</div>
- <br />
-</div>
+ <!-- Display modules navigation -->
+ <div class="clear"> </div>
+ <{if \$pagenav}><br /><div class="xo-pagenav floatright"><{\$pagenav}></div><div class="clear spacer"></div><{/if}>
+ <{if \$error}>
+ <div class="errorMsg">
+ <strong><{\$error}></strong>
+ </div>
+ <{/if}>
+<{else}>
+ <!-- Display form (add,edit) -->
+ <{if \$form}>
+ <div class="spacer"><{\$form}></div>
+ <{/if}>
+<{/if}>
+<br />
+<!-- Footer -->
<{include file="db:admin_footer.tpl"}>
EOT;
$this->tdmcfile->create($module_name, 'templates/admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-22 09:57:53 UTC (rev 12631)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-22 12:26:45 UTC (rev 12632)
@@ -69,7 +69,8 @@
<{include file="db:user_header.tpl"}>
<div class="outer">
<table class="{$module_name}">
- <tr class="head">\n
+ <thead>
+ <tr class="head">\n
EOT;
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
@@ -77,13 +78,15 @@
$field_name = $fields[$f]->getVar('field_name');
$lang_stu_field_name = $language.strtoupper($field_name);
$content .= <<<EOT
- <th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
+ <th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
EOT;
}
$content .= <<<EOT
- </tr>
- <{foreach item={$table_fieldname} from=\${$table_name}}>
- <tr class="<{cycle values='odd, even'}>">\n
+ </tr>
+ </thead>
+ <tbody>
+ <{foreach item={$table_fieldname} from=\${$table_name}}>
+ <tr class="<{cycle values='odd, even'}>">\n
EOT;
foreach(array_keys($fields) as $f)
{
@@ -98,21 +101,22 @@
}
if( $field_element == 9 ) {
$content .= <<<EOT
- <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
} elseif( $field_element == 8 ) {
$content .= <<<EOT
- <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
+ <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
EOT;
} else {
$content .= <<<EOT
- <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
+ <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
EOT;
}
}
$content .= <<<EOT
- </tr>
- <{/foreach}>
+ </tr>
+ <{/foreach}>
+ </tbody>
</table>
</div>
<div class="outer">
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-22 09:57:53 UTC (rev 12631)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-22 12:26:45 UTC (rev 12632)
@@ -261,6 +261,7 @@
$tables = $this->getTables();
$ret = <<<EOT
// Templates Admin
+\$modversion['templates'][] = array('file' => 'admin_about.tpl', 'description' => '', 'type' => 'admin');
\$modversion['templates'][] = array('file' => 'admin_header.tpl', 'description' => '', 'type' => 'admin');
\$modversion['templates'][] = array('file' => 'admin_index.tpl', 'description' => '', 'type' => 'admin');\n
EOT;
|
|
From: <txm...@us...> - 2014-06-22 13:04:01
|
Revision: 12633
http://sourceforge.net/p/xoops/svn/12633
Author: txmodxoops
Date: 2014-06-22 13:03:57 +0000 (Sun, 22 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-22 12:26:45 UTC (rev 12632)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-22 13:03:57 UTC (rev 12633)
@@ -76,7 +76,7 @@
public function getMenu($language, $tables) {
$menu = 1;
$ret = <<<EOT
-// Menu
+// Admin Menu
define('{$language}ADMENU{$menu}', "Dashboard");\n
EOT;
@@ -115,6 +115,29 @@
return $ret;
}
/*
+ * @public function getSubmenu
+ * @param string $language
+ * @param array $tables
+ */
+ public function getSubmenu($language, $tables) {
+ $ret = <<<EOT
+// Blocks\n
+EOT;
+ $i = 1;
+ foreach (array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ if ( $tables[$t]->getVar('table_submenu') == 1 ) {
+ $ret .= <<<EOT
+define('{$language}SMNAME{$i}', "{$table_name}");\n
+EOT;
+ }
+ $i++;
+ }
+ unset($i);
+ return $ret;
+ }
+ /*
* @public function getBlocks
* @param string $language
* @param array $tables
@@ -259,21 +282,20 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getMain($language, $module);
$content .= $this->getAdmin($language);
- $content .= $this->getUser($language);
- //if(is_object($tables)) {
- $content .= $this->getMenu($language, $tables);
- $content .= $this->getBlocks($language, $tables);
- //}
- if(is_object($table)) {
- $content .= $this->getConfig($language, $table);
- if ( $table->getVar('table_notifications') == 1 )
- {
- $content .= $this->getNotifications($language);
- }
- if ( $table->getVar('table_permissions') != 0 ) {
- $content .= $this->getPermissions($language);
- }
+ $content .= $this->getUser($language);
+ $content .= $this->getMenu($language, $tables);
+ $content .= $this->getBlocks($language, $tables);
+ if ( $table->getVar('table_submenu') == 1 ) {
+ $content .= $this->getSubmenu($language, $tables);
}
+ $content .= $this->getConfig($language, $table);
+ if ( $table->getVar('table_notifications') == 1 )
+ {
+ $content .= $this->getNotifications($language);
+ }
+ if ( $table->getVar('table_permissions') != 0 ) {
+ $content .= $this->getPermissions($language);
+ }
//
$this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-22 12:26:45 UTC (rev 12632)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-22 13:03:57 UTC (rev 12633)
@@ -301,6 +301,32 @@
return $ret;
}
/*
+ * @private function getXoopsVersionSubmenu
+ * @param string $language
+ */
+ private function getXoopsVersionSubmenu($language)
+ {
+ $ret = <<<EOT
+// Submenu list\n
+EOT;
+ $tables = $this->getTables();
+ $i = 1;
+ foreach (array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ if ( $tables[$t]->getVar('table_submenu') == 1 ) {
+ $ret .= <<<EOT
+// Sub {$table_name}
+\$modversion['sub'][{$i}]['name'] = {$language}SMNAME{$i};
+\$modversion['sub'][{$i}]['url'] = "{$table_name}.php";\n
+EOT;
+ }
+ $i++;
+ }
+ unset($i);
+ return $ret;
+ }
+ /*
* @private function getXoopsVersionBlocks
* @param string $module_name
* @param string $language
@@ -633,6 +659,9 @@
if($table->getVar('table_user') == 1) {
$content .= $this->getXoopsVersionTemplatesUser($module_name);
}
+ if ($table->getVar('table_submenu') == 1) {
+ $content .= $this->getXoopsVersionSubmenu($language);
+ }
if ($table->getVar('table_blocks') == 1) {
$content .= $this->getXoopsVersionBlocks($module_name, $language);
}
|
|
From: <txm...@us...> - 2014-06-23 09:56:45
|
Revision: 12636
http://sourceforge.net/p/xoops/svn/12636
Author: txmodxoops
Date: 2014-06-23 09:56:37 +0000 (Mon, 23 Jun 2014)
Log Message:
-----------
Pleace: You can test alpha 1 ???
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.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/pages.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-22 19:55:09 UTC (rev 12635)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-23 09:56:37 UTC (rev 12636)
@@ -55,15 +55,16 @@
* @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);
+ public function getBlocksShow($module_name, $table_name, $table_fieldname, $table_category, $fields, $fpif) {
+ $stu_module_name = strtoupper($module_name);
+ $stl_module_name = 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)
+function b_{$stl_module_name}_{$table_name}_show(\$options)
{
- include_once XOOPS_ROOT_PATH.'/modules/{$mod_name_lowercase}/class/{$table_name}.php';
+ include_once XOOPS_ROOT_PATH.'/modules/{$stl_module_name}/class/{$table_name}.php';
\$myts =& MyTextSanitizer::getInstance();
-
+ \$GLOBALS['xoopsTpl']->assign('{$stl_module_name}_upload_url', {$stu_module_name}_UPLOAD_URL);
\${$table_fieldname} = array();
\$type_block = \$options[0];
\$nb_{$table_name} = \$options[1];
@@ -78,7 +79,7 @@
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'));
+ \$criteria->add(new Criteria('{$table_fieldname}_category', {$module_name}_block_addCatSelect(\$options), 'IN'));
}\n
EOT;
}
@@ -97,11 +98,17 @@
EOT;
foreach(array_keys($fields) as $f)
{
- if( $fields[$f]->getVar('field_block') == 1 ) {
+ $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));
+ }
+ }
$ret .= <<<EOT
- \${$table_fieldname}['{$fpmf}'] = \${$table_name}_arr[\$i]->getVar('{$fpmf}');\n
+ \${$table_fieldname}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
EOT;
- }
}
$ret .= <<<EOT
}
@@ -119,12 +126,14 @@
* @param string $language
*/
public function getBlocksEdit($module_name, $table_name, $fpif, $fpmf, $language) {
- $mod_name_lowercase = strtolower($module_name);
+ $stu_module_name = strtoupper($module_name);
+ $stl_module_name = strtolower($module_name);
$ret = <<<EOT
-function b_{$mod_name_lowercase}_{$table_name}_edit(\$options)
+function b_{$stl_module_name}_{$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}');
+ include_once XOOPS_ROOT_PATH.'/modules/{$stl_module_name}/class/{$table_name}.php';
+ \${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
+ \$GLOBALS['xoopsTpl']->assign('{$stl_module_name}_upload_url', {$stu_module_name}_UPLOAD_URL);
\$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 />";
@@ -174,7 +183,7 @@
}
}
$content = $this->getHeaderFilesComments($module, $filename);
- $content .= $this->getBlocksShow($module_name, $table_name, $table_fieldname, $table_category, $fields, $fpif, $fpmf);
+ $content .= $this->getBlocksShow($module_name, $table_name, $table_fieldname, $table_category, $fields, $fpif);
$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);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-22 19:55:09 UTC (rev 12635)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-23 09:56:37 UTC (rev 12636)
@@ -99,15 +99,15 @@
$rp_field_name = substr($field_name, $str + 1, strlen($field_name));
}
}
- switch( $field_element ) {
- case 9:
+ switch( $field_element ) {
+ case 8:
$content .= <<<EOT
- <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
EOT;
break;
- case 8:
+ case 9:
$content .= <<<EOT
- <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
break;
default:
@@ -122,7 +122,7 @@
<{/foreach}>
</tbody>
</table>
- <!-- Display modules navigation -->
+ <!-- Display navigation -->
<div class="clear"> </div>
<{if \$pagenav}><br /><div class="xo-pagenav floatright"><{\$pagenav}></div><div class="clear spacer"></div><{/if}>
<{if \$error}>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php 2014-06-22 19:55:09 UTC (rev 12635)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php 2014-06-23 09:56:37 UTC (rev 12636)
@@ -59,14 +59,15 @@
public function renderFile($filename) {
$module = $this->getModule();
$table = $this->getTable();
- $module_name = $module->getVar('mod_name');
+ $module_name = strtolower($module->getVar('mod_name'));
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
//$filename = $this->getFileName();
- $language = $this->getLanguage($module_name, 'MA');
+ $language = $this->getLanguage($module_name, 'MB');
$content = <<<EOT
-<table class="{$table_name}" cellpadding="0" cellspacing="0" width="100%">
- <tr class="head">\n
+<table class="{$table_name} width100">
+ <thead>
+ <tr class="head">\n
EOT;
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
@@ -74,13 +75,15 @@
$field_name = $fields[$f]->getVar('field_name');
$lang_stu_field_name = $language.strtoupper($field_name);
$content .= <<<EOT
- <th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
+ <th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
EOT;
}
$content .= <<<EOT
- </tr>
- <{foreach item={$table_fieldname} from=\${$table_name}}>
- <tr class="<{cycle values=\'odd, even\'}>">\n
+ </tr>
+ </thead>
+ <tbody>
+ <{foreach item={$table_fieldname} from=\${$table_name}}>
+ <tr class="<{cycle values='odd, even'}>">\n
EOT;
foreach(array_keys($fields) as $f)
{
@@ -95,21 +98,24 @@
}
if( $field_element == 9 ) {
$content .= <<<EOT
- <td class="center"><img src="<{\$xoops_url}>/uploads/{$module_name}/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ <td class="center">
+ <img src="<{\${$module_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}">
+ </td>\n
EOT;
} elseif( $field_element == 8 ) {
$content .= <<<EOT
- <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
+ <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
EOT;
} else {
$content .= <<<EOT
- <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
+ <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
EOT;
}
}
$content .= <<<EOT
- </tr>
- <{/foreach}>
+ </tr>
+ <{/foreach}>
+ </tbody>
</table>
EOT;
$this->tdmcfile->create($module_name, 'templates/blocks', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-22 19:55:09 UTC (rev 12635)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-23 09:56:37 UTC (rev 12636)
@@ -67,10 +67,9 @@
$language = $this->getLanguage($module_name, 'MA');
$content = <<<EOT
<{include file="db:user_header.tpl"}>
-<div class="outer">
- <table class="{$module_name}">
- <thead>
- <tr class="head">\n
+<table class="{$module_name}">
+ <thead class="outer">
+ <tr class="head">\n
EOT;
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
@@ -78,15 +77,15 @@
$field_name = $fields[$f]->getVar('field_name');
$lang_stu_field_name = $language.strtoupper($field_name);
$content .= <<<EOT
- <th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
+ <th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
EOT;
}
$content .= <<<EOT
- </tr>
- </thead>
- <tbody>
- <{foreach item={$table_fieldname} from=\${$table_name}}>
- <tr class="<{cycle values='odd, even'}>">\n
+ </tr>
+ </thead>
+ <tbody>
+ <{foreach item={$table_fieldname} from=\${$table_name}}>
+ <tr class="<{cycle values='odd, even'}>">\n
EOT;
foreach(array_keys($fields) as $f)
{
@@ -99,30 +98,29 @@
$rp_field_name = substr($field_name, $str + 1, strlen($field_name));
}
}
- if( $field_element == 9 ) {
- $content .= <<<EOT
- <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ switch( $field_element ) {
+ case 8:
+ $content .= <<<EOT
+ <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
EOT;
- } elseif( $field_element == 8 ) {
- $content .= <<<EOT
- <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
+ break;
+ case 9:
+ $content .= <<<EOT
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
- } else {
- $content .= <<<EOT
- <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
+ break;
+ default:
+ $content .= <<<EOT
+ <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
EOT;
+ break;
}
}
$content .= <<<EOT
- </tr>
- <{/foreach}>
- </tbody>
- </table>
-</div>
-<div class="outer">
- <div class="center">None</div>
- <br />
-</div>\n
+ </tr>
+ <{/foreach}>
+ </tbody>
+</table>\n
EOT;
$content .= <<<EOT
<{include file="db:user_footer.tpl"}>
|
|
From: <txm...@us...> - 2014-06-25 08:46:27
|
Revision: 12646
http://sourceforge.net/p/xoops/svn/12646
Author: txmodxoops
Date: 2014-06-25 08:46:21 +0000 (Wed, 25 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-24 22:36:12 UTC (rev 12645)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-25 08:46:21 UTC (rev 12646)
@@ -122,12 +122,10 @@
if ( $table->getVar('table_blocks') == 1) {
// Creation of "blocks" folder and index.html file
$this->structure->makeDirAndCopyFile('blocks', $indexFile, 'index.html');
- }
- if ( $table->getVar('table_name') != null) {
- // Creation of "class" folder and index.html file
- $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
- }
+ }
}
+ // Creation of "class" folder and index.html file
+ $this->structure->makeDirAndCopyFile('class', $indexFile, 'index.html');
// Creation of "assets" folder and index.html file
$this->structure->makeDirAndCopyFile('assets', $indexFile, 'index.html');
// Creation of "css" folder and index.html file
@@ -265,7 +263,11 @@
$ret[] = $userTemplatesPages->renderFile($stl_mod_name.'_'.$table_name.'.tpl');
}
/*var_dump($table_name); */
- }
+ }
+ // Language Modinfo File
+ $languageModinfo = LanguageModinfo::getInstance();
+ $languageModinfo->write($module, $table, $tables, 'modinfo.php');
+ $ret[] = $languageModinfo->render();
// Creation of blocks language file
if (is_object($table)) {
if ( $table->getVar('table_blocks') == 1) {
@@ -274,10 +276,7 @@
$languageBlocks->write($module, $tables, 'blocks.php');
$ret[] = $languageBlocks->render();
}
- // Language Modinfo File
- $languageModinfo = LanguageModinfo::getInstance();
- $languageModinfo->write($module, $table, $tables, 'modinfo.php');
- $ret[] = $languageModinfo->render();
+
// Creation of admin files
if ( $table->getVar('table_admin') == 1) {
// Admin Header File
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-24 22:36:12 UTC (rev 12645)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-25 08:46:21 UTC (rev 12646)
@@ -73,7 +73,7 @@
* @param string $language
* @param array $tables
*/
- public function getMenu($language, $tables) {
+ public function getMenu($language, $table, $tables) {
$menu = 1;
$ret = <<<EOT
// Admin Menu
@@ -89,7 +89,7 @@
define('{$language}ADMENU{$menu}', "{$ucf_table_name}");\n
EOT;
}
- if ( $table_permissions != 0 ) {
+ if ( $table->getVar('table_permissions') == 1 ) {
$menu++;
$ret .= <<<EOT
define('{$language}ADMENU{$menu}', "Permissions");\n
@@ -283,19 +283,21 @@
$content .= $this->getMain($language, $module);
$content .= $this->getAdmin($language);
$content .= $this->getUser($language);
- $content .= $this->getMenu($language, $tables);
- $content .= $this->getBlocks($language, $tables);
- if ( $table->getVar('table_submenu') == 1 ) {
- $content .= $this->getSubmenu($language, $tables);
+ if (is_object($table)) {
+ if ( $table->getVar('table_submenu') == 1 ) {
+ $content .= $this->getSubmenu($language, $tables);
+ }
+ $content .= $this->getMenu($language, $table, $tables);
+ $content .= $this->getBlocks($language, $tables);
+ $content .= $this->getConfig($language, $table);
+ if ( $table->getVar('table_notifications') == 1 )
+ {
+ $content .= $this->getNotifications($language);
+ }
+ if ( $table->getVar('table_permissions') == 1 ) {
+ $content .= $this->getPermissions($language);
+ }
}
- $content .= $this->getConfig($language, $table);
- if ( $table->getVar('table_notifications') == 1 )
- {
- $content .= $this->getNotifications($language);
- }
- if ( $table->getVar('table_permissions') != 0 ) {
- $content .= $this->getPermissions($language);
- }
//
$this->tdmcfile->create($module_name, 'language/'.$GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
|
|
From: <txm...@us...> - 2014-06-25 19:02:43
|
Revision: 12647
http://sourceforge.net/p/xoops/svn/12647
Author: txmodxoops
Date: 2014-06-25 19:02:35 +0000 (Wed, 25 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Still work to do
Modified Paths:
--------------
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/pages.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/language/modinfo.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/index.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
Modified: 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-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -77,7 +77,7 @@
}
$content .= <<<EOT
// Template Index
-\$template_main = 'admin_index.tpl';
+\$template_main = '{$module_name}_index.tpl';
// InfoBox Statistics
\$adminMenu->addInfoBox({$language}STATISTICS);
// InfoBox\n
Modified: 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-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -65,7 +65,7 @@
$menu = 1;
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
-\n\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
\$module_handler =& xoops_gethandler('module');
\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid'));
@@ -75,7 +75,7 @@
\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/index.php';
\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/home.png';
-\$i++;
+\$i++;\n
EOT;
foreach (array_keys($tables) as $i)
{
@@ -84,25 +84,25 @@
{
$menu++;
$content .= <<<EOT
-\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/{$tables[$i]->getVar('table_name')}.php';
\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$i]->getVar('table_image')}';
-\$i++;
+\$i++;\n
EOT;
}
}
if( $table_permissions == 1 ) {
$menu++;
$content .= <<<EOT
-\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/permissions.php';
\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/permissions.png';
-\$i++;
+\$i++;\n
EOT;
}
$menu++;
$content .= <<<EOT
-\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/about.php';
\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/about.png';
unset( \$i );
Modified: 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-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -91,7 +91,7 @@
\$limit = xoops_getModuleOption('adminpager');
\$start = {$module_name}_CleanVars(\$_REQUEST, 'start', 0);
\$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$table_name}.php?op=new', 'add');
- \$template_main = 'admin_{$table_name}.tpl';
+ \$template_main = '{$stl_mod_name}_{$table_name}.tpl';
echo \$adminMenu->renderButton();
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
@@ -101,7 +101,6 @@
unset(\$criteria);
\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_url', {$stu_mod_name}_URL);
\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_upload_url', {$stu_mod_name}_UPLOAD_URL);
- \$GLOBALS['xoopsTpl']->assign('{$table_name}_list', true);
// Table view
if (\${$table_name}_rows > 0)
{
@@ -124,7 +123,7 @@
EOT;
}
$ret .= <<<EOT
- \$GLOBALS['xoopsTpl']->append('{$table_name}', \${$lp_field_name});
+ \$GLOBALS['xoopsTpl']->append('{$table_name}_list', \${$lp_field_name});
unset(\${$lp_field_name});
}
if ( \${$table_name}_rows > \$limit ) {
@@ -145,14 +144,14 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesNew($table_name, $language) {
+ public function getAdminPagesNew($module_name, $table_name, $language) {
+ $stl_mod_name = strtolower($module_name);
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
- case 'new':
- \$template_main = 'admin_{$table_name}.tpl';
+ case 'new':
+ \$template_main = '{$stl_mod_name}_{$table_name}.tpl';
\$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
- echo \$adminMenu->renderButton();
- \$GLOBALS['xoopsTpl']->append('{$table_name}_list', false);
+ echo \$adminMenu->renderButton();
// Get Form
\${$table_name}Obj =& \${$table_name}Handler->create();
\$form = \${$table_name}Obj->getForm();
@@ -226,15 +225,15 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesEdit($table_name, $language, $fpif) {
+ public function getAdminPagesEdit($module_name, $table_name, $language, $fpif) {
+ $stl_mod_name = strtolower($module_name);
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
- case 'edit':
- \$template_main = 'admin_{$table_name}.tpl';
+ case 'edit':
+ \$template_main = '{$stl_mod_name}_{$table_name}.tpl';
\$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();
- \$GLOBALS['xoopsTpl']->assign('{$table_name}_list', false);
+ echo \$adminMenu->renderButton();
// Get Form
\${$table_name}Obj = \${$table_name}Handler->get(\$_REQUEST['{$fpif}']);
\$form = \${$table_name}Obj->getForm();
@@ -309,9 +308,9 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getAdminPagesHeader($module_name, $table_name);
$content .= $this->getAdminPagesList($module_name, $table_name, $table_fieldname, $language, $fields, $fpif, $fpmf);
- $content .= $this->getAdminPagesNew($table_name, $language);
+ $content .= $this->getAdminPagesNew($module_name, $table_name, $language);
$content .= $this->getAdminPagesSave($module_name, $table_name, $language, $fields, $fpif, $fpmf);
- $content .= $this->getAdminPagesEdit($table_name, $language, $fpif);
+ $content .= $this->getAdminPagesEdit($module_name, $table_name, $language, $fpif);
$content .= $this->getAdminPagesDelete($table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -59,7 +59,8 @@
$stu_module_name = strtoupper($module_name);
$stl_module_name = strtolower($module_name);
$ret = <<<EOT
-include_once XOOPS_ROOT_PATH.'/modules/{$module_name}/include/functions.php';
+include_once XOOPS_ROOT_PATH.'/modules/{$stl_module_name}/include/common.php';
+include_once XOOPS_ROOT_PATH.'/modules/{$stl_module_name}/include/functions.php';
function b_{$stl_module_name}_{$table_name}_show(\$options)
{
include_once XOOPS_ROOT_PATH.'/modules/{$stl_module_name}/class/{$table_name}.php';
@@ -131,7 +132,7 @@
$ret = <<<EOT
function b_{$stl_module_name}_{$table_name}_edit(\$options)
{
- include_once XOOPS_ROOT_PATH.'/modules/{$stl_module_name}/class/{$table_name}.php';
+ include_once XOOPS_ROOT_PATH.'/modules/{$stl_module_name}/class/{$table_name}.php';
\${$table_name}Handler =& xoops_getModuleHandler('{$table_name}', '{$module_name}');
\$GLOBALS['xoopsTpl']->assign('{$stl_module_name}_upload_url', {$stu_module_name}_UPLOAD_URL);
\$form = {$language}DISPLAY;
@@ -146,7 +147,7 @@
\$criteria->setSort('{$fpif}');
\$criteria->setOrder('ASC');
\${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
- unset(\$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) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -280,7 +280,7 @@
*/
public function __construct(&\$db)
{
- parent::__construct(\$db, 'mod_{$module_name}_{$table_name}', '{$module_name}{$table_name}', '{$fpif}', '{$fpmf}');
+ parent::__construct(\$db, '{$module_name}_{$table_name}', '{$module_name}{$table_name}', '{$fpif}', '{$fpmf}');
}
}
EOT;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/language/modinfo.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -56,11 +56,11 @@
$this->setFileName($filename);
}
/*
- * @public function getMain
+ * @private function getMain
* @param string $language
* @param string $module
*/
- public function getMain($language, $module) {
+ private function getMain($language, $module) {
$ret = <<<EOT
// Main
define('{$language}NAME', "{$module->getVar('mod_name')}");
@@ -69,11 +69,11 @@
return $ret;
}
/*
- * @public function getMenu
+ * @private function getMenu
* @param string $language
* @param array $tables
*/
- public function getMenu($language, $table, $tables) {
+ private function getMenu($language, $table, $tables) {
$menu = 1;
$ret = <<<EOT
// Admin Menu
@@ -103,10 +103,10 @@
return $ret;
}
/*
- * @public function getAdmin
+ * @private function getAdmin
* @param string $language
*/
- public function getAdmin($language) {
+ private function getAdmin($language) {
$ret = <<<EOT
// Admin
define('{$language}ADMINPAGER', "Admin pager");
@@ -115,11 +115,11 @@
return $ret;
}
/*
- * @public function getSubmenu
+ * @private function getSubmenu
* @param string $language
* @param array $tables
*/
- public function getSubmenu($language, $tables) {
+ private function getSubmenu($language, $tables) {
$ret = <<<EOT
// Blocks\n
EOT;
@@ -138,11 +138,11 @@
return $ret;
}
/*
- * @public function getBlocks
+ * @private function getBlocks
* @param string $language
* @param array $tables
*/
- public function getBlocks($language, $tables) {
+ private function getBlocks($language, $tables) {
$ret = <<<EOT
// Blocks\n
EOT;
@@ -160,10 +160,10 @@
return $ret;
}
/*
- * @public function getUser
+ * @private function getUser
* @param string $language
*/
- public function getUser($language) {
+ private function getUser($language) {
$ret = <<<EOT
// User
define('{$language}USERPAGER', "User pager");
@@ -172,11 +172,11 @@
return $ret;
}
/*
- * @public function getConfig
+ * @private function getConfig
* @param string $language
* @param string $table_image
*/
- public function getConfig($language, $table) {
+ private function getConfig($language, $table) {
$ret = <<<EOT
// Config
define('{$language}EDITOR', "Editor");
@@ -206,11 +206,11 @@
return $ret;
}
/*
- * @public function getNotifications
+ * @private function getNotifications
* @param string $language
* @param mixed $table
*/
- public function getNotifications($language) {
+ private function getNotifications($language) {
$ret = <<<EOT
// Notifications
define('{$language}GLOBAL_NOTIFY', "Allow Facebook comments in the form");
@@ -255,10 +255,10 @@
return $ret;
}
/*
- * @public function getPermissions
+ * @private function getPermissions
* @param string $language
*/
- public function getPermissions($language) {
+ private function getPermissions($language) {
$ret = <<<EOT
// Permissions Groups
define('{$language}GROUPS', "Groups access");
@@ -281,9 +281,13 @@
$language = $this->getLanguage($module_name, 'MI');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getMain($language, $module);
- $content .= $this->getAdmin($language);
- $content .= $this->getUser($language);
if (is_object($table)) {
+ if ( $table->getVar('table_admin') == 1 ) {
+ $content .= $this->getAdmin($language);
+ }
+ if ( $table->getVar('table_user') == 1 ) {
+ $content .= $this->getUser($language);
+ }
if ( $table->getVar('table_submenu') == 1 ) {
$content .= $this->getSubmenu($language, $tables);
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -85,7 +85,7 @@
</tr>
</thead>
<tbody>
- <{foreach item={$table_fieldname} from=\${$table_name}}>
+ <{foreach item={$table_fieldname} from=\${$table_name}_list}>
<tr class="<{cycle values='odd, even'}>">\n
EOT;
foreach(array_keys($fields) as $f)
@@ -121,20 +121,21 @@
</tr>
<{/foreach}>
</tbody>
- </table>
- <!-- Display navigation -->
+ </table>
<div class="clear"> </div>
- <{if \$pagenav}><br /><div class="xo-pagenav floatright"><{\$pagenav}></div><div class="clear spacer"></div><{/if}>
+ <{if \$pagenav}><br />
+ <!-- Display navigation -->
+ <div class="xo-pagenav floatright"><{\$pagenav}></div><div class="clear spacer"></div>
+ <{/if}>
<{if \$error}>
- <div class="errorMsg">
- <strong><{\$error}></strong>
- </div>
+ <div class="errorMsg">
+ <strong><{\$error}></strong>
+ </div>
<{/if}>
-<{else}>
+<{/if}>
+<{if \$form}>
<!-- Display form (add,edit) -->
- <{if \$form}>
<div class="spacer"><{\$form}></div>
- <{/if}>
<{/if}>
<br />
<!-- Footer -->
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/index.php 2014-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/index.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -64,7 +64,7 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\ninclude_once 'header.php';
-\$xoopsOption['template_main'] = 'user_index.tpl';
+\$xoopsOption['template_main'] = '{$stl_mod_name}_index.tpl';
include_once XOOPS_ROOT_PATH.'/header.php';
// Define Stylesheet
\$xoTheme->addStylesheet( \$style );
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php 2014-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -129,7 +129,7 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
\ninclude_once 'header.php';
-\$xoopsOption['template_main'] = 'user_{$table_name}.tpl';
+\$xoopsOption['template_main'] = '{$stl_mod_name}_{$table_name}.tpl';
include_once XOOPS_ROOT_PATH . '/header.php';
\$start = {$stl_mod_name}_CleanVars( \$_REQUEST, 'start', 0);
\$limit = xoops_getModuleOption('userpager', \$dirname);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-25 08:46:21 UTC (rev 12646)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-25 19:02:35 UTC (rev 12647)
@@ -202,7 +202,7 @@
foreach (array_keys($tables) as $t)
{
$ret .= <<<EOT
-\$modversion['tables'][{$n}] = "mod_{$stl_mod_name}_{$tables[$t]->getVar('table_name')}";\n
+\$modversion['tables'][{$n}] = "{$stl_mod_name}_{$tables[$t]->getVar('table_name')}";\n
EOT;
$n++;
}
@@ -221,7 +221,7 @@
$ret = '';
if ( $module->getVar('mod_search') == 1 ) {
$ret .= <<<EOT
-//Search
+// Search
\$modversion['hasSearch'] = 1;
\$modversion['search']['file'] = "include/search.inc.php";
\$modversion['search']['func'] = "{$stl_mod_name}_search";\n
@@ -367,7 +367,10 @@
$module_name = $module->getVar('mod_name');
$stl_mod_name = strtolower($module_name);
$ret = <<<EOT
-// Config
+// ------------------- Config -------------------\n
+EOT;
+ $ret .= <<<EOT
+// Editor
xoops_load('xoopseditorhandler');
\$editor_handler = XoopsEditorHandler::getInstance();
\$modversion['config'][] = array(
@@ -414,7 +417,7 @@
'default' => \$admin_groups);\n\n
EOT;
}
- $key = implode(', ', $this->getKeywords());
+ $keyword = implode(', ', $this->getKeywords());
$ret .= <<<EOT
\$modversion['config'][] = array(
'name' => "keywords",
@@ -422,7 +425,7 @@
'description' => "{$language}KEYWORDS_DESC",
'formtype' => "textbox",
'valuetype' => "text",
- 'default' => "{$stl_mod_name}, {$key}");\n
+ 'default' => "{$stl_mod_name}, {$keyword}");\n
EOT;
unset($this->keywords);
if ($table->getVar('table_name') != '')
|
|
From: <txm...@us...> - 2014-06-26 10:30:30
|
Revision: 12648
http://sourceforge.net/p/xoops/svn/12648
Author: txmodxoops
Date: 2014-06-26 10:30:26 +0000 (Thu, 26 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php 2014-06-25 19:02:35 UTC (rev 12647)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/about.php 2014-06-26 10:30:26 UTC (rev 12648)
@@ -62,7 +62,7 @@
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
include 'header.php';
-\$template_main = 'admin_about.tpl';
+\$template_main = '{$module_name}_about.tpl';
\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('about.php'));
\$GLOBALS['xoopsTpl']->assign('about', \$adminMenu->renderAbout('{$module_donations}', false));
include 'footer.php';
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-25 19:02:35 UTC (rev 12647)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-26 10:30:26 UTC (rev 12648)
@@ -31,7 +31,8 @@
* @public function constructor
* @param null
*/
- public function __construct() {
+ public function __construct() {
+ parent::__construct();
$this->tdmcfile = TDMCreateFile::getInstance();
}
/*
@@ -352,7 +353,6 @@
'options' => "{$tables[$i]->getVar('table_fieldname')}|5|25|0",
'template' => "'{$stl_mod_name}_block_{$table_name}.tpl");\n\n
EOT;
- $this->setKeywords($table_name);
}
}
return $ret;
@@ -369,7 +369,13 @@
$ret = <<<EOT
// ------------------- Config -------------------\n
EOT;
- $ret .= <<<EOT
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach (array_keys($fields) as $f)
+ {
+ $field_element = $fields[$f]->getVar('field_element');
+ }
+ if( $field_element == 3 ) {
+ $ret .= <<<EOT
// Editor
xoops_load('xoopseditorhandler');
\$editor_handler = XoopsEditorHandler::getInstance();
@@ -382,6 +388,7 @@
'options' => array_flip(\$editor_handler->getList()),
'default' => "dhtml");\n\n
EOT;
+ }
if ( $module->getVar('mod_permissions') == 1 ) {
$ret .= <<<EOT
// Get groups
|
|
From: <txm...@us...> - 2014-06-28 09:56:03
|
Revision: 12660
http://sourceforge.net/p/xoops/svn/12660
Author: txmodxoops
Date: 2014-06-28 09:55:59 +0000 (Sat, 28 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.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/include/comment_functions.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/install.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php 2014-06-27 15:47:48 UTC (rev 12659)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php 2014-06-28 09:55:59 UTC (rev 12660)
@@ -95,9 +95,9 @@
* @param mixed $tables
*/
public function setTables($tables) {
- //if (is_object($tables) && ($tables instanceof TDMCreateTables)) {
+ if (is_array($tables)) {
$this->tables = $tables;
- //}
+ }
}
/*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/permissions.php 2014-06-27 15:47:48 UTC (rev 12659)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/permissions.php 2014-06-28 09:55:59 UTC (rev 12660)
@@ -55,11 +55,11 @@
$this->setTables($tables);
}
/*
- * @public function render
+ * @private function getPermissionsCodeHeader
* @param string $module_name
* @param string $language
*/
- public function getHeaderPermissionsCode($module_name, $language)
+ private function getPermissionsCodeHeader($module_name, $language)
{
$ret = <<<PRM
\ninclude_once 'header.php';
@@ -77,12 +77,13 @@
echo \$adminMenu->addNavigation('permissions.php');
-\$permission = {$module_name}_CleanVars(\$_POST, 'permission', 1, 'int');
+\$permission = {$module_name}_CleanVars(\$_REQUEST, '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()');
+xoops_load('XoopsFormLoader');
+\$permTableForm = new XoopsSimpleForm('', 'fselperm', 'permissions.php', 'get');
+\$formSelect = new XoopsFormSelect('', 'permission', \$permission);
+\$formSelect->setExtra('onchange="document.forms.fselperm.submit()"');
\$formSelect->addOption(\$selected[0], {$language}GLOBAL);
\$formSelect->addOption(\$selected[1], {$language}APPROVE);
\$formSelect->addOption(\$selected[2], {$language}SUBMIT);
@@ -94,11 +95,11 @@
}
/*
- * @public function render
+ * @private function getPermissionsCodeSwitch
* @param string $module_name
* @param string $language
*/
- public function getSwitchPermissionsCode($module_name, $language)
+ private function getPermissionsCodeSwitch($module_name, $language)
{
$ret = <<<PRM
\$module_id = \$xoopsModule->getVar('mid');
@@ -133,12 +134,12 @@
}
/*
- * @public function render
+ * @private function getPermissionsCodeBody
* @param string $module_name
* @param string $table_name
* @param string $language
*/
- public function getBodyPermissionsCode($module_name, $language)
+ private function getPermissionsCodeBody($module_name, $language)
{
$tables = $this->getTables();
foreach(array_keys($tables) as $t)
@@ -189,10 +190,10 @@
}
/*
- * @public function getFooterPermissionsCode
+ * @private function getPermissionsCodeFooter
* @param null
*/
- public function getFooterPermissionsCode() {
+ private function getPermissionsCodeFooter() {
$ret = <<<PRM
}
unset(\$permform);
@@ -211,10 +212,10 @@
$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();
+ $content .= $this->getPermissionsCodeHeader($module_name, $language);
+ $content .= $this->getPermissionsCodeSwitch($module_name, $language);
+ $content .= $this->getPermissionsCodeBody($module_name, $language);
+ $content .= $this->getPermissionsCodeFooter();
//
$this->tdmcfile->create($module_name, 'admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-27 15:47:48 UTC (rev 12659)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-28 09:55:59 UTC (rev 12660)
@@ -350,7 +350,7 @@
}
// Include Install File
$includeInstall = IncludeInstall::getInstance();
- $includeInstall->write($module, $tables, 'install.php');
+ $includeInstall->write($module, $table, $tables, 'install.php');
$ret[] = $includeInstall->render();
// Creation of sql file
if ( $table->getVar('table_name') != null) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/comment_functions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/comment_functions.php 2014-06-27 15:47:48 UTC (rev 12659)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/comment_functions.php 2014-06-28 09:55:59 UTC (rev 12660)
@@ -64,6 +64,7 @@
$table_name = $table->getVar('table_name');
$ucf_module_name = ucfirst($module_name);
$ucf_table_name = ucfirst($table_name);
+ $filename = $this->getFileName();
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
defined('XOOPS_ROOT_PATH') or die('Restricted access');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/install.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/install.php 2014-06-27 15:47:48 UTC (rev 12659)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/include/install.php 2014-06-28 09:55:59 UTC (rev 12660)
@@ -48,112 +48,159 @@
* @param mixed $tables
* @param string $filename
*/
- public function write($module, $tables, $filename) {
+ public function write($module, $table, $tables, $filename) {
$this->setModule($module);
+ $this->setTable($table);
$this->setTables($tables);
$this->setFileName($filename);
}
/*
- * @private function getHeaderInstall
+ * @private function getInstallModuleFolder
* @param string $module_name
*/
- private function getHeaderInstall($module_name) {
+ private function getInstallModuleFolder($module_name) {
$ret = <<<EOT
+//
defined('XOOPS_ROOT_PATH') or die('Restricted access');
+// Copy base file
\$indexFile = XOOPS_UPLOAD_PATH.'/index.html';
\$blankFile = XOOPS_UPLOAD_PATH.'/blank.gif';
-
// Making of "uploads/{$module_name}" folder
\${$module_name} = XOOPS_UPLOAD_PATH.'/{$module_name}';
if(!is_dir(\${$module_name}))
mkdir(\${$module_name}, 0777);
chmod(\${$module_name}, 0777);
-copy(\$indexFile, \${$module_name}.'/index.html');
+copy(\$indexFile, \${$module_name}.'/index.html');\n
EOT;
return $ret;
}
/*
- * @public function render
- * @param null
+ * @private function getHeaderTableFolder
+ * @param string $module_name
+ * @param string $table_name
*/
- public function render()
- {
- $module = $this->getModule();
- $module_name = strtolower($module->getVar('mod_name'));
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-\$indexFile = XOOPS_UPLOAD_PATH.'/index.html';
-\$blankFile = XOOPS_UPLOAD_PATH.'/blank.gif';
-
-// Making of "uploads/{$module_name}" folder
-\${$module_name} = XOOPS_UPLOAD_PATH.'/{$module_name}';
-if(!is_dir(\${$module_name}))
- mkdir(\${$module_name}, 0777);
- chmod(\${$module_name}, 0777);
-copy(\$indexFile, \${$module_name}.'/index.html');
-EOT;
- $field_element = '';
- foreach (array_keys($tables) as $t)
- {
- $table_name = $tables[$t]->getVar('table_name');
- $fields = $this->getTableFields($tables[$t]->getVar('table_id'));
- foreach(array_keys($fields) as $f)
- {
- $field_name = $fields[$f]->getVar('field_name');
- if ( ($f > 0) && ($tables[$t]->getVar('table_autoincrement') == 1) ) {
- $field_element = $fields[$f]->getVar('field_element');
- }
- if ( $f == 0 ) {
- $content .= <<<EOT
-\n// Making of {$table_name} uploads folder
+ private function getInstallTableFolder($module_name, $table_name) {
+ $ret = <<<EOT
+// Making of {$table_name} uploads folder
\${$table_name} = \${$module_name}.'/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
chmod(\${$table_name}, 0777);
copy(\$indexFile, \${$table_name}.'/index.html');\n
EOT;
- } else {
- if ( $field_element == 9 ) {
- $content .= <<<EOT
-// Making of "{$field_name}" images folder
-\${$table_name} = \${$module_name}.'/images';
+ return $ret;
+ }
+ /*
+ * @private function getInstallImagesFolder
+ * @param string $module_name
+ */
+ private function getInstallImagesFolder($module_name) {
+ $ret = <<<EOT
+// Making of images folder
+\$images = \${$module_name}.'/images';
+if(!is_dir(\$images))
+ mkdir(\$images, 0777);
+ chmod(\$images, 0777);
+copy(\$indexFile, \$images.'/index.html');
+copy(\$blankFile, \$images.'/blank.gif');\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getInstallTableImagesFolder
+ * @param string $table_name
+ */
+ private function getInstallTableImagesFolder($table_name) {
+ $ret = <<<EOT
+// Making of "{$table_name}" images folder
+\${$table_name} = \$images.'/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
chmod(\${$table_name}, 0777);
copy(\$indexFile, \${$table_name}.'/index.html');
-copy(\$blankFile, \${$table_name}.'/blank.gif');
-
-// Making of "{$field_name}" images folder
-\${$table_name} = \${$module_name}.'/images/{$table_name}';
-if(!is_dir(\${$table_name}))
- mkdir(\${$table_name}, 0777);
- chmod(\${$table_name}, 0777);
-copy(\$indexFile, \${$table_name}.'/index.html');
-copy(\$blankFile, \${$table_name}.'/blank.gif');
+copy(\$blankFile, \${$table_name}.'/blank.gif');\n
EOT;
- } elseif ( $field_element == 10 ) {
- $content .= <<<EOT
-// Making of "{$field_name}" files folder
-\${$table_name} = \${$module_name}.'/files';
+ return $ret;
+ }
+ /*
+ * @private function getInstallFilesFolder
+ * @param string $module_name
+ */
+ private function getInstallFilesFolder($module_name) {
+ $ret = <<<EOT
+// Making of files folder
+\$files = \${$module_name}.'/files';
+if(!is_dir(\$files))
+ mkdir(\$files, 0777);
+ chmod(\$files, 0777);
+copy(\$indexFile, \$files.'/index.html');\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getInstallTableFilesFolder
+ * @param string $table_name
+ */
+ private function getInstallTableFilesFolder($table_name) {
+ $ret = <<<EOT
+// Making of "{$table_name}" files folder
+\${$table_name} = \$files.'/{$table_name}';
if(!is_dir(\${$table_name}))
mkdir(\${$table_name}, 0777);
chmod(\${$table_name}, 0777);
-copy(\$indexFile, \${$table_name}.'/index.html');
-
-// Making of "{$field_name}" files folder
-\${$table_name} = \${$module_name}.'/files/{$table_name}';
-if(!is_dir(\${$table_name}))
- mkdir(\${$table_name}, 0777);
- chmod(\${$table_name}, 0777);
-copy(\$indexFile, \${$table_name}.'/index.html');
+copy(\$indexFile, \${$table_name}.'/index.html');\n
EOT;
- }
- }
+ return $ret;
+ }
+ /*
+ * @private function getInstallFooter
+ * @param null
+ */
+ private function getInstallFooter() {
+ $ret = <<<EOT
+// ---------- Install Footer ---------- //
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render()
+ {
+ $module = $this->getModule();
+ $module_name = strtolower($module->getVar('mod_name'));
+ $table = $this->getTable();
+ $tables = $this->getTables();
+ $filename = $this->getFileName();
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getInstallModuleFolder($module_name);
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
+ {
+ $field_element = $fields[$f]->getVar('field_element');
+ // All fields elements selected
+ switch( $field_element ) {
+ case 9:
+ $content .= $this->getInstallImagesFolder($module_name);
+ foreach(array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ $content .= $this->getInstallTableImagesFolder($table_name);
+ }
+ break;
+ case 10:
+ $content .= $this->getInstallFileFolder($module_name);
+ foreach(array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ $content .= $this->getInstallTableFilesFolder($table_name);
+ }
+ break;
}
- }
+ }
+ $content .= $this->getInstallFooter();
+ //
$this->tdmcfile->create($module_name, 'include', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-27 15:47:48 UTC (rev 12659)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-06-28 09:55:59 UTC (rev 12660)
@@ -129,8 +129,8 @@
'dirmoduleadmin' => "Frameworks/moduleclasses/moduleadmin",
'sysicons16' => "../../Frameworks/moduleclasses/icons/16",
'sysicons32' => "../../Frameworks/moduleclasses/icons/32",
- 'modicons16' => 'assets/images/icons/16',
- 'modicons32' => 'assets/images/icons/32',
+ 'modicons16' => "assets/images/icons/16",
+ 'modicons32' => "assets/images/icons/32",
//About
'demo_site_url' => "{$module->getVar('mod_demo_site_url')}",
'demo_site_name' => "{$module->getVar('mod_demo_site_name')}",
@@ -139,19 +139,12 @@
'module_website_url' => "{$module->getVar('mod_website_url')}",
'module_website_name' => "{$module->getVar('mod_website_name')}",
'release' => "{$module->getVar('mod_release')}",
- 'module_status' => "{$module->getVar('mod_status')}",
- // Admin system menu
- 'system_menu' => 1,\n
+ 'module_status' => "{$module->getVar('mod_status')}",\n
EOT;
- if(is_object($table)) {
- $table_admin = $table->getVar('table_admin');
- $table_user = $table->getVar('table_user');
- } else {
- $table_admin = null;
- $table_user = null;
- }
- if ( $module->getVar('mod_admin') == 1 && $table_admin == 1 ) {
+ if ( $table->getVar('table_admin') == 1 ) {
$ret .= <<<EOT
+ // Admin system menu
+ 'system_menu' => 1,
// Admin things
'hasAdmin' => 1,
'adminindex' => "admin/index.php",
@@ -165,22 +158,24 @@
'hasAdmin' => 0,\n
EOT;
}
- if ( $module->getVar('mod_user') == 1 && $table_user == 1 ) {
+ if ( $table->getVar('table_user') == 1 )
+ {
$ret .= <<<EOT
// Menu
- 'hasMain' => 1,
- // Scripts to run upon installation or update
- 'onInstall' => "include/install.php",
- 'onUpdate' => "include/update.php"
-);\n
+ 'hasMain' => 1,\n
EOT;
} else {
$ret .= <<<EOT
// Menu
- 'hasMain' => 0
+ 'hasMain' => 0,\n
+EOT;
+ }
+ $ret .= <<<EOT
+ // Install/Update
+ 'onInstall' => "include/install.php",
+ 'onUpdate' => "include/update.php"
);\n
EOT;
- }
return $ret;
}
/*
@@ -219,15 +214,12 @@
{
$module_name = $module->getVar('mod_name');
$stl_mod_name = strtolower($module_name);
- $ret = '';
- if ( $module->getVar('mod_search') == 1 ) {
- $ret .= <<<EOT
+ $ret = <<<EOT
// Search
\$modversion['hasSearch'] = 1;
\$modversion['search']['file'] = "include/search.inc.php";
\$modversion['search']['func'] = "{$stl_mod_name}_search";\n
EOT;
- }
return $ret;
}
/*
@@ -238,9 +230,7 @@
{
$module_name = $module->getVar('mod_name');
$stl_mod_name = strtolower($module_name);
- $ret = '';
- if ( $module->getVar('mod_comments') == 1 ) {
- $ret .= <<<EOT
+ $ret = <<<EOT
// Comments
\$modversion['comments']['pageName'] = "comments.php";
\$modversion['comments']['itemName'] = "com_id";
@@ -249,7 +239,6 @@
\$modversion['comments']['callback']['approve'] = "{$stl_mod_name}_com_approve";
\$modversion['comments']['callback']['update'] = "{$stl_mod_name}_com_update";\n
EOT;
- }
return $ret;
}
/*
@@ -435,7 +424,7 @@
'default' => "{$stl_mod_name}, {$keyword}");\n
EOT;
unset($this->keywords);
- if ($table->getVar('table_name') != '')
+ if( $field_element == 9 )
{
$ret .= <<<EOT
\n//Uploads : maxsize of image
@@ -518,24 +507,22 @@
{
$module_name = $module->getVar('mod_name');
$stl_mod_name = strtolower($module_name);
- $ret = '';
- if ( $module->getVar('mod_notifications') == 1 )
- {
- $notify_file = '';
- $tables = $this->getTables();
- foreach (array_keys($tables) as $i)
- {
- $table_name = $tables[$i]->getVar('table_name');
- $count = count($table_name);
- if($tables[$i]->getVar('table_notifications') == 1) {
- if($i <= $count) {
- $notify_file .= "'".$table_name.".php', ";
- } else {
- $notify_file .= "'".$table_name.".php'";
- }
+ $ret = '';
+ $notify_file = '';
+ $tables = $this->getTables();
+ foreach(array_keys($tables) as $t)
+ {
+ $table_name = $tables[$t]->getVar('table_name');
+ $count = count($table_name);
+ if($tables[$t]->getVar('table_notifications') == 1) {
+ if($t <= $count) {
+ $notify_file .= "'".$table_name.".php', ";
+ } else {
+ $notify_file .= "'".$table_name.".php'";
}
- }
- $ret .= <<<EOT
+ }
+ }
+ $ret .= <<<EOT
\n// Notifications {$stl_mod_name}
\$modversion['hasNotification'] = 1;
\$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
@@ -640,7 +627,6 @@
'mail_template' => "file_approve_notify",
'mail_subject' => {$language}FILE_APPROVE_NOTIFY_SUBJECT);
EOT;
- }
return $ret;
}
@@ -664,9 +650,9 @@
if ($table->getVar('table_comments') == 1) {
$content .= $this->getXoopsVersionComments($module);
}
- if($table->getVar('table_admin') == 1) {
+ /*if($table->getVar('table_admin') == 1) {
$content .= $this->getXoopsVersionTemplatesAdmin($module_name);
- }
+ }*/
if($table->getVar('table_user') == 1) {
$content .= $this->getXoopsVersionTemplatesUser($module_name);
}
|
|
From: <txm...@us...> - 2014-06-28 14:04:37
|
Revision: 12661
http://sourceforge.net/p/xoops/svn/12661
Author: txmodxoops
Date: 2014-06-28 14:04:32 +0000 (Sat, 28 Jun 2014)
Log Message:
-----------
- Fixed bugs for field_name empty
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.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/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php
Modified: 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-06-28 09:55:59 UTC (rev 12660)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-06-28 14:04:32 UTC (rev 12661)
@@ -111,21 +111,31 @@
{
$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
+ // Verify if table_fieldname is not empty
+ if(!empty($table_fieldname)) {
+ 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;
+ } else {
+ $lp_field_name = $table_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});
- }
+ }\n
+EOT;
+ $ret .= <<<EOT
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);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-28 09:55:59 UTC (rev 12660)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/blocks.php 2014-06-28 14:04:32 UTC (rev 12661)
@@ -101,15 +101,24 @@
{
$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));
- }
+ // Verify if table_fieldname is not empty
+ if(!empty($table_fieldname)) {
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false){
+ $rp_field_name = substr($field_name, $str + 1, strlen($field_name));
+ }
+ }
+ $tname = $table_fieldname;
+ $ret .= <<<EOT
+ \${$tname}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
+EOT;
+ } else {
+ $tname = $table_name;
+ $ret .= <<<EOT
+ \${$tname}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
+EOT;
}
- $ret .= <<<EOT
- \${$table_fieldname}['{$rp_field_name}'] = \${$table_name}_arr[\$i]->getVar('{$field_name}');\n
-EOT;
}
$ret .= <<<EOT
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-28 09:55:59 UTC (rev 12660)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-28 14:04:32 UTC (rev 12661)
@@ -52,20 +52,15 @@
$this->setTable($table);
}
/*
- * @public function render
- * @param null
+ * @private function getTemplatesAdminPagesHeader
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
*/
- public function renderFile($filename) {
- $module = $this->getModule();
- $table = $this->getTable();
- $module_name = $module->getVar('mod_name');
- $stl_mod_name = strtolower($module_name);
+ private function getTemplatesAdminPagesHeader($module_name, $table, $language) {
+ $stl_mod_name = strtolower($module_name);
$table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- //
- $stu_module_name = strtoupper($module_name);
- $language = $this->getLanguage($module_name, 'AM');
- $content = <<<EOT
+ $ret = <<<EOT
<{include file="db:{$stl_mod_name}_header.tpl"}>
<{if {$table_name}_list}>
<table class="outer {$table_name} width100">
@@ -77,17 +72,32 @@
{
$field_name = $fields[$f]->getVar('field_name');
$lang_fn = $language.strtoupper($field_name);
- $content .= <<<EOT
+ $ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
EOT;
}
- $content .= <<<EOT
+ $ret .= <<<EOT
</tr>
- </thead>
+ </thead>\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getTemplatesAdminPagesBody
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
+ */
+ private function getTemplatesAdminPagesBody($module_name, $table, $language)
+ {
+ $stl_mod_name = strtolower($module_name);
+ $table_name = $table->getVar('table_name');
+ $ret = <<<EOT
<tbody>
- <{foreach item={$table_fieldname} from=\${$table_name}_list}>
+ <{foreach item=list from=\${$table_name}_list}>
<tr class="<{cycle values='odd, even'}>">\n
EOT;
+ $fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
$field_name = $fields[$f]->getVar('field_name');
@@ -101,27 +111,83 @@
}
switch( $field_element ) {
case 8:
- $content .= <<<EOT
- <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
+ $ret .= <<<EOT
+ <td class="center"><span style="background-color: <{\$list.{$rp_field_name}}>;"> </span></td>\n
EOT;
break;
case 9:
- $content .= <<<EOT
- <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ $ret .= <<<EOT
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\$list.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
break;
default:
- $content .= <<<EOT
- <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
+ $ret .= <<<EOT
+ <td class="center"><{\$list.{$rp_field_name}}></td>\n
EOT;
break;
}
}
- $content .= <<<EOT
+ $ret .= <<<EOT
</tr>
<{/foreach}>
</tbody>
- </table>
+ </table>\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getTemplatesAdminPagesBodyFieldnameEmpty
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
+ */
+ private function getTemplatesAdminPagesBodyFieldnameEmpty($module_name, $table, $language)
+ {
+ $stl_mod_name = strtolower($module_name);
+ $table_name = $table->getVar('table_name');
+ $ret = <<<EOT
+ <tbody>
+ <{foreach item=list from=\${$table_name}_list}>
+ <tr class="<{cycle values='odd, even'}>">\n
+EOT;
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
+ {
+ $field_name = $fields[$f]->getVar('field_name');
+ $field_element = $fields[$f]->getVar('field_element');
+ switch( $field_element ) {
+ case 8:
+ $ret .= <<<EOT
+ <td class="center"><span style="background-color: <{\$list.{$field_name}}>;">\t\t</span></td>\n
+EOT;
+ break;
+ case 9:
+ $ret .= <<<EOT
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\$list.{$field_name}}>" alt="{$table_name}"></td>\n
+EOT;
+ break;
+ default:
+ $ret .= <<<EOT
+ <td class="center"><{\$list.{$field_name}}></td>\n
+EOT;
+ break;
+ }
+ }
+ $ret .= <<<EOT
+ </tr>
+ <{/foreach}>
+ </tbody>
+ </table>\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getTemplatesAdminPagesFooter
+ * @param string $module_name
+ */
+ private function getTemplatesAdminPagesFooter($module_name) {
+ $stl_mod_name = strtolower($module_name);
+ $ret = <<<EOT
<div class="clear"> </div>
<{if \$pagenav}><br />
<!-- Display navigation -->
@@ -141,6 +207,31 @@
<!-- Footer -->
<{include file="db:{$stl_mod_name}_footer.tpl"}>
EOT;
+ return $ret;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function renderFile($filename) {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $module_name = $module->getVar('mod_name');
+ $stl_mod_name = strtolower($module_name);
+ $table_name = $table->getVar('table_name');
+ $table_fieldname = $table->getVar('table_fieldname');
+ //
+ $stu_module_name = strtoupper($module_name);
+ $language = $this->getLanguage($module_name, 'AM');
+ $content = $this->getTemplatesAdminPagesHeader($module_name, $table, $language);
+ // Verify if table_fieldname is not empty
+ if(!empty($table_fieldname)) {
+ $content .= $this->getTemplatesAdminPagesBody($module_name, $table, $language);
+ } else {
+ $content .= $this->getTemplatesAdminPagesBodyFieldnameEmpty($module_name, $table, $language);
+ }
+ $content .= $this->getTemplatesAdminPagesFooter($module_name);
+ //
$this->tdmcfile->create($module_name, 'templates/admin', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php 2014-06-28 09:55:59 UTC (rev 12660)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php 2014-06-28 14:04:32 UTC (rev 12661)
@@ -46,25 +46,21 @@
* @public function write
* @param string $module
* @param string $table
- * @param string $filename
*/
public function write($module, $table) {
$this->setModule($module);
$this->setTable($table);
- }
+ }
/*
- * @public function renderFile
- * @param string $filename
+ * @private function getTemplatesBlocksHeader
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
*/
- public function renderFile($filename) {
- $module = $this->getModule();
- $table = $this->getTable();
- $module_name = strtolower($module->getVar('mod_name'));
+ private function getTemplatesBlocksHeader($module_name, $table, $language) {
+ $stl_mod_name = strtolower($module_name);
$table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- //$filename = $this->getFileName();
- $language = $this->getLanguage($module_name, 'MB');
- $content = <<<EOT
+ $ret = <<<EOT
<table class="{$table_name} width100">
<thead>
<tr class="head">\n
@@ -74,17 +70,32 @@
{
$field_name = $fields[$f]->getVar('field_name');
$lang_stu_field_name = $language.strtoupper($field_name);
- $content .= <<<EOT
+ $ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
EOT;
}
- $content .= <<<EOT
+ $ret .= <<<EOT
</tr>
- </thead>
+ </thead>\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getTemplatesBlocksBody
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
+ */
+ private function getTemplatesBlocksBody($module_name, $table, $language)
+ {
+ $stl_mod_name = strtolower($module_name);
+ $table_name = $table->getVar('table_name');
+ $ret = <<<EOT
<tbody>
- <{foreach item={$table_fieldname} from=\${$table_name}}>
+ <{foreach item=list from=\${$table_name}}>
<tr class="<{cycle values='odd, even'}>">\n
EOT;
+ $fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
$field_name = $fields[$f]->getVar('field_name');
@@ -97,27 +108,93 @@
}
}
if( $field_element == 9 ) {
- $content .= <<<EOT
+ $ret .= <<<EOT
<td class="center">
- <img src="<{\${$module_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}">
+ <img src="<{\${$module_name}_upload_url}>/images/{$table_name}/<{\$list.{$rp_field_name}}>" alt="{$table_name}">
</td>\n
EOT;
} elseif( $field_element == 8 ) {
- $content .= <<<EOT
- <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
+ $ret .= <<<EOT
+ <td class="center"><span style="background-color: <{\$list.{$rp_field_name}}>;">\t\t</span></td>\n
EOT;
} else {
- $content .= <<<EOT
- <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
+ $ret .= <<<EOT
+ <td class="center"><{\$list.{$rp_field_name}}></td>\n
EOT;
}
}
- $content .= <<<EOT
+ $ret .= <<<EOT
</tr>
<{/foreach}>
</tbody>
</table>
EOT;
+ return $ret;
+ }
+ /*
+ * @private function getTemplatesBlocksBodyFieldnameEmpty
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
+ */
+ private function getTemplatesBlocksBodyFieldnameEmpty($module_name, $table, $language)
+ {
+ $stl_mod_name = strtolower($module_name);
+ $table_name = $table->getVar('table_name');
+ $ret = <<<EOT
+ <tbody>
+ <{foreach item=list from=\${$table_name}}>
+ <tr class="<{cycle values='odd, even'}>">\n
+EOT;
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
+ {
+ $field_name = $fields[$f]->getVar('field_name');
+ $field_element = $fields[$f]->getVar('field_element');
+ if( $field_element == 9 ) {
+ $ret .= <<<EOT
+ <td class="center">
+ <img src="<{\${$module_name}_upload_url}>/images/{$table_name}/<{\$list.{$field_name}}>" alt="{$table_name}">
+ </td>\n
+EOT;
+ } elseif( $field_element == 8 ) {
+ $ret .= <<<EOT
+ <td class="center"><span style="background-color: <{\$list.{$field_name}}>;">\t\t</span></td>\n
+EOT;
+ } else {
+ $ret .= <<<EOT
+ <td class="center"><{\$list.{$field_name}}></td>\n
+EOT;
+ }
+ }
+ $ret .= <<<EOT
+ </tr>
+ <{/foreach}>
+ </tbody>
+</table>
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function renderFile
+ * @param string $filename
+ */
+ 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');
+ $language = $this->getLanguage($module_name, 'MB');
+ $content = $this->getTemplatesBlocksHeader($module_name, $table, $language);
+ // Verify if table_fieldname is not empty
+ if(!empty($table_fieldname)) {
+ $content .= $this->getTemplatesBlocksBody($module_name, $table, $language);
+ } else {
+ $content .= $this->getTemplatesBlocksBodyFieldnameEmpty($module_name, $table, $language);
+ }
+ //$content .= $this->getTemplatesBlocksFooter($module_name);
+ //
$this->tdmcfile->create($module_name, 'templates/blocks', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-28 09:55:59 UTC (rev 12660)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-28 14:04:32 UTC (rev 12661)
@@ -51,21 +51,16 @@
public function write($module, $table) {
$this->setModule($module);
$this->setTable($table);
- }
- /*
- * @public function renderFile
- * @param string $filename
+ }
+ /*
+ * @private function getTemplatesUserPagesHeader
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
*/
- public function renderFile($filename) {
- $module = $this->getModule();
- $table = $this->getTable();
- $module_name = $module->getVar('mod_name');
- $stl_mod_name = strtolower($module_name);
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- //$filename = $this->getFileName();
- $language = $this->getLanguage($module_name, 'MA');
- $content = <<<EOT
+ private function getTemplatesUserPagesHeader($module_name, $table, $language) {
+ $stl_mod_name = strtolower($module_name);
+ $ret = <<<EOT
<{include file="db:{$stl_mod_name}_header.tpl"}>
<table class="{$module_name}">
<thead class="outer">
@@ -76,17 +71,32 @@
{
$field_name = $fields[$f]->getVar('field_name');
$lang_stu_field_name = $language.strtoupper($field_name);
- $content .= <<<EOT
+ $ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_stu_field_name}}></th>\n
EOT;
}
- $content .= <<<EOT
+ $ret .= <<<EOT
</tr>
- </thead>
+ </thead>\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getTemplatesUserPagesBody
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
+ */
+ private function getTemplatesUserPagesBody($module_name, $table, $language)
+ {
+ $stl_mod_name = strtolower($module_name);
+ $table_name = $table->getVar('table_name');
+ $ret = <<<EOT
<tbody>
- <{foreach item={$table_fieldname} from=\${$table_name}}>
+ <{foreach item=list from=\${$table_name}}>
<tr class="<{cycle values='odd, even'}>">\n
EOT;
+ $fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
$field_name = $fields[$f]->getVar('field_name');
@@ -100,31 +110,106 @@
}
switch( $field_element ) {
case 8:
- $content .= <<<EOT
- <td class="center"><span style="background-color: <{\${$table_fieldname}.{$rp_field_name}}>;"> </span></td>\n
+ $ret .= <<<EOT
+ <td class="center"><span style="background-color: <{\$list.{$rp_field_name}}>;">\t\t</span></td>\n
EOT;
break;
case 9:
- $content .= <<<EOT
- <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ $ret .= <<<EOT
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\$list.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
break;
default:
- $content .= <<<EOT
- <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
+ $ret .= <<<EOT
+ <td class="center"><{\$list.{$rp_field_name}}></td>\n
EOT;
break;
- }
+ }
}
- $content .= <<<EOT
+ $ret .= <<<EOT
</tr>
<{/foreach}>
</tbody>
</table>\n
EOT;
- $content .= <<<EOT
+ return $ret;
+ }
+ /*
+ * @private function getTemplatesUserPagesBodyFieldnameEmpty
+ * @param string $module_name
+ * @param string $table
+ * @param string $language
+ */
+ private function getTemplatesUserPagesBodyFieldnameEmpty($module_name, $table, $language)
+ {
+ $stl_mod_name = strtolower($module_name);
+ $table_name = $table->getVar('table_name');
+ $ret = <<<EOT
+ <tbody>
+ <{foreach item=list from=\${$table_name}}>
+ <tr class="<{cycle values='odd, even'}>">\n
+EOT;
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
+ {
+ $field_name = $fields[$f]->getVar('field_name');
+ $field_element = $fields[$f]->getVar('field_element');
+ switch( $field_element ) {
+ case 8:
+ $ret .= <<<EOT
+ <td class="center"><span style="background-color: <{\$list.{$field_name}}>;"></span></td>\n
+EOT;
+ break;
+ case 9:
+ $ret .= <<<EOT
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\$list.{$field_name}}>" alt="{$table_name}"></td>\n
+EOT;
+ break;
+ default:
+ $ret .= <<<EOT
+ <td class="center"><{\$list.{$field_name}}></td>\n
+EOT;
+ break;
+ }
+ }
+ $ret .= <<<EOT
+ </tr>
+ <{/foreach}>
+ </tbody>
+</table>\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @private function getTemplatesUserPagesFooter
+ * @param string $module_name
+ */
+ private function getTemplatesUserPagesFooter($module_name) {
+ $stl_mod_name = strtolower($module_name);
+ $ret = <<<EOT
<{include file="db:{$stl_mod_name}_footer.tpl"}>
EOT;
+ return $ret;
+ }
+ /*
+ * @public function renderFile
+ * @param string $filename
+ */
+ public function renderFile($filename) {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $module_name = $module->getVar('mod_name');
+ $table_fieldname = $table->getVar('table_fieldname');
+ $language = $this->getLanguage($module_name, 'MA');
+ $content = $this->getTemplatesUserPagesHeader($module_name, $table, $language);
+ // Verify if table_fieldname is not empty
+ if(!empty($table_fieldname)) {
+ $content .= $this->getTemplatesUserPagesBody($module_name, $table, $language);
+ } else {
+ $content .= $this->getTemplatesUserPagesBodyFieldnameEmpty($module_name, $table, $language);
+ }
+ $content .= $this->getTemplatesUserPagesFooter($module_name);
+ //
$this->tdmcfile->create($module_name, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php 2014-06-28 09:55:59 UTC (rev 12660)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php 2014-06-28 14:04:32 UTC (rev 12661)
@@ -51,83 +51,21 @@
$this->setModule($module);
$this->setTable($table);
}
+
/*
- * @public function getAdminPagesList
- * @param string $table_name
+ * @private function getUserPages
* @param string $language
*/
- public function getUserPagesList($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();
- \${$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 render
- * @param null
- */
- public function renderFile($filename) {
- $module = $this->getModule();
+ private function getUserPages($module_name, $language)
+ {
$table = $this->getTable();
- $module_name = $module->getVar('mod_name');
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
$stu_mod_name = strtoupper($module_name);
$stl_mod_name = strtolower($module_name);
$stu_table_name = strtoupper($table_name);
- $stl_table_name = strtolower($table_name);
- $language = $this->getLanguage($module_name, 'MA');
- $content = $this->getHeaderFilesComments($module, $filename);
- $content .= <<<EOT
+ $stl_table_name = strtolower($table_name);
+ $ret = <<<EOT
\ninclude_once 'header.php';
\$xoopsOption['template_main'] = '{$stl_mod_name}_{$table_name}.tpl';
include_once XOOPS_ROOT_PATH . '/header.php';
@@ -153,33 +91,52 @@
{
$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, '_'));
- $field_element = $fields[$f]->getVar('field_element');
- if ( $fields[$f]->getVar('field_main') == 1 ) {
- $fpmf = $field_name; // fpmf = fields parameters main field
- }
-
- // Verify if this is a textarea or dhtmltextarea
- if ( $field_element == 2 || $field_element == 3 ) {
- $content .= <<<EOT
- \${$lp_field_name}['{$rp_field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$field_name}'));\n
+ // Verify if table_fieldname is not empty
+ if(!empty($table_fieldname)) {
+ 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, '_'));
+ $tname = $lp_field_name;
+ $field_element = $fields[$f]->getVar('field_element');
+ if ( $fields[$f]->getVar('field_main') == 1 ) {
+ $fpmf = $field_name; // fpmf = fields parameters main field
+ }
+ // Verify if this is a textarea or dhtmltextarea
+ if ( $field_element == 2 || $field_element == 3 ) {
+ $ret .= <<<EOT
+ \${$tname}['{$rp_field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$field_name}'));\n
EOT;
+ } else {
+ $ret .= <<<EOT
+ \${$tname}['{$rp_field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$field_name}');\n
+EOT;
+ }
} else {
- $content .= <<<EOT
- \${$lp_field_name}['{$rp_field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$field_name}');\n
+ $tname = $table_name;
+ $field_element = $fields[$f]->getVar('field_element');
+ if ( $fields[$f]->getVar('field_main') == 1 ) {
+ $fpmf = $field_name; // fpmf = fields parameters main field
+ }
+ // Verify if this is a textarea or dhtmltextarea
+ if ( $field_element == 2 || $field_element == 3 ) {
+ $ret .= <<<EOT
+ \${$tname}['{$rp_field_name}'] = strip_tags(\${$stl_table_name}_arr[\$i]->getVar('{$field_name}'));\n
EOT;
+ } else {
+ $ret .= <<<EOT
+ \${$tname}['{$rp_field_name}'] = \${$stl_table_name}_arr[\$i]->getVar('{$field_name}');\n
+EOT;
+ }
}
}
- $content .= <<<EOT
- \$GLOBALS['xoopsTpl']->append('{$stl_table_name}', \${$table_fieldname});
+ $ret .= <<<EOT
+ \$GLOBALS['xoopsTpl']->append('{$stl_table_name}', \${$tname});
\$keywords[] = \${$stl_table_name}_arr[\$i]->getVar('{$fpmf}');
- unset(\${$table_fieldname});
+ unset(\${$tname});
}
// Display Navigation
if (\${$stl_table_name}_count > \$limit) {
@@ -188,15 +145,28 @@
\$GLOBALS['xoopsTpl']->assign('pagenav', \$nav->renderNav(4));
}
}
-//keywords
+// keywords
{$stl_mod_name}_meta_keywords(xoops_getModuleOption('keywords', \$dirname) .', '. implode(', ', \$keywords));
-//description
+// description
{$stl_mod_name}_meta_description({$language}{$stu_table_name}_DESC);
//
\$GLOBALS['xoopsTpl']->assign('xoops_mpageurl', {$stu_mod_name}_URL.'/{$stl_table_name}.php');
//
include_once 'footer.php';
EOT;
+ return $ret;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function renderFile($filename) {
+ $module = $this->getModule();
+ $module_name = $module->getVar('mod_name');
+ $language = $this->getLanguage($module_name, 'MA');
+ $content = $this->getHeaderFilesComments($module, $filename);
+ $content .= $this->getUserPages($module_name, $language);
+ //
$this->tdmcfile->create($module_name, '/', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
return $this->tdmcfile->renderFile();
}
|
|
From: <txm...@us...> - 2014-07-02 16:00:05
|
Revision: 12669
http://sourceforge.net/p/xoops/svn/12669
Author: txmodxoops
Date: 2014-07-02 16:00:01 +0000 (Wed, 02 Jul 2014)
Log Message:
-----------
- Fixed several bugs
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.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/sql/mysql.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
Modified: 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-07-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -86,7 +86,9 @@
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
\$adminmenu[\$i]['link'] = 'admin/{$tables[$i]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = 'assets/images/32/{$tables[$i]->getVar('table_image')}';
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$i]->getVar('table_image')}';
+// Local path
+//\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$i]->getVar('table_image')}';
\$i++;\n
EOT;
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-07-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -230,7 +230,7 @@
$table = $this->tdmcreate->getHandler('tables')->get($table_id);
// Copy of tables images file
if( file_exists($upload_table_image = $uploadTablesIcons32.'/'.$table_image)) {
- $this->structure->copyFile('assets/images/32', $upload_table_image, $table_image);
+ $this->structure->copyFile('assets/images/icons/32', $upload_table_image, $table_image);
}
// Creation of admin files
if ( $table_admin == 1) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-07-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -194,7 +194,7 @@
xoops_load('XoopsFormLoader');
\$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
\$form->setExtra('enctype="multipart/form-data"');\n
-{$this->formelements->renderElements()}\n
+{$this->formelements->renderElements()}
EOT;
return $ret;
}
@@ -228,8 +228,7 @@
\$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$full_list );
\$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$full_list );
\$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$full_list );
- }
-
+ }
// For approve
\$groups_can_approve_checkbox->addOptionArray ( \$group_list );
\$form->addElement ( \$groups_can_approve_checkbox );
@@ -238,7 +237,7 @@
\$form->addElement ( \$groups_can_submit_checkbox );
// For view
\$groups_can_view_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_view_checkbox );\n\n
+ \$form->addElement ( \$groups_can_view_checkbox );\n
EOT;
return $ret;
}
@@ -248,6 +247,7 @@
*/
private function getFootFunctionForm() {
$ret = <<<EOT
+ // Send
\$form->addElement(new XoopsFormHidden('op', 'save'));
\$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return \$form;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -199,6 +199,7 @@
private function getXoopsFormSelect($language, $table_name, $field_name, $required = 'false') {
$ret = <<<EOT
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
+ \${$field_name}_select->addOption('Empty');
\${$field_name}_select->addOptionArray({$table_name}Handler->getList());
\$form->addElement( \${$field_name}_select{$required} );\n
EOT;
@@ -258,12 +259,12 @@
$field_name = $fields[$f]->getVar('field_name');
}
}
- $ret = <<<XFT
+ $ret = <<<EOT
\${$table_name}Handler =& \$this->{$module_dirname}->getHandler('{$table_name}');
\${$field_name}_select = new XoopsFormSelect({$language}, '{$field_name}', \$this->getVar('{$field_name}'));
\${$field_name}_select->addOptionArray(\${$field_name}Handler->getList());
\$form->addElement( \${$field_name}_select{$required} );\n
-XFT;
+EOT;
return $ret;
}
/*
@@ -274,12 +275,13 @@
* @param string $fields
* @param string $required
*/
- private function getXoopsFormTopic($language, $module_dirname, $table_name, $fields, $required = 'false')
+ private function getXoopsFormTopic($language, $module_dirname, $table, $fields, $required = 'false')
{
+ $table_name = $table->getVar('table_name');
foreach(array_keys($fields) as $f)
{
$field_name = $fields[$f]->getVar('field_name');
- if($fields[$f]->getVar('field_id') == 1) {
+ if(($f == 0) && ($table->getVar('table_autoincrement') == 1)) {
$field_id = $field_name;
}
if($fields[$f]->getVar('field_parent') == 1) {
@@ -289,17 +291,17 @@
$field_main = $field_name;
}
}
- $ret = <<<XFT
+ $ret = <<<EOT
include_once(XOOPS_ROOT_PATH . '/class/tree.php');
\${$table_name}Handler = \$this->{$module_dirname}->getHandler('{$table_name}');
\$criteria = new CriteriaCompo();
\${$table_name} = \${$table_name}Handler->getObjects( \$criteria );
if(\${$table_name}) {
\${$table_name}_tree = new XoopsObjectTree( \${$table_name}, '{$field_id}', '{$field_pid}' );
- \${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_main}','--', \$this->getVar('{$field_pid}', 'e' ), true );
+ \${$field_pid} = \${$table_name}_tree->makeSelBox( '{$field_pid}', '{$field_main}', '--', \$this->getVar('{$field_pid}', 'e' ), true );
\$form->addElement( new XoopsFormLabel ( {$language}, \${$field_pid} ){$required} );
- }\n
-XFT;
+ }\n
+EOT;
return $ret;
}
/*
@@ -323,57 +325,57 @@
$language = $language_funct . strtoupper($field_name);
$required = ( $fields[$f]->getVar('field_required') == 1 ) ? ', true' : '';
//
- if($field_inform == 1) {
- // If we want to hide XoopsFormHidden() or field id
- //if(($f > 0) && ($table->getVar('table_autoincrement') == 1)) {
- // Switch elements
- switch($field_element)
- {
- case 1:
- $ret .= $this->getXoopsFormText($language, $field_name, $required);
- break;
- case 2:
- $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
- break;
- case 3:
- $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required);
- break;
- case 4:
- $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
- break;
- case 5:
- $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
- break;
- case 6:
- $ret .= $this->getXoopsFormSelect($language, $table_name, $field_name, $required);
- break;
- case 7:
- $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
- break;
- case 8:
- $ret .= $this->getXoopsFormColorPicker($language, $module_dirname, $field_name, $required);
- break;
- case 9:
- $ret .= $this->getXoopsFormUploadImage($language_funct, $module_dirname, $table_name, $field_name, $required);
- break;
- case 10:
- $ret .= $this->getXoopsFormUploadFile($language, $module_dirname, $field_name, $required);
- break;
- case 11:
- $ret .= $this->getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required);
- break;
- default:
- $ret .= $this->getXoopsFormHidden($field_name);
- break;
+ if($field_inform == 1) {
+ // Switch elements
+ switch($field_element)
+ {
+ case 1:
+ $ret .= $this->getXoopsFormText($language, $field_name, $required);
+ break;
+ case 2:
+ $ret .= $this->getXoopsFormTextArea($language, $field_name, $required);
+ break;
+ case 3:
+ $ret .= $this->getXoopsFormDhtmlTextArea($language, $module_dirname, $field_name, $required);
+ break;
+ case 4:
+ $ret .= $this->getXoopsFormCheckBox($language, $field_name, $required);
+ break;
+ case 5:
+ $ret .= $this->getXoopsFormRadioYN($language, $field_name, $required);
+ break;
+ case 6:
+ $ret .= $this->getXoopsFormSelect($language, $table_name, $field_name, $required);
+ break;
+ case 7:
+ $ret .= $this->getXoopsFormSelectUser($language, $field_name, $required);
+ break;
+ case 8:
+ $ret .= $this->getXoopsFormColorPicker($language, $module_dirname, $field_name, $required);
+ break;
+ case 9:
+ $ret .= $this->getXoopsFormUploadImage($language_funct, $module_dirname, $table_name, $field_name, $required);
+ break;
+ case 10:
+ $ret .= $this->getXoopsFormUploadFile($language, $module_dirname, $field_name, $required);
+ break;
+ case 11:
+ $ret .= $this->getXoopsFormTextDateSelect($language, $module_dirname, $field_name, $required);
+ break;
+ default:
+ // If we want to hide XoopsFormHidden() or field id
+ if(($f == 0) && ($table->getVar('table_autoincrement') == 1)) {
+ $ret .= $this->getXoopsFormHidden($field_name);
+ }
+ break;
+ }
+ if ($field_element > 11) {
+ if($table->getVar('table_category') == 1) {
+ $ret .= $this->getXoopsFormTopic($language, $module_dirname, $table, $fields, $required);
+ } else {
+ $ret .= $this->getXoopsFormTable($language, $module_dirname, $table_name, $fields, $required);
}
- if ($field_element > 11) {
- if($table->getVar('table_category') == 1) {
- $ret .= $this->getXoopsFormTopic($language, $module_dirname, $table_name, $fields, $required);
- } else {
- $ret .= $this->getXoopsFormTable($language, $module_dirname, $table_name, $fields, $required);
- }
- }
- //}
+ }
}
}
return $ret;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php 2014-07-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/sql/mysql.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -318,7 +318,7 @@
$module = $this->getModule();
$filename = $this->getFileName();
$module_name = strtolower($module->getVar('mod_name'));
- $module_dirname = strtolower($module->getVar('mod_name'));
+ $module_dirname = strtolower($module->getVar('mod_dirname'));
$content = $this->getHeaderSqlComments($module_name);
$content .= $this->getDatabaseTables($module_dirname);
$this->tdmcfile->create($module_dirname, 'sql', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -213,7 +213,7 @@
public function renderFile($filename) {
$module = $this->getModule();
$table = $this->getTable();
- $module_dirname = $module->getVar('mod_name');
+ $module_dirname = $module->getVar('mod_dirname');
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
$language = $this->getLanguage($module_dirname, 'AM');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/permissions.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/permissions.php 2014-07-02 08:52:43 UTC (rev 12668)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/permissions.php 2014-07-02 16:00:01 UTC (rev 12669)
@@ -69,7 +69,7 @@
public function render() {
$module = $this->getModule();
$filename = $this->getFileName();
- $module_dirname = $module->getVar('mod_name');
+ $module_dirname = $module->getVar('mod_dirname');
$language = $this->getLanguage($module_dirname, 'AM');
$content = $this->getTemplatesAdminPermissions($module_dirname);
//
|
|
From: <txm...@us...> - 2014-07-02 19:27:21
|
Revision: 12671
http://sourceforge.net/p/xoops/svn/12671
Author: txmodxoops
Date: 2014-07-02 19:27:17 +0000 (Wed, 02 Jul 2014)
Log Message:
-----------
- Updated
- Still work to do
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
Modified: 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-07-02 16:54:58 UTC (rev 12670)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-07-02 19:27:17 UTC (rev 12671)
@@ -77,8 +77,13 @@
/*
* @public function getAdminPagesList
+ * @param string $module_dirname
* @param string $table_name
+ * @param string $table_fieldname
* @param string $language
+ * @param string $fields
+ * @param string $fpif
+ * @param string $fpmf
*/
public function getAdminPagesList($module_dirname, $table_name, $table_fieldname, $language, $fields, $fpif, $fpmf) {
$stu_module_dirname = strtoupper($module_dirname);
@@ -150,6 +155,7 @@
/*
* @public function getAdminPagesNew
+ * @param string $module_dirname
* @param string $table_name
* @param string $language
*/
@@ -171,8 +177,12 @@
/*
* @public function getAdminPagesSave
- * @param string $table_name
- * @param string $language
+ * @param string $module_dirname
+ * @param string $table_name
+ * @param string $language
+ * @param string $fields
+ * @param string $fpif
+ * @param string $fpmf
*/
public function getAdminPagesSave($module_dirname, $table_name, $language, $fields, $fpif, $fpmf)
{
@@ -230,15 +240,19 @@
/*
* @public function getAdminPagesEdit
- * @param string $table_name
+ * @param string $module_dirname
+ * @param string $table_name
+ * @param string $table_fieldname
* @param string $language
+ * @param string $fpif
*/
- public function getAdminPagesEdit($module_dirname, $table_name, $language, $fpif) {
+ public function getAdminPagesEdit($module_dirname, $table_name, $table_fieldname, $language, $fpif) {
$stu_table_name = strtoupper($table_name);
+ $stu_table_fieldname = strtoupper($table_fieldname);
$ret = <<<EOT
case 'edit':
\$template_main = '{$module_dirname}_admin_{$table_name}.tpl';
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$table_name}.php?op=new', 'add');
\$adminMenu->addItemButton({$language}{$stu_table_name}_LIST, '{$table_name}.php', 'list');
echo \$adminMenu->renderButton();
// Get Form
@@ -317,7 +331,7 @@
$content .= $this->getAdminPagesList($module_dirname, $table_name, $table_fieldname, $language, $fields, $fpif, $fpmf);
$content .= $this->getAdminPagesNew($module_dirname, $table_name, $language);
$content .= $this->getAdminPagesSave($module_dirname, $table_name, $language, $fields, $fpif, $fpmf);
- $content .= $this->getAdminPagesEdit($module_dirname, $table_name, $language, $fpif);
+ $content .= $this->getAdminPagesEdit($module_dirname, $table_name, $table_fieldname, $language, $fpif);
$content .= $this->getAdminPagesDelete($table_name, $language, $fpif, $fpmf);
$content .= $this->getAdminPagesFooter();
//
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-07-02 16:54:58 UTC (rev 12670)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/classes.php 2014-07-02 19:27:17 UTC (rev 12671)
@@ -144,7 +144,7 @@
/*
* @var mixed
*/
- private {$module_dirname} = null;
+ private \${$module_dirname} = null;
/*
* Constructor
*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-02 16:54:58 UTC (rev 12670)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-02 19:27:17 UTC (rev 12671)
@@ -76,6 +76,7 @@
EOT;
}
$ret .= <<<EOT
+ <th class="center"><{\$smarty.const.{$language}FORMACTION}></th>
</tr>
</thead>\n
EOT;
@@ -102,12 +103,22 @@
$field_name = $fields[$f]->getVar('field_name');
$field_element = $fields[$f]->getVar('field_element');
$rp_field_name = $field_name;
+ if($f == 0) {
+ $field_id = $field_name;
+ if(strpos($field_name, '_')) {
+ $str = strpos($field_name, '_');
+ if($str !== false) {
+ $rp_field_id = substr($field_name, $str + 1, strlen($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, '_'));
switch( $field_element ) {
case 8:
$ret .= <<<EOT
@@ -127,6 +138,14 @@
}
}
$ret .= <<<EOT
+ <td class="center">
+ <a href="{$table_name}.php?op=edit&{$field_id}=<{\$list.{$rp_field_id}}>" title="<{\$smarty.const._EDIT}>">
+ <img src="<{xoModuleIcons16 edit.png}>" alt="<{\$smarty.const._EDIT}>" />
+ </a>
+ <a href="{$table_name}.php?op=delete&{$field_id}=<{\$list.{$rp_field_id}}>" title="<{\$smarty.const._DELETE}>">
+ <img src="<{xoModuleIcons16 delete.png}>" alt="<{\$smarty.const._DELETE}>" />
+ </a>
+ </td>
</tr>
<{/foreach}>
</tbody>
|
|
From: <txm...@us...> - 2014-07-04 08:02:50
|
Revision: 12673
http://sourceforge.net/p/xoops/svn/12673
Author: txmodxoops
Date: 2014-07-04 08:02:45 +0000 (Fri, 04 Jul 2014)
Log Message:
-----------
- Fixed several bugs
- Still work to do
Modified Paths:
--------------
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/classes/formelements.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
Modified: 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-07-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/header.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -63,7 +63,7 @@
$tables = $this->getTables();
$filename = $this->getFileName();
$moduleDirname = $module->getVar('mod_dirname');
- $ucfmod_name = ucfirst($moduleDirname);
+ $ucfModuleName = ucfirst($moduleDirname);
$language = $this->getLanguage('AM');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
@@ -76,7 +76,7 @@
if ( $table->getVar('table_name') != '' ) {
$content .= <<<EOT
// Get instance of module
-\${$moduleDirname} = {$ucfmod_name}Helper::getInstance();\n
+\${$moduleDirname} = {$ucfModuleName}Helper::getInstance();\n
EOT;
}
$content .= <<<EOT
Modified: 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-07-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/index.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -65,13 +65,13 @@
$language_thereare = $this->getLanguage($moduleDirname, 'AM', 'THEREARE_');
$content = $this->getHeaderFilesComments($module, $filename);
$content .= <<<EOT
-include_once 'header.php';\n
+include_once 'header.php';
+// Count elements\n
EOT;
foreach (array_keys($tables) as $i)
{
$tableName = $tables[$i]->getVar('table_name');
$content .= <<<EOT
-//count "{$tableName}"
\$count_{$tableName} = \${$tableName}Handler->getCount();\n
EOT;
}
@@ -80,14 +80,14 @@
\$template_main = '{$moduleDirname}_admin_index.tpl';
// InfoBox Statistics
\$adminMenu->addInfoBox({$language}STATISTICS);
-// InfoBox\n
+// Info elements\n
EOT;
foreach (array_keys($tables) as $i)
{
$tableName = $tables[$i]->getVar('table_name');
- $ta_stutable_name = $language_thereare.strtoupper($tableName);
+ $stuTableName = $language_thereare.strtoupper($tableName);
$content .= <<<EOT
-\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$ta_stutable_name}.'</label>', \$count_{$tableName});\n
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, '<label>'.{$stuTableName}.'</label>', \$count_{$tableName});\n
EOT;
}
$content .= <<<EOT
Modified: 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-07-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -26,7 +26,8 @@
* @public function constructor
* @param null
*/
- public function __construct() {
+ public function __construct() {
+ parent::__construct();
$this->tdmcfile = TDMCreateFile::getInstance();
}
/*
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/classes/formelements.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -398,7 +398,7 @@
}
break;
}
- if ($field_element > 12) {
+ if ($fieldElement > 12) {
if($table->getVar('table_category') == 1) {
$ret .= $this->getXoopsFormTopic($language, $moduleDirname, $table, $fields, $required);
} else {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-03 22:42:40 UTC (rev 12672)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-04 08:02:45 UTC (rev 12673)
@@ -71,9 +71,11 @@
{
$fieldName = $fields[$f]->getVar('field_name');
$lang_fn = $language.strtoupper($fieldName);
- $ret .= <<<EOT
+ if($fields[$f]->getVar('field_inlist') == 1) {
+ $ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
EOT;
+ }
}
$ret .= <<<EOT
<th class="center"><{\$smarty.const.{$language}FORMACTION}></th>
@@ -119,27 +121,29 @@
}
}
$lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- switch( $fieldElement ) {
- case 8:
- $ret .= <<<EOT
+ if($fields[$f]->getVar('field_inlist') == 1) {
+ switch( $fieldElement ) {
+ case 8:
+ $ret .= <<<EOT
<td class="center"><span style="background-color: <{\$list.{$rp_field_name}}>;"> </span></td>\n
EOT;
- break;
- case 9:
- $ret .= <<<EOT
+ break;
+ case 9:
+ $ret .= <<<EOT
<td class="center"><img src="<{xoModuleIcons32}><{\$list.{$rp_field_name}}>" alt="{$tableName}"></td>\n
EOT;
- break;
- case 10:
- $ret .= <<<EOT
+ break;
+ case 10:
+ $ret .= <<<EOT
<td class="center"><img src="<{\${$moduleDirname}_upload_url}>/images/{$tableName}/<{\$list.{$rp_field_name}}>" alt="{$tableName}"></td>\n
EOT;
- break;
- default:
- $ret .= <<<EOT
+ break;
+ default:
+ $ret .= <<<EOT
<td class="center"><{\$list.{$rp_field_name}}></td>\n
EOT;
- break;
+ break;
+ }
}
}
$ret .= <<<EOT
@@ -176,31 +180,44 @@
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
- $fieldElement = $fields[$f]->getVar('field_element');
- switch( $fieldElement ) {
- case 8:
- $ret .= <<<EOT
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if($f == 0) {
+ $field_id = $fieldName;
+ }
+ if($fields[$f]->getVar('field_inlist') == 1) {
+ switch( $fieldElement ) {
+ case 8:
+ $ret .= <<<EOT
<td class="center"><span style="background-color: <{\$list.{$fieldName}}>;">\t\t</span></td>\n
EOT;
- break;
- case 9:
- $ret .= <<<EOT
+ break;
+ case 9:
+ $ret .= <<<EOT
<td class="center"><img src="<{xoModuleIcons32}><{\$list.{$fieldName}}>" alt="{$tableName}"></td>\n
EOT;
- break;
- case 10:
- $ret .= <<<EOT
+ break;
+ case 10:
+ $ret .= <<<EOT
<td class="center"><img src="<{\${$moduleDirname}_upload_url}>/images/{$tableName}/<{\$list.{$fieldName}}>" alt="{$tableName}"></td>\n
EOT;
- break;
- default:
- $ret .= <<<EOT
+ break;
+ default:
+ $ret .= <<<EOT
<td class="center"><{\$list.{$fieldName}}></td>\n
EOT;
- break;
+ break;
+ }
}
}
$ret .= <<<EOT
+ <td class="center">
+ <a href="{$tableName}.php?op=edit&{$field_id}=<{\$list.{$field_id}}>" title="<{\$smarty.const._EDIT}>">
+ <img src="<{xoModuleIcons16 edit.png}>" alt="<{\$smarty.const._EDIT}>" />
+ </a>
+ <a href="{$tableName}.php?op=delete&{$field_id}=<{\$list.{$field_id}}>" title="<{\$smarty.const._DELETE}>">
+ <img src="<{xoModuleIcons16 delete.png}>" alt="<{\$smarty.const._DELETE}>" />
+ </a>
+ </td>
</tr>
<{/foreach}>
</tbody>
|
|
From: <txm...@us...> - 2014-07-04 09:29:48
|
Revision: 12674
http://sourceforge.net/p/xoops/svn/12674
Author: txmodxoops
Date: 2014-07-04 09:29:45 +0000 (Fri, 04 Jul 2014)
Log Message:
-----------
- Fixed many issues for templates & admin/menu
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
Modified: 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-07-04 08:02:45 UTC (rev 12673)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/menu.php 2014-07-04 09:29:45 UTC (rev 12674)
@@ -45,6 +45,7 @@
/*
* @public function write
* @param string $module
+ * @param mixed $table
* @param mixed $tables
* @param string $filename
*/
@@ -54,6 +55,28 @@
$this->setFileName($filename);
}
/*
+ * @private function getAdminMenuPath
+ * @param array $tables
+ * @param integer $t
+ */
+ private function getAdminMenuPath($tables, $t) {
+ $fields = $this->getTableFields($tables[$t]->getVar('table_id'));
+ foreach (array_keys($fields) as $f)
+ {
+ $fieldElement = $fields[$f]->getVar('field_element');
+ if( ($fieldElement == 9) || ( $fieldElement != 10 ) ) {
+ $ret = <<<EOT
+\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';\n
+EOT;
+ } elseif( $fieldElement == 10 ) {
+ $ret = <<<EOT
+\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';\n
+EOT;
+ }
+ }
+ return $ret;
+ }
+ /*
* @public function render
* @param null
*/
@@ -83,29 +106,15 @@
$tablePermissions = $tables[$t]->getVar('table_permissions');
if ( $tables[$t]->getVar('table_admin') == 1 )
{
- $menu++;
+ $menu++;
$content .= <<<EOT
\$adminmenu[\$i]['title'] = {$language}{$menu};
-\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';
-\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';
-// Local path
+\$adminmenu[\$i]['link'] = 'admin/{$tables[$t]->getVar('table_name')}.php';\n
EOT;
- $fields = $this->getTableFields($tables[$t]->getVar('table_id'));
- foreach (array_keys($fields) as $f)
- {
- $fieldElement = $fields[$f]->getVar('field_element');
- if( $fieldElement == 9 ) {
- $content .= <<<EOT
-//\$adminmenu[\$i]['icon'] = \$sysPathIcon32.'/{$tables[$t]->getVar('table_image')}';
+ $content .= $this->getAdminMenuPath($tables, $t);
+ $content .= <<<EOT
\$i++;\n
EOT;
- } elseif( $fieldElement == 10 ) {
- $content .= <<<EOT
-//\$adminmenu[\$i]['icon'] = 'assets/images/icons/32/{$tables[$t]->getVar('table_image')}';
-\$i++;\n
-EOT;
- }
- }
}
}
if( $tablePermissions == 1 ) {
Modified: 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-07-04 08:02:45 UTC (rev 12673)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-07-04 09:29:45 UTC (rev 12674)
@@ -64,10 +64,10 @@
public function getAdminPagesHeader($moduleDirname, $tableName) {
$ret = <<<EOT
-\ninclude_once 'header.php';
+include_once 'header.php';
//It recovered the value of argument op in URL$
\$op = {$moduleDirname}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
-//
+// Switch options
switch (\$op)
{\n
EOT;
@@ -93,9 +93,9 @@
default:
\$limit = \${$moduleDirname}->getConfig('adminpager');
\$start = {$moduleDirname}_CleanVars(\$_REQUEST, 'start', 0);
- \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$tableName}.php?op=new', 'add');
\$template_main = '{$moduleDirname}_admin_{$tableName}.tpl';
\$GLOBALS['xoopsTpl']->assign('navigation', \$adminMenu->addNavigation('{$tableName}.php'));
+ \$adminMenu->addItemButton({$language}ADD_{$stu_table_fieldname}, '{$tableName}.php?op=new', 'add');
\$GLOBALS['xoopsTpl']->assign('buttons', \$adminMenu->renderButton());
\$criteria = new CriteriaCompo();
\$criteria->setSort('{$fpif} ASC, {$fpmf}');
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-04 08:02:45 UTC (rev 12673)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-07-04 09:29:45 UTC (rev 12674)
@@ -70,8 +70,8 @@
foreach(array_keys($fields) as $f)
{
$fieldName = $fields[$f]->getVar('field_name');
- $lang_fn = $language.strtoupper($fieldName);
- if($fields[$f]->getVar('field_inlist') == 1) {
+ $lang_fn = $language.strtoupper($fieldName);
+ if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
$ret .= <<<EOT
<th class="center"><{\$smarty.const.{$lang_fn}}></th>\n
EOT;
@@ -121,7 +121,7 @@
}
}
$lp_field_name = substr($fieldName, 0, strpos($fieldName, '_'));
- if($fields[$f]->getVar('field_inlist') == 1) {
+ if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
switch( $fieldElement ) {
case 8:
$ret .= <<<EOT
@@ -184,7 +184,7 @@
if($f == 0) {
$field_id = $fieldName;
}
- if($fields[$f]->getVar('field_inlist') == 1) {
+ if( ($fields[$f]->getVar('field_inlist') == 1) || ($table->getVar('table_autoincrement') == 1) ) {
switch( $fieldElement ) {
case 8:
$ret .= <<<EOT
@@ -241,8 +241,7 @@
<strong><{\$error}></strong>
</div>
<{/if}>
-<{/if}>
-<{if \$form}>
+<{else}>
<!-- Display form (add,edit) -->
<div class="spacer"><{\$form}></div>
<{/if}>
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-07-04 08:02:45 UTC (rev 12673)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/xoopsversion.php 2014-07-04 09:29:45 UTC (rev 12674)
@@ -98,7 +98,7 @@
defined('XOOPS_ROOT_PATH') or die('Restricted access');
//
\$dirname = basename( dirname( __FILE__ ) ) ;
-//
+// ---------------------- Informations ---------------------- //
\$modversion = array(
'name' => {$language}NAME,
'version' => {$module->getVar('mod_version')},
@@ -193,7 +193,7 @@
$ret = '';
if ( !empty($tableName) ) {
$ret .= <<<EOT
-\n// Mysql file
+// ---------------------- Mysql ---------------------- //
\$modversion['sqlfile']['mysql'] = "sql/mysql.sql";
// Tables\n
EOT;
@@ -216,7 +216,7 @@
private function getXoopsVersionSearch($moduleDirname)
{
$ret = <<<EOT
-// Search
+// ---------------------- Search ---------------------- //
\$modversion['hasSearch'] = 1;
\$modversion['search']['file'] = "include/search.inc.php";
\$modversion['search']['func'] = "{$moduleDirname}_search";\n
@@ -230,7 +230,7 @@
private function getXoopsVersionComments($moduleDirname)
{
$ret = <<<EOT
-// Comments
+// ---------------------- Comments ---------------------- //
\$modversion['comments']['pageName'] = "comments.php";
\$modversion['comments']['itemName'] = "com_id";
// Comment callback functions
@@ -248,7 +248,8 @@
{
$tables = $this->getTables();
$ret = <<<EOT
-// Templates Admin
+// ---------------------- Templates ---------------------- //
+// Admin
\$modversion['templates'][] = array('file' => '{$moduleDirname}_admin_about.tpl', 'description' => '', 'type' => 'admin');
\$modversion['templates'][] = array('file' => '{$moduleDirname}_admin_header.tpl', 'description' => '', 'type' => 'admin');
\$modversion['templates'][] = array('file' => '{$moduleDirname}_admin_index.tpl', 'description' => '', 'type' => 'admin');\n
@@ -278,7 +279,7 @@
{
$tables = $this->getTables();
$ret = <<<EOT
-// Templates User
+// User
\$modversion['templates'][] = array('file' => '{$moduleDirname}_header.tpl', 'description' => '');
\$modversion['templates'][] = array('file' => '{$moduleDirname}_index.tpl', 'description' => '');\n
EOT;
@@ -300,7 +301,7 @@
private function getXoopsVersionSubmenu($language)
{
$ret = <<<EOT
-// Submenu list\n
+// ---------------------- Submenu ---------------------- //\n
EOT;
$tables = $this->getTables();
$i = 1;
@@ -328,7 +329,7 @@
{
$tables = $this->getTables();
$ret = <<<EOT
-//Blocks\n
+// ---------------------- Blocks ---------------------- //\n
EOT;
foreach (array_keys($tables) as $i) {
$tableName = $tables[$i]->getVar('table_name');
@@ -357,7 +358,7 @@
{
$moduleDirname = $module->getVar('mod_dirname');
$ret = <<<EOT
-// ------------------- Config -------------------\n
+// ------------------- Config ------------------- //\n
EOT;
$fields = $this->getTableFields($table->getVar('table_id'));
foreach (array_keys($fields) as $f)
@@ -522,7 +523,7 @@
}
}
$ret .= <<<EOT
-\n// Notifications {$moduleDirname}
+// ------------------- Notifications ------------------- //
\$modversion['hasNotification'] = 1;
\$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
\$modversion['notification']['lookup_func'] = '{$moduleDirname}_notify_iteminfo';
|