CMS  Version 3.9
SearchableCheckListFieldRenderer Class Reference

Inherits CheckListFieldRenderer.

Public Member Functions

 SearchableCheckListFieldRenderer ($form, $field, $label)
 
 alias ()
 To modify the displayed label for a searchable class name, send parameter string in the format class_name, myLabel, class_name2, myLabel2... More...
 
 renderSearchField ($field)
 

Detailed Description

Definition at line 42 of file searchable_check_list_field_renderer.inc.

Member Function Documentation

◆ alias()

SearchableCheckListFieldRenderer::alias ( )

To modify the displayed label for a searchable class name, send parameter string in the format class_name, myLabel, class_name2, myLabel2...

e.g. "Article", "News" will change the option label form Articles to News

Definition at line 78 of file searchable_check_list_field_renderer.inc.

79  {
80  for($i = 0; $i < func_num_args(); $i += 2)
81  {
82  $class_name = func_get_arg($i);
83  $label = func_get_arg($i + 1);
84  if(array_key_exists($class_name, $this->options))
85  {
86  $this->options[$class_name] = $label;
87  }
88  }
89  }

◆ renderSearchField()

SearchableCheckListFieldRenderer::renderSearchField (   $field)

Definition at line 91 of file searchable_check_list_field_renderer.inc.

92  {
93  if (!$this->parent->params->get($field, ""))
94  {
95  $this->parent->params->set($field, "", implode(",", array_keys($this->options)));
96  }
97 
98  trace("Options: ".$this->parent->params->get($field), 3);
99 
100  return parent::renderSearchField($field);
101  }

◆ SearchableCheckListFieldRenderer()

SearchableCheckListFieldRenderer::SearchableCheckListFieldRenderer (   $form,
  $field,
  $label 
)

Definition at line 44 of file searchable_check_list_field_renderer.inc.

45  {
46 
47  $options = array();
49  if(count(SearchManager::$map)>0)
50  {
51  foreach(SearchManager::$map as $component => $searchables)
52  {
54 
55  if(count($searchables) > 0 )
56  {
57  foreach($searchables as $searchable)
58  {
59  $obj = new $searchable;
60  $name = $obj->prettifyClassName(true);
61 
62  $options[$searchable] = $name;
63  }
64  }
65  }
66  }
67 
68  $this->CheckListFieldRenderer($form, $field, $label, $options, false);
69  }
$form
$component
Definition: help.inc:38
$name
Definition: upload.inc:54
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
static buildSearchMap()

The documentation for this class was generated from the following file: