|
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;
|