[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/course/format/scorm/ -> format.php (source)

   1  <?php // $Id: format.php,v 1.12.2.1 2007/10/22 06:54:40 nfreear Exp $
   2        // format.php - course format featuring single activity
   3        //              included from view.php
   4  
   5      $module = $course->format;
   6      require_once($CFG->dirroot.'/mod/'.$module.'/locallib.php');
   7  
   8      // Bounds for block widths
   9      // more flexible for theme designers taken from theme config.php
  10      $lmin = (empty($THEME->block_l_min_width)) ? 100 : $THEME->block_l_min_width;
  11      $lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
  12      $rmin = (empty($THEME->block_r_min_width)) ? 100 : $THEME->block_r_min_width;
  13      $rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
  14  
  15      define('BLOCK_L_MIN_WIDTH', $lmin);
  16      define('BLOCK_L_MAX_WIDTH', $lmax);
  17      define('BLOCK_R_MIN_WIDTH', $rmin);
  18      define('BLOCK_R_MAX_WIDTH', $rmax);
  19    
  20      $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),  
  21                                              BLOCK_L_MAX_WIDTH);
  22      $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 
  23                                              BLOCK_R_MAX_WIDTH);
  24  
  25      $strgroups  = get_string('groups');
  26      $strgroupmy = get_string('groupmy');
  27      $editing    = $PAGE->user_is_editing();
  28  
  29      echo '<table id="layout-table" cellspacing="0" summary="'.get_string('layouttable').'">';
  30      echo '<tr>';
  31  
  32      if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
  33          echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
  34          blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
  35          echo '</td>';
  36      }
  37  
  38      echo '<td id="middle-column">'. skip_main_destination();
  39      $moduleformat = $module.'_course_format_display';
  40      if (function_exists($moduleformat)) {
  41          $moduleformat($USER,$course);
  42      } else { 
  43          notify('The module '. $module. ' does not support single activity course format');
  44      }
  45      echo '</td>';
  46  
  47      // The right column
  48      if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
  49          echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
  50          blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
  51          echo '</td>';
  52      }
  53  
  54      echo '</tr>';
  55      echo '</table>';
  56  
  57  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7