Index: trunk/kernel/units/configuration/configuration_event_handler.php
===================================================================
diff -u -N -r4625 -r4653
--- trunk/kernel/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 4625)
+++ trunk/kernel/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 4653)
@@ -2,7 +2,20 @@
class ConfigurationEventHandler extends InpDBEventHandler {
+
/**
+ * Changes permission section to one from REQUEST, not from config
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $event->setEventParam('PermSection', $this->Application->GetVar('section'));
+ return parent::CheckPermission($event);
+ }
+
+
+ /**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
@@ -101,36 +114,48 @@
function OnUpdate(&$event)
{
if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+
+ // 1. save user selected module root category
+ $items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
+ $new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue');
+ if ($new_category_id) {
+ unset($items_info['ModuleRootCategory']);
+ $this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
+ }
+
parent::OnUpdate($event);
+
+ if ($event->status == erSUCCESS && $new_category_id !== false) {
+ // root category was submitted
+ $module = $this->Application->GetVar('module');
+ $root_category_id = $this->Application->findModule('Name', $module, 'RootCat');
+
+ if ($root_category_id != $new_category_id) {
+ // root category differs from one in db
+ $fields_hash = Array('RootCat' => $new_category_id);
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module));
+ }
+ }
}
- $event->SetRedirectParam('opener', 's');
-
if ($this->Application->GetVar('errormsgs')) {
// because we have list out there, and this is item
$this->Application->removeObject($event->getPrefixSpecial());
$event->redirect = false;
}
}
-
- function OnCancel(&$event)
- {
- parent::OnCancel($event);
- $event->SetRedirectParam('opener', 's');
- }
/**
* Enter description here...
*
* @param kEvent $event
*/
- function OnChangeCountry(&$event)
+ /*function OnChangeCountry(&$event)
{
$event->setPseudoClass('_List');
$object = &$event->getObject( Array('per_page'=>-1) );
$object->Query();
- //$object->SetDBField('');
- $array_records = &$object->Records;
+ $array_records =& $object->Records;
foreach($array_records as $i=>$record){
if ($record['VariableName']=='Comm_Country'){
$values = $this->Application->GetVar('conf');
@@ -140,6 +165,28 @@
$event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay!
$event->redirect = false;
+ }*/
+
+ /**
+ * Allows to process module root category selection
+ *
+ * @param kEvent $event
+ */
+ function OnSelectItems(&$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+
+ $items_info = $this->Application->GetVar('c');
+ list($resource_id, $field_values) = each($items_info);
+
+ if ($resource_id) {
+ $sql = 'SELECT CategoryId
+ FROM '.TABLE_PREFIX.'Category
+ WHERE ResourceId = '.$resource_id;
+ $category_id = $this->Conn->GetOne($sql);
+ $this->Application->StoreVar('ModuleRootCategory', $category_id);
+ }
+ $this->finalizePopup($event);
}
}
Index: trunk/core/units/configuration/configuration_event_handler.php
===================================================================
diff -u -N -r4625 -r4653
--- trunk/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 4625)
+++ trunk/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 4653)
@@ -2,7 +2,20 @@
class ConfigurationEventHandler extends InpDBEventHandler {
+
/**
+ * Changes permission section to one from REQUEST, not from config
+ *
+ * @param kEvent $event
+ */
+ function CheckPermission(&$event)
+ {
+ $event->setEventParam('PermSection', $this->Application->GetVar('section'));
+ return parent::CheckPermission($event);
+ }
+
+
+ /**
* Apply any custom changes to list's sql query
*
* @param kEvent $event
@@ -101,36 +114,48 @@
function OnUpdate(&$event)
{
if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+
+ // 1. save user selected module root category
+ $items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
+ $new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue');
+ if ($new_category_id) {
+ unset($items_info['ModuleRootCategory']);
+ $this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
+ }
+
parent::OnUpdate($event);
+
+ if ($event->status == erSUCCESS && $new_category_id !== false) {
+ // root category was submitted
+ $module = $this->Application->GetVar('module');
+ $root_category_id = $this->Application->findModule('Name', $module, 'RootCat');
+
+ if ($root_category_id != $new_category_id) {
+ // root category differs from one in db
+ $fields_hash = Array('RootCat' => $new_category_id);
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module));
+ }
+ }
}
- $event->SetRedirectParam('opener', 's');
-
if ($this->Application->GetVar('errormsgs')) {
// because we have list out there, and this is item
$this->Application->removeObject($event->getPrefixSpecial());
$event->redirect = false;
}
}
-
- function OnCancel(&$event)
- {
- parent::OnCancel($event);
- $event->SetRedirectParam('opener', 's');
- }
/**
* Enter description here...
*
* @param kEvent $event
*/
- function OnChangeCountry(&$event)
+ /*function OnChangeCountry(&$event)
{
$event->setPseudoClass('_List');
$object = &$event->getObject( Array('per_page'=>-1) );
$object->Query();
- //$object->SetDBField('');
- $array_records = &$object->Records;
+ $array_records =& $object->Records;
foreach($array_records as $i=>$record){
if ($record['VariableName']=='Comm_Country'){
$values = $this->Application->GetVar('conf');
@@ -140,6 +165,28 @@
$event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay!
$event->redirect = false;
+ }*/
+
+ /**
+ * Allows to process module root category selection
+ *
+ * @param kEvent $event
+ */
+ function OnSelectItems(&$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+
+ $items_info = $this->Application->GetVar('c');
+ list($resource_id, $field_values) = each($items_info);
+
+ if ($resource_id) {
+ $sql = 'SELECT CategoryId
+ FROM '.TABLE_PREFIX.'Category
+ WHERE ResourceId = '.$resource_id;
+ $category_id = $this->Conn->GetOne($sql);
+ $this->Application->StoreVar('ModuleRootCategory', $category_id);
+ }
+ $this->finalizePopup($event);
}
}
Index: trunk/core/kernel/application.php
===================================================================
diff -u -N -r4645 -r4653
--- trunk/core/kernel/application.php (.../application.php) (revision 4645)
+++ trunk/core/kernel/application.php (.../application.php) (revision 4653)
@@ -537,6 +537,9 @@
$this->Debugger->appendMemoryUsage('Application before Run:');
}
+ $this->LinkVar('module');
+ $this->LinkVar('section');
+
if (!$this->RequestProcessed) $this->ProcessRequest();
$this->InitParser();
Index: trunk/kernel/admin_templates/incs/header.tpl
===================================================================
diff -u -N -r4490 -r4653
--- trunk/kernel/admin_templates/incs/header.tpl (.../header.tpl) (revision 4490)
+++ trunk/kernel/admin_templates/incs/header.tpl (.../header.tpl) (revision 4653)
@@ -48,6 +48,4 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
Index: trunk/kernel/units/configuration/configuration_tag_processor.php
===================================================================
diff -u -N -r4446 -r4653
--- trunk/kernel/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4446)
+++ trunk/kernel/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4653)
@@ -58,7 +58,8 @@
$prev_heading = $list->GetDBField('heading');
$list->GoNext();
}
-
+
+ $this->Application->RemoveVar('ModuleRootCategory');
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
return $o;
}
@@ -127,6 +128,68 @@
return $msg;
}
+
+ /**
+ * Allows to show category path of selected module
+ *
+ * @param Array $params
+ * @return string
+ */
+ function CategoryPath($params)
+ {
+ if (!isset($params['cat_id'])) {
+ $params['cat_id'] = $this->ModuleRootCategory( Array() );
+ }
+
+ $block_params['current'] = 1;
+ $block_params['separator'] = $params['separator'];
+ if ($params['cat_id'] == 0) {
+ $block_params['name'] = $params['rootcatblock'];
+ return $this->Application->ParseBlock($block_params);
+ }
+ else {
+ $cat_object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' );
+ $sql = 'SELECT CategoryId, ParentId, Name FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$params['cat_id'];
+ $res = $this->Conn->GetRow($sql);
+ if ($res === false) {
+ // in case if category is deleted
+ return '';
+ }
+ $block_params['name'] = $params['block'];
+ $block_params['cat_name'] = $res['Name'];
+ $block_params['separator'] = $params['separator'];
+ $block_params['cat_id'] = $res['CategoryId'];
+ $next_params['separator'] = $params['separator'];
+ $next_params['rootcatblock'] = $params['rootcatblock'];
+ $next_params['block'] = $params['block'];
+ $next_params['cat_id'] = $res['ParentId'];
+ return $this->CategoryPath($next_params).$this->Application->ParseBlock($block_params);
+ }
+ }
+
+ /**
+ * Shows edit warning in case if module root category changed but not saved
+ *
+ * @param Array $params
+ * @return string
+ */
+ function SaveWarning($params)
+ {
+ $temp_category_id = $this->Application->RecallVar('ModuleRootCategory');
+ if ($temp_category_id !== false) {
+ return $this->Application->ParseBlock($params);
+ }
+ return '';
+ }
+
+ function ModuleRootCategory($params)
+ {
+ $category_id = $this->Application->RecallVar('ModuleRootCategory');
+ if ($category_id === false) {
+ $category_id = $this->Application->findModule('Name', $this->Application->GetVar('module'), 'RootCat');
+ }
+ return $category_id;
+ }
}
?>
\ No newline at end of file
Index: trunk/kernel/units/config_general/config_general_event_handler.php
===================================================================
diff -u -N
--- trunk/kernel/units/config_general/config_general_event_handler.php (revision 4287)
+++ trunk/kernel/units/config_general/config_general_event_handler.php (revision 0)
@@ -1,89 +0,0 @@
-getObject();
- $object->addFilter('by_name', '%1$s.Name = "In-Commerce"');
-
- }
-
- function OnSelectItems(&$event){
- $this->Application->setUnitOption($event->Prefix,'AutoLoad',false);
- $object =& $event->getObject();
-
- $selected_cat=$this->Application->GetVar("c");
- reset($selected_cat);
- //print_r($selected_cat);
- foreach($selected_cat as $cat_resource_id=>$val){}
-
-
- if ($cat_resource_id){
- $category_id = $this->Conn->GetOne('SELECT CategoryId FROM '.TABLE_PREFIX.'Category WHERE ResourceId='.$cat_resource_id);
- $this->Application->StoreVar("StoredRootCatId", $category_id);
- }
-
- $event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf,confg');
- $this->finalizePopup($event);
- }
-
- /**
- * Enter description here...
- *
- * @param kEvent $event
- */
-
-
- function OnBeforeItemUpdate(&$event)
- {
- $object =& $event->getObject();
- }
-
- /**
- * Enter description here...
- *
- * @param kEvent $event
- */
-
- function OnAfterItemUpdate(&$event)
- {
- $object =& $event->getObject();
- }
-
- function OnUpdate(&$event)
- {
- parent::OnUpdate($event);
- $event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay!
- }
-
- function OnCancel(&$event)
- {
- parent::OnCancel($event);
- $event->redirect_params = Array('opener' => 's', 'pass'=>'all,confg'); //stay!
- }
-
- /*
- function myUrlDecode($str){
- $str=str_replace(';',':', $str);
- $str=str_replace('!','-', $str);
- return $str;
- }
-
- function myUrlEncode($str){
- $str=str_replace('-', '!', $str);
- $str=str_replace(':', ';', $str);
- return $str;
- }
- */
-
- }
-
-?>
\ No newline at end of file
Index: trunk/kernel/units/config_general/config_general_config.php
===================================================================
diff -u -N
--- trunk/kernel/units/config_general/config_general_config.php (revision 2487)
+++ trunk/kernel/units/config_general/config_general_config.php (revision 0)
@@ -1,70 +0,0 @@
- 'confg',
- 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
- 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
- 'EventHandlerClass' => Array('class'=>'ConfigGeneralEventHandler','file'=>'config_general_event_handler.php','build_event'=>'OnBuild'),
- 'TagProcessorClass' => Array('class'=>'ConfigGeneralTagProcessor','file'=>'config_general_tag_processor.php','build_event'=>'OnBuild'),
- 'AutoLoad' => true,
- 'AggregateTags' => Array(
- Array(
- 'AggregateTo' => 'm',
- 'AggregatedTagName' => 'AllowAffiliateRegistration',
- 'LocalTagName' => 'AllowAffiliateRegistration',
- ),
- ),
- 'QueryString' => Array(
- 1 => 'id',
- 2 => 'page',
- 3 => 'event',
- 4 => 'type',
- 5 => 'mode',
- ),
-
- 'Hooks' => Array(
- Array(
- 'Mode' => hBEFORE,
- 'Conditional' => false,
- 'HookToPrefix' => 'conf',
- 'HookToSpecial' => '',
- 'HookToEvent' => Array( 'OnUpdate' ),
- 'DoPrefix' => 'confg',
- 'DoSpecial' => '',
- 'DoEvent' => 'OnUpdate',
- ),
- ),
-
- 'IDField' => 'Name',
-
- 'TitleField' => 'Name', // field, used in bluebar when editing existing item
-
- 'TitlePhrase' => 'la_title_GeneralFields',
-
- 'TitlePresets' => Array(
- 'config_list' => Array('prefixes' => Array('confg_List'), 'format' => "!la_updating_config!"),
- ),
-
- 'TableName' => TABLE_PREFIX.'Modules',
-
- 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
- ), // key - special, value - list select sql
- 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
- ),
-
- 'Fields' => Array(
- 'Name' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Path' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Var' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Version' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Loaded' => Array('type' => 'int','not_null' => '1','default' => '1'),
- 'LoadOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
- 'TemplatePath' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'RootCat' => Array('type' => 'int','not_null' => '1','default' => '0'),
- 'BuildDate' => Array('type' => 'double','not_null' => '1','default' => '0'), ),
- 'VirtualFields' => Array(),
-
- 'Grids' => Array(),
- );
-
-?>
\ No newline at end of file
Index: trunk/kernel/units/config_general/config_general_tag_processor.php
===================================================================
diff -u -N
--- trunk/kernel/units/config_general/config_general_tag_processor.php (revision 4446)
+++ trunk/kernel/units/config_general/config_general_tag_processor.php (revision 0)
@@ -1,103 +0,0 @@
-Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params);
-/* $prefix_special = $this->getPrefixSpecial();
-
- if ( !($list->OriginalParams == $params) ) {
- $this->Application->removeObject($prefix_special);
- $list =& $this->Application->recallObject($prefix_special,$this->Prefix.'_List',$params);
- }
- */
- $id_field = $this->Application->getUnitOption($this->Prefix,'IDField');
-
- $list->PerPage=-1;
- $list->Query();
- $o = '';
- $list->GoFirst();
-
- $block_params=$this->prepareTagParams($params);
- $block_params['name']=$params['block'];
- $block_params['pass_params']='true';
- $block_params['IdField'] = $id_field;
-
- while (!$list->EOL())
- {
- $stored_cat=$this->Application->RecallVar("StoredRootCatId", "");
- if ($stored_cat!=""){
- $list->Records[$list->CurrentIndex]["RootCat"]=$stored_cat;
- }
- $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) );
- $o.= $this->Application->ParseBlock($block_params, 1);
- $list->GoNext();
- }
-
- $this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
- $this->Application->RemoveVar("StoredRootCatId");
- return $o;
- }
-
- function CategoryPath($params)
- {
- $object=&$this->Application->recallObject("confg");
- $root_cat=$object->GetDBField("RootCat");
-
- if (!isset($params['cat_id'])){
- $stored_cat=$this->Application->RecallVar("StoredRootCatId", "");
- if ($stored_cat){
- $params['cat_id'] = $stored_cat;
- }else{
- $params['cat_id'] = $root_cat;
- }
- }
-
- $block_params['current'] = 1;
-
- $block_params['separator'] = $params['separator'];
- if ($params['cat_id'] == 0) {
- $block_params['name'] = $params['rootcatblock'];
- return $this->Application->ParseBlock($block_params);
- }
- else {
- $cat_object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' );
- $sql = 'SELECT CategoryId, ParentId, Name FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$params['cat_id'];
- $res = $this->Conn->GetRow($sql);
- if ($res === false) {
- // in case if category is deleted
- return '';
- }
- $block_params['name'] = $params['block'];
- $block_params['cat_name'] = $res['Name'];
- $block_params['separator'] = $params['separator'];
- $block_params['cat_id'] = $res['CategoryId'];
- $next_params['separator'] = $params['separator'];
- $next_params['rootcatblock'] = $params['rootcatblock'];
- $next_params['block'] = $params['block'];
- $next_params['cat_id'] = $res['ParentId'];
- return $this->CategoryPath($next_params).$this->Application->ParseBlock($block_params);
- }
- }
-
- function SaveWarning($params)
- {
-
- $object=&$this->Application->recallObject($this->getPrefixSpecial());
- $root_cat=$object->GetDBField("RootCat");
- $stored_cat=$this->Application->RecallVar("StoredRootCatId", "");
-
- if ($stored_cat!="" && $stored_cat!=$root_cat){
- return $this->Application->ParseBlock($params);
- }
- return "";
- }
-
- function AllowAffiliateRegistration($params)
- {
- return $this->Application->ConfigValue('Comm_RegisterAsAffiliate') ? 1 : 0;
- }
-}
-
-?>
\ No newline at end of file
Index: trunk/core/kernel/db/db_event_handler.php
===================================================================
diff -u -N -r4640 -r4653
--- trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4640)
+++ trunk/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 4653)
@@ -80,6 +80,7 @@
$permissions = Array(
'OnNew' => Array('self' => 'add', 'subitem' => 'add'),
'OnCreate' => Array('self' => 'add', 'subitem' => 'add|edit'),
+ 'OnUpdate' => Array('self' => 'edit', 'subitem' => 'add|edit'),
'OnDelete' => Array('self' => 'delete', 'subitem' => 'edit|add'),
'OnMassDelete' => Array('self' => 'delete', 'subitem' => 'edit|add'),
'OnSelectItems' => Array('self' => 'add|edit', 'subitem' => 'add|edit'),
Index: trunk/core/units/configuration/configuration_config.php
===================================================================
diff -u -N -r4644 -r4653
--- trunk/core/units/configuration/configuration_config.php (.../configuration_config.php) (revision 4644)
+++ trunk/core/units/configuration/configuration_config.php (.../configuration_config.php) (revision 4653)
@@ -19,11 +19,11 @@
'TitlePresets' => Array(
'default' => Array('tag_params' => Array('conf' => Array('per_page' => -1))),
- 'config_list_general' => Array('prefixes' => Array('conf_List','confg_List'), 'format' => "!la_updating_config!"),
- 'config_list_output' => Array('prefixes' => Array('conf_List','confg_List'), 'format' => "!la_updating_config!"),
- 'config_list_contacts' => Array('prefixes' => Array('conf_List','confg_List'), 'format' => "!la_updating_config!"),
+ 'config_list_general' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"),
+ 'config_list_output' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"),
+ 'config_list_contacts' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"),
),
-
+
'TableName' => TABLE_PREFIX.'ConfigurationValues',
'ListSQLs' => Array(''=>'SELECT * FROM '.TABLE_PREFIX.'ConfigurationAdmin LEFT JOIN '.TABLE_PREFIX.'ConfigurationValues Using(VariableName) '),
Index: trunk/core/units/configuration/configuration_tag_processor.php
===================================================================
diff -u -N -r4446 -r4653
--- trunk/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4446)
+++ trunk/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4653)
@@ -58,7 +58,8 @@
$prev_heading = $list->GetDBField('heading');
$list->GoNext();
}
-
+
+ $this->Application->RemoveVar('ModuleRootCategory');
$this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
return $o;
}
@@ -127,6 +128,68 @@
return $msg;
}
+
+ /**
+ * Allows to show category path of selected module
+ *
+ * @param Array $params
+ * @return string
+ */
+ function CategoryPath($params)
+ {
+ if (!isset($params['cat_id'])) {
+ $params['cat_id'] = $this->ModuleRootCategory( Array() );
+ }
+
+ $block_params['current'] = 1;
+ $block_params['separator'] = $params['separator'];
+ if ($params['cat_id'] == 0) {
+ $block_params['name'] = $params['rootcatblock'];
+ return $this->Application->ParseBlock($block_params);
+ }
+ else {
+ $cat_object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List' );
+ $sql = 'SELECT CategoryId, ParentId, Name FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$params['cat_id'];
+ $res = $this->Conn->GetRow($sql);
+ if ($res === false) {
+ // in case if category is deleted
+ return '';
+ }
+ $block_params['name'] = $params['block'];
+ $block_params['cat_name'] = $res['Name'];
+ $block_params['separator'] = $params['separator'];
+ $block_params['cat_id'] = $res['CategoryId'];
+ $next_params['separator'] = $params['separator'];
+ $next_params['rootcatblock'] = $params['rootcatblock'];
+ $next_params['block'] = $params['block'];
+ $next_params['cat_id'] = $res['ParentId'];
+ return $this->CategoryPath($next_params).$this->Application->ParseBlock($block_params);
+ }
+ }
+
+ /**
+ * Shows edit warning in case if module root category changed but not saved
+ *
+ * @param Array $params
+ * @return string
+ */
+ function SaveWarning($params)
+ {
+ $temp_category_id = $this->Application->RecallVar('ModuleRootCategory');
+ if ($temp_category_id !== false) {
+ return $this->Application->ParseBlock($params);
+ }
+ return '';
+ }
+
+ function ModuleRootCategory($params)
+ {
+ $category_id = $this->Application->RecallVar('ModuleRootCategory');
+ if ($category_id === false) {
+ $category_id = $this->Application->findModule('Name', $this->Application->GetVar('module'), 'RootCat');
+ }
+ return $category_id;
+ }
}
?>
\ No newline at end of file
Index: trunk/core/kernel/utility/event.php
===================================================================
diff -u -N -r4636 -r4653
--- trunk/core/kernel/utility/event.php (.../event.php) (revision 4636)
+++ trunk/core/kernel/utility/event.php (.../event.php) (revision 4653)
@@ -282,6 +282,11 @@
*/
function getSection()
{
+ $perm_section = $this->getEventParam('PermSection');
+ if ($perm_section) {
+ return $perm_section;
+ }
+
$main_prefix = $this->Application->GetTopmostPrefix($this->Prefix);
$section = $this->Application->getUnitOption($main_prefix, 'PermSection');
Index: trunk/kernel/units/admin/admin_tag_processor.php
===================================================================
diff -u -N -r4610 -r4653
--- trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4610)
+++ trunk/kernel/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4653)
@@ -47,18 +47,6 @@
}
/**
- * Save module & section once passed in REQUEST for future use
- *
- * @param Array $params
- */
- function StoreSystemVars($params)
- {
- // save theese variables to session, because they are useful for most configuration templates
- $this->Application->LinkVar('module');
- $this->Application->LinkVar('section');
- }
-
- /**
* Saves all required data for popups to return to it's parent window
*
* @param Array $params
Index: trunk/kernel/units/configuration/configuration_config.php
===================================================================
diff -u -N -r4644 -r4653
--- trunk/kernel/units/configuration/configuration_config.php (.../configuration_config.php) (revision 4644)
+++ trunk/kernel/units/configuration/configuration_config.php (.../configuration_config.php) (revision 4653)
@@ -19,11 +19,11 @@
'TitlePresets' => Array(
'default' => Array('tag_params' => Array('conf' => Array('per_page' => -1))),
- 'config_list_general' => Array('prefixes' => Array('conf_List','confg_List'), 'format' => "!la_updating_config!"),
- 'config_list_output' => Array('prefixes' => Array('conf_List','confg_List'), 'format' => "!la_updating_config!"),
- 'config_list_contacts' => Array('prefixes' => Array('conf_List','confg_List'), 'format' => "!la_updating_config!"),
+ 'config_list_general' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"),
+ 'config_list_output' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"),
+ 'config_list_contacts' => Array('prefixes' => Array('conf_List'), 'format' => "!la_updating_config!"),
),
-
+
'TableName' => TABLE_PREFIX.'ConfigurationValues',
'ListSQLs' => Array(''=>'SELECT * FROM '.TABLE_PREFIX.'ConfigurationAdmin LEFT JOIN '.TABLE_PREFIX.'ConfigurationValues Using(VariableName) '),
Index: trunk/core/units/admin/admin_tag_processor.php
===================================================================
diff -u -N -r4610 -r4653
--- trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4610)
+++ trunk/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 4653)
@@ -47,18 +47,6 @@
}
/**
- * Save module & section once passed in REQUEST for future use
- *
- * @param Array $params
- */
- function StoreSystemVars($params)
- {
- // save theese variables to session, because they are useful for most configuration templates
- $this->Application->LinkVar('module');
- $this->Application->LinkVar('section');
- }
-
- /**
* Saves all required data for popups to return to it's parent window
*
* @param Array $params