]> git.mjollnir.org Git - moodle.git/commitdiff
Clean up code (Bugs 5027, 5161), 'weekscss' course format.
authornfreear <nfreear>
Thu, 13 Apr 2006 14:37:32 +0000 (14:37 +0000)
committernfreear <nfreear>
Thu, 13 Apr 2006 14:37:32 +0000 (14:37 +0000)
course/format/weekscss/format.php

index f3aa27f4622a89eb8da41e92f733f3e7bad6ac53..e7a1e4b739e5a6217092b40364284ddde6c4f5af 100644 (file)
     require_once("$CFG->dirroot/mod/forum/lib.php");
 
     $week = optional_param('week', -1, PARAM_INT);
-/*
-    // Bounds for block widths; in PIXELS.
-    define('BLOCK_L_MIN_WIDTH', 100);
-    define('BLOCK_L_MAX_WIDTH', 210);
-    define('BLOCK_R_MIN_WIDTH', 100);
-    define('BLOCK_R_MAX_WIDTH', 210);
-
-    $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),  
-                                            BLOCK_L_MAX_WIDTH);
-    $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 
-                                            BLOCK_R_MAX_WIDTH);
-    // 'Answer' in pixels: left 180, right 210.
-    
-    //Accessibility: relative block widths to approximate current pixel widths.
-    // Min/max-width not supported by IE6.
-    $preferred_width_left  = '18%; ';
-    $preferred_width_right = '18%; ';
-    $width_center = '60%; ';
-    $min_max_block= 'min-width:100px; max-width:210px; ';
-    $min_max_main = 'min-width:25em; max-width:37em; '; //33em
-*/
+
     if ($week != -1) {
         $displaysection = course_set_display($course->id, $week);
     } else {
@@ -98,7 +78,6 @@
 /// The left column ...
 
     if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
-        //echo '<div style="width:'.$preferred_width_left.$min_max_block.'float:left;" id="left-column">';
         echo '<div id="left-column">';
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
         echo '</div>';
     
 /// The right column, BEFORE the middle-column.
     if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
-        //echo '<div style="width:'.$preferred_width_right.$min_max_block.' float:right;" id="right-column">';
         echo '<div id="right-column">';
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
         echo '</div>';
     }
 
 /// Start main column
-    //echo '<div id="middle-column" style="width:'.$width_center.$min_max_main.'float:left;">';
     echo '<div id="middle-column">';
 
     print_heading_block(get_string('weeklyoutline'), 'outline');
         echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions);
 
         if (isediting($course->id)) {
-            echo '<a title="'.$streditsummary.'" '.
+            echo '<p><a title="'.$streditsummary.'" '.
                  ' href="editsection.php?id='.$thissection->id.'"><img src="'.$CFG->pixpath.'/t/edit.gif" '.
-                 ' class="icon edit" alt="'.$streditsummary.'" /></a><br /><br />';
+                 ' class="icon edit" alt="'.$streditsummary.'" /></a></p>';
         }
         echo '</div>';
         
             print_section_add_menus($course, $section, $modnames);
         }
 
-        echo '</div>'; //'<div class="right side" >&nbsp;</div><div class="clearer"></div>';
+        echo '</div>';
         echo "</li>\n";
     }
 
                 }
             }
 
-            echo '</div>'; /*'<div class="right side">';
-            
-            if ($displaysection == $section) {
-                echo '<a href="view.php?id='.$course->id.'&amp;week=0#section-'.$section.'" title="'.$strshowallweeks.'">'.
-                     '<img src="'.$CFG->pixpath.'/i/all.gif" class="icon wkall" alt="'.$strshowallweeks.'" /></a><br />';
-            } else {
-                $strshowonlyweek = get_string("showonlyweek", "", $section);
-                echo '<a href="view.php?id='.$course->id.'&amp;week='.$section.'" title="'.$strshowonlyweek.'">'.
-                     '<img src="'.$CFG->pixpath.'/i/one.gif" class="icon wkone" alt="'.$strshowonlyweek.'" /></a><br />';
-            }
-
-            if (isediting($course->id)) {
-                if ($thissection->visible) {        // Show the hide/show eye
-                    echo '<a href="view.php?id='.$course->id.'&amp;hide='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strweekhide.'">'.
-                         '<img src="'.$CFG->pixpath.'/i/hide.gif" class="icon hide" alt="'.$strweekhide.'" /></a><br />';
-                } else {
-                    echo '<a href="view.php?id='.$course->id.'&amp;show='.$section.'&amp;sesskey='.$USER->sesskey.'#section-'.$section.'" title="'.$strweekhide.'">'.
-                         '<img src="'.$CFG->pixpath.'/i/show.gif" class="icon hide" alt="'.$strweekhide.'" /></a><br />';
-                }
-                if ($section > 1) {                       // Add a arrow to move section up
-                    echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=-1&amp;sesskey='.$USER->sesskey.'#section-'.($section-1).'" title="'.$strmoveup.'">'.
-                         '<img src="'.$CFG->pixpath.'/t/up.gif" class="icon up" alt="'.$strmoveup.'" /></a><br />';
-                }
-
-                if ($section < $course->numsections) {    // Add a arrow to move section down
-                    echo '<a href="view.php?id='.$course->id.'&amp;section='.$section.'&amp;move=1&amp;sesskey='.$USER->sesskey.'#section-'.($section+1).'" title="'.$strmovedown.'">'.
-                         '<img src="'.$CFG->pixpath.'/t/down.gif" class="icon down" alt="'.$strmovedown.'" /></a><br />';
-                }
-            }
-
-            ///echo '</div><div class="clearer"></div>';
-            */
+            echo '</div>';
             echo "</li>\n";
         }
 
 
     echo '</div>';
 
-/*    // The right column
-    if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
-        echo '<div style="width:'.$preferred_width_right.$min_max_block.' float:right;" id="right-column">';
-        blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
-        echo '</div>';
-    }
-
-    echo '<div class="clearer"></div>';
-*/
     echo '</div>';
     echo '<div class="clearer"></div>';
 
-if ($CFG->debug > 7) {
-?>
-<p class="debugwarn">Debug, document.body.clientWidth:
-  <script type="text/javascript">
-  document.writeln(document.body.clientWidth +" pixels [Refresh after resize.]");
-  </script><noscript>[Unknown] Javascript disabled.</noscript>
-</p>
-<?php
-}
 ?>
\ No newline at end of file