Template markers on frontpage (Bug#883377)

Made the template markers bold so that they stand out more.

Change-Id: Iccfe9305ce5a68223f7ba321ea9cd12e90408e94
Signed-off-by: Christopher Tombleson <christopher@catalyst.net.nz>
Add local hooks for registration and user initialisation (bug #1001064)

Three new hooks are added:

local_init_user() - called after $USER is initialised.  This is useful
for changing the user's theme before $THEME is initialised.

local_register_submit() - called when the registration form is
successfully submitted, but before the submitted values are saved to
usr_registration.  This is useful for remembering the properties or
preferences of the logged-out user when the form was submitted.

local_post_register() - called after a user has successfully been
created and logged in during registration.  This is useful when
properties of the user (which may have been saved to usr_registration
by local_register_submit()) need to be transferred to the newly
registered user.

Change-Id: Ifcb19737bdcecb550185624f2fd78e541690a337
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Don't write logged out user preferences to the db (bug #1001064)

$USER->set_account_preferences() always saves preferences to the
usr_account_preference table as well as to $USER.  Adding a test for
the user's id means that this function can be safely called on a
logged-out user.

Change-Id: Ieab78c5fbf30647dbb5dce10e960afb260c8dd1f
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Preserve registration 'extra' values during approval (bug #1001064)

When approving registration, there is an option to add institution
staff permission - this property is saved in the 'extra' column of the
usr_registration table.  But if the local registraion submit hook has
been used to store other properties in this column, they are removed
during approval.  This change ensures the existing properties are left
in place.

Change-Id: Icfa57f446e88ecee5213fb4ce6ff4fdb9f780f6a
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Remove duplicate rows

Change-Id: Ie8201f50fc4043ad40f8f7be8de4b700049f4247
Signed-off-by: Son Nguyen <son.nguyen@catalyst.net.nz>
Use consistent ordering in plans, blog blocks

If there are multiple blog posts or tasks with exactly the same
creation or completion time, the same blog post can appear on two
different pages of results, because the the order by part of the query
is not restrictive enough to produce an unambiguous order.

Change-Id: I59a7110b49e92af1a05dba37379707ea9fc225ef
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Add new function get_all_blocktype_javascript

This will get not only the js files but also the initialization code
result = array(
'jsfiles' => array(),
'initjs'  => array()
)

Change-Id: I2be9c19ab5bcc951b33f0feff17d0934af7ecce3
Signed-off-by: Son Nguyen <son.nguyen@catalyst.net.nz>
Initilization the property 'artefactplugin' of BlockInstance

This property is used in determine the path of blocktype

Change-Id: Icfeee5399d7899330efaac8fc9a323a1069aadd5
Signed-off-by: Son Nguyen <son.nguyen@catalyst.net.nz>
Merge "Remove duplicate rows"
Merge "Initilization the property 'artefactplugin' of BlockInstance"
Have more sorting options on member's listing in a group Bug#781990

5 sorting options:
 - Admin first
 - Name A to Z
 - Name Z to A
 - First joined
 - Last joined
* Name = display name if not empty, if else = first name lastname.

Change-Id: Ie14ce285a3f3e7f805ae6226c555c507c7e0fe23
Signed-off-by: Son Nguyen <son.nguyen@catalyst.net.nz>
Load jquery on every page (bug #1006213)

Change-Id: I942c1fbeaab3178ea040196ecafafa22bb2c73c2
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Merge "Load jquery on every page (bug #1006213)"
Expand group info to include number of forums and posts Bug#900652

Add number of forums, topics and posts associated to a group

Change-Id: I0928bff2113471084a80b1c04ec321293cb08b82
Signed-off-by: Son Nguyen <son.nguyen@catalyst.net.nz>
Merge "Expand group info to include number of forums and posts Bug#900652"
Gather themename, logo & stylesheets together in User object

The Theme constructor expects a triple (basename, logo, stylesheet),
which is passed by the User::get_themedata function.  But the three
properties are stored separately in the User object.  If they are
grouped together, then it will be easier to switch themes in and out
at a later date.

The three properties are combined under the 'institutiontheme' name,
to make it clear that they are defined by the user's institutions, and
to distinguish them from the user's own theme preference.

This requires a slight change to code for setting a view theme on view
creation, where only the basename property is allowed, because custom
themes with logos & stylesheets are not yet available as view themes.

Change-Id: Ie400a0f1c4a2172382dfaba14139f1b0b27f2120
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Add support in User for theme preference

Part of bug #793308

If a user has the 'theme' property set in their account preferences,
this is used instead of the site or institution's theme.

The LiveUser::reset_institutions() function, which recalculates the
institution theme, is now called in place of LiveUser::update_theme()
whenever a user's institutions have changed.  reset_institutions() now
calls update_theme() if the user is a LiveUser.

Change-Id: I75b36da85a5aa249c3098078b8588b8a20ac9b48
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Add config option to allow users to change their theme

Part of bug #793308

Adds a config.php option which lets users change their theme (for
browsing) via a drop-down on the Settings page.  The allowed themes
are the same set accessible to the user when the viewthemes option is
availiable.  Any theme which is restricted to one or more institutions
in its themeconfig.php file is not available in the drop-down unless
the user is a member of one of those institutions.

Change-Id: If6a7db9a4c160e16b38d22a074c128777968c4ca
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Add urlid fields to usr, group, and view tables

Bug #1006634, part 1

These columns will hold the portions of a full page url which relate
to users, groups, and views respectively.

Change-Id: I50e19f822ef2b8e2f0116db81f27cb4d3bb1bd53
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>
Add clean url configuration options to config-defaults (bug #1006634)

Change-Id: Ie2cc733185c0f542ff467c9dc1c173587921129d
Signed-off-by: Richard Mansfield <richard.mansfield@catalyst.net.nz>