Elgg  Version 4.x
views.php
Go to the documentation of this file.
1 <?php
48 use Elgg\Menu\Menu;
50 
63 function elgg_set_viewtype($viewtype = '') {
64  return _elgg_services()->views->setViewtype($viewtype);
65 }
66 
76 function elgg_get_viewtype() {
77  return _elgg_services()->views->getViewtype();
78 }
79 
92  _elgg_services()->views->registerViewtypeFallback($viewtype);
93 }
94 
108 }
109 
119 }
120 
129 function elgg_register_external_view($view, $cacheable = false) {
130 
131  _elgg_services()->ajax->registerView($view);
132 
133  if ($cacheable) {
134  _elgg_services()->views->registerCacheableView($view);
135  }
136 }
137 
146  _elgg_services()->ajax->unregisterView($view);
147 }
148 
164  _elgg_services()->views->setViewDir($view, $location, $viewtype);
165 }
166 
178 function elgg_view_exists($view, $viewtype = '', $recurse = true) {
179  return _elgg_services()->views->viewExists($view, $viewtype, $recurse);
180 }
181 
205 function elgg_view($view, $vars = [], $viewtype = '') {
206  if (func_num_args() == 5) {
207  elgg_log(__FUNCTION__ . ' now has only 3 arguments. Update your usage.', 'ERROR');
208  $viewtype = func_get_arg(4);
209  }
210  return _elgg_services()->views->renderView($view, $vars, $viewtype);
211 }
212 
236 function elgg_extend_view($view, $view_extension, $priority = 501) {
237  _elgg_services()->views->extendView($view, $view_extension, $priority);
238 }
239 
249 function elgg_unextend_view($view, $view_extension) {
250  return _elgg_services()->views->unextendView($view, $view_extension);
251 }
252 
264  $list = _elgg_services()->views->getViewList($view);
265  unset($list[500]);
266  return $list;
267 }
268 
288 function elgg_view_page($title, $body, $page_shell = 'default', $vars = []) {
289 
290  if (elgg_is_xhr() && get_input('_elgg_ajax_list')) {
291  // requested by ajaxed pagination
292  return is_array($body) ? elgg_extract('content', $body) : $body;
293  }
294 
295  if (is_array($body)) {
296  $vars['entity'] = elgg_extract('entity', $body, elgg_extract('entity', $vars));
297 
298  $body['title'] = elgg_extract('title', $body, $title);
299  $body = elgg_view_layout('default', $body);
300  }
301 
302  $timer = _elgg_services()->timer;
303  if (!$timer->hasEnded(['build page'])) {
304  $timer->end(['build page']);
305  }
306  $timer->begin([__FUNCTION__]);
307 
308  $params = [];
309  $params['identifier'] = _elgg_services()->request->getFirstUrlSegment();
310  $params['segments'] = _elgg_services()->request->getUrlSegments();
311  array_shift($params['segments']);
312  $page_shell = elgg_trigger_plugin_hook('shell', 'page', $params, $page_shell);
313 
314 
315  $system_messages = _elgg_services()->system_messages;
316 
317  $messages = null;
318  if ($system_messages->count()) {
319  $messages = $system_messages->dumpRegister();
320 
321  if (isset($messages['error'])) {
322  // always make sure error is the first type
323  $errors = [
324  'error' => $messages['error']
325  ];
326 
327  unset($messages['error']);
328  $messages = array_merge($errors, $messages);
329  }
330  }
331 
332  $vars['title'] = $title;
333  $vars['body'] = $body;
334  $vars['sysmessages'] = $messages;
335  $vars['page_shell'] = $page_shell;
336 
337  $vars['head'] = elgg_trigger_plugin_hook('head', 'page', $vars, ['metas' => [], 'links' => []]);
338 
339  $vars = elgg_trigger_plugin_hook('output:before', 'page', null, $vars);
340 
341  $output = elgg_view("page/$page_shell", $vars);
342 
343 
344  // Allow plugins to modify the output
345  $output = elgg_trigger_plugin_hook('output', 'page', $vars, $output);
346 
347  $timer->end([__FUNCTION__]);
348  return $output;
349 }
350 
361 function elgg_view_resource($name, array $vars = []) {
362  $view = "resources/$name";
363 
364  if (elgg_view_exists($view)) {
365  return _elgg_services()->views->renderView($view, $vars);
366  }
367 
368  if (elgg_get_viewtype() !== 'default' && elgg_view_exists($view, 'default')) {
369  return _elgg_services()->views->renderView($view, $vars, 'default');
370  }
371 
372  _elgg_services()->logger->error("The view $view is missing.");
373 
374  // only works for default viewtype
375  throw new PageNotFoundException();
376 }
377 
406 function elgg_view_layout($layout_name, $vars = []) {
407  $timer = _elgg_services()->timer;
408  if (!$timer->hasEnded(['build page'])) {
409  $timer->end(['build page']);
410  }
411  $timer->begin([__FUNCTION__]);
412 
413  $vars['identifier'] = _elgg_services()->request->getFirstUrlSegment();
414  $vars['segments'] = _elgg_services()->request->getUrlSegments();
415  array_shift($vars['segments']);
416 
417  $layout_name = elgg_trigger_plugin_hook('layout', 'page', $vars, $layout_name);
418 
419  $vars['layout'] = $layout_name;
420 
421  $layout_views = [
422  "page/layouts/$layout_name",
423  "page/layouts/default",
424  ];
425 
426  $output = '';
427  foreach ($layout_views as $layout_view) {
428  if (elgg_view_exists($layout_view)) {
429  $output = elgg_view($layout_view, $vars);
430  break;
431  }
432  }
433 
434  $timer->end([__FUNCTION__]);
435  return $output;
436 }
437 
494 function elgg_view_menu($menu, array $vars = []) {
495 
496  $menu_view = elgg_extract('menu_view', $vars);
497  unset($vars['menu_view']);
498 
499  if (is_string($menu)) {
500  $menu = _elgg_services()->menus->getMenu($menu, $vars);
501  } elseif ($menu instanceof UnpreparedMenu) {
502  $menu = _elgg_services()->menus->prepareMenu($menu);
503  }
504 
505  if (!$menu instanceof Menu) {
506  throw new ElggInvalidArgumentException('$menu must be a menu name, a Menu, or UnpreparedMenu');
507  }
508 
509  $name = $menu->getName();
510  $params = $menu->getParams();
511 
512  $views = [
513  $menu_view,
514  "navigation/menu/$name",
515  'navigation/menu/default',
516  ];
517 
518  foreach ($views as $view) {
519  if (elgg_view_exists($view)) {
520  return elgg_view($view, $params);
521  }
522  }
523 }
524 
544 function elgg_view_entity(\ElggEntity $entity, array $vars = []) {
545 
546  $defaults = [
547  'full_view' => true,
548  ];
549 
550  $vars = array_merge($defaults, $vars);
551 
552  if (elgg_extract('register_rss_link', $vars, elgg_extract('full_view', $vars))) {
554  }
555 
556  $vars['entity'] = $entity;
557 
558  $entity_type = $entity->getType();
559  $entity_subtype = $entity->getSubtype();
560 
561  $entity_views = [
562  elgg_extract('item_view', $vars, ''),
563  "$entity_type/$entity_subtype",
564  "$entity_type/default",
565  ];
566 
567  $contents = '';
568  foreach ($entity_views as $view) {
569  if (elgg_view_exists($view)) {
570  $contents = elgg_view($view, $vars);
571  break;
572  }
573  }
574 
575  return $contents;
576 }
577 
593 function elgg_view_entity_icon(\ElggEntity $entity, $size = 'medium', $vars = []) {
594 
595  $vars['entity'] = $entity;
596  $vars['size'] = $size;
597 
598  $entity_type = $entity->getType();
599 
600  $subtype = $entity->getSubtype();
601 
602  $contents = '';
603  if (elgg_view_exists("icon/$entity_type/$subtype")) {
604  $contents = elgg_view("icon/$entity_type/$subtype", $vars);
605  }
606  if (empty($contents) && elgg_view_exists("icon/$entity_type/default")) {
607  $contents = elgg_view("icon/$entity_type/default", $vars);
608  }
609  if (empty($contents)) {
610  $contents = elgg_view("icon/default", $vars);
611  }
612 
613  return $contents;
614 }
615 
633  $defaults = [
634  'full_view' => true,
635  ];
636 
637  $vars = array_merge($defaults, $vars);
638  $vars['annotation'] = $annotation;
639 
640  $name = $annotation->name;
641  if (empty($name)) {
642  return false;
643  }
644 
645  $annotation_views = [
646  elgg_extract('item_view', $vars, ''),
647  "annotation/$name",
648  "annotation/default",
649  ];
650 
651  $contents = '';
652  foreach ($annotation_views as $view) {
653  if (elgg_view_exists($view)) {
654  $contents = elgg_view($view, $vars);
655  break;
656  }
657  }
658 
659  return $contents;
660 }
661 
687 function elgg_view_entity_list($entities, array $vars = []) {
688  $offset = (int) get_input('offset', 0);
689 
690  // list type can be passed as request parameter
691  $list_type = get_input('list_type', 'list');
692 
693  $defaults = [
694  'items' => $entities,
695  'list_class' => 'elgg-list-entity',
696  'full_view' => true,
697  'pagination' => true,
698  'list_type' => $list_type,
699  'offset' => $offset,
700  'limit' => null,
701  ];
702 
703  $vars = array_merge($defaults, $vars);
704 
705  if (!$vars["limit"] && !$vars["offset"]) {
706  // no need for pagination if listing is unlimited
707  $vars["pagination"] = false;
708  }
709 
710  $view = "page/components/{$vars['list_type']}";
711  if (!elgg_view_exists($view)) {
712  $view = 'page/components/list';
713  }
714 
715  return elgg_view($view, $vars);
716 }
717 
736 function elgg_view_annotation_list($annotations, array $vars = []) {
737  // list type can be passed as request parameter
738  $list_type = get_input('list_type', 'list');
739 
740  $defaults = [
741  'items' => $annotations,
742  'offset' => null,
743  'limit' => null,
744  'list_class' => 'elgg-list-annotation',
745  'full_view' => true,
746  'list_type' => $list_type,
747  'offset_key' => 'annoff',
748  ];
749 
750  $vars = array_merge($defaults, $vars);
751 
752  if (!$vars["limit"] && !$vars["offset"]) {
753  // no need for pagination if listing is unlimited
754  $vars["pagination"] = false;
755  }
756 
757  $view = "page/components/{$vars['list_type']}";
758  if (!elgg_view_exists($view)) {
759  $view = 'page/components/list';
760  }
761 
762  return elgg_view($view, $vars);
763 }
764 
783 function elgg_view_relationship_list($relationships, array $vars = []) {
784  // list type can be passed as request parameter
785  $list_type = get_input('list_type', 'list');
786 
787  $defaults = [
788  'items' => $relationships,
789  'offset' => null,
790  'limit' => null,
791  'list_class' => 'elgg-list-relationship',
792  'full_view' => false,
793  'list_type' => $list_type,
794  'offset_key' => 'reloff',
795  ];
796 
797  $vars = array_merge($defaults, $vars);
798 
799  if (!$vars['limit'] && !$vars['offset']) {
800  // no need for pagination if listing is unlimited
801  $vars['pagination'] = false;
802  }
803 
804  $view = "page/components/{$vars['list_type']}";
805  if (!elgg_view_exists($view)) {
806  $view = 'page/components/list';
807  }
808 
809  return elgg_view($view, $vars);
810 }
811 
829  $defaults = [
830  'full_view' => true,
831  ];
832 
833  $vars = array_merge($defaults, $vars);
834  $vars['relationship'] = $relationship;
835 
836  $name = $relationship->relationship;
837  if (empty($name)) {
838  return false;
839  }
840 
841  $relationship_views = [
842  elgg_extract('item_view', $vars, ''),
843  "relationship/$name",
844  "relationship/default",
845  ];
846 
847  $contents = '';
848  foreach ($relationship_views as $view) {
849  if (elgg_view_exists($view)) {
850  $contents = elgg_view($view, $vars);
851  break;
852  }
853  }
854 
855  return $contents;
856 }
857 
868 function elgg_view_title($title, array $vars = []) {
869  $vars['title'] = $title;
870 
871  return elgg_view('page/elements/title', $vars);
872 }
873 
886  $view = 'output/friendlytime';
887  $vars = [
888  'time' => $time,
889  'time_updated' => $time_updated,
890  ];
891  $viewtype = elgg_view_exists($view) ? '' : 'default';
892 
894 }
895 
909 function elgg_view_comments($entity, $add_comment = true, array $vars = []) {
910 
911  if (!$entity instanceof \ElggEntity) {
912  return false;
913  }
914 
915  if (!$entity->hasCapability('commentable')) {
916  return false;
917  }
918 
919  $vars['entity'] = $entity;
920  $vars['show_add_form'] = $add_comment;
921  $vars['class'] = elgg_extract('class', $vars, "{$entity->getSubtype()}-comments");
922 
923  $output = elgg_trigger_plugin_hook('comments', $entity->getType(), $vars, false);
924  if ($output !== false) {
925  return $output;
926  }
927 
928  return elgg_view('page/elements/comments', $vars);
929 }
930 
950  $vars['image'] = $image;
951  $vars['body'] = $body;
952  return elgg_view('page/components/image_block', $vars);
953 }
954 
970 function elgg_view_module($type, $title, $body, array $vars = []) {
971  $vars['type'] = $type;
972  $vars['title'] = $title;
973  $vars['body'] = $body;
974  return elgg_view('page/components/module', $vars);
975 }
976 
991 function elgg_view_message($type, $body, array $vars = []) {
992  $vars['type'] = $type;
993  $vars['body'] = $body;
994  return elgg_view('page/components/message', $vars);
995 }
996 
1006 function elgg_view_river_item($item, array $vars = []) {
1007 
1008  if (!($item instanceof \ElggRiverItem)) {
1009  return '';
1010  }
1011 
1012  // checking default viewtype since some viewtypes do not have unique views per item (rss)
1013  $view = $item->getView();
1014 
1015  $subject = $item->getSubjectEntity();
1016  $object = $item->getObjectEntity();
1017  if (!$subject || !$object) {
1018  // subject is disabled or subject/object deleted
1019  return '';
1020  }
1021 
1022  if (elgg_extract('register_rss_link', $vars)) {
1024  }
1025 
1026  $vars['item'] = $item;
1027 
1028  // create river view logic
1029  $type = $object->getType();
1030  $subtype = $object->getSubtype();
1031  $action = $item->action_type;
1032 
1033  $river_views = [
1034  elgg_extract('item_view', $vars, ''),
1035  'river/item', // important for other viewtypes, e.g. "rss"
1036  $view,
1037  "river/{$type}/{$subtype}/{$action}",
1038  "river/{$type}/{$subtype}/default",
1039  "river/{$type}/{$action}",
1040  "river/{$type}/default",
1041  'river/elements/layout',
1042  ];
1043 
1044  $contents = '';
1045  foreach ($river_views as $view) {
1046  if (elgg_view_exists($view)) {
1047  $contents = elgg_view($view, $vars);
1048  break;
1049  }
1050  }
1051 
1052  return $contents;
1053 }
1054 
1091  return _elgg_services()->forms->render($action, $form_vars, $body_vars);
1092 }
1093 
1104  return _elgg_services()->forms->setFooter($footer);
1105 }
1106 
1112  return _elgg_services()->forms->getFooter();
1113 }
1114 
1126 function _elgg_split_vars(array $vars = [], array $prefixes = null) {
1127 
1128  if (!isset($prefixes)) {
1129  $prefixes = ['#'];
1130  }
1131 
1132  $return = [];
1133  $default_section = ''; // something weird with PHP 8.1 compatibility
1134 
1135  foreach ($vars as $key => $value) {
1136  foreach ($prefixes as $prefix) {
1137  if (substr($key, 0, 1) === $prefix) {
1138  $key = substr($key, 1);
1139  $return[$prefix][$key] = $value;
1140  break;
1141  } else {
1142  $return[$default_section][$key] = $value;
1143  }
1144  }
1145  }
1146 
1147  return $return;
1148 }
1149 
1169 function elgg_view_field(array $params = []) {
1170 
1171  if (!empty($params['#html'])) {
1172  return $params['#html'];
1173  }
1174 
1175  if (empty($params['#type'])) {
1176  _elgg_services()->logger->error(__FUNCTION__ . '(): $params["#type"] is required.');
1177  return '';
1178  }
1179 
1180  $input_type = $params['#type'];
1181  if (!elgg_view_exists("input/$input_type")) {
1182  return '';
1183  }
1184 
1185  $hidden_types = ['hidden', 'securitytoken'];
1186  if (in_array($input_type, $hidden_types)) {
1188  return elgg_view("input/$input_type", $params['']);
1189  }
1190 
1191  $id = elgg_extract('id', $params);
1192  if (!$id) {
1193  $id = "elgg-field-" . base_convert(mt_rand(), 10, 36);
1194  $params['id'] = $id;
1195  }
1196 
1197  $make_special_checkbox_label = false;
1198  if ($input_type == 'checkbox' && (isset($params['label']) || isset($params['#label']))) {
1199  if (isset($params['#label']) && isset($params['label'])) {
1200  $params['label_tag'] = 'div';
1201  } else {
1202  $label = elgg_extract('label', $params);
1203  $label = elgg_extract('#label', $params, $label);
1204 
1205  $params['#label'] = $label;
1206  unset($params['label']);
1207 
1208  // Single checkbox input view gets special treatment
1209  // We don't want the field label to appear a checkbox without a label
1210  $make_special_checkbox_label = true;
1211  }
1212  }
1213 
1214  // Need to set defaults to prevent input keys with same name ending up in element vars if not provided
1215  $defaults = [
1216  '#class' => ELGG_ENTITIES_ANY_VALUE,
1217  '#help' => ELGG_ENTITIES_ANY_VALUE,
1218  '#label' => ELGG_ENTITIES_ANY_VALUE,
1219  '#view' => ELGG_ENTITIES_ANY_VALUE,
1220  ];
1221  $params = array_merge($defaults, $params);
1222 
1223  // first pass non-hash keys into both
1224  $split_params = _elgg_split_vars($params);
1225 
1226  // $vars passed to input/$input_name
1227  $input_vars = $split_params[''];
1228 
1229  // $vars passed to label, help and field wrapper views
1230  $element_vars = array_merge($split_params[''], $split_params['#']);
1231 
1232  // field input view needs this
1233  $input_vars['input_type'] = $input_type;
1234 
1235  // field views get more data
1236  $element_vars['input_type'] = $input_type;
1237 
1238  // wrap if present
1239  $element_vars['label'] = elgg_view('elements/forms/label', $element_vars);
1240  $element_vars['help'] = elgg_view('elements/forms/help', $element_vars);
1241 
1242  if ($make_special_checkbox_label) {
1243  $input_vars['label'] = $element_vars['label'];
1244  $input_vars['label_tag'] = 'div';
1245  unset($element_vars['label']);
1246  }
1247  $element_vars['input'] = elgg_view("elements/forms/input", $input_vars);
1248 
1249  return elgg_view('elements/forms/field', $element_vars);
1250 }
1251 
1264 function elgg_view_tagcloud(array $options = []) {
1265 
1266  $type = $subtype = '';
1267  if (isset($options['type'])) {
1268  $type = $options['type'];
1269  }
1270  if (isset($options['subtype'])) {
1271  $subtype = $options['subtype'];
1272  }
1273 
1274  $tag_data = elgg_get_tags($options);
1275  return elgg_view("output/tagcloud", [
1276  'value' => $tag_data,
1277  'type' => $type,
1278  'subtype' => $subtype,
1279  ]);
1280 }
1281 
1292 function elgg_view_list_item($item, array $vars = []) {
1293 
1294  if ($item instanceof \ElggEntity) {
1295  return elgg_view_entity($item, $vars);
1296  } else if ($item instanceof \ElggAnnotation) {
1297  return elgg_view_annotation($item, $vars);
1298  } else if ($item instanceof \ElggRiverItem) {
1299  return elgg_view_river_item($item, $vars);
1300  } else if ($item instanceof ElggRelationship) {
1302  }
1303 
1304  $view = elgg_extract('item_view', $vars);
1305  if ($view && elgg_view_exists($view)) {
1306  $vars['item'] = $item;
1307  return elgg_view($view, $vars);
1308  }
1309 
1310  return '';
1311 }
1312 
1323 function elgg_view_icon($name, $vars = []) {
1324  if (empty($vars)) {
1325  $vars = [];
1326  }
1327 
1328  if (is_string($vars)) {
1329  $vars = ['class' => $vars];
1330  }
1331 
1332  if (!is_array($vars)) {
1333  throw new ElggInvalidArgumentException('$vars needs to be a string or an array');
1334  }
1335 
1336  $vars['class'] = elgg_extract_class($vars, "elgg-icon-$name");
1337 
1338  return elgg_view('output/icon', $vars);
1339 }
1340 
1347  _elgg_services()->config->_elgg_autofeed = true;
1348 }
1349 
1356  _elgg_services()->config->_elgg_autofeed = false;
1357 }
1358 
1366  if (_elgg_services()->config->disable_rss) {
1367  return false;
1368  }
1369 
1370  return (bool) _elgg_services()->config->_elgg_autofeed;
1371 }
1372 
1381 function elgg_views_boot() {
1382  _elgg_services()->viewCacher->registerCoreViews();
1383 
1384  // jQuery and UI must come before require. See #9024
1385  elgg_register_external_file('js', 'jquery', elgg_get_simplecache_url('jquery.js'));
1386  elgg_load_external_file('js', 'jquery');
1387 
1388  elgg_extend_view('require.js', 'elgg/require_config.js', 100);
1389 
1390  elgg_register_external_file('js', 'require', elgg_get_simplecache_url('require.js'));
1391  elgg_load_external_file('js', 'require');
1392 
1393  elgg_register_external_file('js', 'elgg', elgg_get_simplecache_url('elgg.js'));
1394  elgg_load_external_file('js', 'elgg');
1395 
1396  elgg_register_external_file('css', 'font-awesome', elgg_get_simplecache_url('font-awesome/css/all.min.css'));
1397  elgg_load_external_file('css', 'font-awesome');
1398 
1399  elgg_define_js('cropperjs', [
1400  'src' => elgg_get_simplecache_url('cropperjs/cropper.min.js'),
1401  ]);
1402  elgg_define_js('jquery-cropper/jquery-cropper', [
1403  'src' => elgg_get_simplecache_url('jquery-cropper/jquery-cropper.min.js'),
1404  ]);
1405 
1406  elgg_require_css('elgg');
1407 
1408  elgg_extend_view('initialize_elgg.js', 'elgg/prevent_clicks.js', 1);
1409 
1410  elgg_extend_view('elgg.css', 'lightbox/elgg-colorbox-theme/colorbox.css');
1411  elgg_extend_view('elgg.css', 'entity/edit/icon/crop.css');
1412 
1413  elgg_define_js('jquery.ui.autocomplete.html', [
1414  'deps' => ['jquery-ui/widgets/autocomplete'],
1415  ]);
1416 
1417  elgg_register_simplecache_view('elgg/touch_punch.js');
1418  elgg_define_js('jquery-ui/widgets/sortable', [
1419  'deps' => ['elgg/touch_punch'],
1420  ]);
1421 
1422  elgg_register_ajax_view('languages.js');
1423 }
1424 
1434 
1435  $message_delay = (int) elgg_get_config('message_delay');
1436  if ($message_delay < 1) {
1437  $message_delay = 6;
1438  }
1439 
1440  return [
1441  'elgg.data' => (object) elgg_trigger_plugin_hook('elgg.data', 'site', null, []),
1442  'elgg.release' => elgg_get_release(),
1443  'elgg.config.wwwroot' => elgg_get_site_url(),
1444  'elgg.config.message_delay' => $message_delay * 1000,
1445 
1446  // refresh token 3 times during its lifetime (in microseconds 1000 * 1/3)
1447  'elgg.security.interval' => (int) _elgg_services()->csrf->getActionTokenTimeout() * 333,
1448  'elgg.config.language' => _elgg_services()->config->language ?: 'en',
1449  ];
1450 }
1451 
1459  $data = elgg_trigger_plugin_hook('elgg.data', 'page', null, []);
1460  if (!is_array($data)) {
1461  elgg_log('"elgg.data" plugin hook handlers must return an array. Returned ' . gettype($data) . '.', 'ERROR');
1462  $data = [];
1463  }
1464 
1465  $elgg = [
1466  'config' => [
1467  'lastcache' => (int) _elgg_services()->config->lastcache,
1468  'viewtype' => elgg_get_viewtype(),
1469  'simplecache_enabled' => (int) elgg_is_simplecache_enabled(),
1470  'current_language' => get_current_language(),
1471  ],
1472  'security' => [
1473  'token' => [
1474  '__elgg_ts' => $ts = _elgg_services()->csrf->getCurrentTime()->getTimestamp(),
1475  '__elgg_token' => _elgg_services()->csrf->generateActionToken($ts),
1476  ],
1477  ],
1478  'session' => [
1479  'user' => null,
1480  'token' => _elgg_services()->session->get('__elgg_session'),
1481  ],
1482  '_data' => (object) $data,
1483  ];
1484 
1486  if ($page_owner instanceof ElggEntity) {
1487  $elgg['page_owner'] = $page_owner->toObject(); // @todo remove in Elgg 5.0
1488  }
1489 
1491  if ($user instanceof ElggUser) {
1492  $user_object = $user->toObject();
1493  $user_object->admin = $user->isAdmin();
1494  $elgg['session']['user'] = $user_object; // @todo remove in Elgg 5.0
1495 
1496  $elgg['user'] = (array) $user_object;
1497  }
1498 
1499  return $elgg;
1500 }
1501 
1514  $current_view_type = null;
1515  if ($viewtype) {
1516  $current_view_type = elgg_get_viewtype();
1518  }
1519 
1520  $ret = elgg_view($view, $vars);
1521 
1522  if (isset($current_view_type)) {
1523  elgg_set_viewtype($current_view_type);
1524  }
1525 
1526  return $ret;
1527 }
1528 
1538  $common_icons = [
1539  'delete-alt' => 'times-circle',
1540  'delete' => 'times',
1541  'grid' => 'th',
1542  'info' => 'info-circle',
1543  'mail' => 'envelope-regular',
1544  'refresh' => 'redo',
1545  'remove' => 'times',
1546  'settings' => 'wrench',
1547  'settings-alt' => 'cog',
1548  'warning' => 'exclamation-triangle',
1549  ];
1550 
1551  $brands = [
1552  '500px',
1553  'accessible-icon',
1554  'accusoft',
1555  'acquisitions-incorporated',
1556  'adn',
1557  'adobe',
1558  'adversal',
1559  'affiliatetheme',
1560  'airbnb',
1561  'algolia',
1562  'alipay',
1563  'amazon-pay',
1564  'amazon',
1565  'amilia',
1566  'android',
1567  'angellist',
1568  'angrycreative',
1569  'angular',
1570  'app-store-ios',
1571  'app-store',
1572  'apper',
1573  'apple-pay',
1574  'apple',
1575  'artstation',
1576  'asymmetrik',
1577  'atlassian',
1578  'audible',
1579  'autoprefixer',
1580  'avianex',
1581  'aviato',
1582  'aws',
1583  'bandcamp',
1584  'battle-net',
1585  'behance-square',
1586  'behance',
1587  'bimobject',
1588  'bitbucket',
1589  'bitcoin',
1590  'bity',
1591  'black-tie',
1592  'blackberry',
1593  'blogger-b',
1594  'blogger',
1595  'bluetooth-b',
1596  'bluetooth',
1597  'bootstrap',
1598  'btc',
1599  'buffer',
1600  'buromobelexperte',
1601  'buy-n-large',
1602  'buysellads',
1603  'canadian-maple-leaf',
1604  'cc-amazon-pay',
1605  'cc-amex',
1606  'cc-apple-pay',
1607  'cc-diners-club',
1608  'cc-discover',
1609  'cc-jcb',
1610  'cc-mastercard',
1611  'cc-paypal',
1612  'cc-stripe',
1613  'cc-visa',
1614  'centercode',
1615  'centos',
1616  'chrome',
1617  'chromecast',
1618  'cloudscale',
1619  'cloudsmith',
1620  'cloudversify',
1621  'codepen',
1622  'codiepie',
1623  'confluence',
1624  'connectdevelop',
1625  'contao',
1626  'cotton-bureau',
1627  'cpanel',
1628  'creative-commons-by',
1629  'creative-commons-nc-eu',
1630  'creative-commons-nc-jp',
1631  'creative-commons-nc',
1632  'creative-commons-nd',
1633  'creative-commons-pd-alt',
1634  'creative-commons-pd',
1635  'creative-commons-remix',
1636  'creative-commons-sa',
1637  'creative-commons-sampling-plus',
1638  'creative-commons-sampling',
1639  'creative-commons-share',
1640  'creative-commons-zero',
1641  'creative-commons',
1642  'critical-role',
1643  'css3-alt',
1644  'css3',
1645  'cuttlefish',
1646  'd-and-d-beyond',
1647  'd-and-d',
1648  'dashcube',
1649  'delicious',
1650  'deploydog',
1651  'deskpro',
1652  'dev',
1653  'deviantart',
1654  'dhl',
1655  'diaspora',
1656  'digg',
1657  'digital-ocean',
1658  'discord',
1659  'discourse',
1660  'dochub',
1661  'docker',
1662  'draft2digital',
1663  'dribbble-square',
1664  'dribbble',
1665  'dropbox',
1666  'drupal',
1667  'dyalog',
1668  'earlybirds',
1669  'ebay',
1670  'edge',
1671  'elementor',
1672  'ello',
1673  'ember',
1674  'empire',
1675  'envira',
1676  'erlang',
1677  'ethereum',
1678  'etsy',
1679  'evernote',
1680  'expeditedssl',
1681  'facebook-f',
1682  'facebook-messenger',
1683  'facebook-square',
1684  'facebook',
1685  'fantasy-flight-games',
1686  'fedex',
1687  'fedora',
1688  'figma',
1689  'firefox-browser',
1690  'firefox',
1691  'first-order-alt',
1692  'first-order',
1693  'firstdraft',
1694  'flickr',
1695  'flipboard',
1696  'fly',
1697  'font-awesome-alt',
1698  'font-awesome-flag',
1699  'font-awesome-logo-full',
1700  'font-awesome',
1701  'fonticons-fi',
1702  'fonticons',
1703  'fort-awesome-alt',
1704  'fort-awesome',
1705  'forumbee',
1706  'foursquare',
1707  'free-code-camp',
1708  'freebsd',
1709  'fulcrum',
1710  'galactic-republic',
1711  'galactic-senate',
1712  'get-pocket',
1713  'gg-circle',
1714  'gg',
1715  'git-alt',
1716  'git-square',
1717  'git',
1718  'github-alt',
1719  'github-square',
1720  'github',
1721  'gitkraken',
1722  'gitlab',
1723  'gitter',
1724  'glide-g',
1725  'glide',
1726  'gofore',
1727  'goodreads-g',
1728  'goodreads',
1729  'google-drive',
1730  'google-play',
1731  'google-plus-g',
1732  'google-plus-square',
1733  'google-plus',
1734  'google-wallet',
1735  'google',
1736  'gratipay',
1737  'grav',
1738  'gripfire',
1739  'grunt',
1740  'gulp',
1741  'hacker-news-square',
1742  'hacker-news',
1743  'hackerrank',
1744  'hips',
1745  'hire-a-helper',
1746  'hooli',
1747  'hornbill',
1748  'hotjar',
1749  'houzz',
1750  'html5',
1751  'hubspot',
1752  'ideal',
1753  'imdb',
1754  'instagram',
1755  'intercom',
1756  'internet-explorer',
1757  'invision',
1758  'ioxhost',
1759  'itch-io',
1760  'itunes-note',
1761  'itunes',
1762  'java',
1763  'jedi-order',
1764  'jenkins',
1765  'jira',
1766  'joget',
1767  'joomla',
1768  'js-square',
1769  'js',
1770  'jsfiddle',
1771  'kaggle',
1772  'keybase',
1773  'keycdn',
1774  'kickstarter-k',
1775  'kickstarter',
1776  'korvue',
1777  'laravel',
1778  'lastfm-square',
1779  'lastfm',
1780  'leanpub',
1781  'less',
1782  'line',
1783  'linkedin-in',
1784  'linkedin',
1785  'linode',
1786  'linux',
1787  'lyft',
1788  'magento',
1789  'mailchimp',
1790  'mandalorian',
1791  'markdown',
1792  'mastodon',
1793  'maxcdn',
1794  'mdb',
1795  'medapps',
1796  'medium-m',
1797  'medium',
1798  'medrt',
1799  'meetup',
1800  'megaport',
1801  'mendeley',
1802  'microblog',
1803  'microsoft',
1804  'mix',
1805  'mixcloud',
1806  'mizuni',
1807  'modx',
1808  'monero',
1809  'napster',
1810  'neos',
1811  'nimblr',
1812  'node-js',
1813  'node',
1814  'npm',
1815  'ns8',
1816  'nutritionix',
1817  'odnoklassniki-square',
1818  'odnoklassniki',
1819  'old-republic',
1820  'opencart',
1821  'openid',
1822  'opera',
1823  'optin-monster',
1824  'orcid',
1825  'osi',
1826  'page4',
1827  'pagelines',
1828  'palfed',
1829  'patreon',
1830  'paypal',
1831  'penny-arcade',
1832  'periscope',
1833  'phabricator',
1834  'phoenix-framework',
1835  'phoenix-squadron',
1836  'php',
1837  'pied-piper-alt',
1838  'pied-piper-hat',
1839  'pied-piper-pp',
1840  'pied-piper-square',
1841  'pied-piper',
1842  'pinterest-p',
1843  'pinterest-square',
1844  'pinterest',
1845  'playstation',
1846  'product-hunt',
1847  'pushed',
1848  'python',
1849  'qq',
1850  'quinscape',
1851  'quora',
1852  'r-project',
1853  'raspberry-pi',
1854  'ravelry',
1855  'react',
1856  'reacteurope',
1857  'readme',
1858  'rebel',
1859  'red-river',
1860  'reddit-alien',
1861  'reddit-square',
1862  'reddit',
1863  'redhat',
1864  'renren',
1865  'replyd',
1866  'researchgate',
1867  'resolving',
1868  'rev',
1869  'rocketchat',
1870  'rockrms',
1871  'safari',
1872  'salesforce',
1873  'sass',
1874  'schlix',
1875  'scribd',
1876  'searchengin',
1877  'sellcast',
1878  'sellsy',
1879  'servicestack',
1880  'shirtsinbulk',
1881  'shopware',
1882  'simplybuilt',
1883  'sistrix',
1884  'sith',
1885  'sketch',
1886  'skyatlas',
1887  'skype',
1888  'slack-hash',
1889  'slack',
1890  'slideshare',
1891  'snapchat-ghost',
1892  'snapchat-square',
1893  'snapchat',
1894  'soundcloud',
1895  'sourcetree',
1896  'speakap',
1897  'speaker-deck',
1898  'spotify',
1899  'squarespace',
1900  'stack-exchange',
1901  'stack-overflow',
1902  'stackpath',
1903  'staylinked',
1904  'steam-square',
1905  'steam-symbol',
1906  'steam',
1907  'sticker-mule',
1908  'strava',
1909  'stripe-s',
1910  'stripe',
1911  'studiovinari',
1912  'stumbleupon-circle',
1913  'stumbleupon',
1914  'superpowers',
1915  'supple',
1916  'suse',
1917  'swift',
1918  'symfony',
1919  'teamspeak',
1920  'telegram-plane',
1921  'telegram',
1922  'tencent-weibo',
1923  'the-red-yeti',
1924  'themeco',
1925  'themeisle',
1926  'think-peaks',
1927  'trade-federation',
1928  'trello',
1929  'tripadvisor',
1930  'tumblr-square',
1931  'tumblr',
1932  'twitch',
1933  'twitter-square',
1934  'twitter',
1935  'typo3',
1936  'uber',
1937  'ubuntu',
1938  'uikit',
1939  'umbraco',
1940  'uniregistry',
1941  'unity',
1942  'untappd',
1943  'ups',
1944  'usb',
1945  'usps',
1946  'ussunnah',
1947  'vaadin',
1948  'viacoin',
1949  'viadeo-square',
1950  'viadeo',
1951  'viber',
1952  'vimeo-square',
1953  'vimeo-v',
1954  'vimeo',
1955  'vine',
1956  'vk',
1957  'vnv',
1958  'vuejs',
1959  'waze',
1960  'weebly',
1961  'weibo',
1962  'weixin',
1963  'whatsapp-square',
1964  'whatsapp',
1965  'whmcs',
1966  'wikipedia-w',
1967  'windows',
1968  'wix',
1969  'wizards-of-the-coast',
1970  'wolf-pack-battalion',
1971  'wordpress-simple',
1972  'wordpress',
1973  'wpbeginner',
1974  'wpexplorer',
1975  'wpforms',
1976  'wpressr',
1977  'xbox',
1978  'xing-square',
1979  'xing',
1980  'y-combinator',
1981  'yahoo',
1982  'yammer',
1983  'yandex-international',
1984  'yandex',
1985  'yarn',
1986  'yelp',
1987  'yoast',
1988  'youtube-square',
1989  'youtube',
1990  'zhihu',
1991  ];
1992 
1993  foreach ($classes as $icon_class) {
1994  if (!preg_match_all('/^elgg-icon-(.+)/i', $icon_class)) {
1995  continue;
1996  }
1997 
1998  // strip elgg-icon-
1999  $base_icon = preg_replace('/^elgg-icon-(.+)/i', '$1', $icon_class);
2000 
2001  // convert common icons
2002  $base_icon = elgg_extract($base_icon, $common_icons, $base_icon);
2003 
2004  // map solid/regular/light iconnames to correct classes
2005  if (preg_match('/.*-solid$/', $base_icon)) {
2006  $base_icon = preg_replace('/(.*)-solid$/', '$1', $base_icon);
2007  $classes[] = 'fas';
2008  } elseif (preg_match('/.*-regular$/', $base_icon)) {
2009  $base_icon = preg_replace('/(.*)-regular$/', '$1', $base_icon);
2010  $classes[] = 'far';
2011  } elseif (preg_match('/.*-light$/', $base_icon)) {
2012  // currently light is only available in FontAwesome 5 Pro
2013  $base_icon = preg_replace('/(.*)-light$/', '$1', $base_icon);
2014  $classes[] = 'fal';
2015  } elseif (in_array($base_icon, $brands)) {
2016  $classes[] = 'fab';
2017  } else {
2018  $classes[] = 'fas';
2019  }
2020 
2021  $classes[] = "fa-{$base_icon}";
2022  }
2023 
2024  $classes = array_unique($classes);
2025 
2026  return elgg_trigger_plugin_hook('classes', 'icon', null, $classes);
2027 }
2028 
2039 function elgg_view_url(string $href, string $text = null, array $options = []): string {
2040  $options['is_trusted'] = elgg_extract('is_trusted', $options, true);
2041  $options['href'] = $href;
2042  $options['text'] = $text;
2043 
2044  return elgg_view('output/url', $options);
2045 }
2046 
2056 function elgg_view_entity_url(\ElggEntity $entity, array $options = []): string {
2057  return elgg_view_url($entity->getURL(), $entity->getDisplayName(), $options);
2058 }
$messages
Definition: admin.php:12
if(!elgg_view_exists("plugins/{$plugin_id}/settings")) $form_vars
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:178
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades...
Definition: views.php:1381
getSubtype()
Get the entity subtype.
elgg_get_release()
Get the current Elgg release.
elgg_get_view_extensions($view)
Get the views (and priorities) that extend a view.
Definition: views.php:263
if(empty($plugins)) $errors
elgg_unregister_ajax_view($view)
Unregister a view for ajax calls.
Definition: views.php:117
if($view &&elgg_view_exists($view)) $label
Definition: field.php:26
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
elgg_require_css(string $view)
Register a CSS view name to be included in the HTML head.
$params
Saves global plugin settings.
Definition: save.php:13
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1169
elgg_view_entity_list($entities, array $vars=[])
Returns a rendered list of entities with pagination.
Definition: views.php:687
$footer
Wrap form footer.
Definition: footer.php:11
if(!$items) $item
Definition: delete.php:13
$classes
Definition: users.php:21
elgg_view_resource($name, array $vars=[])
Render a resource view.
Definition: views.php:361
$defaults
$title
Definition: generic.php:50
get_current_language()
Get the current system/user language or "en".
Definition: languages.php:44
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
Definition: cache.php:111
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
Definition: cache.php:139
elgg_view_relationship_list($relationships, array $vars=[])
Returns a rendered list of relationships, plus pagination.
Definition: views.php:783
$relationship
Elgg default relationship view.
Definition: default.php:10
if(!$annotation instanceof ElggAnnotation) $time
Definition: time.php:20
$subtype
Definition: delete.php:22
if(elgg_trigger_plugin_hook('usersettings:save', 'user', $hooks_params, true)) foreach($request->validation() ->all() as $item) $data
Definition: save.php:53
if($vars['name']&&$vars['default']!==false) $input_vars
Definition: checkboxes.php:95
if(!$count) $offset
Definition: pagination.php:26
$menu
Admin sidebar – just outputs the page menus.
Definition: sidebar.php:6
$time_updated
Definition: time.php:21
elgg_view_tagcloud(array $options=[])
Create a tagcloud for viewing.
Definition: views.php:1264
$type
Definition: delete.php:21
elgg_register_viewtype_fallback($viewtype)
Register a viewtype to fall back to a default view if a view isn&#39;t found for that viewtype...
Definition: views.php:91
elgg_register_external_file(string $type, string $name, string $url, string $location= '')
Core registration function for external files.
_elgg_get_js_site_data()
Get the site data to be merged into "elgg" in elgg.js.
Definition: views.php:1433
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:708
elgg_set_form_footer($footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
Definition: views.php:1103
$options
Elgg admin footer.
Definition: footer.php:6
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=[])
View the icon of an entity.
Definition: views.php:593
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
Definition: views.php:288
$value
Definition: generic.php:51
elgg_get_viewtype()
Return the current view type.
Definition: views.php:76
elgg_view_image_block($image, $body, $vars=[])
Wrapper function for the image block display pattern.
Definition: views.php:949
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
Definition: views.php:129
_elgg_has_rss_link()
Should the RSS view of this URL be linked to?
Definition: views.php:1365
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:494
Linear set of menu items collected from configuration and the "register" hook.
_elgg_get_js_page_data()
Get the initial contents of "elgg" client side.
Definition: views.php:1458
Thrown when page is not accessible.
$input_type
Helper view that can be used to filter vars for all input views.
Definition: input.php:6
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
Definition: views.php:991
elgg_view_list_item($item, array $vars=[])
View an item in a list.
Definition: views.php:1292
$entity
Definition: reset.php:8
elgg_set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view.
Definition: views.php:163
elgg_view_river_item($item, array $vars=[])
Renders a human-readable representation of a river item.
Definition: views.php:1006
if(!empty($avatar)&&!$avatar->isValid()) elseif(empty($avatar)) if(!$owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
Definition: upload.php:39
elgg_view_form($action, $form_vars=[], $body_vars=[])
Definition: views.php:1090
get_input($variable, $default=null, $filter_result=true)
Parameter input functions.
Definition: input.php:20
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
Definition: elgglib.php:399
elgg_view_relationship(\ElggRelationship $relationship, array $vars=[])
Returns a string of a rendered relationship.
Definition: views.php:828
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
Definition: views.php:544
$icon_class
Definition: record.php:73
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:970
if($id< 1) $annotation
Definition: delete.php:11
$user
Definition: ban.php:7
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Definition: elgglib.php:380
$image
Definition: image_block.php:25
elgg_load_external_file(string $type, string $name)
Load an external resource for use on this page.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:23
$viewtype
Definition: default.php:11
$timer
Definition: pending.php:29
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
Definition: views.php:106
const ELGG_ENTITIES_ANY_VALUE
Definition: constants.php:24
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
$body
Definition: useradd.php:61
$page_owner
Definition: add.php:15
elgg_extend_view($view, $view_extension, $priority=501)
Extends a view with another view.
Definition: views.php:236
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:686
$size
Definition: thumb.php:23
$action
Definition: subscribe.php:11
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
Definition: summary.php:44
elgg_view_friendly_time($time, $time_updated=null)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:885
elgg_view_annotation_list($annotations, array $vars=[])
Returns a rendered list of annotations, plus pagination.
Definition: views.php:736
_elgg_map_icon_glyph_class(array $classes)
Converts icon classes to correct FontAwesome 5 classes.
Definition: views.php:1537
elgg_get_tags(array $options=[])
Get popular tags and their frequencies.
Definition: metadata.php:80
if($email instanceof\Elgg\Email) $object
Definition: body.php:16
$ts
CSRF security token view for use with secure forms.
$location
Definition: member.php:29
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
Definition: views.php:2039
elgg_view_layout($layout_name, $vars=[])
Displays a layout with optional parameters.
Definition: views.php:406
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof ElggRelationship) elseif(is_callable([$item, 'getType']))
Definition: item.php:48
elgg_is_simplecache_enabled()
Is simple cache enabled.
Definition: cache.php:149
getType()
Returns the entity type.
elgg_view_icon($name, $vars=[])
View an icon glyph.
Definition: views.php:1323
_elgg_services()
Get the global service provider.
Definition: elgglib.php:777
elgg_set_viewtype($viewtype= '')
Manually set the viewtype.
Definition: views.php:63
$vars['head']
Definition: html.php:24
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:26
elgg_view_annotation(\ElggAnnotation $annotation, array $vars=[])
Returns a string of a rendered annotation.
Definition: views.php:632
elgg_unregister_external_view($view)
Unregister a view for ajax calls.
Definition: views.php:145
elgg_unregister_rss_link()
Remove the RSS icon link and link element from the head.
Definition: views.php:1355
_elgg_view_under_viewtype($view, $vars, $viewtype)
Render a view while the global viewtype is temporarily changed.
Definition: views.php:1513
$text
Definition: button.php:32
elgg_is_xhr()
Checks whether the request was requested via ajax.
Definition: actions.php:76
$id
Generic annotation delete action.
Definition: delete.php:6
if(!($comment instanceof ElggComment)||!$comment->canEdit()) $body_vars
$output
Definition: download.php:9
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:205
_elgg_split_vars(array $vars=[], array $prefixes=null)
Split array of vars into subarrays based on property prefixes.
Definition: views.php:1126
if(!empty($title)&&!empty($icon_name)) if(!empty($title)) if(!empty($menu)) if(!empty($header)) if(!empty($body)) $contents
Definition: message.php:73
getURL()
Gets the URL for this entity.
$menu_view
Definition: default.php:31
$subject
Definition: useradd.php:60
elgg_define_js($name, $config)
Helper functions for external files like css/js.
elgg_view_title($title, array $vars=[])
Renders a title.
Definition: views.php:868
$priority
elgg_view_entity_url(\ElggEntity $entity, array $options=[])
Helper function for outputting a link to an entity.
Definition: views.php:2056
$views
Definition: item.php:17
getDisplayName()
Get the entity&#39;s display name.
Definition: ElggEntity.php:318
elgg_get_config($name, $default=null)
Get an Elgg configuration value.
A complete menu, sorted, filtered by the "prepare" hook, and split into sections. ...
Definition: Menu.php:10
elgg_view_comments($entity, $add_comment=true, array $vars=[])
Returns rendered comments and a comment form for an entity.
Definition: views.php:909
elgg_get_form_footer()
Returns currently set footer, or false if not in the form rendering stack.
Definition: views.php:1111
elgg_register_rss_link()
Include the RSS icon link and link element in the head.
Definition: views.php:1346
elgg_unextend_view($view, $view_extension)
Unextends a view.
Definition: views.php:249