206 if (func_num_args() == 5) {
207 elgg_log(__FUNCTION__ .
' now has only 3 arguments. Update your usage.',
'ERROR');
295 if (is_array(
$body)) {
303 if (!
$timer->hasEnded([
'build page'])) {
304 $timer->end([
'build page']);
306 $timer->begin([__FUNCTION__]);
311 array_shift(
$params[
'segments']);
318 if ($system_messages->count()) {
319 $messages = $system_messages->dumpRegister();
335 $vars[
'page_shell'] = $page_shell;
347 $timer->end([__FUNCTION__]);
362 $view =
"resources/$name";
408 if (!
$timer->hasEnded([
'build page'])) {
409 $timer->end([
'build page']);
411 $timer->begin([__FUNCTION__]);
415 array_shift(
$vars[
'segments']);
419 $vars[
'layout'] = $layout_name;
422 "page/layouts/$layout_name",
423 "page/layouts/default",
427 foreach ($layout_views as $layout_view) {
434 $timer->end([__FUNCTION__]);
497 unset(
$vars[
'menu_view']);
499 if (is_string(
$menu)) {
514 "navigation/menu/$name",
515 'navigation/menu/default',
558 $entity_type = $entity->
getType();
563 "$entity_type/$entity_subtype",
564 "$entity_type/default",
568 foreach ($entity_views as
$view) {
598 $entity_type = $entity->
getType();
640 $name = $annotation->name;
645 $annotation_views = [
648 "annotation/default",
652 foreach ($annotation_views as
$view) {
691 $list_type =
get_input(
'list_type',
'list');
694 'items' => $entities,
695 'list_class' =>
'elgg-list-entity',
697 'pagination' =>
true,
698 'list_type' => $list_type,
707 $vars[
"pagination"] =
false;
710 $view =
"page/components/{$vars['list_type']}";
712 $view =
'page/components/list';
738 $list_type =
get_input(
'list_type',
'list');
741 'items' => $annotations,
744 'list_class' =>
'elgg-list-annotation',
746 'list_type' => $list_type,
747 'offset_key' =>
'annoff',
754 $vars[
"pagination"] =
false;
757 $view =
"page/components/{$vars['list_type']}";
759 $view =
'page/components/list';
785 $list_type =
get_input(
'list_type',
'list');
788 'items' => $relationships,
791 'list_class' =>
'elgg-list-relationship',
792 'full_view' =>
false,
793 'list_type' => $list_type,
794 'offset_key' =>
'reloff',
801 $vars[
'pagination'] =
false;
804 $view =
"page/components/{$vars['list_type']}";
806 $view =
'page/components/list';
836 $name = $relationship->relationship;
841 $relationship_views = [
843 "relationship/$name",
844 "relationship/default",
848 foreach ($relationship_views as
$view) {
886 $view =
'output/friendlytime';
915 if (!
$entity->hasCapability(
'commentable')) {
920 $vars[
'show_add_form'] = $add_comment;
1037 "river/{$type}/{$subtype}/{$action}",
1038 "river/{$type}/{$subtype}/default",
1039 "river/{$type}/{$action}",
1040 "river/{$type}/default",
1041 'river/elements/layout',
1045 foreach ($river_views as
$view) {
1128 if (!isset($prefixes)) {
1133 $default_section =
'';
1136 foreach ($prefixes as $prefix) {
1171 if (!empty(
$params[
'#html'])) {
1175 if (empty(
$params[
'#type'])) {
1176 _elgg_services()->logger->error(__FUNCTION__ .
'(): $params["#type"] is required.');
1185 $hidden_types = [
'hidden',
'securitytoken'];
1193 $id =
"elgg-field-" . base_convert(mt_rand(), 10, 36);
1197 $make_special_checkbox_label =
false;
1210 $make_special_checkbox_label =
true;
1230 $element_vars = array_merge($split_params[
''], $split_params[
'#']);
1239 $element_vars[
'label'] =
elgg_view(
'elements/forms/label', $element_vars);
1240 $element_vars[
'help'] =
elgg_view(
'elements/forms/help', $element_vars);
1242 if ($make_special_checkbox_label) {
1245 unset($element_vars[
'label']);
1249 return elgg_view(
'elements/forms/field', $element_vars);
1276 'value' => $tag_data,
1328 if (is_string(
$vars)) {
1332 if (!is_array(
$vars)) {
1414 'deps' => [
'jquery-ui/widgets/autocomplete'],
1419 'deps' => [
'elgg/touch_punch'],
1436 if ($message_delay < 1) {
1444 'elgg.config.message_delay' => $message_delay * 1000,
1447 'elgg.security.interval' => (int)
_elgg_services()->csrf->getActionTokenTimeout() * 333,
1448 'elgg.config.language' =>
_elgg_services()->config->language ?:
'en',
1460 if (!is_array(
$data)) {
1461 elgg_log(
'"elgg.data" plugin hook handlers must return an array. Returned ' . gettype(
$data) .
'.',
'ERROR');
1482 '_data' => (object)
$data,
1492 $user_object =
$user->toObject();
1493 $user_object->admin =
$user->isAdmin();
1494 $elgg[
'session'][
'user'] = $user_object;
1496 $elgg[
'user'] = (array) $user_object;
1514 $current_view_type = null;
1522 if (isset($current_view_type)) {
1539 'delete-alt' =>
'times-circle',
1540 'delete' =>
'times',
1542 'info' =>
'info-circle',
1543 'mail' =>
'envelope-regular',
1544 'refresh' =>
'redo',
1545 'remove' =>
'times',
1546 'settings' =>
'wrench',
1547 'settings-alt' =>
'cog',
1548 'warning' =>
'exclamation-triangle',
1555 'acquisitions-incorporated',
1603 'canadian-maple-leaf',
1628 'creative-commons-by',
1629 'creative-commons-nc-eu',
1630 'creative-commons-nc-jp',
1631 'creative-commons-nc',
1632 'creative-commons-nd',
1633 'creative-commons-pd-alt',
1634 'creative-commons-pd',
1635 'creative-commons-remix',
1636 'creative-commons-sa',
1637 'creative-commons-sampling-plus',
1638 'creative-commons-sampling',
1639 'creative-commons-share',
1640 'creative-commons-zero',
1682 'facebook-messenger',
1685 'fantasy-flight-games',
1698 'font-awesome-flag',
1699 'font-awesome-logo-full',
1710 'galactic-republic',
1732 'google-plus-square',
1741 'hacker-news-square',
1756 'internet-explorer',
1817 'odnoklassniki-square',
1834 'phoenix-framework',
1840 'pied-piper-square',
1912 'stumbleupon-circle',
1969 'wizards-of-the-coast',
1970 'wolf-pack-battalion',
1983 'yandex-international',
1994 if (!preg_match_all(
'/^elgg-icon-(.+)/i', $icon_class)) {
1999 $base_icon = preg_replace(
'/^elgg-icon-(.+)/i',
'$1', $icon_class);
2002 $base_icon =
elgg_extract($base_icon, $common_icons, $base_icon);
2006 $base_icon = preg_replace(
'/(.*)-solid$/',
'$1', $base_icon);
2009 $base_icon = preg_replace(
'/(.*)-regular$/',
'$1', $base_icon);
2013 $base_icon = preg_replace(
'/(.*)-light$/',
'$1', $base_icon);
2015 }
elseif (in_array($base_icon, $brands)) {
2021 $classes[] =
"fa-{$base_icon}";
2024 $classes = array_unique($classes);
if(!elgg_view_exists("plugins/{$plugin_id}/settings")) $form_vars
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades...
getSubtype()
Get the entity subtype.
elgg_get_release()
Get the current Elgg release.
elgg_get_view_extensions($view)
Get the views (and priorities) that extend a view.
if(empty($plugins)) $errors
elgg_unregister_ajax_view($view)
Unregister a view for ajax calls.
if(!$user||!$user->canDelete()) $name
elgg_require_css(string $view)
Register a CSS view name to be included in the HTML head.
$params
Saves global plugin settings.
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
elgg_view_entity_list($entities, array $vars=[])
Returns a rendered list of entities with pagination.
elgg_view_resource($name, array $vars=[])
Render a resource view.
get_current_language()
Get the current system/user language or "en".
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
elgg_get_simplecache_url($view, $subview= '')
Get the URL for the cached view.
elgg_view_relationship_list($relationships, array $vars=[])
Returns a rendered list of relationships, plus pagination.
$relationship
Elgg default relationship view.
if(!$annotation instanceof ElggAnnotation) $time
if(elgg_trigger_plugin_hook('usersettings:save', 'user', $hooks_params, true)) foreach($request->validation() ->all() as $item) $data
if($vars['name']&&$vars['default']!==false) $input_vars
elgg_view_tagcloud(array $options=[])
Create a tagcloud for viewing.
elgg_register_viewtype_fallback($viewtype)
Register a viewtype to fall back to a default view if a view isn't found for that viewtype...
elgg_register_external_file(string $type, string $name, string $url, string $location= '')
Core registration function for external files.
_elgg_get_js_site_data()
Get the site data to be merged into "elgg" in elgg.js.
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
elgg_set_form_footer($footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=[])
View the icon of an entity.
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
elgg_get_viewtype()
Return the current view type.
elgg_view_image_block($image, $body, $vars=[])
Wrapper function for the image block display pattern.
elgg_register_external_view($view, $cacheable=false)
Registers a view as being available externally (i.e.
_elgg_has_rss_link()
Should the RSS view of this URL be linked to?
elgg_view_menu($menu, array $vars=[])
Render a menu.
_elgg_get_js_page_data()
Get the initial contents of "elgg" client side.
Thrown when page is not accessible.
elgg_view_message($type, $body, array $vars=[])
Wrapper function for the message display pattern.
elgg_view_list_item($item, array $vars=[])
View an item in a list.
elgg_set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view.
elgg_view_river_item($item, array $vars=[])
Renders a human-readable representation of a river item.
if(!empty($avatar)&&!$avatar->isValid()) elseif(empty($avatar)) if(!$owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
elgg_view_form($action, $form_vars=[], $body_vars=[])
elgg_log($message, $level=\Psr\Log\LogLevel::NOTICE)
Log a message.
elgg_view_relationship(\ElggRelationship $relationship, array $vars=[])
Returns a string of a rendered relationship.
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_load_external_file(string $type, string $name)
Load an external resource for use on this page.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
const ELGG_ENTITIES_ANY_VALUE
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
elgg_extend_view($view, $view_extension, $priority=501)
Extends a view with another view.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
elgg_view_friendly_time($time, $time_updated=null)
Displays a UNIX timestamp in a friendly way.
elgg_view_annotation_list($annotations, array $vars=[])
Returns a rendered list of annotations, plus pagination.
_elgg_map_icon_glyph_class(array $classes)
Converts icon classes to correct FontAwesome 5 classes.
if($email instanceof\Elgg\Email) $object
$ts
CSRF security token view for use with secure forms.
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
elgg_view_layout($layout_name, $vars=[])
Displays a layout with optional parameters.
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof ElggRelationship) elseif(is_callable([$item, 'getType']))
elgg_is_simplecache_enabled()
Is simple cache enabled.
getType()
Returns the entity type.
elgg_view_icon($name, $vars=[])
View an icon glyph.
_elgg_services()
Get the global service provider.
elgg_set_viewtype($viewtype= '')
Manually set the viewtype.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
elgg_view_annotation(\ElggAnnotation $annotation, array $vars=[])
Returns a string of a rendered annotation.
elgg_unregister_external_view($view)
Unregister a view for ajax calls.
elgg_unregister_rss_link()
Remove the RSS icon link and link element from the head.
_elgg_view_under_viewtype($view, $vars, $viewtype)
Render a view while the global viewtype is temporarily changed.
elgg_is_xhr()
Checks whether the request was requested via ajax.
$id
Generic annotation delete action.
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
_elgg_split_vars(array $vars=[], array $prefixes=null)
Split array of vars into subarrays based on property prefixes.
if(!empty($title)&&!empty($icon_name)) if(!empty($title)) if(!empty($menu)) if(!empty($header)) if(!empty($body)) $contents
getURL()
Gets the URL for this entity.
elgg_define_js($name, $config)
Helper functions for external files like css/js.
elgg_view_title($title, array $vars=[])
Renders a title.
elgg_view_entity_url(\ElggEntity $entity, array $options=[])
Helper function for outputting a link to an entity.
getDisplayName()
Get the entity's display name.
elgg_get_config($name, $default=null)
Get an Elgg configuration value.
elgg_view_comments($entity, $add_comment=true, array $vars=[])
Returns rendered comments and a comment form for an entity.
elgg_get_form_footer()
Returns currently set footer, or false if not in the form rendering stack.
elgg_register_rss_link()
Include the RSS icon link and link element in the head.
elgg_unextend_view($view, $view_extension)
Unextends a view.