|
From: <txm...@us...> - 2014-03-27 14:29:02
|
Revision: 12413
http://sourceforge.net/p/xoops/svn/12413
Author: txmodxoops
Date: 2014-03-27 14:28:58 +0000 (Thu, 27 Mar 2014)
Log Message:
-----------
Updated
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
Added Paths:
-----------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/building.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -41,8 +41,12 @@
$handler = TDMCreateArchitecture::getInstance();
$handler->getPath( TDMC_PATH );
$handler->getUploadPath( TDMC_UPLOAD_PATH );
- $handler->getArchitectureFiles( $modules );
-
+ $base_architecture = $handler->getArchitectureFiles( $modules );
+ /*if($base_architecture !== false) { */
+ $GLOBALS['xoopsTpl']->assign('base_architecture', $base_architecture);
+ /*} else {
+ $GLOBALS['xoopsTpl']->assign('base_architecture', false);
+ }*/
// Creation of the structure of folders and files
$GLOBALS['xoopsTpl']->assign('build_list', 'Under new construction - Temporary build');
break;
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/architecture.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -18,9 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: architecture.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
require_once 'structure.php';
class TDMCreateArchitecture
{
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -1,266 +0,0 @@
-<?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: class_files.php 12258 2014-01-02 09:33:29Z timgno $
- */
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
-
-class ClassFiles extends CreateFile
-{
- /*
- * @var null
- */
- public $table = null;
- /*
- * @public function constructor
- * @param string $module
- * @param string $table
- * @param string $file_name
- */
- public function __construct($module, $table, $file_name) {
- $this->module = $module;
- $this->table = $table;
- $this->file_name = $file_name;
- }
- /*
- * @public function getInitVar
- * @param array $type
- * @param string $obj
- */
- public function getInitVar(array $type, $obj = 'INT') {
- $ret = <<<EOT
- \$this->initVar('{$type}', XOBJ_DTYPE_{$obj});
-EOT;
- return $ret;
- }
- /*
- * @public function getInitVars
- * @param array $type
- * @param array $fields
- */
- public function getInitVars($table_fields) {
- $ret = '';
- // Counts the number of fields
- $fields = explode('|', $table_fields);
- $nb_fields = count($fields);
- // Creation of the initVar functions list
- for ($i = 0; $i < $nb_fields; $i++) {
- $type = explode(':', $fields[$i]);
- switch($type[1]) {
- case 'int':
- case 'tinyint':
- case 'mediumint':
- case 'smallint':
- $ret .= $this->getInitVar($type[0], 'INT');
- break;
- case 'char':
- case 'varchar':
- $ret .= $this->getInitVar($type[0], 'TXTBOX');
- break;
- case 'text':
- case 'tinytext':
- case 'mediumtext':
- case 'longtext':
- $ret .= $this->getInitVar($type[0], 'TXTAREA');
- break;
- case 'float':
- $ret .= $this->getInitVar($type[0], 'FLOAT');
- break;
- case 'decimal':
- case 'double':
- $ret .= $this->getInitVar($type[0], 'DECIMAL');
- break;
- case 'enum':
- $ret .= $this->getInitVar($type[0], 'ENUM');
- break;
- case 'email':
- $ret .= $this->getInitVar($type[0], 'EMAIL');
- break;
- case 'url':
- $ret .= $this->getInitVar($type[0], 'URL');
- break;
- case 'date':
- case 'datetime':
- case 'timestamp':
- case 'time':
- case 'year':
- $ret .= $this->getInitVar($type[0], 'LTIME');
- break;
- }
- }
- return $ret;
- }
- /*
- * @public function getHeadClass
- * @param mixed $constructor
- */
- public function getHeadClass($mod_name, $initvar_functions) {
- $ucf_mod_name = ucfirst($mod_name);
- $ucf_table_name = ucfirst($this->table->getVar('table_name'));
- $ret = <<<EOT
-\ndefined('XOOPS_ROOT_PATH') or die("Restricted access");
-/*
- * Class Object {$ucf_mod_name}{$ucf_table_name}
- */
-class {$ucf_mod_name}{$ucf_table_name} extends XoopsObject
-{
- /*
- * Constructor
- *
- * @param null
- */
- function __construct()
- {
- \$this->XoopsObject();
- {$initvar_functions}
-\n\t}
-EOT;
- return $ret;
- }
-
- /*
- * @public function getHeadFunctionForm
- * @param string $form
- */
- public function getHeadFunctionForm($elements_form) {
- $lang_add = $this->getLanguage('_AM_', '_ADD');
- $lang_edit = $this->getLanguage('_AM_', '_EDIT');
- $ret = <<<EOT
- /*
- * Get form
- *
- * @param mixed \$action
- */
- function getForm(\$action = false)
- {
- if (\$action === false) {
- \$action = \$_SERVER['REQUEST_URI'];
- }
-
- \$title = \$this->isNew() ? sprintf({$lang_add}) : sprintf({$lang_edit});
-
- include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
-
- \$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
- \$form->setExtra('enctype="multipart/form-data"');\n
- {$elements_form}
-EOT;
- return $ret;
- }
- /*
- * @public function getPermissionsInFunctionForm
- * @param string $fpif
- */
- public function getPermissionsInFunctionForm($mod_name, $fpif) {
- $perm_approve = $this->getLanguage('_AM_', '_PERMISSIONS_APPROVE');
- $perm_submit = $this->getLanguage('_AM_', '_PERMISSIONS_SUBMIT');
- $perm_view = $this->getLanguage('_AM_', '_PERMISSIONS_VIEW');
- $ret = <<<EOT
- \n//permissions
- \$member_handler = & xoops_gethandler ( 'member' );
- \$group_list = &\$member_handler->getGroupList();
- \$gperm_handler = &xoops_gethandler ( 'groupperm' );
- \$full_list = array_keys ( \$group_list );
- global \$xoopsModule;
- if ( !\$this->isNew() ) {
- \$groups_ids_approve = \$gperm_handler->getGroupIds ( '{$mod_name}_approve', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
- \$groups_ids_submit = \$gperm_handler->getGroupIds ( '{$mod_name}_submit', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
- \$groups_ids_view = \$gperm_handler->getGroupIds ( '{$mod_name}_view', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
- \$groups_ids_approve = array_values ( \$groups_ids_approve );
- \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$groups_ids_approve );
- \$groups_ids_submit = array_values ( \$groups_ids_submit );
- \$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$groups_ids_submit );
- \$groups_ids_view = array_values ( \$groups_ids_view );
- \$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$groups_ids_view );
- } else {
- \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$full_list );
- \$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$full_list );
- \$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$full_list );
- }
-
- // For approve
- \$groups_can_approve_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_approve_checkbox );
- // For submit
- \$groups_can_submit_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_submit_checkbox );
- // For view
- \$groups_can_view_checkbox->addOptionArray ( \$group_list );
- \$form->addElement ( \$groups_can_view_checkbox );
-EOT;
- return $ret;
- }
- /*
- * @public function getFootFunctionForm
- * @param null
- */
- public function getFootFunctionForm() {
- $ret = <<<EOT
- \n\$form->addElement(new XoopsFormHidden('op', 'save'));
- \$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
- return \$form;
- }
-}\n\n
-EOT;
- return $ret;
- }
- /*
- * @public function getClassHandler
- * @param string $fpif
- * @param string $fpmf
- */
- public function getClassHandler($mod_name, $fpif, $fpmf) {
- $table_name = $this->table->getVar('table_name');
- $ucf_mod_table_handler = ucfirst($mod_name).ucfirst($table_name);
- $ret = <<<EOT
-/*
- * Class Object Handler {$ucf_mod_name}{$ucf_table_name}
- */
-class {$ucf_mod_table_handler}Handler extends XoopsPersistableObjectHandler
-{
- /*
- * Constructor
- *
- * @param string \$db
- */
- function __construct(&\$db)
- {
- parent::__construct(\$db, 'mod_{$mod_name}_{$table_name}', '{$mod_name}{$table_name}', '{$fpif}', '{$fpmf}');
- }
-}
-EOT;
- return $ret;
- }
- /*
- * @public function render
- * @param null
- */
- public function render() {
- $module_name = $this->getModuleName();
- $table_fields = $this->table->getVar('table_fields');
- $initvar = $this->getInitVars($table_fields);
- $ret = $this->getHeadClass($module_name, $initvar);
- $ret .= $this->getHeadFunctionForm($form);
- $ret .= $this->getPermissionsInFunctionForm($module_name, $fpif);
- $ret .= $this->getFootFunctionForm();
- $ret .= $this->getClassHandler($module_name, $fpif, $fpmf);
- return $ret;
- }
-}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/class_files.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -0,0 +1,266 @@
+<?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: class_files.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+if (!defined('XOOPS_ROOT_PATH')) {
+ die('XOOPS root path not defined');
+}
+
+class ClassFiles extends CreateFile
+{
+ /*
+ * @var null
+ */
+ public $table = null;
+ /*
+ * @public function constructor
+ * @param string $module
+ * @param string $table
+ * @param string $file_name
+ */
+ public function __construct($module, $table, $file_name) {
+ $this->module = $module;
+ $this->table = $table;
+ $this->file_name = $file_name;
+ }
+ /*
+ * @public function getInitVar
+ * @param array $type
+ * @param string $obj
+ */
+ public function getInitVar(array $type, $obj = 'INT') {
+ $ret = <<<EOT
+ \$this->initVar('{$type}', XOBJ_DTYPE_{$obj});
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getInitVars
+ * @param array $type
+ * @param array $fields
+ */
+ public function getInitVars($table_fields) {
+ $ret = '';
+ // Counts the number of fields
+ $fields = explode('|', $table_fields);
+ $nb_fields = count($fields);
+ // Creation of the initVar functions list
+ for ($i = 0; $i < $nb_fields; $i++) {
+ $type = explode(':', $fields[$i]);
+ switch($type[1]) {
+ case 'int':
+ case 'tinyint':
+ case 'mediumint':
+ case 'smallint':
+ $ret .= $this->getInitVar($type[0], 'INT');
+ break;
+ case 'char':
+ case 'varchar':
+ $ret .= $this->getInitVar($type[0], 'TXTBOX');
+ break;
+ case 'text':
+ case 'tinytext':
+ case 'mediumtext':
+ case 'longtext':
+ $ret .= $this->getInitVar($type[0], 'TXTAREA');
+ break;
+ case 'float':
+ $ret .= $this->getInitVar($type[0], 'FLOAT');
+ break;
+ case 'decimal':
+ case 'double':
+ $ret .= $this->getInitVar($type[0], 'DECIMAL');
+ break;
+ case 'enum':
+ $ret .= $this->getInitVar($type[0], 'ENUM');
+ break;
+ case 'email':
+ $ret .= $this->getInitVar($type[0], 'EMAIL');
+ break;
+ case 'url':
+ $ret .= $this->getInitVar($type[0], 'URL');
+ break;
+ case 'date':
+ case 'datetime':
+ case 'timestamp':
+ case 'time':
+ case 'year':
+ $ret .= $this->getInitVar($type[0], 'LTIME');
+ break;
+ }
+ }
+ return $ret;
+ }
+ /*
+ * @public function getHeadClass
+ * @param mixed $constructor
+ */
+ public function getHeadClass($mod_name, $initvar_functions) {
+ $ucf_mod_name = ucfirst($mod_name);
+ $ucf_table_name = ucfirst($this->table->getVar('table_name'));
+ $ret = <<<EOT
+\ndefined('XOOPS_ROOT_PATH') or die("Restricted access");
+/*
+ * Class Object {$ucf_mod_name}{$ucf_table_name}
+ */
+class {$ucf_mod_name}{$ucf_table_name} extends XoopsObject
+{
+ /*
+ * Constructor
+ *
+ * @param null
+ */
+ function __construct()
+ {
+ \$this->XoopsObject();
+ {$initvar_functions}
+\n\t}
+EOT;
+ return $ret;
+ }
+
+ /*
+ * @public function getHeadFunctionForm
+ * @param string $form
+ */
+ public function getHeadFunctionForm($elements_form) {
+ $lang_add = $this->getLanguage('_AM_', '_ADD');
+ $lang_edit = $this->getLanguage('_AM_', '_EDIT');
+ $ret = <<<EOT
+ /*
+ * Get form
+ *
+ * @param mixed \$action
+ */
+ function getForm(\$action = false)
+ {
+ if (\$action === false) {
+ \$action = \$_SERVER['REQUEST_URI'];
+ }
+
+ \$title = \$this->isNew() ? sprintf({$lang_add}) : sprintf({$lang_edit});
+
+ include_once(XOOPS_ROOT_PATH.'/class/xoopsformloader.php');
+
+ \$form = new XoopsThemeForm(\$title, 'form', \$action, 'post', true);
+ \$form->setExtra('enctype="multipart/form-data"');\n
+ {$elements_form}
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getPermissionsInFunctionForm
+ * @param string $fpif
+ */
+ public function getPermissionsInFunctionForm($mod_name, $fpif) {
+ $perm_approve = $this->getLanguage('_AM_', '_PERMISSIONS_APPROVE');
+ $perm_submit = $this->getLanguage('_AM_', '_PERMISSIONS_SUBMIT');
+ $perm_view = $this->getLanguage('_AM_', '_PERMISSIONS_VIEW');
+ $ret = <<<EOT
+ \n//permissions
+ \$member_handler = & xoops_gethandler ( 'member' );
+ \$group_list = &\$member_handler->getGroupList();
+ \$gperm_handler = &xoops_gethandler ( 'groupperm' );
+ \$full_list = array_keys ( \$group_list );
+ global \$xoopsModule;
+ if ( !\$this->isNew() ) {
+ \$groups_ids_approve = \$gperm_handler->getGroupIds ( '{$mod_name}_approve', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
+ \$groups_ids_submit = \$gperm_handler->getGroupIds ( '{$mod_name}_submit', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
+ \$groups_ids_view = \$gperm_handler->getGroupIds ( '{$mod_name}_view', \$this->getVar ( '{$fpif}' ), \$xoopsModule->getVar ( 'mid' ) );
+ \$groups_ids_approve = array_values ( \$groups_ids_approve );
+ \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$groups_ids_approve );
+ \$groups_ids_submit = array_values ( \$groups_ids_submit );
+ \$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$groups_ids_submit );
+ \$groups_ids_view = array_values ( \$groups_ids_view );
+ \$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$groups_ids_view );
+ } else {
+ \$groups_can_approve_checkbox = new XoopsFormCheckBox ( {$perm_approve}, 'groups_approve[]', \$full_list );
+ \$groups_can_submit_checkbox = new XoopsFormCheckBox ( {$perm_submit}, 'groups_submit[]', \$full_list );
+ \$groups_can_view_checkbox = new XoopsFormCheckBox ( {$perm_view}, 'groups_view[]', \$full_list );
+ }
+
+ // For approve
+ \$groups_can_approve_checkbox->addOptionArray ( \$group_list );
+ \$form->addElement ( \$groups_can_approve_checkbox );
+ // For submit
+ \$groups_can_submit_checkbox->addOptionArray ( \$group_list );
+ \$form->addElement ( \$groups_can_submit_checkbox );
+ // For view
+ \$groups_can_view_checkbox->addOptionArray ( \$group_list );
+ \$form->addElement ( \$groups_can_view_checkbox );
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getFootFunctionForm
+ * @param null
+ */
+ public function getFootFunctionForm() {
+ $ret = <<<EOT
+ \n\$form->addElement(new XoopsFormHidden('op', 'save'));
+ \$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
+ return \$form;
+ }
+}\n\n
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function getClassHandler
+ * @param string $fpif
+ * @param string $fpmf
+ */
+ public function getClassHandler($mod_name, $fpif, $fpmf) {
+ $table_name = $this->table->getVar('table_name');
+ $ucf_mod_table_handler = ucfirst($mod_name).ucfirst($table_name);
+ $ret = <<<EOT
+/*
+ * Class Object Handler {$ucf_mod_name}{$ucf_table_name}
+ */
+class {$ucf_mod_table_handler}Handler extends XoopsPersistableObjectHandler
+{
+ /*
+ * Constructor
+ *
+ * @param string \$db
+ */
+ function __construct(&\$db)
+ {
+ parent::__construct(\$db, 'mod_{$mod_name}_{$table_name}', '{$mod_name}{$table_name}', '{$fpif}', '{$fpmf}');
+ }
+}
+EOT;
+ return $ret;
+ }
+ /*
+ * @public function render
+ * @param null
+ */
+ public function render() {
+ $module_name = $this->getModuleName();
+ $table_fields = $this->table->getVar('table_fields');
+ $initvar = $this->getInitVars($table_fields);
+ $ret = $this->getHeadClass($module_name, $initvar);
+ $ret .= $this->getHeadFunctionForm($form);
+ $ret .= $this->getPermissionsInFunctionForm($module_name, $fpif);
+ $ret .= $this->getFootFunctionForm();
+ $ret .= $this->getClassHandler($module_name, $fpif, $fpmf);
+ return $ret;
+ }
+}
\ No newline at end of file
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/create_file.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -1,93 +0,0 @@
-<?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: create_file.php 12258 2014-01-02 09:33:29Z timgno $
- */
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
-
-class CreateFile extends HeaderFile
-{
- /*
- * @var string
- */
- public $content = null;
- /*
- * @var string
- */
- public $file_path = null;
- /*
- * @public function constructor
- * @param string $content
- */
- public function __construct($path, $content, $lng_ok, $lng_notok, $file_name, $class = 'even', $mode = 'w+') {
- $this->path .= $path;
- $this->content = $content;
- $this->lng_ok = $lng_ok;
- $this->lng_notok = $lng_notok;
- $this->file_name = $file_name;
- $this->_class = $class;
- $this->mode = $mode;
- //$this->file_path = $this->getHeader($path, $module, $folder, $file_name);
- }
- /*
- * @static function &getInstance
- * @param null
- */
- public static function &getInstance()
- {
- static $instance = false;
- if (!$instance) {
- $instance = new self();
- }
- return $instance;
- }
- /*
- * @public function renderFile
- * @param null
- */
- public function renderFile()
- {
- $path = $this->path;
- $content = $this->content;
- $lng_ok = $this->lng_ok;
- $lng_notok = $this->lng_notok;
- $file_name = $this->file_name;
- $class = $this->_class;
- $handle = XoopsFile::getHandler();
- $handle->__construct($path, false);
- // Integration of the content of file
- if ($handle->open($this->mode) == false) {
- $GLOBALS['xoopsTpl']->assign('lng_notok', sprintf($this->lng_notok, $this->file_name));
- return false;
- }
- if ($handle->is_writable($path))
- {
- if ($handle->write($this->content) == false) {
- $GLOBALS['xoopsTpl']->assign('lng_notok', sprintf($this->lng_notok, $this->file_name));
- exit;
- }
- $GLOBALS['xoopsTpl']->assign('lng_ok', sprintf($this->lng_ok, $this->file_name));
- $handle->close();
- } else {
- $GLOBALS['xoopsTpl']->assign('lng_notok', sprintf($this->lng_notok, $this->file_name));
- }
- return $GLOBALS['xoopsTpl']->fetch("db:tdmcreate_building.html");
- }
-}
\ No newline at end of file
Added: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php (rev 0)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/file.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -0,0 +1,203 @@
+<?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: file.php 12258 2014-01-02 09:33:29Z timgno $
+ */
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
+
+class TDMCreateFile
+{
+ /*
+ * @var string
+ */
+ private $xoopsfile = null;
+
+ /*
+ * @var string
+ */
+ private $path = null;
+
+ /*
+ * @var string
+ */
+ private $folder_name = null;
+
+ /*
+ * @var string
+ */
+ private $file_name = null;
+
+ /*
+ * @var string
+ */
+ private $content = null;
+
+ /*
+ * @var mixed
+ */
+ private $created = false;
+
+ /*
+ * @var mixed
+ */
+ private $notcreated = false;
+
+ /*
+ * @var string
+ */
+ private $mode = null;
+
+ /*
+ * @public function constructor
+ * @param null
+ */
+ public function __construct() {
+ $this->xoopsfile = XoopsFile::getHandler();
+ }
+
+ /*
+ * @public static function &getInstance
+ * @param null
+ */
+ public static function &getInstance() {
+ static $instance = false;
+ if (!$instance) {
+ $instance = new self();
+ }
+ return $instance;
+ }
+
+ /*
+ * @public function constructor
+ * @param string $content
+ */
+ public function create($path, $folder_name, $file_name, $content = '', $created = false, $notcreated = false, $mode = 'w+') {
+ $this->folder_name = $folder_name;
+ $this->file_name = $file_name;
+ $this->created = $created;
+ $this->notcreated = $notcreated;
+ $this->mode = $mode;
+ if(isset($path)){
+ $this->setPath($path);
+ }
+ if(isset($content)){
+ $this->setContent($content);
+ }
+ }
+
+ /*
+ * @private function setPath
+ * @param string $path
+ */
+ private function setPath($path) {
+ $this->path = $path;
+ }
+
+ /*
+ * @private function getPath
+ * @param null
+ */
+ private function getPath() {
+ return $this->path;
+ }
+
+ /*
+ * @private function setContent
+ * @param string $content
+ */
+ private function setContent($content) {
+ $this->content = $content;
+ }
+
+ /*
+ * @private function setContent
+ * @param null
+ */
+ private function getContent() {
+ return $this->content;
+ }
+
+ /*
+ * @private function getFolderName
+ * @param null
+ */
+ private function getFolderName() {
+ return $this->folder_name;
+ }
+
+ /*
+ * @private function getFileName
+ * @param null
+ */
+ private function getFileName() {
+ return $this->file_name;
+ }
+
+ /*
+ * @private function getCreated
+ * @param null
+ */
+ private function getCreated() {
+ return $this->created;
+ }
+
+ /*
+ * @private function getNotCreated
+ * @param null
+ */
+ private function getNotCreated() {
+ return $this->notcreated;
+ }
+
+ /*
+ * @private function getMode
+ * @param null
+ */
+ private function getMode() {
+ return $this->mode;
+ }
+
+ /*
+ * @public function renderFile
+ * @param null
+ */
+ public function renderFile() {
+ $path = $this->getPath();
+ $folder_name = $this->getFolderName();
+ $file_name = $this->getFileName();
+ $created = $this->getCreated();
+ $notcreated = $this->getNotCreated();
+ $this->xoopsfile->__construct($path);
+ // Integration of the content of file
+ if($this->xoopsfile->open($this->getMode()) == false) {
+ $GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $file_name, $folder_name));
+ return false;
+ }
+ if($this->xoopsfile->is_writable($path)) {
+ if ($this->xoopsfile->write($this->getContent()) == false) {
+ $GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $file_name, $folder_name));
+ exit;
+ }
+ $GLOBALS['xoopsTpl']->assign('created', sprintf($created, $file_name, $folder_name));
+ $this->xoopsfile->close();
+ } else {
+ $GLOBALS['xoopsTpl']->assign('notcreated', sprintf($notcreated, $file_name, $folder_name));
+ }
+ return $GLOBALS['xoopsTpl']->fetch("db:tdmcreate_building.html");
+ }
+}
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/structure.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -18,9 +18,7 @@
* @author Txmod Xoops http://www.txmodxoops.org
* @version $Id: structure.php 12258 2014-01-02 09:33:29Z timgno $
*/
-if (!defined('XOOPS_ROOT_PATH')) {
- die('XOOPS root path not defined');
-}
+defined('XOOPS_ROOT_PATH') or die('Restricted access');
xoops_load('XoopsFile');
class TDMCreateStructure
{
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/modules.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -166,8 +166,7 @@
$form->addElement($imgtray);
//---------- START -----------------
- ?>
-
+ ?>
<script type="text/javascript">
function showImgSelected2(imgId, selectId, imgDir, extra, xoopsUrl) {
@@ -179,7 +178,7 @@
if (selectDom.options[selectDom.selectedIndex].value != "") {
imgDom.src = xoopsUrl + imgDir + "/" + selectDom.options[selectDom.selectedIndex].value + extra;
} else {
- imgDom.src = xoopsUrl + "/modules/TDMCreate/images/uploads/modules/blank.gif";
+ imgDom.src = xoopsUrl + "/modules/TDMCreate/images/icons/blank.gif";
}
}
@@ -223,22 +222,16 @@
});
}
</script>
-
-
<?php
$tables_img = $this->getVar('table_image') ? $this->getVar('table_image') : 'about.png';
if(is_dir($pathIcon32)){
- $uploadirectory = $pathIcon32;
+ $uploadirectory = $pathIcon32;
+ $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./{$pathIcon32}");
} else {
$uploadirectory = "/uploads/".$GLOBALS['xoopsModule']->dirname()."/images/tables";
+ $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./uploads/".$GLOBALS['xoopsModule']->dirname()."/images/tables");
}
$createLogoTray = new XoopsFormElementTray('Create new Logo','<br />');
- //$imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, './' . $uploadirectory);
- if(is_dir($pathIcon32)){
- $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./{$pathIcon32}");
- } else {
- $imgpath = sprintf(_AM_TDMCREATE_FORMIMAGE_PATH, "./uploads/".$GLOBALS['xoopsModule']->dirname()."/images/tables");
- }
$iconSelect= new XoopsFormSelect($imgpath, 'tables_img', $tables_img, 8);
$tables_img_array = XoopsLists::getImgListAsArray( $uploadirectory );
foreach( $tables_img_array as $image ) {
@@ -302,12 +295,10 @@
}
}
- $dirname = $GLOBALS['xoopsModule']->dirname();
$iconFileName = $pathIcon32 . '/' . basename($logoIcon);
- $dirlogos = TDMC_PATH . "/images/logos";
- //$dirlogos = XOOPS_ROOT_PATH . "/modules/" . $dirname . "/images/logos";
- if (!file_exists($imageBase = $dirlogos . "/xoops2.png") ||
+ $dirlogos = TDMC_PATH . "/images/logos";
+ if (!file_exists($imageBase = $dirlogos . "/empty.png") ||
!file_exists($font = $dirlogos . "/VeraBd.ttf") ||
!file_exists($iconFile = $iconFileName)) {
return false;
@@ -324,8 +315,7 @@
imagecopy($imageModule, $imageIcon, 29, 2, 0, 0, 32, 32);
$targetImage = TDMC_UPLOAD_IMGMOD_URL . "/" . $moduleName . "_logo.png";
- //$targetImage = "/uploads/" . $dirname . "/images/modules/" . $moduleName . "_logo.png"; XOOPS_ROOT_PATH .
-
+
imagepng($imageModule, $targetImage );
imagedestroy($imageModule);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/language/english/admin.php 2014-03-27 14:28:58 UTC (rev 12413)
@@ -254,35 +254,10 @@
//Creation
//OK
define('_AM_TDMCREATE_CONST_OK_ARCHITECTURE', "<span class='green'>The structure of the module was created (index.html, folders, ...)</span>");
-define('_AM_TDMCREATE_CONST_OK_COMMENTS', "The file <b>%s</b> is created in the <span class='green bold'>directory</span> of module");
-define('_AM_TDMCREATE_CONST_OK_DOCS', "The file <b>%s</b> is created in the <span class='green bold'>docs</span> folder");
-define('_AM_TDMCREATE_CONST_OK_CSS', "The file <b>%s</b> is created in the <span class='green bold'>css</span> folder");
-define('_AM_TDMCREATE_CONST_OK_ROOTS', "The file <b>%s</b> is created in the <span class='green bold'>directory</span> of the module");
-define('_AM_TDMCREATE_CONST_OK_CLASSES', "The file <b>%s</b> is created in the <span class='green bold'>class</span> folder");
-define('_AM_TDMCREATE_CONST_OK_BLOCKS', "The file <b>%s</b> is created in the <span class='green bold'>blocks</span> folder");
-define('_AM_TDMCREATE_CONST_OK_SQL', "The file <b>%s</b> is created in the <span class='green bold'>sql</span> folder");
-define('_AM_TDMCREATE_CONST_OK_ADMINS', "The file <b>%s</b> is created in the <span class='green bold'>admin</span> folder");
-define('_AM_TDMCREATE_CONST_OK_LANGUAGES', "The file <b>%s</b> is created in the <span class='green bold'>language</span> folder");
-define('_AM_TDMCREATE_CONST_OK_INCLUDES', "The file <b>%s</b> is created in the <span class='green bold'>include</span> folder");
-define('_AM_TDMCREATE_CONST_OK_TEMPLATES', "The file <b>%s</b> is created in the <span class='green bold'>templates</span> folder");
-define('_AM_TDMCREATE_CONST_OK_TEMPLATES_BLOCKS', "The file <b>%s</b> is created in the <span class='green bold'>templates/blocks</span> folder");
-define('_AM_TDMCREATE_CONST_OK_TEMPLATES_ADMIN', "The file <b>%s</b> is created in the <span class='green bold'>templates/admin</span> folder");
-
+define('_AM_TDMCREATE_CONST_OK_FILE_IN_FOLDER', "The file <b>%s</b> is created in the <span class='green bold'>%s</span> of module");
//NOTOK
define('_AM_TDMCREATE_CONST_NOTOK_ARCHITECTURE', "<span class='red'>Problems: Creating the structure of the module (index.html, icons ,...)</span>");
-define('_AM_TDMCREATE_CONST_NOTOK_COMMENTS', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>directory</span> of module");
-define('_AM_TDMCREATE_CONST_NOTOK_DOCS', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>docs</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_CSS', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>css</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_ROOTS', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>directory</span> of the module");
-define('_AM_TDMCREATE_CONST_NOTOK_CLASSES', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>class</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_BLOCKS', "Problems: Creating file <b class='red'>%s</b> in <span class='red bold'>blocks</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_SQL', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>sql</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_ADMINS', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>admin</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_LANGUAGES', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>language</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_INCLUDES', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>include</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_TEMPLATES', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>templates</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_TEMPLATES_BLOCKS', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>templates/blocks</span> folder");
-define('_AM_TDMCREATE_CONST_NOTOK_TEMPLATES_ADMIN', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>templates/admin</span> folder");
+define('_AM_TDMCREATE_CONST_NOTOK_FILE_IN_FOLDER', "Problems: Creating file <b class='red'>%s</b> in the <span class='red bold'>%s</span> of module");
//------------ new additions: Ver. 1.11 -----------------------
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-27 10:15:29 UTC (rev 12412)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/templates/admin/tdmcreate_building.html 2014-03-27 14:28:58 UTC (rev 12413)
@@ -13,11 +13,12 @@
</thead>
<tbody>
<tr class="even">
- <td style="padding-left: 30px;"><{$list.file}></td>
- <{if $architecture_created}>
+ <{if $base_architecture}>
+ <td style="padding-left: 30px;"><{$smarty.const._AM_TDMCREATE_CONST_OK_ARCHITECTURE}></td>
<td class="center"><img src="<{xoModuleIcons16 on.png}>" alt="" /></td>
<td> </td>
- <{else}>
+ <{else}>
+ <td style="padding-left: 30px;"><{$smarty.const._AM_TDMCREATE_CONST_NOTOK_ARCHITECTURE}></td>
<td> </td>
<td class="center"><img src="<{xoModuleIcons16 off.png}>" alt="" /></td>
<{/if}>
@@ -27,9 +28,11 @@
<td class="center" colspan="3"><{$build_list}></td>
<!-- <td style="padding-left: 30px;"><{$list.file}></td>
<{if $list.on}>
+ <td style="padding-left: 30px;"><{$created}></td>
<td class="center"><img src="<{xoModuleIcons16 on.png}>" alt="" /></td>
<td> </td>
<{elseif $list.off}>
+ <td style="padding-left: 30px;"><{$notcreated}></td>
<td> </td>
<td class="center"><img src="<{xoModuleIcons16 off.png}>" alt="" /></td>
<{/if}> -->
|