|
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"}>
|