|
From: <txm...@us...> - 2014-06-18 09:22:00
|
Revision: 12616
http://sourceforge.net/p/xoops/svn/12616
Author: txmodxoops
Date: 2014-06-18 09:21:52 +0000 (Wed, 18 Jun 2014)
Log Message:
-----------
- Fixed bugs
- Updated
- Deleted files and Cleared code unused or duplicated
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/templates.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
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/fields.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -22,7 +22,6 @@
// Recovered value of arguments op in the URL $
$op = XoopsRequest::getString('op', 'list');
// Get fields Variables
-$table_name = TDMCreate_CleanVars($_REQUEST, 'table_name', '', 'string');
$field_mid = TDMCreate_CleanVars($_REQUEST, 'field_mid');
$field_tid = TDMCreate_CleanVars($_REQUEST, 'field_tid');
$field_numb = TDMCreate_CleanVars($_REQUEST, 'field_numb');
@@ -131,11 +130,6 @@
} else {
$GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_FIELDS);
}
- var_dump($table_name);
- var_dump($field_mid);
- var_dump($field_tid);
- var_dump($field_numb);
- var_dump($field_name);
break;
case 'new':
@@ -152,7 +146,6 @@
$form = $fieldsObj->getForm($field_mid, $field_tid, $field_numb, $field_name);
$GLOBALS['xoopsTpl']->assign('form', $form->render());
- var_dump($table_name);
var_dump($field_mid);
var_dump($field_tid);
var_dump($field_numb);
@@ -166,7 +159,7 @@
}
$field_id = TDMCreate_CleanVars($_REQUEST, 'field_id');
// Fields Handler
- $fields = $tdmcreate->getHandler('fields');
+ $fields = $tdmcreate->getHandler('fields');
// Set Variables
foreach($_POST['field_id'] as $key => $value)
{
@@ -177,7 +170,7 @@
case 'edit':
$fieldsObj =& $fields->get($value);
break;
- }
+ }
if (isset($field_mid) && isset($field_tid) && !empty($_POST['field_name'][$key])) {
// Set Data
$fieldsObj->setVar( 'field_mid', $field_mid );
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -126,10 +126,12 @@
$form->addElement(new TDMCreateFormLabel('<td>'._AM_TDMCREATE_FIELD_PARAMETERS.'</th>'));
$form->addElement(new TDMCreateFormLabel('</tr></thead>'));
$form->addElement(new TDMCreateFormLabel('<tbody>'));
- //
+ //
+ $class = 'even';
if($isNew) {
for($i = 1; $i <= $f_numb; $i++) {
- $this->getFormElements($form, $isNew, 'new', $i, $f_name, $field_mid, $field_tid, $this);
+ $class = ($class == 'even') ? 'odd' : 'even';
+ $this->getFormElements($form, $isNew, 'new', $i, $f_name, $field_mid, $field_tid, $this, $class);
}
} else {
// Get the list of fields
@@ -138,8 +140,9 @@
$fields = $this->tdmcreate->getHandler('fields')->getObjects($criteria);
unset($criteria);
$i = 1;
- foreach($fields as $field) {
- $this->getFormElements($form, $isNew, 'edit', $i, null, $field_mid, $field_tid, $field);
+ foreach($fields as $field) {
+ $class = ($class == 'even') ? 'odd' : 'even';
+ $this->getFormElements($form, $isNew, 'edit', $i, null, $field_mid, $field_tid, $field, $class);
$i++;
}
unset($i);
@@ -173,8 +176,7 @@
$form->addElement(new XoopsFormHidden('field_id['.$id.']', $type));
$form->addElement(new XoopsFormHidden('field_mid', $field_mid));
$form->addElement(new XoopsFormHidden('field_tid', $field_tid));
-
- $class = ($class == 'even') ? 'odd' : 'even';
+
$form->addElement(new TDMCreateFormLabel('<tr class="'.$class.'">'));
// Index ID
$form->addElement(new TDMCreateFormLabel('<td class="center">'.$id.'</td>'));
@@ -251,9 +253,13 @@
$check_field_block = new XoopsFormCheckBox('', 'field_block['.$id.']', $field_block);
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
$parameters_tray->addElement($check_field_block);
- //$main = 1;
- $field_main = $isNew ? $id : $field->getVar('field_main');
- $check_field_main = new XoopsFormRadio('', 'field_main['.$id.']');
+ $main = $field->getVar('field_main');
+ $field_main = $isNew ? $id : $main;
+ if($main == 1) {
+ $check_field_main = new XoopsFormRadio('', 'field_main['.$id.']', $field_main);
+ } else {
+ $check_field_main = new XoopsFormRadio('', 'field_main['.$id.']');
+ }
$check_field_main->addOption($field_main, _AM_TDMCREATE_FIELD_MAINFIELD );
$parameters_tray->addElement($check_field_main);
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-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/abstract.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -59,7 +59,9 @@
* @param mixed $module
*/
public function setModule($module) {
- $this->module = $module;
+ if (is_object($module) && ($module instanceof TDMCreateModules)) {
+ $this->module = $module;
+ }
}
/*
@@ -75,9 +77,9 @@
* @param mixed $table
*/
public function setTable($table) {
- //if (is_object($table) && is_a($table, 'TDMCreateTables')) {
+ if (is_object($table) && ($table instanceof TDMCreateTables)) {
$this->table = $table;
- //}
+ }
}
/*
@@ -93,7 +95,7 @@
* @param mixed $tables
*/
public function setTables($tables) {
- //if (is_object($tables) && is_a($tables, 'TDMCreateTables')) {
+ //if (is_object($tables) && ($tables instanceof TDMCreateTables)) {
$this->tables = $tables;
//}
}
@@ -111,9 +113,9 @@
* @param mixed $fields
*/
public function setFields($fields) {
- //if (is_object($fields) && is_a($fields, 'TDMCreateFields')) {
+ if (is_object($fields) && ($fields instanceof TDMCreateFields)) {
$this->fields = $fields;
- //}
+ }
}
/*
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-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -222,11 +222,15 @@
$ret[] = $adminTemplatesPages->renderFile($table_name.'.tpl');
}
// Creation of blocks
- if ( $table_blocks == 1) {
+ if ( $table_blocks == 1) {
// Blocks Files
$blocksFiles = BlocksFiles::getInstance();
$blocksFiles->write($module, $table);
$ret[] = $blocksFiles->renderFile($table_name.'.php');
+ // Templates Blocks Files
+ $templatesFiles = TemplatesBlocks::getInstance();
+ $templatesFiles->write($module, $table);
+ $ret[] = $templatesFiles->renderFile($table_name.'.tpl');
}
// Blocks Templates File
/*$blocksTemplates = BlocksTemplates::getInstance();
Deleted: 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-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/blocks/templates.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -1,98 +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: blocks.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class BlocksTemplates extends HtmlSmartyCodes
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- parent::__construct();
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param mixed $table
- */
- public function write($module, $table) {
- $this->setModule($module);
- $this->setTable($table);
- }
- /*
- * @public function render
- * @param null
- */
- public function renderFile($filename) {
- $module = $this->getModule();
- $table = $this->getTable();
- $module_name = $module->getVar('mod_name');
- $table_name = $table->getVar('table_name');
- $table_fieldname = $table->getVar('table_fieldname');
- $language = $this->getLanguage($module_name, 'MB');
- $content = <<<EOT
-<table class="outer">
- <tr class="head">\n
-EOT;
- $fields = $this->getTableFields($table->getVar('table_id'));
- foreach(array_keys($fields) as $f)
- {
- $lng_field_name = $language.strtoupper($fields[$f]->getVar('field_name'));
- $content .= <<<EOT
- <th><{\$smarty.const.{$lng_field_name}}></th>\n
-EOT;
- }
- $content .= <<<EOT
- </tr>
- <{foreachq item={$table_fieldname} from=\${$table_name}}>
- <tr class = "<{cycle values = 'even,odd'}>">\n
-
-EOT;
- foreach(array_keys($fields) as $f)
- {
- $table_field_name = $table_fieldname.'.'.strip_tags($fields[$f]->getVar('field_name'));
- $content .= <<<EOT
- <td><{\${$table_field_name}}></td>\n
-EOT;
- }
- $content .= <<<EOT
- </tr>
- <{/foreach}>
-</table>
-EOT;
- $this->tdmcfile->create($module_name, 'templates/blocks', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/blocks/blocks.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -0,0 +1,118 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: blocks.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TemplatesBlocks extends TDMCreateFile
+{
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ parent::__construct();
+ $this->tdmcfile = TDMCreateFile::getInstance();
+ }
+ /*
+ * @static function &getInstance
+ * @param null
+ */
+ public static function &getInstance()
+ {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+ /*
+ * @public function write
+ * @param string $module
+ * @param string $table
+ * @param string $filename
+ */
+ public function write($module, $table) {
+ $this->setModule($module);
+ $this->setTable($table);
+ }
+ /*
+ * @public function renderFile
+ * @param string $filename
+ */
+ public function renderFile($filename) {
+ $module = $this->getModule();
+ $table = $this->getTable();
+ $module_name = $module->getVar('mod_name');
+ $table_name = $table->getVar('table_name');
+ $table_fieldname = $table->getVar('table_fieldname');
+ //$filename = $this->getFileName();
+ $language = $this->getLanguage($module_name, 'MA');
+ $content = <<<EOT
+<table class="{$table_name}" cellpadding="0" cellspacing="0" width="100%">
+ <tr class="head">\n
+EOT;
+ $fields = $this->getTableFields($table->getVar('table_id'));
+ foreach(array_keys($fields) as $f)
+ {
+ $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
+EOT;
+ }
+ $content .= <<<EOT
+ </tr>
+ <{foreach item={$table_fieldname} from=\${$table_name}}>
+ <tr class="<{cycle values=\'odd, even\'}>">\n
+EOT;
+ foreach(array_keys($fields) as $f)
+ {
+ $field_name = $fields[$f]->getVar('field_name');
+ $field_element = $fields[$f]->getVar('field_element');
+ $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));
+ }
+ }
+ 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
+EOT;
+ } elseif( $field_element == 8 ) {
+ $content .= <<<EOT
+ <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
+EOT;
+ }
+ }
+ $content .= <<<EOT
+ </tr>
+ <{/foreach}>
+</table>
+EOT;
+ $this->tdmcfile->create($module_name, 'templates/blocks', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
+ return $this->tdmcfile->renderFile();
+ }
+}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/footer.php 2014-06-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/footer.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -1,109 +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: templates_footer.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class TemplatesFooter extends HtmlSmartyCodes
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
-
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param mixed $table
- * @param string $filename
- */
- public function write($module, $table, $filename) {
- $this->setModule($module);
- $this->setTable($table);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $language = $this->getLanguage($module_name, 'MA');
- $content = <<<EOT
-<{if \$bookmarks != 0}>
-<{include file="db:system_bookmarks.html"}>
-<{/if}>
-\n<{if \$fbcomments != 0}>
-<{include file="db:system_fbcomments.html"}>
-<{/if}>
-\n<div class="left"><{\$copyright}></div>
-EOT;
- if( $table->getVar('table_name') != null ) {
- $content .= <<<EOT
-\n<{if \$pagenav != ''}>
- <div class="right"><{\$pagenav}></div>
-<{/if}>
-<br />
-EOT;
- }
- $content .= <<<EOT
-\n<{if \$xoops_isadmin}>
- <div class="center bold"><a href="<{\$admin}>"><{\$smarty.const.{$language}ADMIN}></a></div>
-<{/if}>
-EOT;
- if ( ($module->getVar('mod_comments') != 0) && ($table->getVar('table_comments') != 0) ) {
- $content .= <<<EOT
-\n<div class="pad2 marg2">
- <{if \$comment_mode == "flat"}>
- <{include file="db:system_comments_flat.html"}>
- <{elseif \$comment_mode == "thread"}>
- <{include file="db:system_comments_thread.html"}>
- <{elseif \$comment_mode == "nest"}>
- <{include file="db:system_comments_nest.html"}>
- <{/if}>
-</div>
-EOT;
- }
- if ( ($module->getVar('mod_notifications') != 0) && ($table->getVar('table_notifications') != 0) ) {
- $content .= <<<EOT
-\n<{include file='db:system_notification_select.html'}>
-EOT;
- }
- $this->tdmcfile->create($module_name, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/header.php 2014-06-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/header.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -1,112 +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: templates_header.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class TemplatesHeader extends HtmlSmartyCodes
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
-
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param mixed $tables
- * @param string $filename
- */
- public function write($module, $tables, $filename) {
- $this->setModule($module);
- $this->setTables($tables);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $tables = $this->getTables();
- $filename = $this->getFileName();
- $module_name = strtolower($module->getVar('mod_name'));
- $language = $this->getLanguage($module_name, 'MA');
- $content = <<<EOT
-<div class="header">
-<span class="left"><b><{\$smarty.const.{$language}TITLE}></b>: </span>
-<span class="left"><{\$smarty.const.{$language}DESC}></span><br />
-</div>
-<div class="head">
- <{if \$adv != ''}>
- <div class="center"><{\$adv}></div>
- <{/if}>
-</div>
-<table class="outer {$module_name}" cellspacing="2" cellpadding="2">
- <thead>
- <tr class="center" colspan="2">
- <th><{\$smarty.const.{$language}TITLE}> - <{\$smarty.const.{$language}DESC}></th>
- </tr>
- </thead>
- <tbody>
- <tr class="center">
- <td class="center bold pad5">
- <ul class="menu center fields">
- <li><a href="<{\${$module_name}_url}>"><{\$smarty.const.{$language}INDEX}></a></li>\n
-EOT;
- foreach (array_keys($tables) as $i)
- {
- $table_name = $tables[$i]->getVar('table_name');
- $stu_table_name = strtoupper($table_name);
- $content .= <<<EOT
- <li> | </li>
- <li><a href="<{\${$module_name}_url}>/{$table_name}.php"><{\$smarty.const.{$language}{$stu_table_name}}></a></li>\n
-EOT;
- }
- $content .= <<<EOT
- </ul>
- </td>
- </tr>
- <{if \$adv != ''}>
- <tr class="center"><td class="center bold pad5"><{\$adv}></td></tr>
- <{else}>
- <tr class="center"><td class="center bold pad5"> </td></tr>
- <{/if}>
- </tbody>
-</table>
-EOT;
- $this->tdmcfile->create($module_name, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/index.php 2014-06-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/index.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -1,77 +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: templates_index.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class TemplatesIndex extends HtmlSmartyCodes
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
-
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param string $filename
- */
- public function write($module, $filename) {
- $this->setModule($module);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $filename = $this->getFileName();
- $module_name = $module->getVar('mod_name');
- $language = $this->getLanguage($module_name, 'MA');
- $content = <<<EOT
-<{include file="db:header.tpl"}>
-<table class="outer {$module_name}">
- <tbody>
- <tr class="left">
- <td class="pad5"><{\$smarty.const.{$language}INDEX_DESC}></td>
- </tr>
- </tbody>
-</table>
-<{include file="db:footer.tpl"}>
-EOT;
- $this->tdmcfile->create($module_name, 'templates', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
- return $this->tdmcfile->renderFile();
- }
-}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/pages.php 2014-06-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/pages.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -1,127 +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: templates_pages.php 12258 2014-01-02 09:33:29Z timgno $
- */
-defined('XOOPS_ROOT_PATH') or die('Restricted access');
-
-class TemplatesPages extends TDMCreateFile
-{
- /*
- * @public function constructor
- * @param null
- */
- public function __construct() {
- parent::__construct();
- $this->tdmcfile = TDMCreateFile::getInstance();
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function write
- * @param string $module
- * @param string $table
- * @param string $filename
- */
- public function write($module, $table, $filename) {
- $this->setModule($module);
- $this->setTable($table);
- $this->setFileName($filename);
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module = $this->getModule();
- $table = $this->getTable();
- $module_name = $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');
- $content = <<<EOT
-<div class="outer">
- <table class="{$table_name}" cellpadding="0" cellspacing="0" width="100%">
- <tr class="head">
-EOT;
- $fields = $this->getTableFields($table->getVar('table_id'));
- foreach(array_keys($fields) as $f)
- {
- $field_name = $fields[$f]->getVar('field_name');
- if(($f == 0) && ($table->getVar('table_autoincrement') == 1)) {
- $fpif = $field_name;
- }
- if($fields[$f]->getVar('field_main') == 1) {
- $fpmf = $field_name;
- }
- $content .= <<<EOT
- <th class="center"><{\$smarty.const.{$language.strtoupper($field_name)}}></th>
-EOT;
- }
- $content .= <<<EOT
- </tr>
- <{foreach item={$table_fieldname} from=${$table_name}}>
- <tr class="<{cycle values=\'odd, even\'}>">
-EOT;
- foreach(array_keys($fields) as $f)
- {
- $field_name = $fields[$f]->getVar('field_name');
- $field_element = $fields[$f]->getVar('field_element');
- if( $field_element == 9 ) {
- $content .= <<<EOT
- <td class="center"><img src="<{$xoops_url}>/uploads/{$mod_name}/images/{$table_name}/<{${$table_fieldname}.{$field_name}}>" alt="{$table_name}"></td>
-EOT;
- } elseif( $field_element == 8 ) {
- $content .= <<<EOT
- <td class="center"><span style="background-color: <{${$table_fieldname}.{$field_name}}>;"> </span></td>
-EOT;
- } else {
- $content .= <<<EOT
- <td class="center"><{${$table_fieldname}.{$field_name}}></td>
-EOT;
- }
- }
- $content .= <<<EOT
- </tr>
- <{/foreach}>
- </table>
-</div>
-<div class="outer">
- <div class="center">None</div>
- <br />
-</div>
-EOT;
- }
- $content .= <<<EOT
-<{include file="db:footer.tpl"}>
-EOT;
- $this->tdmcfile->create($module_name, 'templates', $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/templates/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -65,6 +65,7 @@
//$filename = $this->getFileName();
$language = $this->getLanguage($module_name, 'MA');
$content = <<<EOT
+<{include file="db:header.tpl"}>
<div class="outer">
<table class="{$table_name}" cellpadding="0" cellspacing="0" width="100%">
<tr class="head">\n
@@ -72,13 +73,7 @@
$fields = $this->getTableFields($table->getVar('table_id'));
foreach(array_keys($fields) as $f)
{
- $field_name = $fields[$f]->getVar('field_name');
- if(($f == 0) && ($table->getVar('table_autoincrement') == 1)) {
- $fpif = $field_name;
- }
- if($fields[$f]->getVar('field_main') == 1) {
- $fpmf = $field_name;
- }
+ $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
@@ -102,7 +97,7 @@
}
if( $field_element == 9 ) {
$content .= <<<EOT
- <td class="center"><img src="<{\$xoops_url}>/uploads/{$mod_name}/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ <td class="center"><img src="<{\$xoops_url}>/uploads/{$module_name}/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
} elseif( $field_element == 8 ) {
$content .= <<<EOT
@@ -110,7 +105,7 @@
EOT;
} else {
$content .= <<<EOT
- <td class="center"><{\${$table_fieldname}.{$field_name}}></td>\n
+ <td class="center"><{\${$table_fieldname}.{$rp_field_name}}></td>\n
EOT;
}
}
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-06-17 15:00:33 UTC (rev 12615)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/include/common.php 2014-06-18 09:21:52 UTC (rev 12616)
@@ -48,7 +48,7 @@
$cfi = '/class/files/include/';
$cfl = '/class/files/language/';
$cfs = '/class/files/sql/';
-$cft = '/class/files/templates/user/';
+$cftu = '/class/files/templates/user/';
$cfta = '/class/files/templates/admin/';
$cftb = '/class/files/templates/blocks/';
$cfu = '/class/files/user/';
@@ -86,10 +86,11 @@
include_once TDMC_PATH . $cfta .'index.php';
include_once TDMC_PATH . $cfta .'footer.php';
include_once TDMC_PATH . $cfta .'pages.php';
-include_once TDMC_PATH . $cft .'header.php';
-include_once TDMC_PATH . $cft .'index.php';
-include_once TDMC_PATH . $cft .'footer.php';
-include_once TDMC_PATH . $cft .'pages.php';
+include_once TDMC_PATH . $cftb .'blocks.php';
+include_once TDMC_PATH . $cftu .'header.php';
+include_once TDMC_PATH . $cftu .'index.php';
+include_once TDMC_PATH . $cftu .'footer.php';
+include_once TDMC_PATH . $cftu .'pages.php';
include_once TDMC_PATH . $cfu .'footer.php';
include_once TDMC_PATH . $cfu .'header.php';
include_once TDMC_PATH . $cfu .'index.php';
|