|
From: <be...@us...> - 2013-10-23 02:45:13
|
Revision: 12206
http://sourceforge.net/p/xoops/svn/12206
Author: beckmi
Date: 2013-10-23 02:45:08 +0000 (Wed, 23 Oct 2013)
Log Message:
-----------
Updating trunk to revision 11599 (timgno: solved little bugs, Updated)
Revision Links:
--------------
http://sourceforge.net/p/xoops/svn/11599
Modified Paths:
--------------
XoopsModules/TDMCreate/trunk/TDMCreate/admin/admin_header.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/building.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/tables.php
XoopsModules/TDMCreate/trunk/TDMCreate/class/tdmcreate_modules.php
XoopsModules/TDMCreate/trunk/TDMCreate/class/tdmcreate_tables.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_about.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_footer.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_header.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_index.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_language.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_menu.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_pages.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_permissions.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_architecture.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_blocks.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_blocks_language.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_blocks_templates.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_changelog.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_class.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_css_style.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_header.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_help_language.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_include_comments.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_include_common.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_include_functions.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_include_functions_comments.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_include_install.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_include_jquery.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_include_notifications.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_include_search.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_js_jquery.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_languages.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_main_language.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_modinfo_language.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_sql.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_templates.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_templates_admin_about.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_templates_admin_help.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_templates_footer.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_templates_header.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_templates_index.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_templates_pages.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_user_comments.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_user_header.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_user_index.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_user_pages.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_waiting.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_xoopsversion.php
XoopsModules/TDMCreate/trunk/TDMCreate/docs/credits.txt
XoopsModules/TDMCreate/trunk/TDMCreate/docs/readme.txt
XoopsModules/TDMCreate/trunk/TDMCreate/include/functions.php
XoopsModules/TDMCreate/trunk/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/trunk/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/trunk/TDMCreate/language/english/help/help.html
XoopsModules/TDMCreate/trunk/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/trunk/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/trunk/TDMCreate/xoops_version.php
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/admin_header.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/admin_header.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/admin_header.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -20,17 +20,16 @@
*/
include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php';
include_once XOOPS_ROOT_PATH . '/include/cp_header.php';
-include_once("../include/functions.php");
+include_once('../include/functions.php');
include_once 'includes.php';
//
$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
//
-
-$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
-$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
-//load class
+// Get class handler
$modulesHandler =& xoops_getModuleHandler('tdmcreate_modules', 'TDMCreate');
$tablesHandler =& xoops_getModuleHandler('tdmcreate_tables', 'TDMCreate');
//
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/building.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/building.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -28,18 +28,12 @@
}
$mod_name = strtolower($modules->getVar('mod_name'));
-$mod_desc = $modules->getVar('mod_description');
$mod_author_website_name = $modules->getVar('mod_author_website_name');
$mod_author_website_url = $modules->getVar('mod_author_website_url');
-$mod_image = $modules->getVar('mod_image');
-$mod_active_search = $modules->getVar('mod_search');
-$mod_active_comments = $modules->getVar('mod_comments');
-$mod_active_notifications = $modules->getVar('mod_notifications');
-$mod_paypal_button = $modules->getVar('mod_donations');
-$mod_subversion = $modules->getVar('mod_subversion');
+$mod_permissions = $modules->getVar('mod_permissions');
if (isset($_REQUEST['table_name'])) {
- $tables =& $tablesHandler->get(isset($_REQUEST['table_name']));
+ $tables =& $tablesHandler->get($_REQUEST['table_name']);
} else {
$tables =& $tablesHandler;
}
@@ -61,14 +55,14 @@
// Effacer repertoire of nouveau module s'il existe
TDMCreate_clearDir($modPath.'/modules/'.$mod_name);
// Debut
- OpenTable();
+ TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_OK, _AM_TDMCREATE_BUILDING_NOTOK);
/************************************************/
/*Structure*/
/************************************************/
//Creation of architecture
- const_architecture($mod_name, $mod_image);
+ const_architecture($modules);
//Creation of changelog.txt
- const_changelog($modules, $mod_name);
+ const_changelog($modules);
$result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
list( $category ) = $xoopsDB->fetchRow($result);
@@ -85,15 +79,10 @@
$table_blocks = $tables_arr[$i]->getVar('table_blocks');
$table_admin = $tables_arr[$i]->getVar('table_admin');
$table_user = $tables_arr[$i]->getVar('table_user');
- if ($mod_active_search != 0) {
- $table_search = $tables_arr[$i]->getVar('table_search');
- }
- if ($mod_active_comments != 0) {
- $table_comments = $tables_arr[$i]->getVar('table_comments');
- }
- if ($mod_active_notifications != 0) {
- $table_notifications = $tables_arr[$i]->getVar('table_notifications');
- }
+ $table_search = $tables_arr[$i]->getVar('table_search');
+ $table_comments = $tables_arr[$i]->getVar('table_comments');
+ $table_notifications = $tables_arr[$i]->getVar('table_notifications');
+ $table_permissions = $tables_arr[$i]->getVar('table_permissions');
$table_waiting = $tables_arr[$i]->getVar('table_waiting');
// Fabrication
@@ -104,114 +93,116 @@
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $mod_name, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
- }
- // Creation of permissions
- if ( $table_category == 1) {
- const_admin_permissions($modules, $mod_name, $table_name, $table_fieldname);
- }
+ const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
+ }
// Creation of pages admin
if ( $table_admin == 1 ) {
- const_admin_pages($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
+ const_admin_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
}
// Creation of pages and templates user
if ( $table_user == 1 && $table_name != null ) {
- const_user_pages($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters);
- const_templates_pages($modules, $mod_name, $table_name, $table_fieldname, $table_fields);
+ const_user_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
+ const_templates_pages($modules, $table_name, $table_fieldname, $table_fields);
}
// Creation of search
- if ( isset($table_search) ) {
- const_include_search($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_image);
- }
- // Creation of comments
- if ( isset($table_comments) ) {
- const_include_comments($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters);
- }
+ if ( $table_search == 1 ) {
+ const_include_search($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_image);
+ }
// Creation of notifications
- if ( isset($table_notifications) ) {
- const_include_notifications($modules, $modules_name, $table_name, $table_fieldname);
+ if ( $table_notifications == 1 ) {
+ const_include_notifications($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
}
// Creation of the file mysql.sql
- const_sql($mod_name, $table_name, $table_fieldname, $category, $table_fields);
+ const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
// Creation of blocks
if ( $table_blocks == 1 ) {
- const_blocks($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
+ const_blocks($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $category);
//Creation of template per blocks
- const_blocks_templates($modules, $mod_name, $table_name, $table_fieldname, $table_fields, $table_parameters);
+ const_blocks_templates($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
+ }
+ // Creation of admin permissions.php
+ if ( $table_permissions == 1) {
+ const_admin_permissions($modules, $table_name, $table_fields, $table_parameters);
}
}
//Creation of architecture of more fields and data
//const_architecture(null, null, $table_admin, $table_blocks, $table_admin, $table_blocks );
+ // Creation of comments
+ if ( $table_comments == 1 ) {
+ const_include_comments($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
+ }
if ( $table_waiting == 1 ) {
// Creation of Waiting Plugin
- const_waiting($modules, $mod_name, $tables_arr);
+ const_waiting($modules, $tables_arr);
}
// Creation of xoopsversion.php
- const_xoopsversion($modules, $mod_name, $table_name, $table_fields, $table_parameters, $tables_arr);
+ const_xoopsversion($modules, $table_name, $table_fields, $table_parameters, $tables_arr);
if ( $table_user == 1 && $table_name != null ) {
// Creation of template index
- const_templates_index($modules, $mod_name);
+ const_templates_index($modules);
// Creation of template header
- const_templates_header($modules, $mod_name, $tables_arr);
+ const_templates_header($modules, $tables_arr);
// Creation of template footer
- const_templates_footer($modules, $mod_name, $table_comments, $table_notifications);
+ const_templates_footer($modules, $table_comments, $table_notifications);
}
if ( $table_admin == 1 ) {
// Creation of template admin about
- const_templates_admin_about($modules, $mod_name);
+ const_templates_admin_about($modules);
// Creation of template admin help
- const_templates_admin_help($modules, $mod_name);
+ const_templates_admin_help($modules);
}
// Include
///////////////////////////////////////////////////////////////////////
// Configs
- const_include_common($modules, $mod_name, $mod_author_website_name, $mod_author_website_url);
+ const_include_common($modules, $mod_author_website_name, $mod_author_website_url);
// Functions
- const_include_functions($modules, $mod_name);
+ const_include_functions($modules);
//Creation of file install per l'uploads
- const_include_install($modules, $mod_name, $tables_arr);
+ const_include_install($modules, $tables_arr);
// Language
///////////////////////////////////////////////////////////////////////
if ( $table_user == 1 ) {
//Creation of language main.php
- const_main_language($modules, $mod_name, $mod_desc, $tables_arr);
+ const_main_language($modules, $tables_arr);
}
// Creation of language modinfo.php
- const_modinfo_language($modules, $mod_name, $mod_desc, $table_name, $table_image, $tables_arr, $category);
- // Creation of language admin.php
- const_admin_language($modules, $mod_name, $tables_arr, $category);
+ const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $category);
+ if ( $table_admin == 1 ) {
+ // Creation of language admin.php
+ const_admin_language($modules, $tables_arr, $category);
+ }
if ( $table_blocks == 1 ) {
// Creation of language blocks.php
- const_blocks_language($modules, $mod_name, $tables_arr);
+ const_blocks_language($modules, $tables_arr);
}
// Creation of language help/help.html
- const_help_language($modules, $mod_name, $mod_desc);
+ const_help_language($modules);
///////////////////////////////////////////////////////////////////////
//Creation of style.css
- const_css_style($modules, $mod_name);
+ const_css_style($modules);
/************************************************/
/*Admin*/
/************************************************/
// Creation of admin header.php
- const_admin_header($modules, $mod_name, $tables_arr);
+ const_admin_header($modules, $tables_arr);
// Creation of admin index.php
- const_admin_index($modules, $mod_name, $table_name, $tables_arr);
+ const_admin_index($modules, $table_name, $tables_arr);
// Creation of admin footer.php
- const_admin_footer($modules, $mod_name, $tables_arr);
+ const_admin_footer($modules);
// Creation of admin menu.php
- const_admin_menu($modules, $mod_name, $tables_arr, $category);
+ const_admin_menu($modules, $tables_arr, $category);
// Creation of admin about.php
- const_admin_about($modules, $mod_name, $mod_paypal_button);
+ const_admin_about($modules);
/************************************************/
/*User*/
/************************************************/
if ( $table_user == 1 ) {
- const_user_header($modules, $mod_name);
- const_user_index($modules, $mod_name);
+ const_user_header($modules);
+ const_user_index($modules);
}
- CloseTable();
+ TDMCreate_CloseTable();
break;
case 'default':
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/modules.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/modules.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -83,6 +83,8 @@
$obj->setVar('mod_search', $_REQUEST['mod_search']);
$obj->setVar('mod_comments', $_REQUEST['mod_comments']);
$obj->setVar('mod_notifications', $_REQUEST['mod_notifications']);
+ $obj->setVar('mod_permissions', $_REQUEST['mod_permissions']);
+ $obj->setVar('mod_install', $_REQUEST['mod_install']);
$obj->setVar('mod_donations', $_POST['mod_donations']);
$obj->setVar('mod_subversion', $_POST['mod_subversion']);
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/tables.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/tables.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -21,7 +21,6 @@
include_once 'admin_header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
echo $adminMenu->addNavigation('tables.php');
-$GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
switch ($op) {
case 'save_table':
if (isset($_REQUEST['table_id'])) {
@@ -50,6 +49,7 @@
$obj->setVar('table_search', 0);
$obj->setVar('table_comments', 0);
$obj->setVar('table_notifications', 0);
+ $obj->setVar('table_permissions', 0);
$obj->setVar('table_nbfields', 7);
$table_fields = 'cat_id:int:8:unsigned:NOT NULL: :primary|cat_pid:int:5:unsigned:NOT NULL:0:unique|cat_title:varchar:255: :NOT NULL: :unique|cat_desc:text: : :NOT NULL: :|cat_image:varchar:255: :NOT NULL: :|cat_weight:int:5:unsigned:NOT NULL:0:|cat_color:varchar:10: :NULL: :';
@@ -94,7 +94,8 @@
$obj->setVar('table_online', $_REQUEST['table_online']);
$obj->setVar('table_search', $_REQUEST['table_search']);
$obj->setVar('table_comments', $_REQUEST['table_comments']);
- $obj->setVar('table_notifications', $_REQUEST['table_notifications']);
+ $obj->setVar('table_notifications', $_REQUEST['table_notifications']);
+ $obj->setVar('table_permissions', $_REQUEST['table_permissions']);
$table_fields = '';
$table_parameters = '';
@@ -218,7 +219,8 @@
$obj->setVar('table_online', $_REQUEST['table_online']);
$obj->setVar('table_search', $_REQUEST['table_search']);
$obj->setVar('table_comments', $_REQUEST['table_comments']);
- $obj->setVar('table_notifications', $_REQUEST['table_notifications']);
+ $obj->setVar('table_notifications', $_REQUEST['table_notifications']);
+ $obj->setVar('table_permissions', $_REQUEST['table_permissions']);
$table_fields = $obj->getVar('table_fields');
$table_nbfields=$_REQUEST['table_nbfields'];
@@ -300,6 +302,8 @@
$table_search = (isset($_REQUEST['table_search'])) ? $_REQUEST['table_search'] : '0';
$table_comments = (isset($_REQUEST['table_comments'])) ? $_REQUEST['table_comments'] : '0';
$table_notifications = (isset($_REQUEST['table_notifications'])) ? $_REQUEST['table_notifications'] : '0';
+ $table_permissions = (isset($_REQUEST['table_permissions'])) ? $_REQUEST['table_permissions'] : '0';
+
$select = (isset($_REQUEST['select'])) ? $_REQUEST['select'] : '0';
//Image
@@ -329,7 +333,7 @@
if ($tablesHandler->insert($obj)) {
$table_id = $xoopsDB->getInsertId();
$obj = $tablesHandler->get($table_id);
- $form = $obj->getFormFields(false, $table_id, intval($_REQUEST['table_mid']), strtolower($_REQUEST['table_name']), strtolower($_REQUEST['table_fieldname']), $table_blocks, $table_display_admin, $table_display_user, $table_status, $table_waiting, $table_online, $table_search, $table_comments, $table_notifications, intval($_REQUEST['table_nbfields']), $select);
+ $form = $obj->getFormFields(false, $table_id, intval($_REQUEST['table_mid']), strtolower($_REQUEST['table_name']), strtolower($_REQUEST['table_fieldname']), $table_blocks, $table_display_admin, $table_display_user, $table_status, $table_waiting, $table_online, $table_search, $table_comments, $table_notifications, $table_permissions, intval($_REQUEST['table_nbfields']), $select);
}
} else {
redirect_header('tables.php', 2, _AM_TDMCREATE_TABLES_EXIST);
@@ -363,6 +367,9 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW_CATEGORY, 'tables.php?op=create_category', 'add');
echo $adminMenu->renderButton();
+
+ $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/style.css' );
+ $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
// Remove unnecessary tables
$sql = "SELECT table_id FROM ".$xoopsDB->prefix("tdmcreate_tables")." WHERE table_mid = 0";
@@ -383,14 +390,14 @@
{
echo '<table width="100%" cellspacing="1" class="outer">';
echo '<tr>';
- echo '<th align="center" width="1%">'._AM_TDMCREATE_ID.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_NAME.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_IMAGE.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_BLOCKS.'</th>';
- echo '<th align="center" width="10%">'._AM_TDMCREATE_NB_FIELDS.'</th>';
- echo '<th align="center" width="1%">'._AM_TDMCREATE_FORMACTION.'</th>';
+ echo '<th class="center width1">'._AM_TDMCREATE_ID.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_NAME.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_IMAGE.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_ADMIN.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_DISPLAY_USER.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_BLOCKS.'</th>';
+ echo '<th class="center width10">'._AM_TDMCREATE_NB_FIELDS.'</th>';
+ echo '<th class="center width5">'._AM_TDMCREATE_FORMACTION.'</th>';
echo '</tr>';
$class = 'odd';
foreach (array_keys($mod_arr) as $i)
@@ -431,7 +438,7 @@
$table_user = (($table_arr[$i]->getVar('table_user') == 1) ? _YES : _NO);
$nb_fields = $table_arr[$i]->getVar('table_nbfields');
$blocks = ($table_blocks == 1) ? _YES : _NO;
- echo '<tr class="even center">';
+ echo '<tr class="even center toggleHidden">';
echo '<td class="center">'.$i.'</b></a></td>';
echo '<td class="left"> <b>- '.$table_name.'</b></a></td>';
if(file_exists($image = $pathIcon32.'/'.$table_image)) {
@@ -443,7 +450,7 @@
echo '<td>'.$table_user.'</td>';
echo '<td>'.$blocks.'</td>';
echo '<td>'.$nb_fields.'</td>';
- echo '<td>';
+ echo '<td class="width6">';
echo '<a href="tables.php?op=edit_table&table_id='.$i.'"><img src="'. $pathIcon16 .'/edit.png" alt="'._AM_TDMCREATE_FORMEDIT.'" title="'._AM_TDMCREATE_FORMEDIT.'"></a> <a href="tables.php?op=edit_fields&table_id='.$i.'"><img src="'. $pathIcon16 .'/inserttable.png" alt="'._AM_TDMCREATE_FORMFIELDS.'" title="'._AM_TDMCREATE_FORMFIELDS.'" /></a> <a href="tables.php?op=delete_table&table_id='.$i.'"><img src="'. $pathIcon16 .'/delete.png" alt="'._AM_TDMCREATE_FORMDEL.'" title="'._AM_TDMCREATE_FORMDEL.'"></a>';
echo '</td>';
echo '</tr>';
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/class/tdmcreate_modules.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/class/tdmcreate_modules.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/class/tdmcreate_modules.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -61,7 +61,9 @@
$this->initVar('mod_user',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['display_user'], false, 1);
$this->initVar('mod_search',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_search'], false, 1);
$this->initVar('mod_comments',XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_comments'], false, 1);
- $this->initVar('mod_notifications', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_notifications'], false, 1);
+ $this->initVar('mod_notifications', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_notifications'], false, 1);
+ $this->initVar('mod_permissions', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['active_permissions'], false, 1);
+ $this->initVar('mod_install', XOBJ_DTYPE_INT, $GLOBALS['xoopsModuleConfig']['inroot_install'], false, 1);
$this->initVar('mod_donations', XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['donations'], false, 50);
$this->initVar('mod_subversion', XOBJ_DTYPE_TXTBOX, $GLOBALS['xoopsModuleConfig']['subversion'], false, 10);
}
@@ -112,6 +114,12 @@
$mod_notifications = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_notifications'] : $this->getVar('mod_notifications');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_NOTIFICATIONS, 'mod_notifications', $mod_notifications, _YES, _NO));
+ $mod_permissions = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['active_permissions'] : $this->getVar('mod_permissions');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_ACTIVE_PERMISSIONS, 'mod_permissions', $mod_permissions, _YES, _NO));
+
+ $mod_install = $this->isNew() ? $GLOBALS['xoopsModuleConfig']['inroot_install'] : $this->getVar('mod_install');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_MODULES_INROOT_INSTALL, 'mod_install', $mod_install, _YES, _NO));
+
$mod_image = $this->getVar('mod_image') ? $this->getVar('mod_image') : 'empty.png';
$uploadirectory = '/modules/'.$xoopsModule->dirname().'/images/uploads/modules';
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/class/tdmcreate_tables.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/class/tdmcreate_tables.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/class/tdmcreate_tables.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -46,11 +46,12 @@
$this->initVar('table_search',XOBJ_DTYPE_INT,null,false, 1);
$this->initVar('table_comments',XOBJ_DTYPE_INT,null,false, 1);
$this->initVar('table_notifications',XOBJ_DTYPE_INT,null,false, 1);
+ $this->initVar('table_permissions',XOBJ_DTYPE_INT,null,false, 1);
}
//Formulaire de saisi de fields
- function getFormFields($action = false, $table_id, $table_mid, $table_name, $table_fieldname, $table_blocks, $table_admin, $table_user, $table_status, $table_waiting, $table_online, $table_search, $table_comments, $table_notifications, $table_nbfields, $select)
+ function getFormFields($action = false, $table_id, $table_mid, $table_name, $table_fieldname, $table_blocks, $table_admin, $table_user, $table_status, $table_waiting, $table_online, $table_search, $table_comments, $table_notifications, $table_permissions, $table_nbfields, $select)
{
global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
if ($action === false) {
@@ -59,7 +60,7 @@
$class = 'even';
$title = $this->isNew() ? sprintf(_AM_TDMCREATE_TABLES_FIELDS_ADD) : sprintf(_AM_TDMCREATE_TABLES_FIELDS_EDIT);
- $table_actions = $table_mid.'&table_id='.$table_id.'&table_name='.$table_name.'&table_fieldname='.$table_fieldname.'&table_blocks='.$table_blocks.'&table_admin='.$table_admin.'&table_user='.$table_user.'&table_status='.$table_status.'&table_waiting='.$table_waiting.'&table_online='.$table_online.'&table_search='.$table_search.'&table_comments='.$table_comments.'&table_notifications='.$table_notifications.'&table_nbfields='.$table_nbfields.'&select='.$select;
+ $table_actions = $table_mid.'&table_id='.$table_id.'&table_name='.$table_name.'&table_fieldname='.$table_fieldname.'&table_blocks='.$table_blocks.'&table_admin='.$table_admin.'&table_user='.$table_user.'&table_status='.$table_status.'&table_waiting='.$table_waiting.'&table_online='.$table_online.'&table_search='.$table_search.'&table_comments='.$table_comments.'&table_notifications='.$table_notifications.'&table_permissions='.$table_permissions.'&table_nbfields='.$table_nbfields.'&select='.$select;
echo "<FORM Method='POST' Action='".$action."?op=save_table&table_mid=".$table_actions."'>
<table border='0' width='100%' cellspacing='1' class='outer'>
@@ -245,6 +246,7 @@
$table_search = $this->getVar('table_search');
$table_comments = $this->getVar('table_comments');
$table_notifications = $this->getVar('table_notifications');
+ $table_permissions = $this->getVar('table_permissions');
$select = 0;
$fields_total = explode("|", $table_fields);
@@ -296,7 +298,7 @@
$fields_param_required_field[$i] = $parameters[6];
}
}
- $table_action = $table_mid.'&table_id='.$table_id.'&table_name='.$table_name.'&table_fieldname='.$table_fieldname.'&table_blocks='.$table_blocks.'&table_display_admin='.$table_admin.'&table_display_user='.$table_user.'&table_status='.$table_status.'&table_waiting='.$table_waiting.'&table_online='.$table_online.'&table_search='.$table_search.'&table_comments='.$table_comments.'&table_notifications='.$table_notifications.'&table_nbfields='.$table_nbfields.'&select='.$select;
+ $table_action = $table_mid.'&table_id='.$table_id.'&table_name='.$table_name.'&table_fieldname='.$table_fieldname.'&table_blocks='.$table_blocks.'&table_display_admin='.$table_admin.'&table_display_user='.$table_user.'&table_status='.$table_status.'&table_waiting='.$table_waiting.'&table_online='.$table_online.'&table_search='.$table_search.'&table_comments='.$table_comments.'&table_notifications='.$table_notifications.'&table_permissions='.$table_permissions.'&table_nbfields='.$table_nbfields.'&select='.$select;
echo "<FORM Method='POST' Action='".$action."?op=save_table&table_mid=".$table_action."'>
<table border='0' width='100%' cellspacing='1' class='outer'>
@@ -444,9 +446,9 @@
echo "<OPTION VALUE='unsigned'>UNSIGNED</OPTION>";
}
if ( $fields_attributes[$i] == 'unsigned zerofill' ) {
- echo "<OPTION VALUE='ON UPDATE CURRENT_TIMESTAMP' selected>on update CURRENT_TIMESTAMP</OPTION>";
+ echo "<OPTION VALUE='ON UPDATE CURRENT_TIMESTAMP' selected>CURRENT_TIMESTAMP</OPTION>";
} else {
- echo "<OPTION VALUE='ON UPDATE CURRENT_TIMESTAMP'>ON UPDATE CURRENT_TIMESTAMP</OPTION>";
+ echo "<OPTION VALUE='ON UPDATE CURRENT_TIMESTAMP'>CURRENT_TIMESTAMP</OPTION>";
}
echo "</SELECT></td>
@@ -666,7 +668,7 @@
function getFormTable($action = false)
{
global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
- $pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+ $pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
@@ -678,56 +680,75 @@
$form = new XoopsThemeForm($title, 'form_tables', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
-
+ //onChange="document.form_tables.submit();
$modulesHandler =& xoops_getModuleHandler('TDMCreate_modules', 'TDMCreate');
- $modules_select = new XoopsFormSelect(_AM_TDMCREATE_TABLES_MODULES, 'table_mid', $this->getVar('table_mid'));
- $modules_select->addOptionArray($modulesHandler->getList());
+ $modules_select = new XoopsFormSelect(_AM_TDMCREATE_TABLES_MODULES, 'table_mid', $this->getVar('table_mid'));
+ //$modules_select->setExtra('onchange="document.location=\'\'+this.options[this.selectedIndex].value"');
+ $modules_select->addOption('');
+ $modules_select->addOptionArray($modulesHandler->getList());
$form->addElement($modules_select, true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_TABLES_NAME, 'table_name', 40, 155, $this->getVar('table_name')), true);
$form->addElement(new XoopsFormText(_AM_TDMCREATE_TABLES_FIELDNAME, 'table_fieldname', 20, 100, $this->getVar('table_fieldname')));
- $form->addElement(new XoopsFormText(_AM_TDMCREATE_TABLES_NB_FIELDS, 'table_nbfields', 5, 10, $this->getVar('table_nbfields')), true);
+ $form->addElement(new XoopsFormText(_AM_TDMCREATE_TABLES_NUMBER_FIELDS, 'table_nbfields', 5, 10, $this->getVar('table_nbfields')), true);
- $select_blocks = $this->isNew() ? 0 : $this->getVar('table_blocks');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_BLOCKS, 'table_blocks', $select_blocks));
-
- $select_admin = $this->isNew() ? 0 : $this->getVar('table_admin');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_DISPLAY_ADMIN, 'table_admin', $select_admin));
-
- $select_user = $this->isNew() ? 0 : $this->getVar('table_user');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_DISPLAY_USER, 'table_user', $select_user));
-
- $form->addElement(new XoopsFormLabel(_AM_TDMCREATE_FORM_INFO_TABLE, _AM_TDMCREATE_FORM_INFO_TABLE_FIELD));
- $select_status = $this->isNew() ? 0 : $this->getVar('table_status');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_STATUS, 'table_status', $select_status));
- $select_waiting = $this->isNew() ? 0 : $this->getVar('table_waiting');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_WAITING, 'table_waiting', $select_waiting));
- $select_online = $this->isNew() ? 0 : $this->getVar('table_online');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_ONLINE, 'table_online', $select_online));
-
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE table_search = '1'");
- list( $active_search ) = $xoopsDB->fetchRow($result);
-
- if ( $active_search == 0 ) {
- $select_search = $this->isNew() ? 1 : $this->getVar('table_search');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_SEARCH, 'table_search', $select_search));
+ $tablesHandler =& xoops_getModuleHandler('TDMCreate_tables', 'TDMCreate');
+ // Category
+ $criteria = new Criteria('table_category', 1);
+ $table_category = $tablesHandler->getCount($criteria);
+ unset($criteria);
+ if ( $table_category == 0 ) {
+ $radio_category = $this->isNew() ? 0 : $this->getVar('table_category');
+ $category = new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_CATEGORY, 'table_category', $radio_category);
+ $category->setDescription(_AM_TDMCREATE_TABLES_CATEGORY_DESC);
+ $form->addElement($category);
}
-
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE table_comments = '1'");
- list( $table_comments ) = $xoopsDB->fetchRow($result);
-
+ // Block
+ $radio_blocks = $this->isNew() ? 0 : $this->getVar('table_blocks');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_BLOCKS, 'table_blocks', $radio_blocks));
+ // Admin
+ $radio_admin = $this->isNew() ? 0 : $this->getVar('table_admin');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_ADMIN, 'table_admin', $radio_admin));
+ // User
+ $radio_user = $this->isNew() ? 0 : $this->getVar('table_user');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_USER, 'table_user', $radio_user));
+ // Others
+ $form->addElement(new XoopsFormLabel('', _AM_TDMCREATE_FORM_INFO_TABLE_OPTIONAL_FIELD));
+ $radio_status = $this->isNew() ? 0 : $this->getVar('table_status');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_STATUS, 'table_status', $radio_status));
+ $radio_waiting = $this->isNew() ? 0 : $this->getVar('table_waiting');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_WAITING, 'table_waiting', $radio_waiting));
+ $radio_online = $this->isNew() ? 0 : $this->getVar('table_online');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_ONLINE, 'table_online', $radio_online));
+ $form->addElement(new XoopsFormLabel('', _AM_TDMCREATE_FORM_INFO_TABLE_STRUCTURES_FIELD));
+ // Search
+ $criteria = new Criteria('table_search', 1);
+ $table_search = $tablesHandler->getCount($criteria);
+ unset($criteria);
+ if ( $table_search == 0 ) {
+ $radio_search = $this->isNew() ? 1 : $this->getVar('table_search');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_SEARCH, 'table_search', $radio_search));
+ }
+ // Comments
+ $criteria = new Criteria('table_comments', 1);
+ $table_comments = $tablesHandler->getCount($criteria);
+ unset($criteria);
if ( $table_comments == 0 ) {
$radio_comments = $this->isNew() ? 1 : $this->getVar('table_comments');
$form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_COMMENTS, 'table_comments', $radio_comments));
+ }
+ // Notifications
+ $radio_notifications = $this->isNew() ? 0 : $this->getVar('table_notifications');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_NOTIFICATIONS, 'table_notifications', $radio_notifications));
+ // Permissions
+ $criteria = new Criteria('table_permissions', 1);
+ $table_permissions = $tablesHandler->getCount($criteria);
+ unset($criteria);
+ if ( $table_permissions == 0 ) {
+ $radio_permissions = $this->isNew() ? 0 : $this->getVar('table_permissions');
+ $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_PERMISSIONS, 'table_permissions', $radio_permissions));
}
-
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix("tdmcreate_tables")." WHERE table_notifications = '1'");
- list( $table_notifications ) = $xoopsDB->fetchRow($result);
-
- if ( $table_notifications == 0 ) {
- $radio_notifications = $this->isNew() ? 1 : $this->getVar('table_notifications');
- $form->addElement(new XoopsFormRadioYN(_AM_TDMCREATE_TABLES_NOTIFICATIONS, 'table_notifications', $radio_notifications));
- }
-
+ $form->addElement(new XoopsFormLabel('', _AM_TDMCREATE_FORM_INFO_TABLE_ICON_FIELD));
+ // Image
$table_image = $this->getVar('table_image') ? $this->getVar('table_image') : 'blank.gif';
if(is_dir($pathIcon32)){
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_about.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_about.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_about.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -19,17 +19,23 @@
* @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($modules, $modules_name, $paypal_button)
+function const_admin_about($modules)
{
+ $mod_name = $modules->getVar('mod_name');
$file = 'about.php';
- $path_file = TDM_CREATE_MURL.'/'.$modules_name.'/admin/'.$file;
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
$text = '<?php'.const_header($modules, $file).'
-include \'admin_header.php\';
+include \'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
+echo $adminMenu->renderabout(\''.$modules->getVar('mod_donations').'\', false);
+include \'footer.php\';';
+ createFile( $tdmcreate_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ if( $modules->getVar('mod_install') == 1 ) {
+ createFile( $root_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_footer.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_footer.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -19,11 +19,14 @@
* @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, $mod_name)
+function const_admin_footer($modules)
{
+ $mod_name = $modules->getVar('mod_name');
+ $mod_support_name = $modules->getVar('mod_support_name');
$language = '_AM_'.strtoupper($mod_name).'_';
- $file = 'admin_footer.php';
- $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $file = 'footer.php';
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$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>
@@ -31,10 +34,15 @@
<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>";
+ <a href=\''.$modules->getVar("mod_support_url").'\' title=\'Visit '.$mod_support_name.'\' class=\'tooltip\' rel=\'external\'>'.$mod_support_name.'</a></div>";
xoops_cp_footer();
';
-createFile($path_file, $text,
- _AM_TDMCREATE_CONST_OK_ADMINS,
- _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ createFile( $tdmcreate_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ if( $modules->getVar('mod_install') == 1 ) {
+ createFile( $root_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ }
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_header.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_header.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_header.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -19,54 +19,59 @@
* @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)
+function const_admin_header($modules, $tables_arr)
{
- $file = 'admin_header.php';
- $path_file = TDM_CREATE_MURL . '/' . $mod_name . '/admin/' . $file;
+ $mod_name = $modules->getVar('mod_name');
+ $file = 'header.php';
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$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';
+<<<EOT
+\nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php';
+\$thisPath = basename(dirname(dirname(__FILE__)));
+include_once \$thisPath.'/include/common.php';
+include_once \$thisPath.'/include/functions.php';
-$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
+\$thisModule = \$GLOBALS['xoopsModule']->getVar('dirname');
-$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
-$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
-$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-//load handlers
-
-EOD;
+\$pathIcon16 = '../' . \$xoopsModule->getInfo('icons16');
+\$pathIcon32 = '../' . \$xoopsModule->getInfo('icons32');
+\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
+//load handlers\n
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = $tables_arr[$i]->getVar('table_name');
-$text .= '$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$mod_name.'_'.$table_name. '\', $thisDirname);'.PHP_EOL;
+$text .= '$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$table_name. '\', $thisModule);'.PHP_EOL;
}
-$text .=<<<'EOD'
-
-$myts =& MyTextSanitizer::getInstance();
-if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+$text .=<<<EOT
+\$myts =& MyTextSanitizer::getInstance();
+if (!isset(\$xoopsTpl) || !is_object(\$xoopsTpl)) {
include_once(XOOPS_ROOT_PATH."/class/template.php");
- $xoopsTpl = new XoopsTpl();
+ \$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);
+xoops_loadLanguage('admin', \$thisModule);
+xoops_loadLanguage('modinfo', \$thisModule);
+xoops_loadLanguage('main', \$thisModule);
// Local admin menu class
-if ( file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))){
- include_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
+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();
-EOD;
-createFile($path_file, $text,
- _AM_TDMCREATE_CONST_OK_ADMINS,
- _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+\$adminMenu = new ModuleAdmin();
+EOT;
+ createFile( $tdmcreate_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ if( $modules->getVar('mod_install') == 1 ) {
+ createFile( $root_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ }
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_index.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_index.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_index.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -19,15 +19,16 @@
* @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, $tbl_name, $tables_arr)
+function const_admin_index($modules, $tbl_name, $tables_arr)
{
+ $mod_name = $modules->getVar('mod_name');
$language = '_AM_'.strtoupper($mod_name).'_';
- $language1 = '_AM_'.strtoupper($mod_name).'_ADMIN_';
- $language2 = '_AM_'.strtoupper($mod_name).'_THEREARE_';
+ $thereare = $language.'_THEREARE_';
$file = 'index.php';
- $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
$text = '<?php'.const_header($modules, $file).'
-include_once \'admin_header.php\';';
+include_once \'header.php\';';
foreach (array_keys($tables_arr) as $i)
{
$table_name = $tables_arr[$i]->getVar('table_name');
@@ -35,6 +36,13 @@
$text .= '
//count "total '.$table_fieldname.'"
$count_'.$table_fieldname.' = $'.$table_name.'Handler->getCount();';
+ if(isset($_REQUEST['table_status'])) {
+ $text .= '
+ //count "status"
+ $criteria = new CriteriaCompo();
+ $criteria->add(new Criteria("'.$table_fieldname.'_status", 1));
+ $'.$table_fieldname.'_status = $'.$table_name.'Handler->getCount($criteria);';
+ }
if(isset($_REQUEST['table_online'])) {
$text .= '
//count "online"
@@ -59,14 +67,18 @@
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
$text .= '
// InfoBox '.$table_fieldname.'
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$language2.strtoupper($table_name).', $count_'.$table_fieldname.'); ';
+ $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_name).', $count_'.$table_fieldname.'); ';
+ if(isset($_REQUEST['table_status'])) {
+ $text .= '
+ $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_STATUS, $'.$table_fieldname.'_status);';
+ }
if(isset($_REQUEST['table_online'])) {
$text .= '
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$language2.strtoupper($table_fieldname).'_ONLINE, $'.$table_fieldname.'_online);';
+ $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_ONLINE, $'.$table_fieldname.'_online);';
}
if(isset($_REQUEST['table_waiting'])) {
$text .= '
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$language2.strtoupper($table_fieldname).'_WAITING, $'.$table_fieldname.'_waiting);
+ $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_WAITING, $'.$table_fieldname.'_waiting);
';
}
}
@@ -74,9 +86,13 @@
// Render Index
echo $adminMenu->addNavigation(\'index.php\');
echo $adminMenu->renderIndex();
-include_once \'admin_footer.php\';
-?>';
-createFile($path_file, $text,
- _AM_TDMCREATE_CONST_OK_ADMINS,
- _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+include_once \'footer.php\';';
+ createFile( $tdmcreate_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ if( $modules->getVar('mod_install') == 1 ) {
+ createFile( $root_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ }
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_language.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_language.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_language.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -19,15 +19,14 @@
* @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, $mod_name, $tables_arr, $category)
+function const_admin_language($modules, $tables_arr, $category)
{
- if(!isset($xoopsConfig)) {
- global $xoopsConfig;
- }
+ $mod_name = $modules->getVar('mod_name');
$language = '_AM_'.strtoupper($mod_name).'_';
$language1 = '_AM_'.strtoupper($mod_name).'_THEREARE_';
$file = 'admin.php';
- $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/language/'.$xoopsConfig['language'].'/'.$file;
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/language/'.$GLOBALS['xoopsConfig']['language'].'/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$mod_name.'/language/'.$GLOBALS['xoopsConfig']['language'].'/'.$file;
$text = '<?php'.const_header($modules, $file).'
//Menu
';
@@ -132,8 +131,12 @@
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
+ createFile( $tdmcreate_path, $text,
+ _AM_TDMCREATE_CONST_OK_LANGUAGES,
+ _AM_TDMCREATE_CONST_NOTOK_LANGUAGES, $file);
+ if( $modules->getVar('mod_install') == 1 ) {
+ createFile( $root_path, $text,
+ _AM_TDMCREATE_CONST_OK_LANGUAGES,
+ _AM_TDMCREATE_CONST_NOTOK_LANGUAGES, $file);
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_menu.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_menu.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -19,11 +19,13 @@
* @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, $category)
+function const_admin_menu($modules, $tables_arr, $category)
{
+ $mod_name = $modules->getVar('mod_name');
$language = '_MI_'.strtoupper($mod_name).'_ADMENU';
$file = 'menu.php';
- $path_file = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
$menu = 1;
$text = '<?php'.const_header($modules, $file).'
$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
@@ -66,8 +68,12 @@
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
+ createFile( $tdmcreate_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ if( $modules->getVar('mod_install') == 1 ) {
+ createFile( $root_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_pages.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_pages.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -19,23 +19,26 @@
* @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, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_category)
+function const_admin_pages($modules, $table_name, $table_fieldname, $table_fields, $table_parameters, $table_category)
{
+ $mod_name = $modules->getVar('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;
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/admin/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$mod_name.'/admin/'.$file;
$text = '<?php'.const_header($modules, $file).'
-include_once \'admin_header.php\';
+include_once \'header.php\';
//It recovered the value of argument op in URL$
$op = '.$mod_name.'_CleanVars($_REQUEST, \'op\', \'list\', \'string\');';
-if(isset($_REQUEST['tables_waiting'])) {
+if(isset($_REQUEST['table_waiting'])) {
$text .= '
// 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);'; }
+$'.$table_fieldname.'_waiting = $'.$table_name.'Handler->getCount($criteria);';
+}
//fields
$fields_total = explode('|', $table_fields);
$nb_fields = count($fields_total);
@@ -50,21 +53,21 @@
$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[2]; // 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
- }
- }
+ if( $i == 0 ) {
+ $fpa[$i] = '0';
+ } else {
+ $param = explode(':', $parameters_total[$i-1]);
+ $fpt[$i] = $param[0]; // fpt = fields parameters type
+ $fpa[$i] = $param[2]; // 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];
+$field_name = $fields[1];
$text .= '
echo $adminMenu->addNavigation(\''.$table_name.'.php\');
@@ -75,7 +78,7 @@
$adminMenu->addItemButton('.$language.'_ADD_'.strtoupper($table_name).', \''.$table_name.'.php?op=new\', \'add\');
echo $adminMenu->renderButton();
$criteria = new CriteriaCompo();
- $criteria->setSort(\''.$field_id.'\');
+ $criteria->setSort(\''.$field_id.' ASC, '.$fpmf.'\');
$criteria->setOrder(\'ASC\');
$numrows = $'.$table_name.'Handler->getCount();
$'.$table_name.'_arr = $'.$table_name.'Handler->getAll($criteria);
@@ -126,7 +129,7 @@
{
global $pathIcon16;
$categoriesHandler =& xoops_getModuleHandler("'.$mod_name.'_categories", "'.$mod_name.'");
- $prefix = $prefix."<img src=\'".'.strtoupper($mod_name).'_URL."/images/icons/16/arrow.gif\'>";
+ $icon = $prefix."<img src=\'".'.strtoupper($mod_name).'_URL."/images/icons/16/arrow.gif\'>";
foreach (array_keys($categories_arr) as $i)
{
$cat_id = $categories_arr[$i]->getVar(\'cat_id\');
@@ -152,7 +155,7 @@
$num_pid = $'.$table_name.'Handler->getCount();
if ( $num_pid != 0 )
{
- '.$mod_name.'_children($cat_id, $category_pid, $prefix, $order, $class);
+ '.$mod_name.'_children($cat_id, $category_pid, $icon, $order, $class);
}
}
}
@@ -167,7 +170,7 @@
<th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
</tr>";
$class = "odd";
- $prefix = "<img src=\'".'.strtoupper($mod_name).'_URL."/images/icons/16/arrow.gif\'>";
+ $icon = "<img src=\'".'.strtoupper($mod_name).'_URL."/images/icons/16/arrow.gif\'>";
foreach (array_keys($'.$table_name.'_arr) as $i)
{
if ( $'.$table_name.'_arr[$i]->getVar(\''.$table_fieldname.'_pid\') == 0 )
@@ -196,7 +199,7 @@
if ( $num_pid != 0)
{
- '.$mod_name.'_children($cat_id, $category_pid, $prefix, \''.$table_fieldname.'_title\', $class);
+ '.$mod_name.'_children($cat_id, $category_pid, $icon, \''.$table_fieldname.'_title\', $class);
}
}
}
@@ -288,9 +291,13 @@
break;'; }
$text .= '
}
-include_once \'admin_footer.php\';
-?>';
-createFile($path_file, $text,
- _AM_TDMCREATE_CONST_OK_ADMINS,
- _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+include_once \'footer.php\';';
+ createFile( $tdmcreate_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ if( $modules->getVar('mod_install') == 1 ) {
+ createFile( $root_path, $text,
+ _AM_TDMCREATE_CONST_OK_ADMINS,
+ _AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
+ }
}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_permissions.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_permissions.php 2013-10-23 02:43:50 UTC (rev 12205)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_permissions.php 2013-10-23 02:45:08 UTC (rev 12206)
@@ -19,79 +19,113 @@
* @version $Id: const_admin_permissions.php 11084 2013-02-23 15:...
[truncated message content] |