Commit 7cdf70b2 authored by Stacey Walker's avatar Stacey Walker Committed by Richard Mansfield
Browse files

Added default My Plans blocktype title


Signed-off-by: default avatarStacey Walker <stacey@catalyst.net.nz>
parent 7acab6fb
......@@ -29,6 +29,7 @@ defined('INTERNAL') || die();
$string['title'] = 'Your Plans';
$string['description'] = 'Display your plans list';
$string['defaulttitledescription'] = 'If this is left empty the title of the plan will be used.';
$string['newerplans'] = 'Newer plans';
$string['noplansaddone'] = 'No plans yet. %sAdd one%s!';
$string['olderplans'] = 'Older plans';
......
......@@ -41,6 +41,22 @@ class PluginBlocktypePlans extends PluginBlocktype {
return array('general');
}
/**
* Optional method. If exists, allows this class to decide the title for
* all blockinstances of this type
*/
public static function get_instance_title(BlockInstance $bi) {
$configdata = $bi->get('configdata');
if (!empty($configdata['artefactid'])) {
safe_require('artefact','plans');
$plan = new ArtefactTypePlan($configdata['artefactid']);
$title = $plan->get('title');
return $title;
}
return '';
}
public static function render_instance(BlockInstance $instance, $editing=false) {
require_once(get_config('docroot') . 'artefact/lib.php');
safe_require('artefact','plans');
......
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