Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Elgg\Core Namespace Reference

Activate a plugin or plugins. More...

Detailed Description

Activate a plugin or plugins.

Elgg RSS output pageshell.

Elgg friends of page.

Elgg friends page.

Elgg collections of friends.

Elgg friends picker callback.

Elgg add a collection of friends.

Assembles and outputs the registration page.

Assembles and outputs a login page.

Assembles and outputs the forgotten password page.

Page for resetting a forgotten password.

Used to show plugin user settings.

Displays an invalid plugin on the admin screen.

Displays a plugin on the admin screen.

Shows a table of plugin dependecies for ElggPlugin in $vars['plugin'].

Shows a list of contributors for ElggPlugin in $vars['plugin'].

Load AMD modules required by the menu item.

A single element of a menu.

Plugin user settings.

Used to show plugin settings for both users and admins.

Elgg primary CSS view.

CSS typography.

CSS reset.

Navigation.

Page Layout.

Elgg icons.

Helpers CSS.

CSS grid.

CSS form/input elements.

Layout Object CSS.

CSS buttons.

Elgg Admin CSS.

Elgg administration plugin screen.

Elgg plugin settings.

Default widgets landing page.

Elgg widgets library.

Elgg's view system.

Elgg users Functions to manage multiple or single users in an Elgg install.

Elgg user settings functions.

Elgg upgrade library.

Elgg tags Functions for managing tags and tag clouds.

Elgg system log.

Elgg statistics library.

Elgg sites Functions to manage multiple or single sites in an Elgg install.

Elgg session management Functions to manage logins.

Elgg river.

Elgg relationships.

Private settings for entities Private settings provide metadata like storage of settings for plugins and users.

Elgg Simple PAM library Contains functions for managing authentication.

Elgg page owner library Contains functions for managing page ownership and context.

Elgg page handler functions.

Notifications This file contains classes and functions which allow plugins to register and send notifications.

Adding a New Notification Event

Elgg navigation library Functions for managing menus and other navigational elements.

Elgg metastrngs Functions to manage object metastrings.

Elgg metadata Functions to manage entity metadata.

Elgg memcache support.

Elgg language module Functions to manage language and translations.

Parameter input functions.

Elgg Groups.

Elgg friends library.

Elgg filestore.

Elgg Entity Extender.

Bootstrapping and helper procedural code available for use in Elgg core and plugins.

Elgg database procedural code.

Elgg cron library.

Elgg comments library.

Elgg cache Cache file interface for caching data.

Elgg autoloader Facilities for class/interface/trait autoloading.

Elgg admin functions.

Elgg Actions.

Functions for Elgg's access system for entities, metadata, and annotations.

A class representing an XML element for import.

SecurityException An Security Exception, throw when a Security Exception occurs.

RegistrationException Could not register a new user for whatever reason.

PluginException.

ODD Metadata class.

ODD Entity class.

This class is used during import and export to construct.

Open Data Definition (ODD) superclass.

Notification exception.

Login Exception Stub.

Interface that provides an interface which must be implemented by all objects wishing to be recorded in the system log (and by extension the river).

Define an interface for geo-tagging entities.

IOException An IO Exception, throw when an IO Exception occurs.

InvalidParameterException A parameter is invalid.

InvalidClassException An invalid class Exception, throw when a class is invalid.

InstallationException Thrown when there is a major problem with the installation.

IncompleteEntityException Thrown when constructing an entity that is missing its secondary entity table.

Import exception.

Define an interface for all ODD importable objects.

An interface for objects that behave as elements within a social network that have a profile.

Export exception.

Define an interface for all ODD exportable objects.

A parser for XML that uses SimpleXMLElement.

Dummy cache which stores values in a static array.

A Site entity.

Shared memory cache description.

Elgg Session Management.

River item class.

Elgg RewriteTester.

Relationship class.

Iterate over elements in a specific priority.

Manages plugin packages under mod.

Plugin manifest.xml parser for Elgg 1.8 and above.

Parent class for manifest parsers.

Parses Elgg manifest.xml files.

Stores site-side plugin settings as private data.

Pluggable Authentication Module

Elgg Object.

Elgg Menu Item.

Elgg Menu Builder.

Memcache wrapper class.

Elgg Installer.

Class representing a container for other elgg entities.

This class defines the interface for all elgg data repositories.

Store cached data in a file store.

This class represents a physical file.

The base class for extenders.

The parent class for all Elgg Entities.

A filestore that uses disk as storage.

A generic class that contains shared code among , , and .

A simple object model for an HTTP cookie.

The elgg cache superclass.

DataModel

Create wrapper P and BR elements in HTML depending on newlines.

Elgg Annotations.

Elgg Transliterate.

Delegates requests to controllers based on the registered configuration.

Queue interface.

FIFO queue that is memory based (not persistent)

FIFO queue that uses the database for persistence.

Internal component to detect and fix some whitespace issues.

PRIVATE CLASS.

Notification container.

Notification event.

Encode and decode JSON while converting empty string keys to a unique token.

Overview: http://html5doctor.com/web-manifest-specification/ Spec: https://w3c.github.io/manifest/.

Database session handler.

Determines if otherwise visible items should be hidden from a user due to group policy or visibility.

Service for Events.

Locate the relative path of an entity's data dir.

Missing value exception.

Factory uncallable exception.

Container holding values which can be resolved upon reading and optionally stored and shared across reads.

Wrap an object and display warnings whenever the object's variables are accessed or a method is used.

An object representing a single Elgg database.

Manages a site-specific secret key, encoded as a 32 byte string "secret".

Count queries performed.

Normalization for strings used in metadata and annoations tables.

Persistent, installation-wide key-value storage.

These settings are stored in the dbprefix_config table and read during system boot into $CONFIG.

Provides a structured format for parsing and examining our commit messages.

A map of class names to absolute file paths.

A class/interface/trait autoloader for PHP.

Least Recently Used Cache.

Manages core autoloading and caching of class maps.

Loads attributes from DB or validates those passed in via constructor.

File server handler.

Simplecache handler.

Control configuration of RequireJS.

WARNING: API IN FLUX.

Data format exception An exception thrown when there is a problem in the format of some data.

Database Exception.

Class not found.

Class Exception.

Call Exception Stub.

Defines database credentials.

Stub info for $CONFIG global options.

Elgg save widget settings action.

Elgg widget move action.

Elgg widget delete action.

Elgg widget add action.

Aggregate action for saving settings.

Action to request a new password.

Elgg registration action.

Saves user-specific plugin settings.

Saves global plugin settings.

Elgg login action.

Elgg remove friend action.

Friends collection edit action.

Elgg friends: delete collection action.

Elgg collection add page.

Elgg add friend action.

Action for adding and editing comments.

Delete comment entity.

Unbans a user.

Reset a user's password.

Revokes admin privileges from a user.

Grants admin privileges to a user.

Delete a user.

Bans a user.

Updates the basic settings for the primary site object.

Updates the advanced settings for the primary site object.

Changes the load priority of a plugin.

Disable all specified installed plugins.

Deactivate a plugin or plugins.

Activates all specified installed and inactive plugins.

Plugins to be activated are passed via $_REQUEST['plugin_guids'] as GUIDs. After activating the plugin(s), the views cache and simplecache are invalidated.

mixed $_GET['plugin_guids'] The GUIDs of the plugin to activate. Can be an array.

Administration.Plugins

All specified plugins in the mod/ directory that aren't active are activated and the views cache and simplecache are invalidated.

Administration.Plugins

Plugins to be deactivated are passed via $_REQUEST['plugin_guids'] as GUIDs. After deactivating the plugin(s), the views cache and simplecache are invalidated.

mixed $_GET['plugin_guids'] The GUIDs of the plugin to deactivate. Can be an array.

Administration.Plugins

Specified plugins in the mod/ directory are disabled and the views cache and simplecache are reset.

Administration.Plugins

Plugin priority affects view, action, and page handler overriding as well as the order of view extensions. Plugins with higher priority are loaded after and override plugins with lower priorities.

NOTE: When viewing the plugin admin page, plugins LOWER on the page have HIGHER priority and will override views, etc from plugins above them.

Administration.Plugins

Options are saved among metadata on the site object, entries in the datalist table, and entries in the config table.

Administration.Site

Basic site settings are saved as metadata on the site object, with the exception of the default language, which is saved in the config table.

Administration.Site

User entities are banned by setting the 'banned' column to 'yes' in the users_entity table.

Administration.User

The user will be deleted recursively, meaning all entities owned or contained by the user will also be removed.

Administration.User

In >=1.7.1, admin is flagged by setting the admin column in the users_entity table.

In <1.7.1, admin is a piece of metadata on the user object.

Administration.User

Administration.User

This is an admin action that generates a new salt and password for a user, then emails the password to the user's registered email address.

NOTE: This is different to the "reset password" link users can use in that it does not first email the user asking if they want to have their password reset.

Administration.User

Comments

Friends.Management

Friends.Collections

User.Authentication

This action can be overriden for a specific plugin by creating the <plugin_id>/settings/save action in that plugin.

array $_REQUEST['params'] A set of key/value pairs to save to the ElggPlugin entity int $_REQUEST['plugin_id'] The ID of the plugin

Plugins.Settings

This action can be overriden for a specific plugin by creating the <plugin_id>/usersettings/save action in that plugin.

array $_REQUEST['params'] A set of key/value pairs to save to the ElggPlugin entity int $_REQUEST['plugin_id'] The id of the plugin int $_REQUEST['user_guid'] The GUID of the user to save settings for.

Plugins.Settings

User.Account

UserSettings

Widgets.Management

Widgets.Management

int $_REQUEST['guid'] The guid of the widget to save array $_REQUEST['params'] An array of params to set on the widget. int $_REQUEST['default_widgets'] Flag for if these settings are for default wigets. string $_REQUEST['context'] An optional context of the widget. Used to return the correct output if widget content changes depending on context. string $_REQUEST['title'] Optional title for the widget

Plugins should never use the $CONFIG array directly.

Configuration

Most of Elgg's configuration is stored in the database. This file contains the credentials to connect to the database, as well as a few optional configuration values.

The Elgg installation attempts to populate this file with the correct settings and then rename it to settings.php.

Generic parent class for Call exceptions

Exceptions.Stub

A generic parent class for Class exceptions

Exceptions.Stub

Thrown when trying to load a class that doesn't exist.

Exceptions

A generic parent class for database exceptions

Exceptions.Stub

Exceptions.Stub

DO NOT USE DIRECTLY.

Use the elgg_* versions instead.

private

Actions

Since
1.9.0

JavaScript

private

DO NOT USE DIRECTLY.

This filter adds AMD names to anonymous AMD modules defined in views.

JavaScript

Since
1.9

private

private

DO NOT USE DIRECTLY.

private

Assets

Since
1.10.0

private

DataModel

private

Autoloader

A fixed sized cache that removes the element used last when it reaches its size limit.

Based on https://github.com/cash/LRUCache

private

Cache

DO NOT USE DIRECTLY.

private

Cache

Since
1.10.0

It is able to load classes that use either:

Classes from a sub-namespace or a sub-hierarchy of PEAR classes can be looked for in a list of locations to ease the vendoring of a sub-set of classes for large projects.

All discovered files are stored in the internal class map and the map is queried before attempting to find a file.

Contains code from Symfony2's UniversalClassLoader.

Copyright (c) 2004-2013 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

private

Autoloader

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Since
1.9

private

DO NOT USE DIRECTLY.

private

Database

Since
1.10.0

DO NOT USE DIRECTLY.

Controls all admin notices in the system.

private

Database

Since
1.10.0

DO NOT USE DIRECTLY.

private

Database

Since
1.9.0

WARNING: API IN FLUX. DO NOT USE DIRECTLY.

private

Database

Since
1.10.0

WARNING: API IN FLUX. DO NOT USE DIRECTLY.

private

Database

Since
1.10.0

private

Do not use directly. Use _elgg_db_get_query_counter().

private

Database

Since
1.9.0

The key can have two formats:

The hex keys were created with rand() as the only decent source of entropy (the site's creation time is not too difficult to find). As such, systems with a low getrandmax() value created particularly weak keys. You can check key string using getStrength().

private

Database

Since
1.10.0

WARNING: THIS API IS IN FLUX. PLUGIN AUTHORS SHOULD NOT USE. See lib/database.php instead.

private

Database

DO NOT USE DIRECTLY.

private

Since
1.11

DO NOT USE DIRECTLY.

Use the elgg_* versions instead.

private

Deprecation

Since
1.11.0

It can also be used to wrap a string.

Note that the wrapper will not share the type of the wrapped object and will fail type hints, instanceof, etc.

This was introduced for deprecating passing particular variabled to views automatically in elgg_view(). It also used to wrap the deprecated global $SESSION. It can be removed once that use is no longer required.

Wraps: url string in ViewsService config object in ViewsService user object in ViewsService session object in session lib config object in ElggPlugin::includeFile

private

$c = new ();

$c->setFactory('foo', 'Foo_factory'); // $c will be passed to Foo_factory() $c->foo; // new Foo instance $c->foo; // same instance

$c->setFactory('bar', 'Bar_factory', false); // non-shared $c->bar; // new Bar instance $c->bar; // different Bar instance

$c->setValue('a_string', 'foo_factory'); // don't call this $c->a_string; // 'foo_factory'

private

Since
1.9

This returns paths like: '1/27/'.

Note
This class does not require the Elgg engine to be loaded and is suitable for being used directly.

private

private

Hooks

Since
1.9.0

DO NOT USE DIRECTLY.

Forms

Since
1.10.0

private

Groups

private

DO NOT USE DIRECTLY.

Use the elgg_* versions instead.

private

Hooks

Since
1.9.0

private

Http

DO NOT USE DIRECTLY.

Provides unified access to the $_GET and $_POST inputs.

Http

Since
1.10.0 private

Support was added to Chrome 39 and is expected to come to Firefox soon.

Http

Since
1.10

private

This gets around PHP's limitation of not allowing empty string object property names. https://bugs.php.net/bug.php?id=46600

Json private

DO NOT USE DIRECTLY.

Use the elgg_* versions instead.

private

Logging

Since
1.9.0

Notifications

Notifications

Since
1.9.0

Notifications

Since
1.10

Notifications

Since
1.9.0

DO NOT USE DIRECTLY.

private

Notifications

Since
1.9.0

API IN FLUX. DO NOT USE DIRECTLY.

private

Since
1.10.0

If a user selects a persistent login, a long, random token is generated and stored in the cookie called "elggperm", and a hash of the token is stored in the DB. If the user's PHP session expires, the session boot sequence will try to log the user in via the token in the cookie.

Before Elgg 1.9, the token hashes were stored as "code" in the users_entity table.

In Elgg 1.9, the token hashes are stored as "code" in the users_remember_me_cookies table, allowing multiple browsers to maintain persistent logins.

Legacy notes: This feature used to be called "remember me"; confusingly, both the tokens and the hashes were called "codes"; old tokens were hexadecimal and lower entropy; new tokens are base64 URL and always begin with the letter "z"; the boot sequence replaces old tokens whenever possible.

private

private

Project

WARNING: API IN FLUX. DO NOT USE DIRECTLY.

private

Queue

Since
1.9.0

Plugin devs should use these wrapper functions:

Router

Since
1.9.0 private

DO NOT USE DIRECTLY.

Use the elgg_* versions instead.

private

UX

Since
1.11.0

For creating "friendly titles" for URLs

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals and is licensed under the LGPL. For more information, see http://www.doctrine-project.org.

Author
Konsta Vesterinen kvest.nosp@m.eri@.nosp@m.cc.hu.nosp@m.t.fi
Jonathan H. Wage jonwa.nosp@m.ge@g.nosp@m.mail..nosp@m.com
Steve Clay steve.nosp@m.@mrc.nosp@m.lay.o.nosp@m.rg

private Plugin authors should not use this directly

DO NOT USE DIRECTLY.

Use the elgg_* versions instead.

private

Widgets

Since
1.9.0

Annotations allow you to attach bits of information to entities. They are essentially the same as metadata, but with additional helper functions for performing calculations.

Note
Internal: Annotations are stored in the annotations table.

DataModel.Annotations

Useful when users use newlines to signal line and paragraph breaks. In all cases output should be well-formed markup.

In DIV elements, Ps are only added when there would be at least two of them.

Output

Since
1.8

This defines the interface for a cache (wherever that cache is stored).

Cache

Comments

Since
1.9.0

Http

See Also
elgg_set_cookie()
http://php.net/manual/en/function.setcookie.php
http://php.net/manual/en/function.session-set-cookie-params.php
Since
1.9.0

Crypto

private

Warning
This should be used by a wrapper class like ElggFile.@subpackageFileStore.DiskAn\ElggEntityisoneofthebasicdatamodelsinElgg.Itistheprimarymeansofstoringandretrievingdatafromthedatabase.An\ElggEntityrepresentsonerowoftheentitiestable.The\ElggEntityclasshandlesCRUDoperationsfortheentitiestable.\ElggEntityshouldalwaysbeextendedbyanotherclasstohandleCRUDoperationsonthetype-specifictable.\ElggEntityusesmagicmethodsforgetandset,soanypropertythatisn'tdeclaredwillbeassumedtobemetadataandwrittentothedatabaseasmetadataontheobject.Allchildrenclassesmustdeclarewhichpropertiesarecolumnsofthetypetableortheywillbeassumedtobemetadata.See\ElggObject::initializeAttributes()forexamples.Coresupports4typesofentities:\ElggObject,\ElggUser,\ElggGroup,and\ElggSite.@tipPluginauthorswillwanttoextendthe\ElggObjectclass,notthisclass.@subpackageDataModel.EntitiesExtendersallowyoutoattachextendedinformationtoan\ElggEntity.Coresupportstwo:\ElggAnnotationand\ElggMetadata.Savingtheextenderdatatodatabaseishandledbythechildclass.@subpackageDataModel.Extender@see\ElggAnnotation@see\ElggMetadataCreateanew\ElggFileobjectandspecifyafilename,andoptionallyaFileStore(ifoneisn'tspecifiedthenthedefaultisassumed.)Openthefileusingtheappropriatemode,andyouwillbeabletoreadandwritetothefile.Optionally,youcanalsocallthefile'ssave()method,thiswillturnthefileintoanentityinthesystemandpermityoutodothingslikeattachtagstothefile.Ifyoudonotsavethefile,noentityiscreatedinthedatabase.Thisisbecausethereareoccasionswhenyoumaywantaccesstofiledataondatastoresusingthe\ElggFileinterfacewithoutaneedtopersistinformationsuchastemporaryfiles.@subpackageDataModel.File@subpackageCaches@subpackageDataStorage@subpackageGroupsControllerforinstallingElgg.Supportsbothweb-basedonCLIinstallation.Thiscontrollerstepstheuserthroughtheinstallprocess.ThemethodforeachstephandlesboththeGETandPOSTrequests.ThereisnoXSS/CSRFprotectiononthePOSTprocessingsincetheinstallerisonlyrunoncebytheadministrator.Theinstallationprocesscanberesumedbyhittingthefirstpage.Theinstallerwilltrytofigureoutwheretopickupagain.Allthelogicfortheinstallationprocessisinthisclass,butitdependsonthecorelibraries.Todothis,weselectivelyloadasubsetofthecorelibrariesforthefirstfewstepsandthenloadtheentireengineoncethedatabaseandsitesettingsareconfigured.Inaddition,thiscontrollerdoesitsownsessionhandlinguntilthedatabaseissetup.ThereisanabortedattemptinthecodeatcreatingthedatadirectoryforusersasasubdirectoryofElgg'sroot.Theideawastoprotectthisdirectorythrougha.htaccessfile.Theproblemisthatamalicioususercanuploada.htaccessofhisownthatoverridestheprotectionforhisuserdirectory.ThebestsolutionisserverlevelconfigurationthatturnsoffAllowOverrideforthedatadirectory.Seeticket#3453fordiscussiononthis.@subpackageInstaller@subpackageMemcache@subpackageNavigation@since1.8.0Tocreateamenuitemthatisnotalink,passfalsefor$href.Anyundocumentedpropertiessetwillbepassedtotheoutput/urlviewduringrendering.E.g.togiveamenuitema"target"attribute,set$item->target,orincludea"target"keyintheoptionsarrayforfactory().@subpackageNavigation@since1.8.0Thisclassdescribesmetadatathatcanbeattachedtoan\ElggEntity.ItisrarethataplugindeveloperneedstousethisAPIformetadata.Almostallinteractionwithmetadataoccursthroughthemethodsof\ElggEntity.Seeits__set(),__get(),andsetMetadata()methods.@subpackageMetadataElggobjectsarethemostcommonmeansofstoringinformationinthedatabase.Theyareachildclassof\ElggEntity,soreceiveallthebenefitsoftheEntities,butalsoincludeatitleanddescriptionfield.An\ElggObjectrepresentsarowfromtheobjects_entitytable,aswellastherelatedrowintheentitiestableasrepresentedbytheparent\ElggEntityobject.@noteInternal:Titleanddescriptionarestoredintheobjects_entitytable.@subpackageDataModel.Object@subpackageAuthenticationThisclassiscurrentlyastub,allowingaplugintosavesettingsinanobject'sprivatesettingsforeachsite.@subpackagePlugins.SettingsNormalizesthevaluesfromthe\ElggManifestParserobject.Thisrequiresan\ElggPluginManifestParserclassimplementationas$this->parser.Toaddnewparserversions,namethem\ElggPluginManifestParserXXwhereXXistheversionspecifiedinthetop-level<plugin_manifest>tag'sXMLnamespace.@subpackagePlugins@since1.8Convertsmanifest.xmlfilesorstringstoanarray.Thisshouldbeextendedbyaclassthatdoestheactualworktoconvertbasedonthemanifest.xmlversion.ThisclassonlyparsesXMLtoanXmlEntityobjectandanarray.Thearrayshouldbeusedprimarilytoextractinformationsinceitisquickertoparseonceandstorevaluesfromthe\ElggXmlElementobjectthantoparsetheobjecteachtime.Thearrayshouldbeanexactrepresentationofthemanifest.xmlfileorstring.Anynormalizationneedstobedoneinthecallingclass/function.@subpackagePlugins@since1.8@subpackagePlugins@since1.8\xrefitemtodo39.Around1.9orsoweshouldeachpluginovertousing\ElggPluginandmerge\ElggPluginPackageand\ElggPlugin.@subpackagePlugins@since1.8$pl=new\ElggPriorityList();$pl->add('Element 0');$pl->add('Element 10', 10);$pl->add('Element -10', -10);foreach($plas$priority=>$element)var_dump("$priority => $element");Yields:-10=>Element-100=>Element010=>Element10Collisionsonpriorityarehandledbyinsertingtheelementatorasclosetotherequestedpriorityaspossible:$pl=new\ElggPriorityList();$pl->add('Element 5', 5);$pl->add('Colliding element 5', 5);$pl->add('Another colliding element 5', 5);foreach($plas$priority=>$element)var_dump("$priority => $element");Yields:5=>'Element5',6=>'Collidingelement5',7=>'Anothercollidingelement5'Youcandoprioritylookupsbyelement:$pl=new\ElggPriorityList();$pl->add('Element 0');$pl->add('Element -5', -5);$pl->add('Element 10', 10);$pl->add('Element -10', -10);$priority=$pl->getPriority('Element -5');Orelementlookupsbypriority.$element=$pl->getElement(-5);Toremoveelements,passtheelement.$pl->remove('Element -10');Tocheckifanelementexists:$pl->contains('Element -5');Tomoveanelement:$pl->move('Element -5', -3);\ElggPriorityListonlytrackspriority.Nocheckingisdonein\ElggPriorityListforduplicatesorupdating.Ifyouneedtotrackthisuseobjectsandanexternalmap:functionelgg_register_something($id, $display_name, $location, $priority = 500)//$id=>$element.static$map=array();static$list;if(!$list)$list=new\ElggPriorityList();//updateifalreadyregistered.if(isset($map[$id]))$element=$map[$id];//moveitfirstbecausewehavetopasstheoriginalelement.if(!$list->move($element, $priority))returnfalse;$element->display_name=$display_name;$element->location=$location;else$element=new\stdClass();$element->display_name=$display_name;$element->location=$location;if(!$list->add($element, $priority))returnfalse;$map[$id]=$element;returntrue;@subpackageHelpers@subpackageCoreTestifURLrewritingisworking.@subpackageInstallerReservedkeys:last_forward_from,msg,sticky_forms,user,guid,id,code,name,usernameDeprecatedkeys:user,id,name,username\ArrayAccesswasdeprecatedinElgg1.9.Thismeansyoushoulduse$session->get('foo')ratherthan$session['foo'].Warning:Youcannotaccessmultidimensionalarraysthrough\ArrayAccesslikethis$session['foo']['bar']@subpackageSession@seeelgg_get_session()Extends\ElggCachewithfunctionsusefultosharedmemorystylecaches(staticvariables,memcacheetc)@subpackageCache\ElggSiterepresentsasinglesiteentity.An\ElggSiteobjectisan\ElggEntitychildclasswiththesubtypeof"site."Itiscreateduponinstallationandholdsinformationaboutasite:-name-description-urlEvery\ElggEntitybelongstoasite.@noteInternal:\ElggSiterepresentsasinglerowfromthesites_entitytable,aswellasthecorresponding\ElggEntityrowfromtheentitiestable.@warningMultiplesitesupportisn'tfullydeveloped.@subpackageDataMode.Site@linkhttp://learn.elgg.org/en/stable/design/database.htmlUsingthismakesfuturereplacementstoothercachingbackends(egmemcache)mucheasier.@subpackageCacheRepresentationofa"user"inthesystem.@subpackageDataModel.UserStoresmetadatainprivatesettingsratherthanas\ElggMetadata@subpackageWidgets@subpackageXML@subpackageODD\xrefitemdeprecated81.@subpackageException\xrefitemdeprecated82.@subpackageSocialModel.Friendable@subpackageDataModel.Importable\xrefitemdeprecated83.@subpackageException\xrefitemdeprecated84.@subpackageException@accessprivate@subpackageExceptionSubclassforspecificIOExceptions.@subpackageException@subpackageSocialModel.LocatableThisinterfacedefinesasetofmethodsthatpermitthesystemlogfunctionstohookinandretrievethenecessaryinformationandtoidentifywhateventscanactuallybelogged.Tohaveeventsinvolvingyourobjecttobeloggedsimplyimplementthisinterface.@subpackageDataModel.LoggableGenericparentclassforloginexceptions.@subpackageExceptions.Stub@subpackageODD\xrefitemdeprecated85.@subpackageODD\xrefitemdeprecated86.@subpackageODD\xrefitemdeprecated87.@subpackageODD\xrefitemdeprecated88.ApluginException,thrownwhenanExceptionoccursrelatingtothepluginmechanism.SubclassforspecificpluginExceptions.@subpackageException@subpackageExceptionsSubclassforspecificSecurityExeceptions(accessproblemsetc)@subpackageException@subpackageXML\xrefitemdeprecated90.Accessisgenerallysavedinthedatabaseasaccess_id.ThiscorrespondstooneoftheACCESS_*constantsdefinedin@linkelgglib.phportheIDofanaccesscollection.@subpackageAccess@seehttp://learn.elgg.org/en/latest/guides/actions.html@subpackageActionsAdminmenuitemsElgghasaconveniencefunctionforaddingmenuitemstothesidebaroftheadminarea.@seeelgg_register_admin_menu_item()AdminpagesPluginsnonotneedtoprovidetheirownpagehandlertoaddapagetotheadminarea.Aviewplacedatadmin/<section>/<subsection>canbeaccessathttp://example.org/admin/<section>/<subsection>.Thetitleofthepagewillbeelgg_echo('admin:<section>:<subsection>').Foranexampleofhowtoaddapagetotheadminarea,seethediagnosticsplugin.AdminnoticesSystemmessages(successanderrormessages)areusedinboththemainsiteandtheadminarea.Thereisaspecialpresistentmessagefortheadminareacalledanadminnotice.Itshouldbeusedwhenapluginrequiresanadministratortotakeanaction.@seeelgg_add_admin_notice()@subpackageAdmin@subpackageAutoloader@subpackageCache@subpackageComments@since1.9@subpackageCronIncludesfunctionsforreadingdata,writingdata,andescapingqueries.@subpackageDatabase\xrefitemtodo63.ThisfilecontainswaysofextendinganElggentityincustomways.@subpackageDataModel.ExtenderThisfilecontainsfunctionsforsavingandretrievingdatafromfiles.@subpackageDataModel.FileStorageProvidestheUIforfriends.Includesaccesscollectionssincetheyarebasedonfriendsrelationships.@subpackageFriendsGroupscontainotherentities,orratheractasaplaceholderforotherentitiestomarkanygivencontainerastheircontainer.@subpackageDataModel.GroupThisfilecontainsfunctionsforgettinginputfromget/postvariables.@subpackageInput@subpackageLanguagesRequiresphp5-memcachetowork.@subpackageCache.Memcache@subpackageDataModel.Metadata@subpackageDataModel.MetaStringsBreadcrumbsElggusesabreadcrumbstack.Thepagehandlers(controllersinMVCterms)pushthebreadcrumblinksontothestack.@seeelgg_push_breadcrumb()PaginationAutomaticallyhandledbyElggwhenusingelgg_list_entities*functions.@seeelgg_list_entities()Tabs@seenavigation/tabsviewMenusElggusesasingleinterfacetomanageitsmenus.Menuitemsareaddedwith@linkelgg_register_menu_item().Thisisgenerallyusedformenusthatappearonlyonceperpage.Fordynamicmenus(suchasthehovermenuforuser'savatar),apluginhookisemittedwhenthemenuisbeingcreated.Thehookis'register','menu:<menu_name>'.Formoredetailsonthis,@seeelgg_view_menu().MenussupportedbytheElggcoreStandardmenus:siteSitenavigationshownoneverypage.pagePagemenuusuallyshowninasidebar.UsesElgg'scontext.topbarTopbarmenushownoneverypage.Thedefaulthastwosections.footerLikethetopbarbutinthefooter.extrasLinksaboutcontentonthepage.TheRSSlinkisaddedtothis.Dynamicmenus(alsocalledjust-in-timemenus):user_hoverAvatarhovermenu.Theuserentityispassedasaparameter.entityThesetoflinksshowninthesummaryofanentity.riverLinksshownonriveritems.owner_blockLinksshownforauserorgroupintheirownerblock.filterThetabfilterforcontent(all,mine,friends)titleThebuttonsshownnexttoacontenttitle.longtextThelinksshownabovetheinput/longtextview.loginMenuoflinksatbottomofloginbox@subpackageNavigation1.Registertheeventwithelgg_register_notification_event()2.Registerforthenotificationmessagepluginhook:'prepare','notification:[eventname]'.Theeventnameisoftheform[action]:[type]:[subtype].Forexample,thepublisheventforablogwouldbenamed'publish:object:blog'.Theparameterarrayforthepluginhookhasthekeys'event','method','recipient',and'language'.Theeventisan\Elgg\Notifications\EventobjectandcanprovideaccesstotheoriginalobjectoftheeventthroughthemethodgetObject()andtheoriginalactorthroughgetActor().Thepluginhookcallbackmodifiesandreturnsa\Elgg\Notifications\Notificationobjectthatholdsthemessagecontent.<h1>AddingaDeliveryMethod</h1>1.Registerthedeliverymethodnamewithelgg_register_notification_method()2.Registerforthepluginhookforsendingnotifications:'send','notification:[methodname]'.ItreceivesthenotificationobjectofthenamespaceElgg\Notifications;classNotificationintheparamsarraywiththekey'notification'.Thecallbackshouldreturnabooleantoindicatewhetherthemessagewassent.<h1>SubscribingaUserforNotifications</h1>Userssubscribetoreceivenotificationsbasedoncontaineranddeliverymethod.@subpackageNotificationsTherearenotificationmethodswhichareprovidedoutofthebox(seenotification_init()).Eachmethodisidentifiedbyastring,e.g."email".Toregisteraneventuseregister_notification_handler()andpassthemethodnameandahandlerfunction.Tosendanotificationcallnotify()passingitthemethodyouwishtousecombinedwithanumberofmethodspecificaddressingparameters.CatchNotificationExceptiontotraperrors.@subpackageNotifications@subpackageRouting@subpackagePageOwnerThisisnotafullimplementationofPAM.Itsupportsasinglefacility(authentication)andallowsmultiplepolicies(userauthenticationisthedefault).Therearetwocontrolflagspossibleforeachmodule:sufficientorrequired.Theentirechainforapolicyisprocessed(oruntilarequiredmodulefails).Amodulefailsbyreturningfalseorthrowinganexception.Theorderthatmodulesareprocessedisdeterminedbytheordertheyareregistered.ForanexampleofaPAM,seepam_auth_userpass()insessions.php.FormoreinformationonPAMssee:http://www.freebsd.org/doc/en/articles/pam/index.html@see\ElggPAM@subpackageAuthentication.PAM@subpackagePrivateSettings@subpackageDataModel.RelationshipActivitystreamfunctions.@subpackageRiver@subpackageSession@subpackageDataModel.SiteThisfilecontainsanumberoffunctionsforobtainingstatisticsabouttherunningsystem.Thesestatisticsaremainlyusedbytheadministrationpages,andisalsowherethebasicviewsforstatisticsareadded.@subpackageStatisticsListenstoeventsandwritescrudeventsintothesystemlogdatabase.@subpackageLogging@subpackageTagsContainscodeforhandlingversioningandupgrades.@subpackageUpgradeFunctionsforaddingandmanipulatingoptionsontheusersettingspanel.@subpackageSettings.User@subpackageDataModel.UserTheviewsystemistheprimarytemplatingengineinElggandrendersalloutput.Viewsareshort,parameterisedPHPscriptsfordisplayingoutputthatcanberegsitered,overridden,orextended.Theviewtypedeterminestheoutputformatandlocationofthefilesthatrenderstheview.Elggusesatwostepprocesstorenderfulloutput:firstcontent-specificelementsarerendered,thentheresultingcontentisinsertedintoalayoutanddisplayed.Thismakesiteasytomaintainaconsistentlookonallpages.Aviewcorrespondstoasinglefileonthefilesystemandtheviewsnameisitsdirectorystructure.Afilein<code>mod/plugins/views/default/myplugin/example.php</code>iscalledbysaying(withthedefaultviewtype):<code>echoelgg_view('myplugin/example');</code>Viewnamesthatareregisteredlateroverridethosethatareregisteredearlier.Forpluginsthiscorrespondsdirectlytotheirloadorder:viewsinpluginslowerinthelistoverridethosehigherinthelist.Pluginviewsbelongintheviews/directoryunderanappropriateviewtype.Viewsareautomaticallyregistered.Viewscanbeembedded-youcancallaviewfromwithinaview.Viewscanalsobeprependedorextendedbyanyotherview.Anyviewcanextendanyotherviewifregisteredwith@linkelgg_extend_view().Viewtypesaresetbypassing$_REQUEST['view'].Theviewtype'default'isastandardHTMLview.Typescanbedefinedontheflyandyoucangetthecurrentviewtypewith@linkelgg_get_viewtype().@noteInternal:Pluginviewsareautoregisteredbeforetheirinitfunctionsarecalled,sotheinitorderdoesn'taffectviews.@noteInternal:Thefilethatdeterminestheoutputoftheviewisthelastregisteredby@linkelgg_set_view_location().@subpackageViewsContainscodeforhandlingwidgets.@subpackageWidgets@subpackageAdministration.DefaultWidgets@usesElggPlugin$vars['plugin']Thepluginobjecttodisplaysettingsfor.@subpackagePlugins.SettingsShowsalistofpluginsthatcanbesortedandfiltered.@subpackageAdmin.PluginsThisisadistinctthemefromthethemeofthesite.TherearedependenciesontheHTMLcreatedbytheviewsinElggcore.@subpackageUI@subpackageUIImageblocks,lists,tables,gallery,messages@subpackageUI@subpackageUIToworkaroundsubpixelroundingdiscrepancies,apply.elgg-col-lasttothelastcolumn\xrefitemtodo89.Containsgenericelementsthatcanbeusedthroughoutthesite.@subpackageUIContainsCSSforthepageshellandpagelayoutDefaultlayout:990pxwide,centered.Usedindefaultpageshell@subpackageUI@subpackagePluginsCallsthepluginadminsettingsformbodywithtypesetto'user'@subpackagePlugins@subpackageNavigation@uses$vars['item']ElggMenuItem@uses$vars['item_class']AdditionalCSSclassforthemenuitem@subpackageNavigation@uses$vars['item']ElggMenuItem@subpackageAdmin.PluginsThisusesatablebecauseit'satableofdata.@subpackageAdmin.PluginsThisfilerendersapluginfortheadminscreen,includingactive/deactive,manifestdetails&displaypluginsettings.@uses$vars['entity']@uses$vars['display_reordering']Dowedisplaythepriorityreorderinglinks?@subpackagePluginsAninvalidpluginisapluginwhoseisValid()methodreturnsfalse.Thisusuallymeanstherearerequiredfilesmissing,unreadableorinthewrongformat.@subpackagePlugins@subpackageRegistrationThispageservesasafallbackfornon-JSuserswhoclickonthelogindropdownlink.Iftheuserisloggedin,thispagewillforwardtothefrontpage.@subpackageAccountsSince1.8,registrationcanbedisabledviaadministration.Ifthisisthecase,callstothispagewillforwardtothenetworkfrontpage.Iftheuserisloggedin,thispagewillforwardtothenetworkfrontpage.@subpackageRegistration@subpackageSocial.Collections@subpackageSocial.Friends@uses$vars['title']ThetitleoftheRSSfeed@uses$vars['body']TheitemsfortheRSSfeedasastring@uses$vars['descrption']ThedescriptionfortheRSSfeed