Elgg  Version 3.0
Elgg\Core Namespace Reference

Updates the advanced settings for the primary site object. More...

Detailed Description

Updates the advanced settings for the primary site object.

Elgg RSS output pageshell.

Assembles and outputs the registration 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.

Elgg icons.

Helpers CSS.

Elgg Admin CSS.

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 statistics library.

Elgg session management Functions to manage logins.

Elgg river.

Elgg relationships.

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 metadata Functions to manage entity metadata.

Elgg language module Functions to manage language and translations.

Parameter input functions.

Elgg Groups.

Elgg filestore.

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 admin functions.

Elgg Actions.

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

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

RegistrationException Could not register a new user for whatever reason.

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.

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

A parser for XML that uses SimpleXMLElement.

River item class.

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.

Elgg Menu Item.

Elgg Menu Builder.

This class defines the interface for all elgg data repositories.

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.

Access collection class.

Elgg Transliterate.

Delegates requests to controllers based on the registered configuration.

PRIVATE CLASS.

Notification event interface.

Notification container.

Subscription 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/.

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

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

WARNING: API IN FLUX.

Control configuration of RequireJS.

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.

Elgg save widget settings action.

Action for adding and editing comments.

Updates the basic settings for the primary site object.

Options are saved among metadata on the site object 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

Comments

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.

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

JavaScript

DO NOT USE DIRECTLY.

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

JavaScript

Since
1.9
1.9

DO NOT USE DIRECTLY.

Forms

Since
1.10.0

Groups

DO NOT USE DIRECTLY.

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

Http

Since
1.10.0

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

Http

Since
1.10

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

Json

Notifications

Notifications

Since
1.10

Notifications

API IN FLUX. DO NOT USE DIRECTLY.

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.

Plugin devs should use elgg_register_route() to register a named route or define it in elgg-plugin.php

Router

Since
1.9.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

Core

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
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\ElggFileobjectandspecifyafilenameOpenthefileusingtheappropriatemode,andyouwillbeabletoreadandwritetothefile.Optionally,youcanalsocallthefile'ssave()method,thiswillturnthefileintoanentityinthesystemandpermityoutodothingslikeattachtagstothefile.Ifyoudonotsavethefile,noentityiscreatedinthedatabase.Thisisbecausethereareoccasionswhenyoumaywantaccesstofiledataondatastoresusingthe\ElggFileinterfacewithoutaneedtopersistinformationsuchastemporaryfiles.@subpackageDataModel.File@subpackageDataStorage@subpackageNavigation@since1.8.0Tocreateamenuitemthatisnotalink,passfalsefor$href.Anyundocumentedpropertiessetwillbepassedtotheoutput/urlviewduringrendering.E.g.togiveamenuitema"target"attribute,set$item->target,orincludea"target"keyintheoptionsarrayforfactory().@subpackageNavigation@since1.8.0Normalizesthevaluesfromthe\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\xrefitemtodo25.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@warningThisshouldbeusedbyawrapperclasslike@link\ElggFile.@subpackageFileStore.Disk@since3.0Storesmetadatainprivatesettingsratherthanas\ElggMetadata@subpackageWidgets@subpackageXML@see\Elgg\Integration\ElggCoreRegressionBugsTest@see\Elgg\Integration\ElggCorePluginsAPITest@subpackageSocialModel.Friendable@subpackageExceptionSubclassforspecificIOExceptions.@subpackageException@subpackageSocialModel.LocatableThisinterfacedefinesasetofmethodsthatpermitthesystemlogfunctionstohookinandretrievethenecessaryinformationandtoidentifywhateventscanactuallybelogged.Tohaveeventsinvolvingyourobjecttobeloggedsimplyimplementthisinterface.@subpackageDataModel.LoggableGenericparentclassforloginexceptions.@subpackageExceptions.Stub@subpackageExceptionsSubclassforspecificSecurityExeceptions(accessproblemsetc)@subpackageExceptionAccessisgenerallysavedinthedatabaseasaccess_id.ThiscorrespondstooneoftheACCESS_*constantsdefinedin@linkelgglib.phportheIDofanaccesscollection.@subpackageAccess@seehttp://learn.elgg.org/en/stable/guides/actions.html@subpackageActionsAdminpagesPluginsnonotneedtoprovidetheirownpagehandlertoaddapagetotheadminarea.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@subpackageCache@subpackageComments@since1.9@subpackageCronIncludesfunctionsforreadingdata,writingdata,andescapingqueries.@subpackageDatabase\xrefitemtodo33.Thisfilecontainsfunctionsforsavingandretrievingdatafromfiles.@subpackageDataModel.FileStorageGroupscontainotherentities,orratheractasaplaceholderforotherentitiestomarkanygivencontainerastheircontainer.@subpackageDataModel.GroupThisfilecontainsfunctionsforgettinginputfromget/postvariables.@subpackageInput@subpackageLanguages@subpackageDataModel.MetadataBreadcrumbsElggusesabreadcrumbstack.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.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@subpackageDataModel.RelationshipActivitystreamfunctions.@subpackageRiver@subpackageSessionThisfilecontainsanumberoffunctionsforobtainingstatisticsabouttherunningsystem.Thesestatisticsaremainlyusedbytheadministrationpages,andisalsowherethebasicviewsforstatisticsareadded.@subpackageStatistics@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['entity']Thepluginobjecttodisplaysettingsfor.@usesElggPlugin$vars['plugin']Sameasentityrequiredforpluginsettingsbackwardcompatibility@subpackagePlugins.SettingsThisisadistinctthemefromthethemeofthesite.TherearedependenciesontheHTMLcreatedbytheviewsinElggcore.@subpackageUIContainsgenericelementsthatcanbeusedthroughoutthesite.@subpackageUI@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@subpackageRegistrationSince1.8,registrationcanbedisabledviaadministration.Ifthisisthecase,callstothispagewillforwardtothenetworkfrontpage.Iftheuserisloggedin,thispagewillforwardtothenetworkfrontpage.@subpackageRegistration@uses$vars['title']ThetitleoftheRSSfeed@uses$vars['body']TheitemsfortheRSSfeedasastring@uses$vars['descrption']ThedescriptionfortheRSSfeed