|
From: <be...@us...> - 2013-10-23 02:46:57
|
Revision: 12207
http://sourceforge.net/p/xoops/svn/12207
Author: beckmi
Date: 2013-10-23 02:46:52 +0000 (Wed, 23 Oct 2013)
Log Message:
-----------
Updating trunk to revision 12082 (timgno: Updated to Beta 2)
Revision Links:
--------------
http://sourceforge.net/p/xoops/svn/12082
Modified Paths:
--------------
XoopsModules/TDMCreate/trunk/TDMCreate/admin/about.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/building.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/includes.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/index.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/modules.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/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_help.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_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_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_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_xoopsversion.php
XoopsModules/TDMCreate/trunk/TDMCreate/images/uploads/modules/My Module_logo.png
XoopsModules/TDMCreate/trunk/TDMCreate/include/functions_const.php
XoopsModules/TDMCreate/trunk/TDMCreate/js/functions.js
XoopsModules/TDMCreate/trunk/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/trunk/TDMCreate/language/english/modinfo.php
XoopsModules/TDMCreate/trunk/TDMCreate/sql/mysql.sql
XoopsModules/TDMCreate/trunk/TDMCreate/xoops_version.php
Added Paths:
-----------
XoopsModules/TDMCreate/trunk/TDMCreate/admin/footer.php
XoopsModules/TDMCreate/trunk/TDMCreate/admin/header.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_class_helper.php
XoopsModules/TDMCreate/trunk/TDMCreate/const/const_class_request.php
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/about.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/about.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/about.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: about.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
echo $adminMenu->addNavigation('about.php');
echo $adminMenu->renderabout('6KJ7RW5DR3VTJ', false);
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/building.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/building.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: building.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
if (isset($_REQUEST['mod_name'])) {
@@ -30,6 +30,8 @@
$mod_name = strtolower($modules->getVar('mod_name'));
$mod_author_website_name = $modules->getVar('mod_author_website_name');
$mod_author_website_url = $modules->getVar('mod_author_website_url');
+$mod_user = $modules->getVar('mod_user');
+$mod_notifications = $modules->getVar('mod_notifications');
$mod_permissions = $modules->getVar('mod_permissions');
if (isset($_REQUEST['table_name'])) {
@@ -55,7 +57,7 @@
// Effacer repertoire of nouveau module s'il existe
TDMCreate_clearDir($modPath.'/modules/'.$mod_name);
// Debut
- TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_OK, _AM_TDMCREATE_BUILDING_NOTOK);
+ TDMCreate_OpenTable(_AM_TDMCREATE_BUILDING_FILES, _AM_TDMCREATE_BUILDING_SUCCESS, _AM_TDMCREATE_BUILDING_FAILED);
/************************************************/
/*Structure*/
/************************************************/
@@ -64,13 +66,13 @@
//Creation of changelog.txt
const_changelog($modules);
- $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
+ $result = $xoopsDB->queryF("SELECT COUNT(*) FROM " . $xoopsDB->prefix('mod_tdmcreate_tables') . " WHERE table_name = 'mod_".$mod_name."_categories'");
list( $category ) = $xoopsDB->fetchRow($result);
foreach (array_keys($tables_arr) as $i)
{
// Variables
- $table_name = $tables_arr[$i]->getVar('table_name');
+ $table_name = $tables_arr[$i]->getVar('table_name');
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
$table_category = $tables_arr[$i]->getVar('table_category');
$table_fields = $tables_arr[$i]->getVar('table_fields');
@@ -86,14 +88,14 @@
$table_waiting = $tables_arr[$i]->getVar('table_waiting');
// Fabrication
- // Copy of images tables
+ // Copy of images tables
$table_image1 = $modPath . '/images/uploads/tables/' . $table_image;
if (file_exists($table_image1)) {
copy($table_image1, $modPath . '/modules/' . $mod_name . '/images/icons/32/' . $table_image);
}
// Creation of classes
if ( $table_admin == 1 || $table_user == 1) {
- const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $category);
+ const_class($modules, $table_name, $table_fieldname, $category, $table_fields, $table_parameters, $table_permissions, $category);
}
// Creation of pages admin
if ( $table_admin == 1 ) {
@@ -113,7 +115,7 @@
const_include_notifications($modules, $table_name, $table_fieldname, $table_fields, $table_parameters);
}
// Creation of the file mysql.sql
- const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
+ const_sql($modules, $table_name, $table_fieldname, $category, $table_fields);
// Creation of blocks
if ( $table_blocks == 1 ) {
@@ -125,8 +127,18 @@
if ( $table_permissions == 1) {
const_admin_permissions($modules, $table_name, $table_fields, $table_parameters);
}
- }
- //Creation of architecture of more fields and data
+ }
+ $table_name = isset($table_name) ? $table_name : null;
+ $table_comments = isset($table_comments) ? $table_comments : null;
+ $table_waiting = isset($table_waiting) ? $table_waiting : null;
+ $table_parameters = isset($table_parameters) ? $table_parameters : null;
+ $table_user = isset($table_user) ? $table_user : null;
+ $table_admin = isset($table_admin) ? $table_admin : null;
+ $table_fields = isset($table_fields) ? $table_fields : null;
+ $table_blocks = isset($table_blocks) ? $table_blocks : null;
+ $table_image = isset($table_image) ? $table_image : null;
+ $table_notifications = isset($table_notifications) ? $table_notifications : null;
+ //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 ) {
@@ -137,16 +149,20 @@
// Creation of Waiting Plugin
const_waiting($modules, $tables_arr);
}
+ // Creation of class helper & request
+ if ( $table_name != '' ) {
+ const_class_helper($modules);
+ const_class_request($modules);
+ }
// Creation of xoopsversion.php
- 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);
- // Creation of template header
- const_templates_header($modules, $tables_arr);
- // Creation of template footer
- const_templates_footer($modules, $table_comments, $table_notifications);
- }
+ const_xoopsversion($modules, $table_name, $table_fields, $table_parameters, $table_image, $tables_arr);
+ // Creation of template index
+ const_templates_index($modules);
+ // Creation of template header
+ const_templates_header($modules, $tables_arr);
+ // Creation of template footer
+ const_templates_footer($modules, $table_comments, $table_notifications);
+
if ( $table_admin == 1 ) {
// Creation of template admin about
const_templates_admin_about($modules);
@@ -163,15 +179,15 @@
const_include_install($modules, $tables_arr);
// Language
///////////////////////////////////////////////////////////////////////
- if ( $table_user == 1 ) {
+ if ( $mod_user == 1 ) {
//Creation of language main.php
const_main_language($modules, $tables_arr);
}
// Creation of language modinfo.php
- const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $category);
+ const_modinfo_language($modules, $table_name, $table_image, $tables_arr, $mod_notifications);
if ( $table_admin == 1 ) {
// Creation of language admin.php
- const_admin_language($modules, $tables_arr, $category);
+ const_admin_language($modules, $tables_arr, $mod_permissions);
}
if ( $table_blocks == 1 ) {
// Creation of language blocks.php
@@ -186,19 +202,19 @@
/*Admin*/
/************************************************/
// Creation of admin header.php
- const_admin_header($modules, $tables_arr);
+ const_admin_header($modules, $table_name, $tables_arr);
// Creation of admin index.php
- const_admin_index($modules, $table_name, $tables_arr);
+ const_admin_index($modules, $tables_arr);
// Creation of admin footer.php
const_admin_footer($modules);
// Creation of admin menu.php
- const_admin_menu($modules, $tables_arr, $category);
+ const_admin_menu($modules, $tables_arr, $mod_permissions);
// Creation of admin about.php
const_admin_about($modules);
/************************************************/
/*User*/
/************************************************/
- if ( $table_user == 1 ) {
+ if ( $mod_user == 1 ) {
const_user_header($modules);
const_user_index($modules);
}
@@ -217,8 +233,8 @@
$form->addElement($mod_select, true);
$form->addElement(new XoopsFormHidden('op', 'build'));
- $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ $form->addElement(new XoopsFormButton(_REQUIRED.' <span class="red bold">*</span>', 'submit', _SUBMIT, 'submit'));
$form->display();
break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Added: XoopsModules/TDMCreate/trunk/TDMCreate/admin/footer.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/footer.php (rev 0)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/footer.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -0,0 +1,26 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id$
+ */
+echo "<div align='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
+ <img src='".$pathIcon32."/xoopsmicrobutton.gif' alt='XOOPS' /></a></div>";
+echo "<div class='center smallsmall italic pad5'>
+ <strong>" . $xoopsModule->getVar('name') . "</strong> is maintained by the
+ <a href='http://xoops.org/forums/newbb' title='Visit Support Forum' class='tooltip' rel='external'>Support Forum</a></div>";
+xoops_cp_footer();
\ No newline at end of file
Property changes on: XoopsModules/TDMCreate/trunk/TDMCreate/admin/footer.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/TDMCreate/trunk/TDMCreate/admin/header.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/header.php (rev 0)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/header.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -0,0 +1,54 @@
+<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+/**
+ * tdmcreate module
+ *
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id$
+ */
+include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
+include_once('../include/functions.php');
+include_once 'includes.php';
+//
+$thisDirname = $GLOBALS['xoopsModule']->getVar('dirname');
+//
+$pathIcon16 = '../' . $xoopsModule->getInfo('icons16');
+$pathIcon32 = '../' . $xoopsModule->getInfo('icons32');
+$pathModuleAdmin = $xoopsModule->getInfo('dirmoduleadmin');
+
+// Get class handler
+$modulesHandler =& xoops_getModuleHandler('modules', $thisDirname);
+$tablesHandler =& xoops_getModuleHandler('tables', $thisDirname);
+//
+$myts =& MyTextSanitizer::getInstance();
+if (!isset($xoopsTpl) || !is_object($xoopsTpl)) {
+ include_once(XOOPS_ROOT_PATH."/class/template.php");
+ $xoopsTpl = new XoopsTpl();
+}
+//
+$GLOBALS['xoopsTpl']->assign('pathIcon16', $pathIcon16);
+$GLOBALS['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');
+}else{
+ redirect_header("../../../admin.php", 5, _AM_MODULEADMIN_MISSING, false);
+}
+xoops_cp_header();
+$adminMenu = new ModuleAdmin();
\ No newline at end of file
Property changes on: XoopsModules/TDMCreate/trunk/TDMCreate/admin/header.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/includes.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/includes.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/includes.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -39,6 +39,8 @@
include_once $cPath.'/const_blocks.php';
include_once $cPath.'/const_blocks_templates.php';
include_once $cPath.'/const_class.php';
+include_once $cPath.'/const_class_helper.php';
+include_once $cPath.'/const_class_request.php';
include_once $cPath.'/const_admin_header.php';
include_once $cPath.'/const_admin_footer.php';
include_once $cPath.'/const_admin_menu.php';
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/index.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/index.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/index.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -1,33 +1,32 @@
<?php
+/*
+ You may not change or alter any portion of this comment or credits
+ of supporting developers from this source code or any supporting source code
+ which is considered copyrighted (c) material of the original comment or credit authors.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
/**
- * ****************************************************************************
- * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS
- * - Licence GPL Copyright (c) (http://www.tdmxoops.net)
+ * tdmcreate module
*
- * Cette licence, contient des limitations!!!
- *
- * 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.
- *
- * @license TDM GPL license
- * @author TDM TEAM DEV MODULE
- *
- * ****************************************************************************
+ * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
+ * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
+ * @package tdmcreate
+ * @since 2.5.0
+ * @author Txmod Xoops http://www.txmodxoops.org
+ * @version $Id: index.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include 'admin_header.php';
+include 'header.php';
$criteria = new CriteriaCompo();
$count_modules = $modulesHandler->getCount($criteria);
$count_tables = $tablesHandler->getCount($criteria);
$adminMenu->addInfoBox(_AM_TDMCREATE_ADMIN_NUMMODULES) ;
-$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, "<label>" ._AM_TDMCREATE_THEREARE_NUMMODULES. "</label>", $count_modules, 'Green') ;
-$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, "<label>" ._AM_TDMCREATE_THEREARE_NUMTABLES. "</label>", $count_tables, 'Orange');
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMMODULES. '</label>', $count_modules, 'Green') ;
+$adminMenu->addInfoBoxLine(_AM_TDMCREATE_ADMIN_NUMMODULES, '<label>' ._AM_TDMCREATE_THEREARE_NUMTABLES. '</label>', $count_tables, 'Orange');
echo $adminMenu->addNavigation('index.php');
echo $adminMenu->renderIndex();
-
-include "admin_footer.php";
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/modules.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/modules.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/modules.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -18,12 +18,12 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: modules.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include_once 'admin_header.php';
+include_once 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'list', 'string' );
echo $adminMenu->addNavigation('modules.php');
switch ($op)
{
- case "save":
+ case 'save':
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('modules.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
}
@@ -33,28 +33,30 @@
} else {
$obj =& $modulesHandler->create();
}
- //Image
+ //Image 'gif|jpeg|pjpeg|png' 500000
include_once XOOPS_ROOT_PATH.'/class/uploader.php';
- $uploaddir = XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/images/uploads/modules/";
- $uploader = new XoopsMediaUploader($uploaddir, "gif|jpeg|pjpeg|png", 104857600, null, null);
+ $uploaddir = XOOPS_ROOT_PATH . '/modules/'.$xoopsModule->dirname().'/images/uploads/modules/';
+ $uploader = new XoopsMediaUploader($uploaddir, xoops_getModuleOption('mimetypes', $thisDirname),
+ xoops_getModuleOption('maxsize', $thisDirname), null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( "/^.+\.([^.]+)$/sU" , "\\1" , $_FILES["attachedfile"]['name']) ;
- $name_img = $_REQUEST['mod_name'].'_slogo.'.$extension;
- $uploader->setTargetFileName($name_img);
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']) ;
+ $img_name = $obj->getVar('mod_name').'_slogo.'.$extension;
+ $uploader->setTargetFileName($img_name);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
if (!$uploader->upload()) {
$errors = $uploader->getErrors();
- redirect_header("javascript:history.go(-1)",3, $errors);
+ redirect_header('javascript:history.go(-1)', 3, $errors);
} else {
$obj->setVar('mod_image', $uploader->getSavedFileName());
}
} else {
$obj->setVar('mod_image', $_POST['mod_image']);
}
- //remove all spaces from the new name
- $obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name']));
+
+ $obj->setVar('mod_name', preg_replace('/\s+/', '', $_POST['mod_name'])); //remove all spaces from the new name
$obj->setVar('mod_version', $_POST['mod_version']);
+ $obj->setVar('mod_since', $_POST['mod_since']);
$obj->setVar('mod_min_php', $_POST['mod_min_php']);
$obj->setVar('mod_min_xoops', $_POST['mod_min_xoops']);
$obj->setVar('mod_min_admin', $_POST['mod_min_admin']);
@@ -93,18 +95,18 @@
}
break;
- case "new":
+ case 'new':
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'modules.php?op=list', 'list');
echo $adminMenu->renderButton();
$obj =& $modulesHandler->create();
$form = $obj->getForm();
break;
- case "edit":
+ case 'edit':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
$form = $obj->getForm();
break;
- case "delete":
+ case 'delete':
$obj =& $modulesHandler->get($_REQUEST['mod_id']);
if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1)
{
@@ -121,7 +123,7 @@
xoops_confirm(array('ok' => 1, 'mod_id' => $_REQUEST['mod_id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
}
break;
- case "list":
+ case 'list':
default:
$adminMenu->addItemButton(_AM_TDMCREATE_MODULES_NEW, 'modules.php?op=new', 'add');
echo $adminMenu->renderButton();
@@ -181,4 +183,4 @@
}
break;
}
-include_once "admin_footer.php";
\ No newline at end of file
+include_once 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/admin/tables.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/admin/tables.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/admin/tables.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -18,7 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: tables.php 11084 2013-02-23 15:44:20Z timgno $
*/
-include_once 'admin_header.php';
+include_once 'header.php';
$op = TDMCreate_CleanVars( $_REQUEST, 'op', 'default', 'string' );
echo $adminMenu->addNavigation('tables.php');
switch ($op) {
@@ -190,7 +190,7 @@
$uploader = new XoopsMediaUploader($uploaddir, 'gif|jpeg|pjpeg|png', 104857600, null, null);
if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']) ;
+ $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
$name_img = $_REQUEST['table_name'].'.'.$extension;
$uploader->setTargetFileName($name_img);
$uploader->fetchMedia($_POST['xoops_upload_file'][0]);
@@ -247,8 +247,10 @@
break;
case "edit_table":
- $obj =& $tablesHandler->get($_REQUEST['table_id']);
- $form = $obj->getFormTable();
+ $table_id = TDMCreate_CleanVars( $_REQUEST, 'table_id', 0);
+ $table_mid = TDMCreate_CleanVars( $_REQUEST, 'table_mid', 0);
+ $obj =& $tablesHandler->get($table_id);
+ $form = $obj->getFormTable(false, $table_mid);
break;
case "edit_fields":
@@ -344,13 +346,14 @@
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW_CATEGORY, 'tables.php?op=create_category', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
echo $adminMenu->renderButton();
-
+
+ $table_mid = TDMCreate_CleanVars( $_REQUEST, 'table_mid', 0);
$obj =& $tablesHandler->create();
- $form = $obj->getFormTable();
+ $form = $obj->getFormTable(false, $table_mid);
break;
- case "create_category":
- $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
+ case "create_category":
+ $adminMenu->addItemButton(_AM_TDMCREATE_TABLES_NEW, 'tables.php?op=create_table', 'add');
$adminMenu->addItemButton(_AM_TDMCREATE_TABLES_LIST, 'tables.php?op=table_list', 'list');
echo $adminMenu->renderButton();
@@ -363,7 +366,7 @@
break;
case "table_list":
- default:
+ default:
$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();
@@ -474,4 +477,4 @@
}
break;
}
-include 'admin_footer.php';
\ No newline at end of file
+include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_about.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_about.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_about.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -25,11 +25,13 @@
$file = 'about.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).'
-include \'header.php\';
-echo $adminMenu->addNavigation(\'about.php\');
-echo $adminMenu->renderabout(\''.$modules->getVar('mod_donations').'\', false);
-include \'footer.php\';';
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude 'header.php';
+echo \$adminMenu->addNavigation('about.php');
+echo \$adminMenu->renderAbout('{$modules->getVar('mod_donations')}', false);
+include 'footer.php';
+EOT;
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_footer.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_footer.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_footer.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -27,16 +27,15 @@
$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>
- <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 '.$mod_support_name.'\' class=\'tooltip\' rel=\'external\'>'.$mod_support_name.'</a></div>";
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\necho "<div class='center'><a href='http://www.xoops.org' title='Visit XOOPS' target='_blank'>
+ <img src='".\$sysPathIcon32."/xoopsmicrobutton.gif' alt='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 {$mod_support_name}' class='tooltip' rel='external'>{$mod_support_name}</a></div>";
xoops_cp_footer();
-';
+EOT;
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_header.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_header.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_header.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -19,25 +19,37 @@
* @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, $tables_arr)
+function const_admin_header($modules, $table_name, $tables_arr)
{
$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;
+ $ucfmod_name = ucfirst($mod_name);
$text = '<?php'.const_header($modules, $file).
<<<EOT
\nrequire_once dirname(dirname(dirname(dirname(__FILE__)))). '/include/cp_header.php';
-\$thisPath = basename(dirname(dirname(__FILE__)));
+\$thisPath = dirname(dirname(__FILE__));
include_once \$thisPath.'/include/common.php';
include_once \$thisPath.'/include/functions.php';
+EOT;
+if ( $table_name != '' ) {
+$text .= <<<EOT
+\ninclude_once \$thisPath.'/class/helper.php';
+// Get instance
+\${$ucfmod_name} = {$ucfmod_name}::getInstance();
+EOT;
+}
+$text .= <<<EOT
+\n\n\$thisModule = \$GLOBALS['xoopsModule']->getVar('dirname');
-\$thisModule = \$GLOBALS['xoopsModule']->getVar('dirname');
+\$sysPathIcon16 = '../' . \$xoopsModule->getInfo('sysicons16');
+\$sysPathIcon32 = '../' . \$xoopsModule->getInfo('sysicons32');
+\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-\$pathIcon16 = '../' . \$xoopsModule->getInfo('icons16');
-\$pathIcon32 = '../' . \$xoopsModule->getInfo('icons32');
-\$pathModuleAdmin = \$GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
-//load handlers\n
+\$modPathIcon16 = \$xoopsModule->getInfo('modicons16');
+\$modPathIcon32 = \$xoopsModule->getInfo('modicons32');
+
EOT;
foreach (array_keys($tables_arr) as $i)
{
@@ -45,14 +57,18 @@
$text .= '$'.$table_name.'Handler =& xoops_getModuleHandler(\''.$table_name. '\', $thisModule);'.PHP_EOL;
}
$text .=<<<EOT
-\$myts =& MyTextSanitizer::getInstance();
+\n\n\$myts =& MyTextSanitizer::getInstance();
if (!isset(\$xoopsTpl) || !is_object(\$xoopsTpl)) {
include_once(XOOPS_ROOT_PATH."/class/template.php");
\$xoopsTpl = new XoopsTpl();
}
+// System icons path
+\$xoopsTpl->assign('sysPathIcon16', \$sysPathIcon16);
+\$xoopsTpl->assign('sysPathIcon32', \$sysPathIcon32);
+// Local icons path
+\$xoopsTpl->assign('modPathIcon16', \$modPathIcon16);
+\$xoopsTpl->assign('modPathIcon32', \$modPathIcon32);
-\$xoopsTpl->assign('pathIcon16', \$pathIcon16);
-\$xoopsTpl->assign('pathIcon32', \$pathIcon32);
//Load languages
xoops_loadLanguage('admin', \$thisModule);
xoops_loadLanguage('modinfo', \$thisModule);
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_help.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_help.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_help.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -19,16 +19,17 @@
* @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, $modules_name)
+function const_admin_help($modules)
{
$file = 'help.php';
- $path_file = TDM_CREATE_MURL.'/'.$modules_name.'/admin/'.$file;
- $text = '<?php'.const_header($modules, $file).'
-include \'admin_header.php\';
-xoops_loadLanguage(\'help\', $xoopsModule->getVar(\'dirname\', \'e\'));
-$xoopsTpl->display(\'db:admin/\' . $xoopsModule->getVar("dirname") . \'_admin_help.html\');
-include \'footer.php\';
-?>';
+ $path_file = TDM_CREATE_MURL.'/'.$modules->getVar('mod_name').'/admin/'.$file;
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude 'admin_header.php';
+xoops_loadLanguage('help', \$xoopsModule->getVar('dirname', 'e'));
+\$xoopsTpl->display('db:admin/' . \$xoopsModule->getVar("dirname") . '_admin_help.html');
+include 'footer.php';
+EOT;
createFile($path_file, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_index.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_index.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_index.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -19,74 +19,86 @@
* @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, $tbl_name, $tables_arr)
+function const_admin_index($modules, $tables_arr)
{
$mod_name = $modules->getVar('mod_name');
$language = '_AM_'.strtoupper($mod_name).'_';
- $thereare = $language.'_THEREARE_';
+ $thereare = $language.'THEREARE_';
$file = 'index.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).'
-include_once \'header.php\';';
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude_once 'header.php';
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = $tables_arr[$i]->getVar('table_name');
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
- $text .= '
- //count "total '.$table_fieldname.'"
- $count_'.$table_fieldname.' = $'.$table_name.'Handler->getCount();';
+$text .= <<<EOT
+\n//count "total {$table_name}"
+\$total_{$table_name} = \${$table_name}Handler->getCount();
+EOT;
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);';
+$text .= <<<EOT
+\n//count "status"
+\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria("{$table_fieldname}_status", 1));
+\${$table_fieldname}_status = ${$table_name}Handler->getCount(\$criteria);
+EOT;
}
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);';
+$text .= <<<EOT
+\n//count "online"
+\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria("{$table_fieldname}_online", 1));
+\${$table_fieldname}_online = ${$table_name}Handler->getCount(\$criteria);
+EOT;
}
if(isset($_REQUEST['table_waiting'])) {
- $text .= '
- $criteria = new CriteriaCompo();
- $criteria->add(new Criteria("'.$table_fieldname.'_waiting", 1));
- $'.$table_fieldname.'_waiting = $'.$table_name.'Handler->getCount($criteria);
- ';
+$text .= <<<EOT
+\n\$criteria = new CriteriaCompo();
+\$criteria->add(new Criteria("{$table_fieldname}_waiting", 1));
+\${$table_fieldname}_waiting = ${$table_name}Handler->getCount(\$criteria);
+EOT;
}
}
- $text .= '
- // InfoBox '.$tbl_name.'
- $adminMenu->addInfoBox('.$language.'STATISTICS);';
+$text .= <<<EOT
+\n// InfoBox Statistics
+\$adminMenu->addInfoBox({$language}STATISTICS);
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = $tables_arr[$i]->getVar('table_name');
$table_fieldname = $tables_arr[$i]->getVar('table_fieldname');
- $text .= '
- // InfoBox '.$table_fieldname.'
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_name).', $count_'.$table_fieldname.'); ';
+ $ta_stu_table_name = $thereare.strtoupper($table_name);
+ $ta_stu_table_fieldname = $thereare.strtoupper($table_fieldname);
+$text .= <<<EOT
+\n// InfoBox {$table_name}
+\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_name}, \$total_{$table_name});
+EOT;
if(isset($_REQUEST['table_status'])) {
- $text .= '
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_STATUS, $'.$table_fieldname.'_status);';
+$text .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_STATUS, \${$table_fieldname}_status);
+EOT;
}
if(isset($_REQUEST['table_online'])) {
- $text .= '
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_ONLINE, $'.$table_fieldname.'_online);';
+$text .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_ONLINE, \${$table_fieldname}_online);
+EOT;
}
if(isset($_REQUEST['table_waiting'])) {
- $text .= '
- $adminMenu->addInfoBoxLine('.$language.'STATISTICS, '.$thereare.strtoupper($table_fieldname).'_WAITING, $'.$table_fieldname.'_waiting);
-';
+$text .= <<<EOT
+\n\$adminMenu->addInfoBoxLine({$language}STATISTICS, {$ta_stu_table_fieldname}_WAITING, \${$table_fieldname}_waiting);
+EOT;
}
}
-$text .= '
- // Render Index
- echo $adminMenu->addNavigation(\'index.php\');
- echo $adminMenu->renderIndex();
-include_once \'footer.php\';';
+$text .= <<<EOT
+\n// Render Index
+echo \$adminMenu->addNavigation('index.php');
+echo \$adminMenu->renderIndex();
+include_once 'footer.php';
+EOT;
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
_AM_TDMCREATE_CONST_NOTOK_ADMINS, $file);
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_language.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_language.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_language.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -19,59 +19,71 @@
* @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, $tables_arr, $category)
+function const_admin_language($modules, $tables_arr, $table_permissions)
{
$mod_name = $modules->getVar('mod_name');
$language = '_AM_'.strtoupper($mod_name).'_';
$language1 = '_AM_'.strtoupper($mod_name).'_THEREARE_';
$file = 'admin.php';
- $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
-';
-$text .= 'define(\''.$language.'STATISTICS\', "'.ucfirst($mod_name).' statistics");';
+ $tdmcreate_path = TDM_CREATE_MURL.'/'.$mod_name.'/language/'.xoops_getConfigOption('language').'/'.$file;
+ $root_path = XOOPS_URL.'/modules/'.$mod_name.'/language/'.xoops_getConfigOption('language').'/'.$file;
+ $text = '<?php'.const_header($modules, $file);
+ $ucf_mod_name = ucfirst($mod_name);
+$text .= <<<EOT
+\n//Index
+define('{$language}STATISTICS', "{$ucf_mod_name} statistics");
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$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");';
+ $table_name_nohs = str_replace('_', ' ', ucfirst($table_name));
+ $stu_table_name = strtoupper($table_name);
+ $text .= <<<EOT
+\ndefine('{$language1}{$stu_table_name}', "There are <span class='bold'>%s</span> {$table_name_nohs} in the database");
+EOT;
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");'; }
+$text .= <<<EOT
+\ndefine('{$language1}{$stu_table_name}ONLINE', "There are <span class='bold'>%s</span> {$table_name_nohs} online in the database");
+EOT;
+
+}
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 .= <<<EOT
+\ndefine('{$language1}{$stu_table_name}WAITING', "There are <span class='bold'>%s</span> {$table_name_nohs} waiting in the database");
+EOT;
+
}
-$text .= '
-//Buttons';
+}
+$text .= <<<EOT
+\n//Buttons
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$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.'");';
+ $stu_table_name = strtoupper($table_name);
+$text .= <<<EOT
+\ndefine('{$language}ADD_{$stu_table_name}', "Add new {$table_name_nohs}");
+define('{$language}{$stu_table_name}_LIST', "List of {$table_name_nohs}");
+EOT;
if(isset($_REQUEST['table_waiting']))
{
- $text .= '
-define(\''.$language.''.strtoupper($table_name).'_WAITING\', "Waiting '.$table_name_nohs.'");
-';}
+$text .= <<<EOT
+\ndefine('{$language}{$stu_table_name}_WAITING', "Waiting {$table_name_nohs}");
+EOT;
}
-$text .= '
-//General
-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");
-';
+}
+$text .= <<<EOT
+\n//General
+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");
+EOT;
$verif = true;
foreach (array_keys($tables_arr) as $i)
{
@@ -84,53 +96,69 @@
$table_name = str_replace('_', ' ', $tables_arr[$i]->getVar('table_name'));
$UcTable_name = UcFirstAndToLower($table_name);
//Recuperation des noms des tables
- $text .= '// '.$UcTable_name;
+ $text .= <<<EOT
+\n// {$UcTable_name}
+EOT;
for($j=0; $j<$nb_fields; $j++)
{
//Nom des fields
- $fields1 = explode(":", $fields_total[$j]);
+ $fields1 = explode(':', $fields_total[$j]);
$fields[$j] = $fields1[0];
$fields_final[$j] = substr($fields1[0], $nb_caracteres);
-
+ $stl_table_name = strtolower($table_name);
if ( $verif == true )
{
- $text .= '
-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).'");
-';
+$text .= <<<EOT
+\ndefine('{$lng_prefix}_ADD', "Add a {$stl_table_name}");
+define('{$lng_prefix}_EDIT', "Edit {$stl_table_name}");
+define('{$lng_prefix}_DELETE', "Delete {$stl_table_name}");
+EOT;
}
$verif = false;
- $text .= '
-define(\''.$lng_prefix.strtoupper($fields_final[$j]).'\', "'.ucfirst($table_fieldname.str_replace("_", " ", $fields_final[$j])).'");';
+ $ucf_fields = ucfirst($table_fieldname.str_replace("_", " ", $fields_final[$j]));
+ $lng_stu_fields_final = $lng_prefix.strtoupper($fields_final[$j]);
+$text .= <<<EOT
+\ndefine('{$lng_stu_fields_final}', "{$ucf_fields}");
+EOT;
}
$verif = true;
- $text .= '
-';
+ $text .= <<<EOT
+EOT;
}
-$text .= '
-//Blocks.php';
+$text .= <<<EOT
+//Blocks.php
+EOT;
foreach (array_keys($tables_arr) as $i)
{
$table_name = str_replace('_', ' ', ucfirst($tables_arr[$i]->getVar('table_name')));
+ $table_fieldname = str_replace('_', ' ', ucfirst($tables_arr[$i]->getVar('table_fieldname')));
$lng_prefix = $language.strtoupper($table_name).'_';
-$text .= '
-define(\''.$lng_prefix.'BLOCK\', "'.ucfirst(str_replace("_", " ", $table_name)).' block");
-';
+$text .= <<<EOT
+\ndefine('{$lng_prefix}BLOCK', "{$table_name} block");
+EOT;
}
-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");
-';
+if( $table_permissions == 1 ) {
+$text .= <<<EOT
+\n//Permissions
+define('{$language}PERMISSIONS_GLOBAL', "Global permissions");
+define('{$language}PERMISSIONS_GLOBAL_DESC', "Only users in the group that you select may global this");
+define('{$language}PERMISSIONS_GLOBAL_4', "Rate from user");
+define('{$language}PERMISSIONS_GLOBAL_8', "Submit from user side");
+define('{$language}PERMISSIONS_GLOBAL_16', "Auto approve");
+define('{$language}PERMISSIONS_APPROVE', "Permissions to approve");
+define('{$language}PERMISSIONS_APPROVE_DESC', "Only users in the group that you select may approve this");
+define('{$language}PERMISSIONS_VIEW', "Permissions to view");
+define('{$language}PERMISSIONS_VIEW_DESC', "Only users in the group that you select may view this");
+define('{$language}PERMISSIONS_SUBMIT', "Permissions to submit");
+define('{$language}PERMISSIONS_SUBMIT_DESC', "Only users in the group that you select may submit this");
+define('{$language}PERMISSIONS_NOPERMSSET', "Permission cannot be set: No {$table_name} created yet! Please create a {$table_fieldname} first.");
+EOT;
}
-$text .= '
-//Error NoFrameworks
-define(\'_AM_ERROR_NOFRAMEWORKS\', "Error: You don't use the Frameworks \"admin module\". Please install this Frameworks");
-define(\''.$language.'MAINTAINEDBY\', "is maintained by the");
-?>';
+$text .= <<<EOT
+\n//Error NoFrameworks
+define('_AM_ERROR_NOFRAMEWORKS', "Error: You don't use the Frameworks \"admin module\". Please install this Frameworks");
+define('{$language}MAINTAINEDBY', "is maintained by the");
+EOT;
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_LANGUAGES,
_AM_TDMCREATE_CONST_NOTOK_LANGUAGES, $file);
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_menu.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_menu.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_menu.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -19,7 +19,7 @@
* @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, $tables_arr, $category)
+function const_admin_menu($modules, $tables_arr, $table_permissions)
{
$mod_name = $modules->getVar('mod_name');
$language = '_MI_'.strtoupper($mod_name).'_ADMENU';
@@ -27,46 +27,53 @@
$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__ ) ) ) ;
-$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;
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\n\$dirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+\$module_handler =& xoops_gethandler('module');
+\$xoopsModule =& XoopsModule::getByDirname(\$dirname);
+\$moduleInfo =& \$module_handler->get(\$xoopsModule->getVar('mid'));
+\$pathIcon32 = \$moduleInfo->getInfo('sysicons32');
+\$adminmenu = array();
+\$i = 1;
+\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/index.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/home.png';
+\$i++;
+EOT;
$menu++;
foreach (array_keys($tables_arr) as $i)
{
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;
+$text .= <<<EOT
+\n\$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++;
+EOT;
$menu++;
}
}
$menu--;
//$menu_id = $menu;
//unset( $menu );
-if( $category == 1 ) {
+if( $table_permissions == 1 ) {
$menu++;
-$text .= '$adminmenu[$i][\'title\'] = '.$language.$menu.';
-$adminmenu[$i][\'link\'] = \'admin/permissions.php\';
-$adminmenu[$i][\'icon\'] = $pathIcon32.\'/permissions.png\';
-$i++;'.PHP_EOL;
+$text .= <<<EOT
+\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/permissions.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/permissions.png';
+\$i++;
+EOT;
}
$menu++;
-$text .= '$adminmenu[$i]["title"] = '.$language.$menu.';
-$adminmenu[$i][\'link\'] = \'admin/about.php\';
-$adminmenu[$i][\'icon\'] = $pathIcon32.\'/about.png\';
-unset( $i );
-?>';
+$text .= <<<EOT
+\n\$adminmenu[\$i]['title'] = {$language}{$menu};
+\$adminmenu[\$i]['link'] = 'admin/about.php';
+\$adminmenu[\$i]['icon'] = \$pathIcon32.'/about.png';
+unset( \$i );
+EOT;
unset( $menu );
createFile( $tdmcreate_path, $text,
_AM_TDMCREATE_CONST_OK_ADMINS,
Modified: XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_pages.php
===================================================================
--- XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_pages.php 2013-10-23 02:45:08 UTC (rev 12206)
+++ XoopsModules/TDMCreate/trunk/TDMCreate/const/const_admin_pages.php 2013-10-23 02:46:52 UTC (rev 12207)
@@ -23,21 +23,26 @@
{
$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);
+ $language_manager = $language.'_'.strtoupper($table_fieldname);
+ $stl_mod_name = strtolower($mod_name);
+ $stu_mod_name = strtoupper($mod_name);
+ $stu_table_name = strtoupper($table_name);
$file = $table_name.'.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).'
-include_once \'header.php\';
+ $text = '<?php'.const_header($modules, $file);
+$text .= <<<EOT
+\ninclude_once 'header.php';
//It recovered the value of argument op in URL$
-$op = '.$mod_name.'_CleanVars($_REQUEST, \'op\', \'list\', \'string\');';
+\$op = {$mod_name}_CleanVars(\$_REQUEST, 'op', 'list', 'string');
+EOT;
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);';
+$text .= <<<EOT
+\n// 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);
+EOT;
}
//fields
$fields_total = explode('|', $table_fields);
@@ -69,229 +74,239 @@
$field_id = $fields[0];
$field_name = $fields[1];
-$text .= '
-echo $adminMenu->addNavigation(\''.$table_name.'.php\');
-switch ($op)
+$text .= <<<EOT
+\n\necho \$adminMenu->addNavigation('{$table_name}.php');
+switch (\$op)
{
- case \'list\':
+ case 'list':
default:
- $adminMenu->addItemButton('.$language.'_ADD_'.strtoupper($table_name).', \''.$table_name.'.php?op=new\', \'add\');
- echo $adminMenu->renderButton();
- $criteria = new CriteriaCompo();
- $criteria->setSort(\''.$field_id.' ASC, '.$fpmf.'\');
- $criteria->setOrder(\'ASC\');
- $numrows = $'.$table_name.'Handler->getCount();
- $'.$table_name.'_arr = $'.$table_name.'Handler->getAll($criteria);
- ';
+ \$adminMenu->addItemButton({$language}_ADD_{$stu_table_name}, '{$table_name}.php?op=new', 'add');
+ echo \$adminMenu->renderButton();
+ \$criteria = new CriteriaCompo();
+ \$criteria->setSort('{$field_id} ASC, {$fpmf}');
+ \$criteria->setOrder('ASC');
+ \$numrows = \${$table_name}Handler->getCount();
+ \${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
+EOT;
$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)
+$text .= <<<EOT
+ \n\t\t// Table view
+ if (\$numrows>0)
{
- echo "<table width=\'100%\' cellspacing=\'1\' class=\'outer\'>
- <tr>';
- $text .= $fcn.'
- <th class=\'center width5\'>".'.$language.'_FORMACTION."</th>
+ echo "<table width='100%' cellspacing='1' class='outer'>
+ <tr>
+EOT;
+ $text .= $fcn;
+$text .= <<<EOT
+\n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
</tr>";
- $class = "odd";
+ \$class = "odd";
- foreach (array_keys($'.$table_name.'_arr) as $i)
+ foreach (array_keys(\${$table_name}_arr) as \$i)
{
- echo "<tr class=\'".$class."\'>";
- $class = ($class == "even") ? "odd" : "even";
- ';
+ echo "<tr class='".\$class."'>";
+ \$class = (\$class == "even") ? "odd" : "even";\n
+EOT;
$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>
+ $text .= $fields_data;
+$text .= <<<EOT
+ \n\t\t\t\t\techo "<td class='center width5'>
+ <a href='{$table_name}.php?op=edit&{$field_id}=".\$i."'><img src=".\$sysPathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
+ <a href='{$table_name}.php?op=delete&{$field_id}=".\$i."'><img src=".\$sysPathIcon16."/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 width='100%' cellspacing='1' class='outer'>
+ <tr>
+EOT;
+ $text .= $fcn;
+$text .= <<<EOT
+ \n\t\t\t\t\t<th class='center width5'>".{$language}_FORMACTION."</th>
+ </tr><tr><td class='errorMsg' colspan='{$nb_fields}'>There are no {$table_name}</td></tr>";
echo "</table><br /><br />";
}
- ';
+EOT;
} else {
- $text .= '
- // Display function that allows children categories
- function '.$mod_name.'_children($cat_id = 0, $'.$table_name.'_arr, $prefix = "", $order = "", &$class)
+ $text .= <<<EOT
+ \n\t\t// Display function that allows children categories
+ function {$mod_name}_children(\$cat_id = 0, \${$table_name}_arr, \$prefix = "", \$order = "", &\$class)
{
- global $pathIcon16;
- $categoriesHandler =& xoops_getModuleHandler("'.$mod_name.'_categories", "'.$mod_name.'");
- $icon = $prefix."<img src=\'".'.strtoupper($mod_name).'_URL."/images/icons/16/arrow.gif\'>"...
[truncated message content] |