Home
About
Community
Docs
Hosting
Download
Log in / create account
Helpers
Contents
1
Input and output
2
Entity methods
3
Entity and context retrieval
4
Plugins
5
Interface and annotations
Input and output
get_input($name)
- Grabs information from a form field (or any variable passed using GET or POST). Also sanitises input, stripping Javascript etc.
set_input($name, $value)
- Forces a value to a particular variable for subsequent retrieval by get_input().
Entity methods
$entity->getURL() - Returns the URL of any entity in the system.
$entity->getGUID() - Returns the GUID of any entity in the system.
$entity->canEdit() - Returns whether or not the current user can edit the entity.
$entity->getOwnerEntity() - Returns the ElggUser owner of a particular entity.
Entity and context retrieval
get_loggedin_user()
- Returns the ElggUser for the current user
get_loggedin_userid()
- Returns the GUID of the current user
isloggedin()
- Is the viewer logged in
isadminloggedin()
- Is the view an admin and logged in
gatekeeper()
- Shorthand for checking if a user is logged in. Forwards user to front page if not.
admin_gatekeeper()
- Shorthand for checking the user is logged in and is an admin. Forwards user to front page if not.
get_user($user_guid)
- Given a GUID, returns a full ElggUser entity.
page_owner()
- Returns the GUID of the current page owner, if there is one.
page_owner_entity()
- Like page_owner() but returns the full entity.
get_context()
- Returns the current page's context - eg "blog" for the blog plugin, "thewire" for the wire, etc. Returns "main" as default.
set_context($context)
- Forces the context to be a particular value.
Plugins
enable_plugin()
- Turn on a plugin
disable_plugin()
- Turn off a plugin
is_plugin_enabled()
- Check if a plugin is installed and enabled
Interface and annotations
elgg_view_listing($icon, $info)
- Return the result in a formatted list.
elgg_count_comments(entity)
- Count the comments on a particular entity.
elgg_view_comments($entity)
- Returns any comments associated with the given entity
friendly_time($unix_timestamp)
- Returns a date formatted in a friendlier way - "18 minutes ago", "2 days ago", etc.
parse_urls($string)
- Converts any URLs in the given string to clickable links.
You can pass 'override' => 'true' to the icon view if you don't want the avatar drop down menu to appear e.g.
elgg_view
(
"profile/icon"
,
array
(
'entity'
=>
$entity
,
'size'
=>
'small'
,
'override'
=>
'true'
)
)
Navigation
Documentation front page
Recent changes
Search docs
Views
Page
Discussion
View source
History