Commit a4b1ad67 authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells

BUG: remove method_exists for get_link, add on base class (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: I0a0a78d67909392613cd630faa542dd9b8145797
parent 77aa623b
......@@ -38,15 +38,13 @@ class PluginBlocktypeBlog extends PluginBlocktype {
return array('blog' => 10000);
}
//{$WWWROOT}artefact/blog/post.php?blog={$blogid
public static function get_link(BlockInstance $instance) {
$configdata = $instance->get('configdata');
if (!empty($configdata['artefactid'])) {
$data = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $configdata['artefactid'] . '&view=' . $instance->get('view');
return sanitize_url($data);
}
}
}
public static function render_instance(BlockInstance $instance, $editing=false) {
global $exporter;
......
......@@ -88,6 +88,16 @@ abstract class PluginBlocktype extends Plugin implements IPluginBlocktype {
return 'blocktype';
}
/**
* Optionally specify a place for a block to link to. This will be rendered in the block header
* in templates
* @var BlockInstance
* @return String or false
*/
public static function get_link(BlockInstance $instance) {
return false;
}
public static function get_theme_path($pluginname) {
if (($artefactname = blocktype_artefactplugin($pluginname))) {
// Path for block plugins that sit under an artefact
......@@ -957,9 +967,9 @@ class BlockInstance {
$smarty->assign('feedlink', call_static_method($classname, 'feed_url', $this));
}
if (method_exists($classname, 'get_link')) {
$smarty->assign('link', call_static_method($classname, 'get_link', $this));
}
$smarty->assign('link', call_static_method($classname, 'get_link', $this));
$smarty->assign('content', $content);
if (isset($configdata['retractable']) && $title) {
......
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