Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1069545
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jul 20, 1:46 AM
Size
7 KB
Mime Type
text/x-diff
Expires
Tue, Jul 22, 1:46 AM (9 h, 50 m)
Engine
blob
Format
Raw Data
Handle
692451
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/kernel/units/modules/modules_event_handler.php
===================================================================
--- trunk/kernel/units/modules/modules_event_handler.php (revision 4577)
+++ trunk/kernel/units/modules/modules_event_handler.php (revision 4578)
@@ -1,75 +1,78 @@
<?php
class ModulesEventHandler extends InpDBEventHandler {
/**
* Builds item
*
* @param kEvent $event
* @access protected
*/
function OnItemBuild(&$event)
{
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $event->Special);
parent::OnItemBuild($event);
}
/**
* List with one record if special passed
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
if ($event->Special) {
$object =& $event->getObject();
$object->addFilter('current_module', 'Name = '.$event->Special);
}
}
function mapEvents()
{
parent::mapEvents();
- unset($this->eventMethods['OnMassDecline']);
+ $this->eventMethods['OnMassApprove'] = 'moduleAction';
+ $this->eventMethods['OnMassDecline'] = 'moduleAction';
}
/**
* Disabled modules, but not In-Portal
*
* @param kEvent $event
*/
- function OnMassDecline(&$event)
+ function moduleAction(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if (!$ids) return true;
$status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') );
foreach($ids as $id)
{
$object->Load($id);
if ($object->GetID() == 'In-Portal') continue;
- $object->SetDBField($status_field, 0);
+ $object->SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0);
if ($object->Update()) {
$event->status = erSUCCESS;
$event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
+
+ $event->SetRedirectParam('RefreshTree', 1);
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/modules/modules_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property
Index: trunk/kernel/admin_templates/modules/modules_list.tpl
===================================================================
--- trunk/kernel/admin_templates/modules/modules_list.tpl (revision 4577)
+++ trunk/kernel/admin_templates/modules/modules_list.tpl (revision 4578)
@@ -1,46 +1,50 @@
<inp2:m_set nobody="yes"/>
<inp2:m_include t="incs/header"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<inp2:m_ParseBlock name="section_header" icon="icon46_modules" title="!la_title_Module_Status!"/>
<inp2:m_ParseBlock name="blue_bar" prefix="mod" title_preset="modules_list" module="in-portal" icon="icon46_modules"/>
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
//do not rename - this function is used in default grid for double click!
function edit()
{
}
var a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_EnableModule" escape="1"/>', function() {
submit_event('mod','OnMassApprove');
}
) );
a_toolbar.AddButton( new ToolBarButton('deny', '<inp2:m_phrase label="la_ToolTip_EnableDisable" escape="1"/>', function() {
submit_event('mod','OnMassDecline');
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
<inp2:m_ParseBlock name="grid" PrefixSpecial="mod" IdField="Name" grid="Default" has_filters="has_filters"/>
<script type="text/javascript">
Grids['mod'].SetDependantToolbarButtons( new Array('approve','deny') );
+ <inp2:m_if check="m_GetEquals" name="RefreshTree" value="1">
+ var $tree_frame = window.parent.getFrame('menu');
+ $tree_frame.location = $tree_frame.location;
+ </inp2:m_if>
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/modules/modules_list.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/units/modules/modules_event_handler.php
===================================================================
--- trunk/core/units/modules/modules_event_handler.php (revision 4577)
+++ trunk/core/units/modules/modules_event_handler.php (revision 4578)
@@ -1,75 +1,78 @@
<?php
class ModulesEventHandler extends InpDBEventHandler {
/**
* Builds item
*
* @param kEvent $event
* @access protected
*/
function OnItemBuild(&$event)
{
$this->Application->SetVar($event->getPrefixSpecial(true).'_id', $event->Special);
parent::OnItemBuild($event);
}
/**
* List with one record if special passed
*
* @param kEvent $event
*/
function SetCustomQuery(&$event)
{
if ($event->Special) {
$object =& $event->getObject();
$object->addFilter('current_module', 'Name = '.$event->Special);
}
}
function mapEvents()
{
parent::mapEvents();
- unset($this->eventMethods['OnMassDecline']);
+ $this->eventMethods['OnMassApprove'] = 'moduleAction';
+ $this->eventMethods['OnMassDecline'] = 'moduleAction';
}
/**
* Disabled modules, but not In-Portal
*
* @param kEvent $event
*/
- function OnMassDecline(&$event)
+ function moduleAction(&$event)
{
if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) {
return;
}
$object =& $event->getObject( Array('skip_autoload' => true) );
$ids = $this->StoreSelectedIDs($event);
if (!$ids) return true;
$status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') );
foreach($ids as $id)
{
$object->Load($id);
if ($object->GetID() == 'In-Portal') continue;
- $object->SetDBField($status_field, 0);
+ $object->SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0);
if ($object->Update()) {
$event->status = erSUCCESS;
$event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay!
}
else {
$event->status = erFAIL;
$event->redirect = false;
break;
}
}
+
+ $event->SetRedirectParam('RefreshTree', 1);
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/modules/modules_event_handler.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property
Event Timeline
Log In to Comment