Minor style changes (adding the section into the tabs list )

skala
Julio Montoya 13 years ago
parent c39e8f2ef2
commit b2055b4490
  1. 5
      main/coursecopy/classes/CourseBuilder.class.php
  2. 47
      main/newscorm/learnpath.class.php
  3. 2
      main/newscorm/lp_build.php
  4. 5
      main/newscorm/lp_controller.php
  5. 4
      main/newscorm/lp_edit.php
  6. 9
      main/newscorm/lp_view.php
  7. 3
      main/newscorm/lp_view_item.php

@ -588,13 +588,12 @@ class CourseBuilder {
* Build the course-descriptions
*/
function build_course_descriptions($session_id = 0,$course_code = '', $with_base_content = false) {
$course_info = api_get_course_info($course_code);
$course_info = api_get_course_info($course_code);
$course_id = $course_info['real_id'];
$table = Database :: get_course_table(TABLE_COURSE_DESCRIPTION);
if (!empty($session_id) && !empty($course_code)) {
if (!empty($session_id) && !empty($course_code)) {
$session_id = intval($session_id);
if ($with_base_content) {
$session_condition = api_get_session_condition($session_id, true, true);

@ -4834,8 +4834,9 @@ class learnpath {
$return .= ' '.Display :: return_icon('i.gif');
$return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('NewStep') . '">
'. Display :: return_icon('add.png', get_lang('NewStep'),'','32').'</a>';
$return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=chapter&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('NewChapter') . '">
'. Display :: return_icon('add_learnpath_section.png', get_lang('NewChapter'),'','32').'</a>';
/*$return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=chapter&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('NewChapter') . '">
'. Display :: return_icon('add_learnpath_section.png', get_lang('NewChapter'),'','32').'</a>';*/
if ($update_audio == 'true') {
$return .= Display::url(Display :: return_icon('upload_audio_na.png', get_lang('UpdateAllAudioFragments'),'','32'),'#');
} else {
@ -5360,11 +5361,11 @@ class learnpath {
$return = '';
if (is_numeric($item_id)) {
$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
$sql = "SELECT lp.* FROM " . $tbl_lp_item . " as lp
WHERE c_id = ".$course_id." AND lp.id = " . Database :: escape_string($item_id);
$result = Database::query($sql);
while ($row = Database :: fetch_array($result)) {
while ($row = Database :: fetch_array($result,'ASSOC')) {
$_SESSION['parent_item_id'] = ($row['item_type'] == 'dokeos_chapter' || $row['item_type'] == 'dokeos_module' || $row['item_type'] == 'dir') ? $item_id : 0;
// Prevents wrong parent selection for document, see Bug#1251.
@ -5374,27 +5375,26 @@ class learnpath {
$return .= $this->display_manipulate($item_id, $row['item_type']);
$return .= '<div style="padding:10px;">';
if ($msg != '')
$return .= $msg;
$return .= '<p class="lp_title">' . $row['title'] . '</p>';
//$return .= '<p class="lp_text">' . ((trim($row['description']) == '') ? 'no description' : stripslashes($row['description'])) . '</p>';
//$return .= '<hr />';
$return .= '<h3>'.$row['title'].'</h3>';
//var_dump($row);
switch ($row['item_type']) {
case TOOL_QUIZ:
if (!empty($row['path'])) {
require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.class.php';
$exercise = new Exercise();
$exercise->read($row['path']);
// $exercise_url = api_get_path(WEB_CODE_PATH).'exercice/admin.php?exerciseId='.$exercise->id.'&'.api_get_cidReq().'&id_session='.api_get_session_id();
$return .=$exercise->description.'<br />';
//$return .=Display::url($exercise_url, $exercise_url).'<br />';*/
$exercise->read($row['path']);
$return .= $exercise->description.'<br />';
}
break;
case TOOL_DOCUMENT:
$tbl_doc = Database :: get_course_table(TABLE_DOCUMENT);
$sql_doc = "SELECT path FROM " . $tbl_doc . " WHERE c_id = ".$course_id." AND id = " . Database :: escape_string($row['path']);
$result = Database::query($sql_doc);
$path_file = Database :: result($result, 0, 0);
$path_file = Database::result($result, 0, 0);
$path_parts = pathinfo($path_file);
// TODO: Correct the following naive comparisons, also, htm extension is missing.
if (in_array($path_parts['extension'], array (
@ -5538,7 +5538,7 @@ class learnpath {
Display::return_icon('add_learnpath_section.png', get_lang('NewChapter'), array(), 64)
);
$chapter = $_SESSION['oLP']->display_item_form('chapter', get_lang('EnterDataNewChapter'));
$chapter = $_SESSION['oLP']->display_item_form('chapter', get_lang('EnterDataNewChapter'), 'add_item');
echo Display::tabs($headers, array($documents, $exercises, $links, $works, $forums, $chapter), 'resource_tab');
return true;
}
@ -6417,7 +6417,7 @@ class learnpath {
* @param mixed Extra info
* @return string HTML form
*/
public function display_item_form($item_type, $title = '', $action = 'add', $id = 0, $extra_info = 'new') {
public function display_item_form($item_type, $title = '', $action = 'add_item', $id = 0, $extra_info = 'new') {
$course_id = api_get_course_int_id();
global $_course;
global $charset;
@ -6479,8 +6479,13 @@ class learnpath {
$return .= '</div>
</div>';
$form = new FormValidator('form', 'POST', api_get_self() . '?' . $_SERVER['QUERY_STRING']);
$gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null;
$url = api_get_self() . '?' .api_get_cidreq().'&gradeboook='.$gradebook.'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id;
//var_dump(api_get_self() . '?' . $_SERVER['QUERY_STRING']);
$form = new FormValidator('form', 'POST', $url);
$defaults['title'] = api_html_entity_decode($item_title, ENT_QUOTES, $charset);
$defaults['description'] = $item_description;
@ -7776,28 +7781,28 @@ class learnpath {
$res_quiz = Database::query($sql_quiz);
$res_hot = Database::query($sql_hot);
//$return .= '<div class="lp_resource_header"' . " onclick=\"javascript: if(document.getElementById('resExercise').style.display == 'block') {document.getElementById('resExercise').style.display = 'none';} else {document.getElementById('resExercise').style.display = 'block';}\"" . ' ><img align="left" alt="" src="../img/lp_' . TOOL_QUIZ . '.gif" style="margin-right:5px;" title="" />' . get_lang('Quiz') . '</div>';
$return = '<div class="lp_resource">';
$return .= '<div class="lp_resource_element">';
//$return .= Display::return_icon('new_exercice.png', '', array(), 32); //'<img alt="" src="../img/icons/22/exercise.gif" style="margin-right:5px;" title="" />';
$return .= '<img alt="" src="../img/new_test_small.gif" style="margin-right:5px;" title="" />';
$return .= '<a href="' . api_get_path(REL_CODE_PATH) . 'exercice/exercise_admin.php?lp_id=' . $this->lp_id . '">' . get_lang('NewExercise') . '</a>';
$return .= '</div>';
$return .= '</div>';
while ($row_hot = Database :: fetch_array($res_hot)) {
$return .= '<div class="lp_resource_element">';
// Display quizhotpotatoes.
$return .= '<img alt="hp" src="../img/hotpotatoes_s.png" style="margin-right:5px;" title="" width="18px" height="18px" />';
$return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=add_item&amp;type=' . TOOL_HOTPOTATOES . '&amp;file=' . $row_hot['id'] . '&amp;lp_id=' . $this->lp_id . '">' . ((!empty ($row_hot['comment'])) ? $row_hot['comment'] : Security :: remove_XSS($row_hot['title'])) . '</a>';
//$return .= $row_quiz['title'];
$return .= '</div>';
}
while ($row_quiz = Database :: fetch_array($res_quiz)) {
$return .= '<div class="lp_resource_element">';
$return .= '<img alt="" src="../img/quizz_small.gif" style="margin-right:5px;" title="" />';
$return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=add_item&amp;type=' . TOOL_QUIZ . '&amp;file=' . $row_quiz['id'] . '&amp;lp_id=' . $this->lp_id . '">' . Security :: remove_XSS($row_quiz['title']) . '</a>';
//$return .= Display::return_icon('quiz.png', '', array(), 32); //'<img alt="" src="../img/icons/22/exercise.gif" style="margin-right:5px;" title="" />';
$return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=add_item&amp;type=' . TOOL_QUIZ . '&amp;file=' . $row_quiz['id'] . '&amp;lp_id=' . $this->lp_id . '">' .
Security :: remove_XSS(cut($row_quiz['title'], 80)).'</a>';
//$return .= $row_quiz['title'];
$return .= '</div>';
}

@ -143,7 +143,7 @@ echo '<table cellpadding="0" cellspacing="0" class="lp_build">';
$learnpathadded = '<p><h2>'.get_lang('LearnPathAddedTitle').'</h2><br />';
$learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang('NewStep').'">'.Display::return_icon('new_learnigpath_object.png', get_lang('NewStep'), array('style' => 'vertical-align: middle;'),'22').' '.get_lang('NewStep').'</a>: '.get_lang('NewStepComment').'<br />';
$learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=chapter&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang('NewChapter').'">'.Display::return_icon('add_learnpath_section.png', get_lang('NewChapter'), array('style' => 'vertical-align: middle;'),'22').' '.get_lang('NewChapter').'</a>: '.get_lang('NewChapterComment').'<br />';
//$learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=chapter&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang('NewChapter').'">'.Display::return_icon('add_learnpath_section.png', get_lang('NewChapter'), array('style' => 'vertical-align: middle;'),'22').' '.get_lang('NewChapter').'</a>: '.get_lang('NewChapterComment').'<br />';
$learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;action=build&amp;lp_id='.Security::remove_XSS($_GET['lp_id']).'" target="_parent">'.Display::return_icon('build_learnpath.png', get_lang('Build'), array('style' => 'vertical-align: middle;'),'22').' '.get_lang('Build')."</a>: ".get_lang('BuildComment').'<br />';
$learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang("BasicOverview").'">'.Display::return_icon('move_learnpath.png', get_lang('BasicOverview'), array('style' => 'vertical-align: middle;'),'22').' '.get_lang('BasicOverview').'</a>: '.get_lang('BasicOverviewComment').'<br />';
$learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&action=view&lp_id='.$_SESSION['oLP']->lp_id.'">'.Display::return_icon('view_left_right.png', get_lang('Display'),array('style' => 'vertical-align: middle;'),'22').' '.get_lang('Display').'</a>: '.get_lang('DisplayComment').'<br />';

@ -247,10 +247,9 @@ switch ($action) {
} else {
// For all other item types than documents, load the item using the item type and path rather than its ID.
$new_item_id = $_SESSION['oLP']->add_item($_POST['parent'], $_POST['previous'], $_POST['type'], $_POST['path'], $_POST['title'], $_POST['description'], $_POST['prerequisites'], $_POST['maxTimeAllowed']);
}
}
// Display.
require 'lp_add_item.php';
require 'lp_add_item.php';
}
} else {
require 'lp_add_item.php';

@ -63,8 +63,8 @@ echo ' '.Display::return_icon('i.gif');
echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=step&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('NewStep').'">
'.Display::return_icon('add.png', get_lang('NewStep'),'','32').'</a>';
echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=chapter&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('NewChapter').'">
'.Display::return_icon('add_learnpath_section.png', get_lang('NewChapter'),'','32').'</a>';
/*echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=chapter&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('NewChapter').'">
'.Display::return_icon('add_learnpath_section.png', get_lang('NewChapter'),'','32').'</a>';*/
echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id='.Security::remove_XSS($_GET['lp_id']).'&amp;updateaudio=true">'.Display::return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'','32').'</a>';

@ -100,17 +100,18 @@ unset($_SESSION['questionList']);
if (!isset($src)) {
$src = '';
switch($lp_type) {
case 1:
$_SESSION['oLP']->stop_previous_item();
$htmlHeadXtra[] = '<script src="scorm_api.php" type="text/javascript" language="javascript"></script>';
$prereq_check = $_SESSION['oLP']->prerequisites_match($lp_item_id);
if ($prereq_check === true) {
$src = $_SESSION['oLP']->get_link('http', $lp_item_id);
if ($prereq_check === true) {
$src = $_SESSION['oLP']->get_link('http', $lp_item_id);
//Prevents FF 3.6 + Adobe Reader 9 bug see BT#794 when calling a pdf file in a LP.
$file_info = parse_url($src);
$file_info = pathinfo($file_info['path']);
$file_info = pathinfo($file_info['path']);
if (api_strtolower(substr($file_info['extension'], 0, 3) == 'pdf')) {
//$src = api_get_path(WEB_CODE_PATH).'newscorm/lp_view_item.php?src='.$src;
$src = api_get_path(WEB_CODE_PATH).'newscorm/lp_view_item.php?lp_item_id='.$lp_item_id;
@ -369,8 +370,6 @@ if ($_SESSION['oLP']->mode == 'embedframe' ||$_SESSION['oLP']->get_hide_toc_fram
<!-- right Zone -->
<div id="learning_path_right_zone" style="margin-left:<?php echo $margin_left;?>;height:100%">
<?php
// hub 26-05-2010 Fullscreen or not fullscreen
if ($_SESSION['oLP']->mode == 'fullscreen') {

@ -33,6 +33,7 @@ require_once 'resourcelinker.inc.php';
// Including the global initialization file.
require_once '../inc/global.inc.php';
api_protect_course_script();
if (isset($_GET['lp_item_id'])) {
@ -66,7 +67,7 @@ $_SESSION['whereami'] = 'lp/build';
if (isset($_SESSION['oLP']) && isset($_GET['id'])) {
$_SESSION['oLP'] -> current = intval($_GET['id']);
}
$this_section=SECTION_COURSES;
$this_section = SECTION_COURSES;
/* Libraries */

Loading…
Cancel
Save