mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #18678
[Bug 1314465] [NEW] Local hook for adding custom sideblocks
Public bug reported:
Local hook would be needed (in lib/web.php) to allow for custom plugins
to add custom sideblocks to certain parts/pages within Mahara without
the need for changing core code.
Below is an example (in local/lib.php) of using such a hook to add
custom sideblock to all pages relatd to groups (i.e. Gropus menu and all
it's submenu items):
function local_sideblocks_update(&$SIDEBLOCKS) {
if (defined('MENUITEM') && MENUITEM != '') {
list($mainmenu, $submenu) = explode('/', MENUITEM);
if($mainmenu == 'groups') {
safe_require('artefact', 'myplugin');
$SIDEBLOCKS[] = array(
'name' => 'mysideblock',
'id' => 'sb-mysideblock',
'weight' => -10,
'data' => PluginArtefactMyplugin::mysideblock_sideblock()
);
}
}
}
** Affects: mahara
Importance: Undecided
Assignee: Gregor Anželj (gregor-anzelj)
Status: New
** Description changed:
Local hook would be needed (in lib/web.php) to allow for custom plugins
to add custom sideblocks to certain parts/pages within Mahara without
the need for changing core code.
Below is an example (in local/lib.php) of using such a hook to add
custom sideblock to all pages relatd to groups (i.e. Gropus menu and all
it's submenu items):
function local_sideblocks_update(&$SIDEBLOCKS) {
- if (defined('MENUITEM') && MENUITEM != '') {
- list($mainmenu, $submenu) = explode('/', MENUITEM);
- if($mainmenu == 'groups') {
- safe_require('artefact', 'myplugin');
- $SIDEBLOCKS[] = array(
- 'name' => 'mysideblock',
- 'id' => 'sb-mysideblock',
- 'weight' => -10,
- 'data' => PluginArtefactMyplugin::mysideblock_sideblock()
- );
- }
- }
+ if (defined('MENUITEM') && MENUITEM != '') {
+ list($mainmenu, $submenu) = explode('/', MENUITEM);
+ if($mainmenu == 'groups') {
+ safe_require('artefact', 'myplugin');
+ $SIDEBLOCKS[] = array(
+ 'name' => 'mysideblock',
+ 'id' => 'sb-mysideblock',
+ 'weight' => -10,
+ 'data' => PluginArtefactMyplugin::mysideblock_sideblock()
+ );
+ }
+ }
}
** Changed in: mahara
Assignee: (unassigned) => Gregor Anželj (gregor-anzelj)
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1314465
Title:
Local hook for adding custom sideblocks
Status in Mahara ePortfolio:
New
Bug description:
Local hook would be needed (in lib/web.php) to allow for custom
plugins to add custom sideblocks to certain parts/pages within Mahara
without the need for changing core code.
Below is an example (in local/lib.php) of using such a hook to add
custom sideblock to all pages relatd to groups (i.e. Gropus menu and
all it's submenu items):
function local_sideblocks_update(&$SIDEBLOCKS) {
if (defined('MENUITEM') && MENUITEM != '') {
list($mainmenu, $submenu) = explode('/', MENUITEM);
if($mainmenu == 'groups') {
safe_require('artefact', 'myplugin');
$SIDEBLOCKS[] = array(
'name' => 'mysideblock',
'id' => 'sb-mysideblock',
'weight' => -10,
'data' => PluginArtefactMyplugin::mysideblock_sideblock()
);
}
}
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1314465/+subscriptions
Follow ups
-
[Bug 1314465] Re: Local hook for adding custom sideblocks
From: Aaron Wells, 2014-10-21
-
[Bug 1314465] Re: Local hook for adding custom sideblocks
From: Kristina Hoeppner, 2014-08-24
-
[Bug 1314465] Re: Local hook for adding custom sideblocks
From: Aaron Wells, 2014-05-02
-
[Bug 1314465] A change has been merged
From: Mahara Bot, 2014-05-02
-
[Bug 1314465] Re: Local hook for adding custom sideblocks
From: Aaron Wells, 2014-05-02
-
[Bug 1314465] Re: Local hook for adding custom sideblocks
From: Gregor Anželj, 2014-04-30
-
[Bug 1314465] Re: Local hook for adding custom sideblocks
From: Aaron Wells, 2014-04-30
-
[Bug 1314465] Re: Local hook for adding custom sideblocks
From: Aaron Wells, 2014-04-30
-
[Bug 1314465] A patch has been submitted for review
From: Mahara Bot, 2014-04-30
-
[Bug 1314465] [NEW] Local hook for adding custom sideblocks
From: Gregor Anželj, 2014-04-30
References