demodata (line
63)
insert basic demonstration data; the foundation for the module/theme demonstration data
this routine inserts all sorts of demonstation data as a foundation for the demonstration of various modules and themes.
The array &$messages is used to pass (error) messages back to the caller. The overall result returned is TRUE on success, or FALSE on failure.
The parameter &$config is used to communicate essential information about the site that is being installed, such as the main URL and the various directories. Also the information about the first user account is passed; this can be used to setup alerts etc. Finally, this array is used to return the three numbers of the three demonstration areas created.
The first demonstration area is a public area. This would be the area to show off all bells and whistles of the CMS. The second demonstration area is a private area. This area could be used to show off an intranet-type of application, maybe accessible only to members of the team. The third area is an in-active area, just for the heck of it.
Note that the demonstration data is to be translated. All translations can be found in /program/install/languages/LL/demodata.php where LL indicates the language code. The language to use is specified in the parameter $config['language_key'].
This routine is completely self-contained, even the translations are handled manually here.
bool
demodata
(array &$messages, array &$config)
-
array
&$messages: used to return (error) messages to caller
-
array
&$config: pertinent information about the site and also returns the area_id's used for the demo
demodata_alerts (line
912)
create a few alerts
bool
demodata_alerts
(array &$messages, array &$config, array &$tr)
-
array
&$messages: used to return (error) messages to caller
-
array
&$config: pertinent information about the site
-
array
&$tr: translations of demodata texts
demodata_areas (line
108)
create three areas + themes
bool
demodata_areas
(array &$messages, array &$config, array &$tr)
-
array
&$messages: used to return (error) messages to caller
-
array
&$config: pertinent information about the site
-
array
&$tr: translations of demodata texts
demodata_sections_pages (line
552)
create a few sections and pages
bool
demodata_sections_pages
(array &$messages, array &$config, array &$tr)
-
array
&$messages: used to return (error) messages to caller
-
array
&$config: pertinent information about the site
-
array
&$tr: translations of demodata texts
demodata_users_groups (line
258)
create a handful of users/groups/capacities/acls
This routine creates the following 4 groups:
- faculty (principals and teachers)
- team (principals and teachers and all other employees)
- seniors (pupils in grades 5 to 8)
- juniors (pupils in grades 1 to 4)
The following 7 group/capacties are also created
- faculty/principal (3)
- faculty/member (4)
- team/member (4)
- seniors/pupil (1)
- seniors/teacher (2)
- juniors/pupil (1)
- juniors/teacher (2)
The following 8 users are also created
- Amelia Cackle (acackl): Faculty/Principal, Team/Member
- Maria Montessori (mmonte): Faculty/Member, Team/Member, Seniors/Teacher
- Helen Parkhurst (hparkh): Faculty/Member, Team/Member, Juniors/Teacher
- Freddie Frinton (ffrint): Team/Member
- Andrew Reese (andrew): Seniors/Pupil
- Catherine Hayes (catherine): Seniors/Pupil
- Herbert Spencer (herberd): Juniors/Pupil
- Georgina King (georgina): Juniors/Pupil
Every user and every group/capacity gets their own acl
- faculty/principal: access to all private areas
- faculty/member: access to intranet in $config['private_area_id']
- others get no special privileges
bool
demodata_users_groups
(array &$messages, array &$config, array &$tr)
-
array
&$messages: used to return (error) messages to caller
-
array
&$config: pertinent information about the site
-
array
&$tr: translations of demodata texts