40 return array_keys($this->getViewsData()[
'locations']);
50 public function getViews($viewtype =
'default') {
53 $view_data = $this->getViewsData();
59 foreach ($view_data[
'locations'][$viewtype] as
$view => $location) {
61 $component->view =
$view;
62 $component->file = $location;
64 $views[
$view] = [500 => $component];
71 if (isset($views[$ext_view])) {
72 $view_list[
$priority] = $views[$ext_view][500];
75 if (count($view_list) > 0) {
76 $views[
$view] = $view_list;
83 foreach ($views as
$view => $view_list) {
84 if (!empty($view_data[
'overrides'][$viewtype][
$view])) {
85 $overrides_list = array();
86 foreach ($view_data[
'overrides'][$viewtype][
$view] as $i => $location) {
88 $component->overridden =
true;
89 $component->view =
$view;
90 $component->file = $location;
92 $overrides_list[
"o:$i"] = $component;
94 $views[
$view] = $overrides_list + $view_list;
101 $input_filtered_views = array();
102 if (!empty($handlers[
'view_vars'])) {
103 $input_filtered_views = array_keys($handlers[
'view_vars']);
106 $filtered_views = array();
107 if (!empty($handlers[
'view'])) {
108 $filtered_views = array_keys($handlers[
'view']);
111 $global_hooks = array();
112 if (!empty($handlers[
'view_vars'][
'all'])) {
113 $global_hooks[] =
'view_vars, all';
115 if (!empty($handlers[
'view'][
'all'])) {
116 $global_hooks[] =
'view, all';
121 'global_hooks' => $global_hooks,
122 'input_filtered_views' => $input_filtered_views,
123 'filtered_views' => $filtered_views,
135 $tree[
$handler] = array($handler_obj->name, implode(
',', array_values($handler_obj->context)));
154 'public' =>
'public',
155 'logged_in' =>
'logged in only',
156 'admin' =>
'admin only',
160 $info[
'file'] = substr(
$info[
'file'], $start);
174 $simplecache =
elgg_extract(
'simplecache', $this->getViewsData(), []);
175 $locations =
elgg_extract(
'locations', $this->getViewsData(), []);
178 foreach ($simplecache as
$view => $foo) {
183 foreach ($locations as $viewtype) {
184 foreach ($viewtype as
$view => $location) {
185 if (pathinfo($location, PATHINFO_EXTENSION) !==
'php') {
213 $info[
'call_method'],
214 (
$info[
'require_api_auth']) ?
'API authentication required' :
'No API authentication required',
215 (
$info[
'require_user_auth']) ?
'User authentication required' :
'No user authentication required',
235 $jit_menus = array(
'annotation',
'entity',
'login',
'longtext',
'owner_block',
'user_hover',
'widget');
246 $entity->title =
'test entity';
249 $user = new \ElggUser();
251 $user->name =
"Test User";
252 $user->username =
'test_user';
256 $widget->title =
'test widget';
259 foreach ($jit_menus as
$type) {
286 $text = htmlspecialchars(
$item->getText(), ENT_QUOTES,
'UTF-8',
false);
287 $href =
$item->getHref();
288 if ($href ===
false) {
289 $href =
'not a link';
290 } elseif ($href ===
"") {
291 $href =
'not a direct link - possibly ajax';
293 $section =
$item->getSection();
294 $parent =
$item->getParentName();
299 $tree[$menu_name][
$name] = array(
323 if (is_string($callable)) {
326 if (is_array($callable) && array_keys($callable) === array(0, 1) && is_string($callable[1])) {
327 if (is_string($callable[0])) {
328 return "{$callable[0]}::{$callable[1]}";
330 return "(" . get_class($callable[0]) .
")->{$callable[1]}";
332 if ($callable instanceof \Closure) {
333 $ref = new \ReflectionFunction($callable);
334 $file = $ref->getFileName();
335 $line = $ref->getStartLine();
337 if ($file_root && 0 === strpos(
$file, $file_root)) {
341 return "(Closure {$file}:{$line})";
343 if (is_object($callable)) {
344 return "(" . get_class($callable) .
")->__invoke()";
346 return print_r($callable,
true);
360 foreach ($all_handlers as $hook => $types) {
361 foreach ($types as
$type => $priorities) {
364 foreach ($priorities as
$priority => $handlers) {
365 foreach ($handlers as $callable) {
367 $callable =
"$priority: $description";
368 $tree[
"$hook, $type"][] = $callable;
384 private function getViewsData() {
386 if (
$data ===
null) {
if($guid==elgg_get_logged_in_user_guid()) $name
elgg layout widgets elgg widgets
getPluginHooks()
Get Elgg plugin hooks information.
getMenus()
Get information about registered menus.
buildHandlerTree($all_handlers)
Build a tree of event handlers.
getViews($viewtype='default')
Get Elgg view information.
describeCallable($callable, $file_root='')
Get a string description of a callback.
getViewtypes()
Get all view types for known views.
getWebServices()
Get Elgg web services API methods.
getEvents()
Get Elgg event information.
getWidgets()
Get Elgg widget information.
getSimpleCache()
Get simplecache information.
getActions()
Get Elgg actions information.
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_get_root_path()
Get the root directory path for this installation.
$annotation
Elgg default annotation view.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
if(! $display_name) $type
if($categories) $description
if(!array_key_exists($filename, $text_files)) $file