Commit 104dd105 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Removing the redundant new local function for style overrides"

parents 743a57d5 20da6bf8
......@@ -103,7 +103,11 @@ ensure_sanity();
require('dml.php');
require('web.php');
require('user.php');
require(get_config('docroot') . 'local/lib.php');
// Optional local/lib.php file
$locallib = get_config('docroot') . 'local/lib.php';
if (file_exists($locallib)) {
require($locallib);
}
// Database access functions
require('adodb/adodb-exceptions.inc.php');
......
......@@ -422,15 +422,6 @@ EOF;
}
}
// Allow for sysadmin to include a local stylesheet to override some styles without
// having to edit a theme and remember the changes on upgrade.
if (function_exists('local_add_stylesheet')) {
$localsheet = local_add_stylesheet($THEME->basename);
if ($localsheet) {
$stylesheets = array_merge($stylesheets, $localsheet);
}
}
$smarty->assign('STRINGJS', $stringjs);
$stylesheets = append_version_number($stylesheets);
$smarty->assign('STYLESHEETLIST', $stylesheets);
......
......@@ -3,20 +3,10 @@
* Library file for miscellaneous local customisations.
*
* For simple customisation of a Mahara site, the core code will call some local_* functions
* which may be defined in this file.
* which may be defined in a file called local/lib.php
*
* Functions that will be called by core if they are defined:
*
* - local_add_stylesheet($themename): all local style overrides in a sheet living at /local/theme/$name/styles.css
* Example - where it will try and find a local sheet for whichever theme you are on:
* function local_add_stylesheet($themename) {
* if (file_exists(get_config('docroot') . 'local/theme/' . $themename . '/style.css')) {
* return array(get_config('wwwroot') . 'local/theme/' . $themename . '/style.css');
* }
* return false;
* }
* If you are doing major style changes it is better to create your own theme.
*
* - local_can_remove_viewtype($viewtype): stop users from deleting views of a particular type
*
* - local_get_allowed_blocktypes($category, $view): Limit which blocktypes are allowed on a view
......
Local customizations directory
==============================
This directory is the recommended place for local customizations.
It can be used for customizations to your site that don't fit into any Mahara's
other plugin types, as well as for accessing various "Hooks" to override the
default behavior.
See also https://wiki.mahara.org/index.php/Developer_Area/Local_customizations
Function hooks
--------------
The file "local/lib.php" can contain various functions which allow your site
to override Mahara's default behavior. See the sample file local/lib-dist.php
for a full list.
Installation hooks
------------------
You can define definitions for the methods in "local/install.php" to execute
PHP code before or after the Mahara installation process.
You can place database definitions in a file called "local/db/install.xml",
and these will be executed during the Mahara installation process just like
the core or plugin install.xml files.
Upgrade hooks
-------------
You can use "local/version.php" and "local/upgrade.php" to run upgrade scripts,
the same as the core and plugin upgrade scripts.
Custom language strings
-----------------------
You can override language strings by placing lang files under "/local/lang/{language.name}".
You don't have to provide a replacement for every string in the file, only those strings
that you want to override. This is especially handy for if you want to customize only
one or two strings.
Examples:
* local/lang/en.utf8/mahara.php
* local/lang/en.utf8/blocktype.contactinfo.php
* local/lang/en.utf8/artefact.blog.php
Custom help files
-----------------
Similarly, you can provide custom help files by placing them under
/local/lang/{language}/help/{forms|pages|sections}/{filename}.html for core help files
or /local/lang/{language}/help/{forms|pages|sections}/{plugintype}.{pluginname}.{filename}.html
for plugins.
Examples:
* local/lang/en.utf8/help/forms/adduser.friendscontrol.html
* local/lang/en.utf8/help/forms/artefact.blog.addentry.draft.html
Custom theme files
------------------
You can override theme files by placing them under /local/theme. Files placed here will override
ALL themes in the site.
Examples:
* Core emplate file: local/theme/templates/index.tpl
* Core stylesheet: local/theme/static/style/style.css
* Core static file: local/theme/static/images/site-logo.png
* Plugin template file: local/theme/artefact/file/templates/profileicons.tpl
* Plugin static file: local/theme/blocktype/creativecommons/static/images/seal.png
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment