]> git.mjollnir.org Git - moodle.git/commitdiff
_ added the DIV framework for new CSS
authorurs_hunkler <urs_hunkler>
Wed, 19 Jan 2005 12:02:52 +0000 (12:02 +0000)
committerurs_hunkler <urs_hunkler>
Wed, 19 Jan 2005 12:02:52 +0000 (12:02 +0000)
mod/glossary/edit.php
mod/glossary/export.php
mod/glossary/formats/faq/faq_format.php
mod/glossary/import.php
mod/glossary/index.php
mod/glossary/view.php

index 8dd69c7971e4309923d1cb6c9c762670a194e5fa..a786cf401e67c2a864d534bf7a8fbc95ec006cce 100644 (file)
@@ -85,10 +85,14 @@ if ( $confirm ) {
               <a href=\"view.php?id=$cm->id\">$glossary->name</a> -> $stredit", "form.text",
               "", true, "", navmenu($course, $cm));
 
+        echo '<div id="glossary-edit" class="glossary">';  // glossary-edit wrapper start
+
         print_heading($glossary->name);
 
         include("edit.html");
 
+        echo '</div>';  // glossary-edit wrapper end
+
         print_footer($course);
         die;
     }
@@ -96,9 +100,9 @@ if ( $confirm ) {
                         "<A HREF=\"index.php?id=$course->id\">$strglossaries</A> ->
               <A HREF=\"view.php?id=$cm->id\">$glossary->name</A> -> $stredit", "form.text",
                         "", true, "", navmenu($course, $cm));
-    
+
     print_heading($glossary->name);
-    
+
     if ($e) {
         //We are updating an entry, so we compare current session user with
         //existing entry user to avoid some potential problems if secureforms=off
@@ -107,11 +111,11 @@ if ( $confirm ) {
         $ineditperiod = ((time() - $old->timecreated <  $CFG->maxeditingtime) || $glossary->editalways);
         if ( (!$ineditperiod  || $USER->id != $old->userid) and !isteacher($course->id) and $e) {
             if ( $USER->id != $old->userid ) {
-                error("You can't edit other people's entries!"); 
+                error("You can't edit other people's entries!");
             } elseif (!$ineditperiod) {
-                error("You can't edit this. Time expired!"); 
-            }           
-            die;        
+                error("You can't edit this. Time expired!");
+            }
+            die;
         }
 
         $newentry->id = $e;
@@ -148,7 +152,7 @@ if ( $confirm ) {
             error("Could not update this glossary entry because this concept already exist.");
         }
     } else {
-    
+
         $newentry->userid = $USER->id;
         $newentry->timecreated = $timenow;
         $newentry->sourceglossaryid = 0;
@@ -287,6 +291,8 @@ print_header_simple(strip_tags("$glossary->name"), "",
               <a href=\"view.php?id=$cm->id\">$glossary->name</a> -> $stredit", "",
               "", true, "", navmenu($course, $cm));
 
+echo '<div id="glossary-edit" class="glossary">';  // glossary-edit wrapper start
+
 $ineditperiod = ((time() - $newentry->timecreated <  $CFG->maxeditingtime) || $glossary->editalways);
 if ( (!$ineditperiod  || $USER->id != $newentry->userid) and !isteacher($course->id) and $e) {
     if ( $USER->id != $newentry->userid ) {
@@ -326,6 +332,8 @@ glossary_print_tabbed_table_end();
        use_html_editor("text");
     }
 
+echo '</div>';  // glossary-edit wrapper end
+
 print_footer($course);
 
 ?>
index 6b904e0e9815d9510b416db5e0aee2ae9dd52740..c0332b4b95eb5b282940cb824e01f4a508a30e90 100644 (file)
@@ -3,7 +3,7 @@
     require_once("../../config.php");
     require_once("lib.php");
     global $CFG, $USER;
-    
+
     require_variable($id);           // Course Module ID
 
     optional_variable($l,"");
 
     if (! $cm = get_record("course_modules", "id", $id)) {
         error("Course Module ID was incorrect");
-    } 
-    
+    }
+
     if (! $course = get_record("course", "id", $cm->course)) {
         error("Course is misconfigured");
-    } 
-    
+    }
+
     if (! $glossary = get_record("glossary", "id", $cm->instance)) {
         error("Course module is incorrect");
-    } 
-    
-    require_login($course->id);    
+    }
+
+    require_login($course->id);
     if (!isteacher($course->id)) {
         error("You must be a teacher to use this page.");
-    } 
+    }
 
     $strglossaries = get_string("modulenameplural", "glossary");
     $strglossary = get_string("modulename", "glossary");
@@ -34,7 +34,7 @@
     $strsearchconcept = get_string("searchconcept", "glossary");
     $strsearchindefinition = get_string("searchindefinition", "glossary");
     $strsearch = get_string("search");
-    
+
     $navigation = "";
     if ($course->category) {
         $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
@@ -46,6 +46,8 @@
         "", "", true, update_module_button($cm->id, $course->id, $strglossary),
         navmenu($course, $cm));
     
+    echo '<div id="glossary-export" class="glossary">';  // glossary-export wrapper start
+
     echo '<p align="center"><font size="3"><b>' . stripslashes_safe($glossary->name);
     echo '</b></font></p>';
 
@@ -76,7 +78,7 @@
         $ffurl = "../../file.php?file=$ffurl";
     }
     echo '<p align="center"><a href="' . $ffurl . '" target="_blank">' . get_string("exportedfile","glossary") .  '</a></p>';
-    
+
     echo '</center>';
     glossary_print_tabbed_table_end();
     print_footer();
index 4e0fc5d36bc181c76474cffa7abb9803147092c7..dbbb4022e86b77cf44744f694c99680c572de6f2 100644 (file)
@@ -36,8 +36,10 @@ function glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode="", $hoo
 
         $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
         echo '</td></tr></table>';
+        echo "</div>\n"; // end container div
 
     } else {
+        echo "<div id=\"glossary-edit\" class=\"glossary\">\n"; // glossary-edit container div
         echo '<center>';
         print_string("noentry", "glossary");
         echo '</center>';
index 261eceafe2f2b1e37c4ddab4a1d9b0da8be099a6..a0bcc08802178b066c0660ddfd75edf198c51c7f 100644 (file)
@@ -7,7 +7,7 @@
 
     require_variable($id);           // Course Module ID
 
-    optional_variable($step,0);   
+    optional_variable($step,0);
     optional_variable($dest,"current");   // current | new
     optional_variable($file);             // file to import
     optional_variable($catsincl,0);       // Import Categories too?
 
     if (! $cm = get_record("course_modules", "id", $id)) {
         error("Course Module ID was incorrect");
-    } 
-    
+    }
+
     if (! $course = get_record("course", "id", $cm->course)) {
         error("Course is misconfigured");
-    } 
-    
+    }
+
     if (! $glossary = get_record("glossary", "id", $cm->instance)) {
         error("Course module is incorrect");
-    } 
-    
-    require_login($course->id);    
+    }
+
+    require_login($course->id);
     if (!isteacher($course->id)) {
         error("You must be a teacher to use this page.");
-    } 
+    }
 
     if ($dest != 'new' and $dest != 'current') {
         $dest = 'current';
     $strsearchconcept = get_string("searchconcept", "glossary");
     $strsearchindefinition = get_string("searchindefinition", "glossary");
     $strsearch = get_string("search");
-    
+
     print_header_simple(strip_tags("$glossary->name"), "",
         "<a href=\"index.php?id=$course->id\">$strglossaries</a> -> $glossary->name",
         "", "", true, update_module_button($cm->id, $course->id, $strglossary),
         navmenu($course, $cm));
-    
+
+    echo '<div id="glossary-import" class="glossary">';  // glossary-import wrapper start
+
     echo '<p align="center"><font size="3"><b>' . stripslashes_safe($glossary->name);
     echo '</b></font></p>';
 
     include("tabs.html");
 
     if ( !$step ) {
-        include("import.html");        
+        include("import.html");
 
         echo '</center>';
         glossary_print_tabbed_table_end();
         print_footer($course);
+        echo '</div>';  // glossary-import wrapper end
         exit;
-    } 
+    }
 
     $form = data_submitted();
     $file = $_FILES["file"];
         if ($dest == 'new') {
             // If the user chose to create a new glossary
             $xmlglossary = $xml['GLOSSARY']['#']['INFO'][0]['#'];
-    
+
             if ( $xmlglossary['NAME'][0]['#'] ) {
                 unset($glossary);
                 $glossary->name = addslashes(utf8_decode($xmlglossary['NAME'][0]['#']));
                     echo '</center>';
                     glossary_print_tabbed_table_end();
                     print_footer($course);
+                    echo '</div>'; // glossary-import wrapper end
                     exit;
                 } else {
                     //The instance has been created, so lets do course_modules
                 echo '</center>';
                 glossary_print_tabbed_table_end();
                 print_footer($course);
+                echo '</div>'; // glossary-import wrapper end
                 exit;
             }
         }
             $permissiongranted = 1;
             if ( $newentry->concept and $newentry->definition ) {
                 if ( !$glossary->allowduplicatedentries ) {
-                    // checking if the entry is valid (checking if it is duplicated when should not be) 
+                    // checking if the entry is valid (checking if it is duplicated when should not be)
                     if ( $newentry->casesensitive ) {
                         $dupentry = get_record("glossary_entries","concept",$newentry->concept,"glossaryid",$glossary->id);
                     } else {
                 $newentry->format           = $xmlentry['#']['FORMAT'][0]['#'];
                 $newentry->timecreated      = time();
                 $newentry->timemodified     = time();
-                
+
                 // Setting the default values if no values were passed
                 if ( isset($xmlentry['#']['USEDYNALINK'][0]['#']) ) {
                     $newentry->usedynalink      = $xmlentry['#']['USEDYNALINK'][0]['#'];
                         for($k = 0; $k < sizeof($xmlcats); $k++) {
                             $xmlcat = $xmlcats[$k];
                             unset($newcat);
-        
+
                             $newcat->name = addslashes(utf8_decode($xmlcat['#']['NAME'][0]['#']));
                             $newcat->usedynalink = $xmlcat['#']['USEDYNALINK'][0]['#'];
                             if ( !$category = get_record("glossary_categories","glossaryid",$glossary->id,"name",$newcat->name) ) {
         }
         echo '</table><hr width="75%">';
 
-        // rejected entries 
+        // rejected entries
         if ($rejections) {
             echo '<center><table border="0" width="70%">';
             echo '<tr><td align="center" colspan="2" width="100%"><strong>' . get_string("rejectionrpt","glossary") . '</strong></tr>';
     glossary_print_tabbed_table_end();
 
 /// Finish the page
+
+    echo '</div>'; // glossary-import wrapper end
+
     print_footer($course);
 
 ?>
index ab61d3756da1b4da334c4cb9189c618a444f8071..dbe1e62e7319c6f91ba4a5ae2a8590516c573077 100644 (file)
@@ -29,6 +29,8 @@
 
     print_header_simple("$strglossarys", "", "$strglossarys", "", "", true, "", navmenu($course));
 
+    echo '<div id="glossary-index" class="glossary">';  // glossary-index wrapper start
+
 /// Get all the appropriate data
 
     if (! $glossarys = get_all_instances_in_course("glossary", $course)) {
@@ -57,7 +59,7 @@
 
     $can_subscribe = (isstudent($course->id) or isteacher($course->id) or isadmin());
 
-    if ($show_rss = (($can_subscribe || $course->id == SITEID) && 
+    if ($show_rss = (($can_subscribe || $course->id == SITEID) &&
                      isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
                      $CFG->enablerssfeeds && $CFG->glossary_enablerssfeeds)) {
         $table->head[] = $strrss;
 
 /// Finish the page
 
+    echo '</div>';  // glossary-index wrapper end
+
     print_footer($course);
 
 ?>
index 4b3c2e307134b179535b84c5e3c0e938d803ea48..70c4ece655606a32d9859703b37f6b2d6b239a5e 100644 (file)
@@ -6,8 +6,8 @@
 
     global $CFG, $THEME, $USER;
     $debug = 0;
-    $CFG->startpagetime = microtime();            
-    
+    $CFG->startpagetime = microtime();
+
     optional_variable($id);           // Course Module ID
     optional_variable($g);            // Glossary ID
 
     if (!empty($id)) {
         if (! $cm = get_record("course_modules", "id", $id)) {
             error("Course Module ID was incorrect");
-        }     
+        }
         if (! $course = get_record("course", "id", $cm->course)) {
             error("Course is misconfigured");
-        }     
+        }
         if (! $glossary = get_record("glossary", "id", $cm->instance)) {
             error("Course module is incorrect");
-        } 
+        }
     } else if (!empty($g)) {
         if (! $glossary = get_record("glossary", "id", $g)) {
             error("Course module is incorrect");
-        } 
+        }
         if (! $course = get_record("course", "id", $glossary->course)) {
             error("Could not determine which course this belonged to!");
-        }     
+        }
         if (!$cm = get_coursemodule_from_instance("glossary", $glossary->id, $course->id)) {
             error("Could not determine which course module this belonged to!");
         }
     if ($CFG->forcelogin) {
         require_login();
     }
-    
+
 /// redirecting if adding a new entry
     if ($tab == GLOSSARY_ADDENTRY_VIEW ) {
         redirect("edit.php?id=$cm->id&amp;mode=$mode");
     }
 
 /// setting the defaut number of entries per page if not set
-    
+
     if ( !$entriesbypage = $glossary->entbypage ) {
         $entriesbypage = $CFG->glossary_entbypage;
     }
@@ -77,7 +77,7 @@
             $mode      = $dp->defaultmode;
             $hook      = $dp->defaulthook;
             $sortkey   = $dp->sortkey;
-            $sortorder = $dp->sortorder;            
+            $sortorder = $dp->sortorder;
         }
     } else {
         $printpivot = 1;
@@ -89,7 +89,7 @@
 
     if ( $displayformat == -1 ) {
          $displayformat = $glossary->displayformat;
-    } 
+    }
 
     if ( $show ) {
         $mode = 'term';
     if (!$cm->visible and !isteacher($course->id)) {
         print_header();
         notice(get_string("activityiscurrentlyhidden"));
-    } 
+    }
     add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id&amp;tab=$tab", $glossary->id, $cm->id);
 
 /// stablishing flag variables
         }
     }
     if ( $sortkey = strtoupper($sortkey) ) {
-        if ($sortkey != 'CREATION' and 
-            $sortkey != 'UPDATE' and 
-            $sortkey != 'FIRSTNAME' and 
+        if ($sortkey != 'CREATION' and
+            $sortkey != 'UPDATE' and
+            $sortkey != 'FIRSTNAME' and
             $sortkey != 'LASTNAME'
             ) {
             $sortkey = '';
         foreach ($searchterms as $key => $searchterm) {
             if (strlen($searchterm) < 2) {
                 unset($searchterms[$key]);
-            } 
-        } 
+            }
+        }
         $hook = trim(implode(' ', $searchterms));
     break;
-    
+
     case 'entry':  /// Looking for a certain entry id
         $tab = GLOSSARY_STANDARD_VIEW;
         if ( $dp = get_record("glossary_formats","name", $glossary->displayformat) ) {
             $displayformat = $dp->popupformatname;
         }
     break;
-    
+
     case 'cat':    /// Looking for a certain cat
         $tab = GLOSSARY_CATEGORY_VIEW;
         if ( $hook > 0 ) {
         $tab = GLOSSARY_DATE_VIEW;
         if ( !$sortkey ) {
             $sortkey = 'UPDATE';
-        } 
+        }
         if ( !$sortorder ) {
             $sortorder = 'desc';
         }
     break;
-    
+
     case 'author':  /// Looking for entries, browsed by author
         $tab = GLOSSARY_AUTHOR_VIEW;
         if ( !$hook ) {
             $hook = 'ALL';
-        } 
+        }
         if ( !$sortkey ) {
             $sortkey = 'FIRSTNAME';
-        } 
+        }
         if ( !$sortorder ) {
             $sortorder = 'asc';
         }
     default:
         $tab = GLOSSARY_STANDARD_VIEW;
         if ( !$hook ) {
-            $hook = 'ALL';  
-        } 
+            $hook = 'ALL';
+        }
     break;
-    }  
+    }
 
     switch ( $tab ) {
-    case GLOSSARY_IMPORT_VIEW: 
-    case GLOSSARY_EXPORT_VIEW: 
+    case GLOSSARY_IMPORT_VIEW:
+    case GLOSSARY_EXPORT_VIEW:
     case GLOSSARY_APPROVAL_VIEW:
         $isuserframe = 0;
     break;
-    
+
     default:
         $isuserframe = 1;
     break;
     $strsearchconcept = get_string("searchconcept", "glossary");
     $strsearchindefinition = get_string("searchindefinition", "glossary");
     $strsearch = get_string("search");
-    
+
     print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname",
         "$navigation <a href=\"index.php?id=$course->id\">$strglossaries</a> -> $glossary->name",
         "", "", true, update_module_button($cm->id, $course->id, $strglossary),
         navmenu($course, $cm));
 
+    echo '<div id="glossary-view" class="glossary">';  // glossary-view wrapper start
+
     //If rss are activated at site and glossary level and this glossary has rss defined, show link
         if (isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
             $CFG->enablerssfeeds && $CFG->glossary_enablerssfeeds && $glossary->rsstype && $glossary->rssarticles) {
             rss_print_link($course->id, $userid, "glossary", $glossary->id, $tooltiptext);
             echo '</td></tr></table>';
         }
-    
+
     echo '<p align="center"><font size="3"><b>' . stripslashes_safe($glossary->name);
     if ( $isuserframe and $mode != 'search') {
     /// the "Print" icon
 
     echo '<table align="center" width="70%" border="0">';
     echo '<tr><td align="center" class="glossarysearchbox">';
-    
+
     echo '<input type="submit" value="'.$strsearch.'" name="searchbutton" /> ';
     if ($mode == 'search') {
         echo '<input type="text" name="hook" size="20" value="'.$hook.'" alt="'.$strsearch.'" /> ';
     echo '<input type="hidden" name="mode" value="search" />';
     echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
     echo $strsearchindefinition;
-    print_simple_box_end();    
-    
+    print_simple_box_end();
+
     echo '</form>';
     echo '<br />';
 
     include("tabs.html");
 
     include_once("sql.php");
-    
+
 /// printing the entries
     $entriesshown = 0;
     $currentpivot = '';
             $pivot = $entry->pivot;
             if ( !$fullpivot ) {
                 $pivot = $pivot[0];
-            }            
-            
+            }
+
             /// if there's a group break
-            if ( $currentpivot != strtoupper($pivot) ) {  
+            if ( $currentpivot != strtoupper($pivot) ) {
 
                 // print the group break if apply
                 if ( $printpivot )  {
                     if ( isset($entry->uid) ) {
                     // printing the user icon if defined (only when browsing authors)
                         echo '<td align="left">';
-                        
+
                         $user = get_record("user","id",$entry->uid);
                         print_user_picture($user->id, $course->id, $user->picture);
                         $pivottoshow = fullname($user, isteacher($course->id));;
 
                 }
             }
-            
+
             $concept = $entry->concept;
             $definition = $entry->definition;
 
             /// highlight the term if necessary
             if ($mode == 'search') {
                 $entry->highlight = $hook;
-            } 
+            }
 
             /// and finally print the entry.
-            
+
             if ( glossary_print_entry($course, $cm, $glossary, $entry, $mode, $hook,1,$displayformat,$ratings) ) {
                 $ratingsmenuused = true;
             }
     }
 
 /// Finish the page
+
+    echo '</div>';  // glossary-view wrapper end
+
     print_footer($course);
 
 ?>