Elgg  Version 3.0
views.php
Go to the documentation of this file.
1 <?php
49 use Elgg\Menu\Menu;
52 
65 function elgg_set_viewtype($viewtype = '') {
66  return _elgg_services()->views->setViewtype($viewtype);
67 }
68 
78 function elgg_get_viewtype() {
79  return _elgg_services()->views->getViewtype();
80 }
81 
92  return _elgg_services()->views->isValidViewtype($viewtype);
93 }
94 
107  _elgg_services()->views->registerViewtypeFallback($viewtype);
108 }
109 
119  return _elgg_services()->views->doesViewtypeFallback($viewtype);
120 }
121 
135 }
136 
146 }
147 
156 function elgg_register_external_view($view, $cacheable = false) {
157 
158  _elgg_services()->ajax->registerView($view);
159 
160  if ($cacheable) {
161  _elgg_services()->views->registerCacheableView($view);
162  }
163 }
164 
173  _elgg_services()->ajax->unregisterView($view);
174 }
175 
191  _elgg_services()->views->setViewDir($view, $location, $viewtype);
192 }
193 
205 function elgg_view_exists($view, $viewtype = '', $recurse = true) {
206  return _elgg_services()->views->viewExists($view, $viewtype, $recurse);
207 }
208 
218 function elgg_list_views($viewtype = 'default') {
219  return _elgg_services()->views->listViews($viewtype);
220 }
221 
246 function elgg_view($view, $vars = [], $viewtype = '') {
247  if (func_num_args() == 5) {
248  elgg_log(__FUNCTION__ . ' now has only 3 arguments. Update your usage.', 'ERROR');
249  $viewtype = func_get_arg(4);
250  }
251  return _elgg_services()->views->renderView($view, $vars, $viewtype);
252 }
253 
266 function elgg_view_deprecated($view, array $vars, $suggestion, $version) {
267  return _elgg_services()->views->renderDeprecatedView($view, $vars, $suggestion, $version);
268 }
269 
293 function elgg_extend_view($view, $view_extension, $priority = 501) {
294  _elgg_services()->views->extendView($view, $view_extension, $priority);
295 }
296 
306 function elgg_unextend_view($view, $view_extension) {
307  return _elgg_services()->views->unextendView($view, $view_extension);
308 }
309 
321  $list = _elgg_services()->views->getViewList($view);
322  unset($list[500]);
323  return $list;
324 }
325 
338  return Minify_CSS_UriRewriter::prepend($css, $path);
339 }
340 
360 function elgg_view_page($title, $body, $page_shell = 'default', $vars = []) {
361  $timer = _elgg_services()->timer;
362  if (!$timer->hasEnded(['build page'])) {
363  $timer->end(['build page']);
364  }
365  $timer->begin([__FUNCTION__]);
366 
367  $params = [];
368  $params['identifier'] = _elgg_services()->request->getFirstUrlSegment();
369  $params['segments'] = _elgg_services()->request->getUrlSegments();
370  array_shift($params['segments']);
371  $page_shell = elgg_trigger_plugin_hook('shell', 'page', $params, $page_shell);
372 
373 
374  $system_messages = _elgg_services()->systemMessages;
375 
376  $messages = null;
377  if ($system_messages->count()) {
378  $messages = $system_messages->dumpRegister();
379 
380  if (isset($messages['error'])) {
381  // always make sure error is the first type
382  $errors = [
383  'error' => $messages['error']
384  ];
385 
386  unset($messages['error']);
387  $messages = array_merge($errors, $messages);
388  }
389  }
390 
391  $vars['title'] = $title;
392  $vars['body'] = $body;
393  $vars['sysmessages'] = $messages;
394  $vars['page_shell'] = $page_shell;
395 
396  // head has keys 'title', 'metas', 'links'
397  $head_params = _elgg_views_prepare_head($title);
398 
399  $vars['head'] = elgg_trigger_plugin_hook('head', 'page', $vars, $head_params);
400 
401  $vars = elgg_trigger_plugin_hook('output:before', 'page', null, $vars);
402 
403  $output = elgg_view("page/$page_shell", $vars);
404 
405 
406  // Allow plugins to modify the output
407  $output = elgg_trigger_plugin_hook('output', 'page', $vars, $output);
408 
409  $timer->end([__FUNCTION__]);
410  return $output;
411 }
412 
423 function elgg_view_resource($name, array $vars = []) {
424  $view = "resources/$name";
425 
426  if (elgg_view_exists($view)) {
427  return _elgg_services()->views->renderView($view, $vars);
428  }
429 
430  if (elgg_get_viewtype() !== 'default' && elgg_view_exists($view, 'default')) {
431  return _elgg_services()->views->renderView($view, $vars, 'default');
432  }
433 
434  _elgg_services()->logger->error("The view $view is missing.");
435 
436  // only works for default viewtype
437  throw new \Elgg\PageNotFoundException();
438 }
439 
448  $params = [
449  'links' => [],
450  'metas' => [],
451  ];
452 
453  if (empty($title)) {
454  $params['title'] = _elgg_config()->sitename;
455  } else {
456  $params['title'] = $title . ' : ' . _elgg_config()->sitename;
457  }
458 
459  $params['metas']['content-type'] = [
460  'http-equiv' => 'Content-Type',
461  'content' => 'text/html; charset=utf-8',
462  ];
463 
464  $params['metas']['description'] = [
465  'name' => 'description',
466  'content' => _elgg_config()->sitedescription
467  ];
468 
469  // https://developer.chrome.com/multidevice/android/installtohomescreen
470  $params['metas']['viewport'] = [
471  'name' => 'viewport',
472  'content' => 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0',
473  ];
474  $params['metas']['mobile-web-app-capable'] = [
475  'name' => 'mobile-web-app-capable',
476  'content' => 'yes',
477  ];
478  $params['metas']['apple-mobile-web-app-capable'] = [
479  'name' => 'apple-mobile-web-app-capable',
480  'content' => 'yes',
481  ];
482 
483  // RSS feed link
484  if (_elgg_has_rss_link()) {
486  if (substr_count($url, '?')) {
487  $url .= "&view=rss";
488  } else {
489  $url .= "?view=rss";
490  }
491  $params['links']['rss'] = [
492  'rel' => 'alternative',
493  'type' => 'application/rss+xml',
494  'title' => 'RSS',
495  'href' => $url,
496  ];
497  }
498 
499  return $params;
500 }
501 
502 
519 function _elgg_views_prepare_favicon_links($hook, $type, $head_params, $params) {
520 
521  $head_params['links']['apple-touch-icon'] = [
522  'rel' => 'apple-touch-icon',
523  'href' => elgg_get_simplecache_url('graphics/favicon-128.png'),
524  ];
525 
526  // favicons
527  $head_params['links']['icon-ico'] = [
528  'rel' => 'icon',
529  'href' => elgg_get_simplecache_url('graphics/favicon.ico'),
530  ];
531  $head_params['links']['icon-vector'] = [
532  'rel' => 'icon',
533  'sizes' => '16x16 32x32 48x48 64x64 128x128',
534  'type' => 'image/svg+xml',
535  'href' => elgg_get_simplecache_url('graphics/favicon.svg'),
536  ];
537  $head_params['links']['icon-16'] = [
538  'rel' => 'icon',
539  'sizes' => '16x16',
540  'type' => 'image/png',
541  'href' => elgg_get_simplecache_url('graphics/favicon-16.png'),
542  ];
543  $head_params['links']['icon-32'] = [
544  'rel' => 'icon',
545  'sizes' => '32x32',
546  'type' => 'image/png',
547  'href' => elgg_get_simplecache_url('graphics/favicon-32.png'),
548  ];
549  $head_params['links']['icon-64'] = [
550  'rel' => 'icon',
551  'sizes' => '64x64',
552  'type' => 'image/png',
553  'href' => elgg_get_simplecache_url('graphics/favicon-64.png'),
554  ];
555  $head_params['links']['icon-128'] = [
556  'rel' => 'icon',
557  'sizes' => '128x128',
558  'type' => 'image/png',
559  'href' => elgg_get_simplecache_url('graphics/favicon-128.png'),
560  ];
561 
562  return $head_params;
563 }
564 
593 function elgg_view_layout($layout_name, $vars = []) {
594  $timer = _elgg_services()->timer;
595  if (!$timer->hasEnded(['build page'])) {
596  $timer->end(['build page']);
597  }
598  $timer->begin([__FUNCTION__]);
599 
600  // Help plugins transition without breaking them
601  switch ($layout_name) {
602  case 'content' :
603  $layout_name = 'default';
605  break;
606 
607  case 'one_sidebar' :
608  $layout_name = 'default';
609  $vars['sidebar'] = elgg_extract('sidebar', $vars, '', false);
610  $vars['sidebar_alt'] = false;
611  break;
612 
613  case 'one_column' :
614  $layout_name = 'default';
615  $vars['sidebar'] = false;
616  $vars['sidebar_alt'] = false;
617  break;
618 
619  case 'two_sidebar' :
620  $layout_name = 'default';
621  $vars['sidebar'] = elgg_extract('sidebar', $vars, '', false);
622  $vars['sidebar_alt'] = elgg_extract('sidebar_alt', $vars, '', false);
623  break;
624 
625  case 'default' :
626  $filter_id = elgg_extract('filter_id', $vars, 'filter');
627  $filter_context = elgg_extract('filter_value', $vars);
628  if (isset($filter_context) && $filter_id === 'filter') {
629  $context = elgg_extract('context', $vars, elgg_get_context());
630  $vars['filter'] = elgg_get_filter_tabs($context, $filter_context, null, $vars);
631  $vars['filter_id'] = $filter_id;
632  $vars['filter_value'] = $filter_context;
633  }
634  break;
635  }
636 
637  if (isset($vars['nav'])) {
638  // Temporary helper until all core views are updated
639  $vars['breadcrumbs'] = $vars['nav'];
640  unset($vars['nav']);
641  }
642 
643  $vars['identifier'] = _elgg_services()->request->getFirstUrlSegment();
644  $vars['segments'] = _elgg_services()->request->getUrlSegments();
645  array_shift($vars['segments']);
646 
647  $layout_name = elgg_trigger_plugin_hook('layout', 'page', $vars, $layout_name);
648 
649  $vars['layout'] = $layout_name;
650 
651  $layout_views = [
652  "page/layouts/$layout_name",
653  "page/layouts/default",
654  ];
655 
656  $output = '';
657  foreach ($layout_views as $layout_view) {
658  if (elgg_view_exists($layout_view)) {
659  $output = elgg_view($layout_view, $vars);
660  break;
661  }
662  }
663 
664  $timer->end([__FUNCTION__]);
665  return $output;
666 }
667 
677 
678  $context = elgg_extract('context', $vars, elgg_get_context());
679 
680  $vars['title'] = elgg_extract('title', $vars, '');
681  if (!$vars['title'] && $vars['title'] !== false) {
682  $vars['title'] = elgg_echo($context);
683  }
684 
685  // 1.8 supported 'filter_override'
686  if (isset($vars['filter_override'])) {
687  $vars['filter'] = $vars['filter_override'];
688  }
689 
690  // register the default content filters
691  if (!isset($vars['filter']) && $context) {
692  $selected = elgg_extract('filter_context', $vars);
693  $vars['filter'] = elgg_get_filter_tabs($context, $selected, null, $vars);
694  $vars['filter_id'] = $context;
695  $vars['filter_value'] = $selected;
696  }
697 
698  return $vars;
699 }
700 
755 function elgg_view_menu($menu, array $vars = []) {
756 
757  $menu_view = elgg_extract('menu_view', $vars);
758  unset($vars['menu_view']);
759 
760  if (is_string($menu)) {
761  $menu = _elgg_services()->menus->getMenu($menu, $vars);
762  } elseif ($menu instanceof UnpreparedMenu) {
763  $menu = _elgg_services()->menus->prepareMenu($menu);
764  }
765 
766  if (!$menu instanceof Menu) {
767  throw new \InvalidArgumentException('$menu must be a menu name, a Menu, or UnpreparedMenu');
768  }
769 
770  $name = $menu->getName();
771  $params = $menu->getParams();
772 
773  $views = [
774  $menu_view,
775  "navigation/menu/$name",
776  'navigation/menu/default',
777  ];
778 
779  foreach ($views as $view) {
780  if (elgg_view_exists($view)) {
781  return elgg_view($view, $params);
782  }
783  }
784 }
785 
794 function elgg_view_menu_item(\ElggMenuItem $item, array $vars = []) {
795 
796  $vars = array_merge($item->getValues(), $vars);
797  $vars['class'] = elgg_extract_class($vars, ['elgg-menu-content']);
798 
799  if ($item->getLinkClass()) {
800  $vars['class'][] = $item->getLinkClass();
801  }
802 
803  if ($item->getHref() === false || $item->getHref() === null) {
804  $vars['class'][] = 'elgg-non-link';
805  }
806 
807  if (!isset($vars['rel']) && !isset($vars['is_trusted'])) {
808  $vars['is_trusted'] = true;
809  }
810 
811  if ($item->getConfirmText()) {
812  $vars['confirm'] = $item->getConfirmText();
813  }
814 
815  return elgg_view('output/url', $vars);
816 }
817 
842 function elgg_view_entity(\ElggEntity $entity, array $vars = []) {
843 
844  $defaults = [
845  'full_view' => true,
846  ];
847 
848  $vars = array_merge($defaults, $vars);
849 
850  if (elgg_extract('register_rss_link', $vars, elgg_extract('full_view', $vars))) {
852  }
853 
854  $vars['entity'] = $entity;
855 
856  $entity_type = $entity->getType();
857  $entity_subtype = $entity->getSubtype();
858 
859  $entity_views = [
860  elgg_extract('item_view', $vars, ''),
861  "$entity_type/$entity_subtype",
862  "$entity_type/default",
863  ];
864 
865  $contents = '';
866  foreach ($entity_views as $view) {
867  if (elgg_view_exists($view)) {
868  $contents = elgg_view($view, $vars);
869  break;
870  }
871  }
872 
873  // Marcus Povey 20090616 : Speculative and low impact approach for fixing #964
874  if ($vars['full_view']) {
875  $annotations = elgg_view_entity_annotations($entity, $vars['full_view']);
876 
877  if ($annotations) {
878  $contents .= $annotations;
879  }
880  }
881  return $contents;
882 }
883 
899 function elgg_view_entity_icon(\ElggEntity $entity, $size = 'medium', $vars = []) {
900 
901  $vars['entity'] = $entity;
902  $vars['size'] = $size;
903 
904  $entity_type = $entity->getType();
905 
906  $subtype = $entity->getSubtype();
907 
908  $contents = '';
909  if (elgg_view_exists("icon/$entity_type/$subtype")) {
910  $contents = elgg_view("icon/$entity_type/$subtype", $vars);
911  }
912  if (empty($contents) && elgg_view_exists("icon/$entity_type/default")) {
913  $contents = elgg_view("icon/$entity_type/default", $vars);
914  }
915  if (empty($contents)) {
916  $contents = elgg_view("icon/default", $vars);
917  }
918 
919  return $contents;
920 }
921 
941  $defaults = [
942  'full_view' => true,
943  ];
944 
945  $vars = array_merge($defaults, $vars);
946  $vars['annotation'] = $annotation;
947 
948  $name = $annotation->name;
949  if (empty($name)) {
950  return false;
951  }
952 
953  $annotation_views = [
954  elgg_extract('item_view', $vars, ''),
955  "annotation/$name",
956  "annotation/default",
957  ];
958 
959  $contents = '';
960  foreach ($annotation_views as $view) {
961  if (elgg_view_exists($view)) {
962  $contents = elgg_view($view, $vars);
963  break;
964  }
965  }
966 
967  return $contents;
968 }
969 
996 function elgg_view_entity_list($entities, array $vars = []) {
997  $offset = (int) get_input('offset', 0);
998 
999  // list type can be passed as request parameter
1000  $list_type = get_input('list_type', 'list');
1001 
1002  $defaults = [
1003  'items' => $entities,
1004  'list_class' => 'elgg-list-entity',
1005  'full_view' => true,
1006  'pagination' => true,
1007  'list_type' => $list_type,
1008  'list_type_toggle' => false,
1009  'offset' => $offset,
1010  'limit' => null,
1011  ];
1012 
1013  $vars = array_merge($defaults, $vars);
1014 
1015  if (!$vars["limit"] && !$vars["offset"]) {
1016  // no need for pagination if listing is unlimited
1017  $vars["pagination"] = false;
1018  }
1019 
1020  $view = "page/components/{$vars['list_type']}";
1021  if (!elgg_view_exists($view)) {
1022  $view = 'page/components/list';
1023  }
1024 
1025  return elgg_view($view, $vars);
1026 }
1027 
1046 function elgg_view_annotation_list($annotations, array $vars = []) {
1047  $defaults = [
1048  'items' => $annotations,
1049  'offset' => null,
1050  'limit' => null,
1051  'list_class' => 'elgg-list-annotation elgg-annotation-list', // @todo remove elgg-annotation-list in Elgg 1.9
1052  'full_view' => true,
1053  'offset_key' => 'annoff',
1054  ];
1055 
1056  $vars = array_merge($defaults, $vars);
1057 
1058  if (!$vars["limit"] && !$vars["offset"]) {
1059  // no need for pagination if listing is unlimited
1060  $vars["pagination"] = false;
1061  }
1062 
1063  return elgg_view('page/components/list', $vars);
1064 }
1065 
1081 
1082  $entity_type = $entity->getType();
1083 
1084  $annotations = elgg_trigger_plugin_hook('entity:annotate', $entity_type,
1085  [
1086  'entity' => $entity,
1087  'full_view' => $full_view,
1088  ]
1089  );
1090 
1091  return $annotations;
1092 }
1093 
1104 function elgg_view_title($title, array $vars = []) {
1105  $vars['title'] = $title;
1106 
1107  return elgg_view('page/elements/title', $vars);
1108 }
1109 
1121  $view = 'output/friendlytime';
1122  $vars = ['time' => $time];
1123  $viewtype = elgg_view_exists($view) ? '' : 'default';
1124 
1126 }
1127 
1141 function elgg_view_comments($entity, $add_comment = true, array $vars = []) {
1142 
1143  if (!$entity instanceof \ElggEntity) {
1144  return false;
1145  }
1146 
1147  $vars['entity'] = $entity;
1148  $vars['show_add_form'] = $add_comment;
1149  $vars['class'] = elgg_extract('class', $vars, "{$entity->getSubtype()}-comments");
1150 
1151  $output = elgg_trigger_plugin_hook('comments', $entity->getType(), $vars, false);
1152  if ($output !== false) {
1153  return $output;
1154  }
1155 
1156  return elgg_view('page/elements/comments', $vars);
1157 }
1158 
1178  $vars['image'] = $image;
1179  $vars['body'] = $body;
1180  return elgg_view('page/components/image_block', $vars);
1181 }
1182 
1198 function elgg_view_module($type, $title, $body, array $vars = []) {
1199  $vars['type'] = $type;
1200  $vars['title'] = $title;
1201  $vars['body'] = $body;
1202  return elgg_view('page/components/module', $vars);
1203 }
1204 
1219 function elgg_view_message($type, $body, array $vars = []) {
1220  $vars['type'] = $type;
1221  $vars['body'] = $body;
1222  return elgg_view('page/components/message', $vars);
1223 }
1224 
1234 function elgg_view_river_item($item, array $vars = []) {
1235 
1236  if (!($item instanceof \ElggRiverItem)) {
1237  return '';
1238  }
1239 
1240  // checking default viewtype since some viewtypes do not have unique views per item (rss)
1241  $view = $item->getView();
1242 
1243  $subject = $item->getSubjectEntity();
1244  $object = $item->getObjectEntity();
1245  if (!$subject || !$object) {
1246  // subject is disabled or subject/object deleted
1247  return '';
1248  }
1249 
1250  if (elgg_extract('register_rss_link', $vars)) {
1252  }
1253 
1254  $vars['item'] = $item;
1255 
1256  // create river view logic
1257  $type = $object->getType();
1259  $action = $item->action_type;
1260 
1261  $river_views = [
1262  elgg_extract('item_view', $vars, ''),
1263  'river/item', // important for other viewtypes, e.g. "rss"
1264  $view,
1265  "river/{$type}/{$subtype}/{$action}",
1266  "river/{$type}/{$subtype}/default",
1267  "river/{$type}/{$action}",
1268  "river/{$type}/default",
1269  'river/elements/layout',
1270  ];
1271 
1272  $contents = '';
1273  foreach ($river_views as $view) {
1274  if (elgg_view_exists($view)) {
1275  $contents = elgg_view($view, $vars);
1276  break;
1277  }
1278  }
1279 
1280  return $contents;
1281 }
1282 
1319  return _elgg_services()->forms->render($action, $form_vars, $body_vars);
1320 }
1321 
1332  return _elgg_services()->forms->setFooter($footer);
1333 }
1334 
1340  return _elgg_services()->forms->getFooter();
1341 }
1342 
1353 function _elgg_split_vars(array $vars = [], array $prefixes = null) {
1354 
1355  if (!isset($prefixes)) {
1356  $prefixes = ['#'];
1357  }
1358 
1359  $return = [];
1360 
1361  foreach ($vars as $key => $value) {
1362  foreach ($prefixes as $prefix) {
1363  if (substr($key, 0, 1) === $prefix) {
1364  $key = substr($key, 1);
1365  $return[$prefix][$key] = $value;
1366  break;
1367  } else {
1368  $return[''][$key] = $value;
1369  }
1370  }
1371  }
1372 
1373  return $return;
1374 }
1375 
1395 function elgg_view_field(array $params = []) {
1396 
1397  if (!empty($params['#html'])) {
1398  return $params['#html'];
1399  }
1400 
1401  if (empty($params['#type'])) {
1402  _elgg_services()->logger->error(__FUNCTION__ . '(): $params["#type"] is required.');
1403  return '';
1404  }
1405 
1406  $input_type = $params['#type'];
1407  if (!elgg_view_exists("input/$input_type")) {
1408  return '';
1409  }
1410 
1411  $hidden_types = ['hidden', 'securitytoken'];
1412  if (in_array($input_type, $hidden_types)) {
1414  return elgg_view("input/$input_type", $params['']);
1415  }
1416 
1417  $id = elgg_extract('id', $params);
1418  if (!$id) {
1419  $id = "elgg-field-" . base_convert(mt_rand(), 10, 36);
1420  $params['id'] = $id;
1421  }
1422 
1423  $make_special_checkbox_label = false;
1424  if ($input_type == 'checkbox' && (isset($params['label']) || isset($params['#label']))) {
1425  if (isset($params['#label']) && isset($params['label'])) {
1426  $params['label_tag'] = 'div';
1427  } else {
1428  $label = elgg_extract('label', $params);
1429  $label = elgg_extract('#label', $params, $label);
1430 
1431  $params['#label'] = $label;
1432  unset($params['label']);
1433 
1434  // Single checkbox input view gets special treatment
1435  // We don't want the field label to appear a checkbox without a label
1436  $make_special_checkbox_label = true;
1437  }
1438  }
1439 
1440  // Need to set defaults to prevent input keys with same name ending up in element vars if not provided
1441  $defaults = [
1442  '#class' => ELGG_ENTITIES_ANY_VALUE,
1443  '#help' => ELGG_ENTITIES_ANY_VALUE,
1444  '#label' => ELGG_ENTITIES_ANY_VALUE,
1445  '#view' => ELGG_ENTITIES_ANY_VALUE,
1446  ];
1447  $params = array_merge($defaults, $params);
1448 
1449  // first pass non-hash keys into both
1450  $split_params = _elgg_split_vars($params);
1451 
1452  // $vars passed to input/$input_name
1453  $input_vars = $split_params[''];
1454 
1455  // $vars passed to label, help and field wrapper views
1456  $element_vars = array_merge($split_params[''], $split_params['#']);
1457 
1458  // field input view needs this
1459  $input_vars['input_type'] = $input_type;
1460 
1461  // field views get more data
1462  $element_vars['input_type'] = $input_type;
1463 
1464  // wrap if present
1465  $element_vars['label'] = elgg_view('elements/forms/label', $element_vars);
1466  $element_vars['help'] = elgg_view('elements/forms/help', $element_vars);
1467 
1468  if ($make_special_checkbox_label) {
1469  $input_vars['label'] = $element_vars['label'];
1470  $input_vars['label_tag'] = 'div';
1471  unset($element_vars['label']);
1472  }
1473  $element_vars['input'] = elgg_view("elements/forms/input", $input_vars);
1474 
1475  return elgg_view('elements/forms/field', $element_vars);
1476 }
1477 
1493 function elgg_view_tagcloud(array $options = []) {
1494 
1495  $type = $subtype = '';
1496  if (isset($options['type'])) {
1497  $type = $options['type'];
1498  }
1499  if (isset($options['subtype'])) {
1500  $subtype = $options['subtype'];
1501  }
1502 
1503  $tag_data = elgg_get_tags($options);
1504  return elgg_view("output/tagcloud", [
1505  'value' => $tag_data,
1506  'type' => $type,
1507  'subtype' => $subtype,
1508  ]);
1509 }
1510 
1523 function elgg_view_list_item($item, array $vars = []) {
1524 
1525  if ($item instanceof \ElggEntity) {
1526  return elgg_view_entity($item, $vars);
1527  } else if ($item instanceof \ElggAnnotation) {
1528  return elgg_view_annotation($item, $vars);
1529  } else if ($item instanceof \ElggRiverItem) {
1530  return elgg_view_river_item($item, $vars);
1531  }
1532 
1533  $view = elgg_extract('item_view', $vars);
1534  if ($view && elgg_view_exists($view)) {
1535  $vars['item'] = $item;
1536  return elgg_view($view, $vars);
1537  }
1538 
1539  return '';
1540 }
1541 
1552 function elgg_view_icon($name, $vars = []) {
1553  if (empty($vars)) {
1554  $vars = [];
1555  }
1556 
1557  if (is_string($vars)) {
1558  $vars = ['class' => $vars];
1559  }
1560 
1561  if (!is_array($vars)) {
1562  throw new \InvalidArgumentException('$vars needs to be a string or an array');
1563  }
1564 
1565  $vars['class'] = elgg_extract_class($vars, "elgg-icon-$name");
1566 
1567  return elgg_view("output/icon", $vars);
1568 }
1569 
1576  _elgg_config()->_elgg_autofeed = true;
1577 }
1578 
1585  _elgg_config()->_elgg_autofeed = false;
1586 }
1587 
1595  if (_elgg_config()->disable_rss) {
1596  return false;
1597  }
1598 
1599  return (bool) _elgg_config()->_elgg_autofeed;
1600 }
1601 
1619 function autoregister_views($view_base, $folder, $ignored, $viewtype) {
1620  return _elgg_services()->views->autoregisterViews($view_base, $folder, $viewtype);
1621 }
1622 
1635  if (preg_match('~[\.-]min\.~', $params['view'])) {
1636  // bypass minification
1637  return;
1638  }
1639 
1640  if ($type == 'js') {
1641  if (_elgg_config()->simplecache_minify_js) {
1642  return JSMin::minify($content);
1643  }
1644  } elseif ($type == 'css') {
1645  if (_elgg_config()->simplecache_minify_css) {
1646  $cssmin = new CSSmin();
1647  return $cssmin->run($content);
1648  }
1649  }
1650 }
1651 
1664  $options = elgg_extract('compiler_options', $params, []);
1665  return _elgg_services()->cssCompiler->compile($content, $options);
1666 }
1667 
1680  $filter = new \Elgg\Amd\ViewFilter();
1681  return $filter->filter($params['view'], $content);
1682 }
1683 
1692  elgg_set_http_header('X-Frame-Options: SAMEORIGIN');
1693 }
1694 
1723  $views = _elgg_services()->views;
1724 
1725  if ($views->viewIsExtended($view) || $views->viewHasHookHandlers($view)) {
1726  return true;
1727  }
1728 
1730 
1731  // check location
1732  if (0 === strpos($path, '/') || preg_match('~^([A-Za-z]\:)?\\\\~', $path)) {
1733  // absolute path
1734  $expected_path = $path;
1735  } else {
1736  // relative path
1737  $expected_path = Paths::elgg() . "views/$viewtype/" . ltrim($path, '/\\');
1738  }
1739 
1740  $view_path = $views->findViewFile($view, $viewtype);
1741 
1742  return realpath($view_path) !== realpath($expected_path);
1743 }
1744 
1753 function elgg_views_boot() {
1754  _elgg_services()->viewCacher->registerCoreViews();
1755 
1756  // jQuery and UI must come before require. See #9024
1757  elgg_register_js('jquery', elgg_get_simplecache_url('jquery.js'), 'head');
1758  elgg_load_js('jquery');
1759 
1760  elgg_register_js('jquery-ui', elgg_get_simplecache_url('jquery-ui.js'), 'head');
1761  elgg_load_js('jquery-ui');
1762 
1763  elgg_register_js('elgg.require_config', elgg_get_simplecache_url('elgg/require_config.js'), 'head');
1764  elgg_load_js('elgg.require_config');
1765 
1766  elgg_register_js('require', elgg_get_simplecache_url('require.js'), 'head');
1767  elgg_load_js('require');
1768 
1769  elgg_register_js('elgg', elgg_get_simplecache_url('elgg.js'), 'head');
1770  elgg_load_js('elgg');
1771 
1772  elgg_register_css('font-awesome', elgg_get_simplecache_url('font-awesome/css/all.min.css'));
1773  elgg_load_css('font-awesome');
1774 
1775  elgg_register_css('elgg', elgg_get_simplecache_url('elgg.css'));
1776  elgg_load_css('elgg');
1777 
1778  elgg_register_simplecache_view('elgg/init.js');
1779 
1780  elgg_extend_view('elgg.css', 'lightbox/elgg-colorbox-theme/colorbox.css');
1781 
1782  elgg_define_js('jquery.ui.autocomplete.html', [
1783  'deps' => ['jquery-ui'],
1784  ]);
1785 
1786  elgg_register_js('elgg.avatar_cropper', elgg_get_simplecache_url('elgg/ui.avatar_cropper.js'));
1787 
1788  // @deprecated 2.2
1789  elgg_register_js('elgg.ui.river', elgg_get_simplecache_url('elgg/ui.river.js'));
1790 
1791  elgg_register_js('jquery.imgareaselect', elgg_get_simplecache_url('jquery.imgareaselect.js'));
1792  elgg_register_css('jquery.imgareaselect', elgg_get_simplecache_url('jquery.imgareaselect.css'));
1793 
1794  elgg_register_css('jquery.treeview', elgg_get_simplecache_url('jquery-treeview/jquery.treeview.css'));
1795  elgg_define_js('jquery.treeview', [
1796  'src' => elgg_get_simplecache_url('jquery-treeview/jquery.treeview.js'),
1797  'exports' => 'jQuery.fn.treeview',
1798  'deps' => ['jquery'],
1799  ]);
1800 
1801  elgg_register_ajax_view('languages.js');
1802 
1803  // pre-process CSS regardless of simplecache
1804  elgg_register_plugin_hook_handler('cache:generate', 'css', '_elgg_views_preprocess_css');
1805  elgg_register_plugin_hook_handler('simplecache:generate', 'css', '_elgg_views_preprocess_css');
1806 
1807  elgg_register_plugin_hook_handler('simplecache:generate', 'js', '_elgg_views_amd');
1808  elgg_register_plugin_hook_handler('cache:generate', 'js', '_elgg_views_amd');
1809  elgg_register_plugin_hook_handler('simplecache:generate', 'css', '_elgg_views_minify');
1810  elgg_register_plugin_hook_handler('simplecache:generate', 'js', '_elgg_views_minify');
1811 
1812  elgg_register_plugin_hook_handler('output:before', 'page', '_elgg_views_send_header_x_frame_options');
1813 
1814  elgg_register_plugin_hook_handler('view_vars', 'elements/forms/help', '_elgg_views_file_help_upload_limit');
1815 
1816  // registered with high priority for BC
1817  // prior to 2.2 registration used to take place in _elgg_views_prepare_head() before the hook was triggered
1818  elgg_register_plugin_hook_handler('head', 'page', '_elgg_views_prepare_favicon_links', 1);
1819 
1820  // set default icon sizes - can be overridden with plugin
1821  if (!_elgg_config()->hasValue('icon_sizes')) {
1822  $icon_sizes = [
1823  'topbar' => ['w' => 16, 'h' => 16, 'square' => true, 'upscale' => true],
1824  'tiny' => ['w' => 25, 'h' => 25, 'square' => true, 'upscale' => true],
1825  'small' => ['w' => 40, 'h' => 40, 'square' => true, 'upscale' => true],
1826  'medium' => ['w' => 100, 'h' => 100, 'square' => true, 'upscale' => true],
1827  'large' => ['w' => 200, 'h' => 200, 'square' => true, 'upscale' => true],
1828  'master' => ['w' => 10240, 'h' => 10240, 'square' => false, 'upscale' => false, 'crop' => false],
1829  ];
1830  elgg_set_config('icon_sizes', $icon_sizes);
1831  }
1832 
1833  // Configure lightbox
1834  elgg_register_plugin_hook_handler('elgg.data', 'site', '_elgg_set_lightbox_config');
1835 }
1836 
1846  $language = _elgg_config()->language;
1847  if (!$language) {
1848  $language = 'en';
1849  }
1850 
1851  return [
1852  'elgg.data' => (object) elgg_trigger_plugin_hook('elgg.data', 'site', null, []),
1853  'elgg.version' => elgg_get_version(),
1854  'elgg.release' => elgg_get_version(true),
1855  'elgg.config.wwwroot' => elgg_get_site_url(),
1856 
1857  // refresh token 3 times during its lifetime (in microseconds 1000 * 1/3)
1858  'elgg.security.interval' => (int) elgg()->csrf->getActionTokenTimeout() * 333,
1859  'elgg.config.language' => $language,
1860  ];
1861 }
1862 
1870  $data = elgg_trigger_plugin_hook('elgg.data', 'page', null, []);
1871  if (!is_array($data)) {
1872  elgg_log('"elgg.data" plugin hook handlers must return an array. Returned ' . gettype($data) . '.', 'ERROR');
1873  $data = [];
1874  }
1875 
1876  $elgg = [
1877  'config' => [
1878  'lastcache' => (int) _elgg_config()->lastcache,
1879  'viewtype' => elgg_get_viewtype(),
1880  'simplecache_enabled' => (int) elgg_is_simplecache_enabled(),
1881  'current_language' => get_current_language(),
1882  ],
1883  'security' => [
1884  'token' => [
1885  '__elgg_ts' => $ts = time(),
1886  '__elgg_token' => generate_action_token($ts),
1887  ],
1888  ],
1889  'session' => [
1890  'user' => null,
1891  'token' => _elgg_services()->session->get('__elgg_session'),
1892  ],
1893  '_data' => (object) $data,
1894  ];
1895 
1896  if (_elgg_config()->elgg_load_sync_code) {
1897  $elgg['config']['load_sync_code'] = true;
1898  }
1899 
1901  if ($page_owner instanceof ElggEntity) {
1902  $elgg['page_owner'] = $page_owner->toObject();
1903  }
1904 
1906  if ($user instanceof ElggUser) {
1907  $user_object = $user->toObject();
1908  $user_object->admin = $user->isAdmin();
1909  $elgg['session']['user'] = $user_object;
1910  }
1911 
1912  return $elgg;
1913 }
1914 
1927  $current_view_type = null;
1928  if ($viewtype) {
1929  $current_view_type = elgg_get_viewtype();
1931  }
1932 
1933  $ret = elgg_view($view, $vars);
1934 
1935  if (isset($current_view_type)) {
1936  elgg_set_viewtype($current_view_type);
1937  }
1938 
1939  return $ret;
1940 }
1941 
1952 function _elgg_set_lightbox_config($hook, $type, $return, $params) {
1953 
1954  $return['lightbox'] = [
1955  'current' => elgg_echo('js:lightbox:current', ['{current}', '{total}']),
1956  'previous' => elgg_view_icon('caret-left'),
1957  'next' => elgg_view_icon('caret-right'),
1958  'close' => elgg_view_icon('times'),
1959  'opacity' => 0.5,
1960  'maxWidth' => '990px',
1961  'maxHeight' => '990px',
1962  'initialWidth' => '300px',
1963  'initialHeight' => '300px',
1964  ];
1965 
1966  return $return;
1967 }
1968 
1980 
1981  $return = $hook->getValue();
1982  if (elgg_extract('input_type', $return) !== 'file') {
1983  return;
1984  }
1985 
1986  if (!elgg_extract('show_upload_limit', $return, true)) {
1987  return;
1988  }
1989 
1990  $help = elgg_extract('help', $return, '');
1991 
1992  // Get post_max_size and upload_max_filesize
1993  $post_max_size = elgg_get_ini_setting_in_bytes('post_max_size');
1994  $upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize');
1995 
1996  // Determine the correct value
1998 
1999  $help .= ' ' . elgg_echo('input:file:upload_limit', [elgg_format_bytes($max_upload)]);
2000 
2001  $return['help'] = trim($help);
2002 
2003  return $return;
2004 }
2005 
2015 function _elgg_map_icon_glyph_class(array $classes, $map_sprites = true) {
2016 
2017  // these 'old' Elgg 1.x sprite icons will be converted to the FontAwesome version
2018  $legacy_sprites = [
2019  "arrow-two-head" => "arrows-h",
2020  "attention" => "exclamation-triangle",
2021  "cell-phone" => "mobile",
2022  "checkmark" => "check",
2023  "clip" => "paperclip",
2024  "cursor-drag-arrow" => "arrows",
2025  "drag-arrow" => "arrows", // 'old' admin sprite
2026  "delete-alt" => "times-circle",
2027  "delete" => "times",
2028  "facebook" => "facebook-square",
2029  "grid" => "th",
2030  "hover-menu" => "caret-down",
2031  "info" => "info-circle",
2032  "lock-closed" => "lock",
2033  "lock-open" => "unlock",
2034  "mail" => "envelope-o",
2035  "mail-alt" => "envelope",
2036  "print-alt" => "print",
2037  "push-pin" => "thumb-tack",
2038  "push-pin-alt" => "thumb-tack",
2039  "redo" => "share",
2040  "round-arrow-left" => "arrow-circle-left",
2041  "round-arrow-right" => "arrow-circle-right",
2042  "round-checkmark" => "check-circle",
2043  "round-minus" => "minus-circle",
2044  "round-plus" => "plus-circle",
2045  "rss" => "rss-square",
2046  "search-focus" => "search",
2047  "settings" => "wrench",
2048  "settings-alt" => "cog",
2049  "share" => "share-alt-square",
2050  "shop-cart" => "shopping-cart",
2051  "speech-bubble" => "comment",
2052  "speech-bubble-alt" => "comments",
2053  "star-alt" => "star",
2054  "star-empty" => "star-o",
2055  "thumbs-down-alt" => "thumbs-down",
2056  "thumbs-up-alt" => "thumbs-up",
2057  "trash" => "trash-o",
2058  "twitter" => "twitter-square",
2059  "undo" => "reply",
2060  "video" => "film"
2061  ];
2062 
2063  $fa5 = [
2064  'address-book-o' => ['address-book', 'far'],
2065  'address-card-o' => ['address-card', 'far'],
2066  'area-chart' => ['chart-area', 'fas'],
2067  'arrow-circle-o-down' => ['arrow-alt-circle-down', 'far'],
2068  'arrow-circle-o-left' => ['arrow-alt-circle-left', 'far'],
2069  'arrow-circle-o-right' => ['arrow-alt-circle-right', 'far'],
2070  'arrow-circle-o-up' => ['arrow-alt-circle-up', 'far'],
2071  'arrows-alt' => ['expand-arrows-alt', 'fas'],
2072  'arrows-h' => ['arrows-alt-h', 'fas'],
2073  'arrows-v' => ['arrows-alt-v', 'fas'],
2074  'arrows' => ['arrows-alt', 'fas'],
2075  'asl-interpreting' => ['american-sign-language-interpreting', 'fas'],
2076  'automobile' => ['car', 'fas'],
2077  'bank' => ['university', 'fas'],
2078  'bar-chart-o' => ['chart-bar', 'far'],
2079  'bar-chart' => ['chart-bar', 'far'],
2080  'bathtub' => ['bath', 'fas'],
2081  'battery-0' => ['battery-empty', 'fas'],
2082  'battery-1' => ['battery-quarter', 'fas'],
2083  'battery-2' => ['battery-half', 'fas'],
2084  'battery-3' => ['battery-three-quarters', 'fas'],
2085  'battery-4' => ['battery-full', 'fas'],
2086  'battery' => ['battery-full', 'fas'],
2087  'bell-o' => ['bell', 'far'],
2088  'bell-slash-o' => ['bell-slash', 'far'],
2089  'bitbucket-square' => ['bitbucket', 'fab'],
2090  'bitcoin' => ['btc', 'fab'],
2091  'bookmark-o' => ['bookmark', 'far'],
2092  'building-o' => ['building', 'far'],
2093  'cab' => ['taxi', 'fas'],
2094  'calendar-check-o' => ['calendar-check', 'far'],
2095  'calendar-minus-o' => ['calendar-minus', 'far'],
2096  'calendar-o' => ['calendar', 'far'],
2097  'calendar-plus-o' => ['calendar-plus', 'far'],
2098  'calendar-times-o' => ['calendar-times', 'far'],
2099  'calendar' => ['calendar-alt', 'fas'],
2100  'caret-square-o-down' => ['caret-square-down', 'far'],
2101  'caret-square-o-left' => ['caret-square-left', 'far'],
2102  'caret-square-o-right' => ['caret-square-right', 'far'],
2103  'caret-square-o-up' => ['caret-square-up', 'far'],
2104  'cc' => ['closed-captioning', 'far'],
2105  'chain-broken' => ['unlink', 'fas'],
2106  'chain' => ['link', 'fas'],
2107  'check-circle-o' => ['check-circle', 'far'],
2108  'check-square-o' => ['check-square', 'far'],
2109  'circle-o-notch' => ['circle-notch', 'fas'],
2110  'circle-o' => ['circle', 'far'],
2111  'circle-thin' => ['circle', 'far'],
2112  'clock-o' => ['clock', 'far'],
2113  'close' => ['times', 'fas'],
2114  'cloud-download' => ['cloud-download-alt', 'fas'],
2115  'cloud-upload' => ['cloud-upload-alt', 'fas'],
2116  'cny' => ['yen-sign', 'fas'],
2117  'code-fork' => ['code-branch', 'fas'],
2118  'comment-o' => ['comment', 'far'],
2119  'commenting-o' => ['comment-alt', 'far'],
2120  'commenting' => ['comment-alt', 'fas'],
2121  'comments-o' => ['comments', 'far'],
2122  'credit-card-alt' => ['credit-card', 'fas'],
2123  'cutlery' => ['utensils', 'fas'],
2124  'dashboard' => ['tachometer-alt', 'fas'],
2125  'deafness' => ['deaf', 'fas'],
2126  'dedent' => ['outdent', 'fas'],
2127  'diamond' => ['gem', 'far'],
2128  'dollar' => ['dollar-sign', 'fas'],
2129  'dot-circle-o' => ['dot-circle', 'far'],
2130  'drivers-license-o' => ['id-card', 'far'],
2131  'drivers-license' => ['id-card', 'fas'],
2132  'eercast' => ['sellcast', 'fab'],
2133  'envelope-o' => ['envelope', 'far'],
2134  'envelope-open-o' => ['envelope-open', 'far'],
2135  'eur' => ['euro-sign', 'fas'],
2136  'euro' => ['euro-sign', 'fas'],
2137  'exchange' => ['exchange-alt', 'fas'],
2138  'external-link-square' => ['external-link-square-alt', 'fas'],
2139  'external-link' => ['external-link-alt', 'fas'],
2140  'eyedropper' => ['eye-dropper', 'fas'],
2141  'fa' => ['font-awesome', 'fab'],
2142  'facebook-f' => ['facebook-f', 'fab'],
2143  'facebook-official' => ['facebook', 'fab'],
2144  'facebook' => ['facebook-f', 'fab'],
2145  'feed' => ['rss', 'fas'],
2146  'file-archive-o' => ['file-archive', 'far'],
2147  'file-audio-o' => ['file-audio', 'far'],
2148  'file-code-o' => ['file-code', 'far'],
2149  'file-excel-o' => ['file-excel', 'far'],
2150  'file-image-o' => ['file-image', 'far'],
2151  'file-movie-o' => ['file-video', 'far'],
2152  'file-o' => ['file', 'far'],
2153  'file-pdf-o' => ['file-pdf', 'far'],
2154  'file-photo-o' => ['file-image', 'far'],
2155  'file-picture-o' => ['file-image', 'far'],
2156  'file-powerpoint-o' => ['file-powerpoint', 'far'],
2157  'file-sound-o' => ['file-audio', 'far'],
2158  'file-text-o' => ['file-alt', 'far'],
2159  'file-text' => ['file-alt', 'fas'],
2160  'file-video-o' => ['file-video', 'far'],
2161  'file-word-o' => ['file-word', 'far'],
2162  'file-zip-o' => ['file-archive', 'far'],
2163  'files-o' => ['copy', 'far'],
2164  'flag-o' => ['flag', 'far'],
2165  'flash' => ['bolt', 'fas'],
2166  'floppy-o' => ['save', 'far'],
2167  'folder-o' => ['folder', 'far'],
2168  'folder-open-o' => ['folder-open', 'far'],
2169  'frown-o' => ['frown', 'far'],
2170  'futbol-o' => ['futbol', 'far'],
2171  'gbp' => ['pound-sign', 'fas'],
2172  'ge' => ['empire', 'fab'],
2173  'gear' => ['cog', 'fas'],
2174  'gears' => ['cogs', 'fas'],
2175  'gittip' => ['gratipay', 'fab'],
2176  'glass' => ['glass-martini', 'fas'],
2177  'google-plus-circle' => ['google-plus', 'fab'],
2178  'google-plus-official' => ['google-plus', 'fab'],
2179  'google-plus' => ['google-plus-g', 'fab'],
2180  'group' => ['users', 'fas'],
2181  'hand-grab-o' => ['hand-rock', 'far'],
2182  'hand-lizard-o' => ['hand-lizard', 'far'],
2183  'hand-o-down' => ['hand-point-down', 'far'],
2184  'hand-o-left' => ['hand-point-left', 'far'],
2185  'hand-o-right' => ['hand-point-right', 'far'],
2186  'hand-o-up' => ['hand-point-up', 'far'],
2187  'hand-paper-o' => ['hand-paper', 'far'],
2188  'hand-peace-o' => ['hand-peace', 'far'],
2189  'hand-pointer-o' => ['hand-pointer', 'far'],
2190  'hand-rock-o' => ['hand-rock', 'far'],
2191  'hand-scissors-o' => ['hand-scissors', 'far'],
2192  'hand-spock-o' => ['hand-spock', 'far'],
2193  'hand-stop-o' => ['hand-paper', 'far'],
2194  'handshake-o' => ['handshake', 'far'],
2195  'hard-of-hearing' => ['deaf', 'fas'],
2196  'hdd-o' => ['hdd', 'far'],
2197  'header' => ['heading', 'fas'],
2198  'heart-o' => ['heart', 'far'],
2199  'hospital-o' => ['hospital', 'far'],
2200  'hotel' => ['bed', 'fas'],
2201  'hourglass-1' => ['hourglass-start', 'fas'],
2202  'hourglass-2' => ['hourglass-half', 'fas'],
2203  'hourglass-3' => ['hourglass-end', 'fas'],
2204  'hourglass-o' => ['hourglass', 'far'],
2205  'id-card-o' => ['id-card', 'far'],
2206  'ils' => ['shekel-sign', 'fas'],
2207  'image' => ['image', 'far'],
2208  'inr' => ['rupee-sign', 'fas'],
2209  'institution' => ['university', 'fas'],
2210  'intersex' => ['transgender', 'fas'],
2211  'jpy' => ['yen-sign', 'fas'],
2212  'keyboard-o' => ['keyboard', 'far'],
2213  'krw' => ['won-sign', 'fas'],
2214  'legal' => ['gavel', 'fas'],
2215  'lemon-o' => ['lemon', 'far'],
2216  'level-down' => ['level-down-alt', 'fas'],
2217  'level-up' => ['level-up-alt', 'fas'],
2218  'life-bouy' => ['life-ring', 'far'],
2219  'life-buoy' => ['life-ring', 'far'],
2220  'life-saver' => ['life-ring', 'far'],
2221  'lightbulb-o' => ['lightbulb', 'far'],
2222  'line-chart' => ['chart-line', 'fas'],
2223  'linkedin-square' => ['linkedin', 'fab'],
2224  'linkedin' => ['linkedin-in', 'fab'],
2225  'long-arrow-down' => ['long-arrow-alt-down', 'fas'],
2226  'long-arrow-left' => ['long-arrow-alt-left', 'fas'],
2227  'long-arrow-right' => ['long-arrow-alt-right', 'fas'],
2228  'long-arrow-up' => ['long-arrow-alt-up', 'fas'],
2229  'mail-forward' => ['share', 'fas'],
2230  'mail-reply-all' => ['reply-all', 'fas'],
2231  'mail-reply' => ['reply', 'fas'],
2232  'map-marker' => ['map-marker-alt', 'fas'],
2233  'map-o' => ['map', 'far'],
2234  'meanpath' => ['font-awesome', 'fab'],
2235  'meh-o' => ['meh', 'far'],
2236  'minus-square-o' => ['minus-square', 'far'],
2237  'mobile-phone' => ['mobile-alt', 'fas'],
2238  'mobile' => ['mobile-alt', 'fas'],
2239  'money' => ['money-bill-alt', 'far'],
2240  'moon-o' => ['moon', 'far'],
2241  'mortar-board' => ['graduation-cap', 'fas'],
2242  'navicon' => ['bars', 'fas'],
2243  'newspaper-o' => ['newspaper', 'far'],
2244  'paper-plane-o' => ['paper-plane', 'far'],
2245  'paste' => ['clipboard', 'far'],
2246  'pause-circle-o' => ['pause-circle', 'far'],
2247  'pencil-square-o' => ['edit', 'far'],
2248  'pencil-square' => ['pen-square', 'fas'],
2249  'pencil' => ['pencil-alt', 'fas'],
2250  'photo' => ['image', 'far'],
2251  'picture-o' => ['image', 'far'],
2252  'pie-chart' => ['chart-pie', 'fas'],
2253  'play-circle-o' => ['play-circle', 'far'],
2254  'plus-square-o' => ['plus-square', 'far'],
2255  'question-circle-o' => ['question-circle', 'far'],
2256  'ra' => ['rebel', 'fab'],
2257  'refresh' => ['sync', 'fas'],
2258  'remove' => ['times', 'fas'],
2259  'reorder' => ['bars', 'fas'],
2260  'repeat' => ['redo', 'fas'],
2261  'resistance' => ['rebel', 'fab'],
2262  'rmb' => ['yen-sign', 'fas'],
2263  'rotate-left' => ['undo', 'fas'],
2264  'rotate-right' => ['redo', 'fas'],
2265  'rouble' => ['ruble-sign', 'fas'],
2266  'rub' => ['ruble-sign', 'fas'],
2267  'ruble' => ['ruble-sign', 'fas'],
2268  'rupee' => ['rupee-sign', 'fas'],
2269  's15' => ['bath', 'fas'],
2270  'scissors' => ['cut', 'fas'],
2271  'send-o' => ['paper-plane', 'far'],
2272  'send' => ['paper-plane', 'fas'],
2273  'share-square-o' => ['share-square', 'far'],
2274  'shekel' => ['shekel-sign', 'fas'],
2275  'sheqel' => ['shekel-sign', 'fas'],
2276  'shield' => ['shield-alt', 'fas'],
2277  'sign-in' => ['sign-in-alt', 'fas'],
2278  'sign-out' => ['sign-out-alt', 'fas'],
2279  'signing' => ['sign-language', 'fas'],
2280  'sliders' => ['sliders-h', 'fas'],
2281  'smile-o' => ['smile', 'far'],
2282  'snowflake-o' => ['snowflake', 'far'],
2283  'soccer-ball-o' => ['futbol', 'far'],
2284  'sort-alpha-asc' => ['sort-alpha-down', 'fas'],
2285  'sort-alpha-desc' => ['sort-alpha-up', 'fas'],
2286  'sort-amount-asc' => ['sort-amount-down', 'fas'],
2287  'sort-amount-desc' => ['sort-amount-up', 'fas'],
2288  'sort-asc' => ['sort-up', 'fas'],
2289  'sort-desc' => ['sort-down', 'fas'],
2290  'sort-numeric-asc' => ['sort-numeric-down', 'fas'],
2291  'sort-numeric-desc' => ['sort-numeric-up', 'fas'],
2292  'spoon' => ['utensil-spoon', 'fas'],
2293  'square-o' => ['square', 'far'],
2294  'star-half-empty' => ['star-half', 'far'],
2295  'star-half-full' => ['star-half', 'far'],
2296  'star-half-o' => ['star-half', 'far'],
2297  'star-o' => ['star', 'far'],
2298  'sticky-note-o' => ['sticky-note', 'far'],
2299  'stop-circle-o' => ['stop-circle', 'far'],
2300  'sun-o' => ['sun', 'far'],
2301  'support' => ['life-ring', 'far'],
2302  'tablet' => ['tablet-alt', 'fas'],
2303  'tachometer' => ['tachometer-alt', 'fas'],
2304  'television' => ['tv', 'fas'],
2305  'thermometer-0' => ['thermometer-empty', 'fas'],
2306  'thermometer-1' => ['thermometer-quarter', 'fas'],
2307  'thermometer-2' => ['thermometer-half', 'fas'],
2308  'thermometer-3' => ['thermometer-three-quarters', 'fas'],
2309  'thermometer-4' => ['thermometer-full', 'fas'],
2310  'thermometer' => ['thermometer-full', 'fas'],
2311  'thumb-tack' => ['thumbtack', 'fas'],
2312  'thumbs-o-down' => ['thumbs-down', 'far'],
2313  'thumbs-o-up' => ['thumbs-up', 'far'],
2314  'ticket' => ['ticket-alt', 'fas'],
2315  'times-circle-o' => ['times-circle', 'far'],
2316  'times-rectangle-o' => ['window-close', 'far'],
2317  'times-rectangle' => ['window-close', 'fas'],
2318  'toggle-down' => ['caret-square-down', 'far'],
2319  'toggle-left' => ['caret-square-left', 'far'],
2320  'toggle-right' => ['caret-square-right', 'far'],
2321  'toggle-up' => ['caret-square-up', 'far'],
2322  'trash-o' => ['trash-alt', 'far'],
2323  'trash' => ['trash-alt', 'fas'],
2324  'try' => ['lira-sign', 'fas'],
2325  'turkish-lira' => ['lira-sign', 'fas'],
2326  'unsorted' => ['sort', 'fas'],
2327  'usd' => ['dollar-sign', 'fas'],
2328  'user-circle-o' => ['user-circle', 'far'],
2329  'user-o' => ['user', 'far'],
2330  'vcard-o' => ['address-card', 'far'],
2331  'vcard' => ['address-card', 'fas'],
2332  'video-camera' => ['video', 'fas'],
2333  'vimeo' => ['vimeo-v', 'fab'],
2334  'volume-control-phone' => ['phone-volume', 'fas'],
2335  'warning' => ['exclamation-triangle', 'fas'],
2336  'wechat' => ['weixin', 'fab'],
2337  'wheelchair-alt' => ['accessible-icon', 'fab'],
2338  'window-close-o' => ['window-close', 'far'],
2339  'won' => ['won-sign', 'fas'],
2340  'y-combinator-square' => ['hacker-news', 'fab'],
2341  'yc-square' => ['hacker-news', 'fab'],
2342  'yc' => ['y-combinator', 'fab'],
2343  'yen' => ['yen-sign', 'fas'],
2344  'youtube-play' => ['youtube', 'fab'],
2345  'youtube-square' => ['youtube', 'fab'],
2346  ];
2347 
2348  $brands = [
2349  '500px',
2350  'accessible-icon',
2351  'accusoft',
2352  'adn',
2353  'adversal',
2354  'affiliatetheme',
2355  'algolia',
2356  'amazon',
2357  'amazon-pay',
2358  'amilia',
2359  'android',
2360  'angellist',
2361  'angrycreative',
2362  'angular',
2363  'app-store',
2364  'app-store-ios',
2365  'apper',
2366  'apple',
2367  'apple-pay',
2368  'asymmetrik',
2369  'audible',
2370  'autoprefixer',
2371  'avianex',
2372  'aviato',
2373  'aws',
2374  'bandcamp',
2375  'behance',
2376  'behance-square',
2377  'bimobject',
2378  'bitbucket',
2379  'bitcoin',
2380  'bity',
2381  'black-tie',
2382  'blackberry',
2383  'blogger',
2384  'blogger-b',
2385  'bluetooth',
2386  'bluetooth-b',
2387  'btc',
2388  'buromobelexperte',
2389  'buysellads',
2390  'cc-amazon-pay',
2391  'cc-amex',
2392  'cc-apple-pay',
2393  'cc-diners-club',
2394  'cc-discover',
2395  'cc-jcb',
2396  'cc-mastercard',
2397  'cc-paypal',
2398  'cc-stripe',
2399  'cc-visa',
2400  'centercode',
2401  'chrome',
2402  'cloudscale',
2403  'cloudsmith',
2404  'cloudversify',
2405  'codepen',
2406  'codiepie',
2407  'connectdevelop',
2408  'contao',
2409  'cpanel',
2410  'creative-commons',
2411  'css3',
2412  'css3-alt',
2413  'cuttlefish',
2414  'd-and-d',
2415  'dashcube',
2416  'delicious',
2417  'deploydog',
2418  'deskpro',
2419  'deviantart',
2420  'digg',
2421  'digital-ocean',
2422  'discord',
2423  'discourse',
2424  'dochub',
2425  'docker',
2426  'draft2digital',
2427  'dribbble',
2428  'dribbble-square',
2429  'dropbox',
2430  'drupal',
2431  'dyalog',
2432  'earlybirds',
2433  'edge',
2434  'elementor',
2435  'ember',
2436  'empire',
2437  'envira',
2438  'erlang',
2439  'ethereum',
2440  'etsy',
2441  'expeditedssl',
2442  'facebook',
2443  'facebook-f',
2444  'facebook-messenger',
2445  'facebook-square',
2446  'firefox',
2447  'first-order',
2448  'firstdraft',
2449  'flickr',
2450  'flipboard',
2451  'fly',
2452  'font-awesome',
2453  'font-awesome-alt',
2454  'font-awesome-flag',
2455  'fonticons',
2456  'fonticons-fi',
2457  'fort-awesome',
2458  'fort-awesome-alt',
2459  'forumbee',
2460  'foursquare',
2461  'free-code-camp',
2462  'freebsd',
2463  'get-pocket',
2464  'gg',
2465  'gg-circle',
2466  'git',
2467  'git-square',
2468  'github',
2469  'github-alt',
2470  'github-square',
2471  'gitkraken',
2472  'gitlab',
2473  'gitter',
2474  'glide',
2475  'glide-g',
2476  'gofore',
2477  'goodreads',
2478  'goodreads-g',
2479  'google',
2480  'google-drive',
2481  'google-play',
2482  'google-plus',
2483  'google-plus-g',
2484  'google-plus-square',
2485  'google-wallet',
2486  'gratipay',
2487  'grav',
2488  'gripfire',
2489  'grunt',
2490  'gulp',
2491  'hacker-news',
2492  'hacker-news-square',
2493  'hips',
2494  'hire-a-helper',
2495  'hooli',
2496  'hotjar',
2497  'houzz',
2498  'html5',
2499  'hubspot',
2500  'imdb',
2501  'instagram',
2502  'internet-explorer',
2503  'ioxhost',
2504  'itunes',
2505  'itunes-note',
2506  'jenkins',
2507  'joget',
2508  'joomla',
2509  'js',
2510  'js-square',
2511  'jsfiddle',
2512  'keycdn',
2513  'kickstarter',
2514  'kickstarter-k',
2515  'korvue',
2516  'laravel',
2517  'lastfm',
2518  'lastfm-square',
2519  'leanpub',
2520  'less',
2521  'line',
2522  'linkedin',
2523  'linkedin-in',
2524  'linode',
2525  'linux',
2526  'lyft',
2527  'magento',
2528  'maxcdn',
2529  'medapps',
2530  'medium',
2531  'medium-m',
2532  'medrt',
2533  'meetup',
2534  'microsoft',
2535  'mix',
2536  'mixcloud',
2537  'mizuni',
2538  'modx',
2539  'monero',
2540  'napster',
2541  'nintendo-switch',
2542  'node',
2543  'node-js',
2544  'npm',
2545  'ns8',
2546  'nutritionix',
2547  'odnoklassniki',
2548  'odnoklassniki-square',
2549  'opencart',
2550  'openid',
2551  'opera',
2552  'optin-monster',
2553  'osi',
2554  'page4',
2555  'pagelines',
2556  'palfed',
2557  'patreon',
2558  'paypal',
2559  'periscope',
2560  'phabricator',
2561  'phoenix-framework',
2562  'php',
2563  'pied-piper',
2564  'pied-piper-alt',
2565  'pied-piper-pp',
2566  'pinterest',
2567  'pinterest-p',
2568  'pinterest-square',
2569  'playstation',
2570  'product-hunt',
2571  'pushed',
2572  'python',
2573  'qq',
2574  'quinscape',
2575  'quora',
2576  'ravelry',
2577  'react',
2578  'rebel',
2579  'red-river',
2580  'reddit',
2581  'reddit-alien',
2582  'reddit-square',
2583  'rendact',
2584  'renren',
2585  'replyd',
2586  'resolving',
2587  'rocketchat',
2588  'rockrms',
2589  'safari',
2590  'sass',
2591  'schlix',
2592  'scribd',
2593  'searchengin',
2594  'sellcast',
2595  'sellsy',
2596  'servicestack',
2597  'shirtsinbulk',
2598  'simplybuilt',
2599  'sistrix',
2600  'skyatlas',
2601  'skype',
2602  'slack',
2603  'slack-hash',
2604  'slideshare',
2605  'snapchat',
2606  'snapchat-ghost',
2607  'snapchat-square',
2608  'soundcloud',
2609  'speakap',
2610  'spotify',
2611  'stack-exchange',
2612  'stack-overflow',
2613  'staylinked',
2614  'steam',
2615  'steam-square',
2616  'steam-symbol',
2617  'sticker-mule',
2618  'strava',
2619  'stripe',
2620  'stripe-s',
2621  'studiovinari',
2622  'stumbleupon',
2623  'stumbleupon-circle',
2624  'superpowers',
2625  'supple',
2626  'telegram',
2627  'telegram-plane',
2628  'tencent-weibo',
2629  'themeisle',
2630  'trello',
2631  'tripadvisor',
2632  'tumblr',
2633  'tumblr-square',
2634  'twitch',
2635  'twitter',
2636  'twitter-square',
2637  'typo3',
2638  'uber',
2639  'uikit',
2640  'uniregistry',
2641  'untappd',
2642  'usb',
2643  'ussunnah',
2644  'vaadin',
2645  'viacoin',
2646  'viadeo',
2647  'viadeo-square',
2648  'viber',
2649  'vimeo',
2650  'vimeo-square',
2651  'vimeo-v',
2652  'vine',
2653  'vk',
2654  'vnv',
2655  'vuejs',
2656  'weibo',
2657  'weixin',
2658  'whatsapp',
2659  'whatsapp-square',
2660  'whmcs',
2661  'wikipedia-w',
2662  'windows',
2663  'wordpress',
2664  'wordpress-simple',
2665  'wpbeginner',
2666  'wpexplorer',
2667  'wpforms',
2668  'xbox',
2669  'xing',
2670  'xing-square',
2671  'y-combinator',
2672  'yahoo',
2673  'yandex',
2674  'yandex-international',
2675  'yelp',
2676  'yoast',
2677  'youtube',
2678  'youtube-square',
2679  ];
2680 
2681  foreach ($classes as $index => $c) {
2682  if ($c === 'fa') {
2683  // FontAwesome 5 deprecated the use of fa prefix in favour of fas, far and fab
2684  unset($classes[$index]);
2685  continue;
2686  }
2687 
2688  if (preg_match_all('/^elgg-icon-(.+)/i', $c)) {
2689  // convert
2690  $base_icon = preg_replace('/^elgg-icon-(.+)/i', '$1', $c);
2691 
2692  if ($map_sprites) {
2693  if (strpos($base_icon, '-hover') !== false) {
2694  $base_icon = str_replace('-hover', '', $base_icon);
2695  $classes[] = 'elgg-state';
2696  $classes[] = 'elgg-state-notice';
2697  }
2698 
2699  $base_icon = elgg_extract($base_icon, $legacy_sprites, $base_icon);
2700  }
2701 
2702  // map solid/regular/light iconnames to correct classes
2703  if (preg_match('/.*-solid$/', $base_icon)) {
2704  $base_icon = preg_replace('/(.*)-solid$/', '$1', $base_icon);
2705  $classes[] = 'fas';
2706  } elseif (preg_match('/.*-regular$/', $base_icon)) {
2707  $base_icon = preg_replace('/(.*)-regular$/', '$1', $base_icon);
2708  $classes[] = 'far';
2709  } elseif (preg_match('/.*-light$/', $base_icon)) {
2710  // currently light is only available in FontAwesome 5 Pro
2711  $base_icon = preg_replace('/(.*)-light$/', '$1', $base_icon);
2712  $classes[] = 'fal';
2713  } else {
2714  if (array_key_exists($base_icon, $fa5)) {
2715  $classes[] = $fa5[$base_icon][1];
2716  $base_icon = $fa5[$base_icon][0];
2717  } else if (in_array($base_icon, $brands)) {
2718  $classes[] = 'fab';
2719  } else {
2720  $classes[] = 'fas';
2721  }
2722  }
2723 
2724  $classes[] = "fa-{$base_icon}";
2725  }
2726  }
2727 
2728  $classes = array_unique($classes);
2729 
2730  return elgg_trigger_plugin_hook('classes', 'icon', null, $classes);
2731 }
$messages
Definition: admin.php:15
_elgg_views_amd($hook, $type, $content, $params)
Inserts module names into anonymous modules by handling the "simplecache:generate" and "cache:generat...
Definition: views.php:1679
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:205
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades...
Definition: views.php:1753
getType()
Get the type of the object.
getSubtype()
Get the entity subtype.
elgg_get_view_extensions($view)
Get the views (and priorities) that extend a view.
Definition: views.php:320
$action
Definition: full.php:111
elgg_unregister_ajax_view($view)
Unregister a view for ajax calls.
Definition: views.php:144
if(!$item instanceof ElggRiverItem) $object
Definition: responses.php:23
$context
Definition: add.php:8
if($view &&elgg_view_exists($view)) $label
Definition: field.php:26
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
$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:1395
_elgg_views_prepare_head($title)
Prepare the variables for the html head.
Definition: views.php:447
if(!$php_log) $post_max_size
Definition: php.php:11
elgg_view_entity_list($entities, array $vars=[])
Returns a rendered list of entities with pagination.
Definition: views.php:996
$annotation
Elgg default annotation view.
Definition: default.php:10
elgg_set_http_header($header, $replace=true)
Set a response HTTP header.
Definition: elgglib.php:57
$errors
Definition: pending.php:46
elgg_view_entity_annotations(\ElggEntity $entity, $full_view=true)
Display a plugin-specified rendered list of annotations for an entity.
Definition: views.php:1080
$footer
Wrap form footer.
Definition: footer.php:11
if(!$items) $item
Definition: delete.php:13
elgg_define_js($name, $config)
Defines a JS lib as an AMD module.
Definition: elgglib.php:119
elgg_view_resource($name, array $vars=[])
Render a resource view.
Definition: views.php:423
elgg_view_menu_item(\ElggMenuItem $item, array $vars=[])
Render a menu item (usually as a link)
Definition: views.php:794
autoregister_views($view_base, $folder, $ignored, $viewtype)
Auto-registers views from a location.
Definition: views.php:1619
$defaults
_elgg_map_icon_glyph_class(array $classes, $map_sprites=true)
Maps legacy sprite classes and FontAwesome 4 classes to FontAwesome 5 classes.
Definition: views.php:2015
get_current_language()
Get the current system/user language or "en".
Definition: languages.php:47
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
Definition: cache.php:113
elgg_does_viewtype_fallback($viewtype)
Checks if a viewtype falls back to default.
Definition: views.php:118
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
Definition: cache.php:141
if(!empty($title)&&!empty($icon_name)) if(!empty($title)) if(!empty($header)) if(!empty($body)) $contents
Definition: message.php:60
$size
Definition: remove.php:24
_elgg_view_may_be_altered($view, $path)
Is there a chance a plugin is altering this view?
Definition: views.php:1722
$full_view
Elgg comment view.
Definition: comment.php:10
getLinkClass()
Get the anchor classes as text.
$path
Definition: details.php:89
elgg_register_css($name, $url, $priority=null)
Register a CSS file for inclusion in the HTML head.
Definition: elgglib.php:207
$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:57
if($vars['name']&&$vars['default']!==false) $input_vars
Definition: checkboxes.php:98
if(!$count) $offset
Definition: pagination.php:26
$menu
Admin sidebar – just outputs the page menus.
Definition: sidebar.php:6
current_page_url()
Returns the current page&#39;s complete URL.
Definition: input.php:94
_elgg_is_valid_viewtype($viewtype)
Checks if $viewtype is a string suitable for use as a viewtype name.
Definition: views.php:91
elgg_view_tagcloud(array $options=[])
Create a tagcloud for viewing.
Definition: views.php:1493
elgg_prepend_css_urls($css, $path)
In CSS content, prepend a path to relative URLs.
Definition: views.php:337
elgg_list_views($viewtype= 'default')
List all views in a viewtype.
Definition: views.php:218
$type
Definition: delete.php:21
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Definition: elgglib.php:634
elgg_view_deprecated($view, array $vars, $suggestion, $version)
Display a view with a deprecation notice.
Definition: views.php:266
catch(LoginException $e) if($request->isXhr()) $output
Definition: login.php:56
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:106
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
_elgg_get_js_site_data()
Get the site data to be merged into "elgg" in elgg.js.
Definition: views.php:1845
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:1153
elgg_set_form_footer($footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
Definition: views.php:1331
$css
Definition: maintenance.php:16
$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:899
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
Definition: views.php:360
getSubtype()
Get the subtype of the object.
elgg_get_viewtype()
Return the current view type.
Definition: views.php:78
elgg_view_image_block($image, $body, $vars=[])
Wrapper function for the image block display pattern.
Definition: views.php:1177
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
Definition: views.php:156
_elgg_has_rss_link()
Should the RSS view of this URL be linked to?
Definition: views.php:1594
if(!elgg_view_exists("plugins/{$plugin_id}/settings")) $form_vars
elgg_view_menu($menu, array $vars=[])
Render a menu.
Definition: views.php:755
getConfirmText()
Get the confirm text.
Linear set of menu items collected from configuration and the "register" hook.
elgg_get_ini_setting_in_bytes($setting)
Returns a PHP INI setting in bytes.
Definition: elgglib.php:1243
_elgg_get_js_page_data()
Get the initial contents of "elgg" client side.
Definition: views.php:1869
Configuration exception.
elgg_load_css($name)
Load a CSS file for this page.
Definition: elgglib.php:234
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
Definition: elgglib.php:91
$id
River item delete action.
Definition: delete.php:6
if(!$owner||!$owner->canEdit()) if(!$owner->hasIcon('master')) if(!$owner->saveIconFromElggFile($owner->getIcon('master'), 'icon', $coords)) $view
Definition: crop.php:30
$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:1219
elgg_view_list_item($item, array $vars=[])
View an item in a list.
Definition: views.php:1523
_elgg_views_send_header_x_frame_options()
Sends X-Frame-Options header on page requests.
Definition: views.php:1691
$entity
Definition: reset.php:8
elgg_set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view.
Definition: views.php:190
$title
Definition: user.php:20
$help
Definition: field.php:27
elgg_view_river_item($item, array $vars=[])
Renders a human-readable representation of a river item.
Definition: views.php:1234
$language
Definition: useradd.php:17
if(!$entity instanceof ElggEntity) $time
Definition: time.php:21
elgg_view_form($action, $form_vars=[], $body_vars=[])
Definition: views.php:1318
_elgg_set_lightbox_config($hook, $type, $return, $params)
Set lightbox config.
Definition: views.php:1952
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_set_config($name, $value)
Set an Elgg configuration value.
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
Definition: elgglib.php:786
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
Definition: views.php:842
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
_elgg_normalize_content_layout_vars(array $vars=[])
Normalizes deprecated content layout $vars for use in default layout Helper function to assist plugin...
Definition: views.php:676
$classes
Definition: full.php:25
$user
Definition: ban.php:7
_elgg_views_prepare_favicon_links($hook, $type, $head_params, $params)
Add favicon link tags to HTML head.
Definition: views.php:519
$url
Definition: default.php:33
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Definition: elgglib.php:720
$image
Definition: image_block.php:25
elgg_get_context()
Get the current context.
Definition: pageowner.php:201
elgg_format_bytes($size, $precision=2)
Format bytes to a human readable format.
Definition: output.php:94
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:65
$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:133
_elgg_views_file_help_upload_limit(\Elgg\Hook $hook)
Add a help text to input/file about upload limit.
Definition: views.php:1979
elgg_get_tags(array $options=[])
Get popular tags and their frequencies.
Definition: tags.php:50
_elgg_views_preprocess_css($hook, $type, $content, $params)
Preprocesses CSS views sent by /cache URLs.
Definition: views.php:1663
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:60
$page_owner
Definition: add.php:15
elgg_extend_view($view, $view_extension, $priority=501)
Extends a view with another view.
Definition: views.php:293
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif(is_callable([$item, 'getType']))
Definition: item.php:39
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:1131
if(!$entity instanceof ElggEntity) $icon_sizes
Definition: default.php:21
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
Definition: summary.php:55
elgg_view_annotation_list($annotations, array $vars=[])
Returns a rendered list of annotations, plus pagination.
Definition: views.php:1046
elgg_get_filter_tabs($context=null, $selected=null, ElggUser $user=null, array $vars=[])
Returns default filter tabs (All, Mine, Friends) for the user.
Definition: navigation.php:494
_elgg_config()
Get the Elgg config service.
$value
Definition: debugging.php:7
elgg_get_version($human_readable=false)
Get the current Elgg version information.
Definition: elgglib.php:814
_elgg_views_minify($hook, $type, $content, $params)
Minifies simplecache CSS and JS views by handling the "simplecache:generate" hook.
Definition: views.php:1634
elgg_view_layout($layout_name, $vars=[])
Displays a layout with optional parameters.
Definition: views.php:593
elgg_is_simplecache_enabled()
Is simple cache enabled.
Definition: cache.php:151
elgg_load_js($name)
Load a JavaScript resource on this page.
Definition: elgglib.php:156
getType()
Returns the entity type.
$content
Set robots.txt action.
Definition: set_robots.php:6
elgg_view_icon($name, $vars=[])
View an icon glyph.
Definition: views.php:1552
$vars['type']
Definition: save.php:11
$location
Definition: default.php:42
_elgg_services()
Get the global service provider.
Definition: elgglib.php:1292
$upload_max_filesize
Definition: php.php:12
$filter
Layout body.
Definition: body.php:18
elgg_set_viewtype($viewtype= '')
Manually set the viewtype.
Definition: views.php:65
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:29
elgg_view_annotation(\ElggAnnotation $annotation, array $vars=[])
Returns a string of a rendered annotation.
Definition: views.php:940
elgg_unregister_external_view($view)
Unregister a view for ajax calls.
Definition: views.php:172
$index
Definition: gallery.php:47
elgg_unregister_rss_link()
Remove the RSS icon link and link element from the head.
Definition: views.php:1584
_elgg_view_under_viewtype($view, $vars, $viewtype)
Render a view while the global viewtype is temporarily changed.
Definition: views.php:1926
generate_action_token($timestamp)
Generate an action token.
Definition: actions.php:83
if(!($comment instanceof ElggComment)||!$comment->canEdit()) $body_vars
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
$version
Definition: version.php:14
_elgg_split_vars(array $vars=[], array $prefixes=null)
Split array of vars into subarrays based on property prefixes.
Definition: views.php:1353
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:1120
$menu_view
Definition: default.php:31
$subject
Definition: useradd.php:59
var elgg
Definition: elgglib.js:4
elgg_view_title($title, array $vars=[])
Renders a title.
Definition: views.php:1104
$priority
$views
Definition: item.php:17
getValues()
Get all the values for this menu item.
getHref()
Get the URL of the menu item.
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:1141
elgg_get_form_footer()
Returns currently set footer, or false if not in the form rendering stack.
Definition: views.php:1339
elgg_register_rss_link()
Include the RSS icon link and link element in the head.
Definition: views.php:1575
elgg_unextend_view($view, $view_extension)
Unextends a view.
Definition: views.php:306