Elgg  Version 1.11
filter.php
Go to the documentation of this file.
1 <?php
8 // create selection array
9 $options = array();
10 $options['type=all'] = elgg_echo('river:select', array(elgg_echo('all')));
11 $registered_entities = elgg_get_config('registered_entities');
12 
13 if (!empty($registered_entities)) {
14  foreach ($registered_entities as $type => $subtypes) {
15  // subtype will always be an array.
16  if (!count($subtypes)) {
17  $label = elgg_echo('river:select', array(elgg_echo("item:$type")));
18  $options["type=$type"] = $label;
19  } else {
20  foreach ($subtypes as $subtype) {
21  $label = elgg_echo('river:select', array(elgg_echo("item:$type:$subtype")));
22  $options["type=$type&subtype=$subtype"] = $label;
23  }
24  }
25  }
26 }
27 
28 $params = array(
29  'id' => 'elgg-river-selector',
30  'options_values' => $options,
31 );
32 $selector = $vars['selector'];
33 if ($selector) {
34  $params['value'] = $selector;
35 }
36 echo elgg_view('input/select', $params);
37 
38 elgg_load_js('elgg.ui.river');
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
if(!empty($registered_entities)) $params
Definition: filter.php:28
$registered_entities
Definition: filter.php:11
$options
Content filter for river.
Definition: filter.php:9
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg echo
Translates a string.
Definition: languages.js:43
$type
Definition: add.php:8
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
$label
Elgg profile plugin edit default profile action.
Definition: add.php:7
elgg_load_js($name)
Load a JavaScript resource on this page.
Definition: elgglib.php:189
$subtypes
$selector
Definition: filter.php:32
$subtype
Definition: river.php:12
if(file_exists($welcome)) $vars
Definition: upgrade.php:93