new function expand and collapse in create document in SCORM - refs BT#7683

remotes/angel/1.11.x
Alex Aragon 9 years ago
parent eea4ccb9dd
commit f6ca3f3f20
  1. 6
      main/document/create_document.php
  2. 6
      main/document/edit_document.php
  3. 20
      main/lp/learnpath.class.php
  4. 31
      main/lp/lp_add_item.php

@ -35,8 +35,6 @@ $(document).ready(function() {
$("#template_col").removeClass("hide");
$("#template_col").addClass("col-md-3");
}
$("#hide_bar_template").toggleClass("hide_bar_template_not_hide");
});
CKEDITOR.on("instanceReady", function (e) {
@ -608,11 +606,11 @@ if ($form->validate()) {
if ($is_certificate_mode) {
$actionsLeft = '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Back'),null,ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Back'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Back'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
} else {
$actionsLeft = '<a href="document.php?curdirpath='.Security::remove_XSS($dir).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Back'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Back'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
}
echo $toolbar = Display::toolbarAction('actions-documents', array(0 => $actionsLeft, 1 => ''));

@ -599,7 +599,7 @@ function show_return($document_id, $path, $call_from_tool='', $slide_id=0, $is_c
$selectedCategory = (isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : '');
$actionsLeft .= '<a href="document.php?curdirpath='. $selectedCategory .'&selectcat=' . $selectedCategory .'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Back'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Back'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
} elseif($call_from_tool=='slideshow') {
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/document/slideshow.php?slide_id='.$slide_id.'&curdirpath='.Security::remove_XSS(urlencode($_GET['curdirpath'])).'">'.
Display::return_icon('slideshow.png', get_lang('BackTo').' '.get_lang('ViewSlideshow'),'',ICON_SIZE_MEDIUM).'</a>';
@ -611,7 +611,7 @@ function show_return($document_id, $path, $call_from_tool='', $slide_id=0, $is_c
$actionsLeft .= '<a href="'.$url.'">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('draw.png', get_lang('BackTo').' '.get_lang('Write'), array(), 32).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Back'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Back'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
} elseif($call_from_tool=='editpaint'){
$actionsLeft .= '<a href="'.$url.'">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), array(), ICON_SIZE_MEDIUM).'</a>';
@ -619,7 +619,7 @@ function show_return($document_id, $path, $call_from_tool='', $slide_id=0, $is_c
} else {
$actionsLeft .= '<a href="'.$url.'">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Back'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Back'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
}
echo $toolbar = Display::toolbarAction('actions-documents', array(0 => $actionsLeft, 1 => ''));

@ -5911,10 +5911,12 @@ class learnpath
public function build_action_menu($returnContent = false)
{
$gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null;
$return = '<div class="actions">';
$return .= '<a href="lp_controller.php?'.api_get_cidreq().'&gradebook=' . $gradebook . '&action=view&lp_id=' . $_SESSION['oLP']->lp_id . '&isStudentView=true" target="_self">' . Display :: return_icon('preview_view.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</a> ';
$return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=admin_view&lp_id=' . $_SESSION['oLP']->lp_id . '&updateaudio=true">' . Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
$return .= '<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft = null;
$actionsLeft .= '<a href="lp_controller.php?'.api_get_cidreq().'&gradebook=' . $gradebook . '&action=view&lp_id=' . $_SESSION['oLP']->lp_id . '&isStudentView=true" target="_self">' . Display :: return_icon('preview_view.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</a> ';
$actionsLeft .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=admin_view&lp_id=' . $_SESSION['oLP']->lp_id . '&updateaudio=true">' . Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a href="lp_controller.php?'.api_get_cidreq().'&action=edit&lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>';
$buttons = array(
array(
'title' => get_lang('SetPrerequisiteForEachItem'),
@ -5925,13 +5927,15 @@ class learnpath
'href' => 'lp_controller.php?'.api_get_cidreq().'&action=clear_prerequisites&lp_id=' . $_SESSION['oLP']->lp_id,
),
);
$return .= Display::group_button(get_lang('PrerequisitesOptions'), $buttons);
$return .= '</div>';
$actionsRigth = Display::group_button(get_lang('PrerequisitesOptions'), $buttons);
if ($returnContent) {
return $return;
return $toolbar=null;
}
echo $return;
echo $toolbar = Display::toolbarAction('actions-lp-controller', array(0 => $actionsLeft, 1 => $actionsRigth));
}
/**

@ -177,19 +177,23 @@ jQuery(document).ready(function(){
});
$(document).ready(function() {
$("#doc_form").removeClass( "col-md-8" ).addClass( "col-md-7" );
$("#hide_bar_template").click(function() {
$("#lp_sidebar").toggleClass("hide");
if ($('#doc_form').is('.col-md-7')) {
$('#doc_form').removeClass('col-md-7');
$('#doc_form').addClass('col-md-11');
$("#hide_bar_template").click(function() {
$("#expand").toggleClass("hide");
$("#contract").toggleClass("hide");
if ($("#doc_form").is(".col-md-8")) {
$("#doc_form").removeClass("col-md-8");
$("#doc_form").addClass("col-md-11");
$("#lp_sidebar").removeClass("col-md-4");
$("#lp_sidebar").addClass("hide");
} else {
$('#doc_form').removeClass('col-md-11');
$('#doc_form').addClass('col-md-7');
$("#doc_form").removeClass("col-md-11");
$("#doc_form").addClass("col-md-8");
$("#lp_sidebar").removeClass("hide");
$("#lp_sidebar").addClass("col-md-4");
}
$("#hide_bar_template").toggleClass("hide_bar_template_not_hide");
});
$('.lp-btn-associate-forum').on('click', function (e) {
@ -228,11 +232,6 @@ if ($type == 'document' && !isset($_GET['file'])) {
echo '</div>';
// hide bar div
if ($action == 'add_item' && $type == 'document' && !isset($_GET['file'])) {
echo '<div class="col-md-1"><div id="hide_bar_template"></div></div> ';
}
echo '<div id="doc_form" class="col-md-8">';
//@todo use session flash messages

Loading…
Cancel
Save