|
From: <be...@us...> - 2012-03-27 08:07:15
|
Revision: 9205
http://xoops.svn.sourceforge.net/xoops/?rev=9205&view=rev
Author: beckmi
Date: 2012-03-27 08:07:04 +0000 (Tue, 27 Mar 2012)
Log Message:
-----------
Added Toggle feature to Fields and Steps tabs, and buttons consistent with 2.5.x Admin GUI
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.5/docs/changelog.250.txt
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/category.php
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/field.php
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/step.php
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/class/field.php
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/docs/changelog.txt
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/language/english/admin.php
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_categorylist.html
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_fieldlist.html
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_steplist.html
XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/xoops_version.php
Modified: XoopsCore/branches/2.5.x/2.5.5/docs/changelog.250.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/docs/changelog.250.txt 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/docs/changelog.250.txt 2012-03-27 08:07:04 UTC (rev 9205)
@@ -14,7 +14,7 @@
- ID: 3511205 Bug in fresh install in page_configsave.php (XavierS)
Improved:
- - replacing "msnbot" with "bingbot" in Protector (mamba)
+ - replacing "msnbot" with "bingbot" in Protector (mamba)
Updated:
- HTML Purifier to 4.4.0 (mamba)
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/category.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/category.php 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/category.php 2012-03-27 08:07:04 UTC (rev 9205)
@@ -31,7 +31,12 @@
include 'admin_header.php';
xoops_cp_header();
$indexAdmin = new ModuleAdmin();
+
+
+$indexAdmin->addItemButton(_ADD . ' ' . _PROFILE_AM_CATEGORY, 'category.php?op=new', 'add', '');
+
echo $indexAdmin->addNavigation('category.php');
+echo $indexAdmin->renderButton('right', '');
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : (isset($_REQUEST['id']) ? "edit" : 'list');
@@ -100,5 +105,4 @@
if ( isset($template_main) ) {
$GLOBALS['xoopsTpl']->display("db:{$template_main}");
}
-include 'admin_footer.php';
-//xoops_cp_footer();
\ No newline at end of file
+include 'admin_footer.php';
\ No newline at end of file
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/field.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/field.php 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/field.php 2012-03-27 08:07:04 UTC (rev 9205)
@@ -20,7 +20,11 @@
include 'admin_header.php';
xoops_cp_header();
$indexAdmin = new ModuleAdmin();
+
+$indexAdmin->addItemButton(_ADD . ' ' . _PROFILE_AM_FIELD, 'field.php?op=new', 'add', '');
+
echo $indexAdmin->addNavigation('field.php');
+echo $indexAdmin->renderButton('right', '');
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : (isset($_REQUEST['id']) ? "edit" : 'list');
@@ -301,14 +305,13 @@
case 'toggle':
if (isset($_REQUEST['field_id'])) {
- $field_id=$_REQUEST['field_id'];
+ $field_id = intval($_REQUEST['field_id']);
if (isset($_REQUEST['field_required'])) {
- $field_required = isset($_GET['field_required']) ? intval($_GET['field_required']) : (isset($_POST['field_required']) ? intval($_POST['field_required']) : 0);
+ $field_required = intval($_REQUEST['field_required']);
profile_visible_toggle($field_id, $field_required);
- redirect_header('field.php', 1, _PROFILE_AM_REQUIRED_TOGGLE_SUCCESS);
- break;
}
}
+ break;
}
if (isset($template_main)) {
@@ -320,10 +323,13 @@
$field_required = ($field_required == 1) ? 0 : 1;
$this_handler =& xoops_getModuleHandler('field', 'profile');
$obj = $this_handler->get($field_id);
- $obj->setVar('field_required', intval($field_required));
- $this_handler->insert($obj,true);
+ $obj->setVar('field_required', $field_required);
+ if ($this_handler->insert($obj, true)) {
+ redirect_header('field.php', 1, _PROFILE_AM_REQUIRED_TOGGLE_SUCCESS);
+ } else {
+ redirect_header('field.php', 1, _PROFILE_AM_REQUIRED_TOGGLE_FAILED);
+ }
}
-include 'admin_footer.php';
-//xoops_cp_footer();
\ No newline at end of file
+include 'admin_footer.php';
\ No newline at end of file
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/step.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/step.php 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/admin/step.php 2012-03-27 08:07:04 UTC (rev 9205)
@@ -20,7 +20,10 @@
include 'admin_header.php';
xoops_cp_header();
$indexAdmin = new ModuleAdmin();
+
+$indexAdmin->addItemButton(_ADD . ' ' . _PROFILE_AM_STEP, 'step.php?op=new', 'add', '');
echo $indexAdmin->addNavigation('step.php');
+echo $indexAdmin->renderButton('right', '');
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : (isset($_REQUEST['id']) ? "edit" : 'list');
@@ -75,11 +78,34 @@
xoops_confirm(array('ok' => 1, 'id' => $_REQUEST['id'], 'op' => 'delete'), $_SERVER['REQUEST_URI'], sprintf(_PROFILE_AM_RUSUREDEL, $obj->getVar('step_name') ));
}
break;
+
+
+ case 'toggle':
+ if (isset($_GET['step_id'])) {
+ $field_id=intval($_GET['step_id']);
+ if (isset($_GET['step_save'])) {
+ $step_save = intval($_GET['step_save']);
+ profile_stepsave_toggle($step_id, $step_save);
+ }
+ }
+ break;
}
if ( !empty($template_main) ) {
$GLOBALS['xoopsTpl']->display("db:{$template_main}");
}
-include 'admin_footer.php';
-//xoops_cp_footer();
\ No newline at end of file
+function profile_stepsave_toggle($step_d, $step_save)
+{
+ $step_save = ($step_save == 1) ? 0 : 1;
+ $handler =& xoops_getmodulehandler('regstep');
+ $obj =& $handler->get($_REQUEST['step_id']);
+ $obj->setVar('step_save', $step_save);
+ if ($handler->insert($obj,true)) {
+ redirect_header('step.php', 1, _PROFILE_AM_SAVESTEP_TOGGLE_SUCCESS);
+ }else {
+ redirect_header('step.php', 1, _PROFILE_AM_SAVESTEP_TOGGLE_FAILED);
+ }
+}
+
+include 'admin_footer.php';
\ No newline at end of file
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/class/field.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/class/field.php 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/class/field.php 2012-03-27 08:07:04 UTC (rev 9205)
@@ -510,7 +510,7 @@
$obj->setVar('field_valuetype', XOBJ_DTYPE_TXTBOX);
}
- if (!in_array($obj->getVar('field_name'), $this->getUserVars())) {
+ if ((!in_array($obj->getVar('field_name'), $this->getUserVars())) && (!isset($_REQUEST['field_required']))) {
if ($obj->isNew()) {
//add column to table
$changetype = "ADD";
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/docs/changelog.txt
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/docs/changelog.txt 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/docs/changelog.txt 2012-03-27 08:07:04 UTC (rev 9205)
@@ -1,6 +1,8 @@
-Version 1.63
+Version 1.63 RC
-------------------
- added "Required" column in Fields with Toggle functionality (mamba)
+- added Toggle functionality to "Save After Step" column (mamba)
+- added "Add" buttons, consistent with 2.5.x Admin GUI (mamba)
Version 1.62 RC
-------------------
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/language/english/admin.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/language/english/admin.php 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/language/english/admin.php 2012-03-27 08:07:04 UTC (rev 9205)
@@ -113,8 +113,12 @@
//1.62
define('_PROFILE_AM_ACTION', 'Action');
//1.63
-define('_PROFILE_AM_REQUIRED_TOGGLE', 'Toggle Required');
+define('_PROFILE_AM_REQUIRED_TOGGLE', 'Toggle Required Field');
define('_PROFILE_AM_REQUIRED_TOGGLE_SUCCESS', 'Successfully Changed Required Field ');
+define('_PROFILE_AM_REQUIRED_TOGGLE_FAILED', 'Changing Required Field Failed');
+define('_PROFILE_AM_SAVESTEP_TOGGLE', 'Toggle Save');
+define('_PROFILE_AM_SAVESTEP_TOGGLE_SUCCESS', 'Successfully Changed Save After Step');
+define('_PROFILE_AM_SAVESTEP_TOGGLE_FAILED', "Changing 'Save After Step' Failed");
?>
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_categorylist.html
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_categorylist.html 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_categorylist.html 2012-03-27 08:07:04 UTC (rev 9205)
@@ -1,4 +1,3 @@
-<div><a href="category.php?op=new"><{$smarty.const._ADD}> <{$smarty.const._PROFILE_AM_CATEGORY}></a></div>
<table>
<tr>
<th><{$smarty.const._PROFILE_AM_TITLE}></th>
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_fieldlist.html
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_fieldlist.html 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_fieldlist.html 2012-03-27 08:07:04 UTC (rev 9205)
@@ -1,4 +1,3 @@
-<div><a href="field.php?op=new"><{$smarty.const._ADD}> <{$smarty.const._PROFILE_AM_FIELD}></a></div>
<form action="field.php" method="post" id="fieldform">
<table>
<th><{$smarty.const._PROFILE_AM_NAME}></th>
@@ -26,15 +25,11 @@
<input type="text" name="weight[<{$field.field_id}>]" size="5" maxlength="5" value="<{$field.field_weight}>" />
<{/if}>
</td>
-
- <!-- ___________adding "Required" status" //mb -->
<td align="center">
<{if $field.canEdit}>
<a href="field.php?op=toggle&field_required=<{$field.field_required}>&field_id=<{$field.field_id}>"><img src="<{$xoops_url}>/modules/profile/images/actions/<{$field.field_required}>.png" title="<{$smarty.const._PROFILE_AM_REQUIRED_TOGGLE}>" alt="<{$smarty.const._PROFILE_AM_REQUIRED_TOGGLE}>" /></a>
<{/if}>
</td>
- <!-- end __________"Required" status" //mb -->
-
<td align= "center">
<{if $field.canEdit}>
<input type="hidden" name="oldweight[<{$field.field_id}>]" value="<{$field.field_weight}>" />
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_steplist.html
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_steplist.html 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/templates/profile_admin_steplist.html 2012-03-27 08:07:04 UTC (rev 9205)
@@ -1,4 +1,3 @@
-<div><a href="step.php?op=new"><{$smarty.const._ADD}> <{$smarty.const._PROFILE_AM_STEP}></a></div>
<table>
<th><{$smarty.const._PROFILE_AM_STEPNAME}></th>
<th><{$smarty.const._PROFILE_AM_STEPORDER}></th>
@@ -7,8 +6,10 @@
<{foreach item=step from=$steps}>
<tr class="<{cycle values='odd, even'}>">
<td><{$step.step_name}></td>
- <td align= "center"><{$step.step_order}></td>
- <td align= "center"><{if $step.step_save == 1}><img src="<{xoModuleIcons16 on.png}>" alt="<{$smarty.const._YES}>" /><{else}><img src="<{xoModuleIcons16 off.png}>" alt="<{$smarty.const._NO}>" /><{/if}></td>
+ <td align= "center"><{$step.step_order}></td>
+ <td align="center">
+ <a href="step.php?op=toggle&step_save=<{$step.step_save}>&step_id=<{$step.step_id}>"><img src="<{$xoops_url}>/modules/profile/images/actions/<{$step.step_save}>.png" title="<{$smarty.const._PROFILE_AM_SAVESTEP_TOGGLE}>" alt="<{$smarty.const._PROFILE_AM_SAVESTEP_TOGGLE}>" /></a>
+ </td>
<td align= "center">
<a href="step.php?id=<{$step.step_id}>" title="<{$smarty.const._EDIT}>"><img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._EDIT}>" title="<{$smarty.const._EDIT}>" /></a>
<a href="step.php?op=delete&id=<{$step.step_id}>" title="<{$smarty.const._DELETE}>"><img src="<{xoModuleIcons16 delete.png}>" alt="<{$smarty.const._DELETE}>" title="<{$smarty.const._DELETE}>"</a>
Modified: XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/xoops_version.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/xoops_version.php 2012-03-26 20:25:40 UTC (rev 9204)
+++ XoopsCore/branches/2.5.x/2.5.5/htdocs/modules/profile/xoops_version.php 2012-03-27 08:07:04 UTC (rev 9205)
@@ -25,7 +25,7 @@
*/
$modversion = array();
$modversion['name'] = _PROFILE_MI_NAME;
-$modversion['version'] = 1.62;
+$modversion['version'] = 1.63;
$modversion['description'] = _PROFILE_MI_DESC;
$modversion['author'] = "Jan Pedersen, Taiwen Jiang, alfred, Wishcraft";
$modversion['credits'] = "Ackbarr, mboyden, marco, mamba, trabis, etc.";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|