Dokeos PHP Cross Reference Learning Management Systems

Source: /main/newscorm/lp_view_item.php - 174 lines - 6318 bytes - Summary - Text - Print

Description: Learning Path This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php

   1  <?php
   2  /* For licensing terms, see /dokeos_license.txt */
   3  
   4  /**
   5   * Learning Path
   6   * This is a learning path creation and player tool in Dokeos - previously learnpath_handler.php
   7   * @package dokeos.learnpath
   8   * @author Patrick Cool
   9   * @author Denes Nagy
  10   * @author Roan Embrechts, refactoring and code cleaning
  11   * @author Yannick Warnier - cleaning and update for new SCORM tool
  12   */
  13  
  14  $_SESSION['whereami'] = 'lp/build';
  15  if(isset($_SESSION['oLP']) && isset($_GET['id']))
  16  {
  17      $_SESSION['oLP'] -> current = intval($_GET['id']);
  18  }
  19  $this_section=SECTION_COURSES;
  20  
  21  api_protect_course_script();
  22  
  23  include ('learnpath_functions.inc.php');
  24  //include('../resourcelinker/resourcelinker.inc.php');
  25  include ('resourcelinker.inc.php');
  26  //rewrite the language file, sadly overwritten by resourcelinker.inc.php
  27  // name of the language file that needs to be included
  28  $language_file = "learnpath";
  29  
  30  /*
  31  -----------------------------------------------------------
  32      Constants and variables
  33  -----------------------------------------------------------
  34  */
  35  $is_allowed_to_edit = api_is_allowed_to_edit(null,true);
  36  
  37  $tbl_lp = Database::get_course_table(TABLE_LP_MAIN);
  38  $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
  39  $tbl_lp_view = Database::get_course_table(TABLE_LP_VIEW);
  40  
  41  $isStudentView  = (empty($_REQUEST['isStudentView'])?0:(int) $_REQUEST['isStudentView']);
  42  $learnpath_id   = (int) $_REQUEST['lp_id'];
  43  /*
  44  $chapter_id     = $_GET['chapter_id'];
  45  $title          = $_POST['title'];
  46  $description   = $_POST['description'];
  47  $Submititem     = $_POST['Submititem'];
  48  $action         = $_REQUEST['action'];
  49  $id             = (int) $_REQUEST['id'];
  50  $type           = $_REQUEST['type'];
  51  $direction      = $_REQUEST['direction'];
  52  $moduleid       = $_REQUEST['moduleid'];
  53  $prereq         = $_REQUEST['prereq'];
  54  $type           = $_REQUEST['type'];
  55  */
  56  /*
  57  ==============================================================================
  58          MAIN CODE
  59  ==============================================================================
  60  */
  61  // using the resource linker as a tool for adding resources to the learning path
  62  if ($action=="add" and $type=="learnpathitem")
  63  {
  64       $htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>";
  65  }
  66  if ( (! $is_allowed_to_edit) or ($isStudentView) )
  67  {
  68      error_log('New LP - User not authorized in lp_view_item.php');
  69      header('location:lp_controller.php?action=view&lp_id='.$learnpath_id);
  70  }
  71  //from here on, we are admin because of the previous condition, so don't check anymore
  72  
  73  $sql_query = "SELECT * FROM $tbl_lp WHERE id = $learnpath_id";
  74  $result=Database::query($sql_query);
  75  $therow=Database::fetch_array($result);
  76  
  77  //$admin_output = '';
  78  /*
  79  -----------------------------------------------------------
  80      Course admin section
  81      - all the functions not available for students - always available in this case (page only shown to admin)
  82  -----------------------------------------------------------
  83  */
  84  /*==================================================
  85              SHOWING THE ADMIN TOOLS
  86   ==================================================*/
  87  
  88  
  89  
  90  /*==================================================
  91      prerequisites setting end
  92   ==================================================*/
  93  if (isset($_SESSION['gradebook'])){
  94      $gradebook=    $_SESSION['gradebook'];
  95  }
  96  
  97  if (!empty($gradebook) && $gradebook=='view') {
  98      $interbreadcrumb[]= array (
  99              'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
 100              'name' => get_lang('Gradebook')
 101          );
 102  }
 103  
 104  $interbreadcrumb[]= array ("url"=>"lp_controller.php?action=list", "name"=> get_lang("_learning_path"));
 105  $interbreadcrumb[]= array ("url"=>api_get_self()."?action=build&lp_id=$learnpath_id", "name" => stripslashes("{$therow['name']}"));
 106  
 107  //Theme calls
 108  $show_learn_path=true;
 109  $lp_theme_css=$_SESSION['oLP']->get_theme();
 110  
 111  Display::display_tool_header(null,'Path');
 112  //api_display_tool_title($therow['name']);
 113  
 114  $suredel = trim(get_lang('AreYouSureToDelete'));
 115  //$suredelstep = trim(get_lang('AreYouSureToDeleteSteps'));
 116  ?>
 117  <script type='text/javascript'>
 118  /* <![CDATA[ */
 119  
 120  function stripslashes(str) {
 121      str=str.replace(/\\'/g,'\'');
 122      str=str.replace(/\\"/g,'"');
 123      str=str.replace(/\\\\/g,'\\');
 124      str=str.replace(/\\0/g,'\0');
 125      return str;
 126  }
 127  function confirmation(name) {
 128      name=stripslashes(name);
 129      if (confirm("<?php echo $suredel; ?> " + name + " ?")) {
 130          return true;
 131      } else {
 132          return false;
 133      }
 134  }
 135  </script>
 136  <?php
 137  
 138  //echo $admin_output;
 139  
 140  /*
 141  -----------------------------------------------------------
 142      DISPLAY SECTION
 143  -----------------------------------------------------------
 144  */
 145  echo $_SESSION['oLP']->build_action_menu();
 146  echo '<div id="content_with_secondary_actions">';
 147  echo '<table style="width:100%" cellpadding="0" cellspacing="0" class="lp_build">';
 148      echo '<tr>';
 149          /*echo '<td class="tree" style="width:18%" valign="top">';
 150              echo '<div class="lp_tree">';
 151                  //build the tree with the menu items in it
 152                  echo $_SESSION['oLP']->build_tree();
 153              echo '</div>';
 154          echo '</td>';*/
 155          echo '<td class="workspace" style="width:100%" valign="top">';
 156              echo $_SESSION['oLP']->display_item((isset($new_item_id)) ? $new_item_id : $_GET['id']);
 157          echo '</td>';
 158      echo '</tr>';
 159  echo '</table>';
 160  echo '</div>';
 161  
 162  echo '<div class="actions">';
 163  //echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=build&lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display::return_icon('build.png', get_lang('Build')).get_lang("Build") . '</a>';
 164  echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&gradebook=&action=view&lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display::return_icon('pixel.gif', get_lang('ViewRight'),array('class'=>'actionplaceholdericon actionwikistudenticon')).get_lang("ViewRight") . '</a>';
 165  echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&gradebook=&action=edit&lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display::return_icon('pixel.gif', get_lang('Publication'),array('class'=>'actionplaceholdericon actionauthorsettings')).get_lang("Publication") . '</a>';
 166  echo '</div>';
 167  
 168  /*
 169  ==============================================================================
 170          FOOTER
 171  ==============================================================================
 172  */
 173  Display::display_footer();
 174  ?>

title

Description

title

Description

title

Description

title

title

Body