|
From: <txm...@us...> - 2014-06-18 22:39:07
|
Revision: 12619
http://sourceforge.net/p/xoops/svn/12619
Author: txmodxoops
Date: 2014-06-18 22:38:58 +0000 (Wed, 18 Jun 2014)
Log Message:
-----------
- Updated
- Work in progress
Modified Paths:
--------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
Removed Paths:
-------------
XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/repository.php
Deleted: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/repository.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/repository.php 2014-06-18 17:18:31 UTC (rev 12618)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/admin/repository.php 2014-06-18 22:38:58 UTC (rev 12619)
@@ -1,231 +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.5
- * @author Txmod Xoops <su...@tx...>
- * @version $Id: 1.59 repository.php 11297 2013-03-24 10:58:10Z timgno $
- */
-include 'header.php';
-// Recovered value of argument op in the URL $
-$op = TDMCreateRequest::getString('op', 'list');
-//
-$mod_id = TDMCreateRequest::getInt('mod_id');
-//
-switch ($op)
-{
- case 'list':
- default:
- $start = TDMCreateRequest::getInt('start', 0);
- $limit = TDMCreateRequest::getInt('limit', $tdmcreate->getConfig('repository_adminpager'));
- // Define main template
- $template_main = 'repository.tpl';
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
- $GLOBALS['xoTheme']->addStylesheet( 'modules/TDMCreate/css/admin/style.css' );
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('repository.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'repository.php?op=new', 'add');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
- $GLOBALS['xoopsTpl']->assign('tdmc_url', TDMC_URL);
- $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgrep_url', TDMC_UPLOAD_IMGREP_URL);
- $GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
- $GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
- $criteria = new CriteriaCompo();
- $criteria->setSort('mod_id ASC, mod_name');
- $criteria->setOrder('ASC');
- $nb_modules = $tdmcreate->getHandler('repository')->getCount( $criteria );
- $mods_arr = $tdmcreate->getHandler('repository')->getAll( $criteria );
- unset($criteria);
- // Redirect if there aren't repository
- if ( $nb_modules == 0 ) {
- redirect_header('repository.php?op=new', 2, _AM_TDMCREATE_NOTMODULES );
- }
- // Display repository list
- if ( $nb_modules > 0 ) {
- foreach (array_keys($mods_arr) as $i) {
- $mod['id'] = $i;
- $mod['name'] = $mods_arr[$i]->getVar('mod_name');
- $mod['version'] = $mods_arr[$i]->getVar('mod_version');
- $mod['image'] = $mods_arr[$i]->getVar('mod_image');
- $mod['release'] = $mods_arr[$i]->getVar('mod_release');
- $mod['status'] = $mods_arr[$i]->getVar('mod_status');
- $mod['admin'] = $mods_arr[$i]->getVar('mod_admin');
- $mod['user'] = $mods_arr[$i]->getVar('mod_user');
- $mod['search'] = $mods_arr[$i]->getVar('mod_search');
- $mod['comments'] = $mods_arr[$i]->getVar('mod_comments');
- $mod['notifications'] = $mods_arr[$i]->getVar('mod_notifications');
- $mod['permissions'] = $mods_arr[$i]->getVar('mod_permissions');
- $GLOBALS['xoopsTpl']->append('repository_list', $mod);
- unset($mod);
- }
- if ( $nb_modules > $limit ) {
- include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
- $pagenav = new XoopsPageNav($nb_modules, $limit, $start, 'start', 'op=list&limit=' . $limit);
- $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
- }
- } else {
- $GLOBALS['xoopsTpl']->assign('error', _AM_TDMCREATE_THEREARENT_MODULES);
- }
- break;
-
- case 'new':
- // Define main template
- $template_main = 'repository.tpl';
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('repository.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'repository.php', 'list');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
-
- $obj =& $tdmcreate->getHandler('repository')->create();
- $form = $obj->getForm();
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
-
- case 'save':
- if ( !$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('repository.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
- if (isset($mod_id)) {
- $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
- } else {
- $obj =& $tdmcreate->getHandler('repository')->create();
- }
- //Form module save
- $obj->setVars(array('mod_name' => $_POST['mod_name'],
- 'mod_version' => $_POST['mod_version'],
- 'mod_since' => $_POST['mod_since'],
- 'mod_min_php' => $_POST['mod_min_php'],
- 'mod_min_xoops' => $_POST['mod_min_xoops'],
- 'mod_min_admin' => $_POST['mod_min_admin'],
- 'mod_min_mysql' => $_POST['mod_min_mysql'],
- 'mod_description' => $_POST['mod_description'],
- 'mod_author' => $_POST['mod_author'],
- 'mod_author_mail' => $_POST['mod_author_mail'],
- 'mod_author_website_url' => $_POST['mod_author_website_url'],
- 'mod_author_website_name' => $_POST['mod_author_website_name'],
- 'mod_credits' => $_POST['mod_credits'],
- 'mod_license' => $_POST['mod_license'],
- 'mod_release_info' => $_POST['mod_release_info'],
- 'mod_release_file' => $_POST['mod_release_file'],
- 'mod_manual' => $_POST['mod_manual'],
- 'mod_manual_file' => $_POST['mod_manual_file']));
- //Form mod_image
- include_once XOOPS_ROOT_PATH . '/class/uploader.php';
- $uploader = new XoopsMediaUploader(TDMC_UPLOAD_IMGMOD_PATH, $tdmcreate->getConfig('mimetypes'),
- $tdmcreate->getConfig('maxsize'), null, null);
- if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
- $extension = preg_replace( '/^.+\.([^.]+)$/sU' , '\\1' , $_FILES['attachedfile']['name']);
- $name_img = strtolower($_POST['mod_name']).'_slogo.'.$extension;
- $uploader->setPrefix($name_img);
- $uploader->fetchMedia($_POST['xoops_upload_file'][0]);
- if (!$uploader->upload()) {
- $errors = $uploader->getErrors();
- redirect_header('javascript:history.go(-1)',3, $errors);
- } else {
- $obj->setVar('mod_image', $uploader->getSavedFileName());
- }
- } else {
- $obj->setVar('mod_image', $_POST['mod_image']);
- }
- //Form module save
- $obj->setVars(array('mod_demo_site_url' => $_POST['mod_demo_site_url'],
- 'mod_demo_site_name' => $_POST['mod_demo_site_name'],
- 'mod_support_url' => $_POST['mod_support_url'],
- 'mod_support_name' => $_POST['mod_support_name'],
- 'mod_website_url' => $_POST['mod_website_url'],
- 'mod_website_name' => $_POST['mod_website_name'],
- 'mod_release' => $_POST['mod_release'],
- 'mod_status' => $_POST['mod_status'],
- 'mod_admin' => (($_REQUEST['mod_admin'] == 1) ? '1' : '0'),
- 'mod_user' => (($_REQUEST['mod_user'] == 1) ? '1' : '0'),
- 'mod_search' => (($_REQUEST['mod_search'] == 1) ? '1' : '0'),
- 'mod_comments' => (($_REQUEST['mod_comments'] == 1) ? '1' : '0'),
- 'mod_notifications' => (($_REQUEST['mod_notifications'] == 1) ? '1' : '0'),
- 'mod_permissions' => (($_REQUEST['mod_permissions'] == 1) ? '1' : '0'),
- 'mod_inroot_copy' => (($_REQUEST['mod_inroot_copy'] == 1) ? '1' : '0'),
- 'mod_donations' => $_POST['mod_donations'],
- 'mod_subversion' => $_POST['mod_subversion'])
- );
-
- if ($tdmcreate->getHandler('repository')->insert($obj)) {
- redirect_header('repository.php', 2, _AM_TDMCREATE_FORMOK);
- }
-
- $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
- $form =& $obj->getForm();
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
-
- case 'edit':
- // Define main template
- $template_main = 'repository.tpl';
- $GLOBALS['xoTheme']->addScript('modules/TDMCreate/js/functions.js');
- $GLOBALS['xoopsTpl']->assign('navigation', $adminMenu->addNavigation('repository.php'));
- $adminMenu->addItemButton(_AM_TDMCREATE_ADD_MODULE, 'repository.php?op=new', 'add');
- $adminMenu->addItemButton(_AM_TDMCREATE_MODULES_LIST, 'repository.php', 'list');
- $GLOBALS['xoopsTpl']->assign('buttons', $adminMenu->renderButton());
-
- $obj = $tdmcreate->getHandler('repository')->get($mod_id);
- $form = $obj->getForm();
- $GLOBALS['xoopsTpl']->assign('form', $form->render());
- break;
-
- case 'delete':
- $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
- if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1) {
- if ( !$GLOBALS['xoopsSecurity']->check() ) {
- redirect_header('repository.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
- }
- if ($tdmcreate->getHandler('repository')->delete($obj)) {
- redirect_header('repository.php', 3, _AM_TDMCREATE_FORMDELOK);
- } else {
- $GLOBALS['xoopsTpl']->assign('error', $obj->getHtmlErrors());
- }
- } else {
- xoops_confirm(array('ok' => 1, 'mod_id' => $mod_id, 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_TDMCREATE_FORMSUREDEL, $obj->getVar('mod_name')));
- }
- break;
-
- case 'display':
- $mod_admin = TDMCreateRequest::getInt('mod_admin');
- $mod_user = TDMCreateRequest::getInt('mod_user');
- $mod_search = TDMCreateRequest::getInt('mod_search');
- $mod_comments = TDMCreateRequest::getInt('mod_comments');
- $mod_notifications = TDMCreateRequest::getInt('mod_notifications');
- $mod_permissions = TDMCreateRequest::getInt('mod_permissions');
-
- if ( $mod_id > 0 ) {
- $obj =& $tdmcreate->getHandler('repository')->get($mod_id);
- if(isset($mod_adminm)) {
- $obj->setVar('mod_admin', $mod_admin);
- } elseif(isset($mod_user)) {
- $obj->setVar('mod_user', $mod_user);
- } elseif(isset($mod_search)) {
- $obj->setVar('mod_search', $mod_search);
- } elseif(isset($mod_comments)) {
- $obj->setVar('mod_comments', $mod_comments);
- } elseif(isset($mod_notifications)) {
- $obj->setVar('mod_notifications', $mod_notifications);
- } elseif(isset($mod_permissions)) {
- $obj->setVar('mod_permissions', $mod_permissions);
- }
- if ($tdmcreate->getHandler('repository')->insert($obj, true)) {
- redirect_header('repository.php', 1, _AM_TDMCREATE_TOGGLE_SUCCESS);
- } else {
- redirect_header('repository.php', 1, _AM_TDMCREATE_TOGGLE_FAILED);
- }
- }
- break;
-}
-include 'footer.php';
\ No newline at end of file
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-18 17:18:31 UTC (rev 12618)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/fields.php 2014-06-18 22:38:58 UTC (rev 12619)
@@ -252,7 +252,8 @@
$field_block = $isNew ? 0 : $field->getVar('field_block');
$check_field_block = new XoopsFormCheckBox('', 'field_block['.$id.']', $field_block);
$check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK);
- $parameters_tray->addElement($check_field_block);
+ $parameters_tray->addElement($check_field_block);
+
$main = $field->getVar('field_main');
$field_main = $isNew ? $id : $main;
if($main == 1) {
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-06-18 17:18:31 UTC (rev 12618)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/admin/pages.php 2014-06-18 22:38:58 UTC (rev 12619)
@@ -80,7 +80,9 @@
* @param string $table_name
* @param string $language
*/
- public function getAdminPagesList($table_name, $language, $fields, $fpif, $fpmf) {
+ public function getAdminPagesList($module_name, $table_name, $language, $fields, $fpif, $fpmf) {
+ $stu_mod_name = strtoupper($module_name);
+ $stl_mod_name = strtolower($module_name);
$stu_table_name = strtoupper($table_name);
$ret = <<<EOT
case 'list':
@@ -95,7 +97,8 @@
\${$table_name}_rows = \${$table_name}Handler->getCount(\$criteria);
\${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
unset(\$criteria);
-
+ \$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_url', {$stu_mod_name}_URL);
+ \$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_upload_url', {$stu_mod_name}_UPLOAD_URL);
// Table view
if (\${$table_name}_rows > 0)
{
@@ -297,7 +300,7 @@
}
$content = $this->getHeaderFilesComments($module, $filename);
$content .= $this->getAdminPagesHeader($module_name, $table_name);
- $content .= $this->getAdminPagesList($table_name, $language, $fields, $fpif, $fpmf);
+ $content .= $this->getAdminPagesList($module_name, $table_name, $language, $fields, $fpif, $fpmf);
$content .= $this->getAdminPagesNew($table_name, $language);
$content .= $this->getAdminPagesSave($module_name, $table_name, $language, $fields, $fpif, $fpmf);
$content .= $this->getAdminPagesEdit($table_name, $language, $fpif);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-18 17:18:31 UTC (rev 12618)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/admin/pages.php 2014-06-18 22:38:58 UTC (rev 12619)
@@ -58,7 +58,8 @@
public function renderFile($filename) {
$module = $this->getModule();
$table = $this->getTable();
- $module_name = $module->getVar('mod_name');
+ $module_name = $module->getVar('mod_name');
+ $stl_mod_name = strtolower($module_name);
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
//
@@ -100,7 +101,7 @@
}
if( $field_element == 9 ) {
$content .= <<<EOT
- <td class="center"><img src="<{\$xoops_url}>/uploads/{$module_name}/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
} elseif( $field_element == 8 ) {
$content .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-18 17:18:31 UTC (rev 12618)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/templates/user/pages.php 2014-06-18 22:38:58 UTC (rev 12619)
@@ -60,6 +60,7 @@
$module = $this->getModule();
$table = $this->getTable();
$module_name = $module->getVar('mod_name');
+ $stl_mod_name = strtolower($module_name);
$table_name = $table->getVar('table_name');
$table_fieldname = $table->getVar('table_fieldname');
//$filename = $this->getFileName();
@@ -82,7 +83,7 @@
$content .= <<<EOT
</tr>
<{foreach item={$table_fieldname} from=\${$table_name}}>
- <tr class="<{cycle values=\'odd, even\'}>">\n
+ <tr class="<{cycle values='odd, even'}>">\n
EOT;
foreach(array_keys($fields) as $f)
{
@@ -97,7 +98,7 @@
}
if( $field_element == 9 ) {
$content .= <<<EOT
- <td class="center"><img src="<{\$xoops_url}>/uploads/{$module_name}/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
+ <td class="center"><img src="<{\${$stl_mod_name}_upload_url}>/images/{$table_name}/<{\${$table_fieldname}.{$rp_field_name}}>" alt="{$table_name}"></td>\n
EOT;
} elseif( $field_element == 8 ) {
$content .= <<<EOT
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php 2014-06-18 17:18:31 UTC (rev 12618)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/class/files/user/pages.php 2014-06-18 22:38:58 UTC (rev 12619)
@@ -71,7 +71,7 @@
\${$table_name}_rows = \${$table_name}Handler->getCount();
\${$table_name}_arr = \${$table_name}Handler->getAll(\$criteria);
unset(\$criteria);
-
+
// Table view
if (\${$table_name}_rows > 0)
{
@@ -138,6 +138,8 @@
// Get Handler
\${$stl_table_name}Handler =& xoops_getModuleHandler('{$stl_table_name}', \$dirname);
//
+\$GLOBALS['xoopsTpl']->assign('{$stl_mod_name}_upload_url', {$stu_mod_name}_UPLOAD_URL);
+//
\$criteria = new CriteriaCompo();
\${$stl_table_name}_count = \${$stl_table_name}Handler->getCount(\$criteria);
\${$stl_table_name}_arr = \${$stl_table_name}Handler->getAll(\$criteria);
Modified: XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php
===================================================================
--- XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-06-18 17:18:31 UTC (rev 12618)
+++ XoopsModules/TDMCreate/branches/timgno/1.91/TDMCreate/xoops_version.php 2014-06-18 22:38:58 UTC (rev 12619)
@@ -55,7 +55,7 @@
$modversion['min_php'] = "5.3";
$modversion['min_xoops'] = "2.5.7";
$modversion['min_admin'] = "1.1";
-$modversion['min_db'] = array('mysql' => '5.5.8', 'mysqli' => '5.5.8');
+$modversion['min_db'] = array('mysql' => '5.0.7', 'mysqli' => '5.0.7');
//about
$modversion['demo_site_url'] = "http://www.xoops.org/";
$modversion['demo_site_name'] = "Xoops TDM";
|