33 return array_keys($this->getViewsData()[
'locations']);
44 $view_data = $this->getViewsData();
52 $component->view =
$view;
62 if (isset(
$views[$ext_view])) {
67 if (count($view_list) > 0) {
80 $component->overridden =
true;
81 $component->view =
$view;
84 $overrides_list[
"o:$i"] = $component;
94 $input_filtered_views = [];
95 if (!empty($handlers[
'view_vars'])) {
96 $input_filtered_views = array_keys($handlers[
'view_vars']);
100 if (!empty($handlers[
'view'])) {
101 $filtered_views = array_keys($handlers[
'view']);
105 if (!empty($handlers[
'view_vars'][
'all'])) {
106 $global_events[] =
'view_vars, all';
109 if (!empty($handlers[
'view'][
'all'])) {
110 $global_events[] =
'view, all';
115 'global_events' => $global_events,
116 'input_filtered_views' => $input_filtered_views,
117 'filtered_views' => $filtered_views,
129 $tree[
$handler] = [$handler_obj->name, implode(
',', array_values($handler_obj->context))];
147 'public' =>
'public',
148 'logged_in' =>
'logged in only',
149 'logged_out' =>
'logged out only',
150 'admin' =>
'admin only',
154 if (isset(
$info[
'file'])) {
156 }
else if (
$info[
'controller']) {
173 $simplecache =
elgg_extract(
'simplecache', $this->getViewsData(), []);
174 $locations =
elgg_extract(
'locations', $this->getViewsData(), []);
177 foreach ($simplecache as
$view => $foo) {
184 if (pathinfo(
$location, PATHINFO_EXTENSION) !==
'php') {
205 $handler = $route->getDefault(
'_handler') ?:
'';
210 $controller = $route->getDefault(
'_controller') ?:
'';
215 $resource = $route->getDefault(
'_resource') ?:
'';
217 $file = $route->getDefault(
'_file') ?:
'';
219 $middleware = $route->getDefault(
'_middleware');
220 if (!is_array($middleware)) {
221 if (!empty($middleware)) {
222 $middleware = [$middleware];
228 $middleware = array_map(
function($e) {
242 uasort($tree,
function($e1, $e2) {
243 return strcmp($e1[0], $e2[0]);
259 $jit_menus = [
'annotation',
'entity',
'login',
'longtext',
'owner_block',
'user_hover',
'widget'];
271 $entity->title =
'test entity';
276 $user = new \ElggUser();
278 $user->name =
'Test User';
279 $user->username =
'test_user';
284 $widget->title =
'test widget';
287 foreach ($jit_menus as
$type) {
315 $text = htmlspecialchars(
$item->getText() ??
'', ENT_QUOTES,
'UTF-8',
false);
317 if (
$href ===
false) {
318 $href =
'not a link';
320 $href =
'not a direct link - possibly ajax';
324 $parent =
$item->getParentName();
329 $tree[$menu_name][
$name] = [
332 "section: {$section}",
353 return _elgg_services()->handlers->describeCallable($callable, $file_root);
368 foreach ($all_handlers as $event => $types) {
369 foreach ($types as
$type => $priorities) {
372 foreach ($priorities as
$priority => $handlers) {
373 foreach ($handlers as $callable) {
374 $description = $handlers_svc->describeCallable($callable, $root);
375 $callable =
"{$priority}: {$description}";
376 $tree[
"{$event}, {$type}"][] = $callable;
392 private function getViewsData() {
394 if (
$data ===
null) {
414 foreach ($plugins as
$plugin) {
420 foreach ($sources as
$source) {
427 foreach ($services as
$name => $service) {
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.
foreach($notification_settings as $purpose=> $prefered_methods) if((bool) elgg_get_config('enable_delayed_email')) $start
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
$attributes
Elgg AJAX loader.
if(! $entity instanceof \ElggUser) $data
const PUBLIC_SERVICES_FILENAME
getMenus()
Get information about registered menus.
buildHandlerTree($all_handlers)
Build a tree of event handlers.
getViews($viewtype='default')
Get Elgg view information.
getNotifications()
Get all registered notification handlers.
getSeeders()
Get the registered database CLI seeders.
describeCallable($callable, $file_root='')
Get a string description of a callback.
getViewtypes()
Get all view types for known views.
getRoutes()
Get Elgg route information.
getEvents()
Get Elgg event information.
getWidgets()
Get Elgg widget information.
getSimpleCache()
Get simplecache information.
getServices()
Returns public DI services.
getActions()
Get Elgg actions information.
Allow executing scripts without $this context or local vars.
static includeFile($file)
Include a file with as little context as possible.
Find Elgg and project paths.
static sanitize($path, $append_slash=true)
Sanitize file paths ensuring that they begin and end with slashes etc.
static elgg()
Get the Elgg codebase path with "/".
elgg_get_root_path()
Get the project path (where composer is installed), ending with slash.
if($item instanceof \ElggEntity) elseif($item instanceof \ElggRiverItem) elseif($item instanceof \ElggRelationship) elseif(is_callable([ $item, 'getType']))
elgg()
Bootstrapping and helper procedural code available for use in Elgg core and plugins.
_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_get_logged_in_user_guid()
Return the current logged in user by guid.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.