242 if (is_array(
$body)) {
250 if (!
$timer->hasEnded([
'build page'])) {
251 $timer->end([
'build page']);
254 $timer->begin([__FUNCTION__]);
259 array_shift(
$params[
'segments']);
265 if ($system_messages->count()) {
266 $messages = $system_messages->dumpRegister();
282 $vars[
'page_shell'] = $page_shell;
293 $timer->end([__FUNCTION__]);
308 $view =
"resources/{$name}";
354 if (!
$timer->hasEnded([
'build page'])) {
355 $timer->end([
'build page']);
358 $timer->begin([__FUNCTION__]);
362 array_shift(
$vars[
'segments']);
366 $vars[
'layout'] = $layout_name;
369 "page/layouts/{$layout_name}",
370 'page/layouts/default',
374 foreach ($layout_views as $layout_view) {
381 $timer->end([__FUNCTION__]);
444 unset(
$vars[
'menu_view']);
446 if (is_string(
$menu)) {
453 throw new ElggInvalidArgumentException(
'$menu must be a menu name, a Menu, or UnpreparedMenu');
461 "navigation/menu/{$name}",
462 'navigation/menu/default',
507 $entity_type =
$entity->getType();
508 $entity_subtype =
$entity->getSubtype();
512 "{$entity_type}/{$entity_subtype}",
513 "{$entity_type}/default",
517 foreach ($entity_views as
$view) {
547 $entity_type =
$entity->getType();
596 $annotation_views = [
598 "annotation/{$name}",
599 'annotation/default',
602 foreach ($annotation_views as
$view) {
640 $list_type =
get_input(
'list_type',
'list');
643 'items' => $entities,
644 'list_class' =>
'elgg-list-entity',
646 'pagination' =>
true,
647 'list_type' => $list_type,
656 $vars[
'pagination'] =
false;
659 $view =
"page/components/{$vars['list_type']}";
661 $view =
'page/components/list';
687 $list_type =
get_input(
'list_type',
'list');
690 'items' => $annotations,
693 'list_class' =>
'elgg-list-annotation',
695 'list_type' => $list_type,
696 'offset_key' =>
'annoff',
703 $vars[
'pagination'] =
false;
706 $view =
"page/components/{$vars['list_type']}";
708 $view =
'page/components/list';
734 $list_type =
get_input(
'list_type',
'list');
737 'items' => $relationships,
740 'list_class' =>
'elgg-list-relationship',
741 'full_view' =>
false,
742 'list_type' => $list_type,
743 'offset_key' =>
'reloff',
750 $vars[
'pagination'] =
false;
753 $view =
"page/components/{$vars['list_type']}";
755 $view =
'page/components/list';
790 $relationship_views = [
792 "relationship/{$name}",
793 'relationship/default',
796 foreach ($relationship_views as
$view) {
833 $view =
'output/friendlytime';
857 if (!
$entity->hasCapability(
'commentable')) {
862 $vars[
'show_add_form'] = $add_comment;
865 $default_id =
'comments';
867 $default_id .=
"-{$entity->guid}";
982 "river/{$type}/{$subtype}/{$action}",
983 "river/{$type}/{$subtype}/default",
984 "river/{$type}/{$action}",
985 "river/{$type}/default",
986 'river/elements/layout',
989 foreach ($river_views as
$view) {
1071 if (!isset($prefixes)) {
1076 $default_section =
'';
1079 foreach ($prefixes as $prefix) {
1080 if (substr(
$key, 0, 1) === $prefix) {
1115 return (
string)
$params[
'#html'];
1118 if (empty(
$params[
'#type'])) {
1119 _elgg_services()->logger->error(__FUNCTION__ .
'(): $params["#type"] is required.');
1128 $hidden_types = [
'hidden',
'securitytoken'];
1135 $params[
'id'] =
'elgg-field-' . base_convert(mt_rand(), 10, 36);
1138 $make_special_checkbox_label =
false;
1151 $make_special_checkbox_label =
true;
1171 $element_vars = array_merge($split_params[
''], $split_params[
'#']);
1180 $label_vars = $element_vars;
1181 if (in_array(
$input_type, [
'checkboxes',
'radio'])) {
1183 unset($label_vars[
'id']);
1186 $element_vars[
'label'] =
elgg_view(
'elements/forms/label', $label_vars);
1189 $element_vars[
'help'] =
elgg_view(
'elements/forms/help', $element_vars);
1191 if ($make_special_checkbox_label) {
1194 unset($element_vars[
'label']);
1199 return elgg_view(
'elements/forms/field', $element_vars);
1342 if (!is_array(
$data)) {
1343 _elgg_services()->logger->error(
'"elgg.data" Event handlers must return an array. Returned ' . gettype(
$data) .
'.');
1348 if ($message_delay < 1) {
1356 'simplecache_enabled' => (int)
_elgg_services()->simpleCache->isEnabled(),
1360 'message_delay' => $message_delay * 1000,
1365 'interval' => (int)
_elgg_services()->csrf->getActionTokenTimeout() * 333,
1381 $user_object =
$user->toObject();
1382 $user_object->admin =
$user->isAdmin();
1384 $elgg[
'user'] = (array) $user_object;
1402 $current_view_type = null;
1410 if (isset($current_view_type)) {
if(! $user||! $user->canDelete()) $name
if(!empty($avatar) &&! $avatar->isValid()) elseif(empty($avatar)) if(! $owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
$params
Saves global plugin settings.
if(empty($plugins)) $errors
if(!elgg_view_exists("plugins/{$plugin_id}/settings")) $form_vars
if(! $annotation instanceof ElggAnnotation) $time
if(! $entity instanceof \ElggUser) $data
elgg_get_simplecache_url(string $view)
Get the URL for the cached view.
if($vars['name'] && $vars['default'] !==false) $input_vars
Thrown when page is not accessible.
Exception thrown if an argument is not of the expected type.
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
elgg_get_release()
Get the current Elgg release.
const ELGG_ENTITIES_ANY_VALUE
Constant to request the value of a parameter be ignored in elgg_get_*() functions.
if($who_can_change_language==='nobody') elseif($who_can_change_language==='admin_only' &&!elgg_is_admin_logged_in()) $options
if($email instanceof \Elgg\Email) $object
if($item instanceof \ElggEntity) elseif($item instanceof \ElggRiverItem) elseif($item instanceof \ElggRelationship) elseif(is_callable([ $item, 'getType']))
$relationship
Elgg default relationship view.
elgg_extract_class(array $array, array|string $existing=[], string $extract_key='class')
Extract class names from an array, optionally merging into a preexisting set.
_elgg_services()
Get the global service provider.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_import_esm(string $name)
Helper functions for external files like css/js.
elgg_load_external_file(string $type, string $name)
Load an external resource for use on this page.
elgg_register_external_file(string $type, string $name, string $url, string $location='')
Core registration function for external files.
elgg_register_esm(string $name, string $href)
Registers an ES module to the import map.
elgg_require_css(string $view)
Register a CSS view name to be included in the HTML head.
elgg_get_current_language()
Get the current system/user language or 'en'.
elgg_is_xhr()
Checks whether the request was requested via ajax.
elgg_trigger_event_results(string $event, string $type, array $params=[], $returnvalue=null)
Triggers an event where it is expected that the mixed return value could be manipulated by event call...
elgg_view_entity_icon(\ElggEntity $entity, string $size='medium', array $vars=[])
View the icon of an entity.
elgg_get_viewtype()
Return the current view type.
elgg_view_relationship(\ElggRelationship $relationship, array $vars=[])
Returns a string of a rendered relationship.
elgg_view_comments(\ElggEntity $entity, bool $add_comment=true, array $vars=[])
Returns rendered comments and a comment form for an entity.
_elgg_has_rss_link()
Should the RSS view of this URL be linked to?
elgg_view_icon(string $name, array $vars=[])
View an icon glyph.
elgg_view_module(string $type, string $title, string $body, array $vars=[])
Wrapper function for the module display pattern.
elgg_get_view_extensions(string $view)
Get the views (and priorities) that extend a view.
elgg_view_tagcloud(array $options=[])
Create a tagcloud for viewing.
elgg_view_exists(string $view, string $viewtype='', bool $recurse=true)
Returns whether the specified view exists.
elgg_unregister_rss_link()
Remove the RSS icon link and link element from the head.
elgg_extend_view(string $view, string $view_extension, int $priority=501)
Extends a view with another view.
elgg_register_ajax_view(string $view)
Register a view to be available for ajax calls.
elgg_view_annotation(\ElggAnnotation $annotation, array $vars=[])
Returns a string of a rendered annotation.
_elgg_get_js_page_data(array $params=[])
Get the initial contents of "elgg" client side.
elgg_unextend_view(string $view, string $view_extension)
Unextends a view.
elgg_view_annotation_list(array $annotations, array $vars=[])
Returns a rendered list of annotations, plus pagination.
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
elgg_unregister_ajax_view(string $view)
Unregister a view for ajax calls.
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades.
elgg_view_list_item($item, array $vars=[])
View an item in a list.
elgg_set_form_footer(string $footer='')
Sets form footer and defers its rendering until the form view and extensions have been rendered.
elgg_view_entity_url(\ElggEntity $entity, array $options=[])
Helper function for outputting a link to an entity.
elgg_get_form_footer()
Returns currently set footer, or false if not in the form rendering stack.
_elgg_view_under_viewtype(string $view, array $vars, string $viewtype)
Render a view while the global viewtype is temporarily changed.
elgg_view_image_block(string $image, string $body, array $vars=[])
Wrapper function for the image block display pattern.
elgg_view_deprecated(string $view, array $vars, string $suggestion, string $version)
Display a view with a deprecation notice.
elgg_view_river_item(\ElggRiverItem $item, array $vars=[])
Renders a human-readable representation of a river item.
elgg_view_message(string $type, string $body, array $vars=[])
Wrapper function for the message display pattern.
_elgg_split_vars(array $vars=[], ?array $prefixes=null)
Split array of vars into subarrays based on property prefixes.
elgg_view_menu($menu, array $vars=[])
Render a menu.
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
elgg_view_layout(string $layout_name, array $vars=[])
Displays a layout with optional parameters.
elgg_view_relationship_list(array $relationships, array $vars=[])
Returns a rendered list of relationships, plus pagination.
elgg_view_resource(string $name, array $vars=[])
Render a resource view.
elgg_view_friendly_time($time, $time_updated=null)
Displays a UNIX timestamp in a friendly way.
elgg_register_viewtype_fallback(string $viewtype)
Register a viewtype to fall back to a default view if a view isn't found for that viewtype.
elgg_view_entity_list(array $entities, array $vars=[])
Returns a rendered list of entities with pagination.
elgg_register_rss_link()
Include the RSS icon link and link element in the head.
elgg_view_title(string $title, array $vars=[])
Renders a title.
elgg_view_page(string $title, string|array $body, string $page_shell='default', array $vars=[])
Assembles and outputs a full page.
elgg_set_viewtype(string $viewtype='')
Manually set the viewtype.
elgg_view_url(string $href, ?string $text=null, array $options=[])
Helper function for outputting urls.
elgg_view(string $view, array $vars=[], string $viewtype='')
Return a parsed view.
if(!empty($title) &&!empty($icon_name)) if(!empty($title)) if(!empty($menu)) if(!empty($header)) if(!empty($body)) $contents
if($container instanceof ElggGroup && $container->guid !=elgg_get_page_owner_guid()) $key
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.
$ts
CSRF security token view for use with secure forms.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
return["default"=>["jquery.js"=> "vendor/npm-asset/jquery/dist/jquery.min.js", "jquery.min.map"=> "vendor/npm-asset/jquery/dist/jquery.min.map", "jquery-ui.js"=> "vendor/npm-asset/jquery-ui/dist/jquery-ui.min.js", "jquery.colorbox.js"=> "vendor/npm-asset/jquery-colorbox/jquery.colorbox-min.js", "jquery.ui.touch-punch.js"=> "vendor/npm-asset/jquery-ui-touch-punch/jquery.ui.touch-punch.js", "sprintf.js"=> "vendor/npm-asset/sprintf-js/src/sprintf.js", "focus-trap.mjs"=> "vendor/npm-asset/focus-trap/dist/focus-trap.esm.js", "tabbable.mjs"=> "vendor/npm-asset/tabbable/dist/index.esm.js", "font-awesome/"=> "vendor/fortawesome/font-awesome/", "jquery-ui/"=> "vendor/npm-asset/jquery-ui/ui", "tagify/"=> "vendor/npm-asset/yaireo--tagify/dist", "normalize.css"=> "vendor/npm-asset/normalize.css/normalize.css", "cropperjs/"=> "vendor/npm-asset/cropperjs/dist/", "jquery-cropper/"=> "vendor/npm-asset/jquery-cropper/dist/", "jquery.ui.autocomplete.html.js"=> dirname(__DIR__) . "/bower_components/jquery-ui-extensions/src/autocomplete/jquery.ui.autocomplete.html.js",],]