Ejemplo n.º 1
0
 public function onIndexSearch(&$field, &$post, &$item)
 {
     if (!in_array($field->field_type, self::$field_types)) {
         return;
     }
     if (!$field->issearch) {
         return;
     }
     FlexicontentFields::onIndexSearch($field, $post, $item, $required_properties = array('originalname'), $search_properties = array('title', 'desc'), $properties_spacer = ' ', $filter_func = null);
     return true;
 }
Ejemplo n.º 2
0
 function onIndexSearch(&$field, &$post, &$item)
 {
     if (!in_array($field->field_type, self::$field_types)) {
         return;
     }
     if (!$field->issearch) {
         return;
     }
     $field->isindexed = true;
     $field->extra_props = self::$extra_props;
     FlexicontentFields::onIndexSearch($field, $post, $item, $required_properties = array(), $search_properties = array('text'), $properties_spacer = ' ', $filter_func = null);
     return true;
 }
Ejemplo n.º 3
0
 function onIndexSearch(&$field, &$post, &$item)
 {
     if (!in_array($field->field_type, self::$field_types)) {
         return;
     }
     if (!$field->issearch) {
         return;
     }
     // a. Each of the values of $values array will be added to the basic search index (one record per item)
     // b. If $values is null then the column value from table 'flexicontent_fields_item_relations' for current field / item pair will be used
     // 'required_properties' is meant for multi-property fields, do not add to search index if any of these is empty
     // 'search_properties'   contains property fields that should be added as text
     // 'properties_spacer'  is the spacer for the 'search_properties' text
     // 'filter_func' is the filtering function to apply to the final text
     FlexicontentFields::onIndexSearch($field, $post, $item, $required_properties = array('title'), $search_properties = array('title', 'text'), $properties_spacer = ' ', $filter_func = 'strip_tags');
     return true;
 }
Ejemplo n.º 4
0
 function onIndexSearch(&$field, &$post, &$item)
 {
     if (!$field->iscore) {
         return;
     }
     if (!$field->issearch) {
         return;
     }
     $values = $this->_prepareForSearchIndexing($field, $post, $for_advsearch = 0);
     // if post is null, indexer is running
     $filter_func = $field->field_type == 'maintext' ? 'strip_tags' : null;
     // 'isindexed' is not applicable for basic index and CORE fields
     $field->isindexed = 0;
     //in_array($field->field_type, array('type','state','tags','categories','created','createdby','modified','modifiedby'));
     // if values is null means retrieve data from the DB
     FlexicontentFields::onIndexSearch($field, $values, $item, $required_properties = array(), $search_properties = array(), $properties_spacer = ' ', $filter_func);
     return true;
 }
Ejemplo n.º 5
0
	function onIndexSearch(&$field, &$post, &$item)
	{
		if ( !in_array($field->field_type, self::$field_types) ) return;
		if ( !$field->issearch ) return;
		
		FlexicontentFields::onIndexSearch($field, $post, $item, $required_properties=array('url'), $search_properties=array('title','author','description','audiotype'), $properties_spacer=' ', $filter_func=null);
		return true;
	}
Ejemplo n.º 6
0
 function onIndexSearch(&$field, &$post, &$item)
 {
     if (!in_array($field->field_type, self::$field_types)) {
         return;
     }
     if (!$field->issearch) {
         return;
     }
     if ($post) {
         $_files_data = $this->getFileData($post, $published = true, $extra_select = ', id AS value_id');
         $values = array();
         if ($_files_data) {
             foreach ($_files_data as $_file_id => $_file_data) {
                 $values[$_file_id] = (array) $_file_data;
             }
         }
     } else {
         $field->unserialize = 0;
         $field->field_rawvalues = 1;
         $field->field_valuesselect = ' file.id AS value_id, file.altname, file.description, file.filename';
         $field->field_valuesjoin = ' JOIN #__flexicontent_files AS file ON file.id = fi.value';
         $field->field_groupby = null;
     }
     FlexicontentFields::onIndexSearch($field, $post, $item, $required_properties = array('filename'), $search_properties = array('altname', 'description'), $properties_spacer = ' ', $filter_func = 'strip_tags');
     return true;
 }
Ejemplo n.º 7
0
 function onIndexSearch(&$field, &$post, &$item)
 {
     if (!$field->iscore) {
         return;
     }
     if (!$field->issearch) {
         return;
     }
     $values = $this->_prepareForSearchIndexing($field, $post, $for_advsearch = 0);
     $filter_func = $field->field_type == 'maintext' ? 'strip_tags' : null;
     FlexicontentFields::onIndexSearch($field, $values, $item, $required_properties = array(), $search_properties = array(), $properties_spacer = ' ', $filter_func);
     return true;
 }
Ejemplo n.º 8
0
 function onIndexSearch(&$field, &$post, &$item)
 {
     if (!in_array($field->field_type, self::$field_types)) {
         return;
     }
     if (!$field->issearch) {
         return;
     }
     if ($post === null) {
         $values = null;
         $field->field_valuesselect = ' CAST(fi.value AS UNSIGNED) AS value_id, ct.title AS value';
         $field->field_valuesjoin = ' JOIN #__content AS ct ON ct.id = CAST(fi.value AS UNSIGNED)';
         $field->field_groupby = ' GROUP BY CAST(fi.value AS UNSIGNED) ';
     } else {
         if (!empty($post)) {
             $_ids = array();
             foreach ($post as $_id) {
                 $_ids[] = (int) $_id;
             }
             // convert itemID:catID to itemID
             $db = JFactory::getDBO();
             $query = 'SELECT i.id AS value_id, i.title AS value FROM #__content AS i WHERE i.id IN (' . implode($_ids, ',') . ')';
             $db->setQuery($query);
             $_values = $db->loadAssocList();
             $values = array();
             foreach ($_values as $v) {
                 $values[$v['value_id']] = $v['value'];
             }
         }
     }
     //JFactory::getApplication()->enqueueMessage('BAS: '.print_r($values, true), 'notice');
     FlexicontentFields::onIndexSearch($field, $values, $item, $required_properties = array(), $search_properties = array(), $properties_spacer = ' ', $filter_func = null);
     return true;
 }
Ejemplo n.º 9
0
	function onIndexSearch(&$field, &$post, &$item)
	{
		if ( !in_array($field->field_type, self::$field_types) ) return;
		if ( !$field->issearch ) return;
		$pst = array();
                if(isset($post[0]['country'])){
                    foreach($post[0]['country'] as $country)
                        $pst[] = $country;
                    
                    //$post = $pst;
                }
                
		FlexicontentFields::onIndexSearch($field, $value, $item, $required_properties=array(), $search_properties=array(), $properties_spacer=' ', $filter_func='strip_tags');
		return true;
	}
Ejemplo n.º 10
0
	function onIndexSearch(&$field, &$post, &$item)
	{
		if ( !in_array($field->field_type, self::$field_types) ) return;
		if ( !$field->issearch ) return;
		
		FlexicontentFields::onIndexSearch($field, $post, $item, $required_properties=array(), $search_properties=array(), $properties_spacer=' ', $filter_func='strip_tags');
		return true;
	}
Ejemplo n.º 11
0
	function onIndexSearch(&$field, &$post, &$item)
	{
		if ( !in_array($field->field_type, self::$field_types) ) return;
		if ( !$field->issearch ) return;
		
		FlexicontentFields::onIndexSearch($field, $post, $item, $required_properties=array(), $search_properties=array('addr1','addr2','addr3','city','state','province','zip','country'), $properties_spacer=' ', $filter_func=null);
		return true;
	}
Ejemplo n.º 12
0
	function onIndexSearch(&$field, &$post, &$item)
	{
		if ($field->field_type != 'phonenumbers') return;
		if ( !$field->issearch ) return;
		
		FlexicontentFields::onIndexSearch($field, $post, $item, $required_properties=array(), $search_properties=array(), $properties_spacer=' ', $filter_func=null);
		return true;
	}