Source for file view_layout.php

Documentation is available at view_layout.php

  1. <?php
  2.     // This file is part of the Sloodle project (www.sloodle.org)
  3.  
  4.     /**
  5.     * This page shows and/or allows editing of Sloodle course settings.
  6.     * Used as an interface script by the Moodle framework.
  7.     *
  8.     * @package sloodle
  9.     * @copyright Copyright (c) 2008 Sloodle (various contributors)
  10.     * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
  11.     *
  12.     * @contributor Peter R. Bloomfield
  13.     * @contributor Edmund Edgar
  14.     *
  15.     */
  16.  
  17.     /** Sloodle/Moodle configuration script. */
  18.     require_once('sl_config.php');
  19.     /** Sloodle core library functionality */
  20.     require_once(SLOODLE_DIRROOT.'/lib.php');
  21.     /** General Sloodle functions. */
  22.     require_once(SLOODLE_LIBROOT.'/general.php');
  23.     /** Sloodle course data. */
  24.     require_once(SLOODLE_LIBROOT.'/course.php');   
  25.     require_once(SLOODLE_LIBROOT.'/layout_profile.php');   
  26.  
  27.     // Get the Sloodle course data
  28.     $courseid required_param('courseid'PARAM_INT);
  29.     $layoutid optional_param('layoutid'-1PARAM_INT)// 0 to add a layout, -1 just to display
  30.  
  31.     $sloodle_course new SloodleCourse();
  32.     if (!$sloodle_course->load($courseid)) error(get_string('failedcourseload','sloodle'));
  33.     
  34.     // Ensure that the user is logged-in to this course
  35.     require_login($courseid);
  36.     $course_context get_context_instance(CONTEXT_COURSE$courseid);
  37.     
  38.     // Do not allow guest access
  39.     if (isguestuser()) {
  40.         error(get_string('noguestaccess''sloodle'));
  41.         exit();
  42.     }
  43.  
  44.     // Make sure the user is logged-in and is not a guest
  45.     if (isloggedin(== false || isguestuser(== true{
  46.         error(get_string('noguestaccess','sloodle'));
  47.         exit();
  48.     }
  49.  
  50.     // Make sure the user has permission to manage activities on this course
  51.     $course_context get_context_instance(CONTEXT_COURSE$courseid);
  52.     require_capability('moodle/course:manageactivities'$course_context);
  53.  
  54. ///////////////////
  55.     
  56.     // Fetch string table text
  57.     $strsloodle get_string('modulename''sloodle');
  58.     $strsloodles get_string('modulenameplural''sloodle');
  59.     $strsavechanges get_string('savechanges');
  60.     $stryes get_string('yes');
  61.     $strno get_string('no');
  62.     
  63.         
  64.     // Attempt to fetch the course module instance
  65.     if ($courseid{
  66.         if (!$course get_record('course''id'$courseid)) {
  67.             error('Could not find course');
  68.         }
  69.     else {
  70.         error('Must specify a course ID');
  71.     }
  72.        
  73.     // Log the view
  74.     add_to_log($courseid'course''view sloodle layout page'"mod/sloodle/view_layout.php?courseid={$courseid}""$course->id");
  75.     
  76.     // Is the user allowed to edit this course?
  77.     require_capability('moodle/course:update'$course_context);
  78.  
  79.     // Display the page header
  80.     $navigation "<a href=\"{$CFG->wwwroot}/mod/sloodle/view_course.php?id={$course->id}#layouts\">".get_string('courseconfig','sloodle')."</a>";
  81.     print_header_simple(get_string('layoutpage','sloodle')""$navigation""""true''navmenu($course));
  82.     
  83.     
  84. //------------------------------------------------------    
  85.     
  86.     // Check the user's permissions regarding layouts
  87.     $layouts_can_use has_capability('mod/sloodle:uselayouts'$course_context);
  88.     $layouts_can_edit has_capability('mod/sloodle:editlayouts'$course_context);
  89.     
  90.     // Only display the layouts if they can use them
  91.     if (!$layouts_can_edit{
  92.         print get_string('layoutmanager:nopermission''sloodle');
  93.         exit;
  94.     }
  95.  
  96.     // Show a list of layouts, if there are any
  97.     $layout_names $sloodle_course->get_layout_names();
  98.  
  99. //------------------------------------------------------    
  100.  
  101.     if (isset($_POST['courseid'])) {
  102.  
  103.        /// Update
  104.  
  105.           $layoutid required_param('layoutid'PARAM_INT);
  106.           $layoutname required_param('layoutname'PARAM_TEXT);
  107.  
  108.           if in_array($layoutname,$layout_names) ) {
  109.               $layoutnamestoids array_flip($layout_names);
  110.               if $layoutnamestoids[$layoutname!= $layoutid )  {
  111.                   print get_string("layoutmanager:namealreadyexists",'sloodle');
  112.                   exit;
  113.               }
  114.           }
  115.  
  116.           // Define parameter names we will ignore
  117.           $IGNORE_PARAMS array('sloodleauthid''sloodledebug');
  118.           // This structure will store our values
  119.  
  120.           $entries array();
  121.  
  122.           $num_items required_param('num_items'PARAM_INT);
  123.           for ($i=0$i<=$num_items$i++{
  124.  
  125.              $checkedfield "layout_entry_on_".$i;
  126.              $idchecked optional_param($checkedfieldfalsePARAM_TEXT);
  127.  
  128.              if $idchecked == "on" {
  129.  
  130.                 $entry_id optional_param("layout_entry_id_$i"0PARAM_INT);
  131.                 $object_type required_param("object_type_$i"PARAM_TEXT);
  132.                 $layout_entry_x required_param("layout_entry_x_$i"PARAM_TEXT);
  133.                 $layout_entry_y required_param("layout_entry_y_$i"PARAM_TEXT);
  134.                 $layout_entry_z required_param("layout_entry_z_$i"PARAM_TEXT);
  135.                 $rotation required_param("layout_entry_rotation_$i"PARAM_RAW);
  136.                 $position "<$layout_entry_x,$layout_entry_y,$layout_entry_z>";
  137.  
  138.         if ($object_type == ''{
  139.             print "error: object_type missing";
  140.             exit;
  141.         }
  142.         
  143.                 $entry new SloodleLayoutEntry();
  144.         if ($entry_id 0{
  145.             $entry->load($entry_id);
  146.         }
  147.                 $entry->name $object_type;
  148.                 $entry->position $position;
  149.                 $entry->rotation $rotation;
  150.                 $entry->layout $layoutid// NB if this is a new entry, layoutid will be 0 and will need to be set on insert
  151.                 $configoptions array('sloodlemoduleid''sloodleserveraccesslevel''sloodleobjectaccesslevelctrl''sloodleobjectaccessleveluse');
  152.                 foreach($configoptions as $configoption{
  153.                     $paramname 'layout_entry_config_'.$configoption.'_'.$i;
  154.                     $configval optional_param($paramnamenullPARAM_TEXT);
  155.                     if ($configval != null{
  156.                         $entry->set_config($configoption$configval);
  157.                     }
  158.                 }
  159.                 
  160.                 $entries[$entry;
  161.  
  162.              }
  163.           }
  164.  
  165.           // Define parameter names we will ignore
  166.           $result $sloodle_course->save_layout_by_id($layoutid$layoutname$entries$add=false);
  167.  
  168.           if ($result{
  169.              $next 'view_course.php?id='.$courseid.'#layouts';
  170.              //print '<a href="'.$next.'">next</a>';
  171.              redirect($next);
  172.           else {
  173.              print "<h3>".get_string('layoutmanager:savefailed','sloodle')."</h3>";
  174.              exit;
  175.       }
  176.  
  177.     }
  178.  
  179. //------------------------------------------------------    
  180.  
  181. // Edmund Edgar, 2009-02-07: Killing this stuff for now - we'll use the list on the sloodle course page instead
  182. /*
  183.     if (count($layout_names) > 0) {
  184.  
  185.         echo "<center>";
  186.         echo "<table border=\"1\">";
  187.         foreach($layout_names as $lid=>$ln) {
  188.             $en_cnt = count($sloodle_course->get_layout_entries($ln));
  189.             echo "<tr><td>$ln</td><td>$en_cnt</td><td><a href=\"view_layout.php?courseid=".$courseid."&layoutid=".$lid."\">Edit</a></td></tr>";
  190.         }
  191.         echo "<tr><td colspan=\"2\">&nbsp;</td><td><a href=\"view_layout.php?courseid=".$courseid."&layoutid=0\">Add</a></td></tr>";
  192.         echo "</table>";
  193.         echo "<center>";
  194.  
  195.     } else {
  196.  
  197.         // show the add page even if the url didn't specify layoutid=0
  198.         $layoutid = 0;
  199.  
  200.     }
  201. */
  202.  
  203. //------------------------------------------------------    
  204. // Fetch current layout
  205.  
  206.     $currentlayoutentries array();
  207.     $recommendedon true// Whether by default we turn on modules that aren't already in the layout we're looking at
  208.     $layoutname 'Layout '.date('Y-m-d H:i:s');
  209.  
  210.     if ($layoutid 0{
  211.          
  212.         $layout new SloodleLayout();
  213.         $layout->load($layoutid);
  214.         $currentlayoutentries $sloodle_course->get_layout_entries_for_layout_id($layoutid);
  215.         $recommendedon false// The user got a chance to use our recommended defaults when they added. Now we'll only turn on things that they did.
  216.         $layoutname $layout_names[$layoutid];
  217.     
  218.  
  219. //------------------------------------------------------    
  220. // Fetch possible options
  221. //
  222.  
  223.     if ($layoutid >= 0// add or edit layout
  224.     $modinfo =get_fast_modinfo($COURSE);
  225.  
  226.     $cmsmodules $modinfo->cms;
  227.     $instancemodules $modinfo->instances;
  228.  
  229.     $objects_to_configs array(
  230.     'SLOODLE Access Checker' => 'accesschecker-1.0',
  231.     'SLOODLE Access Checker Door' => 'accesscheckerdoor-1.0',
  232.     'SLOODLE Choice (Horizontal)' => 'choice-1.0',
  233.     'SLOODLE Choice (Vertical)' => 'choice-1.0',
  234.     'SLOODLE LoginZone' => 'loginzone-1.0',
  235.     'SLOODLE MetaGloss' => 'glossary-1.0',
  236.     'SLOODLE Password Reset' => 'pwreset-1.0',
  237.     'SLOODLE Presenter (alpha)' => 'presenter-1.0',
  238.     'SLOODLE PrimDrop' => 'primdrop-1.0',
  239.     'SLOODLE Quiz Chair' => 'quiz-1.0',
  240.     'SLOODLE Quiz Pile-On' => 'quiz-1.0',
  241.     'SLOODLE RegEnrol Booth' => 'regbooth-1.0',
  242.     'SLOODLE Stipend Giver (alpha)' => 'stipendgiver-1.0',
  243.     'SLOODLE Vending Machine' => 'distributor-1.0',
  244.     'SLOODLE WebIntercom' => 'chat-1.0'
  245.     );
  246.  
  247.     $configs_to_access_options array(
  248.         'accesschecker-1.0' => array(truefalsefalse),
  249.         'accesscheckerdoor-1.0' => array(truefalsefalse),
  250.         'choice-1.0' => array(truefalsetrue),
  251.         'demo-1.0' => array(truetruetrue),
  252.         'distributor-1.0' => array(truetruefalse),
  253.         'enrolbooth-1.0' => array(truefalsefalse),
  254.         'presenter-1.0' => array(falsetruefalse),
  255.         'pwreset-1.0' => array(truefalsetrue),
  256.         'quiz-1.0' => array(truefalsetrue),
  257.         'quiz_pile_on-1.0' => array(truetruetrue),
  258.         'regbooth-1.0' => array(truefalsefalse),
  259.         'stipendgiver-1.0' => arraytruetruetrue)
  260.     );
  261.  
  262.     $standardobjects array(
  263.         'SLOODLE RegEnrol Booth',
  264.         'SLOODLE Access Checker Door',
  265.         'SLOODLE Vending Machine',
  266.         'SLOODLE LoginZone'
  267.     );
  268.     $instanceobjectmappingspercourse array(
  269.         'quiz'=>array('SLOODLE Quiz Chair','SLOODLE Quiz Pile-On'),
  270.         'glossary'=>array('SLOODLE MetaGloss'),
  271.         'chat'=>array('SLOODLE WebIntercom'
  272.     );
  273.     $instanceobjectmappingsperstudent array(
  274.         // TODO: Deal with what happens when we want to rez one object per student in the class 
  275.     );
  276.  
  277.     $rezoptions array();
  278.     foreach($standardobjects as $obj{
  279.        $rezoptions[array($obj);
  280.     }
  281.  
  282.     // When putting in default spacing, space objects out 2 meters apart along the y axis
  283.     define('DEFAULT_SPACING_X'1);
  284.     define('DEFAULT_SPACING_Y'2);
  285.     define('DEFAULT_CENTER_Y'0);
  286.     define('DEFAULT_CENTER_X'0);
  287.   
  288.     // increment and return the position variables
  289.     /*
  290.              O  
  291.                 O O  
  292.            O O O
  293.               O O O O
  294.              O O O O O
  295.             O O O O O O
  296.     */
  297.  
  298.     function rowForItem($index{
  299.         $index++;
  300.         $itemsPerRow 1;
  301.         $row 1;
  302.         $itemsInThisRow 0;
  303.         for ($i=0$i<$index$i++{
  304.              
  305.         }
  306.         return $row;
  307.     }
  308.  
  309.     function xForIndex($index{
  310.         return 1;
  311.     }
  312.  
  313.     function yForIndex($index{
  314.         return $index;
  315.     }
  316.  
  317.     $posx 1;
  318.     $posy 1;
  319.     $posz = -2// they'll need to be below the rezzer
  320.     // make a list of potential objects and their potential and default configuration settings
  321.     $possiblemoduleobjects array();
  322.     $allpossiblemodules array_merge($cmsmodules$instancemodules);
  323.     $modulesbyid array();
  324.     foreach($allpossiblemodules as $mod{
  325.  
  326.         // for easy access later
  327.         $modid $mod->id;
  328.         $modulesbyid[$modid$mod;
  329.  
  330.         $modname $mod->modname;
  331.         if (isset($instanceobjectmappingspercourse[$modname])) {
  332.            $modobjects $instanceobjectmappingspercourse[$modname];
  333.            
  334.            $isdefault true;
  335.            foreach($modobjects as $mo{
  336.               $pm array(
  337.                  'object'=>$mo
  338.                  'id'=>$mod->id
  339.                  'name'=>$mod->name
  340.                  'isdefault'=>($isdefault && $recommendedon)
  341.               );
  342.               $possiblemoduleobjects[$pm;
  343.               $isdefault false;  // By default, only turn on the first object for each module
  344.            }
  345.         }
  346.     }
  347.  
  348.     //------------------------------------------------------
  349.  
  350.     echo "<center>";
  351.  
  352.     // Create a form
  353.     echo "<form action=\"view_layout.php\" method=\"POST\">\n";
  354.     echo "<input type=\"hidden\" name=\"courseid\" value=\"{$course->id}\">\n";
  355.     echo "<input type=\"hidden\" name=\"layoutid\" value=\"{$layoutid}\">\n";
  356.  
  357.     $description_table new stdClass();
  358.     $description_table->head array(get_string('layoutmanager:Layouts''sloodle'));
  359.     $description_table->data[array(get_string('layoutmanager:layoutaddpageexplanation''sloodle'));
  360.  
  361.     print '<br />';
  362.     print_table($description_table);
  363.  
  364.     $name_table new stdClass();
  365.     $name_table->data[array(get_string('layoutmanager:layoutname''sloodle'),"<input type=\"text\" name=\"layoutname\" maxlength=\"40\" size=\"40\" value=\"{$layoutname}\" />");
  366.  
  367.     print '<br />';
  368.     print_table($name_table);
  369.  
  370.     print '<br />';
  371.  
  372.     if (!empty($currentlayoutentries)) {
  373.  
  374.  
  375.         $table new stdClass();
  376.         $table->head array('&nbsp;','&nbsp;',get_string('layoutmanager:currentobjects','sloodle'),get_string('layoutmanager:module','sloodle'),get_string('layoutmanager:x','sloodle'),get_string('layoutmanager:y','sloodle'),get_string('layoutmanager:z','sloodle'),get_string('accesslevelobject:use','sloodle'),get_string('accesslevelobject:control','sloodle'),get_string('accesslevel','sloodle'));
  377.  
  378.  
  379.         $item 0;
  380.         $pageitem 0;
  381.  
  382.         foreach($currentlayoutentries as $co{
  383.  
  384.            $sloodlemoduleid '';
  385.            $modname '';
  386.            $confighash $co->get_layout_entry_configs_as_name_value_hash();
  387.            if (isset($confighash['sloodlemoduleid'])) {
  388.            $sloodlemoduleid $confighash['sloodlemoduleid'];
  389.            if (isset($modulesbyid[$sloodlemoduleid])) {
  390.               $modobj $modulesbyid[$sloodlemoduleid];
  391.               $modname $modobj->name;
  392.            }
  393.            }
  394.            $posxyz $co->position;
  395.            //if (preg_match('/^<(-?\d+)\,(-?\d+)\,(-?\d+)>$/', $posxyz, $matches)) {
  396.            if (preg_match('/^<(.*?)\,(.*?)\,(.*?)>$/'$posxyz$matches)) {
  397.           $posx $matches[1];
  398.           $posy $matches[2];
  399.           $posz $matches[3];
  400.            
  401.            $accesssettings array(truetruetrue);
  402.            if (isset($objects_to_configs[$co->name])) {
  403.           $linkertype $objects_to_configs[$co->name];
  404.           if (isset($configs_to_access_options[$linkertype])) {
  405.              $accesssettings $configs_to_access_options[$linkertype];
  406.           }
  407.            }
  408.            echo "\n";
  409.            echo "<input type=\"hidden\" name=\"layout_entry_id_{$item}\" value=\"{$co->id}\" />";
  410.            echo "<input type=\"hidden\" name=\"object_type_{$item}\" value=\"{$co->name}\" />";
  411.            echo "<input type=\"hidden\" name=\"layout_entry_rotation_{$item}\" value=\"{$co->rotation}\" />";
  412.            echo $co->get_layout_entry_configs_as_hidden_fields('layout_entry_config_''_'.$item)
  413.            echo "\n";
  414.  
  415.            $table->data[array(
  416.           $co->id,
  417.           "<input type=\"checkbox\" name=\"layout_entry_on_{$item}\" value=\"on\" checked=\"checked\" />",
  418.           $co->name,
  419.           $modname,
  420.           "<input type=\"text\" name=\"layout_entry_x_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posx\" />",
  421.           "<input type=\"text\" name=\"layout_entry_y_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posy\" />",
  422.           "<input type=\"text\" name=\"layout_entry_z_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posz\" />",
  423.           sloodle_access_level_option_choice('sloodleobjectaccessleveluse'$confighash$accesssettings[0]$prefix 'layout_entry_config_'$suffix '_'.$item),
  424.           sloodle_access_level_option_choice('sloodleobjectaccesslevelctrl'$confighash$accesssettings[1]$prefix 'layout_entry_config_'$suffix '_'.$item),
  425.           sloodle_access_level_option_choice('sloodleserveraccesslevel'$confighash$accesssettings[2]$prefix 'layout_entry_config_'$suffix '_'.$item)
  426.  
  427.            );
  428.            $item++
  429.            $pageitem++;
  430.         }
  431.  
  432.         print_table($table);
  433.  
  434.     print '<br />';
  435.  
  436.     }
  437.  
  438.     $table new stdClass();
  439.     $table->head array('&nbsp; &nbsp; &nbsp; ','&nbsp;',get_string('layoutmanager:addobjects','sloodle'),get_string('layoutmanager:module','sloodle'),get_string('layoutmanager:x','sloodle'),get_string('layoutmanager:y','sloodle'),get_string('layoutmanager:z','sloodle'),get_string('accesslevelobject:use','sloodle'),get_string('accesslevelobject:control','sloodle'),get_string('accesslevel','sloodle'));
  440.  
  441.     $checkedflag '';
  442.     if ($recommendedon{
  443.         $checkedflag 'checked="checked" ';
  444.     }
  445.     foreach($standardobjects as $so{
  446.  
  447.        $posy yForIndex($pageitem);
  448.        $posx xForIndex($pageitem);
  449.      
  450.        $accesssettings array(truetruetrue);
  451.        if (isset($objects_to_configs[$so])) {
  452.           $linkertype $objects_to_configs[$so];
  453.           if (isset($configs_to_access_options[$linkertype])) {
  454.              $accesssettings $configs_to_access_options[$linkertype];
  455.           }
  456.        }
  457.        echo "<input type=\"hidden\" name=\"object_type_{$item}\" value=\"{$so}\" />";
  458.        echo "<input type=\"hidden\" name=\"layout_entry_rotation_{$item}\" value=\"<0,0,0>\" />";
  459.  
  460.        $table->data[array(
  461.            "&nbsp;",
  462.            "<input type=\"checkbox\" name=\"layout_entry_on_{$item}\" value=\"on\" {$checkedflag} />",
  463.            "{$so}",
  464.            "-",
  465.            "<input type=\"text\" name=\"layout_entry_x_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posx\" />",
  466.            "<input type=\"text\" name=\"layout_entry_y_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posy\" />",
  467.            "<input type=\"text\" name=\"layout_entry_z_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posz\" />",
  468.            sloodle_access_level_option_choice('sloodleobjectaccessleveluse'$confighash$accesssettings[0]$prefix 'layout_entry_config_'$suffix '_'.$item),
  469.            sloodle_access_level_option_choice('sloodleobjectaccesslevelctrl'$confighash$accesssettings[1]$prefix 'layout_entry_config_'$suffix '_'.$item),
  470.            sloodle_access_level_option_choice('sloodleserveraccesslevel'$confighash$accesssettings[2]$prefix 'layout_entry_config_'$suffix '_'.$item)
  471.        );
  472.        //$posy = $posy + DEFAULT_SPACING_Y;
  473.       //$posx = $posx + DEFAULT_SPACING_X;
  474.        $item++
  475.        $pageitem++
  476.     }
  477.  
  478.     foreach($possiblemoduleobjects as $pmo{
  479.  
  480.        $posy yForIndex($pageitem);
  481.        $posx xForIndex($pageitem);
  482.  
  483.        $accesssettings array(truetruetrue);
  484.        $objname $pmo['object'];
  485.        if (isset($objects_to_configs[$objname])) {
  486.           $linkertype $objects_to_configs[$objname];
  487.           if (isset($configs_to_access_options[$linkertype])) {
  488.              $accesssettings $configs_to_access_options[$linkertype];
  489.           }
  490.        }
  491.  
  492.        echo "\n";
  493.        echo "<input type=\"hidden\" name=\"object_type_{$item}\" value=\"{$pmo['object']}\" />";
  494.        echo "<input type=\"hidden\" name=\"layout_entry_rotation_{$item}\" value=\"<0,0,0>\" />";
  495.        echo "<input type=\"hidden\" name=\"layout_entry_config_sloodlemoduleid_{$item}\" value=\"{$pmo['id']}\" />";
  496.  
  497.        $checkedflag '';
  498.        if ($pmo['isdefault']{
  499.            $checkedflag "checked=\"checked\""
  500.        }
  501.        $table->data[array(
  502.            "&nbsp;",
  503.            "<input type=\"checkbox\" name=\"layout_entry_on_{$item}\" {$checkedflag} />",
  504.            "{$pmo['object']}",
  505.            "{$pmo['name']}",
  506.            "<input type=\"text\" name=\"layout_entry_x_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posx\" />",
  507.            "<input type=\"text\" name=\"layout_entry_y_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posy\" />",
  508.            "<input type=\"text\" name=\"layout_entry_z_{$item}\" size=\"4\" maxlength=\"9\" value=\"$posz\" />",
  509.            sloodle_access_level_option_choice('sloodleobjectaccessleveluse'$confighash$accesssettings[0]$prefix 'layout_entry_config_'$suffix '_'.$item),
  510.            sloodle_access_level_option_choice('sloodleobjectaccesslevelctrl'$confighash$accesssettings[1]$prefix 'layout_entry_config_'$suffix '_'.$item),
  511.            sloodle_access_level_option_choice('sloodleserveraccesslevel'$confighash$accesssettings[2]$prefix 'layout_entry_config_'$suffix '_'.$item)
  512.        );
  513.       //$posy = $posy + DEFAULT_SPACING_Y;
  514.       // $posx = $posx + DEFAULT_SPACING_X;
  515.        $item++
  516.        $pageitem++
  517.     }
  518.     print_table($table);
  519.  
  520.     // TODO: localize
  521.     echo '<input type="hidden" name="num_items" value="'.($item-1).'" />';
  522.     echo '<input type="submit" value="'.get_string('layoutmanager:savelayout','sloodle').'" />';
  523.     // Determine how many allocations there are for this course
  524.     echo "</form>\n";
  525.  
  526.     echo "</center>";
  527.  
  528.     }
  529.  
  530.     print_box_end();
  531.  
  532. //------------------------------------------------------
  533.     
  534.     print_footer($course);
  535.     
  536. ?>

Documentation generated on Fri, 17 Jul 2009 11:02:48 +0100 by phpDocumentor 1.4.0