← Back to team overview

mahara-contributors team mailing list archive

[Bug 1314465] A change has been merged

 

Reviewed:  https://reviews.mahara.org/3303
Committed: http://gitorious.org/mahara/mahara/commit/47cbcac65802dd5b06b92cad90dccf18da440717
Submitter: Aaron Wells (aaronw@xxxxxxxxxxxxxxx)
Branch:    master

commit 47cbcac65802dd5b06b92cad90dccf18da440717
Author: Gregor Anzelj <gregor.anzelj@xxxxxxxxx>
Date:   Wed Apr 30 06:30:41 2014 +0200

Local hook for adding custom sideblocks (Bug #1314465)

Change-Id: I4f461e72074fb937baeb8a5abd35667d2e3cb407
Signed-off-by: Gregor Anzelj <gregor.anzelj@xxxxxxxxx>

-- 
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:
  Fix Committed

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


References