From: <txm...@us...> - 2013-04-03 18:20:29
|
Revision: 11340 http://sourceforge.net/p/xoops/svn/11340 Author: txmodxoops Date: 2013-04-03 18:20:26 +0000 (Wed, 03 Apr 2013) Log Message: ----------- Updated Added more files Modified Paths: -------------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html Added Paths: ----------- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-04-03 02:56:45 UTC (rev 11339) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/admin/tables.php 2013-04-03 18:20:26 UTC (rev 11340) @@ -73,10 +73,7 @@ foreach (array_keys($mod_arr) as $i) { $mod['id'] = $mod_arr[$i]->getVar('mod_id'); $mod['name'] = $mod_arr[$i]->getVar('mod_name'); - $mod['version'] = $mod_arr[$i]->getVar('mod_version'); $mod['image'] = $mod_arr[$i]->getVar('mod_image'); - $mod['release'] = $mod_arr[$i]->getVar('mod_release'); - $mod['status'] = $mod_arr[$i]->getVar('mod_status'); $mod['admin'] = $mod_arr[$i]->getVar('mod_admin'); $mod['user'] = $mod_arr[$i]->getVar('mod_user'); $mod['submenu'] = $mod_arr[$i]->getVar('mod_submenu'); @@ -95,10 +92,7 @@ foreach (array_keys($tables_arr) as $i) { $table['id'] = $tables_arr[$i]->getVar('table_id'); - $table['name'] = $tables_arr[$i]->getVar('table_name'); - $module_name = $modules_Handler->get($tables_arr[$i]->getVar('table_mid')); - $mod_name = $module_name->getVar('mod_name'); - $table['mid'] = $mod_name; + $table['name'] = $tables_arr[$i]->getVar('table_name'); $table['image'] = $tables_arr[$i]->getVar('table_image'); $table['nbfields'] = $tables_arr[$i]->getVar('table_nbfields'); $table['blocks'] = $tables_arr[$i]->getVar('table_blocks'); @@ -147,7 +141,7 @@ 'table_nbfields' => $_POST['table_nbfields'], 'table_fieldname' => $_POST['table_fieldname'])); //Form table_image $pathIcon32 = XOOPS_ROOT_PATH . '/media/xoops/images/icons/32'; - $uploaddir = is_dir($pathIcon32) ? $pathIcon32 : TDMC_TABLES_PATH_IMG; + $uploaddir = ( is_dir($pathIcon32) && XoopsLoad::fileExists($pathIcon32) ) ? $pathIcon32 : TDMC_TABLES_PATH_IMG; $uploader = new XoopsMediaUploader( $uploaddir, $xoops->getModuleConfig('mimetypes'), $xoops->getModuleConfig('maxuploadsize'), null, null); if ($uploader->fetchMedia($_POST['tables_image'][0])) { Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php 2013-04-03 18:20:26 UTC (rev 11340) @@ -0,0 +1,127 @@ +<?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.6.0 + * @author Timgno <txm...@gm...> + * @version $Id$ + */ +defined('XOOPS_ROOT_PATH') or die("Restricted access"); + +class TDMCreateFolder extends XoopsFolderHandler +{ + /** + * Constructor. + * + * @param string $path Path to folder + * @param bool $create Create folder if not found + * @param mixed $mode Mode (CHMOD) to apply to created folder, false to ignore + */ + public function __construct($path = '', $create = true, $mode = false) + { + parent::__construct($path, $create, $mode); + } + + /** + * Create a directory. + * + * @param string $path The directory structure to create + * @param int|bool $mode octal value 0755 + * @access public + */ + public function create($path = '', $mode = false) + { + $this->create($path, $mode); + } + + /** + * Change the mode on a directory structure recursively. + * + * @param string $path The path to chmod + * @param int|bool $mode octal value 0755 + * @param bool $recursive chmod recursively + * @param array $exceptions array of files, directories to skip + * @return bool Returns TRUE on success, FALSE on failure + * @access public + */ + public function chmod($path, $mode) + { + $this->chmod($path, $mode); + } +} + +class TDMCreateFile extends XoopsFileHandler +{ + /** + * Constructor + * + * @param string $path Path to file + * @param boolean $create Create file if it does not exist (if true) + * @param integer $mode Mode to apply to the folder holding the file + * @access private + */ + public function __construct($path, $create = false, $mode = 0755) + { + parent::__construct($path, $create, $mode); + $this->create(); + } + + /** + * + * @param string $path_name + * @param string $module_name + * @param string $dirname + * @param string $file + */ + public function getDirFile($path_name, $module_name, $dirname, $file) + { + return $path_name . '/' . $module_name . '/' . $dirname . '/' . $file; + } + + /** + * + * @param string $path + * @param string $text + * @param string $lng_ok + * @param string $lng_notok + * @param string $file + */ + public function createFile($path, $text, $lng_ok, $lng_notok, $file) + { + $this->path = $path; + $this->open('a+'); + if ($this->writable()) + { + if ($this->write($text) === false) { + echo '<tr> + <td>'.sprintf($lng_notok, $file).'</td> + <td><img src='. $pathIcon16 .'/off.png></td> + </tr>'; + exit; + } + echo '<tr> + <td>'.sprintf($lng_ok, $file).'</td> + <td><img src='. $pathIcon16 .'/on.png></td> + </tr>'; + $this->close(); + } else { + echo '<tr> + <td>'.sprintf($lng_notok, $file).'</td> + <td><img src='. $pathIcon16 .'/off.png></td> + </tr>'; + } + } +} \ No newline at end of file Property changes on: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/files/files.php ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Author Date Id Rev URL \ No newline at end of property Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php 2013-04-03 02:56:45 UTC (rev 11339) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/class/structure.php 2013-04-03 18:20:26 UTC (rev 11340) @@ -21,64 +21,6 @@ */ defined('XOOPS_ROOT_PATH') or die("Restricted access"); -class TDMCreateFolder extends XoopsFolderHandler -{ - /** - * Constructor. - * - * @param string $path Path to folder - * @param bool $create Create folder if not found - * @param mixed $mode Mode (CHMOD) to apply to created folder, false to ignore - */ - public function __construct($path = '', $create = true, $mode = false) - { - parent::__construct($path, $create, $mode); - } - - /** - * Create a directory. - * - * @param string $path The directory structure to create - * @param int|bool $mode octal value 0755 - * @access public - */ - public function create($path = '', $mode = false) - { - $this->create($path, $mode); - } - - /** - * Change the mode on a directory structure recursively. - * - * @param string $path The path to chmod - * @param int|bool $mode octal value 0755 - * @param bool $recursive chmod recursively - * @param array $exceptions array of files, directories to skip - * @return bool Returns TRUE on success, FALSE on failure - * @access public - */ - public function chmod($path, $mode) - { - $this->chmod($path, $mode); - } -} - -class TDMCreateFile extends XoopsFileHandler -{ - /** - * Constructor - * - * @param string $path Path to file - * @param boolean $create Create file if it does not exist (if true) - * @param integer $mode Mode to apply to the folder holding the file - * @access private - */ - function __construct($path, $create = false, $mode = 0755) - { - parent::__construct($path, $create, $mode); - } -} - class TDMCreateStructure extends TDMCreateFile { /** Added: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt (rev 0) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/docs/lang_diff.txt 2013-04-03 18:20:26 UTC (rev 11340) @@ -0,0 +1,4 @@ +Read Me First +============= + +Please make sure that you download the XOOPS Icon Set, and upload it to uploads/images directory \ No newline at end of file Modified: XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html =================================================================== --- XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-04-03 02:56:45 UTC (rev 11339) +++ XoopsModules26/tdmcreate/branches/2.01/timgno/tdmcreate/templates/admin/tdmcreate_tables.html 2013-04-03 18:20:26 UTC (rev 11340) @@ -7,12 +7,9 @@ <tr> <th class='txtcenter'><{translate key="ID"}></th> <th class='txtcenter'><{translate key="NAME"}></th> - <th class='txtcenter'><{translate key="VERSION"}></th> <th class='txtcenter'><{translate key="IMAGE"}></th> - <th class='txtcenter'><{translate key="RELEASE"}></th> - <th class='txtcenter'><{translate key="STATUS"}></th> <th class='txtcenter'><{translate key="FIELDS"}></th> - <th class='txtcenter'><{translate key="BLOCKS"}></th> + <th class='txtcenter'><{translate key="BLOCKS"}></th> <th class='txtcenter'><{translate key="ADMIN"}></th> <th class='txtcenter'><{translate key="USER"}></th> <th class='txtcenter'><{translate key="SUBMENU"}></th> @@ -27,10 +24,7 @@ <tr class='<{cycle values='even,odd'}>'> <td class='center'><{$module.id}></td> <td class='center'><{$module.name}></td> - <td class='center'><{$module.version}></td> <td class='center'><img src='<{xoAppUrl uploads/tdmcreate/images/modules}>/<{$module.image}>' height='20px' title='<{$module.name}>' alt='<{$module.name}>' /></td> - <td class='center'><{$module.release}></td> - <td class='center'><{$module.status}></td> <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/16/fields.png}>' /></td> <td class='center'><img src='<{xoAppUrl modules/tdmcreate/icons/16/blocks.png}>' /></td> <td class='center'><img src='<{if $module.admin}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> @@ -57,10 +51,8 @@ <tr class='<{cycle values='even,odd'}>'> <td class='center'><{$table.id}></td> <td class='center'><{$table.name}></td> - <td class='center'><{$table.mid}></td> <!-- uploads/tdmcreate/images/tables --> - <td class='center'><img src='<{xoAppUrl media/xoops/images/icons/32}>/<{$table.image}>' title='<{$table.name}>' alt='<{$table.name}>' height='20px' /></td> - <td class='center'> </td> - <td class='center'> </td> + <!-- uploads/tdmcreate/images/tables --> + <td class='center'><img src='<{xoAppUrl media/xoops/images/icons/32}>/<{$table.image}>' title='<{$table.name}>' alt='<{$table.name}>' height='20px' /></td> <td class='center'><{$table.nbfields}></td> <td class='center'><img src='<{if $table.blocks}><{xoAppUrl modules/tdmcreate/icons/16/green.png}> <{else}><{xoAppUrl modules/tdmcreate/icons/16/red.png}><{/if}>' /></td> |