Moving options from 2nd tab to main area. Step1. MDL-8793

Merged from MOODLE_18_STABLE
This commit is contained in:
stronk7
2007-03-29 22:19:29 +00:00
parent 8f80eba57d
commit 136ce8dee2
3 changed files with 83 additions and 44 deletions
+3 -25
View File
@@ -15,30 +15,8 @@
$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.
'&mode='.$mode.'&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.'&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
+65 -19
View File
@@ -233,30 +233,76 @@
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;
}
rss_print_link($course->id, $userid, "glossary", $glossary->id, $tooltiptext);
echo '</td></tr></table>';
/// 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>';
}
/// the "Print" icon
$printicon = '';
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>";
/// 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 />';
}
$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>';
}
}
print_heading(format_string($glossary->name).$printicon);
/// 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) {
$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) {
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();
}
}
/// End glossary controls
print_box_end(); /// glossarycontrol
print_box('&nbsp;', 'clearer');
/// Info box
if ( $glossary->intro ) {
+15
View 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