Elgg  Version 1.11
longtext.php
Go to the documentation of this file.
1 <?php
14 $vars['class'] = (array) elgg_extract('class', $vars, []);
15 $vars['class'][] = 'elgg-input-longtext';
16 
17 $defaults = array(
18  'value' => '',
19  'rows' => '10',
20  'cols' => '50',
21  'id' => 'elgg-input-' . rand(), //@todo make this more robust
22 );
23 
24 $vars = array_merge($defaults, $vars);
25 
26 $value = htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8');
27 unset($vars['value']);
28 
29 echo elgg_view_menu('longtext', array(
30  'sort_by' => 'priority',
31  'class' => 'elgg-menu-hz',
32  'id' => $vars['id'],
33 ));
34 
35 echo elgg_format_element('textarea', $vars, $value);
$vars['class']
Definition: longtext.php:14
$value
Definition: longtext.php:26
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1246
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:215
elgg_view_menu($menu_name, array $vars=array())
Render a menu.
Definition: views.php:692
elgg echo
Translates a string.
Definition: languages.js:43
$defaults
Definition: longtext.php:17