23 $view_function = lcfirst(str_replace(
' ',
'', ucwords(str_replace([
'_',
'-'],
' ', $this->
getPage())))) .
'Entity';
24 if (!is_callable([$this, $view_function])) {
37 $route_parts = $this->getRouteParts();
39 if (!in_array($route_parts[0], [
'add',
'edit',
'view'])) {
48 return $this->getRouteParts()[0];
60 if (isset($this->entity) && !$validate_can_edit) {
64 $guid = (int) $this->request->getParam(
'guid');
78 switch ($this->getPage()) {
100 if (
$page ===
'view') {
101 $options[
'filter_id'] =
"{$this->getEntitySubtype()}/view";
103 $options[
'filter_id'] =
"{$this->getEntitySubtype()}/edit";
108 $sidebar_view = $this->route?->getOption(
'sidebar_view');
113 $entity = $this->getEntity(
true);
128 if (
$page ===
'view') {
129 $options[
'title'] = $this->getEntity()->getDisplayName();
131 $options[
'title'] =
elgg_echo(
"{$page}:{$this->getEntityType()}:{$this->getEntitySubtype()}");
164 $entity = $this->getEntity(true);
$guid
Reset an ElggUpgrade.
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/clear'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['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', 'controller'=> \Elgg\Diagnostics\DownloadController::class,], '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'=>[],]
Generic base controller for content listing and content view/edit/add.
Generic controller to handle entity view/edit/add routes.
addEntity()
Render an entity add page.
prepareBreadcrumbs()
Prepare breadcrumbs.
getEntity(bool $validate_can_edit=false)
Get the entity from the request.
assertValidRoute()
{Validate that route is supported.void }
getPage()
{Get the page from the route name.string }
getPageOptions(string $page, array $options)
{Get additional options to use when viewing a page.for which page to get the options ('all',...
editEntity()
Render an entity edit page.
viewEntity()
Render the entity view page.
handleRequest(\Elgg\Request $request)
{Handle the request.the Elgg requestResponse }
Thrown when entity can not be edited or container permissions do not allow it to be written.
Action validation exception.
if(count($css_vars)< 2) $options
elgg_push_entity_breadcrumbs(\ElggEntity $entity)
Resolves and pushes entity breadcrumbs based on named routes.
elgg_push_collection_breadcrumbs(string $entity_type, string $entity_subtype, ?\ElggEntity $container=null, bool $friends=false)
Resolves and pushes collection breadcrumbs for a container.
elgg_entity_gatekeeper(int $guid, ?string $type=null, ?string $subtype=null, bool $validate_can_edit=false)
Can the viewer see this entity?
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
elgg_view_exists(string $view, string $viewtype='', bool $recurse=true)
Returns whether the specified view exists.
elgg_view_entity(\ElggEntity $entity, array $vars=[])
Returns a string of a rendered entity.
elgg_view_entity_form(string $entity_type, string $entity_subtype, ?\ElggEntity $entity=null, array $vars=[])
Render an entity edit/add form.
elgg_view_page(string $title, string|array $body, string $page_shell='default', array $vars=[])
Assembles and outputs a full page.
elgg_view(string $view, array $vars=[], string $viewtype='')
Return a parsed view.
elgg_ok_response($content='', string|array $message='', ?string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.