Index: trunk/core/units/config_search/config_search_event_handler.php =================================================================== diff -u -N -r4000 -r4043 --- trunk/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 4000) +++ trunk/core/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 4043) @@ -13,63 +13,35 @@ { $object =& $event->getObject(); - $module_owner=$this->Application->GetVar('module'); - if ($module_owner===false) { - $module_owner=$this->myUrlDecode($this->Application->GetVar('confs_module')); - $this->Application->SetVar("module", $module_owner); - } - - $section=$this->Application->GetVar('section'); - if ($section===false){ - $section=$this->myUrlDecode($this->Application->GetVar('confs_section')); - $this->Application->SetVar("section", $section); - } - - $object->addFilter('module_filter', '%1$s.ModuleName = "'.$module_owner.'"'); - + $module_owner = $this->Application->GetLinkedVar('module'); + $this->Application->LinkVar('section'); + $object->addFilter('module_filter', '%1$s.ModuleName = '.$this->Conn->qstr($module_owner)); } + /** + * Enter description here... + * + * @param kEvent $event + */ function OnUpdate(&$event) { if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) { parent::OnUpdate($event); + + $conf_update = new kEvent('conf:OnUpdate'); + $conf_update->redirect = false; + $this->Application->HandleEvent($conf_update); } - $module_owner=$this->Application->GetVar('module'); - $module_section=$this->Application->GetVar('section'); - - $conf_update = new kEvent( ); - $conf_update->Init('conf'); - $conf_update->Name = 'OnUpdate'; - $conf_update->redirect = false; - $this->Application->HandleEvent($conf_update); - $event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'confs_section'=>$this->myUrlEncode($module_section),'conf_module'=>$this->myUrlEncode($module_owner),'conf_section'=>$this->myUrlEncode($module_section),'pass'=>'all,confs,conf'); //stay! - + $event->SetRedirectParam('opener', 's'); } function OnCancel(&$event) { parent::OnCancel($event); - $module_owner=$this->Application->GetVar('module'); - $module_section=$this->Application->GetVar('section'); - - $event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'confs_section'=>$this->myUrlEncode($module_section),'conf_module'=>$this->myUrlEncode($module_owner),'conf_section'=>$this->myUrlEncode($module_section),'pass'=>'all,confs,conf'); //stay! - - + $event->SetRedirectParam('opener', 's'); } - - 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; - } - /** * Enter description here... * Index: trunk/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r4029 -r4043 --- trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4029) +++ trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 4043) @@ -1471,6 +1471,27 @@ $object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params); return $object; } + + /** + * Group list records by header, saves internal order in group + * + * @param Array $records + * @param string $heading_field + */ + function groupRecords(&$records, $heading_field) + { + $sorted = Array(); + $i = 0; $record_count = count($records); + while ($i < $record_count) { + $sorted[ $records[$i][$heading_field] ][] = $records[$i]; + $i++; + } + + $records = Array(); + foreach ($sorted as $heading => $heading_records) { + $records = array_merge_recursive($records, $heading_records); + } + } } Index: trunk/kernel/units/configuration/configuration_event_handler.php =================================================================== diff -u -N -r1875 -r4043 --- trunk/kernel/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 1875) +++ trunk/kernel/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 4043) @@ -13,21 +13,11 @@ { $object =& $event->getObject(); - $module_owner=$this->Application->GetVar('module'); - if ($module_owner===false) { - $module_owner=$this->myUrlDecode($this->Application->GetVar('conf_module')); - $this->Application->SetVar("module", $module_owner); - } - - $section=$this->Application->GetVar('section'); - if ($section===false){ - $section=$this->myUrlDecode($this->Application->GetVar('conf_section')); - $this->Application->SetVar("section", $section); - } + $module_owner = $this->Application->GetLinkedVar('module'); + $section = $this->Application->GetLinkedVar('section'); - $object->addFilter('module_filter', '%1$s.ModuleOwner = "'.$module_owner.'"'); - $object->addFilter('section_filter', '%1$s.Section = "'.$section.'"'); - $object->AddOrderField('DisplayOrder', 'ASC'); + $object->addFilter('module_filter', '%1$s.ModuleOwner = '.$this->Conn->qstr($module_owner)); + $object->addFilter('section_filter', '%1$s.Section = '.$this->Conn->qstr($section)); } /** @@ -38,13 +28,12 @@ function OnBeforeItemUpdate(&$event) { $object =& $event->getObject(); - if($object->GetDBField('element_type') == 'password') - { - if (trim($object->GetDBField('VariableValue'))=='') { - $field_options=$object->GetFieldOptions('VariableValue'); - $field_options['skip_empty']=1; + if ($object->GetDBField('element_type') == 'password') { + if (trim($object->GetDBField('VariableValue')) == '') { + $field_options = $object->GetFieldOptions('VariableValue'); + $field_options['skip_empty'] = 1; $object->SetFieldOptions('VariableValue', $field_options); - }else{ + }else { $object->SetDBField('VariableValue', md5($object->GetDBField('VariableValue'))); } } @@ -54,7 +43,7 @@ //$this->country_state_pairs = Array('Comm_Country' => 'Comm_State', 'Comm_Shipping_Country' => 'Comm_Shipping_State'); $this->state_country_pairs = Array('Comm_State' => 'Comm_Country', 'Comm_Shipping_State' => 'Comm_Shipping_Country'); - if ( isset($this->state_country_pairs[$object->GetDBField('VariableName')]) ){ + if ( isset($this->state_country_pairs[$object->GetDBField('VariableName')]) ) { //$this->state_country_codes[$this->country_state_pairs[$object->GetDBField('VariableName')]]=$object->GetDBField('VariableValue'); $check_state = $object->GetDBField('VariableValue'); $check_country = $submitted_vars[$this->state_country_pairs[$object->GetDBField('VariableName')]]['VariableValue']; @@ -93,51 +82,39 @@ function OnAfterItemUpdate(&$event) { $object =& $event->getObject(); - if($object->GetDBField('element_type') == 'password') - { - if (trim($object->GetDBField('VariableValue'))=='') { - $field_options=$object->GetFieldOptions('VariableValue'); + if ($object->GetDBField('element_type') == 'password') { + if (trim($object->GetDBField('VariableValue')) == '') { + $field_options = $object->GetFieldOptions('VariableValue'); unset($field_options['skip_empty']); $object->SetFieldOptions('VariableValue', $field_options); } } } + /** + * Enter description here... + * + * @param kEvent $event + */ function OnUpdate(&$event) { if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) { parent::OnUpdate($event); } - $module_owner=$this->Application->GetVar('module'); - $section=$this->Application->GetVar('section'); - $event->redirect_params = Array('opener' => 's','conf_section'=>$this->myUrlEncode($section), 'conf_module'=>$this->myUrlEncode($module_owner),'pass'=>'all,conf'); //stay! - if ($this->Application->GetVar('errormsgs')){ + $event->SetRedirectParam('opener', 's'); + + if ($this->Application->GetVar('errormsgs')) { $event->redirect = false; } } function OnCancel(&$event) { parent::OnCancel($event); - $module_owner=$this->Application->GetVar('module'); - $section=$this->Application->GetVar('section'); - - $event->redirect_params = Array('opener' => 's','conf_section'=>$this->myUrlEncode($section), 'conf_module'=>$this->myUrlEncode($module_owner),'pass'=>'all,conf'); //stay! + $event->SetRedirectParam('opener', 's'); } - - 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; - } - /** * Enter description here... * @@ -161,8 +138,6 @@ $event->redirect = false; } - - } Index: trunk/core/units/configuration/configuration_event_handler.php =================================================================== diff -u -N -r1875 -r4043 --- trunk/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 1875) +++ trunk/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 4043) @@ -13,21 +13,11 @@ { $object =& $event->getObject(); - $module_owner=$this->Application->GetVar('module'); - if ($module_owner===false) { - $module_owner=$this->myUrlDecode($this->Application->GetVar('conf_module')); - $this->Application->SetVar("module", $module_owner); - } - - $section=$this->Application->GetVar('section'); - if ($section===false){ - $section=$this->myUrlDecode($this->Application->GetVar('conf_section')); - $this->Application->SetVar("section", $section); - } + $module_owner = $this->Application->GetLinkedVar('module'); + $section = $this->Application->GetLinkedVar('section'); - $object->addFilter('module_filter', '%1$s.ModuleOwner = "'.$module_owner.'"'); - $object->addFilter('section_filter', '%1$s.Section = "'.$section.'"'); - $object->AddOrderField('DisplayOrder', 'ASC'); + $object->addFilter('module_filter', '%1$s.ModuleOwner = '.$this->Conn->qstr($module_owner)); + $object->addFilter('section_filter', '%1$s.Section = '.$this->Conn->qstr($section)); } /** @@ -38,13 +28,12 @@ function OnBeforeItemUpdate(&$event) { $object =& $event->getObject(); - if($object->GetDBField('element_type') == 'password') - { - if (trim($object->GetDBField('VariableValue'))=='') { - $field_options=$object->GetFieldOptions('VariableValue'); - $field_options['skip_empty']=1; + if ($object->GetDBField('element_type') == 'password') { + if (trim($object->GetDBField('VariableValue')) == '') { + $field_options = $object->GetFieldOptions('VariableValue'); + $field_options['skip_empty'] = 1; $object->SetFieldOptions('VariableValue', $field_options); - }else{ + }else { $object->SetDBField('VariableValue', md5($object->GetDBField('VariableValue'))); } } @@ -54,7 +43,7 @@ //$this->country_state_pairs = Array('Comm_Country' => 'Comm_State', 'Comm_Shipping_Country' => 'Comm_Shipping_State'); $this->state_country_pairs = Array('Comm_State' => 'Comm_Country', 'Comm_Shipping_State' => 'Comm_Shipping_Country'); - if ( isset($this->state_country_pairs[$object->GetDBField('VariableName')]) ){ + if ( isset($this->state_country_pairs[$object->GetDBField('VariableName')]) ) { //$this->state_country_codes[$this->country_state_pairs[$object->GetDBField('VariableName')]]=$object->GetDBField('VariableValue'); $check_state = $object->GetDBField('VariableValue'); $check_country = $submitted_vars[$this->state_country_pairs[$object->GetDBField('VariableName')]]['VariableValue']; @@ -93,51 +82,39 @@ function OnAfterItemUpdate(&$event) { $object =& $event->getObject(); - if($object->GetDBField('element_type') == 'password') - { - if (trim($object->GetDBField('VariableValue'))=='') { - $field_options=$object->GetFieldOptions('VariableValue'); + if ($object->GetDBField('element_type') == 'password') { + if (trim($object->GetDBField('VariableValue')) == '') { + $field_options = $object->GetFieldOptions('VariableValue'); unset($field_options['skip_empty']); $object->SetFieldOptions('VariableValue', $field_options); } } } + /** + * Enter description here... + * + * @param kEvent $event + */ function OnUpdate(&$event) { if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) { parent::OnUpdate($event); } - $module_owner=$this->Application->GetVar('module'); - $section=$this->Application->GetVar('section'); - $event->redirect_params = Array('opener' => 's','conf_section'=>$this->myUrlEncode($section), 'conf_module'=>$this->myUrlEncode($module_owner),'pass'=>'all,conf'); //stay! - if ($this->Application->GetVar('errormsgs')){ + $event->SetRedirectParam('opener', 's'); + + if ($this->Application->GetVar('errormsgs')) { $event->redirect = false; } } function OnCancel(&$event) { parent::OnCancel($event); - $module_owner=$this->Application->GetVar('module'); - $section=$this->Application->GetVar('section'); - - $event->redirect_params = Array('opener' => 's','conf_section'=>$this->myUrlEncode($section), 'conf_module'=>$this->myUrlEncode($module_owner),'pass'=>'all,conf'); //stay! + $event->SetRedirectParam('opener', 's'); } - - 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; - } - /** * Enter description here... * @@ -161,8 +138,6 @@ $event->redirect = false; } - - } Index: trunk/kernel/units/config_search/config_search_tag_processor.php =================================================================== diff -u -N -r1566 -r4043 --- trunk/kernel/units/config_search/config_search_tag_processor.php (.../config_search_tag_processor.php) (revision 1566) +++ trunk/kernel/units/config_search/config_search_tag_processor.php (.../config_search_tag_processor.php) (revision 4043) @@ -2,48 +2,42 @@ class ConfigSearchTagProcessor extends kDBTagProcessor { + /** + * Prints list content using block specified + * + * @param Array $params + * @return string + * @access public + */ function PrintList($params) { - $list =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); + $list =& $this->GetList($params); $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); - $prefix_special = $this->getPrefixSpecial(); - if ( !($list->OriginalParams == $params) ) { - $this->Application->removeObject($prefix_special); - $list =& $this->Application->recallObject($prefix_special,$this->Prefix.'_List',$params); - } - $list->Query(); $o = ''; $list->GoFirst(); + + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $this->SelectParam($params, 'render_as,block'); + $block_params['pass_params'] = 'true'; - $block_params=$this->prepareTagParams($params); - $block_params['name']=$params['block']; - $block_params['pass_params']='true'; + $this->groupRecords($list->Records, 'ConfigHeader'); + $prev_heading = ''; - $prev_title=""; - - while (!$list->EOL()) + while (!$list->EOL()) { - $this_title=$list->Records[$list->CurrentIndex]['ConfigHeader']; - - if ($this_title!=$prev_title){ - $prev_title=$this_title; - $section_header_params=array(); - $section_header_params['name']='config_section_header'; - $section_header_params['title']=$this->Application->Phrase($this_title); - $o.= $this->Application->ParseBlock($section_header_params, 1); - } - $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET + $block_params['show_heading'] = ($prev_heading != $list->GetDBField('ConfigHeader') ) ? 1 : 0; + $o.= $this->Application->ParseBlock($block_params, 1); + $prev_heading = $list->GetDBField('ConfigHeader'); $list->GoNext(); } - + $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); - return $o; + return $o; } - } ?> \ No newline at end of file Index: trunk/admin/config/config_search.php =================================================================== diff -u -N -r2853 -r4043 --- trunk/admin/config/config_search.php (.../config_search.php) (revision 2853) +++ trunk/admin/config/config_search.php (.../config_search.php) (revision 4043) @@ -92,7 +92,13 @@ foreach($Items as $c) { print "\n"; - print "".prompt_language($c->Get("DisplayName"))."\n"; + print "".prompt_language($c->Get("DisplayName")); + + if (IsDebugMode()) { + echo '
['.$c->Get('SearchConfigId').'] '.$c->Get('FieldName').''; + } + + print "\n"; $checked = ""; if((int)$c->Get("SimpleSearch")==1) $checked = " CHECKED"; Index: trunk/core/units/config_search/config_search_tag_processor.php =================================================================== diff -u -N -r1566 -r4043 --- trunk/core/units/config_search/config_search_tag_processor.php (.../config_search_tag_processor.php) (revision 1566) +++ trunk/core/units/config_search/config_search_tag_processor.php (.../config_search_tag_processor.php) (revision 4043) @@ -2,48 +2,42 @@ class ConfigSearchTagProcessor extends kDBTagProcessor { + /** + * Prints list content using block specified + * + * @param Array $params + * @return string + * @access public + */ function PrintList($params) { - $list =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); + $list =& $this->GetList($params); $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); - $prefix_special = $this->getPrefixSpecial(); - if ( !($list->OriginalParams == $params) ) { - $this->Application->removeObject($prefix_special); - $list =& $this->Application->recallObject($prefix_special,$this->Prefix.'_List',$params); - } - $list->Query(); $o = ''; $list->GoFirst(); + + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $this->SelectParam($params, 'render_as,block'); + $block_params['pass_params'] = 'true'; - $block_params=$this->prepareTagParams($params); - $block_params['name']=$params['block']; - $block_params['pass_params']='true'; + $this->groupRecords($list->Records, 'ConfigHeader'); + $prev_heading = ''; - $prev_title=""; - - while (!$list->EOL()) + while (!$list->EOL()) { - $this_title=$list->Records[$list->CurrentIndex]['ConfigHeader']; - - if ($this_title!=$prev_title){ - $prev_title=$this_title; - $section_header_params=array(); - $section_header_params['name']='config_section_header'; - $section_header_params['title']=$this->Application->Phrase($this_title); - $o.= $this->Application->ParseBlock($section_header_params, 1); - } - $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET + $block_params['show_heading'] = ($prev_heading != $list->GetDBField('ConfigHeader') ) ? 1 : 0; + $o.= $this->Application->ParseBlock($block_params, 1); + $prev_heading = $list->GetDBField('ConfigHeader'); $list->GoNext(); } - + $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); - return $o; + return $o; } - } ?> \ No newline at end of file Index: trunk/kernel/units/configuration/configuration_tag_processor.php =================================================================== diff -u -N -r1566 -r4043 --- trunk/kernel/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 1566) +++ trunk/kernel/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4043) @@ -2,63 +2,58 @@ class ConfigurationTagProcessor extends kDBTagProcessor { + + /** + * Prints list content using block specified + * + * @param Array $params + * @return string + * @access public + */ function PrintList($params) { - $params['per_page'] = -1; - $list =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); + $list =& $this->GetList($params); $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); - - if ( !($list->OriginalParams == $params) ) { - $this->Application->removeObject($this->getPrefixSpecial()); - $list =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix.'_List',$params); - } - - - $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; +// $block_params['name'] = $this->SelectParam($params, 'render_as,block'); + $block_params['pass_params'] = 'true'; + $block_params['IdField'] = $list->IDField; - $next_block=$params['full_block']; + $prev_heading = ''; + $next_block = $params['full_block']; + $this->groupRecords($list->Records, 'heading'); - $prev_title=""; - - while (!$list->EOL()) + while (!$list->EOL()) { - $nextItemPrompt=$list->Records[$list->CurrentIndex+1]['prompt']; - $thisItemPrompt=$list->Records[$list->CurrentIndex]['prompt']; - - $this_title=$list->Records[$list->CurrentIndex]['heading']; - - if ($this_title!=$prev_title){ - $prev_title=$this_title; - $section_header_params=array(); - $section_header_params['name']='config_section_header'; - $section_header_params['title']=$this->Application->Phrase($this_title); - $o.= $this->Application->ParseBlock($section_header_params, 1); + $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET + + // using 2 blocks for drawing o row in case if current & next record titles match + $next_item_prompt = $list->Records[$list->CurrentIndex + 1]['prompt']; + $this_item_prompt = $list->GetDBField('prompt'); + + if ($next_item_prompt == $this_item_prompt) { + $curr_block = $params['half_block1']; + $next_block = $params['half_block2']; + } else { + $curr_block = $next_block; + $next_block = $params['full_block']; } - - if ($nextItemPrompt==$thisItemPrompt){ - $curr_block=$params['half_block1']; - $next_block=$params['half_block2']; - }else{ - $curr_block=$next_block; - $next_block=$params['full_block']; - } - $block_params['name']=$curr_block; + + $block_params['name'] = $curr_block; - $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); + $block_params['show_heading'] = ($prev_heading != $list->GetDBField('heading') ) ? 1 : 0; $o.= $this->Application->ParseBlock($block_params, 1); - + $prev_heading = $list->GetDBField('heading'); $list->GoNext(); } - return $o; + + $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); + return $o; } function PrintConfList($params){ @@ -70,57 +65,29 @@ $o = ''; $list->GoFirst(); - $tmp_row=array(); + $tmp_row = Array(); - while (!$list->EOL()) - { + while (!$list->EOL()) { $rec = $list->getCurrentRecord(); - $tmp_row[0][$rec['VariableName']]=$rec['VariableValue']; - $tmp_row[0]['prompt']=$rec['prompt']; + $tmp_row[0][$rec['VariableName']] = $rec['VariableValue']; + $tmp_row[0][$rec['VariableName'].'_prompt'] = $rec['prompt']; $list->GoNext(); } $list->Records = $tmp_row; - $block_params=$this->prepareTagParams($params); - $block_params['name']=$params['block']; + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $params['block']; $list->GoFirst(); return $this->Application->ParseBlock($block_params, 1); } - - function GetToEnv($params){ - - $vars = explode(',', $params['vars']); - - foreach ($vars as $key => $var){ - $val=$this->Application->GetVar($var); - if ($val) { - $this->Application->SetVar("conf_".$var, $this->myUrlEncode($val)); - } - - } - } - - 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; - } - - function ConfigValue($params){ - + function ConfigValue($params) + { return $this->Application->ConfigValue($params['name']); - } function Error($params) @@ -131,7 +98,7 @@ $errors = $this->Application->GetVar('errormsgs'); $errors = $errors[$this->getPrefixSpecial()]; - if (isset($errors[$field])){ + if (isset($errors[$field])) { $msg = $this->Application->Phrase($errors[$field]); } else { Index: trunk/core/units/configuration/configuration_tag_processor.php =================================================================== diff -u -N -r1566 -r4043 --- trunk/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 1566) +++ trunk/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 4043) @@ -2,63 +2,58 @@ class ConfigurationTagProcessor extends kDBTagProcessor { + + /** + * Prints list content using block specified + * + * @param Array $params + * @return string + * @access public + */ function PrintList($params) { - $params['per_page'] = -1; - $list =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); + $list =& $this->GetList($params); $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); - - if ( !($list->OriginalParams == $params) ) { - $this->Application->removeObject($this->getPrefixSpecial()); - $list =& $this->Application->recallObject($this->getPrefixSpecial(),$this->Prefix.'_List',$params); - } - - - $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; +// $block_params['name'] = $this->SelectParam($params, 'render_as,block'); + $block_params['pass_params'] = 'true'; + $block_params['IdField'] = $list->IDField; - $next_block=$params['full_block']; + $prev_heading = ''; + $next_block = $params['full_block']; + $this->groupRecords($list->Records, 'heading'); - $prev_title=""; - - while (!$list->EOL()) + while (!$list->EOL()) { - $nextItemPrompt=$list->Records[$list->CurrentIndex+1]['prompt']; - $thisItemPrompt=$list->Records[$list->CurrentIndex]['prompt']; - - $this_title=$list->Records[$list->CurrentIndex]['heading']; - - if ($this_title!=$prev_title){ - $prev_title=$this_title; - $section_header_params=array(); - $section_header_params['name']='config_section_header'; - $section_header_params['title']=$this->Application->Phrase($this_title); - $o.= $this->Application->ParseBlock($section_header_params, 1); + $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET + + // using 2 blocks for drawing o row in case if current & next record titles match + $next_item_prompt = $list->Records[$list->CurrentIndex + 1]['prompt']; + $this_item_prompt = $list->GetDBField('prompt'); + + if ($next_item_prompt == $this_item_prompt) { + $curr_block = $params['half_block1']; + $next_block = $params['half_block2']; + } else { + $curr_block = $next_block; + $next_block = $params['full_block']; } - - if ($nextItemPrompt==$thisItemPrompt){ - $curr_block=$params['half_block1']; - $next_block=$params['half_block2']; - }else{ - $curr_block=$next_block; - $next_block=$params['full_block']; - } - $block_params['name']=$curr_block; + + $block_params['name'] = $curr_block; - $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); + $block_params['show_heading'] = ($prev_heading != $list->GetDBField('heading') ) ? 1 : 0; $o.= $this->Application->ParseBlock($block_params, 1); - + $prev_heading = $list->GetDBField('heading'); $list->GoNext(); } - return $o; + + $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); + return $o; } function PrintConfList($params){ @@ -70,57 +65,29 @@ $o = ''; $list->GoFirst(); - $tmp_row=array(); + $tmp_row = Array(); - while (!$list->EOL()) - { + while (!$list->EOL()) { $rec = $list->getCurrentRecord(); - $tmp_row[0][$rec['VariableName']]=$rec['VariableValue']; - $tmp_row[0]['prompt']=$rec['prompt']; + $tmp_row[0][$rec['VariableName']] = $rec['VariableValue']; + $tmp_row[0][$rec['VariableName'].'_prompt'] = $rec['prompt']; $list->GoNext(); } $list->Records = $tmp_row; - $block_params=$this->prepareTagParams($params); - $block_params['name']=$params['block']; + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $params['block']; $list->GoFirst(); return $this->Application->ParseBlock($block_params, 1); } - - function GetToEnv($params){ - - $vars = explode(',', $params['vars']); - - foreach ($vars as $key => $var){ - $val=$this->Application->GetVar($var); - if ($val) { - $this->Application->SetVar("conf_".$var, $this->myUrlEncode($val)); - } - - } - } - - 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; - } - - function ConfigValue($params){ - + function ConfigValue($params) + { return $this->Application->ConfigValue($params['name']); - } function Error($params) @@ -131,7 +98,7 @@ $errors = $this->Application->GetVar('errormsgs'); $errors = $errors[$this->getPrefixSpecial()]; - if (isset($errors[$field])){ + if (isset($errors[$field])) { $msg = $this->Application->Phrase($errors[$field]); } else { Index: trunk/kernel/units/custom_fields/custom_fields_tag_processor.php =================================================================== diff -u -N -r4029 -r4043 --- trunk/kernel/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 4029) +++ trunk/kernel/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 4043) @@ -48,7 +48,7 @@ } if ($this->Special == 'general') { - $this->sortCustomFields($list->Records); + $this->groupRecords($list->Records, 'Heading'); } while (!$list->EOL()) @@ -68,23 +68,6 @@ $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); return $o; } - - - - function sortCustomFields(&$records) - { - $sorted = Array(); - $i = 0; $record_count = count($records); - while ($i < $record_count) { - $sorted[ $records[$i]['Heading'] ][] = $records[$i]; - $i++; - } - - $records = Array(); - foreach ($sorted as $heading => $heading_records) { - $records = array_merge_recursive($records, $heading_records); - } - } } ?> \ No newline at end of file Index: trunk/core/units/custom_fields/custom_fields_tag_processor.php =================================================================== diff -u -N -r4029 -r4043 --- trunk/core/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 4029) +++ trunk/core/units/custom_fields/custom_fields_tag_processor.php (.../custom_fields_tag_processor.php) (revision 4043) @@ -48,7 +48,7 @@ } if ($this->Special == 'general') { - $this->sortCustomFields($list->Records); + $this->groupRecords($list->Records, 'Heading'); } while (!$list->EOL()) @@ -68,23 +68,6 @@ $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); return $o; } - - - - function sortCustomFields(&$records) - { - $sorted = Array(); - $i = 0; $record_count = count($records); - while ($i < $record_count) { - $sorted[ $records[$i]['Heading'] ][] = $records[$i]; - $i++; - } - - $records = Array(); - foreach ($sorted as $heading => $heading_records) { - $records = array_merge_recursive($records, $heading_records); - } - } } ?> \ No newline at end of file Index: trunk/kernel/units/general/cat_dbitem_export.php =================================================================== diff -u -N -r3813 -r4043 --- trunk/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3813) +++ trunk/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 4043) @@ -22,20 +22,6 @@ var $exportOptions = Array(); /** - * If we have custom fields in export - * - * @var unknown_type - */ - var $hasCustomFields = false; - - /** - * Custom field values for last item beeing exported - * - * @var Array - */ - var $customValues = Array(); - - /** * Item beeing currenly exported * * @var kCatDBItem @@ -394,11 +380,8 @@ $this->writeRecord($data_array); } $this->exportOptions['total_records'] = $this->Conn->GetOne( $this->getExportSQL(true) ); - $this->exportOptions['has_custom_fields'] = $this->scanCustomFields(); } - $this->hasCustomFields = $this->exportOptions['has_custom_fields']; - // 2. export data $records = $this->Conn->Query( $this->getExportSQL() ); $records_exported = 0; @@ -407,11 +390,7 @@ $this->curItem->SetDBFieldsFromHash($record_info); $this->setCurrentID(); $this->curItem->raiseEvent('OnAfterItemLoad', $this->curItem->GetID() ); - if ($this->hasCustomFields) - { - $this->loadItemCustomFields(); - } - + $data_array = Array(); foreach ($this->exportFields as $export_field) { @@ -501,7 +480,6 @@ fseek($this->filePointer, $this->exportOptions['start_from']); while (($bytes_imported < IMPORT_CHUNK) && !feof($this->filePointer)) { - $this->customValues = Array(); $data = $this->readRecord(); if ($data) { if ($this->exportOptions['ReplaceDuplicates']) { @@ -541,8 +519,8 @@ } if (substr($field_name, 0, 7) == 'Custom_') { - $field_name = substr($field_name, 7); - $this->customValues[$field_name] = $value; + $field_name = 'cust_'.substr($field_name, 7); + $this->curItem->SetField($field_name, $value); } elseif ($field_name == 'CategoryPath') { $this->curItem->CategoryPath = $value ? explode($this->exportOptions['CategorySeparator'], $value) : Array(); @@ -706,12 +684,6 @@ $this->addToCache('new_ids', $where_clause, $this->curItem->GetID() ); } - // set custom fields - foreach ($this->customValues as $custom_field => $custom_value) { - if (($save_method == 'Create') && !$custom_value) continue; - $this->curItem->SetCustomField($custom_field, $custom_value); - } - // assign item to categories $this->curItem->assignToCategory($category_id, false); @@ -738,15 +710,6 @@ return $parent_path; } - function loadItemCustomFields() - { - $sql = 'SELECT meta_data.Value, cf.FieldName - FROM '.TABLE_PREFIX.'CustomMetaData meta_data - LEFT JOIN '.TABLE_PREFIX.'CustomField cf ON cf.CustomFieldId = meta_data.CustomFieldId - WHERE meta_data.ResourceId = '.$this->curItem->GetDBField('ResourceId'); - $this->customValues = $this->Conn->GetCol($sql, 'FieldName'); - } - function getFileExtension() { return $this->exportOptions['ExportFormat'] == 1 ? 'csv' : 'xml'; @@ -757,21 +720,6 @@ return $this->exportOptions[$option] == 1 ? "\r\n" : "\n"; } - function scanCustomFields() - { - $ret = false; - $export_fields = $this->exportOptions['ExportColumns']; - foreach ($export_fields as $field) - { - if (substr($field, 0, 10) == '__CUSTOM__') - { - $ret = true; - break; - } - } - return $ret; - } - /** * Returns field caption for any exported field * @@ -808,8 +756,8 @@ function getFieldValue($field) { if (substr($field, 0, 10) == '__CUSTOM__') { - $field = substr($field, 10, strlen($field) ); - $ret = isset($this->customValues[$field]) ? $this->customValues[$field] : ''; + $field = 'cust_'.substr($field, 10, strlen($field)); + $ret = $this->curItem->GetField($field); } elseif (substr($field, 0, 12) == '__CATEGORY__') { return $this->getCategoryPath(); Index: trunk/core/units/general/cat_dbitem_export.php =================================================================== diff -u -N -r3813 -r4043 --- trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3813) +++ trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 4043) @@ -22,20 +22,6 @@ var $exportOptions = Array(); /** - * If we have custom fields in export - * - * @var unknown_type - */ - var $hasCustomFields = false; - - /** - * Custom field values for last item beeing exported - * - * @var Array - */ - var $customValues = Array(); - - /** * Item beeing currenly exported * * @var kCatDBItem @@ -394,11 +380,8 @@ $this->writeRecord($data_array); } $this->exportOptions['total_records'] = $this->Conn->GetOne( $this->getExportSQL(true) ); - $this->exportOptions['has_custom_fields'] = $this->scanCustomFields(); } - $this->hasCustomFields = $this->exportOptions['has_custom_fields']; - // 2. export data $records = $this->Conn->Query( $this->getExportSQL() ); $records_exported = 0; @@ -407,11 +390,7 @@ $this->curItem->SetDBFieldsFromHash($record_info); $this->setCurrentID(); $this->curItem->raiseEvent('OnAfterItemLoad', $this->curItem->GetID() ); - if ($this->hasCustomFields) - { - $this->loadItemCustomFields(); - } - + $data_array = Array(); foreach ($this->exportFields as $export_field) { @@ -501,7 +480,6 @@ fseek($this->filePointer, $this->exportOptions['start_from']); while (($bytes_imported < IMPORT_CHUNK) && !feof($this->filePointer)) { - $this->customValues = Array(); $data = $this->readRecord(); if ($data) { if ($this->exportOptions['ReplaceDuplicates']) { @@ -541,8 +519,8 @@ } if (substr($field_name, 0, 7) == 'Custom_') { - $field_name = substr($field_name, 7); - $this->customValues[$field_name] = $value; + $field_name = 'cust_'.substr($field_name, 7); + $this->curItem->SetField($field_name, $value); } elseif ($field_name == 'CategoryPath') { $this->curItem->CategoryPath = $value ? explode($this->exportOptions['CategorySeparator'], $value) : Array(); @@ -706,12 +684,6 @@ $this->addToCache('new_ids', $where_clause, $this->curItem->GetID() ); } - // set custom fields - foreach ($this->customValues as $custom_field => $custom_value) { - if (($save_method == 'Create') && !$custom_value) continue; - $this->curItem->SetCustomField($custom_field, $custom_value); - } - // assign item to categories $this->curItem->assignToCategory($category_id, false); @@ -738,15 +710,6 @@ return $parent_path; } - function loadItemCustomFields() - { - $sql = 'SELECT meta_data.Value, cf.FieldName - FROM '.TABLE_PREFIX.'CustomMetaData meta_data - LEFT JOIN '.TABLE_PREFIX.'CustomField cf ON cf.CustomFieldId = meta_data.CustomFieldId - WHERE meta_data.ResourceId = '.$this->curItem->GetDBField('ResourceId'); - $this->customValues = $this->Conn->GetCol($sql, 'FieldName'); - } - function getFileExtension() { return $this->exportOptions['ExportFormat'] == 1 ? 'csv' : 'xml'; @@ -757,21 +720,6 @@ return $this->exportOptions[$option] == 1 ? "\r\n" : "\n"; } - function scanCustomFields() - { - $ret = false; - $export_fields = $this->exportOptions['ExportColumns']; - foreach ($export_fields as $field) - { - if (substr($field, 0, 10) == '__CUSTOM__') - { - $ret = true; - break; - } - } - return $ret; - } - /** * Returns field caption for any exported field * @@ -808,8 +756,8 @@ function getFieldValue($field) { if (substr($field, 0, 10) == '__CUSTOM__') { - $field = substr($field, 10, strlen($field) ); - $ret = isset($this->customValues[$field]) ? $this->customValues[$field] : ''; + $field = 'cust_'.substr($field, 10, strlen($field)); + $ret = $this->curItem->GetField($field); } elseif (substr($field, 0, 12) == '__CATEGORY__') { return $this->getCategoryPath(); Index: trunk/kernel/units/general/cat_event_handler.php =================================================================== diff -u -N -r4029 -r4043 --- trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4029) +++ trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4043) @@ -1496,10 +1496,9 @@ $available_columns = array_merge_recursive2($available_columns, $this->getCustomExportColumns($event)); // custom fields - $fields = array_keys($object->CustomFields); - foreach ($fields as $field_name) + foreach ($object->customFields as $custom_id => $custom_name) { - $available_columns['__CUSTOM__'.$field_name] = $field_name; + $available_columns['__CUSTOM__'.$custom_name] = $custom_name; } // columns already in use Index: trunk/core/kernel/application.php =================================================================== diff -u -N -r4000 -r4043 --- trunk/core/kernel/application.php (.../application.php) (revision 4000) +++ trunk/core/kernel/application.php (.../application.php) (revision 4043) @@ -699,7 +699,7 @@ * @param mixed $ses_var Session variable name * @param mixed $default Default variable value */ - function LinkVar($var, $ses_var=null, $default='') + function LinkVar($var, $ses_var = null, $default = '') { if (!isset($ses_var)) $ses_var = $var; if ($this->GetVar($var) !== false) @@ -725,9 +725,8 @@ * @param mixed $default Default variable value * @return mixed */ - function GetLinkedVar($var, $ses_var=null, $default='') + function GetLinkedVar($var, $ses_var = null, $default = '') { - if (!isset($ses_var)) $ses_var = $var; $this->LinkVar($var, $ses_var, $default); return $this->GetVar($var); } Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -N -r4029 -r4043 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4029) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 4043) @@ -1496,10 +1496,9 @@ $available_columns = array_merge_recursive2($available_columns, $this->getCustomExportColumns($event)); // custom fields - $fields = array_keys($object->CustomFields); - foreach ($fields as $field_name) + foreach ($object->customFields as $custom_id => $custom_name) { - $available_columns['__CUSTOM__'.$field_name] = $field_name; + $available_columns['__CUSTOM__'.$custom_name] = $custom_name; } // columns already in use Index: trunk/core/units/general/cat_dbitem.php =================================================================== diff -u -N -r3787 -r4043 --- trunk/core/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 3787) +++ trunk/core/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 4043) @@ -2,8 +2,6 @@ class kCatDBItem extends kDBItem { - var $CustomFields = Array(); - /** * Category path, needed for import * @@ -18,15 +16,6 @@ */ var $useFilenames = true; - function Init($prefix, $special, $event_params = null) - { - parent::Init($prefix, $special, $event_params); - - $item_type = $this->Application->getUnitOption($this->Prefix, 'ItemType'); - $sql = 'SELECT CustomFieldId, FieldName FROM '.TABLE_PREFIX.'CustomField WHERE Type = '.$item_type; - $this->CustomFields = $this->Conn->GetCol($sql, 'FieldName'); - } - function Create($force_id=false, $system_create=false) { if (!$this->Validate()) return false; @@ -199,23 +188,6 @@ } } - function SetCustomField($field, $value) - { - $cf_id = getArrayValue($this->CustomFields, $field); - if(!$cf_id) return false; - - $data_table = TABLE_PREFIX.'CustomMetaData'; - - $sql = 'SELECT CustomDataId FROM '.$data_table.' WHERE CustomFieldId = %s AND ResourceId = %s'; - $data_id = (int)$this->Conn->GetOne( sprintf($sql, $cf_id, $this->GetDBField('ResourceId') ) ); - - $lang_id = $this->Application->GetVar('lang.current_id'); - - $sql = 'REPLACE INTO '.$data_table.'(CustomDataId,ResourceId,CustomFieldId,Value,l'.$lang_id.'_Value) VALUES (%1$s,%2$s,%3$s,%4$s,%4$s)'; - - $this->Conn->Query( sprintf($sql, $data_id, $this->GetDBField('ResourceId'), $cf_id, $this->Conn->qstr($value) ) ); - } - /** * replace not allowed symbols with "_" chars + remove duplicate "_" chars in result * Index: trunk/kernel/units/general/cat_dbitem.php =================================================================== diff -u -N -r3787 -r4043 --- trunk/kernel/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 3787) +++ trunk/kernel/units/general/cat_dbitem.php (.../cat_dbitem.php) (revision 4043) @@ -2,8 +2,6 @@ class kCatDBItem extends kDBItem { - var $CustomFields = Array(); - /** * Category path, needed for import * @@ -18,15 +16,6 @@ */ var $useFilenames = true; - function Init($prefix, $special, $event_params = null) - { - parent::Init($prefix, $special, $event_params); - - $item_type = $this->Application->getUnitOption($this->Prefix, 'ItemType'); - $sql = 'SELECT CustomFieldId, FieldName FROM '.TABLE_PREFIX.'CustomField WHERE Type = '.$item_type; - $this->CustomFields = $this->Conn->GetCol($sql, 'FieldName'); - } - function Create($force_id=false, $system_create=false) { if (!$this->Validate()) return false; @@ -199,23 +188,6 @@ } } - function SetCustomField($field, $value) - { - $cf_id = getArrayValue($this->CustomFields, $field); - if(!$cf_id) return false; - - $data_table = TABLE_PREFIX.'CustomMetaData'; - - $sql = 'SELECT CustomDataId FROM '.$data_table.' WHERE CustomFieldId = %s AND ResourceId = %s'; - $data_id = (int)$this->Conn->GetOne( sprintf($sql, $cf_id, $this->GetDBField('ResourceId') ) ); - - $lang_id = $this->Application->GetVar('lang.current_id'); - - $sql = 'REPLACE INTO '.$data_table.'(CustomDataId,ResourceId,CustomFieldId,Value,l'.$lang_id.'_Value) VALUES (%1$s,%2$s,%3$s,%4$s,%4$s)'; - - $this->Conn->Query( sprintf($sql, $data_id, $this->GetDBField('ResourceId'), $cf_id, $this->Conn->qstr($value) ) ); - } - /** * replace not allowed symbols with "_" chars + remove duplicate "_" chars in result * Index: trunk/core/units/configuration/configuration_config.php =================================================================== diff -u -N -r1682 -r4043 --- trunk/core/units/configuration/configuration_config.php (.../configuration_config.php) (revision 1682) +++ trunk/core/units/configuration/configuration_config.php (.../configuration_config.php) (revision 4043) @@ -12,13 +12,13 @@ 1 => 'id', 2 => 'page', 3 => 'event', - 4 => 'module', - 5 => 'section', ), 'IDField' => 'VariableName', '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!"), @@ -29,7 +29,13 @@ 'ListSQLs' => Array(''=>'SELECT * FROM '.TABLE_PREFIX.'ConfigurationAdmin LEFT JOIN '.TABLE_PREFIX.'ConfigurationValues Using(VariableName) '), 'ItemSQLs' => Array(''=>'SELECT * FROM '.TABLE_PREFIX.'ConfigurationAdmin LEFT JOIN '.TABLE_PREFIX.'ConfigurationValues Using(VariableName) '), - + + 'ListSortings' => Array( + '' => Array( + 'Sorting' => Array('DisplayOrder' => 'asc'), + ) + ), + 'SubTables' => Array(), 'Fields' => Array( Index: trunk/core/units/config_search/config_search_config.php =================================================================== diff -u -N -r3999 -r4043 --- trunk/core/units/config_search/config_search_config.php (.../config_search_config.php) (revision 3999) +++ trunk/core/units/config_search/config_search_config.php (.../config_search_config.php) (revision 4043) @@ -37,14 +37,12 @@ 1 => 'id', 2 => 'page', 3 => 'event', - 4 => 'module', - 5 => 'section', ), 'IDField' => 'SearchConfigId', 'TitlePresets' => Array( - 'config_list_search' => Array('prefixes' => Array('confs_List'), 'format' => "!la_updating_config!"), + 'config_list_search' => Array('prefixes' => Array('confs_List'), 'tag_params' => Array('confs' => Array('per_page' => -1) ), 'format' => "!la_updating_config!"), ), 'TableName' => TABLE_PREFIX.'SearchConfig', Index: trunk/kernel/units/configuration/configuration_config.php =================================================================== diff -u -N -r1682 -r4043 --- trunk/kernel/units/configuration/configuration_config.php (.../configuration_config.php) (revision 1682) +++ trunk/kernel/units/configuration/configuration_config.php (.../configuration_config.php) (revision 4043) @@ -12,13 +12,13 @@ 1 => 'id', 2 => 'page', 3 => 'event', - 4 => 'module', - 5 => 'section', ), 'IDField' => 'VariableName', '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!"), @@ -29,7 +29,13 @@ 'ListSQLs' => Array(''=>'SELECT * FROM '.TABLE_PREFIX.'ConfigurationAdmin LEFT JOIN '.TABLE_PREFIX.'ConfigurationValues Using(VariableName) '), 'ItemSQLs' => Array(''=>'SELECT * FROM '.TABLE_PREFIX.'ConfigurationAdmin LEFT JOIN '.TABLE_PREFIX.'ConfigurationValues Using(VariableName) '), - + + 'ListSortings' => Array( + '' => Array( + 'Sorting' => Array('DisplayOrder' => 'asc'), + ) + ), + 'SubTables' => Array(), 'Fields' => Array( Index: trunk/kernel/units/config_search/config_search_config.php =================================================================== diff -u -N -r3999 -r4043 --- trunk/kernel/units/config_search/config_search_config.php (.../config_search_config.php) (revision 3999) +++ trunk/kernel/units/config_search/config_search_config.php (.../config_search_config.php) (revision 4043) @@ -37,14 +37,12 @@ 1 => 'id', 2 => 'page', 3 => 'event', - 4 => 'module', - 5 => 'section', ), 'IDField' => 'SearchConfigId', 'TitlePresets' => Array( - 'config_list_search' => Array('prefixes' => Array('confs_List'), 'format' => "!la_updating_config!"), + 'config_list_search' => Array('prefixes' => Array('confs_List'), 'tag_params' => Array('confs' => Array('per_page' => -1) ), 'format' => "!la_updating_config!"), ), 'TableName' => TABLE_PREFIX.'SearchConfig', Index: trunk/kernel/units/config_search/config_search_event_handler.php =================================================================== diff -u -N -r4000 -r4043 --- trunk/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 4000) +++ trunk/kernel/units/config_search/config_search_event_handler.php (.../config_search_event_handler.php) (revision 4043) @@ -13,63 +13,35 @@ { $object =& $event->getObject(); - $module_owner=$this->Application->GetVar('module'); - if ($module_owner===false) { - $module_owner=$this->myUrlDecode($this->Application->GetVar('confs_module')); - $this->Application->SetVar("module", $module_owner); - } - - $section=$this->Application->GetVar('section'); - if ($section===false){ - $section=$this->myUrlDecode($this->Application->GetVar('confs_section')); - $this->Application->SetVar("section", $section); - } - - $object->addFilter('module_filter', '%1$s.ModuleName = "'.$module_owner.'"'); - + $module_owner = $this->Application->GetLinkedVar('module'); + $this->Application->LinkVar('section'); + $object->addFilter('module_filter', '%1$s.ModuleName = '.$this->Conn->qstr($module_owner)); } + /** + * Enter description here... + * + * @param kEvent $event + */ function OnUpdate(&$event) { if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 0)) { parent::OnUpdate($event); + + $conf_update = new kEvent('conf:OnUpdate'); + $conf_update->redirect = false; + $this->Application->HandleEvent($conf_update); } - $module_owner=$this->Application->GetVar('module'); - $module_section=$this->Application->GetVar('section'); - - $conf_update = new kEvent( ); - $conf_update->Init('conf'); - $conf_update->Name = 'OnUpdate'; - $conf_update->redirect = false; - $this->Application->HandleEvent($conf_update); - $event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'confs_section'=>$this->myUrlEncode($module_section),'conf_module'=>$this->myUrlEncode($module_owner),'conf_section'=>$this->myUrlEncode($module_section),'pass'=>'all,confs,conf'); //stay! - + $event->SetRedirectParam('opener', 's'); } function OnCancel(&$event) { parent::OnCancel($event); - $module_owner=$this->Application->GetVar('module'); - $module_section=$this->Application->GetVar('section'); - - $event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'confs_section'=>$this->myUrlEncode($module_section),'conf_module'=>$this->myUrlEncode($module_owner),'conf_section'=>$this->myUrlEncode($module_section),'pass'=>'all,confs,conf'); //stay! - - + $event->SetRedirectParam('opener', 's'); } - - 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; - } - /** * Enter description here... * Index: trunk/kernel/admin_templates/incs/config_blocks.tpl =================================================================== diff -u -N --- trunk/kernel/admin_templates/incs/config_blocks.tpl (revision 0) +++ trunk/kernel/admin_templates/incs/config_blocks.tpl (revision 4043) @@ -0,0 +1,84 @@ + + " value="" /> + + + + " id="" value="" /> + " id="verify_" value="" /> +  "> + + + + + + + + + + + + " name="" value=""> + " type="checkbox" id="_cb_" name="_cb_" class="" onclick="update_checkbox(this, document.getElementById(''))"> + + + + + + + + name="" id="_" value="">  + + + + + + + + + + + + + + + " id="_"> + + + +
[] +
+ + + + + + +
+ + + + + + + + + + " id="_"> + + + +
[] +
+ + + +    +
+ + + + + +