Elgg  Version 2.3
views.php
Go to the documentation of this file.
1 <?php
52 
61 
74 function elgg_set_viewtype($viewtype = "") {
76 
77  $CURRENT_SYSTEM_VIEWTYPE = $viewtype;
78 
79  return true;
80 }
81 
95 function elgg_get_viewtype() {
97 
98  if (empty($CURRENT_SYSTEM_VIEWTYPE)) {
99  $CURRENT_SYSTEM_VIEWTYPE = _elgg_get_initial_viewtype();
100  }
101 
103 }
104 
113  global $CONFIG;
114 
115  $viewtype = get_input('view', '', false);
116  if (_elgg_is_valid_viewtype($viewtype)) {
117  return $viewtype;
118  }
119 
120  if (isset($CONFIG->view) && _elgg_is_valid_viewtype($CONFIG->view)) {
121  return $CONFIG->view;
122  }
123 
124  return 'default';
125 }
126 
133 function elgg_register_viewtype($viewtype) {
134  if (!isset($GLOBALS['_ELGG']->view_types) || !is_array($GLOBALS['_ELGG']->view_types)) {
135  $GLOBALS['_ELGG']->view_types = array();
136  }
137 
138  if (!in_array($viewtype, $GLOBALS['_ELGG']->view_types)) {
139  $GLOBALS['_ELGG']->view_types[] = $viewtype;
140  }
141 
142  return true;
143 }
144 
153 function elgg_is_registered_viewtype($viewtype) {
154  if (!isset($GLOBALS['_ELGG']->view_types) || !is_array($GLOBALS['_ELGG']->view_types)) {
155  return false;
156  }
157 
158  return in_array($viewtype, $GLOBALS['_ELGG']->view_types);
159 }
160 
161 
171 function _elgg_is_valid_viewtype($viewtype) {
172  if (!is_string($viewtype) || $viewtype === '') {
173  return false;
174  }
175 
176  if (preg_match('/\W/', $viewtype)) {
177  return false;
178  }
179 
180  return true;
181 }
182 
194 function elgg_register_viewtype_fallback($viewtype) {
195  _elgg_services()->views->registerViewtypeFallback($viewtype);
196 }
197 
206 function elgg_does_viewtype_fallback($viewtype) {
207  return _elgg_services()->views->doesViewtypeFallback($viewtype);
208 }
209 
223 }
224 
234 }
235 
244 function elgg_register_external_view($view, $cacheable = false) {
245 
246  _elgg_services()->ajax->registerView($view);
247 
248  if ($cacheable) {
249  _elgg_services()->views->registerCacheableView($view);
250  }
251 }
252 
261  _elgg_services()->ajax->unregisterView($view);
262 }
263 
278 function elgg_set_view_location($view, $location, $viewtype = '') {
279  _elgg_services()->views->setViewDir($view, $location, $viewtype);
280 }
281 
293 function elgg_view_exists($view, $viewtype = '', $recurse = true) {
294  return _elgg_services()->views->viewExists($view, $viewtype, $recurse);
295 }
296 
306 function elgg_list_views($viewtype = 'default') {
307  return _elgg_services()->views->listViews($viewtype);
308 }
309 
336 function elgg_view($view, $vars = array(), $ignore1 = false, $ignore2 = false, $viewtype = '') {
337  return _elgg_services()->views->renderView($view, $vars, $ignore1, $viewtype);
338 }
339 
353 function elgg_view_deprecated($view, array $vars, $suggestion, $version) {
354  return _elgg_services()->views->renderDeprecatedView($view, $vars, $suggestion, $version);
355 }
356 
380 function elgg_extend_view($view, $view_extension, $priority = 501) {
381  _elgg_services()->views->extendView($view, $view_extension, $priority);
382 }
383 
393 function elgg_unextend_view($view, $view_extension) {
394  return _elgg_services()->views->unextendView($view, $view_extension);
395 }
396 
408  $list = _elgg_services()->views->getViewList($view);
409  unset($list[500]);
410  return $list;
411 }
412 
425  return Minify_CSS_UriRewriter::prepend($css, $path);
426 }
427 
447 function elgg_view_page($title, $body, $page_shell = 'default', $vars = array()) {
448  $timer = _elgg_services()->timer;
449  if (!$timer->hasEnded(['build page'])) {
450  $timer->end(['build page']);
451  }
452  $timer->begin([__FUNCTION__]);
453 
454  $params = array();
455  $params['identifier'] = _elgg_services()->request->getFirstUrlSegment();
456  $params['segments'] = _elgg_services()->request->getUrlSegments();
457  array_shift($params['segments']);
458  $page_shell = elgg_trigger_plugin_hook('shell', 'page', $params, $page_shell);
459 
460 
461  $system_messages = _elgg_services()->systemMessages;
462 
463  $messages = null;
464  if ($system_messages->count()) {
465  $messages = $system_messages->dumpRegister();
466 
467  if (isset($messages['error'])) {
468  // always make sure error is the first type
469  $errors = array(
470  'error' => $messages['error']
471  );
472 
473  unset($messages['error']);
474  $messages = array_merge($errors, $messages);
475  }
476  }
477 
478  $vars['title'] = $title;
479  $vars['body'] = $body;
480  $vars['sysmessages'] = $messages;
481 
482  // head has keys 'title', 'metas', 'links'
483  $head_params = _elgg_views_prepare_head($title);
484 
485  $vars['head'] = elgg_trigger_plugin_hook('head', 'page', $vars, $head_params);
486 
487  $vars = elgg_trigger_plugin_hook('output:before', 'page', null, $vars);
488 
489  $output = elgg_view("page/$page_shell", $vars);
490 
491  $vars['page_shell'] = $page_shell;
492 
493  // Allow plugins to modify the output
494  $output = elgg_trigger_plugin_hook('output', 'page', $vars, $output);
495 
496  $timer->end([__FUNCTION__]);
497  return $output;
498 }
499 
510 function elgg_view_resource($name, array $vars = []) {
511  $view = "resources/$name";
512 
513  if (elgg_view_exists($view)) {
514  return _elgg_services()->views->renderView($view, $vars);
515  }
516 
517  if (elgg_get_viewtype() !== 'default' && elgg_view_exists($view, 'default')) {
518  return _elgg_services()->views->renderView($view, $vars, false, 'default');
519  }
520 
521  _elgg_services()->logger->error("The view $view is missing.");
522 
523  if (elgg_get_viewtype() === 'default') {
524  // only works for default viewtype
525  forward('', '404');
526  } else {
527  register_error(elgg_echo('error:404:content'));
528  forward('');
529  }
530 }
531 
540  $params = array(
541  'links' => array(),
542  'metas' => array(),
543  );
544 
545  if (empty($title)) {
546  $params['title'] = elgg_get_config('sitename');
547  } else {
548  $params['title'] = $title . ' : ' . elgg_get_config('sitename');
549  }
550 
551  $params['metas']['content-type'] = array(
552  'http-equiv' => 'Content-Type',
553  'content' => 'text/html; charset=utf-8',
554  );
555 
556  $params['metas']['description'] = array(
557  'name' => 'description',
558  'content' => elgg_get_config('sitedescription')
559  );
560 
561  // https://developer.chrome.com/multidevice/android/installtohomescreen
562  $params['metas']['viewport'] = array(
563  'name' => 'viewport',
564  'content' => 'width=device-width',
565  );
566  $params['metas']['mobile-web-app-capable'] = array(
567  'name' => 'mobile-web-app-capable',
568  'content' => 'yes',
569  );
570  $params['metas']['apple-mobile-web-app-capable'] = array(
571  'name' => 'apple-mobile-web-app-capable',
572  'content' => 'yes',
573  );
574 
575  // RSS feed link
576  if (_elgg_has_rss_link()) {
578  if (substr_count($url,'?')) {
579  $url .= "&view=rss";
580  } else {
581  $url .= "?view=rss";
582  }
583  $params['links']['rss'] = array(
584  'rel' => 'alternative',
585  'type' => 'application/rss+xml',
586  'title' => 'RSS',
587  'href' => elgg_format_url($url),
588  );
589  }
590 
591  return $params;
592 }
593 
594 
611 function _elgg_views_prepare_favicon_links($hook, $type, $head_params, $params) {
612 
613  $head_params['links']['apple-touch-icon'] = array(
614  'rel' => 'apple-touch-icon',
615  'href' => elgg_get_simplecache_url('favicon-128.png'),
616  );
617 
618  // favicons
619  $head_params['links']['icon-ico'] = array(
620  'rel' => 'icon',
621  'href' => elgg_get_simplecache_url('favicon.ico'),
622  );
623  $head_params['links']['icon-vector'] = array(
624  'rel' => 'icon',
625  'sizes' => '16x16 32x32 48x48 64x64 128x128',
626  'type' => 'image/svg+xml',
627  'href' => elgg_get_simplecache_url('favicon.svg'),
628  );
629  $head_params['links']['icon-16'] = array(
630  'rel' => 'icon',
631  'sizes' => '16x16',
632  'type' => 'image/png',
633  'href' => elgg_get_simplecache_url('favicon-16.png'),
634  );
635  $head_params['links']['icon-32'] = array(
636  'rel' => 'icon',
637  'sizes' => '32x32',
638  'type' => 'image/png',
639  'href' => elgg_get_simplecache_url('favicon-32.png'),
640  );
641  $head_params['links']['icon-64'] = array(
642  'rel' => 'icon',
643  'sizes' => '64x64',
644  'type' => 'image/png',
645  'href' => elgg_get_simplecache_url('favicon-64.png'),
646  );
647  $head_params['links']['icon-128'] = array(
648  'rel' => 'icon',
649  'sizes' => '128x128',
650  'type' => 'image/png',
651  'href' => elgg_get_simplecache_url('favicon-128.png'),
652  );
653 
654  return $head_params;
655 }
656 
689 function elgg_view_layout($layout_name, $vars = array()) {
690  $timer = _elgg_services()->timer;
691  if (!$timer->hasEnded(['build page'])) {
692  $timer->end(['build page']);
693  }
694  $timer->begin([__FUNCTION__]);
695 
696  $params = array();
697  $params['identifier'] = _elgg_services()->request->getFirstUrlSegment();
698  $params['segments'] = _elgg_services()->request->getUrlSegments();
699  array_shift($params['segments']);
700  $layout_name = elgg_trigger_plugin_hook('layout', 'page', $params, $layout_name);
701 
702  $param_array = $vars;
703 
704  $param_array['layout'] = $layout_name;
705 
706  $params = elgg_trigger_plugin_hook('output:before', 'layout', null, $param_array);
707 
708  if (elgg_view_exists("page/layouts/$layout_name")) {
709  $output = elgg_view("page/layouts/$layout_name", $params);
710  } else {
711  $output = elgg_view("page/layouts/default", $params);
712  }
713 
714  $output = elgg_trigger_plugin_hook('output:after', 'layout', $params, $output);
715 
716  $timer->end([__FUNCTION__]);
717  return $output;
718 }
719 
775 function elgg_view_menu($menu, array $vars = array()) {
776 
777  $menu_view = elgg_extract('menu_view', $vars);
778  unset($vars['menu_view']);
779 
780  if (is_string($menu)) {
781  $menu = _elgg_services()->menus->getMenu($menu, $vars);
782 
783  } elseif ($menu instanceof UnpreparedMenu) {
784  $menu = _elgg_services()->menus->prepareMenu($menu);
785  }
786 
787  if (!$menu instanceof Menu) {
788  throw new \InvalidArgumentException('$menu must be a menu name, a Menu, or UnpreparedMenu');
789  }
790 
791  $name = $menu->getName();
792  $params = $menu->getParams();
793 
794  $views = [
795  $menu_view,
796  "navigation/menu/$name",
797  'navigation/menu/default',
798  ];
799 
800  foreach ($views as $view) {
801  if (elgg_view_exists($view)) {
802  return elgg_view($view, $params);
803  }
804  }
805 }
806 
815 function elgg_view_menu_item(\ElggMenuItem $item, array $vars = array()) {
816  if (!isset($vars['class'])) {
817  $vars['class'] = 'elgg-menu-content';
818  }
819 
820  $vars = array_merge($item->getValues(), $vars);
821 
822  if ($item->getLinkClass()) {
823  $vars['class'] .= ' ' . $item->getLinkClass();
824  }
825 
826  if ($item->getHref() === false || $item->getHref() === null) {
827  $text = $item->getText();
828 
829  // if contains elements, don't wrap
830  if (preg_match('~<[a-z]~', $text)) {
831  return $text;
832  } else {
833  return elgg_format_element('span', array('class' => 'elgg-non-link'), $text);
834  }
835  }
836 
837  if (!isset($vars['rel']) && !isset($vars['is_trusted'])) {
838  $vars['is_trusted'] = true;
839  }
840 
841  if ($item->getConfirmText()) {
842  $vars['confirm'] = $item->getConfirmText();
843  }
844 
845  return elgg_view('output/url', $vars);
846 }
847 
873 function elgg_view_entity(\ElggEntity $entity, array $vars = array(), $bypass = false, $debug = false) {
874 
875  // No point continuing if entity is null
876  if (!$entity || !($entity instanceof \ElggEntity)) {
877  return false;
878  }
879 
881 
882  $defaults = array(
883  'full_view' => true,
884  );
885 
886  $vars = array_merge($defaults, $vars);
887 
888  $vars['entity'] = $entity;
889 
890  $entity_type = $entity->getType();
891  $entity_subtype = $entity->getSubtype();
892  if (empty($entity_subtype)) {
893  $entity_subtype = 'default';
894  }
895 
896  $entity_views = array(
897  elgg_extract('item_view', $vars, ''),
898  "$entity_type/$entity_subtype",
899  "$entity_type/default",
900  );
901 
902  $contents = '';
903  foreach ($entity_views as $view) {
904  if (elgg_view_exists($view)) {
905  $contents = elgg_view($view, $vars, $bypass, $debug);
906  break;
907  }
908  }
909 
910  // Marcus Povey 20090616 : Speculative and low impact approach for fixing #964
911  if ($vars['full_view']) {
912  $annotations = elgg_view_entity_annotations($entity, $vars['full_view']);
913 
914  if ($annotations) {
916  }
917  }
918  return $contents;
919 }
920 
936 function elgg_view_entity_icon(\ElggEntity $entity, $size = 'medium', $vars = array()) {
937 
938  // No point continuing if entity is null
939  if (!$entity || !($entity instanceof \ElggEntity)) {
940  return false;
941  }
942 
943  $vars['entity'] = $entity;
944  $vars['size'] = $size;
945 
946  $entity_type = $entity->getType();
947 
948  $subtype = $entity->getSubtype();
949  if (empty($subtype)) {
950  $subtype = 'default';
951  }
952 
953  $contents = '';
954  if (elgg_view_exists("icon/$entity_type/$subtype")) {
955  $contents = elgg_view("icon/$entity_type/$subtype", $vars);
956  }
957  if (empty($contents)) {
958  $contents = elgg_view("icon/$entity_type/default", $vars);
959  }
960  if (empty($contents)) {
961  $contents = elgg_view("icon/default", $vars);
962  }
963 
964  return $contents;
965 }
966 
987 function elgg_view_annotation(\ElggAnnotation $annotation, array $vars = array(), $bypass = false, $debug = false) {
989 
990  $defaults = array(
991  'full_view' => true,
992  );
993 
994  $vars = array_merge($defaults, $vars);
995  $vars['annotation'] = $annotation;
996 
997  $name = $annotation->name;
998  if (empty($name)) {
999  return false;
1000  }
1001 
1002  $annotation_views = array(
1003  elgg_extract('item_view', $vars, ''),
1004  "annotation/$name",
1005  "annotation/default",
1006  );
1007 
1008  $contents = '';
1009  foreach ($annotation_views as $view) {
1010  if (elgg_view_exists($view)) {
1011  $contents = elgg_view($view, $vars, $bypass, $debug);
1012  break;
1013  }
1014  }
1015 
1016  return $contents;
1017 }
1018 
1048 function elgg_view_entity_list($entities, array $vars = array()) {
1049  $offset = (int)get_input('offset', 0);
1050 
1051  // list type can be passed as request parameter
1052  $list_type = get_input('list_type', 'list');
1053 
1054  $defaults = array(
1055  'items' => $entities,
1056  'list_class' => 'elgg-list-entity',
1057  'full_view' => true,
1058  'pagination' => true,
1059  'list_type' => $list_type,
1060  'list_type_toggle' => false,
1061  'offset' => $offset,
1062  'limit' => null,
1063  );
1064 
1065  $vars = array_merge($defaults, $vars);
1066 
1067  if (!$vars["limit"] && !$vars["offset"]) {
1068  // no need for pagination if listing is unlimited
1069  $vars["pagination"] = false;
1070  }
1071 
1072  if ($vars['list_type'] == 'table') {
1073  return elgg_view('page/components/table', $vars);
1074  } elseif ($vars['list_type'] == 'list') {
1075  return elgg_view('page/components/list', $vars);
1076  } else {
1077  return elgg_view('page/components/gallery', $vars);
1078  }
1079 }
1080 
1099 function elgg_view_annotation_list($annotations, array $vars = array()) {
1100  $defaults = array(
1101  'items' => $annotations,
1102  'offset' => null,
1103  'limit' => null,
1104  'list_class' => 'elgg-list-annotation elgg-annotation-list', // @todo remove elgg-annotation-list in Elgg 1.9
1105  'full_view' => true,
1106  'offset_key' => 'annoff',
1107  );
1108 
1109  $vars = array_merge($defaults, $vars);
1110 
1111  if (!$vars["limit"] && !$vars["offset"]) {
1112  // no need for pagination if listing is unlimited
1113  $vars["pagination"] = false;
1114  }
1115 
1116  return elgg_view('page/components/list', $vars);
1117 }
1118 
1134  if (!($entity instanceof \ElggEntity)) {
1135  return false;
1136  }
1137 
1138  $entity_type = $entity->getType();
1139 
1140  $annotations = elgg_trigger_plugin_hook('entity:annotate', $entity_type,
1141  array(
1142  'entity' => $entity,
1143  'full_view' => $full_view,
1144  )
1145  );
1146 
1147  return $annotations;
1148 }
1149 
1160 function elgg_view_title($title, array $vars = array()) {
1161  $vars['title'] = $title;
1162 
1163  return elgg_view('page/elements/title', $vars);
1164 }
1165 
1176 function elgg_view_friendly_time($time) {
1177  $view = 'output/friendlytime';
1178  $vars = ['time' => $time];
1179  $viewtype = elgg_view_exists($view) ? '' : 'default';
1180 
1181  return _elgg_view_under_viewtype($view, $vars, $viewtype);
1182 }
1183 
1197 function elgg_view_comments($entity, $add_comment = true, array $vars = array()) {
1198  if (!($entity instanceof \ElggEntity)) {
1199  return false;
1200  }
1201 
1202  $vars['entity'] = $entity;
1203  $vars['show_add_form'] = $add_comment;
1204  $vars['class'] = elgg_extract('class', $vars, "{$entity->getSubtype()}-comments");
1205 
1206  $output = elgg_trigger_plugin_hook('comments', $entity->getType(), $vars, false);
1207  if ($output !== false) {
1208  return $output;
1209  } else {
1210  return elgg_view('page/elements/comments', $vars);
1211  }
1212 }
1213 
1229 function elgg_view_image_block($image, $body, $vars = array()) {
1230  $vars['image'] = $image;
1231  $vars['body'] = $body;
1232  return elgg_view('page/components/image_block', $vars);
1233 }
1234 
1250 function elgg_view_module($type, $title, $body, array $vars = array()) {
1251  $vars['type'] = $type;
1252  $vars['title'] = $title;
1253  $vars['body'] = $body;
1254  return elgg_view('page/components/module', $vars);
1255 }
1256 
1265 function elgg_view_river_item($item, array $vars = array()) {
1266  if (!($item instanceof \ElggRiverItem)) {
1267  return '';
1268  }
1269  // checking default viewtype since some viewtypes do not have unique views per item (rss)
1270  $view = $item->getView();
1271  if (!$view || !elgg_view_exists($view, 'default')) {
1272  return '';
1273  }
1274 
1275  $subject = $item->getSubjectEntity();
1276  $object = $item->getObjectEntity();
1277  if (!$subject || !$object) {
1278  // subject is disabled or subject/object deleted
1279  return '';
1280  }
1281 
1282  // @todo this needs to be cleaned up
1283  // Don't hide objects in closed groups that a user can see.
1284  // see https://github.com/elgg/elgg/issues/4789
1285  // else {
1286  // // hide based on object's container
1287  // $visibility = \Elgg\GroupItemVisibility::factory($object->container_guid);
1288  // if ($visibility->shouldHideItems) {
1289  // return '';
1290  // }
1291  // }
1292 
1293  $vars['item'] = $item;
1294 
1295  $river_views = array(
1296  elgg_extract('item_view', $vars, ''),
1297  "river/item",
1298  );
1299 
1300  $contents = '';
1301  foreach ($river_views as $view) {
1302  if (elgg_view_exists($view)) {
1303  $contents = elgg_view($view, $vars);
1304  break;
1305  }
1306  }
1307 
1308  return $contents;
1309 }
1310 
1345 function elgg_view_form($action, $form_vars = array(), $body_vars = array()) {
1346  return _elgg_services()->forms->render($action, $form_vars, $body_vars);
1347 }
1348 
1359  return _elgg_services()->forms->setFooter($footer);
1360 }
1361 
1367  return _elgg_services()->forms->getFooter();
1368 }
1369 
1385 function elgg_view_input($input_type, array $vars = array()) {
1386 
1387  elgg_deprecated_notice(__FUNCTION__ . '() is deprecated. Use elgg_view_field()', '2.3');
1388 
1389  $vars['#type'] = $input_type;
1390 
1391  if (isset($vars['label']) && $input_type !== 'checkbox') {
1392  $vars['#label'] = $vars['label'];
1393  unset($vars['label']);
1394  }
1395  if (isset($vars['help'])) {
1396  $vars['#help'] = $vars['help'];
1397  unset($vars['help']);
1398  }
1399  if (isset($vars['field_class'])) {
1400  $vars['#class'] = $vars['field_class'];
1401  unset($vars['field_class']);
1402  }
1403 
1404  return elgg_view_field($vars);
1405 }
1406 
1424 function elgg_view_field(array $params = []) {
1425 
1426  if (empty($params['#type'])) {
1427  _elgg_services()->logger->error(__FUNCTION__ . '(): $params["#type"] is required.');
1428  return '';
1429  }
1430 
1431  $input_type = $params['#type'];
1432  if (!elgg_view_exists("input/$input_type")) {
1433  return '';
1434  }
1435 
1436  $hidden_types = ['hidden', 'securitytoken'];
1437  if (in_array($input_type, $hidden_types)) {
1438  unset($params['#type']);
1439  unset($params['#label']);
1440  unset($params['#help']);
1441  unset($params['#class']);
1442  return elgg_view("input/$input_type", $params);
1443  }
1444 
1445  $id = elgg_extract('id', $params);
1446  if (!$id) {
1447  $id = "elgg-field-" . base_convert(mt_rand(), 10, 36);
1448  $params['id'] = $id;
1449  }
1450 
1451  // $vars passed to label, help and field wrapper views
1452  $element_vars = [];
1453 
1454  // $vars passed to input/$input_name
1455  $input_vars = [];
1456 
1457  $make_special_checkbox_label = false;
1458  if ($input_type == 'checkbox' && (isset($params['label']) || isset($params['#label']))) {
1459  if (isset($params['#label']) && isset($params['label'])) {
1460  $params['label_tag'] = 'div';
1461  } else {
1462  $label = elgg_extract('label', $params);
1463  $label = elgg_extract('#label', $params, $label);
1464 
1465  $params['#label'] = $label;
1466  unset($params['label']);
1467 
1468  // Single checkbox input view gets special treatment
1469  // We don't want the field label to appear a checkbox without a label
1470  $make_special_checkbox_label = true;
1471  }
1472  }
1473 
1474  // first pass non-hash keys into both
1475  foreach ($params as $key => $value) {
1476  if ($key[0] !== '#') {
1477  $element_vars[$key] = $value;
1478  $input_vars[$key] = $value;
1479  }
1480  }
1481 
1482  // field input view needs this
1483  $input_vars['input_type'] = $input_type;
1484 
1485  // field views get more data
1486  $element_vars['input_type'] = $input_type;
1487 
1488  unset($element_vars['class']);
1489  if (isset($params['#class'])) {
1490  $element_vars['class'] = $params['#class'];
1491  }
1492  unset($element_vars['help']);
1493  if (isset($params['#help'])) {
1494  $element_vars['help'] = $params['#help'];
1495  }
1496  unset($element_vars['label']);
1497  if (isset($params['#label'])) {
1498  $element_vars['label'] = $params['#label'];
1499  }
1500 
1501  // wrap if present
1502  $element_vars['label'] = elgg_view('elements/forms/label', $element_vars);
1503  $element_vars['help'] = elgg_view('elements/forms/help', $element_vars);
1504 
1505  if ($make_special_checkbox_label) {
1506  $input_vars['label'] = $element_vars['label'];
1507  $input_vars['label_tag'] = 'div';
1508  unset($element_vars['label']);
1509  }
1510  $element_vars['input'] = elgg_view("elements/forms/input", $input_vars);
1511 
1512  return elgg_view('elements/forms/field', $element_vars);
1513 }
1514 
1529 function elgg_view_tagcloud(array $options = array()) {
1530 
1531  $type = $subtype = '';
1532  if (isset($options['type'])) {
1533  $type = $options['type'];
1534  }
1535  if (isset($options['subtype'])) {
1536  $subtype = $options['subtype'];
1537  }
1538 
1539  $tag_data = elgg_get_tags($options);
1540  return elgg_view("output/tagcloud", array(
1541  'value' => $tag_data,
1542  'type' => $type,
1543  'subtype' => $subtype,
1544  ));
1545 }
1546 
1557 function elgg_view_list_item($item, array $vars = array()) {
1558 
1559  if ($item instanceof \ElggEntity) {
1560  return elgg_view_entity($item, $vars);
1561  } else if ($item instanceof \ElggAnnotation) {
1562  return elgg_view_annotation($item, $vars);
1563  } else if ($item instanceof \ElggRiverItem) {
1564  return elgg_view_river_item($item, $vars);
1565  }
1566 
1567  return '';
1568 }
1569 
1582 function elgg_view_icon($name, $vars = array()) {
1583  if (empty($vars)) {
1584  $vars = array();
1585  }
1586 
1587  if ($vars === true) {
1588  elgg_deprecated_notice("Using a boolean to float the icon is deprecated. Use the class float.", 1.9);
1589  $vars = array('class' => 'float');
1590  }
1591 
1592  if (is_string($vars)) {
1593  $vars = array('class' => $vars);
1594  }
1595 
1596  if (!is_array($vars)) {
1597  throw new \InvalidArgumentException('$vars needs to be a string or an array');
1598  }
1599 
1600  if (!array_key_exists('class', $vars)) {
1601  $vars['class'] = array();
1602  }
1603 
1604  if (!is_array($vars['class'])) {
1605  $vars['class'] = array($vars['class']);
1606  }
1607 
1608  $vars['class'][] = "elgg-icon-$name";
1609 
1610  return elgg_view("output/icon", $vars);
1611 }
1612 
1619  _elgg_services()->config->set('_elgg_autofeed', true);
1620 }
1621 
1628  _elgg_services()->config->set('_elgg_autofeed', false);
1629 }
1630 
1638  if (isset($GLOBALS['autofeed']) && is_bool($GLOBALS['autofeed'])) {
1639  elgg_deprecated_notice('Do not set the global $autofeed. Use elgg_register_rss_link()', '2.1');
1640  return $GLOBALS['autofeed'];
1641  }
1642  return (bool)_elgg_services()->config->getVolatile('_elgg_autofeed');
1643 }
1644 
1655  if ($collections = get_user_access_collections($owner_guid)) {
1657  if ($user) {
1658  $entities = $user->getFriends(array('limit' => 0));
1659  } else {
1660  $entities = array();
1661  }
1662 
1663  foreach ($collections as $key => $collection) {
1664  $collections[$key]->members = get_members_of_access_collection($collection->id, true);
1665  $collections[$key]->entities = $entities;
1666  }
1667  }
1668 
1669  return elgg_view('core/friends/collections', array('collections' => $collections));
1670 }
1671 
1689 function autoregister_views($view_base, $folder, $ignored, $viewtype) {
1690  return _elgg_services()->views->autoregisterViews($view_base, $folder, $viewtype);
1691 }
1692 
1705  if (preg_match('~[\.-]min\.~', $params['view'])) {
1706  // bypass minification
1707  return;
1708  }
1709 
1710  if ($type == 'js') {
1711  if (elgg_get_config('simplecache_minify_js')) {
1712  return JSMin::minify($content);
1713  }
1714  } elseif ($type == 'css') {
1715  if (elgg_get_config('simplecache_minify_css')) {
1716  $cssmin = new CSSmin();
1717  return $cssmin->run($content);
1718  }
1719  }
1720 }
1721 
1722 
1735  $filter = new \Elgg\Amd\ViewFilter();
1736  return $filter->filter($params['view'], $content);
1737 }
1738 
1746  if (_elgg_has_rss_link()) {
1747  $url = current_page_url();
1748  if (substr_count($url, '?')) {
1749  $url .= "&view=rss";
1750  } else {
1751  $url .= "?view=rss";
1752  }
1753 
1755  elgg_register_menu_item('extras', array(
1756  'name' => 'rss',
1757  'text' => elgg_view_icon('rss'),
1758  'href' => $url,
1759  'title' => elgg_echo('feed:rss'),
1760  ));
1761  }
1762 }
1763 
1770  header('X-Frame-Options: SAMEORIGIN');
1771 }
1772 
1801  $views = _elgg_services()->views;
1802 
1803  if ($views->viewIsExtended($view) || $views->viewHasHookHandlers($view)) {
1804  return true;
1805  }
1806 
1807  $viewtype = elgg_get_viewtype();
1808 
1809  // check location
1810  if (0 === strpos($path, '/') || preg_match('~^([A-Za-z]\:)?\\\\~', $path)) {
1811  // absolute path
1812  $expected_path = $path;
1813  } else {
1814  // relative path
1815  $root = dirname(dirname(__DIR__));
1816  $expected_path = "$root/views/$viewtype/" . ltrim($path, '/\\');
1817  }
1818 
1819  $view_path = $views->findViewFile($view, $viewtype);
1820 
1821  return realpath($view_path) !== realpath($expected_path);
1822 }
1823 
1832 function elgg_views_boot() {
1833  global $CONFIG;
1834 
1835  if (!elgg_get_config('system_cache_loaded')) {
1836  // Core view files in /views
1837  _elgg_services()->views->registerPluginViews(realpath(__DIR__ . '/../../'));
1838 
1839  // Core view definitions in /engine/views.php
1840  $file = dirname(__DIR__) . '/views.php';
1841  if (is_file($file)) {
1842  $spec = Includer::includeFile($file);
1843  if (is_array($spec)) {
1844  _elgg_services()->views->mergeViewsSpec($spec);
1845  }
1846  }
1847  }
1848 
1849  // on every page
1850 
1851  // jQuery and UI must come before require. See #9024
1852  elgg_register_js('jquery', elgg_get_simplecache_url('jquery.js'), 'head');
1853  elgg_load_js('jquery');
1854 
1855  elgg_register_js('jquery-ui', elgg_get_simplecache_url('jquery-ui.js'), 'head');
1856  elgg_load_js('jquery-ui');
1857 
1858  elgg_register_js('elgg.require_config', elgg_get_simplecache_url('elgg/require_config.js'), 'head');
1859  elgg_load_js('elgg.require_config');
1860 
1861  elgg_register_js('require', elgg_get_simplecache_url('require.js'), 'head');
1862  elgg_load_js('require');
1863 
1864  elgg_register_js('elgg', elgg_get_simplecache_url('elgg.js'), 'head');
1865  elgg_load_js('elgg');
1866 
1867  elgg_register_css('font-awesome', elgg_get_simplecache_url('font-awesome/css/font-awesome.css'));
1868  elgg_load_css('font-awesome');
1869 
1870  elgg_register_css('elgg', elgg_get_simplecache_url('elgg.css'));
1871  elgg_load_css('elgg');
1872 
1873  elgg_register_simplecache_view('elgg/init.js');
1874 
1875  elgg_register_css('lightbox', elgg_get_simplecache_url('lightbox/elgg-colorbox-theme/colorbox.css'));
1876  elgg_load_css('lightbox');
1877 
1878  // provide warning to use elgg/lightbox AMD
1879  elgg_register_js('lightbox', elgg_get_simplecache_url('lightbox.js'));
1880 
1881  // just provides warning to use elgg/autocomplete AMD
1882  elgg_register_js('elgg.autocomplete', elgg_normalize_url('js/lib/ui.autocomplete.js'));
1883 
1884  elgg_define_js('jquery.ui.autocomplete.html', [
1885  'deps' => ['jquery-ui'],
1886  ]);
1887 
1888  elgg_register_js('elgg.friendspicker', elgg_get_simplecache_url('elgg/ui.friends_picker.js'));
1889  elgg_register_js('elgg.avatar_cropper', elgg_get_simplecache_url('elgg/ui.avatar_cropper.js'));
1890 
1891  // @deprecated 2.2
1892  elgg_register_js('elgg.ui.river', elgg_get_simplecache_url('elgg/ui.river.js'));
1893 
1894  elgg_register_js('jquery.imgareaselect', elgg_get_simplecache_url('jquery.imgareaselect.js'));
1895  elgg_register_css('jquery.imgareaselect', elgg_get_simplecache_url('jquery.imgareaselect.css'));
1896 
1897  elgg_register_ajax_view('languages.js');
1898 
1899  elgg_register_plugin_hook_handler('simplecache:generate', 'js', '_elgg_views_amd');
1900  elgg_register_plugin_hook_handler('simplecache:generate', 'css', '_elgg_views_minify');
1901  elgg_register_plugin_hook_handler('simplecache:generate', 'js', '_elgg_views_minify');
1902 
1903  elgg_register_plugin_hook_handler('output:before', 'layout', 'elgg_views_add_rss_link');
1904  elgg_register_plugin_hook_handler('output:before', 'page', '_elgg_views_send_header_x_frame_options');
1905 
1906  // registered with high priority for BC
1907  // prior to 2.2 registration used to take place in _elgg_views_prepare_head() before the hook was triggered
1908  elgg_register_plugin_hook_handler('head', 'page', '_elgg_views_prepare_favicon_links', 1);
1909 
1910  // @todo the cache is loaded in load_plugins() but we need to know viewtypes earlier
1911  $view_path = _elgg_services()->views->view_path;
1912  $viewtype_dirs = scandir($view_path);
1913  foreach ($viewtype_dirs as $viewtype) {
1914  if (_elgg_is_valid_viewtype($viewtype) && is_dir($view_path . $viewtype)) {
1915  elgg_register_viewtype($viewtype);
1916  }
1917  }
1918 
1919  // set default icon sizes - can be overridden in settings.php or with plugin
1920  if (!isset($CONFIG->icon_sizes)) {
1921  $icon_sizes = array(
1922  'topbar' => array('w' => 16, 'h' => 16, 'square' => true, 'upscale' => true),
1923  'tiny' => array('w' => 25, 'h' => 25, 'square' => true, 'upscale' => true),
1924  'small' => array('w' => 40, 'h' => 40, 'square' => true, 'upscale' => true),
1925  'medium' => array('w' => 100, 'h' => 100, 'square' => true, 'upscale' => true),
1926  'large' => array('w' => 200, 'h' => 200, 'square' => false, 'upscale' => false),
1927  'master' => array('w' => 550, 'h' => 550, 'square' => false, 'upscale' => false),
1928  );
1929  elgg_set_config('icon_sizes', $icon_sizes);
1930  }
1931 
1932  // Patches and features that were included between major releases
1933  // sometimes require additional styling, but adding them to core CSS files
1934  // is not always feasible, because those can be replaced by themes.
1935  // @todo Remove in 3.0
1936  elgg_extend_view('elgg.css', 'elements/pathces.css');
1937  elgg_extend_view('admin.css', 'elements/pathces.css');
1938 }
1939 
1958  global $CONFIG;
1959 
1960  static $allow_delay_pagesetup = true;
1961 
1962  if (isset($GLOBALS['_ELGG']->pagesetupdone) || empty($CONFIG->boot_complete)) {
1963  return;
1964  }
1965 
1966  // only first rendering gets an opportunity to delay
1967  $allow_delay = $allow_delay_pagesetup;
1968  $allow_delay_pagesetup = false;
1969 
1970  if ($allow_delay && (0 === strpos($view, 'resources/'))) {
1971  return;
1972  }
1973 
1974  $GLOBALS['_ELGG']->pagesetupdone = true;
1975 
1976  // don't call this anymore
1977  _elgg_services()->hooks->unregisterHandler('view_vars', 'all', '_elgg_manage_pagesetup');
1978 
1979  _elgg_services()->events->trigger('pagesetup', 'system');
1980 }
1981 
1991  $language = elgg_get_config('language');
1992  if (!$language) {
1993  $language = 'en';
1994  }
1995 
1996  return [
1997  'elgg.data' => (object)elgg_trigger_plugin_hook('elgg.data', 'site', null, []),
1998  'elgg.version' => elgg_get_version(),
1999  'elgg.release' => elgg_get_version(true),
2000  'elgg.config.wwwroot' => elgg_get_site_url(),
2001 
2002  // refresh token 3 times during its lifetime (in microseconds 1000 * 1/3)
2003  'elgg.security.interval' => (int)_elgg_services()->actions->getActionTokenTimeout() * 333,
2004  'elgg.config.language' => $language,
2005  ];
2006 }
2007 
2015  $data = elgg_trigger_plugin_hook('elgg.data', 'page', null, []);
2016  if (!is_array($data)) {
2017  elgg_log('"elgg.data" plugin hook handlers must return an array. Returned ' . gettype($data) . '.', 'ERROR');
2018  $data = [];
2019  }
2020 
2021  $elgg = array(
2022  'config' => array(
2023  'lastcache' => (int) elgg_get_config('lastcache'),
2024  'viewtype' => elgg_get_viewtype(),
2025  'simplecache_enabled' => (int) elgg_is_simplecache_enabled(),
2026  ),
2027  'security' => array(
2028  'token' => array(
2029  '__elgg_ts' => $ts = time(),
2030  '__elgg_token' => generate_action_token($ts),
2031  ),
2032  ),
2033  'session' => array(
2034  'user' => null,
2035  'token' => _elgg_services()->session->get('__elgg_session'),
2036  ),
2037  '_data' => (object) $data,
2038  );
2039 
2040  if (elgg_get_config('elgg_load_sync_code')) {
2041  $elgg['config']['load_sync_code'] = true;
2042  }
2043 
2045  if ($page_owner instanceof ElggEntity) {
2046  $elgg['page_owner'] = $page_owner->toObject();
2047  }
2048 
2050  if ($user instanceof ElggUser) {
2051  $user_object = $user->toObject();
2052  $user_object->admin = $user->isAdmin();
2053  $elgg['session']['user'] = $user_object;
2054  }
2055 
2056  return $elgg;
2057 }
2058 
2070 function _elgg_view_under_viewtype($view, $vars, $viewtype) {
2071  if ($viewtype) {
2072  $old = elgg_get_viewtype();
2073  elgg_set_viewtype($viewtype);
2074  }
2075 
2076  $ret = elgg_view($view, $vars);
2077 
2078  if ($viewtype) {
2079  elgg_set_viewtype($old);
2080  }
2081 
2082  return $ret;
2083 }
2084 
2085 return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
2086  $events->registerHandler('boot', 'system', 'elgg_views_boot');
2087  $hooks->registerHandler('view_vars', 'all', '_elgg_manage_pagesetup', 1000);
2088 };
_elgg_get_initial_viewtype()
Get the initial viewtype.
Definition: views.php:112
$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:1734
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:293
$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:1832
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:1582
getSubtype()
Get the entity subtype.
elgg_get_view_extensions($view)
Get the views (and priorities) that extend a view.
Definition: views.php:407
$action
Definition: full.php:133
elgg_unregister_ajax_view($view)
Unregister a view for ajax calls.
Definition: views.php:232
if(!array_key_exists($filename, $text_files)) $file
$version
elgg_get_tags(array $options=array())
Get popular tags and their frequencies.
Definition: tags.php:78
$subject
Definition: exceptions.php:25
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1424
_elgg_views_prepare_head($title)
Prepare the variables for the html head.
Definition: views.php:539
global $CURRENT_SYSTEM_VIEWTYPE
The viewtype override.
Definition: views.php:59
$annotation
Elgg default annotation view.
Definition: default.php:10
elgg_view_access_collections($owner_guid)
Displays a user&#39;s access collections, using the core/friends/collections view.
Definition: views.php:1654
elgg_view_annotation(\ElggAnnotation $annotation, array $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered annotation.
Definition: views.php:987
elgg_view_entity_annotations(\ElggEntity $entity, $full_view=true)
Display a plugin-specified rendered list of annotations for an entity.
Definition: views.php:1133
elgg_normalize_url($url)
Definition: output.php:280
$footer
Wrap form footer $vars[&#39;footer&#39;] Form footer $vars[&#39;action_name&#39;] Action name.
Definition: footer.php:8
if(!$items) $item
Definition: delete.php:17
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:183
if($footer) $contents
Definition: module.php:43
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:1345
elgg_view_resource($name, array $vars=[])
Render a resource view.
Definition: views.php:510
autoregister_views($view_base, $folder, $ignored, $viewtype)
Auto-registers views from a location.
Definition: views.php:1689
$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:206
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:1745
_elgg_view_may_be_altered($view, $path)
Is there a chance a plugin is altering this view?
Definition: views.php:1800
$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:42
elgg_register_css($name, $url, $priority=null)
Register a CSS file for inclusion in the HTML head.
Definition: elgglib.php:271
$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:689
elgg_is_registered_viewtype($viewtype)
Checks if $viewtype is registered.
Definition: views.php:153
current_page_url()
Returns the current page&#39;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:171
elgg_prepend_css_urls($css, $path)
In CSS content, prepend a path to relative URLs.
Definition: views.php:424
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:425
elgg_list_views($viewtype= 'default')
List all views in a viewtype.
Definition: views.php:306
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Definition: elgglib.php:740
elgg_view_deprecated($view, array $vars, $suggestion, $version)
Display a view with a deprecation notice.
Definition: views.php:353
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:194
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:1265
_elgg_get_js_site_data()
Get the site data to be merged into "elgg" in elgg.js.
Definition: views.php:1990
$url
Definition: exceptions.php:24
$vars['entity']
elgg_view_tagcloud(array $options=array())
Create a tagcloud for viewing.
Definition: views.php:1529
elgg_set_form_footer($footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
Definition: views.php:1358
$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:208
elgg_get_viewtype()
Return the current view type.
Definition: views.php:95
$params
Definition: login.php:72
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
Definition: views.php:244
$text
Definition: default.php:25
_elgg_has_rss_link()
Should the RSS view of this URL be linked to?
Definition: views.php:1637
$_ELGG view_types
A list of valid view types as discovered.
Definition: config.php:353
elgg_view_input($input_type, array $vars=array())
Renders a form field.
Definition: views.php:1385
$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:2014
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
Definition: views.php:1229
elgg_load_css($name)
Load a CSS file for this page.
Definition: elgglib.php:298
elgg_view_list_item($item, array $vars=array())
View an item in a list.
Definition: views.php:1557
elgg_register_js($name, $url, $location= 'head', $priority=null)
Register a JavaScript file for inclusion.
Definition: elgglib.php:155
generate_action_token($timestamp)
Generate an action token.
Definition: actions.php:177
$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:1197
_elgg_views_send_header_x_frame_options()
Sends X-Frame-Options header on page requests.
Definition: views.php:1769
elgg_set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view.
Definition: views.php:278
get_user($guid)
Get a user object from a GUID.
Definition: users.php:87
$key
Definition: summary.php:34
$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:873
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.
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:74
$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:611
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Definition: elgglib.php:826
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1098
elgg global
Pointer to the global context.
Definition: elgglib.js:12
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
$input_vars
Definition: checkboxes.php:61
clearfix elgg elgg elgg elgg page header
Definition: admin.css.php:127
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
Definition: views.php:221
elgg_view_menu_item(\ElggMenuItem $item, array $vars=array())
Render a menu item (usually as a link)
Definition: views.php:815
$page_owner
Definition: add.php:25
elgg_extend_view($view, $view_extension, $priority=501)
Extends a view with another view.
Definition: views.php:380
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:1375
elgg_view_module($type, $title, $body, array $vars=array())
Wrapper function for the module display pattern.
Definition: views.php:1250
getText()
Get the display text of the menu item.
elgg_log($message, $level= 'NOTICE')
Display or log a message.
Definition: elgglib.php:1028
elgg_view_entity_list($entities, array $vars=array())
Returns a rendered list of entities with pagination.
Definition: views.php:1048
elgg_view_menu($menu, array $vars=array())
Render a menu.
Definition: views.php:775
$size
Definition: default.php:20
elgg subtext time
elgg_get_version($human_readable=false)
Get the current Elgg version information.
Definition: elgglib.php:1071
_elgg_views_minify($hook, $type, $content, $params)
Minifies simplecache CSS and JS views by handling the "simplecache:generate" hook.
Definition: views.php:1704
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:399
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:220
getType()
Returns the entity type.
$content
Set robots.txt action.
Definition: set_robots.php:6
_elgg_manage_pagesetup($hook, $view, $value, $params)
Handle triggering the pagesetup event at the right time.
Definition: views.php:1957
$entity
Definition: delete.php:7
elgg_format_url($url)
Handles formatting of ampersands in urls.
Definition: output.php:81
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
Definition: views.php:936
elgg_register_viewtype($viewtype)
Register a viewtype.
Definition: views.php:133
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:260
$output
Definition: item.php:10
elgg_unregister_rss_link()
Remove the RSS icon link and link element from the head.
Definition: views.php:1627
_elgg_view_under_viewtype($view, $vars, $viewtype)
Render a view while the global viewtype is temporarily changed.
Definition: views.php:2070
if(!$collection_name) $id
Definition: add.php:17
elgg_view_annotation_list($annotations, array $vars=array())
Returns a rendered list of annotations, plus pagination.
Definition: views.php:1099
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:5
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:1176
$priority
elgg_view_title($title, array $vars=array())
Renders a title.
Definition: views.php:1160
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_get_form_footer()
Returns currently set footer, or false if not in the form rendering stack.
Definition: views.php:1366
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:447
elgg_register_rss_link()
Include the RSS icon link and link element in the head.
Definition: views.php:1618
$image
Definition: upload.php:37
elgg_unextend_view($view, $view_extension)
Unextends a view.
Definition: views.php:393
if(!$display_name) $type
Definition: delete.php:27