Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
views.php
Go to the documentation of this file.
1 <?php
49 use Elgg\Menu\Menu;
51 
60 
73 function elgg_set_viewtype($viewtype = "") {
75 
76  $CURRENT_SYSTEM_VIEWTYPE = $viewtype;
77 
78  return true;
79 }
80 
94 function elgg_get_viewtype() {
96 
97  if (empty($CURRENT_SYSTEM_VIEWTYPE)) {
98  $CURRENT_SYSTEM_VIEWTYPE = _elgg_get_initial_viewtype();
99  }
100 
102 }
103 
112  global $CONFIG;
113 
114  $viewtype = get_input('view', '', false);
115  if (_elgg_is_valid_viewtype($viewtype)) {
116  return $viewtype;
117  }
118 
119  if (isset($CONFIG->view) && _elgg_is_valid_viewtype($CONFIG->view)) {
120  return $CONFIG->view;
121  }
122 
123  return 'default';
124 }
125 
132 function elgg_register_viewtype($viewtype) {
133  if (!isset($GLOBALS['_ELGG']->view_types) || !is_array($GLOBALS['_ELGG']->view_types)) {
134  $GLOBALS['_ELGG']->view_types = array();
135  }
136 
137  if (!in_array($viewtype, $GLOBALS['_ELGG']->view_types)) {
138  $GLOBALS['_ELGG']->view_types[] = $viewtype;
139  }
140 
141  return true;
142 }
143 
152 function elgg_is_registered_viewtype($viewtype) {
153  if (!isset($GLOBALS['_ELGG']->view_types) || !is_array($GLOBALS['_ELGG']->view_types)) {
154  return false;
155  }
156 
157  return in_array($viewtype, $GLOBALS['_ELGG']->view_types);
158 }
159 
160 
170 function _elgg_is_valid_viewtype($viewtype) {
171  if (!is_string($viewtype) || $viewtype === '') {
172  return false;
173  }
174 
175  if (preg_match('/\W/', $viewtype)) {
176  return false;
177  }
178 
179  return true;
180 }
181 
193 function elgg_register_viewtype_fallback($viewtype) {
194  _elgg_services()->views->registerViewtypeFallback($viewtype);
195 }
196 
205 function elgg_does_viewtype_fallback($viewtype) {
206  return _elgg_services()->views->doesViewtypeFallback($viewtype);
207 }
208 
222 }
223 
233 }
234 
243 function elgg_register_external_view($view, $cacheable = false) {
244  if (!isset($GLOBALS['_ELGG']->allowed_ajax_views)) {
245  $GLOBALS['_ELGG']->allowed_ajax_views = array();
246  }
247 
248  $GLOBALS['_ELGG']->allowed_ajax_views[$view] = true;
249 
250  if ($cacheable) {
251  _elgg_services()->views->registerCacheableView($view);
252  }
253 }
254 
263  if (isset($GLOBALS['_ELGG']->allowed_ajax_views[$view])) {
264  unset($GLOBALS['_ELGG']->allowed_ajax_views[$view]);
265  }
266 }
267 
284 function elgg_set_view_location($view, $location, $viewtype = '') {
285  _elgg_services()->views->setViewDir($view, $location, $viewtype);
286 }
287 
299 function elgg_view_exists($view, $viewtype = '', $recurse = true) {
300  return _elgg_services()->views->viewExists($view, $viewtype, $recurse);
301 }
302 
312 function elgg_list_views($viewtype = 'default') {
313  return _elgg_services()->views->listViews($viewtype);
314 }
315 
342 function elgg_view($view, $vars = array(), $ignore1 = false, $ignore2 = false, $viewtype = '') {
343  return _elgg_services()->views->renderView($view, $vars, $ignore1, $viewtype);
344 }
345 
359 function elgg_view_deprecated($view, array $vars, $suggestion, $version) {
360  return _elgg_services()->views->renderDeprecatedView($view, $vars, $suggestion, $version);
361 }
362 
386 function elgg_extend_view($view, $view_extension, $priority = 501) {
387  _elgg_services()->views->extendView($view, $view_extension, $priority);
388 }
389 
399 function elgg_unextend_view($view, $view_extension) {
400  return _elgg_services()->views->unextendView($view, $view_extension);
401 }
402 
415  return Minify_CSS_UriRewriter::prepend($css, $path);
416 }
417 
437 function elgg_view_page($title, $body, $page_shell = 'default', $vars = array()) {
438  $timer = _elgg_services()->timer;
439  if (!$timer->hasEnded(['build page'])) {
440  $timer->end(['build page']);
441  }
442  $timer->begin([__FUNCTION__]);
443 
444  $params = array();
445  $params['identifier'] = _elgg_services()->request->getFirstUrlSegment();
446  $params['segments'] = _elgg_services()->request->getUrlSegments();
447  array_shift($params['segments']);
448  $page_shell = elgg_trigger_plugin_hook('shell', 'page', $params, $page_shell);
449 
450 
451  $system_messages = _elgg_services()->systemMessages;
452 
453  $messages = null;
454  if ($system_messages->count()) {
455  $messages = $system_messages->dumpRegister();
456 
457  if (isset($messages['error'])) {
458  // always make sure error is the first type
459  $errors = array(
460  'error' => $messages['error']
461  );
462 
463  unset($messages['error']);
464  $messages = array_merge($errors, $messages);
465  }
466  }
467 
468  $vars['title'] = $title;
469  $vars['body'] = $body;
470  $vars['sysmessages'] = $messages;
471 
472  // head has keys 'title', 'metas', 'links'
473  $head_params = _elgg_views_prepare_head($title);
474 
475  $vars['head'] = elgg_trigger_plugin_hook('head', 'page', $vars, $head_params);
476 
477  $vars = elgg_trigger_plugin_hook('output:before', 'page', null, $vars);
478 
479  $output = elgg_view("page/$page_shell", $vars);
480 
481  $vars['page_shell'] = $page_shell;
482 
483  // Allow plugins to modify the output
484  $output = elgg_trigger_plugin_hook('output', 'page', $vars, $output);
485 
486  $timer->end([__FUNCTION__]);
487  return $output;
488 }
489 
500 function elgg_view_resource($name, array $vars = []) {
501  $view = "resources/$name";
502 
503  if (elgg_view_exists($view)) {
504  return _elgg_services()->views->renderView($view, $vars);
505  }
506 
507  if (elgg_get_viewtype() !== 'default' && elgg_view_exists($view, 'default')) {
508  return _elgg_services()->views->renderView($view, $vars, false, 'default');
509  }
510 
511  _elgg_services()->logger->error("The view $view is missing.");
512 
513  if (elgg_get_viewtype() === 'default') {
514  // only works for default viewtype
515  forward('', '404');
516  } else {
517  register_error(elgg_echo('error:404:content'));
518  forward('');
519  }
520 }
521 
530  $params = array(
531  'links' => array(),
532  'metas' => array(),
533  );
534 
535  if (empty($title)) {
536  $params['title'] = elgg_get_config('sitename');
537  } else {
538  $params['title'] = $title . ' : ' . elgg_get_config('sitename');
539  }
540 
541  $params['metas']['content-type'] = array(
542  'http-equiv' => 'Content-Type',
543  'content' => 'text/html; charset=utf-8',
544  );
545 
546  $params['metas']['description'] = array(
547  'name' => 'description',
548  'content' => elgg_get_config('sitedescription')
549  );
550 
551  // https://developer.chrome.com/multidevice/android/installtohomescreen
552  $params['metas']['viewport'] = array(
553  'name' => 'viewport',
554  'content' => 'width=device-width',
555  );
556  $params['metas']['mobile-web-app-capable'] = array(
557  'name' => 'mobile-web-app-capable',
558  'content' => 'yes',
559  );
560  $params['metas']['apple-mobile-web-app-capable'] = array(
561  'name' => 'apple-mobile-web-app-capable',
562  'content' => 'yes',
563  );
564 
565  // RSS feed link
566  if (_elgg_has_rss_link()) {
568  if (substr_count($url,'?')) {
569  $url .= "&view=rss";
570  } else {
571  $url .= "?view=rss";
572  }
573  $params['links']['rss'] = array(
574  'rel' => 'alternative',
575  'type' => 'application/rss+xml',
576  'title' => 'RSS',
577  'href' => elgg_format_url($url),
578  );
579  }
580 
581  return $params;
582 }
583 
584 
601 function _elgg_views_prepare_favicon_links($hook, $type, $head_params, $params) {
602 
603  $head_params['links']['apple-touch-icon'] = array(
604  'rel' => 'apple-touch-icon',
605  'href' => elgg_get_simplecache_url('favicon-128.png'),
606  );
607 
608  // favicons
609  $head_params['links']['icon-ico'] = array(
610  'rel' => 'icon',
611  'href' => elgg_get_simplecache_url('favicon.ico'),
612  );
613  $head_params['links']['icon-vector'] = array(
614  'rel' => 'icon',
615  'sizes' => '16x16 32x32 48x48 64x64 128x128',
616  'type' => 'image/svg+xml',
617  'href' => elgg_get_simplecache_url('favicon.svg'),
618  );
619  $head_params['links']['icon-16'] = array(
620  'rel' => 'icon',
621  'sizes' => '16x16',
622  'type' => 'image/png',
623  'href' => elgg_get_simplecache_url('favicon-16.png'),
624  );
625  $head_params['links']['icon-32'] = array(
626  'rel' => 'icon',
627  'sizes' => '32x32',
628  'type' => 'image/png',
629  'href' => elgg_get_simplecache_url('favicon-32.png'),
630  );
631  $head_params['links']['icon-64'] = array(
632  'rel' => 'icon',
633  'sizes' => '64x64',
634  'type' => 'image/png',
635  'href' => elgg_get_simplecache_url('favicon-64.png'),
636  );
637  $head_params['links']['icon-128'] = array(
638  'rel' => 'icon',
639  'sizes' => '128x128',
640  'type' => 'image/png',
641  'href' => elgg_get_simplecache_url('favicon-128.png'),
642  );
643 
644  return $head_params;
645 }
646 
679 function elgg_view_layout($layout_name, $vars = array()) {
680  $timer = _elgg_services()->timer;
681  if (!$timer->hasEnded(['build page'])) {
682  $timer->end(['build page']);
683  }
684  $timer->begin([__FUNCTION__]);
685 
686  $params = array();
687  $params['identifier'] = _elgg_services()->request->getFirstUrlSegment();
688  $params['segments'] = _elgg_services()->request->getUrlSegments();
689  array_shift($params['segments']);
690  $layout_name = elgg_trigger_plugin_hook('layout', 'page', $params, $layout_name);
691 
692  $param_array = $vars;
693 
694  $param_array['layout'] = $layout_name;
695 
696  $params = elgg_trigger_plugin_hook('output:before', 'layout', null, $param_array);
697 
698  if (elgg_view_exists("page/layouts/$layout_name")) {
699  $output = elgg_view("page/layouts/$layout_name", $params);
700  } else {
701  $output = elgg_view("page/layouts/default", $params);
702  }
703 
704  $output = elgg_trigger_plugin_hook('output:after', 'layout', $params, $output);
705 
706  $timer->end([__FUNCTION__]);
707  return $output;
708 }
709 
745 function elgg_view_menu($menu, array $vars = array()) {
746  if (is_string($menu)) {
747  $menu = _elgg_services()->menus->getMenu($menu, $vars);
748 
749  } elseif ($menu instanceof UnpreparedMenu) {
750  $menu = _elgg_services()->menus->prepareMenu($menu);
751  }
752 
753  if (!$menu instanceof Menu) {
754  throw new \InvalidArgumentException('$menu must be a menu name, a Menu, or UnpreparedMenu');
755  }
756 
757  $name = $menu->getName();
758 
759  if (elgg_view_exists("navigation/menu/$name")) {
760  return elgg_view("navigation/menu/$name", $menu->getParams());
761  } else {
762  return elgg_view("navigation/menu/default", $menu->getParams());
763  }
764 }
765 
774 function elgg_view_menu_item(\ElggMenuItem $item, array $vars = array()) {
775  if (!isset($vars['class'])) {
776  $vars['class'] = 'elgg-menu-content';
777  }
778 
779  $vars = array_merge($item->getValues(), $vars);
780 
781  if ($item->getLinkClass()) {
782  $vars['class'] .= ' ' . $item->getLinkClass();
783  }
784 
785  if ($item->getHref() === false || $item->getHref() === null) {
786  $text = $item->getText();
787 
788  // if contains elements, don't wrap
789  if (preg_match('~<[a-z]~', $text)) {
790  return $text;
791  } else {
792  return elgg_format_element('span', array('class' => 'elgg-non-link'), $text);
793  }
794  }
795 
796  if (!isset($vars['rel']) && !isset($vars['is_trusted'])) {
797  $vars['is_trusted'] = true;
798  }
799 
800  if ($item->getConfirmText()) {
801  $vars['confirm'] = $item->getConfirmText();
802  }
803 
804  return elgg_view('output/url', $vars);
805 }
806 
832 function elgg_view_entity(\ElggEntity $entity, array $vars = array(), $bypass = false, $debug = false) {
833 
834  // No point continuing if entity is null
835  if (!$entity || !($entity instanceof \ElggEntity)) {
836  return false;
837  }
838 
840 
841  $defaults = array(
842  'full_view' => true,
843  );
844 
845  $vars = array_merge($defaults, $vars);
846 
847  $vars['entity'] = $entity;
848 
849  $entity_type = $entity->getType();
850  $entity_subtype = $entity->getSubtype();
851  if (empty($entity_subtype)) {
852  $entity_subtype = 'default';
853  }
854 
855  $entity_views = array(
856  elgg_extract('item_view', $vars, ''),
857  "$entity_type/$entity_subtype",
858  "$entity_type/default",
859  );
860 
861  $contents = '';
862  foreach ($entity_views as $view) {
863  if (elgg_view_exists($view)) {
864  $contents = elgg_view($view, $vars, $bypass, $debug);
865  break;
866  }
867  }
868 
869  // Marcus Povey 20090616 : Speculative and low impact approach for fixing #964
870  if ($vars['full_view']) {
871  $annotations = elgg_view_entity_annotations($entity, $vars['full_view']);
872 
873  if ($annotations) {
875  }
876  }
877  return $contents;
878 }
879 
895 function elgg_view_entity_icon(\ElggEntity $entity, $size = 'medium', $vars = array()) {
896 
897  // No point continuing if entity is null
898  if (!$entity || !($entity instanceof \ElggEntity)) {
899  return false;
900  }
901 
902  $vars['entity'] = $entity;
903  $vars['size'] = $size;
904 
905  $entity_type = $entity->getType();
906 
907  $subtype = $entity->getSubtype();
908  if (empty($subtype)) {
909  $subtype = 'default';
910  }
911 
912  $contents = '';
913  if (elgg_view_exists("icon/$entity_type/$subtype")) {
914  $contents = elgg_view("icon/$entity_type/$subtype", $vars);
915  }
916  if (empty($contents)) {
917  $contents = elgg_view("icon/$entity_type/default", $vars);
918  }
919  if (empty($contents)) {
920  $contents = elgg_view("icon/default", $vars);
921  }
922 
923  return $contents;
924 }
925 
946 function elgg_view_annotation(\ElggAnnotation $annotation, array $vars = array(), $bypass = false, $debug = false) {
948 
949  $defaults = array(
950  'full_view' => true,
951  );
952 
953  $vars = array_merge($defaults, $vars);
954  $vars['annotation'] = $annotation;
955 
956  $name = $annotation->name;
957  if (empty($name)) {
958  return false;
959  }
960 
961  $annotation_views = array(
962  elgg_extract('item_view', $vars, ''),
963  "annotation/$name",
964  "annotation/default",
965  );
966 
967  $contents = '';
968  foreach ($annotation_views as $view) {
969  if (elgg_view_exists($view)) {
970  $contents = elgg_view($view, $vars, $bypass, $debug);
971  break;
972  }
973  }
974 
975  return $contents;
976 }
977 
1007 function elgg_view_entity_list($entities, array $vars = array()) {
1008  $offset = (int)get_input('offset', 0);
1009 
1010  // list type can be passed as request parameter
1011  $list_type = get_input('list_type', 'list');
1012 
1013  $defaults = array(
1014  'items' => $entities,
1015  'list_class' => 'elgg-list-entity',
1016  'full_view' => true,
1017  'pagination' => true,
1018  'list_type' => $list_type,
1019  'list_type_toggle' => false,
1020  'offset' => $offset,
1021  'limit' => null,
1022  );
1023 
1024  $vars = array_merge($defaults, $vars);
1025 
1026  if (!$vars["limit"] && !$vars["offset"]) {
1027  // no need for pagination if listing is unlimited
1028  $vars["pagination"] = false;
1029  }
1030 
1031  if ($vars['list_type'] != 'list') {
1032  return elgg_view('page/components/gallery', $vars);
1033  } else {
1034  return elgg_view('page/components/list', $vars);
1035  }
1036 }
1037 
1056 function elgg_view_annotation_list($annotations, array $vars = array()) {
1057  $defaults = array(
1058  'items' => $annotations,
1059  'offset' => null,
1060  'limit' => null,
1061  'list_class' => 'elgg-list-annotation elgg-annotation-list', // @todo remove elgg-annotation-list in Elgg 1.9
1062  'full_view' => true,
1063  'offset_key' => 'annoff',
1064  );
1065 
1066  $vars = array_merge($defaults, $vars);
1067 
1068  if (!$vars["limit"] && !$vars["offset"]) {
1069  // no need for pagination if listing is unlimited
1070  $vars["pagination"] = false;
1071  }
1072 
1073  return elgg_view('page/components/list', $vars);
1074 }
1075 
1091  if (!($entity instanceof \ElggEntity)) {
1092  return false;
1093  }
1094 
1095  $entity_type = $entity->getType();
1096 
1097  $annotations = elgg_trigger_plugin_hook('entity:annotate', $entity_type,
1098  array(
1099  'entity' => $entity,
1100  'full_view' => $full_view,
1101  )
1102  );
1103 
1104  return $annotations;
1105 }
1106 
1117 function elgg_view_title($title, array $vars = array()) {
1118  $vars['title'] = $title;
1119 
1120  return elgg_view('page/elements/title', $vars);
1121 }
1122 
1133 function elgg_view_friendly_time($time) {
1134  $view = 'output/friendlytime';
1135  $vars = ['time' => $time];
1136  $viewtype = elgg_view_exists($view) ? '' : 'default';
1137 
1138  return _elgg_view_under_viewtype($view, $vars, $viewtype);
1139 }
1140 
1154 function elgg_view_comments($entity, $add_comment = true, array $vars = array()) {
1155  if (!($entity instanceof \ElggEntity)) {
1156  return false;
1157  }
1158 
1159  $vars['entity'] = $entity;
1160  $vars['show_add_form'] = $add_comment;
1161  $vars['class'] = elgg_extract('class', $vars, "{$entity->getSubtype()}-comments");
1162 
1163  $output = elgg_trigger_plugin_hook('comments', $entity->getType(), $vars, false);
1164  if ($output !== false) {
1165  return $output;
1166  } else {
1167  return elgg_view('page/elements/comments', $vars);
1168  }
1169 }
1170 
1186 function elgg_view_image_block($image, $body, $vars = array()) {
1187  $vars['image'] = $image;
1188  $vars['body'] = $body;
1189  return elgg_view('page/components/image_block', $vars);
1190 }
1191 
1207 function elgg_view_module($type, $title, $body, array $vars = array()) {
1208  $vars['type'] = $type;
1209  $vars['title'] = $title;
1210  $vars['body'] = $body;
1211  return elgg_view('page/components/module', $vars);
1212 }
1213 
1222 function elgg_view_river_item($item, array $vars = array()) {
1223  if (!($item instanceof \ElggRiverItem)) {
1224  return '';
1225  }
1226  // checking default viewtype since some viewtypes do not have unique views per item (rss)
1227  $view = $item->getView();
1228  if (!$view || !elgg_view_exists($view, 'default')) {
1229  return '';
1230  }
1231 
1232  $subject = $item->getSubjectEntity();
1233  $object = $item->getObjectEntity();
1234  if (!$subject || !$object) {
1235  // subject is disabled or subject/object deleted
1236  return '';
1237  }
1238 
1239  // @todo this needs to be cleaned up
1240  // Don't hide objects in closed groups that a user can see.
1241  // see https://github.com/elgg/elgg/issues/4789
1242  // else {
1243  // // hide based on object's container
1244  // $visibility = \Elgg\GroupItemVisibility::factory($object->container_guid);
1245  // if ($visibility->shouldHideItems) {
1246  // return '';
1247  // }
1248  // }
1249 
1250  $vars['item'] = $item;
1251 
1252  $river_views = array(
1253  elgg_extract('item_view', $vars, ''),
1254  "river/item",
1255  );
1256 
1257  $contents = '';
1258  foreach ($river_views as $view) {
1259  if (elgg_view_exists($view)) {
1260  $contents = elgg_view($view, $vars);
1261  break;
1262  }
1263  }
1264 
1265  return $contents;
1266 }
1267 
1302 function elgg_view_form($action, $form_vars = array(), $body_vars = array()) {
1303  global $CONFIG;
1304 
1305  $defaults = array(
1306  'action' => $CONFIG->wwwroot . "action/$action",
1307  'body' => elgg_view("forms/$action", $body_vars)
1308  );
1309 
1310  // append elgg-form class to any class options set
1311  $form_vars['class'] = (array) elgg_extract('class', $form_vars, []);
1312  $form_vars['class'][] = 'elgg-form-' . preg_replace('/[^a-z0-9]/i', '-', $action);
1313 
1314  $form_vars = array_merge($defaults, $form_vars);
1315  $form_vars['action_name'] = $action;
1316 
1317  return elgg_view('input/form', $form_vars);
1318 }
1319 
1332 function elgg_view_input($input_type, array $vars = array()) {
1333 
1334  if (!elgg_view_exists("input/$input_type")) {
1335  return '';
1336  }
1337 
1338  if ($input_type == 'hidden') {
1339  return elgg_view("input/$input_type", $vars);
1340  }
1341 
1342  $id = elgg_extract('id', $vars);
1343  if (!$id) {
1344  $id = "elgg-field-" . base_convert(mt_rand(), 10, 36);
1345  $vars['id'] = $id;
1346  }
1347 
1348  $vars['input_type'] = $input_type;
1349 
1350  $label = elgg_view('elements/forms/label', $vars);
1351  if ($input_type == 'checkbox') {
1352  $vars['label'] = $label;
1353  $vars['label_tag'] = 'div';
1354  $label = false;
1355  } else {
1356  unset($vars['label']);
1357  }
1358 
1359  $help = elgg_view('elements/forms/help', $vars);
1360  unset($vars['help']);
1361 
1362  $required = elgg_extract('required', $vars);
1363 
1364  $field_class = (array) elgg_extract('field_class', $vars, array());
1365  unset($vars['field_class']);
1366 
1367  $input = elgg_view("elements/forms/input", $vars);
1368 
1369  return elgg_view('elements/forms/field', array(
1370  'label' => $label,
1371  'help' => $help,
1372  'required' => $required,
1373  'id' => $id,
1374  'input' => $input,
1375  'class' => $field_class,
1376  'input_type' => $input_type,
1377  ));
1378 }
1379 
1394 function elgg_view_tagcloud(array $options = array()) {
1395 
1396  $type = $subtype = '';
1397  if (isset($options['type'])) {
1398  $type = $options['type'];
1399  }
1400  if (isset($options['subtype'])) {
1401  $subtype = $options['subtype'];
1402  }
1403 
1404  $tag_data = elgg_get_tags($options);
1405  return elgg_view("output/tagcloud", array(
1406  'value' => $tag_data,
1407  'type' => $type,
1408  'subtype' => $subtype,
1409  ));
1410 }
1411 
1422 function elgg_view_list_item($item, array $vars = array()) {
1423 
1424  if ($item instanceof \ElggEntity) {
1425  return elgg_view_entity($item, $vars);
1426  } else if ($item instanceof \ElggAnnotation) {
1427  return elgg_view_annotation($item, $vars);
1428  } else if ($item instanceof \ElggRiverItem) {
1429  return elgg_view_river_item($item, $vars);
1430  }
1431 
1432  return '';
1433 }
1434 
1447 function elgg_view_icon($name, $vars = array()) {
1448  if (empty($vars)) {
1449  $vars = array();
1450  }
1451 
1452  if ($vars === true) {
1453  elgg_deprecated_notice("Using a boolean to float the icon is deprecated. Use the class float.", 1.9);
1454  $vars = array('class' => 'float');
1455  }
1456 
1457  if (is_string($vars)) {
1458  $vars = array('class' => $vars);
1459  }
1460 
1461  if (!is_array($vars)) {
1462  throw new \InvalidArgumentException('$vars needs to be a string or an array');
1463  }
1464 
1465  if (!array_key_exists('class', $vars)) {
1466  $vars['class'] = array();
1467  }
1468 
1469  if (!is_array($vars['class'])) {
1470  $vars['class'] = array($vars['class']);
1471  }
1472 
1473  $vars['class'][] = "elgg-icon-$name";
1474 
1475  return elgg_view("output/icon", $vars);
1476 }
1477 
1484  _elgg_services()->config->set('_elgg_autofeed', true);
1485 }
1486 
1493  _elgg_services()->config->set('_elgg_autofeed', false);
1494 }
1495 
1503  if (isset($GLOBALS['autofeed']) && is_bool($GLOBALS['autofeed'])) {
1504  elgg_deprecated_notice('Do not set the global $autofeed. Use elgg_register_rss_link()', '2.1');
1505  return $GLOBALS['autofeed'];
1506  }
1507  return (bool)_elgg_services()->config->getVolatile('_elgg_autofeed');
1508 }
1509 
1520  if ($collections = get_user_access_collections($owner_guid)) {
1522  if ($user) {
1523  $entities = $user->getFriends(array('limit' => 0));
1524  } else {
1525  $entities = array();
1526  }
1527 
1528  foreach ($collections as $key => $collection) {
1529  $collections[$key]->members = get_members_of_access_collection($collection->id, true);
1530  $collections[$key]->entities = $entities;
1531  }
1532  }
1533 
1534  return elgg_view('core/friends/collections', array('collections' => $collections));
1535 }
1536 
1554 function autoregister_views($view_base, $folder, $ignored, $viewtype) {
1555  return _elgg_services()->views->autoregisterViews($view_base, $folder, $viewtype);
1556 }
1557 
1570  if (preg_match('~[\.-]min\.~', $params['view'])) {
1571  // bypass minification
1572  return;
1573  }
1574 
1575  if ($type == 'js') {
1576  if (elgg_get_config('simplecache_minify_js')) {
1577  return JSMin::minify($content);
1578  }
1579  } elseif ($type == 'css') {
1580  if (elgg_get_config('simplecache_minify_css')) {
1581  $cssmin = new CSSmin();
1582  return $cssmin->run($content);
1583  }
1584  }
1585 }
1586 
1587 
1600  $filter = new \Elgg\Amd\ViewFilter();
1601  return $filter->filter($params['view'], $content);
1602 }
1603 
1611  if (_elgg_has_rss_link()) {
1612  $url = current_page_url();
1613  if (substr_count($url, '?')) {
1614  $url .= "&view=rss";
1615  } else {
1616  $url .= "?view=rss";
1617  }
1618 
1620  elgg_register_menu_item('extras', array(
1621  'name' => 'rss',
1622  'text' => elgg_view_icon('rss'),
1623  'href' => $url,
1624  'title' => elgg_echo('feed:rss'),
1625  ));
1626  }
1627 }
1628 
1635  header('X-Frame-Options: SAMEORIGIN');
1636 }
1637 
1666  $views = _elgg_services()->views;
1667 
1668  if ($views->viewIsExtended($view) || $views->viewHasHookHandlers($view)) {
1669  return true;
1670  }
1671 
1672  $viewtype = elgg_get_viewtype();
1673 
1674  // check location
1675  if (0 === strpos($path, '/') || preg_match('~^([A-Za-z]\:)?\\\\~', $path)) {
1676  // absolute path
1677  $expected_path = $path;
1678  } else {
1679  // relative path
1680  $root = dirname(dirname(__DIR__));
1681  $expected_path = "$root/views/$viewtype/" . ltrim($path, '/\\');
1682  }
1683 
1684  $view_path = $views->findViewFile($view, $viewtype);
1685 
1686  return realpath($view_path) !== realpath($expected_path);
1687 }
1688 
1697 function elgg_views_boot() {
1698  global $CONFIG;
1699 
1700  if (!elgg_get_config('system_cache_loaded')) {
1701  // Core view files in /views
1702  _elgg_services()->views->registerPluginViews(realpath(__DIR__ . '/../../'));
1703 
1704  // Core view definitions in /engine/views.php
1705  $file = dirname(__DIR__) . '/views.php';
1706  if (is_file($file)) {
1707  $spec = (include $file);
1708  if (is_array($spec)) {
1709  _elgg_services()->views->mergeViewsSpec($spec);
1710  }
1711  }
1712  }
1713 
1714  // on every page
1715 
1716  // jQuery and UI must come before require. See #9024
1717  elgg_register_js('jquery', elgg_get_simplecache_url('jquery.js'), 'head');
1718  elgg_load_js('jquery');
1719 
1720  elgg_register_js('jquery-ui', elgg_get_simplecache_url('jquery-ui.js'), 'head');
1721  elgg_load_js('jquery-ui');
1722 
1723  elgg_register_js('elgg.require_config', elgg_get_simplecache_url('elgg/require_config.js'), 'head');
1724  elgg_load_js('elgg.require_config');
1725 
1726  elgg_register_js('require', elgg_get_simplecache_url('require.js'), 'head');
1727  elgg_load_js('require');
1728 
1729  elgg_register_js('elgg', elgg_get_simplecache_url('elgg.js'), 'head');
1730  elgg_load_js('elgg');
1731 
1732  elgg_register_css('font-awesome', elgg_get_simplecache_url('font-awesome/css/font-awesome.css'));
1733  elgg_load_css('font-awesome');
1734 
1735  elgg_register_css('elgg', elgg_get_simplecache_url('elgg.css'));
1736  elgg_load_css('elgg');
1737 
1738  elgg_register_simplecache_view('elgg/init.js');
1739 
1740  elgg_register_css('lightbox', elgg_get_simplecache_url('lightbox/elgg-colorbox-theme/colorbox.css'));
1741  elgg_load_css('lightbox');
1742 
1743  // provide warning to use elgg/lightbox AMD
1744  elgg_register_js('lightbox', elgg_get_simplecache_url('lightbox.js'));
1745 
1746  // just provides warning to use elgg/autocomplete AMD
1747  elgg_register_js('elgg.autocomplete', elgg_normalize_url('js/lib/ui.autocomplete.js'));
1748 
1749  elgg_define_js('jquery.ui.autocomplete.html', [
1750  'deps' => ['jquery-ui'],
1751  ]);
1752 
1753  elgg_register_js('elgg.friendspicker', elgg_get_simplecache_url('elgg/ui.friends_picker.js'));
1754  elgg_register_js('elgg.avatar_cropper', elgg_get_simplecache_url('elgg/ui.avatar_cropper.js'));
1755 
1756  // @deprecated 2.2
1757  elgg_register_js('elgg.ui.river', elgg_get_simplecache_url('elgg/ui.river.js'));
1758 
1759  elgg_register_js('jquery.imgareaselect', elgg_get_simplecache_url('jquery.imgareaselect.js'));
1760  elgg_register_css('jquery.imgareaselect', elgg_get_simplecache_url('jquery.imgareaselect.css'));
1761 
1762  elgg_register_ajax_view('languages.js');
1763 
1764  elgg_register_plugin_hook_handler('simplecache:generate', 'js', '_elgg_views_amd');
1765  elgg_register_plugin_hook_handler('simplecache:generate', 'css', '_elgg_views_minify');
1766  elgg_register_plugin_hook_handler('simplecache:generate', 'js', '_elgg_views_minify');
1767 
1768  elgg_register_plugin_hook_handler('output:before', 'layout', 'elgg_views_add_rss_link');
1769  elgg_register_plugin_hook_handler('output:before', 'page', '_elgg_views_send_header_x_frame_options');
1770 
1771  // registered with high priority for BC
1772  // prior to 2.2 registration used to take place in _elgg_views_prepare_head() before the hook was triggered
1773  elgg_register_plugin_hook_handler('head', 'page', '_elgg_views_prepare_favicon_links', 1);
1774 
1775  // @todo the cache is loaded in load_plugins() but we need to know viewtypes earlier
1776  $view_path = $GLOBALS['_ELGG']->view_path;
1777  $viewtype_dirs = scandir($view_path);
1778  foreach ($viewtype_dirs as $viewtype) {
1779  if (_elgg_is_valid_viewtype($viewtype) && is_dir($view_path . $viewtype)) {
1780  elgg_register_viewtype($viewtype);
1781  }
1782  }
1783 
1784  // set default icon sizes - can be overridden in settings.php or with plugin
1785  if (!isset($CONFIG->icon_sizes)) {
1786  $icon_sizes = array(
1787  'topbar' => array('w' => 16, 'h' => 16, 'square' => true, 'upscale' => true),
1788  'tiny' => array('w' => 25, 'h' => 25, 'square' => true, 'upscale' => true),
1789  'small' => array('w' => 40, 'h' => 40, 'square' => true, 'upscale' => true),
1790  'medium' => array('w' => 100, 'h' => 100, 'square' => true, 'upscale' => true),
1791  'large' => array('w' => 200, 'h' => 200, 'square' => false, 'upscale' => false),
1792  'master' => array('w' => 550, 'h' => 550, 'square' => false, 'upscale' => false),
1793  );
1794  elgg_set_config('icon_sizes', $icon_sizes);
1795  }
1796 }
1797 
1816  global $CONFIG;
1817 
1818  static $allow_delay_pagesetup = true;
1819 
1820  if (isset($GLOBALS['_ELGG']->pagesetupdone) || empty($CONFIG->boot_complete)) {
1821  return;
1822  }
1823 
1824  // only first rendering gets an opportunity to delay
1825  $allow_delay = $allow_delay_pagesetup;
1826  $allow_delay_pagesetup = false;
1827 
1828  if ($allow_delay && (0 === strpos($view, 'resources/'))) {
1829  return;
1830  }
1831 
1832  $GLOBALS['_ELGG']->pagesetupdone = true;
1833 
1834  // don't call this anymore
1835  _elgg_services()->hooks->unregisterHandler('view_vars', 'all', '_elgg_manage_pagesetup');
1836 
1837  _elgg_services()->events->trigger('pagesetup', 'system');
1838 }
1839 
1849  $language = elgg_get_config('language');
1850  if (!$language) {
1851  $language = 'en';
1852  }
1853 
1854  return [
1855  'elgg.data' => (object)elgg_trigger_plugin_hook('elgg.data', 'site', null, []),
1856  'elgg.version' => elgg_get_version(),
1857  'elgg.release' => elgg_get_version(true),
1858  'elgg.config.wwwroot' => elgg_get_site_url(),
1859 
1860  // refresh token 3 times during its lifetime (in microseconds 1000 * 1/3)
1861  'elgg.security.interval' => (int)_elgg_services()->actions->getActionTokenTimeout() * 333,
1862  'elgg.config.language' => $language,
1863  ];
1864 }
1865 
1873  $data = elgg_trigger_plugin_hook('elgg.data', 'page', null, []);
1874  if (!is_array($data)) {
1875  elgg_log('"elgg.data" plugin hook handlers must return an array. Returned ' . gettype($data) . '.', 'ERROR');
1876  $data = [];
1877  }
1878 
1879  $elgg = array(
1880  'config' => array(
1881  'lastcache' => (int) elgg_get_config('lastcache'),
1882  'viewtype' => elgg_get_viewtype(),
1883  'simplecache_enabled' => (int) elgg_is_simplecache_enabled(),
1884  ),
1885  'security' => array(
1886  'token' => array(
1887  '__elgg_ts' => $ts = time(),
1888  '__elgg_token' => generate_action_token($ts),
1889  ),
1890  ),
1891  'session' => array(
1892  'user' => null,
1893  'token' => _elgg_services()->session->get('__elgg_session'),
1894  ),
1895  '_data' => (object) $data,
1896  );
1897 
1898  if (elgg_get_config('elgg_load_sync_code')) {
1899  $elgg['config']['load_sync_code'] = true;
1900  }
1901 
1903  if ($page_owner instanceof ElggEntity) {
1904  $elgg['page_owner'] = $page_owner->toObject();
1905  }
1906 
1908  if ($user instanceof ElggUser) {
1909  $user_object = $user->toObject();
1910  $user_object->admin = $user->isAdmin();
1911  $elgg['session']['user'] = $user_object;
1912  }
1913 
1914  return $elgg;
1915 }
1916 
1928 function _elgg_view_under_viewtype($view, $vars, $viewtype) {
1929  if ($viewtype) {
1930  $old = elgg_get_viewtype();
1931  elgg_set_viewtype($viewtype);
1932  }
1933 
1934  $ret = elgg_view($view, $vars);
1935 
1936  if ($viewtype) {
1937  elgg_set_viewtype($old);
1938  }
1939 
1940  return $ret;
1941 }
1942 
1943 return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
1944  $events->registerHandler('boot', 'system', 'elgg_views_boot');
1945  $hooks->registerHandler('view_vars', 'all', '_elgg_manage_pagesetup', 1000);
1946 };
_elgg_get_initial_viewtype()
Get the initial viewtype.
Definition: views.php:111
$icon_sizes
Definition: default.php:18
$messages
Definition: admin.php:27
_elgg_views_amd($hook, $type, $content, $params)
Inserts module names into anonymous modules by handling the "simplecache:generate" hook...
Definition: views.php:1599
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:299
$object
These two snippets demonstrates triggering an event and how to register for that event.
Definition: trigger.php:7
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades...
Definition: views.php:1697
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
$view
Definition: crop.php:34
elgg_view_icon($name, $vars=array())
View one of the icons.
Definition: views.php:1447
getSubtype()
Get the entity subtype.
$action
Definition: full.php:125
elgg_unregister_ajax_view($view)
Unregister a view for ajax calls.
Definition: views.php:231
if(!array_key_exists($filename, $text_files)) $file
elgg_get_tags(array $options=array())
Get popular tags and their frequencies.
Definition: tags.php:78
$subject
Definition: exceptions.php:25
_elgg_views_prepare_head($title)
Prepare the variables for the html head.
Definition: views.php:529
global $CURRENT_SYSTEM_VIEWTYPE
The viewtype override.
Definition: views.php:58
$annotation
Elgg default annotation view.
Definition: default.php:10
elgg_view_access_collections($owner_guid)
Displays a user's access collections, using the core/friends/collections view.
Definition: views.php:1519
elgg_view_annotation(\ElggAnnotation $annotation, array $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered annotation.
Definition: views.php:946
elgg_view_entity_annotations(\ElggEntity $entity, $full_view=true)
Display a plugin-specified rendered list of annotations for an entity.
Definition: views.php:1090
elgg_normalize_url($url)
Definition: output.php:290
if($guid==elgg_get_logged_in_user_guid()) $name
Definition: delete.php:21
elgg_define_js($name, $config)
Defines a JS lib as an AMD module.
Definition: elgglib.php:171
if($footer) $contents
Definition: module.php:44
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_form($action, $form_vars=array(), $body_vars=array())
Definition: views.php:1302
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $input
Definition: edit.php:19
elgg_view_resource($name, array $vars=[])
Render a resource view.
Definition: views.php:500
autoregister_views($view_base, $folder, $ignored, $viewtype)
Auto-registers views from a location.
Definition: views.php:1554
$defaults
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
Definition: cache.php:108
elgg_does_viewtype_fallback($viewtype)
Checks if a viewtype falls back to default.
Definition: views.php:205
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
Definition: cache.php:136
elgg_views_add_rss_link()
Add the RSS link to the extras when if needed.
Definition: views.php:1610
_elgg_view_may_be_altered($view, $path)
Is there a chance a plugin is altering this view?
Definition: views.php:1665
$data
Definition: opendd.php:13
$full_view
Elgg comment view.
Definition: comment.php:9
getLinkClass()
Get the anchor classes as text.
$path
Definition: details.php:88
$value
Definition: longtext.php:26
elgg_register_css($name, $url, $priority=null)
Register a CSS file for inclusion in the HTML head.
Definition: elgglib.php:259
$subtype
Definition: delete.php:28
if(!$count) $offset
Definition: pagination.php:26
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:679
elgg_is_registered_viewtype($viewtype)
Checks if $viewtype is registered.
Definition: views.php:152
current_page_url()
Returns the current page's complete URL.
Definition: input.php:65
$collection
_elgg_is_valid_viewtype($viewtype)
Checks if $viewtype is a string suitable for use as a viewtype name.
Definition: views.php:170
elgg_prepend_css_urls($css, $path)
In CSS content, prepend a path to relative URLs.
Definition: views.php:414
elgg_list_views($viewtype= 'default')
List all views in a viewtype.
Definition: views.php:312
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Definition: elgglib.php:715
elgg_view_deprecated($view, array $vars, $suggestion, $version)
Display a view with a deprecation notice.
Definition: views.php:359
elgg_register_viewtype_fallback($viewtype)
Register a viewtype to fall back to a default view if a view isn't found for that viewtype...
Definition: views.php:193
get_members_of_access_collection($collection_id, $guids_only=false)
Get all of members of an access collection.
Definition: access.php:416
elgg_view_river_item($item, array $vars=array())
Renders a human-readable representation of a river item.
Definition: views.php:1222
_elgg_get_js_site_data()
Get the site data to be merged into "elgg" in elgg.js.
Definition: views.php:1848
$url
Definition: exceptions.php:24
$vars['entity']
elgg_view_tagcloud(array $options=array())
Create a tagcloud for viewing.
Definition: views.php:1394
$title
Definition: save.php:22
$css
Definition: maintenance.php:16
$options
Elgg admin footer.
Definition: footer.php:6
elgg_format_element($tag_name, array $attributes=array(), $text= '', array $options=array())
Format an HTML element.
Definition: output.php:218
register_error($error)
Display an error on next page load.
Definition: elgglib.php:452
elgg_get_viewtype()
Return the current view type.
Definition: views.php:94
$params
Definition: login.php:72
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
Definition: views.php:243
$text
Definition: default.php:25
_elgg_has_rss_link()
Should the RSS view of this URL be linked to?
Definition: views.php:1502
$_ELGG view_types
A list of valid view types as discovered.
Definition: config.php:349
elgg_view_input($input_type, array $vars=array())
Renders a form field.
Definition: views.php:1332
$owner_guid
getConfirmText()
Get the confirm text.
Linear set of menu items collected from configuration and the "register" hook.
get_user_access_collections($owner_guid, $site_guid=0)
Returns an array of database row objects of the access collections owned by $owner_guid.
Definition: access.php:403
_elgg_get_js_page_data()
Get the initial contents of "elgg" client side.
Definition: views.php:1872
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
Definition: views.php:1186
elgg_load_css($name)
Load a CSS file for this page.
Definition: elgglib.php:286
elgg_view_list_item($item, array $vars=array())
View an item in a list.
Definition: views.php:1422
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
Definition: elgglib.php:143
generate_action_token($timestamp)
Generate an action token.
Definition: actions.php:166
$input_type
Helper view that can be used to filter vars for all input views.
Definition: input.php:6
elgg_view_comments($entity, $add_comment=true, array $vars=array())
Returns rendered comments and a comment form for an entity.
Definition: views.php:1154
_elgg_views_send_header_x_frame_options()
Sends X-Frame-Options header on page requests.
Definition: views.php:1634
elgg_set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view.
Definition: views.php:284
$key
Definition: summary.php:34
get_user($guid)
Get a user object from a GUID.
Definition: users.php:87
$language
Definition: useradd.php:20
elgg_view_entity(\ElggEntity $entity, array $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered entity.
Definition: views.php:832
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.
$item
Definition: item.php:12
global $CONFIG
if(!$vars['title']&&$vars['title']!==false) if(isset($vars['filter_override'])) if(!isset($vars['filter'])&&elgg_is_logged_in()&&$context) $filter
Definition: content.php:62
$user
Definition: ban.php:13
elgg_set_viewtype($viewtype="")
Manually set the viewtype.
Definition: views.php:73
$body_vars
$annotations
Definition: entity.php:20
_elgg_views_prepare_favicon_links($hook, $type, $head_params, $params)
Add favicon link tags to HTML head.
Definition: views.php:601
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Definition: elgglib.php:801
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1070
elgg_get_site_url($site_guid=0)
Get the URL for the current (or specified) site.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:56
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
Definition: views.php:220
$help
Definition: field.php:18
elgg_view_menu_item(\ElggMenuItem $item, array $vars=array())
Render a menu item (usually as a link)
Definition: views.php:774
$page_owner
Definition: add.php:25
elgg_extend_view($view, $view_extension, $priority=501)
Extends a view with another view.
Definition: views.php:386
if(!elgg_instanceof($comment, 'object', 'comment')||!$comment->canEdit()) $form_vars
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
Definition: autoloader.php:17
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:1310
elgg_view_module($type, $title, $body, array $vars=array())
Wrapper function for the module display pattern.
Definition: views.php:1207
getText()
Get the display text of the menu item.
elgg_log($message, $level= 'NOTICE')
Display or log a message.
Definition: elgglib.php:1000
elgg_view_entity_list($entities, array $vars=array())
Returns a rendered list of entities with pagination.
Definition: views.php:1007
elgg_view_menu($menu, array $vars=array())
Render a menu.
Definition: views.php:745
$size
Definition: default.php:20
forward($location="", $reason= 'system')
Forward to $location.
Definition: elgglib.php:93
elgg_get_version($human_readable=false)
Get the current Elgg version information.
Definition: elgglib.php:1043
_elgg_views_minify($hook, $type, $content, $params)
Minifies simplecache CSS and JS views by handling the "simplecache:generate" hook.
Definition: views.php:1569
elgg_is_simplecache_enabled()
Is simple cache enabled.
Definition: cache.php:146
$label
Elgg profile plugin edit default profile action.
Definition: add.php:7
elgg_load_js($name)
Load a JavaScript resource on this page.
Definition: elgglib.php:208
getType()
Returns the entity type.
$content
Set robots.txt action.
Definition: set_robots.php:6
$required
Definition: label.php:12
_elgg_manage_pagesetup($hook, $view, $value, $params)
Handle triggering the pagesetup event at the right time.
Definition: views.php:1815
$entity
Definition: delete.php:7
$field_class
Definition: field.php:20
elgg_format_url($url)
Handles formatting of ampersands in urls.
Definition: output.php:91
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
Definition: views.php:895
elgg_register_viewtype($viewtype)
Register a viewtype.
Definition: views.php:132
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:32
$menu
Definition: default.php:19
elgg_unregister_external_view($view)
Unregister a view for ajax calls.
Definition: views.php:262
$output
Definition: item.php:10
elgg_unregister_rss_link()
Remove the RSS icon link and link element from the head.
Definition: views.php:1492
_elgg_view_under_viewtype($view, $vars, $viewtype)
Render a view while the global viewtype is temporarily changed.
Definition: views.php:1928
if(!$collection_name) $id
Definition: add.php:17
$version
Definition: version.php:14
elgg_view_annotation_list($annotations, array $vars=array())
Returns a rendered list of annotations, plus pagination.
Definition: views.php:1056
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:1133
$priority
elgg_view_title($title, array $vars=array())
Renders a title.
Definition: views.php:1117
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:11
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:437
elgg_register_rss_link()
Include the RSS icon link and link element in the head.
Definition: views.php:1483
$image
Definition: upload.php:37
elgg_unextend_view($view, $view_extension)
Unextends a view.
Definition: views.php:399
if(!$display_name) $type
Definition: delete.php:27