Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1081548
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
Mon, Aug 4, 5:38 PM
Size
8 KB
Mime Type
text/x-diff
Expires
Wed, Aug 6, 5:38 PM (4 h, 36 m)
Engine
blob
Format
Raw Data
Handle
702072
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_config.php (revision 1368)
@@ -0,0 +1,67 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'confs',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'ConfigSearchEventHandler','file'=>'config_search_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'ConfigSearchTagProcessor','file'=>'config_search_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'hooks' => Array(),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'module',
+ ),
+ 'IDField' => 'SearchConfigId',
+
+ 'TitlePresets' => Array(
+ 'config_list' => Array('prefixes' => Array('confs_List'), 'format' => "!la_updating_config!"),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'SearchConfig',
+
+ 'ListSQLs' => Array(''=>'SELECT * FROM '.TABLE_PREFIX.'SearchConfig'),
+
+ 'ItemSQLs' => Array(''=>'SELECT * FROM '.TABLE_PREFIX.'SearchConfig'),
+
+ 'SubTables' => Array(),
+
+ 'Fields' => Array(
+ 'TableName' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'FieldName' => Array('type' => 'string','not_null' => '1','default' => ''),
+ 'SimpleSearch' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'AdvancedSearch' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'Description' => Array('type' => 'string','default' => ''),
+ 'DisplayName' => Array('type' => 'string','default' => ''),
+ 'ModuleName' => Array('type' => 'string','default' => ''),
+ 'ConfigHeader' => Array('type' => 'string','default' => ''),
+ 'DisplayOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'SearchConfigId' => Array('type' => 'int','not_null' => '1','default' => ''),
+ 'Priority' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'FieldType' => Array('type' => 'string','not_null' => '1','default' => 'text'),
+ 'ForeignField' => Array('type' => 'string','default' => ''),
+ 'JoinClause' => Array('type' => 'string','default' => ''),
+ 'IsWhere' => Array('type' => 'string','default' => ''),
+ 'IsNotWhere' => Array('type' => 'string','default' => ''),
+ 'ContainsWhere' => Array('type' => 'string','default' => ''),
+ 'NotContainsWhere' => Array('type' => 'string','default' => ''),
+ 'CustomFieldId' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ ),
+
+ 'VirtualFields' => Array(),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'), // icons for each StatusField values, if no matches or no statusfield selected, then "default" icon is used
+ 'Fields' => Array(
+ 'TableName' => Array( 'title'=>'la_col_TableName', 'data_block' => 'grid_data_td'),
+ 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_data_td' ),
+ 'SimpleSearch' => Array( 'title'=>'la_col_SimpleSearch', 'data_block' => 'grid_data_td'),
+ ),
+ ),
+ ),
+ );
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_tag_processor.php (revision 1368)
@@ -0,0 +1,37 @@
+<?php
+
+class ConfigSearchTagProcessor extends kDBTagProcessor {
+
+ function PrintList($params)
+ {
+ $list =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$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']=$params['block'];
+ $block_params['pass_params']='true';
+
+ while (!$list->EOL())
+ {
+ $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET
+ $o.= $this->Application->ParseBlock($block_params, 1);
+ $list->GoNext();
+ }
+
+ $this->Application->SetVar( $this->getPrefixSpecial().'_id', '');
+ return $o;
+ }
+
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_event_handler.php (revision 1368)
@@ -0,0 +1,56 @@
+<?php
+
+ class ConfigSearchEventHandler extends InpDBEventHandler {
+
+ /**
+ * Apply any custom changes to list's sql query
+ *
+ * @param kEvent $event
+ * @access protected
+ * @see OnListBuild
+ */
+ function SetCustomQuery(&$event)
+ {
+ $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);
+ }
+
+ $object->addFilter('module_filter', '%1$s.ModuleName = "'.$module_owner.'"');
+ $object->AddOrderField('DisplayOrder', 'ASC');
+ }
+
+ function OnUpdate(&$event)
+ {
+ parent::OnUpdate($event);
+ $module_owner=$this->Application->GetVar('module');
+
+ $event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'pass'=>'all,conf'); //stay!
+ }
+
+ function OnCancel(&$event)
+ {
+ parent::OnCancel($event);
+ $module_owner=$this->Application->GetVar('module');
+
+ $event->redirect_params = Array('opener' => 's','confs_module'=>$this->myUrlEncode($module_owner),'pass'=>'all,conf'); //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
Property changes on: branches/unlabeled/unlabeled-1.1.2/core/units/config_search/config_search_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.1.2.1
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment