Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sat, Sep 20, 6:10 PM

in-portal

Index: branches/unlabeled/unlabeled-1.10.2/kernel/units/custom_fields/custom_fields_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/kernel/units/custom_fields/custom_fields_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/kernel/units/custom_fields/custom_fields_config.php (revision 4381)
@@ -0,0 +1,119 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'cf',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'CustomFieldsEventHandler','file'=>'custom_fields_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'CustomFieldsTagProcessor','file'=>'custom_fields_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'hooks' => Array(),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'type',
+ 5 => 'mode',
+ ),
+
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'cf',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave'), // edit cloned fields to made alters :)
+ 'DoPrefix' => 'cf',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnSaveCustomField',
+ ),
+ ),
+
+ 'IDField' => 'CustomFieldId',
+
+ 'TitleField' => 'FieldName', // field, used in bluebar when editing existing item
+
+ 'TitlePhrase' => 'la_title_CustomFields',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('cf'=>'!la_title_addingCustom!'),
+ 'edit_status_labels' => Array('cf'=>'!la_title_Editing_CustomField!'),
+ 'new_titlefield' => Array('cf'=>'!la_title_NewCustomField!'),
+ ),
+
+ 'custom_fields_list'=>Array( 'prefixes' => Array('cf_List'),
+ 'format' => "!la_tab_ConfigCustom! (#cf_recordcount#)",
+ ),
+
+ 'custom_fields_edit'=>Array( 'prefixes' => Array('cf'),
+ 'new_titlefield' => Array('cf'=>'!la_title_NewCustomField!'),
+ 'format' => "#cf_status# '#cf_titlefield#'",
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'CustomField',
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('DisplayOrder' => 'asc'),
+ 'Sorting' => Array('FieldName' => 'asc'),
+ ),
+
+ 'general' => Array(
+ 'Sorting' => Array('DisplayOrder' => 'asc')
+ ),
+
+ ),
+
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'SubItems' => Array('confs-cf'),
+
+ 'Fields' => Array(
+ 'CustomFieldId' => Array('type' => 'int','not_null' => '1','default' => ''),
+ 'Type' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'FieldName' => Array('required'=>'1', 'type' => 'string','not_null' => 1,'default' => ''),
+ 'FieldLabel' => Array('type' => 'string', 'required' => 1, 'default' => ''),
+ 'Heading' => Array('type' => 'string', 'required' => 1, 'default' => ''),
+ 'Prompt' => Array('type' => 'string','default' => ''),
+ 'ElementType' => Array('required'=>'1', 'type'=>'string', 'not_null'=>1, 'default'=>'NULL', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array('' => 'la_EmptyValue', 'text' => 'la_type_text', 'select' => 'la_type_select', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_checkbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea', 'label' => 'la_type_label')),
+ 'ValueList' => Array('type' => 'string','default' => ''),
+ 'DisplayOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'OnGeneralTab' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'IsSystem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => '1', 'default' => '0'),
+ ),
+ 'VirtualFields' => Array(
+ 'Value' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'CustomFieldId' => Array( 'title'=>'la_prompt_FieldId', 'data_block' => 'grid_checkbox_td' ),
+ 'FieldName' => Array( 'title'=>'la_prompt_FieldName'),
+ 'FieldLabel' => Array( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'cf_grid_data_td' ),
+ 'DisplayOrder' => Array('title' => 'la_prompt_DisplayOrder'),
+ ),
+
+ ),
+ 'SeparateTab' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td'),
+ 'Prompt' => Array( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td' ),
+ 'Value' => Array( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td'),
+ ),
+ ),
+
+ ),
+ );
+
+ if (constOn('DEBUG_MODE')) {
+ $config['Grids']['Default']['Fields']['IsSystem'] = Array('title' => 'la_col_IsSystem');
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/kernel/units/custom_fields/custom_fields_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.10.2/kernel/units/categories/categories_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/kernel/units/categories/categories_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/kernel/units/categories/categories_event_handler.php (revision 4381)
@@ -0,0 +1,254 @@
+<?php
+
+class CategoriesEventHandler extends InpDBEventHandler {
+
+ /**
+ * Goes one level up from current category
+ *
+ * @param kEvent $event
+ */
+ function OnCategoryUp(&$event)
+ {
+ $category_table = $this->Application->getUnitOption($event->Prefix,'TableName');
+ $current_cat = $this->Application->GetVar('m_cat_id');
+
+ if($current_cat)
+ {
+ $sql = 'SELECT ParentId FROM '.$category_table.' WHERE CategoryId = '.$current_cat;
+ $cat_to_go = $this->Conn->GetOne($sql);
+ }
+ else
+ {
+ $cat_to_go = 0;
+ }
+
+ $event->redirect_params = Array('m_cat_id' => $cat_to_go);
+ }
+
+ /**
+ * Goes to home category
+ *
+ * @param kEvent $event
+ */
+ function OnGoHome(&$event)
+ {
+ $cat_to_go = 0;
+ $event->redirect_params = Array('m_cat_id' => $cat_to_go);
+ }
+
+ /**
+ * Apply system filter to categories list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $types=$event->getEventParam('types');
+ $except_types=$event->getEventParam('except');
+ $object =& $event->getObject();
+ $type_clauses = Array();
+
+ $object =& $event->getObject();
+
+ if ( $event->getEventParam('parent_cat_id') ) {
+ $parent_cat_id = $event->getEventParam('parent_cat_id');
+ }
+ else {
+ $parent_cat_id = $this->Application->GetVar('c_id');
+ if (!$parent_cat_id) {
+ $parent_cat_id = $this->Application->GetVar('m_cat_id');
+ }
+ if (!$parent_cat_id) {
+ $parent_cat_id = 0;
+ }
+ }
+
+ if ($parent_cat_id != 'any') {
+ if ($event->getEventParam('recursive')) {
+ $current_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$parent_cat_id);
+ $subcats = $this->Conn->GetCol('SELECT CategoryId FROM '.TABLE_PREFIX.'Category WHERE ParentPath LIKE "'.$current_path.'%" ');
+ $object->addFilter('parent_filter', 'ParentId IN ('.implode(', ', $subcats).')');
+ }
+ else {
+ $object->addFilter('parent_filter', 'ParentId = '.$parent_cat_id);
+ }
+ }
+
+ $object->addFilter('parent_filter', 'ParentId = '.$parent_cat_id);
+
+ $view_perm = 1;
+ $object->addFilter('perm_filter', 'PermId = '.$view_perm);
+ if ( !$this->Application->IsAdmin() )
+ {
+ $groups = explode(',',$this->Application->RecallVar('UserGroups'));
+ foreach ($groups as $group) {
+ $view_filters[] = 'FIND_IN_SET('.$group.', acl) || ((NOT FIND_IN_SET('.$group.',dacl)) AND acl=\'\')';
+ }
+ $view_filter = implode(' OR ', $view_filters);
+ $object->addFilter('perm_filter2', $view_filter);
+ $object->addFilter('status_filter', $object->TableName.'.Status = 1');
+ }
+
+ if(strpos($types, 'category_related') !== false)
+ {
+ $object->removeFilter('parent_filter');
+ $resource_id = $this->Conn->GetOne('
+ SELECT ResourceId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
+ WHERE CategoryId = '.$parent_cat_id
+ );
+
+ $sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
+ WHERE SourceId = '.$resource_id.' AND SourceType = 1';
+ $related_cats = $this->Conn->GetCol($sql);
+ $related_cats = is_array($related_cats) ? $related_cats : Array();
+ $sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
+ WHERE TargetId = '.$resource_id.' AND TargetType = 1 AND Type = 1';
+ $related_cats2 = $this->Conn->GetCol($sql);
+ $related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
+ $related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
+
+ if($related_cats)
+ {
+ $type_clauses['category_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
+ $type_clauses['category_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
+ }
+ else
+ {
+ $type_clauses['category_related']['include'] = '0';
+ $type_clauses['category_related']['except'] = '1';
+ }
+ $type_clauses['category_related']['having_filter'] = false;
+ }
+
+ if(strpos($types, 'product_related') !== false)
+ {
+ $object->removeFilter('parent_filter');
+
+ $product_id = $event->getEventParam('product_id') ? $event->getEventParam('product_id') : $this->Application->GetVar('p_id');
+ $resource_id = $this->Conn->GetOne('
+ SELECT ResourceId FROM '.$this->Application->getUnitOption('p', 'TableName').'
+ WHERE ProductId = '.$product_id
+ );
+
+ $sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
+ WHERE SourceId = '.$resource_id.' AND TargetType = 1';
+ $related_cats = $this->Conn->GetCol($sql);
+ $related_cats = is_array($related_cats) ? $related_cats : Array();
+ $sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
+ WHERE TargetId = '.$resource_id.' AND SourceType = 1 AND Type = 1';
+ $related_cats2 = $this->Conn->GetCol($sql);
+ $related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
+ $related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
+
+ if($related_cats)
+ {
+ $type_clauses['product_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
+ $type_clauses['product_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
+ }
+ else
+ {
+ $type_clauses['product_related']['include'] = '0';
+ $type_clauses['product_related']['except'] = '1';
+ }
+ $type_clauses['product_related']['having_filter'] = false;
+ }
+
+ /********************************************/
+
+ $includes_or_filter =& $this->Application->makeClass('kMultipleFilter');
+ $includes_or_filter->setType(FLT_TYPE_OR);
+
+ $excepts_and_filter =& $this->Application->makeClass('kMultipleFilter');
+ $excepts_and_filter->setType(FLT_TYPE_AND);
+
+ $includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter');
+ $includes_or_filter_h->setType(FLT_TYPE_OR);
+
+ $excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter');
+ $excepts_and_filter_h->setType(FLT_TYPE_AND);
+
+ $except_types_array=explode(',', $types);
+
+ if ($types){
+ $types_array=explode(',', $types);
+ for ($i=0; $i<sizeof($types_array); $i++){
+ $type=trim($types_array[$i]);
+ if (isset($type_clauses[$type])){
+ if ($type_clauses[$type]['having_filter']){
+ $includes_or_filter_h->removeFilter('filter_'.$type);
+ $includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
+ }else{
+ $includes_or_filter->removeFilter('filter_'.$type);
+ $includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
+ }
+ }
+ }
+ }
+
+ if ($except_types){
+ $except_types_array=explode(',', $except_types);
+ for ($i=0; $i<sizeof($except_types_array); $i++){
+ $type=trim($except_types_array[$i]);
+ if (isset($type_clauses[$type])){
+ if ($type_clauses[$type]['having_filter']){
+ $excepts_and_filter_h->removeFilter('filter_'.$type);
+ $excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
+ }else{
+ $excepts_and_filter->removeFilter('filter_'.$type);
+ $excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
+ }
+ }
+ }
+ }
+
+ $object->addFilter('includes_filter', $includes_or_filter);
+ $object->addFilter('excepts_filter', $excepts_and_filter);
+
+ $object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
+ $object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
+ }
+
+ function GetPassedId(&$event)
+ {
+ if ( $this->Application->IsAdmin() ) return parent::getPassedID($event);
+
+ $ret = $this->Application->GetVar('m_cat_id');
+ if($ret) return $ret;
+
+ return parent::getPassedID($event);
+ }
+
+ /**
+ * Rebuilds category cache
+ *
+ * @param kEvent $event
+ */
+ function OnRebuildCache(&$event)
+ {
+ $this->Application->StoreVar('PermCache_UpdateRequired', 1);
+ $event->SetRedirectParam('index_file', 'category/category_maint.php');
+ }
+
+ /**
+ * Adds calculates fields for item statuses
+ *
+ * @param kCatDBItem $object
+ * @param kEvent $event
+ */
+ function prepareObject(&$object, &$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+
+ $object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2,
+ IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
+ $this->Application->ConfigValue('Category_DaysNew').
+ '*3600*24), 1, 0),
+ %1$s.NewItem
+ )');
+
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/kernel/units/categories/categories_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.10.2/admin/logs/searchlog.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/admin/logs/searchlog.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/admin/logs/searchlog.php (revision 4381)
@@ -0,0 +1,167 @@
+<?php
+##############################################################
+##In-portal ##
+##############################################################
+## In-portal ##
+## Intechnic Corporation ##
+## All Rights Reserved, 1998-2002 ##
+## ##
+## No portion of this code may be copied, reproduced or ##
+## otherwise redistributed without proper written ##
+## consent of Intechnic Corporation. Violation will ##
+## result in revocation of the license and support ##
+## privileges along maximum prosecution allowed by law. ##
+##############################################################
+
+// new startup: begin
+define('REL_PATH', 'admin/logs');
+$relation_level = count( explode('/', REL_PATH) );
+define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+require_once FULL_PATH.'/kernel/startup.php';
+// new startup: end
+
+$pathtolocal = $pathtoroot."kernel/";
+
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+require_once($pathtoroot.$admin."/listview/listview.php");
+
+$pathtolocal = $pathtoroot;
+
+//Set Section
+$section = 'in-portal:searchlog';
+
+//Set Environment Variable
+$envar = "env=" . BuildEnv();
+
+//Display header
+
+$objListToolBar = new clsToolBar();
+
+$objListToolBar->Set("section",$section);
+$objListToolBar->Set("load_menu_func","");
+$objListToolBar->Set("CheckClass","ListChecks");
+$objListToolBar->Set("CheckForm","searchlistform");
+
+$listImages = array();
+ //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick
+
+$objListToolBar->Add("log_refresh", "la_ToolTip_Refresh","#","swap('log_refresh','toolbar/tool_refresh_f2.gif');",
+ "swap('log_refresh', 'toolbar/tool_refresh.gif');","window.location.href = window.location.href;",
+ "tool_refresh.gif", FALSE, TRUE);
+
+$objListToolBar->Add("log_reset","la_ToolTip_Delete","#", "if (ListChecks.itemChecked()) swap('log_reset','toolbar/tool_clear_selected_f2.gif');",
+ "if (ListChecks.itemChecked()) swap('log_reset', 'toolbar/tool_clear_selected.gif');","if (ListChecks.itemChecked()) ListChecks.check_submit('searchlog','m_keyword_reset');",
+ "tool_clear_selected.gif", TRUE, TRUE);
+
+$listImages[] = "ListChecks.addImage('log_reset','$imagesURL/toolbar/tool_clear_selected.gif','$imagesURL/toolbar/tool_clear_selected_f3.gif',1); ";
+
+$objListToolBar->Add("log_clear", "la_ToolTip_DeleteAll","#","swap('log_clear','toolbar/tool_reset_f2.gif');",
+ "swap('log_clear', 'toolbar/tool_reset.gif');","ListChecks.check_submit('searchlog','m_clear_searchlog');",
+ "tool_reset.gif", FALSE, TRUE);
+
+$objListToolBar->Add("divider");
+
+$objListToolBar->Add("user_print", "la_ToolTip_Print","#","swap('user_print','toolbar/tool_print_f2.gif');",
+ "swap('user_print', 'toolbar/tool_print.gif');","window.print();","tool_print.gif");
+
+/*$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ",
+ "swap('viewmenubutton', 'toolbar/tool_view.gif');",
+ "ShowViewMenu();","tool_view.gif");
+*/
+$objListToolBar->AddToInitScript($listImages);
+$objListToolBar->AddToInitScript("fwLoadMenus();");
+
+$objSearchList = new clsSearchLogList();
+
+$order = $objConfig->Get("SearchLog_SortOrder");
+$SearchWords = $objSession->GetVariable("KeywordSearchWord");
+if(strlen($SearchWords))
+{
+ $where = $objSearchList->AdminSearchWhereClause($SearchWords);
+}
+else
+ $where = "";
+
+$sql = "SELECT ELT(sl.SearchType+1,'".admin_language("la_Text_Simple")."','".admin_language("la_Text_Advanced")."') as TextType,sl.* FROM ".GetTablePrefix()."SearchLog as sl";
+
+if(strlen($where))
+ $sql .= " WHERE ".$where;
+
+$orderBy = trim($objConfig->Get("SearchLog_SortField")." ".$objConfig->Get("SearchLog_SortOrder"));
+if(strlen($orderBy))
+ $sql .=" ORDER BY ".$orderBy;
+
+$sql .=" ".GetLimitSQL($objSession->GetVariable("Page_SearchLog"),$objConfig->Get("Perpage_SearchLog"));
+
+if($objSession->HasSystemPermission("DEBUG.LIST"))
+ echo $sql."<br>\n";
+
+$objSearchList->Query_Item($sql);
+$itemcount = TableCount(GetTablePrefix()."SearchLog", $where,0);
+
+$objListView = new clsListView($objListToolBar,$objSearchList);
+$objListView->IdField = "SearchLogId";
+$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl";
+
+$objListView->ColumnHeaders->Add("TextType",admin_language("la_prompt_SearchType"),1,0,$order,"width=\"20%\"","SearchLog_SortField","SearchLog_SortOrder","TextType");
+$objListView->ColumnHeaders->Add("Keyword",admin_language("la_prompt_Keyword"),1,0,$order,"width=\"70%\"","SearchLog_SortField","SearchLog_SortOrder","Keyword");
+$objListView->ColumnHeaders->Add("Indices",admin_language("la_prompt_Frequency"),1,0,$order,"width=\"10%\"","SearchLog_SortField","SearchLog_SortOrder","Indices");
+$objListView->ColumnHeaders->SetSort($objConfig->Get("SearchLog_SortField"),$order);
+
+$objListView->PrintToolBar = FALSE;
+$objListView->SearchBar = TRUE;
+$objListView->SearchKeywords = $SearchWords;
+$objListView->SearchAction="m_searchword_search";
+$objListView->CurrentPageVar = "Page_SearchLog";
+$objListView->PerPageVar = "Perpage_SearchLog";
+$objListView->CheckboxName = "itemlist[]";
+$objListView->TotalItemCount = $itemcount;
+
+$objListView->ConfigureViewMenu("SearchLog_SortField","SearchLog_SortOrder","TextType","","",0);
+
+$filter = false;
+if ($SearchWords != '') {
+ $filter = true;
+}
+
+$title = admin_language("la_Show_Log")." (".$itemcount.")";
+$h = "\n\n<SCRIPT Language=\"JavaScript1.2\">\n".$objListView->GetViewMenu($imagesURL)."\n</SCRIPT>\n";
+int_header($objListToolBar,NULL,$title, NULL, $h);
+if ($filter) { ?>
+<table width="100%" border="0" cellspacing="0" cellpadding="0" class="toolbar">
+ <tr>
+ <td valign="top">
+ <?php int_hint_red(admin_language("la_Warning_Filter")); ?>
+ </td>
+ </tr>
+</table>
+<?php } ?>
+<FORM method="POST" ACTION="" NAME="searchlistform" ID="searchlistform">
+<?php
+ print $objListView->PrintList();
+?>
+<input type="hidden" name="Action" value="">
+</FORM>
+
+<!-- CODE FOR VIEW MENU -->
+<form ID="viewmenu" method="post" action="<?php echo $_SERVER["PHP_SELF"]."?env=".BuildEnv(); ?>" name="viewmenu">
+ <input type="hidden" name="fieldname" value="">
+ <input type="hidden" name="varvalue" value="">
+ <input type="hidden" name="varvalue2" value="">
+ <input type="hidden" name="Action" value="">
+</form>
+<FORM ID="ListSearchForm" NAME="ListSearchForm" method="POST" action="<?php echo $_SERVER["PHP_SELF"]."?env=".BuildEnv(); ?>">
+ <INPUT TYPE="HIDDEN" NAME="Action" VALUE="">
+ <INPUT TYPE="HIDDEN" NAME="list_search">
+</FORM>
+<script src="<?php echo $adminURL; ?>/listview/listview.js"></script>
+<script>
+initSelectiorContainers();
+<?php echo $objListToolBar->Get("CheckClass").".setImages();"; ?>
+</script>
+<!-- END CODE-->
+<?php int_footer(); ?>
+
Property changes on: branches/unlabeled/unlabeled-1.10.2/admin/logs/searchlog.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.10.2/core/kernel/utility/params.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/core/kernel/utility/params.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/core/kernel/utility/params.php (revision 4381)
@@ -0,0 +1,129 @@
+<?php
+
+class Params extends kBase {
+ var $_Params = Array();
+
+ function Params($params_str = null)
+ {
+ parent::kBase();
+ if($params_str != '') $this->SplitParamsStr($params_str);
+ }
+
+ /**
+ * Splits tag params into associative array
+ *
+ * @param string $params_str
+ * @access private
+ */
+ function SplitParamsStr($params_str)
+ {
+ preg_match_all('/([\${}a-zA-Z0-9_.-]+)=(["\']{1,1})(.*?)(?<!\\\)\\2/s', $params_str, $rets, PREG_SET_ORDER);
+
+ $values = Array();
+ foreach ($rets AS $key => $val){
+ $values[$val[1]] = str_replace('\\' . $val[2], $val[2], $val[3]);
+ }
+ $this->AddParams($values);
+ }
+
+ /**
+ * Sets new parameter value
+ *
+ * @param string $name
+ * @param string $val
+ * @access public
+ */
+ function Set($name, $val)
+ {
+ $this->_Params[$name] = $val;
+ }
+
+ /**
+ * Removes parameter
+ *
+ * @param string $name
+ * @access public
+ */
+ function Remove($name)
+ {
+ unset($this->_Params[$name]);
+ }
+
+ /**
+ * Gets parameter value by parameter name
+ *
+ * @param string $name Name of variable to retrieve
+ * @param int $default default value returned in case if varible not present
+ * @return string
+ * @access public
+ */
+ function Get($name, $default = false)
+ {
+ return isset($this->_Params[$name]) ? $this->_Params[$name] : $default;
+ }
+
+ /**
+ * Mass parameter setting from hash
+ *
+ * @param Array $params
+ * @access public
+ */
+ function AddParams($params)
+ {
+ if (!is_array($params)) return;
+ /*if (count($this->_Params) == 0) {
+ $this->_Params = $params;
+ }
+ else {*/
+ foreach ($params as $name => $val)
+// $this->Set(strtolower($name), $val);
+ $this->Set($name, $val);
+ //}
+ }
+
+ /**
+ * Return all paramters as hash
+ *
+ * @return Array
+ * @access public
+ */
+ function GetParams()
+ {
+ return $this->_Params;
+ }
+}
+
+class kArray extends kBase {
+ var $_Array;
+
+ /**
+ * Returns array value with any deep key
+ *
+ * @return mixed
+ * @todo array_unshift doesn't accept parameters by reference, fix it's usage in this method
+ */
+ function GetArrayValue()
+ {
+ $args = func_get_args();
+ array_unshift_ref($args, $this->_Array);
+ return call_user_func_array('getArrayValue', $args);
+ }
+
+ function SetArrayValue()
+ {
+ $args = func_get_args();
+ $value = array_pop($args);
+
+ $arr =& $this->_Array;
+ for ($i=0; $i<count($args); $i++) {
+ $key = $args[$i];
+ if ( !isset($arr[$key]) || !is_array($arr[$key]) ) {
+ $arr[$key] = Array();
+ }
+ $arr =& $arr[$key];
+ }
+ $arr = $value;
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/core/kernel/utility/params.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.10.2/core/units/custom_fields/custom_fields_config.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/core/units/custom_fields/custom_fields_config.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/core/units/custom_fields/custom_fields_config.php (revision 4381)
@@ -0,0 +1,119 @@
+<?php
+
+$config = Array(
+ 'Prefix' => 'cf',
+ 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
+ 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
+ 'EventHandlerClass' => Array('class'=>'CustomFieldsEventHandler','file'=>'custom_fields_event_handler.php','build_event'=>'OnBuild'),
+ 'TagProcessorClass' => Array('class'=>'CustomFieldsTagProcessor','file'=>'custom_fields_tag_processor.php','build_event'=>'OnBuild'),
+ 'AutoLoad' => true,
+ 'hooks' => Array(),
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'type',
+ 5 => 'mode',
+ ),
+
+ 'Hooks' => Array(
+ Array(
+ 'Mode' => hAFTER,
+ 'Conditional' => false,
+ 'HookToPrefix' => 'cf',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnSave'), // edit cloned fields to made alters :)
+ 'DoPrefix' => 'cf',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnSaveCustomField',
+ ),
+ ),
+
+ 'IDField' => 'CustomFieldId',
+
+ 'TitleField' => 'FieldName', // field, used in bluebar when editing existing item
+
+ 'TitlePhrase' => 'la_title_CustomFields',
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('cf'=>'!la_title_addingCustom!'),
+ 'edit_status_labels' => Array('cf'=>'!la_title_Editing_CustomField!'),
+ 'new_titlefield' => Array('cf'=>'!la_title_NewCustomField!'),
+ ),
+
+ 'custom_fields_list'=>Array( 'prefixes' => Array('cf_List'),
+ 'format' => "!la_tab_ConfigCustom! (#cf_recordcount#)",
+ ),
+
+ 'custom_fields_edit'=>Array( 'prefixes' => Array('cf'),
+ 'new_titlefield' => Array('cf'=>'!la_title_NewCustomField!'),
+ 'format' => "#cf_status# '#cf_titlefield#'",
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'CustomField',
+
+ 'ListSQLs' => Array( ''=>'SELECT * FROM %s',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('DisplayOrder' => 'asc'),
+ 'Sorting' => Array('FieldName' => 'asc'),
+ ),
+
+ 'general' => Array(
+ 'Sorting' => Array('DisplayOrder' => 'asc')
+ ),
+
+ ),
+
+ 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
+ ),
+ 'SubItems' => Array('confs-cf'),
+
+ 'Fields' => Array(
+ 'CustomFieldId' => Array('type' => 'int','not_null' => '1','default' => ''),
+ 'Type' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'FieldName' => Array('required'=>'1', 'type' => 'string','not_null' => 1,'default' => ''),
+ 'FieldLabel' => Array('type' => 'string', 'required' => 1, 'default' => ''),
+ 'Heading' => Array('type' => 'string', 'required' => 1, 'default' => ''),
+ 'Prompt' => Array('type' => 'string','default' => ''),
+ 'ElementType' => Array('required'=>'1', 'type'=>'string', 'not_null'=>1, 'default'=>'NULL', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array('' => 'la_EmptyValue', 'text' => 'la_type_text', 'select' => 'la_type_select', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_checkbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea', 'label' => 'la_type_label')),
+ 'ValueList' => Array('type' => 'string','default' => ''),
+ 'DisplayOrder' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'OnGeneralTab' => Array('type' => 'int','not_null' => '1','default' => '0'),
+ 'IsSystem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => '1', 'default' => '0'),
+ ),
+ 'VirtualFields' => Array(
+ 'Value' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'CustomFieldId' => Array( 'title'=>'la_prompt_FieldId', 'data_block' => 'grid_checkbox_td' ),
+ 'FieldName' => Array( 'title'=>'la_prompt_FieldName'),
+ 'FieldLabel' => Array( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'cf_grid_data_td' ),
+ 'DisplayOrder' => Array('title' => 'la_prompt_DisplayOrder'),
+ ),
+
+ ),
+ 'SeparateTab' => Array(
+ 'Icons' => Array('default'=>'icon16_custom.gif'),
+ 'Fields' => Array(
+ 'FieldName' => Array( 'title'=>'la_col_FieldName', 'data_block' => 'grid_icon_td'),
+ 'Prompt' => Array( 'title'=>'la_col_Prompt', 'data_block' => 'grid_data_label_ml_td' ),
+ 'Value' => Array( 'title'=>'la_col_Value', 'data_block' => 'edit_custom_td'),
+ ),
+ ),
+
+ ),
+ );
+
+ if (constOn('DEBUG_MODE')) {
+ $config['Grids']['Default']['Fields']['IsSystem'] = Array('title' => 'la_col_IsSystem');
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/core/units/custom_fields/custom_fields_config.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.10.2/core/units/categories/categories_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/core/units/categories/categories_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/core/units/categories/categories_event_handler.php (revision 4381)
@@ -0,0 +1,254 @@
+<?php
+
+class CategoriesEventHandler extends InpDBEventHandler {
+
+ /**
+ * Goes one level up from current category
+ *
+ * @param kEvent $event
+ */
+ function OnCategoryUp(&$event)
+ {
+ $category_table = $this->Application->getUnitOption($event->Prefix,'TableName');
+ $current_cat = $this->Application->GetVar('m_cat_id');
+
+ if($current_cat)
+ {
+ $sql = 'SELECT ParentId FROM '.$category_table.' WHERE CategoryId = '.$current_cat;
+ $cat_to_go = $this->Conn->GetOne($sql);
+ }
+ else
+ {
+ $cat_to_go = 0;
+ }
+
+ $event->redirect_params = Array('m_cat_id' => $cat_to_go);
+ }
+
+ /**
+ * Goes to home category
+ *
+ * @param kEvent $event
+ */
+ function OnGoHome(&$event)
+ {
+ $cat_to_go = 0;
+ $event->redirect_params = Array('m_cat_id' => $cat_to_go);
+ }
+
+ /**
+ * Apply system filter to categories list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ parent::SetCustomQuery($event);
+
+ $types=$event->getEventParam('types');
+ $except_types=$event->getEventParam('except');
+ $object =& $event->getObject();
+ $type_clauses = Array();
+
+ $object =& $event->getObject();
+
+ if ( $event->getEventParam('parent_cat_id') ) {
+ $parent_cat_id = $event->getEventParam('parent_cat_id');
+ }
+ else {
+ $parent_cat_id = $this->Application->GetVar('c_id');
+ if (!$parent_cat_id) {
+ $parent_cat_id = $this->Application->GetVar('m_cat_id');
+ }
+ if (!$parent_cat_id) {
+ $parent_cat_id = 0;
+ }
+ }
+
+ if ($parent_cat_id != 'any') {
+ if ($event->getEventParam('recursive')) {
+ $current_path = $this->Conn->GetOne('SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId='.$parent_cat_id);
+ $subcats = $this->Conn->GetCol('SELECT CategoryId FROM '.TABLE_PREFIX.'Category WHERE ParentPath LIKE "'.$current_path.'%" ');
+ $object->addFilter('parent_filter', 'ParentId IN ('.implode(', ', $subcats).')');
+ }
+ else {
+ $object->addFilter('parent_filter', 'ParentId = '.$parent_cat_id);
+ }
+ }
+
+ $object->addFilter('parent_filter', 'ParentId = '.$parent_cat_id);
+
+ $view_perm = 1;
+ $object->addFilter('perm_filter', 'PermId = '.$view_perm);
+ if ( !$this->Application->IsAdmin() )
+ {
+ $groups = explode(',',$this->Application->RecallVar('UserGroups'));
+ foreach ($groups as $group) {
+ $view_filters[] = 'FIND_IN_SET('.$group.', acl) || ((NOT FIND_IN_SET('.$group.',dacl)) AND acl=\'\')';
+ }
+ $view_filter = implode(' OR ', $view_filters);
+ $object->addFilter('perm_filter2', $view_filter);
+ $object->addFilter('status_filter', $object->TableName.'.Status = 1');
+ }
+
+ if(strpos($types, 'category_related') !== false)
+ {
+ $object->removeFilter('parent_filter');
+ $resource_id = $this->Conn->GetOne('
+ SELECT ResourceId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').'
+ WHERE CategoryId = '.$parent_cat_id
+ );
+
+ $sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
+ WHERE SourceId = '.$resource_id.' AND SourceType = 1';
+ $related_cats = $this->Conn->GetCol($sql);
+ $related_cats = is_array($related_cats) ? $related_cats : Array();
+ $sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
+ WHERE TargetId = '.$resource_id.' AND TargetType = 1 AND Type = 1';
+ $related_cats2 = $this->Conn->GetCol($sql);
+ $related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
+ $related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
+
+ if($related_cats)
+ {
+ $type_clauses['category_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
+ $type_clauses['category_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
+ }
+ else
+ {
+ $type_clauses['category_related']['include'] = '0';
+ $type_clauses['category_related']['except'] = '1';
+ }
+ $type_clauses['category_related']['having_filter'] = false;
+ }
+
+ if(strpos($types, 'product_related') !== false)
+ {
+ $object->removeFilter('parent_filter');
+
+ $product_id = $event->getEventParam('product_id') ? $event->getEventParam('product_id') : $this->Application->GetVar('p_id');
+ $resource_id = $this->Conn->GetOne('
+ SELECT ResourceId FROM '.$this->Application->getUnitOption('p', 'TableName').'
+ WHERE ProductId = '.$product_id
+ );
+
+ $sql = 'SELECT DISTINCT(TargetId) FROM '.TABLE_PREFIX.'Relationship
+ WHERE SourceId = '.$resource_id.' AND TargetType = 1';
+ $related_cats = $this->Conn->GetCol($sql);
+ $related_cats = is_array($related_cats) ? $related_cats : Array();
+ $sql = 'SELECT DISTINCT(SourceId) FROM '.TABLE_PREFIX.'Relationship
+ WHERE TargetId = '.$resource_id.' AND SourceType = 1 AND Type = 1';
+ $related_cats2 = $this->Conn->GetCol($sql);
+ $related_cats2 = is_array($related_cats2) ? $related_cats2 : Array();
+ $related_cats = array_unique( array_merge( $related_cats2, $related_cats ) );
+
+ if($related_cats)
+ {
+ $type_clauses['product_related']['include'] = '%1$s.ResourceId IN ('.implode(',', $related_cats).')';
+ $type_clauses['product_related']['except'] = '%1$s.ResourceId NOT IN ('.implode(',', $related_cats).')';
+ }
+ else
+ {
+ $type_clauses['product_related']['include'] = '0';
+ $type_clauses['product_related']['except'] = '1';
+ }
+ $type_clauses['product_related']['having_filter'] = false;
+ }
+
+ /********************************************/
+
+ $includes_or_filter =& $this->Application->makeClass('kMultipleFilter');
+ $includes_or_filter->setType(FLT_TYPE_OR);
+
+ $excepts_and_filter =& $this->Application->makeClass('kMultipleFilter');
+ $excepts_and_filter->setType(FLT_TYPE_AND);
+
+ $includes_or_filter_h =& $this->Application->makeClass('kMultipleFilter');
+ $includes_or_filter_h->setType(FLT_TYPE_OR);
+
+ $excepts_and_filter_h =& $this->Application->makeClass('kMultipleFilter');
+ $excepts_and_filter_h->setType(FLT_TYPE_AND);
+
+ $except_types_array=explode(',', $types);
+
+ if ($types){
+ $types_array=explode(',', $types);
+ for ($i=0; $i<sizeof($types_array); $i++){
+ $type=trim($types_array[$i]);
+ if (isset($type_clauses[$type])){
+ if ($type_clauses[$type]['having_filter']){
+ $includes_or_filter_h->removeFilter('filter_'.$type);
+ $includes_or_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['include']);
+ }else{
+ $includes_or_filter->removeFilter('filter_'.$type);
+ $includes_or_filter->addFilter('filter_'.$type, $type_clauses[$type]['include']);
+ }
+ }
+ }
+ }
+
+ if ($except_types){
+ $except_types_array=explode(',', $except_types);
+ for ($i=0; $i<sizeof($except_types_array); $i++){
+ $type=trim($except_types_array[$i]);
+ if (isset($type_clauses[$type])){
+ if ($type_clauses[$type]['having_filter']){
+ $excepts_and_filter_h->removeFilter('filter_'.$type);
+ $excepts_and_filter_h->addFilter('filter_'.$type, $type_clauses[$type]['except']);
+ }else{
+ $excepts_and_filter->removeFilter('filter_'.$type);
+ $excepts_and_filter->addFilter('filter_'.$type, $type_clauses[$type]['except']);
+ }
+ }
+ }
+ }
+
+ $object->addFilter('includes_filter', $includes_or_filter);
+ $object->addFilter('excepts_filter', $excepts_and_filter);
+
+ $object->addFilter('includes_filter_h', $includes_or_filter_h, HAVING_FILTER);
+ $object->addFilter('excepts_filter_h', $excepts_and_filter_h, HAVING_FILTER);
+ }
+
+ function GetPassedId(&$event)
+ {
+ if ( $this->Application->IsAdmin() ) return parent::getPassedID($event);
+
+ $ret = $this->Application->GetVar('m_cat_id');
+ if($ret) return $ret;
+
+ return parent::getPassedID($event);
+ }
+
+ /**
+ * Rebuilds category cache
+ *
+ * @param kEvent $event
+ */
+ function OnRebuildCache(&$event)
+ {
+ $this->Application->StoreVar('PermCache_UpdateRequired', 1);
+ $event->SetRedirectParam('index_file', 'category/category_maint.php');
+ }
+
+ /**
+ * Adds calculates fields for item statuses
+ *
+ * @param kCatDBItem $object
+ * @param kEvent $event
+ */
+ function prepareObject(&$object, &$event)
+ {
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+
+ $object->addCalculatedField('IsNew', ' IF(%1$s.NewItem = 2,
+ IF(%1$s.CreatedOn >= (UNIX_TIMESTAMP() - '.
+ $this->Application->ConfigValue('Category_DaysNew').
+ '*3600*24), 1, 0),
+ %1$s.NewItem
+ )');
+
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/core/units/categories/categories_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.10.2/core/units/config_search/config_search_event_handler.php
===================================================================
--- branches/unlabeled/unlabeled-1.10.2/core/units/config_search/config_search_event_handler.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.10.2/core/units/config_search/config_search_event_handler.php (revision 4381)
@@ -0,0 +1,89 @@
+<?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();
+
+ // show only items that belong to selected module
+ $module = $this->Application->GetVar('module');
+ $object->addFilter('module_filter', '%1$s.ModuleName = '.$this->Conn->qstr($module));
+
+ // don't show disabled search items
+ $object->addFilter('active_filter', '%1$s.SimpleSearch <> -1');
+ }
+
+ /**
+ * 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);
+ }
+
+ $event->SetRedirectParam('opener', 's');
+ }
+
+ function OnCancel(&$event)
+ {
+ parent::OnCancel($event);
+ $event->SetRedirectParam('opener', 's');
+ }
+
+ /**
+ * Enter description here...
+ *
+ * @param kEvent $event
+ */
+ function OnCreateCustomField(&$event)
+ {
+ $custom_field =& $event->MasterEvent->getObject();
+ if ($custom_field->GetDBField('Type') == 6) {
+ // user custom fields are not searchable
+ return false;
+ }
+
+ $sql = 'SELECT Module
+ FROM '.TABLE_PREFIX.'ItemTypes
+ WHERE ItemType = '.$custom_field->GetDBField('Type');
+ $module_name = $this->Conn->GetOne($sql);
+
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+
+ $custom_id = $custom_field->GetID();
+ if ($custom_id) {
+ $object->Load($custom_id, 'CustomFieldId');
+ $object->SetDBField('CustomFieldId', $custom_id); // for cloning only
+ }
+
+ $cf_search = Array();
+ $cf_search['DisplayOrder'] = $custom_field->GetDBField('DisplayOrder');
+ $cf_search['ElementType'] = $custom_field->GetDBField('ElementType');
+ $cf_search['DisplayName'] = $custom_field->GetDBField('FieldLabel');
+ $cf_search['FieldName'] = $custom_field->GetDBField('FieldName');
+ $cf_search['Description'] = $custom_field->GetDBField('Prompt');
+ $cf_search['ConfigHeader'] = $custom_field->GetDBField('Heading'); // 'la_Text_CustomFields';
+ $cf_search['TableName'] = 'CustomField';
+ $cf_search['ModuleName'] = $module_name;
+ $object->SetFieldsFromHash($cf_search);
+
+ $result = $object->isLoaded() ? $object->Update() : $object->Create();
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.10.2/core/units/config_search/config_search_event_handler.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.10
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline