Gitlab CSE Unil

Commit 10db78d5 authored by M. Chardon's avatar M. Chardon
Browse files

correction affichage axe dans le workspace général

parent 1b900505
......@@ -266,23 +266,23 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
$toolbarCostum = array();
$axis = array();
foreach ($widget->toolbars as $toolbar) {
$axis[] = $toolbar['label'];
$axis[$toolbar['axeid']] = $toolbar['label'];
$toolbartmp = '';
foreach ($toolbar['tool'] as $tool) {
if ($tool->enabled) {
$toolbartmp .= $this->render_toolbar_button('', '', $tool);
}
}
$toolbarCostum[] = html_writer::div($toolbartmp, 'toolbar customtoolbar', array('role' => 'toolbar', 'id' => 'toolbaraxis' . $tool->axis, 'style' => 'display:none;'));
$toolbarCostum[] = html_writer::div($toolbartmp, 'toolbar customtoolbar', array('role' => 'toolbar', 'id' => 'toolbaraxis' . $toolbar['axeid'], 'style' => 'display:none;'));
}
usort($axis, function($a, $b) {
$al = substr($a, 4, 5);
$bl = substr($b, 4, 5);
if ($al == $bl) {
return 0;
}
return ($al > $bl) ? +1 : -1;
});
/* usort($axis, function($a, $b) {
$al = substr($a, 4, 5);
$bl = substr($b, 4, 5);
if ($al == $bl) {
return 0;
}
return ($al > $bl) ? +1 : -1;
}); */
$axischoice = html_writer::div(html_writer::select($axis, 'axisselection', 0, FALSE), 'toolbar ', array('role' => 'toolbar'));
foreach ($toolbarCostum as $toolbarCostumUnit) {
$toolbarCostumdiv .= $toolbarCostumUnit;
......@@ -383,19 +383,19 @@ class assignfeedback_editpdfplus_renderer extends plugin_renderer_base {
public function render_assignfeedback_editpdfplus_widget_admin(assignfeedback_editpdfplus\widget_admin $widget) {
return $this->render_from_template('assignfeedback_editpdfplus/admin', $widget);
}
public function render_assignfeedback_editpdfplus_widget_admin_axisform(moodleform $form){
public function render_assignfeedback_editpdfplus_widget_admin_axisform(moodleform $form) {
return $this->render_from_template('assignfeedback_editpdfplus/axis_form', $form);
}
public function render_assignfeedback_editpdfplus_widget_admin_axisdelform(moodleform $form){
public function render_assignfeedback_editpdfplus_widget_admin_axisdelform(moodleform $form) {
return $this->render_from_template('assignfeedback_editpdfplus/axis_del_form', $form);
}
public function render_assignfeedback_editpdfplus_widget_admin_toolform($data){
$data->map01 = $this->pix_url('map01','assignfeedback_editpdfplus');
$data->map02 = $this->pix_url('map02','assignfeedback_editpdfplus');
$data->map03 = $this->pix_url('map03','assignfeedback_editpdfplus');
public function render_assignfeedback_editpdfplus_widget_admin_toolform($data) {
$data->map01 = $this->pix_url('map01', 'assignfeedback_editpdfplus');
$data->map02 = $this->pix_url('map02', 'assignfeedback_editpdfplus');
$data->map03 = $this->pix_url('map03', 'assignfeedback_editpdfplus');
return $this->render_from_template('assignfeedback_editpdfplus/tool_form', $data);
}
......
......@@ -74,9 +74,17 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
$toolbars = array();
$coursecontext = context::instance_by_id($this->assignment->get_context()->id);
$coursecontexts = array_filter(explode('/', $coursecontext->path), 'strlen');
$axis = array();
foreach ($coursecontexts as $value) {
$axistmp = page_editor::get_axis(array($value));
if ($axistmp && sizeof($axistmp) > 0) {
$axis = $axistmp;
}
}
//$axis = page_editor::get_axis($coursecontexts);
$tools = page_editor::get_tools($coursecontexts);
$axis = page_editor::get_axis($coursecontexts);
foreach ($axis as $ax) {
$toolbars[$ax->id]['axeid'] = $ax->id;
$toolbars[$ax->id]['label'] = $ax->label;
foreach ($tools as $tool) {
if ($tool->axis == $ax->id) {
......@@ -243,7 +251,7 @@ class assign_feedback_editpdfplus extends assign_feedback_plugin {
*/
public function view(stdClass $grade) {
global $PAGE;
$html = '';
// Show a link to download the pdf.
if (page_editor::has_annotations_or_comments($grade->id, false)) {
......
......@@ -5594,7 +5594,7 @@ EDITOR.prototype = {
toolbar.hide();
}, this);
var axisselector = this.get_dialogue_element(SELECTOR.AXISCUSTOMTOOLBAR + ' option:checked');
var axisid = parseInt(axisselector.get('value'), 10) + 1;
var axisid = parseInt(axisselector.get('value'), 10);
var customtoolbar = this.get_dialogue_element(SELECTOR.CUSTOMTOOLBARID + '' + axisid);
customtoolbar.show();
},
......
......@@ -5594,7 +5594,7 @@ EDITOR.prototype = {
toolbar.hide();
}, this);
var axisselector = this.get_dialogue_element(SELECTOR.AXISCUSTOMTOOLBAR + ' option:checked');
var axisid = parseInt(axisselector.get('value'), 10) + 1;
var axisid = parseInt(axisselector.get('value'), 10);
var customtoolbar = this.get_dialogue_element(SELECTOR.CUSTOMTOOLBARID + '' + axisid);
customtoolbar.show();
},
......
......@@ -840,7 +840,7 @@ EDITOR.prototype = {
toolbar.hide();
}, this);
var axisselector = this.get_dialogue_element(SELECTOR.AXISCUSTOMTOOLBAR + ' option:checked');
var axisid = parseInt(axisselector.get('value'), 10) + 1;
var axisid = parseInt(axisselector.get('value'), 10);
var customtoolbar = this.get_dialogue_element(SELECTOR.CUSTOMTOOLBARID + '' + axisid);
customtoolbar.show();
},
......
Supports Markdown
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