]> git.mjollnir.org Git - moodle.git/commitdiff
Moving options from 2nd tab to main area. Step1. MDL-8793
authorstronk7 <stronk7>
Thu, 29 Mar 2007 22:19:29 +0000 (22:19 +0000)
committerstronk7 <stronk7>
Thu, 29 Mar 2007 22:19:29 +0000 (22:19 +0000)
Merged from MOODLE_18_STABLE

mod/glossary/tabs.php
mod/glossary/view.php
theme/standard/styles_layout.css

index e0afbe59b7459fb13804990552071aa663d85b1f..2edb871b8e20eec3f9221152dee39c6243efc6ae 100644 (file)
     $inactive = array();
     $activated = array();
 
-    if (has_capability('mod/glossary:import', $context)) {
-        $toolsrow[] = new tabobject(GLOSSARY_IMPORT_VIEW, 
-                                    $CFG->wwwroot.'/mod/glossary/import.php?id='.$cm->id, 
-                                    get_string('importentries', 'glossary'));
-    }
-    if (has_capability('mod/glossary:export', $context)) {
-        $toolsrow[] = new tabobject(GLOSSARY_EXPORT_VIEW, 
-                                    $CFG->wwwroot.'/mod/glossary/export.php?id='.$cm->id.
-                                    '&amp;mode='.$mode.'&amp;hook='.urlencode($hook), 
-                                    get_string('exportentries', 'glossary'));
-    }
-
-    if (has_capability('mod/glossary:approve', $context)) {
-        if ($hiddenentries = count_records_select('glossary_entries',"glossaryid  = $glossary->id and approved = 0")) {
-            $toolsrow[] = new tabobject(GLOSSARY_APPROVAL_VIEW, 
-                                        $CFG->wwwroot.'/mod/glossary/view.php?id='.$id.'&amp;mode=approval',
-                                        get_string("waitingapproval", "glossary"). ' ('.$hiddenentries.')');
-
-        } else if ($tab == GLOSSARY_APPROVAL_VIEW) {  
-         // Teachers going to approval view and without entries->go to defaulttab
-            $tab = $defaulttab;
-        }
-    } else if ($tab == GLOSSARY_APPROVAL_VIEW) { 
-     // Non-teachers going to approval view go to defaulttab
+    if (!has_capability('mod/glossary:approve', $context) && $tab == GLOSSARY_APPROVAL_VIEW) {
+    /// Non-teachers going to approval view go to defaulttab
         $tab = $defaulttab;
     }
 
@@ -81,7 +59,7 @@
 
 <?php print_tabs($tabrows, $tab, $inactive, $activated); ?>
 
-  <div width="100%" class="entrybox">
+  <div class="entrybox">
 
 <?php
  
index 5c3d6f8e74b3ea1a91295e0cf20c2dbded2388c4..b65465fb17d7370595b843ff7c52d5c6f1105e82 100644 (file)
     print_header_simple(format_string($glossary->name), "",
                  "$navigation ".format_string($glossary->name), "", "", true, update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
 
-    //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) {
-            echo '<table width="100%" border="0" cellpadding="3" cellspacing="0"><tr valign="top"><td align="right">';
-            $tooltiptext = get_string("rsssubscriberss","glossary",format_string($glossary->name,true));
-            if (empty($USER->id)) {
-                $userid = 0;
-            } else {
-                $userid = $USER->id;
+/// To calculate available options
+    $availableoptions = '';
+
+/// Decide about to print the import link
+    if (has_capability('mod/glossary:import', $context)) {
+        $availableoptions = '<span class="helplink">' .
+                            '<a href="' . $CFG->wwwroot . '/mod/glossary/import.php?id=' . $cm->id . '"' .
+                            '  title="' . s(get_string('importentries', 'glossary')) . '">' .
+                            get_string('importentries', 'glossary') . '</a>' .
+                            '</span>';
+    }
+/// Decide about to print the export link
+    if (has_capability('mod/glossary:export', $context)) {
+        if ($availableoptions) {
+            $availableoptions .= '&nbsp;/&nbsp;';
+        }
+        $availableoptions .='<span class="helplink">' .
+                            '<a href="' . $CFG->wwwroot . '/mod/glossary/export.php?id=' . $cm->id . 
+                            '&amp;mode='.$mode . '&amp;hook=' . urlencode($hook) . '"' .
+                            '  title="' . s(get_string('exportentries', 'glossary')) . '">' .
+                            get_string('exportentries', 'glossary') . '</a>' .
+                            '</span>';
+    }
+
+/// Decide about to print the approval link
+    if (has_capability('mod/glossary:approve', $context)) {
+    /// Check we have pending entries
+        if ($hiddenentries = count_records_select('glossary_entries',"glossaryid  = $glossary->id and approved = 0")) {
+            if ($availableoptions) {
+                $availableoptions .= '<br />';
             }
-            rss_print_link($course->id, $userid, "glossary", $glossary->id, $tooltiptext);
-            echo '</td></tr></table>';
+            $availableoptions .='<span class="helplink">' .
+                                '<a href="' . $CFG->wwwroot . '/mod/glossary/view.php?id=' . $cm->id . 
+                                '&amp;mode=approval' . '"' .
+                                '  title="' . s(get_string('waitingapproval', 'glossary')) . '">' .
+                                get_string('waitingapproval', 'glossary') . ' ('.$hiddenentries.')</a>' .
+                                '</span>';
         }
+    }
+
+/// Start to print glossary controls
+    print_box_start('glossarycontrol');
+    echo $availableoptions;
 
+/// 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) {
 
-    /// the "Print" icon
-    $printicon = '';
+        $tooltiptext = get_string("rsssubscriberss","glossary",format_string($glossary->name,true));
+        if (empty($USER->id)) {
+            $userid = 0;
+        } else {
+            $userid = $USER->id;
+        }
+        print_box_start('rsslink');
+        rss_print_link($course->id, $userid, "glossary", $glossary->id, $tooltiptext);
+        print_box_end(); 
+    }
+/// The print icon
     if ( $isuserframe and $mode != 'search') {
         if (has_capability('mod/glossary:manageentries', $context) or $glossary->allowprintview) {
-            $printicon = " <a title =\"". get_string("printerfriendly","glossary") ."\" target=\"printview\" href=\"print.php?id=$cm->id&amp;mode=$mode&amp;hook=".urlencode($hook)."&amp;sortkey=$sortkey&amp;sortorder=$sortorder&amp;offset=$offset\"><img class=\"icon\" src=\"print.gif\" alt=\"". get_string("printerfriendly","glossary") . "\" /></a>";
+            print_box_start('printicon');
+            echo " <a title =\"". get_string("printerfriendly","glossary") ."\" target=\"printview\" href=\"print.php?id=$cm->id&amp;mode=$mode&amp;hook=".urlencode($hook)."&amp;sortkey=$sortkey&amp;sortorder=$sortorder&amp;offset=$offset\"><img class=\"icon\" src=\"print.gif\" alt=\"". get_string("printerfriendly","glossary") . "\" /></a>";
+            print_box_end(); 
         }
     }
-    print_heading(format_string($glossary->name).$printicon);
+/// End glossary controls
+    print_box_end(); /// glossarycontrol
 
+    print_box('&nbsp;', 'clearer');
 
 /// Info box
     if ( $glossary->intro ) {
index e2ad949e25dd38712ec545deffdefcab11ab38e0..7e2bef5b5fbcc447ab5f11d0939fc08cccfe07b2 100644 (file)
@@ -2848,10 +2848,16 @@ body#mod-forum-search .introcontent {
 }
 
 .entrybox {
+  width: 100%;
   border-width: 0px 1px 1px 1px;
   border-style: solid;
 }
 
+.entrybox hr {
+  border-left:none;
+  border-right:none;
+}
+
 .glossarypost {
   width: 95%;
   border-width:1px;
@@ -2969,6 +2975,15 @@ body#mod-forum-search .introcontent {
   text-align: center;
 }
 
+.mod-glossary .tabrow0 {
+  padding-bottom: 5px;
+}
+
+#mod-glossary-view .glossarycontrol {
+  float: right;
+  text-align:right;
+  white-space: nowrap;
+}
 
 /***
  *** Modules: Journal