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) {
313 $name = $item->getName();
314 $text = htmlspecialchars($item->getText() ??
'', ENT_QUOTES,
'UTF-8',
false);
315 $href = $item->getHref();
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) {
420 if (!is_file($source)) {
426 foreach ($services as
$name => $service) {
static includeFile($file)
Include a file with as little context as possible.
static elgg()
Get the Elgg codebase path with "/".
$params
Saves global plugin settings.
getEvents()
Get Elgg event information.
getWidgets()
Get Elgg widget information.
if(!$user||!$user->canDelete()) $name
getServices()
Returns public DI services.
getMenus()
Get information about registered menus.
getViews($viewtype= 'default')
Get Elgg view information.
const PUBLIC_SERVICES_FILENAME
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof\ElggRelationship) elseif(is_callable([$item, 'getType']))
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
foreach($notification_settings as $purpose=> $prefered_methods) if((bool) elgg_get_config('enable_delayed_email')) $start
if(!$entity instanceof\ElggUser) $data
if(!empty($avatar)&&!$avatar->isValid()) elseif(empty($avatar)) if(!$owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
getActions()
Get Elgg actions information.
buildHandlerTree($all_handlers)
Build a tree of event handlers.
elgg_get_root_path()
Get the project path (where composer is installed), ending with slash.
getViewtypes()
Get all view types for known views.
getRoutes()
Get Elgg route information.
getSimpleCache()
Get simplecache information.
getSeeders()
Get the registered database CLI seeders.
static sanitize($path, $append_slash=true)
Sanitize file paths ensuring that they begin and end with slashes etc.
_elgg_services()
Get the global service provider.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
describeCallable($callable, $file_root= '')
Get a string description of a callback.
$attributes
Elgg AJAX loader.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.