|
From: <txm...@us...> - 2013-04-16 15:22:54
|
Revision: 11388
http://sourceforge.net/p/xoops/svn/11388
Author: txmodxoops
Date: 2013-04-16 15:22:50 +0000 (Tue, 16 Apr 2013)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_footer.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_header.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_help.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_index.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_language.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_menu.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_permissions.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_blocks.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_blocks_language.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_blocks_templates.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_changelog.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_css_style.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_help_language.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_functions.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_install.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_notification.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_include_search.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_js_jquery.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_languages.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_main_language.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_modinfo_language.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_sql.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_templates.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_templates_admin_about.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_templates_admin_help.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_templates_footer.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_templates_header.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_templates_index.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_templates_pages.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_user_comments.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_user_header.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_user_index.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_user_pages.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_xoopsversion.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/templates/admin/tdmcreate_modules.html
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/templates/admin/tdmcreate_tables.html
XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_footer.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/admin_footer.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -18,8 +18,8 @@
* @author Txmod Xoops <su...@tx...>
* @version $Id: 1.59 admin_footer.php 11297 2013-03-24 10:58:10Z timgno $
*/
-$fsname = $GLOBALS['xoopsModule']->getInfo('forum_site_name');
+$fsname = $GLOBALS['xoopsModule']->getInfo('support_name');
echo "<div align='center'><a href='http://www.xoops.org' target='_blank'>
<img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a></div>";
- echo "<div class='center pad5'>" . sprintf(_AM_TDMCREATE_MAINTAINEDBY, $GLOBALS['xoopsModule']->getVar('dirname'), $GLOBALS['xoopsModule']->getInfo('forum_site_url'), $fsname, $fsname) . "</div>";
+ echo "<div class='center pad5'>" . sprintf(_AM_TDMCREATE_MAINTAINEDBY, $GLOBALS['xoopsModule']->getVar('dirname'), $GLOBALS['xoopsModule']->getInfo('support_url'), $fsname, $fsname) . "</div>";
xoops_cp_footer();
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/tables.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/admin/tables.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -1,74 +1,72 @@
<?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.
+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.
- */
+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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 tables.php 11297 2013-03-24 10:58:10Z timgno $
- */
+* 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.5
+* @author Txmod Xoops <su...@tx...>
+* @version $Id: 1.59 tables.php 11297 2013-03-24 10:58:10Z timgno $
+*/
include 'admin_header.php';
// Recovered the value of the argument op in the URL $
$op = TDMCreate_CleanVars($_REQUEST, 'op', 'list', 'string');
$mod_id = TDMCreate_CleanVars($_REQUEST, 'mod_id', 0);
switch ($op)
{
- case 'list':
- default:
+ case 'list':
+ default:
$limit = $GLOBALS['xoopsModuleConfig']['adminperpage'];
$start = TDMCreate_CleanVars($_REQUEST, 'start', 0);
- // Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
+ // Define main template
+ $xoopsOption['template_main'] = 'tdmcreate_tables.html';
xoops_cp_header();
$GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/style.css' );
$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
-
+
$xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
$xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('tdmc_url', TDMC_URL);
- $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
- $xoopsTpl->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
+ $xoopsTpl->assign('tdmc_url', TDMC_URL);
+ $xoopsTpl->assign('tdmc_upload_url', TDMC_UPLOAD_URL);
+ $xoopsTpl->assign('pathIcon32', XOOPS_URL.'/Frameworks/moduleclasses/icons/32');
// Get the list of modules
- $criteria = new CriteriaCompo();
- $criteria->setSort('mod_id ASC, mod_name');
- $criteria->setOrder('ASC');
- $numrows_modules = $modulesHandler->getCount();
+ $criteria = new CriteriaCompo();
+ $criteria->setSort('mod_id ASC, mod_name');
+ $criteria->setOrder('ASC');
+ $numrows_modules = $modulesHandler->getCount();
// Redirect if there aren't modules
- if ( $numrows_modules == 0 ) {
- redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- }
+ if ( $numrows_modules == 0 ) {
+ redirect_header('modules.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
+ }
$mods_arr = $modulesHandler->getAll($criteria);
unset($criteria);
// Display modules list
- if ( $numrows_modules > 0 )
+ if ( $numrows_modules > 0 )
{
- $_yes = "<img src='../images/icons/16/yellow.png' alt='"._YES."' title='"._YES."' />";
+ $_yes = "<img src='../images/icons/16/yellow.png' alt='"._YES."' title='"._YES."' />";
$_no = "<img src='../images/icons/16/red.png' alt='"._NO."' title='"._NO."' />";
- foreach (array_keys($mods_arr) as $i)
+ foreach (array_keys($mods_arr) as $i)
{
$mod['id'] = $i;
- $mod['name'] = $mods_arr[$i]->getVar('mod_name');
- $mod['image'] = $mods_arr[$i]->getVar('mod_image');
+ $mod['name'] = $mods_arr[$i]->getVar('mod_name');
+ $mod['image'] = $mods_arr[$i]->getVar('mod_image');
$mod['admin'] = ( $mods_arr[$i]->getVar('mod_admin') == 1 ) ? $_yes : $_no;
$mod['user'] = ( $mods_arr[$i]->getVar('mod_user') == 1 ) ? $_yes : $_no;
$mod['submenu'] = ( $mods_arr[$i]->getVar('mod_submenu') == 1 ) ? $_yes : $_no;
$mod['search'] = ( $mods_arr[$i]->getVar('mod_search') == 1 ) ? $_yes : $_no;
$mod['comments'] = ( $mods_arr[$i]->getVar('mod_comments') == 1 ) ? $_yes : $_no;
$mod['notifications'] = ( $mods_arr[$i]->getVar('mod_notifications') == 1 ) ? $_yes : $_no;
- $xoopsTpl->append_by_ref('modules_list', $mod);
- unset($mod);
// Get the list of tables
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('table_mid', $i));
@@ -78,6 +76,7 @@
$tables_arr = $tablesHandler->getAll($criteria);
unset($criteria);
// Display tables list
+ $tables = array();
if ( $numrows_tables > 0 )
{
$_yes = "<img src='../images/icons/16/green.png' alt='"._YES."' title='"._YES."' />";
@@ -89,19 +88,22 @@
$table['image'] = $tables_arr[$t]->getVar('table_image');
$table['nbfields'] = $tables_arr[$t]->getVar('table_nbfields');
$table['blocks'] = ( $tables_arr[$t]->getVar('table_blocks') == 1 ) ? $_yes : $_no;
- $table['admin'] = ( $tables_arr[$t]->getVar('mod_admin') == 1 ) ? $_yes : $_no;
- $table['user'] = ( $tables_arr[$t]->getVar('mod_user') == 1 ) ? $_yes : $_no;
- $table['submenu'] = ( $tables_arr[$t]->getVar('mod_submenu') == 1 ) ? $_yes : $_no;
- $table['search'] = ( $tables_arr[$t]->getVar('mod_search') == 1 ) ? $_yes : $_no;
- $table['comments'] = ( $tables_arr[$t]->getVar('mod_comments') == 1 ) ? $_yes : $_no;
- $table['notifications'] = ( $tables_arr[$t]->getVar('mod_notifications') == 1 ) ? $_yes : $_no;
- $xoopsTpl->append_by_ref('tables_list', $table);
+ $table['admin'] = ( $tables_arr[$t]->getVar('table_admin') == 1 ) ? $_yes : $_no;
+ $table['user'] = ( $tables_arr[$t]->getVar('table_user') == 1 ) ? $_yes : $_no;
+ $table['submenu'] = ( $tables_arr[$t]->getVar('table_submenu') == 1 ) ? $_yes : $_no;
+ $table['search'] = ( $tables_arr[$t]->getVar('table_search') == 1 ) ? $_yes : $_no;
+ $table['comments'] = ( $tables_arr[$t]->getVar('table_comments') == 1 ) ? $_yes : $_no;
+ $table['notifications'] = ( $tables_arr[$t]->getVar('table_notifications') == 1 ) ? $_yes : $_no;
+ $tables[] = $table;
unset($table);
}
- }
+ }
+ $mod['tables'] = $tables;
+ $xoopsTpl->append('modules_list', $mod);
+ unset($mod);
}
-
- if ( $numrows_modules > $limit ) {
+
+ if ( $numrows_modules > $limit ) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($numrows_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
$xoopsTpl->assign('pagenav', $pagenav->renderNav(4));
@@ -109,50 +111,50 @@
} else {
$xoopsTpl->assign('error', 'There aren\'t modules');
}
- break;
+ break;
- case 'new':
- // Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
- xoops_cp_header();
+ case 'new':
+ // Define main template
+ $xoopsOption['template_main'] = 'tdmcreate_tables.html';
+ xoops_cp_header();
$xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
$xoopsTpl->assign('button_new', $adminMenu->renderButton());
-
- $obj =& $tablesHandler->create();
- $form = $obj->getForm();
+
+ $obj =& $tablesHandler->create();
+ $form = $obj->getForm();
$xoopsTpl->assign('form', $form->render());
- break;
-
+ break;
+
case 'save':
if ( !$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
+ redirect_header('tables.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
+ }
$table_id = TDMCreate_CleanVars($_REQUEST, 'table_id', 0, 'int');
- if (isset($table_id)) {
- $obj =& $tablesHandler->get($table_id);
- } else {
- $obj =& $tablesHandler->create();
- }
-
+ if (isset($table_id)) {
+ $obj =& $tablesHandler->get($table_id);
+ } else {
+ $obj =& $tablesHandler->create();
+ }
+
$table_mid = intval($_REQUEST['table_mid']);
$table_nbfields = intval($_REQUEST['table_nbfields']);
$table_fieldname = strtolower($_REQUEST['table_fieldname']);
//Form tables
$obj->setVars(array('table_mid' => $table_mid, 'table_name' => $_POST['table_name'],
- 'table_nbfields' => $table_nbfields, 'table_fieldname' => $table_fieldname));
+ 'table_nbfields' => $table_nbfields, 'table_fieldname' => $table_fieldname));
//Form table_image
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
if(is_dir($pathIcon32)){
- $uploaddir = $pathIcon32;
+ $uploaddir = $pathIcon32;
}else{
- $uploaddir = TDMC_UPLOAD_PATH.'/images/tables';
+ $uploaddir = TDMC_UPLOAD_PATH.'/images/tables';
}
$uploader = new XoopsMediaUploader($uploaddir, $GLOBALS['xoopsModuleConfig']['mimetypes'],
- $GLOBALS['xoopsModuleConfig']['maxsize'], null, null);
+ $GLOBALS['xoopsModuleConfig']['maxsize'], null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['table_image']['name']);
- $name_img = $_GET['table_name'].'.'.$extension;
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['table_image']['name']);
+ $name_img = $_GET['table_name'].'.'.$extension;
$uploader->setPrefix($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
@@ -165,42 +167,40 @@
$obj->setVar('table_image', $_POST['table_image']);
}
$obj->setVars(array('table_blocks' => (($_REQUEST['table_blocks'] == 1) ? '1' : '0'),
- 'table_admin' => (($_REQUEST['table_admin'] == 1) ? '1' : '0'),
- 'table_user' => (($_REQUEST['table_user'] == 1) ? '1' : '0'),
- 'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'),
- 'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'),
- 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'),
- 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0')));
-
- if( $tablesHandler->insert($obj) ) {
- if( $obj->isNew() ) {
- $tid = $GLOBALS['xoopsDB']->getInsertId();
- redirect_header('fields.php?op=new&field_tid='.$tid.'&field_mid='.$table_mid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, _AM_TDMCREATE_FORMOK);
+ 'table_admin' => (($_REQUEST['table_admin'] == 1) ? '1' : '0'),
+ 'table_user' => (($_REQUEST['table_user'] == 1) ? '1' : '0'),
+ 'table_submenu' => (($_REQUEST['table_submenu'] == 1) ? '1' : '0'),
+ 'table_search' => (($_REQUEST['table_search'] == 1) ? '1' : '0'),
+ 'table_comments' => (($_REQUEST['table_comments'] == 1) ? '1' : '0'),
+ 'table_notifications' => (($_REQUEST['table_notifications'] == 1) ? '1' : '0')));
+
+ if( $tablesHandler->insert($obj) ) {
+ if( $obj->isNew() ) {
+ $tid = $GLOBALS['xoopsDB']->getInsertId();
+ redirect_header('fields.php?op=new&field_tid='.$tid.'&field_mid='.$table_mid.'&field_numb='.$table_nbfields.'&field_name='.$table_fieldname, 3, _AM_TDMCREATE_FORMOK);
} else {
- redirect_header('tables.php', 3, _AM_TDMCREATE_FORMOK);
+ redirect_header('tables.php', 3, _AM_TDMCREATE_FORMOK);
}
- }
+ }
- $xoopsTpl->assign('error', $obj->getHtmlErrors());
+ $xoopsTpl->assign('error', $obj->getHtmlErrors());
$form = $obj->getForm();
$xoopsTpl->assign('form', $form->render());
- break;
-
+ break;
+
case 'edit':
- // Define main template
- $xoopsOption['template_main'] = 'tdmcreate_tables.html';
- xoops_cp_header();
+ // Define main template
+ $xoopsOption['template_main'] = 'tdmcreate_tables.html';
+ xoops_cp_header();
$xoopsTpl->assign('navigation', $adminMenu->addNavigation('tables.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php', 'list');
- $xoopsTpl->assign('button_new', $adminMenu->renderButton());
- $xoopsTpl->assign('button_list', $adminMenu->renderButton());
+ $adminMenu->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
+ $xoopsTpl->assign('button_new', $adminMenu->renderButton());
$obj = $tablesHandler->get($_REQUEST['table_id']);
$form = $obj->getForm();
$xoopsTpl->assign('form', $form->render());
- break;
-
+ break;
+
case 'delete':
$obj =& $tablesHandler->get($_REQUEST['table_id']);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
@@ -215,6 +215,6 @@
} else {
xoops_confirm(array('ok' => 1, 'table_id' => $_REQUEST['table_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('table_name')));
}
- break;
+ break;
}
include 'admin_footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_about.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_about.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_about.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -14,21 +14,22 @@
* @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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 const_admin_about.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_about($mod, $mod_name)
+function const_admin_about($modules, $modules_name, $paypal_button)
{
$file = 'about.php';
- $path_file = TDM_CREATE_MURL . '/' . $mod_name . '/admin/' . $file;
- $text = '<?php'.const_header($mod, $file).'
-include "admin_header.php";
-echo $adminMenu->addNavigation("about.php");
-echo $adminMenu->renderabout(\'YDRUY5QZQHAHS\', false);
-include "admin_footer.php";';
+ $path_file = TDM_CREATE_MURL.'/'.$modules_name.'/admin/'.$file;
+ $text = '<?php'.const_header($modules, $file).'
+include \'admin_header.php\';
+echo $adminMenu->addNavigation(\'about.php\');
+echo $adminMenu->renderabout(\''.$paypal_button.'\', false);
+include \'admin_footer.php\';';
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
-}
\ No newline at end of file
+}
+?>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_footer.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_footer.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -14,28 +14,26 @@
* @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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 const_admin_footer.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: const_admin_footer.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_footer($modules, $modules_name, $tables_arr)
+function const_admin_footer($modules, $mod_name)
{
+ $language = '_AM_'.strtoupper($mod_name).'_';
$file = 'admin_footer.php';
- $path_file = TDM_CREATE_MURL."/".$modules_name."/admin/".$file;
- $text = '<?php'.const_header($modules, $file).'
-echo "<div class=\'center\'><a href=\'http://www.xoops.org\' target=\'_blank\'>
- <img src=\'".$GLOBALS[\'pathIcon32\']."/xoopsmicrobutton.gif\' alt=\'XOOPS\' title=\'XOOPS\'></a>
- </div>";
-echo "<div class=\'center pad5\'>
- <span class=\'bold\'>".$GLOBALS[\'xoopsModule\']->getVar(\'name\')."</span>
- <span class=\'small italic\'> "._AM_TDMCREATE_MAINTAINEDBY."
- <a href=\''.$modules->getVar("mod_support_url").'\' title=\'Visit '.$modules->getVar("mod_support_name").'\' class=\'tooltip\' rel=\'external\'>'.$modules->getVar("mod_support_name").'</a></span>
- </div>";
+ $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $text = '<?php'.const_header($modules, $file).'
+echo "<div align=\'center\'><a href=\'http://www.xoops.org\' title=\'Visit XOOPS\' target=\'_blank\'>
+ <img src=\'".$pathIcon32."/xoopsmicrobutton.gif\' alt=\'XOOPS\' /></a>
+ <a href=\'http://www.txmodxoops.org\' title=\'Visit TXMod Xoops\' rel=\'external\'>
+ <img src=\'../images/txmodxoops_logo.png\' alt=\'TXMod Xoops\' /></a></div>";
+echo "<div class=\'center smallsmall italic pad5\'>
+ <strong>" . $xoopsModule->getVar(\'name\') . "</strong> ".'.$language.'MAINTAINEDBY."
+ <a href=\''.$modules->getVar("mod_support_url").'\' title=\'Visit '.$modules->getVar("mod_support_name").'\' class=\'tooltip\' rel=\'external\'>'.$modules->getVar("mod_support_name").'</a></div>";
xoops_cp_footer();
';
-//$cf = new TDMCreateStructureFile($path_file);
-//$cf->createFile($text, _AM_TDMCREATE_CONST_OK_ADMINS, _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_header.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_header.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_header.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -14,58 +14,58 @@
* @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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 const_admin_header.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: const_admin_header.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
function const_admin_header($modules, $mod_name, $tables_arr)
{
$file = 'admin_header.php';
- $path_file = TDM_CREATE_MURL."/".$mod_name."/admin/".$file;
- $text = '<?php'.const_header($modules, $file).'
-include_once XOOPS_ROOT_PATH . \'/include/cp_header.php\';
-include_once \'../include/config.php\';
-include_once \'../include/functions.php\';
+ $path_file = TDM_CREATE_MURL . '/' . $mod_name . '/admin/' . $file;
+ $text = '<?php'.const_header($modules, $file).
+<<<'EOD'
+require_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php';
+$thisdir = dirname(dirname(__FILE__));
+include_once $thisdir.'/include/common.php';
+include_once $thisdir.'/include/functions.php';
-$thisDirname = $GLOBALS[\'xoopsModule\']->getVar(\'dirname\');
+$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
-$pathIcon16 = XOOPS_URL .\'/\'. $GLOBALS[\'xoopsModule\']->getInfo(\'icons16\');
-$pathIcon32 = XOOPS_URL .\'/\'. $GLOBALS[\'xoopsModule\']->getInfo(\'icons32\');
-$pathModuleAdmin = $GLOBALS[\'xoopsModule\']->getInfo(\'dirmoduleadmin\');
+$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
+//load handlers
-//load class
-';
+EOD;
foreach (array_keys($tables_arr) as $i)
{
- $t_name = $tables_arr[$i]->getVar('tables_name');
-$text .= '$'.$t_name.'Handler=& xoops_getModuleHandler(\''.$mod_name.'\'_\''.$t_name.', $thisDirname);
-';
+ $table_name = $tables_arr[$i]->getVar('table_name');
+$text .= '$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$mod_name.'_'.$table_name. '\', $thisDirname);'.PHP_EOL;
}
-$text .= '
+$text .=<<<'EOD'
+
$myts =& MyTextSanitizer::getInstance();
-
if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
include_once(XOOPS_ROOT_PATH."/class/template.php");
$xoopsTpl = new XoopsTpl();
}
-$xoopsTpl->assign(\'pathIcon16\', $pathIcon16);
-$xoopsTpl->assign(\'pathIcon32\', $pathIcon32);
+$xoopsTpl->assign('pathIcon16', $pathIcon16);
+$xoopsTpl->assign('pathIcon32', $pathIcon32);
//Load languages
-xoops_loadLanguage(\'admin\', $thisDirname);
-xoops_loadLanguage(\'modinfo\', $thisDirname);
-xoops_loadLanguage(\'main\', $thisDirname);
-
-// Locad admin menu class
-if ( file_exists($GLOBALS[\'xoops\']->path($pathModuleAdmin.\'/moduleadmin.php\'))){
- include_once $GLOBALS[\'xoops\']->path($pathModuleAdmin.\'/moduleadmin.php\');
+xoops_loadLanguage('admin', $thisDirname);
+xoops_loadLanguage('modinfo', $thisDirname);
+xoops_loadLanguage('main', $thisDirname);
+// Local admin menu class
+if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
+ include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
}else{
redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
}
xoops_cp_header();
-$adminMenu = new ModuleAdmin();
-';
+$adminMenu = new ModuleAdmin();
+EOD;
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_help.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_help.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_help.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -14,24 +14,20 @@
* @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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 const_admin_help.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: const_admin_help.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_help($modules, $mod_name, $menu)
+function const_admin_help($modules, $modules_name)
{
- $language = '_AM_'.strtoupper($mod_name).'_HELP_';
$file = 'help.php';
- $path_file = TDM_CREATE_MURL."/".$mod_name."/admin/".$file;
+ $path_file = TDM_CREATE_MURL.'/'.$modules_name.'/admin/'.$file;
$text = '<?php'.const_header($modules, $file).'
-include "header.php";
-xoops_cp_header();
-xoops_loadLanguage("help", $xoopsModule->getVar("dirname", "e"));
-
-$xoopsTpl->display("db: admin/" . $xoopsModule->getVar("dirname") . "_admin_help.html");
-
-include "footer.php";
+include \'admin_header.php\';
+xoops_loadLanguage(\'help\', $xoopsModule->getVar(\'dirname\', \'e\'));
+$xoopsTpl->display(\'db:admin/\' . $xoopsModule->getVar("dirname") . \'_admin_help.html\');
+include \'footer.php\';
?>';
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_index.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_index.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_index.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -14,66 +14,67 @@
* @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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 const_admin_index.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: const_admin_index.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_index($modules, $mod_name, $tables_arr)
+function const_admin_index($modules, $mod_name, $tbl_name, $tables_arr)
{
- $prefix = '_AM_'.strtoupper($mod_name).'_';
- $prefix1 = '_AM_'.strtoupper($mod_name).'_THEREARE_';
- $myts =& MyTextSanitizer::getInstance();
+ $language = '_AM_'.strtoupper($mod_name).'_';
+ $language1 = '_AM_'.strtoupper($mod_name).'_ADMIN_';
+ $language2 = '_AM_'.strtoupper($mod_name).'_THEREARE_';
$file = 'index.php';
- $path_file = TDM_CREATE_MURL."/".$mod_name."/admin/".$file;
+ $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$text = '<?php'.const_header($modules, $file).'
-include "admin_header.php";
-';
+include_once \'admin_header.php\';';
foreach (array_keys($tables_arr) as $i)
{
- $t_name = $tables_arr[$i]->getVar('table_name');
+ $table_name = $tables_arr[$i]->getVar('table_name');
+ $table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
$text .= '
- //count "total"
- $count_'.$t_name.' = $'.$t_name.'Handler->getCount();
- //count "online"
- $criteria = new CriteriaCompo();';
- //if(array_key_exists($t_name."_online", $t_champs)){
- $text .= '
- $criteria->add(new Criteria("'.$t_name.'_online", 1));
- $'.$t_name.'_online = $'.$t_name.'Handler->getCount($criteria);';
- //}
- //if(array_key_exists($t_name."_pending", $t_champs)){
- $text .= '
- $criteria->add(new Criteria("'.$t_name.'_pending", 1));
- $'.$t_name.'_pending = $'.$t_name.'Handler->getCount($criteria);';
- //}
+ //count "total '.$table_fieldname.'"
+ $count_'.$table_fieldname.' = $'.$table_name.'Handler->getCount();';
+ if(isset($_REQUEST['table_online'])) {
+ $text .= '
+ //count "online"
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("'.$table_fieldname.'_online", 1));
+ $'.$table_fieldname.'_online = $'.$table_name.'Handler->getCount($criteria);';
+ }
+ if(isset($_REQUEST['table_waiting'])) {
$text .= '
- unset($criteria);
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("'.$table_fieldname.'_waiting", 1));
+ $'.$table_fieldname.'_waiting = $'.$table_name.'Handler->getCount($criteria);
';
+ }
}
$text .= '
- $r = \'#FF0000\'; // Red
- $g = \'#00AA00\'; // Green
- ';
+ // InfoBox '.$tbl_name.'
+ $adminMenu->addInfoBox('.$language.'STATISTICS);';
foreach (array_keys($tables_arr) as $i)
{
- $t_name = $tables_arr[$i]->getVar('table_name');
+ $table_name = $tables_arr[$i]->getVar('table_name');
+ $table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
$text .= '
- $adminMenu->addInfoBox('.$prefix.strtoupper($t_name).');
- $adminMenu->addInfoBoxLine('.$prefix.strtoupper($t_name).','.$prefix1.strtoupper($t_name).', $count_'.$t_name.', ($count_'.$t_name.' == 0) ? $r : $g);';
- //if(array_key_exists($t_name."_online", $t_champs)){
- $text .= '
- $adminMenu->addInfoBoxLine('.$prefix.strtoupper($t_name).','.$prefix1.strtoupper($t_name).'_ONLINE, $'.$t_name.'_online, ($count_'.$t_name.' == 0) ? $r : $g);';
- //}
- //if(array_key_exists($t_name."_pending", $t_champs)){
+ // InfoBox '.$table_fieldname.'
+ $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$language2.strtoupper($table_name).', $count_'.$table_fieldname.'); ';
+ if(isset($_REQUEST['table_online'])) {
+ $text .= '
+ $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$language2.strtoupper($table_fieldname).'_ONLINE, $'.$table_fieldname.'_online);';
+ }
+ if(isset($_REQUEST['table_waiting'])) {
$text .= '
- $adminMenu->addInfoBoxLine('.$prefix.strtoupper($t_name).','.$prefix1.strtoupper($t_name).'_PENDING, $'.$t_name.'_pending, ($count_'.$t_name.' == 0) ? $r : $g);
-'; //}
+ $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$language2.strtoupper($table_fieldname).'_WAITING, $'.$table_fieldname.'_waiting);
+';
+ }
}
$text .= '
- echo $adminMenu->addNavigation("index.php") ;
+ // Render Index
+ echo $adminMenu->addNavigation(\'index.php\');
echo $adminMenu->renderIndex();
-include "admin_footer.php";
+include_once \'admin_footer.php\';
?>';
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_language.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_language.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_language.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -14,109 +14,126 @@
* @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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 const_admin_language.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: const_admin_language.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_language($modules, $modules_name, $tables_arr, $topic)
+function const_admin_language($modules, $mod_name, $tables_arr, $category)
{
if(!isset($xoopsConfig)) {
global $xoopsConfig;
}
- $language = '_AM_'.strtoupper($modules_name).'_';
+ $language = '_AM_'.strtoupper($mod_name).'_';
+ $language1 = '_AM_'.strtoupper($mod_name).'_THEREARE_';
$file = 'admin.php';
- $path_file = TDM_CREATE_MURL."/".$modules_name."/language/".$xoopsConfig['language']."/".$file;
+ $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/language/'.$xoopsConfig['language'].'/'.$file;
$text = '<?php'.const_header($modules, $file).'
-//Index
+//Menu
';
+$text .= 'define(\''.$language.'STATISTICS\', "'.ucfirst($mod_name).' statistics");';
foreach (array_keys($tables_arr) as $i)
{
- $t_name = $tables_arr[$i]->getVar("tables_name");
- $text .= 'define("'.$language.strtoupper($t_name).'","'.ucfirst($t_name).' Statistics");
-define("'.$language.'THEREARE_'.strtoupper($t_name).'","There are <span class=\'bold\'>%s</span> '. ucfirst($t_name).' in the Database");
-define("'.$language.'THEREARE_'.strtoupper($t_name).'_ONLINE","There are <span class=\'bold\'>%s</span> '. ucfirst($t_name).' online in the Database");
-define("'.$language.'THEREARE_'.strtoupper($t_name).'_PENDING","There are <span class=\'bold\'>%s</span> '. ucfirst($t_name).' pending in the Database");
-';
+ $table_name = $tables_arr[$i]->getVar('table_name');
+ $table_name_nohs = str_replace('_', ' ', $table_name);
+ $text .= '
+define(\''.$language1.strtoupper($table_name).'\', "There are <span class=\'bold\'>%s</span> '. ucfirst($table_name_nohs).' in the database");';
+if(isset($_REQUEST['table_online'])) {
+$text .= '
+define(\''.$language1.strtoupper($table_name).'ONLINE\', "There are <span class=\'bold\'>%s</span> '. ucfirst($table_name_nohs).' online in the database");'; }
+if(isset($_REQUEST['table_waiting'])) {
+$text .= '
+define(\''.$language1.strtoupper($table_name).'WAITING\', "There are <span class=\'bold\'>%s</span> '. ucfirst($table_name_nohs).' waiting in the database");
+'; }
}
+$text .= '
+//Buttons';
foreach (array_keys($tables_arr) as $i)
-{
- $t_name = $tables_arr[$i]->getVar("tables_name");
-$text .= '//Buttons
-define("'.$language.'NEW'.strtoupper($t_name).'","Add New '.UcFirstAndToLower($t_name).'");
-define("'.$language.''.strtoupper($t_name).'LIST","List '.UcFirstAndToLower($t_name).'");
-define("'.$language.''.strtoupper($t_name).'WAIT","Pending '.UcFirstAndToLower($t_name).'");
-';
+{
+ $table_name = $tables_arr[$i]->getVar('table_name');
+ $table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
+ $table_name_nohs = str_replace('_', ' ', $table_name);
+ $table_fieldname_nohs = str_replace('_', ' ', $table_fieldname);
+$text .= '
+define(\''.$language.'ADD_'.strtoupper($table_name).'\', "Add new '.$table_name_nohs.'");
+define(\''.$language.''.strtoupper($table_name).'_LIST\', "List of '.$table_name_nohs.'");';
+if(isset($_REQUEST['table_waiting']))
+{
+ $text .= '
+define(\''.$language.''.strtoupper($table_name).'_WAITING\', "Waiting '.$table_name_nohs.'");
+';}
}
$text .= '
//General
-define("'.$language.'FORMOK","Registered successfull");
-define("'.$language.'FORMDELOK","Deleted successfull");
-define("'.$language.'FORMSUREDEL", "Are you sure you want to delete: <span class=\'bold red\'>%s</span>");
-define("'.$language.'FORMSURERENEW", "Are you sure you want renew: <span class=\'bold red\'>%s</span>");
-define("'.$language.'FORMUPLOAD","Upload");
-define("'.$language.'FORMIMAGE_PATH","File presents in %s");
-define("'.$language.'FORMACTION","Action");
-define("'.$language.'OFF","Offline");
-define("'.$language.'ON","Online");
+define(\''.$language.'FORMOK\',"Registered successfull");
+define(\''.$language.'FORMDELOK\',"Deleted successfull");
+define(\''.$language.'FORMSUREDEL\', "Are you sure to Delete: <span class=\'bold red\'>%s</span></b>");
+define(\''.$language.'FORMSURERENEW\', "Are you sure to Renew: <span class=\'bold red\'>%s</span></b>");
+define(\''.$language.'FORMUPLOAD\',"Upload");
+define(\''.$language.'FORMIMAGE_PATH\',"File presents in %s");
+define(\''.$language.'FORMACTION\',"Action");
';
-
$verif = true;
foreach (array_keys($tables_arr) as $i)
{
- //Champs
- $t_name = $tables_arr[$i]->getVar("tables_name");
- $champs_total = explode("|", $tables_arr[$i]->getVar("tables_champs"));
- $nb_champs = $tables_arr[$i]->getVar("tables_nb_champs");
- $language1 = $language.strtoupper($t_name).'_';
+ $table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
+ $fields_total = explode('|', $tables_arr[$i]->getVar('table_fields'));
+ $nb_fields = count($fields_total);
+ $nb_caracteres = strlen($table_fieldname);
+ $lng_prefix = $language.strtoupper($table_fieldname);
+ $table_name = str_replace('_', ' ', $tables_arr[$i]->getVar('table_name'));
+ $UcTable_name = UcFirstAndToLower($table_name);
//Recuperation des noms des tables
- for($j=0; $j<$nb_champs; $j++)
+ $text .= '// '.$UcTable_name;
+ for($j=0; $j<$nb_fields; $j++)
{
- //Nom des champs
- $champs_name = explode(":", $champs_total[$j]);
- $champs_final[$j] = substr($champs_name[0], strpos($champs_name[0], "_") + 1);
+ //Nom des fields
+ $fields1 = explode(":", $fields_total[$j]);
+ $fields[$j] = $fields1[0];
+ $fields_final[$j] = substr($fields1[0], $nb_caracteres);
if ( $verif == true )
{
$text .= '
-define("'.$language1.'ADD","Add a '.UcFirstAndToLower($t_name).'");
-define("'.$language1.'EDIT","Edit a '.UcFirstAndToLower($t_name).'");
-define("'.$language1.'DELETE","Delete a '.UcFirstAndToLower($t_name).'");
+define(\''.$lng_prefix.'_ADD\', "Add a '.strtolower($table_name).'");
+define(\''.$lng_prefix.'_EDIT\', "Edit '.strtolower($table_name).'");
+define(\''.$lng_prefix.'_DELETE\', "Delete '.strtolower($table_name).'");
';
}
$verif = false;
- $text .= 'define("'.$language1.strtoupper($champs_final[$j]).'","'.str_ireplace("_", " ", UcFirstAndToLower($champs_final[$j])).'");
-';
+ $text .= '
+define(\''.$lng_prefix.strtoupper($fields_final[$j]).'\', "'.ucfirst($table_fieldname.str_replace("_", " ", $fields_final[$j])).'");';
}
$verif = true;
$text .= '
';
}
-
-$text .= '//Blocks.php';
+$text .= '
+//Blocks.php';
foreach (array_keys($tables_arr) as $i)
{
- $t_name = $tables_arr[$i]->getVar("tables_name");
- $language1 = $language.strtoupper($t_name).'_';
- $text .= '
-define("'.$language1.'BLOCK_DAY","'.UcFirstAndToLower($t_name).' of today");
-define("'.$language1.'BLOCK_RANDOM","'.UcFirstAndToLower($t_name).' random");
-define("'.$language1.'BLOCK_RECENT","'.UcFirstAndToLower($t_name).' recents");
+ $table_name = str_replace('_', ' ', ucfirst($tables_arr[$i]->getVar('table_name')));
+ $lng_prefix = $language.strtoupper($table_name).'_';
+$text .= '
+define(\''.$lng_prefix.'BLOCK\', "'.ucfirst(str_replace("_", " ", $table_name)).' block");
';
-}
-if( $topic == 1 ){
+}
+if( $category == 1 ) {
$text .= '
//Permissions
-define("'.$language.'PERMISSIONS_ACCESS","Permissions to access");
-define("'.$language.'PERMISSIONS_VIEW","Permissions to view");
-define("'.$language.'PERMISSIONS_SUBMIT","Permissions to submit");';}
+define(\''.$language.'PERMISSIONS_ACCESS\', "Permissions to access");
+define(\''.$language.'PERMISSIONS_VIEW\', "Permissions to view");
+define(\''.$language.'PERMISSIONS_SUBMIT\', "Permissions to submit");
+';
+}
$text .= '
//Error NoFrameworks
-define("'.$language.'NOFRAMEWORKS","Error: You don't use the Frameworks \"admin module\". Please install this Frameworks");
-define("'.$language.'MAINTAINEDBY", "is maintained by the");
+define(\'_AM_ERROR_NOFRAMEWORKS\', "Error: You don't use the Frameworks \"admin module\". Please install this Frameworks");
+define(\''.$language.'MAINTAINEDBY\', "is maintained by the");
?>';
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_LANGUAGES,
_AM_TDMCREATE_CONST_NOTOK_LANGUAGES, $file);
-}
\ No newline at end of file
+}
+?>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_menu.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_menu.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -14,53 +14,60 @@
* @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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 const_admin_menu.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: const_admin_menu.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_menu($modules, $mod_name, $tables_arr, $topic)
+function const_admin_menu($modules, $mod_name, $tables_arr, $category)
{
- global $xoopsModule, $xoopsConfig;
$language = '_MI_'.strtoupper($mod_name).'_ADMENU';
$file = 'menu.php';
- $path_file = TDM_CREATE_MURL."/".$mod_name."/admin/".$file;
+ $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$menu = 1;
$text = '<?php'.const_header($modules, $file).'
-$pathIcon32 = $GLOBALS[\'xoopsModule\']->getInfo("icons32");
-$adminmenu = array(); $i = 1;
-$adminmenu[$i]["title"] = '.$language.$menu.';
-$adminmenu[$i]["link"] = "admin/index.php";
-$adminmenu[$i]["icon"] = "../../".$pathIcon32."/dashboard.png"; $i++;'.PHP_EOL;
+$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+$module_handler =& xoops_gethandler(\'module\');
+$xoopsModule =& XoopsModule::getByDirname($dirname);
+$moduleInfo =& $module_handler->get($xoopsModule->getVar(\'mid\'));
+$pathIcon32 = $moduleInfo->getInfo(\'icons32\');
+$adminmenu = array();
+$i = 1;
+$adminmenu[$i][\'title\'] = '.$language.$menu.';
+$adminmenu[$i][\'link\'] = \'admin/index.php\';
+$adminmenu[$i][\'icon\'] = $pathIcon32.\'/home.png\';
+$i++;'.PHP_EOL;
$menu++;
foreach (array_keys($tables_arr) as $i)
- {
- //$tables_id = $tables_arr[$i]->getVar("tables_id");
- if ( $tables_arr[$i]->getVar("tables_display_admin") == 1 ) {
-
- $text .= '$adminmenu[$i]["title"] = '.$language.$menu.';
-$adminmenu[$i]["link"] = "admin/'.$tables_arr[$i]->getVar("tables_name").'.php";
-$adminmenu[$i]["icon"] = "../../".$pathIcon32."/'.$tables_arr[$i]->getVar("tables_img").'"; $i++;'.PHP_EOL;
+ {
+ if ( $tables_arr[$i]->getVar('table_admin') == 1 )
+ {
+ $text .= '$adminmenu[$i][\'title\'] = '.$language.$menu.';
+$adminmenu[$i][\'link\'] = \'admin/'.$tables_arr[$i]->getVar('table_name').'.php\';
+$adminmenu[$i][\'icon\'] = $pathIcon32.\'/'.$tables_arr[$i]->getVar('table_image').'\';
+$i++;'.PHP_EOL;
$menu++;
}
- $tables_module_table = $tables_arr[$i]->getVar("tables_module_table");
}
$menu--;
//$menu_id = $menu;
//unset( $menu );
-if( $topic == 1 ){
+if( $category == 1 ) {
$menu++;
-$text .= '$adminmenu[$i]["title"] = '.$language.$menu.';
-$adminmenu[$i]["link"] = "admin/permissions.php";
-$adminmenu[$i]["icon"] = "../../".$pathIcon32."/permissions.png"; $i++;'.PHP_EOL;
+$text .= '$adminmenu[$i][\'title\'] = '.$language.$menu.';
+$adminmenu[$i][\'link\'] = \'admin/permissions.php\';
+$adminmenu[$i][\'icon\'] = $pathIcon32.\'/permissions.png\';
+$i++;'.PHP_EOL;
}
$menu++;
$text .= '$adminmenu[$i]["title"] = '.$language.$menu.';
-$adminmenu[$i]["link"] = "admin/about.php";
-$adminmenu[$i]["icon"] = "../../".$pathIcon32."/about.png"; unset( $i );
+$adminmenu[$i][\'link\'] = \'admin/about.php\';
+$adminmenu[$i][\'icon\'] = $pathIcon32.\'/about.png\';
+unset( $i );
?>';
unset( $menu );
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
-}
\ No newline at end of file
+}
+?>
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_pages.php 2013-04-16 15:19:57 UTC (rev 11387)
+++ XoopsModules/TDMCreate/branches/timgno/1.59/TDMCreate/const/const_admin_pages.php 2013-04-16 15:22:50 UTC (rev 11388)
@@ -14,130 +14,210 @@
* @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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 const_admin_pages.php 11297 2013-03-24 10:58:10Z timgno $
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: const_admin_pages.php 11084 2013-02-23 15:44:20Z timgno $
*/
include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php';
-function const_admin_pages($modules, $mod_name, $tables_id, $table_name, $table_fieldname, $fields_arr, $topic)
+function const_admin_pages($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_category)
{
- $prefix = '_AM_'.strtoupper($mod_name).'';
+ $language = '_AM_'.strtoupper($mod_name);
+ $language_manager = '_AM_'.strtoupper($mod_name).'_'.strtoupper($table_fieldname);
+ $mod_name_minuscule = strtolower($mod_name);
$file = $table_name.'.php';
- $path_file = TDM_CREATE_MURL."/".$mod_name."/admin/".$file;
+ $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
$text = '<?php'.const_header($modules, $file).'
-include "admin_header.php";
-// We recovered the value of the argument op in the URL$
-$op = '.$mod_name.'_CleanVars($_REQUEST, \'op\', \'list\', \'string\');
-';
- // Fields
- foreach(array_keys($fields_arr) as $i)
- {
- // Name of fields
- $field_id = $fields_arr[$i]->getVar('field_id');
- $field_name = $fields_arr[$i]->getVar('field_name');
- }
-
+include_once \'admin_header.php\';
+//It recovered the value of argument op in URL$
+$op = '.$mod_name.'_CleanVars($_REQUEST, \'op\', \'list\', \'string\');';
+if(isset($_REQUEST['tables_waiting'])) {
$text .= '
-echo $adminMenu->addNavigation("'.$table_name.'.php");
+// the number of loading not validated
+$criteria = new CriteriaCompo();
+$criteria->add(new Criteria(\''.$table_fieldname.'_waiting\', 0));
+$'.$table_fieldname.'_waiting = $'.$table_name.'Handler->getCount($criteria);'; }
+//fields
+$fields_total = explode('|', $table_fields);
+$nb_fields = count($fields_total);
+
+//parameters
+$parameters_total = explode('|', $table_parameters);
+
+//Recuperation des noms des tables
+for($i=0; $i<$nb_fields; $i++)
+{
+ //Nom des fields
+ $fields1 = explode(':', $fields_total[$i]);
+ $fields[$i] = $fields1[0];
+ //Afficher dans l'admin
+ if( $i == 0 ) {
+ $fpa[$i] = '0';
+ } else {
+ $param = explode(':', $parameters_total[$i-1]);
+ $fpt[$i] = $param[0]; // fpt = fields parameters type
+ $fpa[$i] = $param[1]; // fpa = fields parameters admin
+ $fprf[$i] = $param[6]; // fprf = fields parameters required field
+ if ( $param[4] == 1 ) {
+ $fpmf = $fields[0]; // fpmf = fields parameters main field
+ }
+ }
+}
+
+$field_id = $fields[0];
+$fields_name = $fields[1];
+
+$text .= '
+echo $adminMenu->addNavigation(\''.$table_name.'.php\');
switch ($op)
{
- case "list":
- default:
- $adminMenu->addItemButton('.$prefix.'_ADD_'.strtoupper($table_fieldname).', \''.$table_name.'.php?op=new\', \'add\');
+ case \'list\':
+ default:
+ $adminMenu->addItemButton('.$language.'_ADD_'.strtoupper($table_name).', \''.$table_name.'.php?op=new\', \'add\');
echo $adminMenu->renderButton();
- $limit = $GLOBALS[\'xoopsModuleConfig\'][\'adminperpage\'];
$criteria = new CriteriaCompo();
- $criteria->setSort("'.$field_id.' ASC, '.$fields_name.'");
- $criteria->setOrder("ASC");
+ $criteria->setSort(\''.$field_id.'\');
+ $criteria->setOrder(\'ASC\');
$numrows = $'.$table_name.'Handler->getCount();
- $start = '.$mod_name.'_CleanVars ( $_REQUEST, \'start\', 0, \'int\' );
- $criteria->setStart($start);
- $criteria->setLimit($limit);
- $'.$table_fieldname.'_arr = $'.$table_name.'Handler->getall($criteria);
- if ( $numrows > $limit ) {
- include_once XOOPS_ROOT_PATH . "/class/pagenav.php";
- $pagenav = new XoopsPageNav($numrows, $limit, $start, \'start\', \'op=list\');
- $pagenav = $pagenav->renderNav(4);
- } else {
- $pagenav = \'\';
- }
-
- //Function that enables display child categories
- function '.$mod_name.'_display_children($topic_id = 0, $topic_arr, $prefix = "", $order = "", &$class)
+ $'.$table_name.'_arr = $'.$table_name.'Handler->getAll($criteria);
+ ';
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 0);
+ if ( $table_category != 1 )
+ {
+ $text .='
+ // Table view
+ if ($numrows>0)
+ {
+ echo "<table width=\'100%\' cellspacing=\'1\' class=\'outer\'>
+ <tr>';
+ $text .= $fcn.'
+ <th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
+ </tr>";
+
+ $class = "odd";
+
+ foreach (array_keys($'.$table_name.'_arr) as $i)
+ {
+ echo "<tr class=\'".$class."\'>";
+ $class = ($class == "even") ? "odd" : "even";
+ ';
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 1);
+
+ $text .= $fields_data.'
+ echo "<td class=\'center width5\'>
+ <a href=\''.$table_name.'.php?op=edit&'.$field_id.'=".$i."\'><img src=".$pathIcon16."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a>
+ <a href=\''.$table_name.'.php?op=delete&'.$field_id.'=".$i."\'><img src=".$pathIcon16."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a>
+ </td>";
+ echo "</tr>";
+ }
+ echo "</table><br /><br />";
+ } else {
+ echo "<table width=\'100%\' cellspacing=\'1\' class=\'outer\'>
+ <tr>';
+ $text .= $fcn.'
+ <th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
+ </tr><tr><td class=\'errorMsg\' colspan=\''.$nb_fields.'\'>There are no '.$table_fieldname.'</td></tr>";
+ echo "</table><br /><br />";
+ }
+ ';
+ } else {
+ $text .= '
+ // Display function that allows children categories
+ function '.$mod_name.'_children($cat_id = 0, $'.$table_name.'_arr, $prefix = "", $order = "", &$class)
{
global $pathIcon16;
- $topicHandler =& xoops_getModuleHandler("'.$table_name.'", "'.$mod_name.'");
- $prefix = $prefix."<img src=\'".XOOPS_URL."/modules/'.$mod_name.'/images/deco/arrow.gif\'>";
- foreach (array_keys($topic_arr) as $i)
+ $categoriesHandler =& xoops_getModuleHandler("'.$mod_name.'_categories", "'.$mod_name.'");
+ $prefix = $prefix."<img src=\'".'.strtoupper($mod_name).'_URL."/images/icons/16/arrow.gif\'>";
+ foreach (array_keys($categories_arr) as $i)
{
- $topic_id = $topic_arr[$i]->getVar("topic_id");
- $topic_img = $topic_arr[$i]->getVar("topic_img");
- $topic_title = $topic_arr[$i]->getVar("topic_title");
- $topic_weight = $topic_arr[$i]->getVar("topic_weight");
+ $cat_id = $categories_arr[$i]->getVar(\'cat_id\');
+ $cat_image = $categories_arr[$i]->getVar(\'cat_image\');
+ $cat_title = $categories_arr[$i]->getVar(\'cat_title\');
+ $cat_weight = $categories_arr[$i]->getVar(\'cat_weight\');
echo "<tr class=\'".$class."\'>";
- echo "<td class=\'center\'>".$i."</td>";
';
- $text .= const_show_fields_parameters($mod_name, $table_fieldname, $fields_arr, $prefix, 1, 1).'
- echo "<td class=\'center\' width=\'10%\'>
- <a href=\''.$table_name.'.php?op=edit_'.$table_fieldname.'&'.$field_id.'=".$i."\'><img src=".$pathIcon16."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a>
- <a href=\''.$table_name.'.php?op=delete_'.$table_fieldname.'&'.$field_id.'=".$i."\'><img src=".$pathIcon16."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a>
+ $fields_data = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 1);
+
+ $text .= ''.$fields_data.'
+ echo "<td class=\'center width5\'>
+ <a href=\''.$table_name.'.php?op=edit&'.$field_id.'=".$i"\'><img src=".$pathIcon16."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a>
+ <a href=\''.$table_name.'.php?op=delete&'.$field_id.'=".$i"\'><img src=".$pathIcon16."/delete.png alt=\'"._DELETE."\' title=\'"._DELETE."\'></a>
</td>
</tr>";
$class = ($class == "even") ? "odd" : "even";
$criteria = new CriteriaCompo();
- $criteria->add(new Criteria("topic_pid", $topic_arr[$i]->getVar("topic_id")));
- $criteria->setSort("topic_title");
+ $criteria->add(new Criteria("'.$table_fieldname.'_pid", $'.$table_name.'_arr[$i]->getVar(\''.$table_fieldname.'_id\')));
+ $criteria->setSort(\''.$table_fieldname.'_title\');
$criteria->setOrder("ASC");
- $topic_pid = $'.$table_name.'Handler->getall($criteria);
+ $category_pid = $'.$table_name.'Handler->getall($criteria);
$num_pid = $'.$table_name.'Handler->getCount();
if ( $num_pid != 0 )
{
- '.$mod_name.'_display_children($topic_id, $topic_pid, $prefix, $order, $class);
+ '.$mod_name.'_children($cat_id, $category_pid, $prefix, $order, $class);
}
}
}
- // View Table
+ // Table view
if ($numrows>0)
{
- echo "<table class=\'outer width100\' cellspacing=\'1\'>
- <tr>
- <th class=\'center width2\'>".'.$prefix.'_'.strtoupper($table_fieldname).'_ID."</th>
- ';
- $fields_colonne_name = const_show_fields_parameters($mod_name, $table_fieldname, $fields_arr, $prefix, '', 0);
- $text .= $fields_colonne_name.'<th class=\'center width5\'>".'.$prefix.'_FORMACTION."</th>
+ echo "<table width=\'100%\' cellspacing=\'1\' class=\'outer\'>
+ <tr>';
+ $fcn = const_show_fields_parameters($mod_name, $table_name, $table_fieldname, $field_id, $nb_fields, $fields, $fpa, $fpt, $language, '', 0);
+ $text .= $fcn.'
+ <th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
</tr>";
$class = "odd";
- $prefix = "<img src=\'".XOOPS_URL."/modules/'.$mod_name.'/images/deco/arrow.gif\'>";
- foreach (array_keys($'.$table_fieldname.'_arr) as $i)
- {
- echo "<tr class=\'".$class."\'>";
- $class = ($class == "even") ? "odd" : "even";
- echo "<td class=\'center\'>".$i."</td>";
- ';
- $text .= const_show_fields_parameters($mod_name, $table_fieldname, $fields_arr, $prefix, '', 1).'
- echo "<td class=\'center width5\'>
- <a href=\''.$table_name.'.php?op=edit_'.$table_fieldname.'&'.$field_id.'=".$i."\'><img src=".$pathIcon16."/edit.png alt=\'"._EDIT."\' title=\'"._EDIT."\'></a>
- <a href=\''.$table_name.'.php?op=...
[truncated message content] |