Commit 32050842 authored by Robert Lyon's avatar Robert Lyon

Bug 1824439: Positioning the signoff block contents back into sign-off block

behatnotneeded

Change-Id: I2746b380b024dfa8a3ad58e600dd031f95930749
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 05e6d96f
......@@ -30,6 +30,13 @@ class PluginBlocktypeSignoff extends MaharaCoreBlocktype {
return get_string('title', 'blocktype.peerassessment/signoff');
}
public static function override_instance_title(BlockInstance $instance) {
if (!$instance->get('inedit')) {
return '';
}
return get_string('title', 'blocktype.peerassessment/signoff');
}
public static function hide_title_on_empty_content() {
return true;
}
......@@ -62,7 +69,19 @@ class PluginBlocktypeSignoff extends MaharaCoreBlocktype {
$html = $smarty->fetch('blocktype:signoff:signoff.tpl');
}
else {
$html = '';
$view = $instance->get_view();
safe_require('artefact', 'peerassessment');
$smarty->assign('WWWROOT', get_config('wwwroot'));
$smarty->assign('view', $view->get('id'));
// Verify option
$smarty->assign('showverify', !empty($configdata['verify']));
$smarty->assign('verifiable', ArtefactTypePeerassessment::is_verifiable($view, false));
$smarty->assign('verified', ArtefactTypePeerassessment::is_verified($view, false));
// Signoff option
$smarty->assign('showsignoff', !empty($configdata['signoff']));
$smarty->assign('signable', ArtefactTypePeerassessment::is_signable($view, false));
$smarty->assign('signoff', ArtefactTypePeerassessment::is_signed_off($view, false));
$html = $smarty->fetch('blocktype:signoff:verifyform.tpl');
}
return $html;
}
......@@ -101,31 +120,6 @@ class PluginBlocktypeSignoff extends MaharaCoreBlocktype {
return array();
}
public static function get_instance_toolbars(BlockInstance $bi) {
global $USER;
$configdata = $bi->get('configdata');
$view = $bi->get_view();
safe_require('artefact', 'peerassessment');
$smarty = smarty_core();
$smarty->assign('WWWROOT', get_config('wwwroot'));
$smarty->assign('view', $view->get('id'));
// Verify option
$smarty->assign('showverify', !empty($configdata['verify']));
$smarty->assign('verifiable', ArtefactTypePeerassessment::is_verifiable($view, false));
$smarty->assign('verified', ArtefactTypePeerassessment::is_verified($view, false));
// Signoff option
$smarty->assign('showsignoff', !empty($configdata['signoff']));
$smarty->assign('signable', ArtefactTypePeerassessment::is_signable($view, false));
$smarty->assign('signoff', ArtefactTypePeerassessment::is_signed_off($view, false));
return array(
array(
'toolbarhtml' => $smarty->fetch('blocktype:signoff:verifyform.tpl')
)
);
}
public static function delete_instance(BlockInstance $instance) {
$viewid = $instance->get_view()->get('id');
execute_sql("DELETE FROM {view_signoff_verify} WHERE view = ?", array($viewid));
......
......@@ -704,6 +704,7 @@ class BlockInstance {
private $artefacts = array();
private $temp = array();
private $tags = array();
private $inedit = false;
public function __construct($id=0, $data=null) {
if (!empty($id)) {
......@@ -1007,7 +1008,7 @@ class BlockInstance {
safe_require('blocktype', $this->get('blocktype'));
$movecontrols = array();
$this->inedit = true;
$blocktypeclass = generate_class_name('blocktype', $this->get('blocktype'));
try {
$title = $this->get_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