32 return array_keys($this->getViewsData()[
'locations']);
43 $view_data = $this->getViewsData();
51 $component->view =
$view;
61 if (isset(
$views[$ext_view])) {
66 if (count($view_list) > 0) {
79 $component->overridden =
true;
80 $component->view =
$view;
83 $overrides_list[
"o:$i"] = $component;
93 $input_filtered_views = [];
94 if (!empty($handlers[
'view_vars'])) {
95 $input_filtered_views = array_keys($handlers[
'view_vars']);
99 if (!empty($handlers[
'view'])) {
100 $filtered_views = array_keys($handlers[
'view']);
104 if (!empty($handlers[
'view_vars'][
'all'])) {
105 $global_events[] =
'view_vars, all';
108 if (!empty($handlers[
'view'][
'all'])) {
109 $global_events[] =
'view, all';
114 'global_events' => $global_events,
115 'input_filtered_views' => $input_filtered_views,
116 'filtered_views' => $filtered_views,
128 $tree[
$handler] = [$handler_obj->name, implode(
',', array_values($handler_obj->context))];
146 'public' =>
'public',
147 'logged_in' =>
'logged in only',
148 'logged_out' =>
'logged out only',
149 'admin' =>
'admin only',
153 if (isset(
$info[
'file'])) {
155 }
else if (
$info[
'controller']) {
172 $simplecache =
elgg_extract(
'simplecache', $this->getViewsData(), []);
173 $locations =
elgg_extract(
'locations', $this->getViewsData(), []);
176 foreach ($simplecache as
$view => $foo) {
183 if (pathinfo(
$location, PATHINFO_EXTENSION) !==
'php') {
204 $handler = $route->getDefault(
'_handler') ?:
'';
209 $controller = $route->getDefault(
'_controller') ?:
'';
214 $resource = $route->getDefault(
'_resource') ?:
'';
216 $file = $route->getDefault(
'_file') ?:
'';
218 $middleware = $route->getDefault(
'_middleware');
219 if (!is_array($middleware)) {
220 if (!empty($middleware)) {
221 $middleware = [$middleware];
227 $middleware = array_map(
function($e) {
241 uasort($tree,
function($e1, $e2) {
242 return strcmp($e1[0], $e2[0]);
258 $jit_menus = [
'annotation',
'entity',
'login',
'longtext',
'owner_block',
'user_hover',
'widget'];
270 $entity->title =
'test entity';
275 $user = new \ElggUser();
277 $user->name =
'Test User';
278 $user->username =
'test_user';
283 $widget->title =
'test widget';
286 foreach ($jit_menus as
$type) {
314 $text = htmlspecialchars(
$item->getText() ??
'', ENT_QUOTES,
'UTF-8',
false);
316 if (
$href ===
false) {
317 $href =
'not a link';
319 $href =
'not a direct link - possibly ajax';
323 $parent =
$item->getParentName();
328 $tree[$menu_name][
$name] = [
331 "section: {$section}",
352 return _elgg_services()->handlers->describeCallable($callable, $file_root);
367 foreach ($all_handlers as $event => $types) {
368 foreach ($types as
$type => $priorities) {
371 foreach ($priorities as
$priority => $handlers) {
372 foreach ($handlers as $callable) {
373 $description = $handlers_svc->describeCallable($callable, $root);
374 $callable =
"{$priority}: {$description}";
375 $tree[
"{$event}, {$type}"][] = $callable;
391 private function getViewsData() {
393 if (
$data ===
null) {
413 foreach ($plugins as
$plugin) {
419 foreach ($sources as
$source) {
426 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.
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.