13 #[\AllowDynamicProperties] 24 'contexts' => [
'all'],
27 'section' =>
'default',
39 'show_with_empty_children' =>
true,
60 'item_contents_view' => null,
98 $this->data[
'name'] =
$name;
131 if (!isset($options[
'name']) || !isset($options[
'text'])) {
132 throw new \Elgg\Exceptions\InvalidArgumentException(__METHOD__ .
': $options "name" and "text" are required.');
135 if (!isset($options[
'href'])) {
136 $options[
'href'] =
'';
139 $item = new \ElggMenuItem($options[
'name'], $options[
'text'], $options[
'href']);
140 unset($options[
'name']);
141 unset($options[
'text']);
142 unset($options[
'href']);
145 if (isset($options[
'context'])) {
146 $options[
'contexts'] = $options[
'context'];
147 unset($options[
'context']);
151 if (isset($options[
'contexts'])) {
152 $item->setContext($options[
'contexts']);
153 unset($options[
'contexts']);
156 if (isset($options[
'link_class'])) {
157 $item->setLinkClass($options[
'link_class']);
158 unset($options[
'link_class']);
161 if (isset($options[
'item_class'])) {
162 $item->setItemClass($options[
'item_class']);
163 unset($options[
'item_class']);
166 if (isset($options[
'data']) && is_array($options[
'data'])) {
167 $item->setData($options[
'data']);
168 unset($options[
'data']);
172 if (array_key_exists(
$key,
$item->data)) {
194 if (is_array(
$key)) {
195 $this->data = array_merge($this->data,
$key);
209 return $this->data[
$key] ?? null;
220 $this->data[
'name'] =
$name;
229 return $this->data[
'name'];
292 return $this->data[
'contexts'];
304 if (in_array(
'all', $this->data[
'contexts'])) {
309 return in_array(
$context, $this->data[
'contexts']);
312 foreach ($this->data[
'contexts'] as
$context) {
329 $this->data[
'selected'] =
$state;
338 if (isset($this->data[
'selected'])) {
339 return $this->data[
'selected'];
343 if (
$href ===
false) {
358 $this->title =
$text;
378 $this->confirm =
$text;
399 $this->data[
'linkClass'] = [
$class];
401 $this->data[
'linkClass'] =
$class;
411 return implode(
' ', $this->data[
'linkClass']);
433 $this->data[
'deps'] = (array) $modules;
442 $modules = (array) $this->data[
'deps'];
443 return array_filter($modules,
function($m) {
444 return is_string($m) && !empty($m);
457 $this->
setDeps($current + (array) $modules);
468 $this->data[
'child_menu'] =
$options;
477 return $this->data[
'child_menu'];
489 $this->data[
'itemClass'] = [
$class];
491 $this->data[
'itemClass'] =
$class;
502 $name = preg_replace(
'/[^a-z0-9\-]/i',
'-', strtolower($this->
getName()));
506 return "elgg-menu-item-$name $class";
508 return "elgg-menu-item-$name";
532 protected function addClass(array &$current, $additional) {
533 if (!is_array($additional)) {
534 $current[] = $additional;
536 $current = array_merge($current, $additional);
557 return (
int) $this->data[
'priority'];
577 return $this->data[
'section'];
588 $this->data[
'parent_name'] =
$name;
597 return $this->data[
'parent_name'];
610 $this->data[
'parent'] = $parent;
621 return $this->data[
'parent'];
634 $this->data[
'children'][] =
$item;
658 return $this->data[
'children'];
671 foreach ($this->data[
'children'] as
$key => $node) {
672 $node->data[
'original_order'] =
$key;
673 $node->sortChildren($sortFunction);
676 usort($this->data[
'children'], $sortFunction);
686 $values = get_object_vars($this);
687 unset($values[
'data']);
710 $this->data[
'item_contents_view'] = $view_name;
720 return $this->data[
'item_contents_view'];
730 return isset($this->data[
'item_contents_view']);
if(!$user||!$user->canDelete()) $name
elgg_in_context(string $context)
Check if this context exists anywhere in the stack.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Collection item interface.
if($who_can_change_language=== 'nobody') elseif($who_can_change_language=== 'admin_only'&&!elgg_is_admin_logged_in()) $options
elgg_get_current_url()
Returns the current page's complete URL.
elgg_http_url_is_identical(string $url1, string $url2, array $ignore_params=['offset', 'limit'])
Test if two URLs are functionally identical.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
elgg_normalize_url(string $url)