Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removing THEME variable and replacing with CSS (SE)
  • Loading branch information
moodler committed Mar 10, 2005
1 parent 4663fb7 commit a846610
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 47 deletions.
64 changes: 25 additions & 39 deletions mod/glossary/lib.php
Expand Up @@ -855,11 +855,11 @@ function glossary_print_entry_attachment($entry,$format=NULL,$align="right",$ins
function glossary_print_entry_approval($cm, $entry, $mode,$align="right",$insidetable=true) {
if ( $mode == 'approval' and !$entry->approved ) {
if ($insidetable) {
echo "<table border=\"0\" width=\"100%\" align=\"$align\"><tr><td align=\"$align\">\n";
echo '<table class="glossaryapproval" align="'.$align.'"><tr><td align="'.$align.'">';
}
echo "<a title=\"" . get_string("approve","glossary"). "\" href=\"approve.php?id=$cm->id&amp;eid=$entry->id&amp;mode=$mode\"><img align=\"$align\" src=\"check.gif\" border=\"0\" width=\"34\" height=\"34\" alt=\"\" /></a>\n";
echo '<a title="'.get_string('approve','glossary').'" href="approve.php?id='.$cm->id.'&amp;eid='.$entry->id.'&amp;mode='.$mode.'"><img align="'.$align.'" src="check.gif" border="0" width="34" height="34" alt="" /></a>';
if ($insidetable) {
echo "</td></tr></table>\n";
echo '</td></tr></table>';
}
}
}
Expand Down Expand Up @@ -1172,19 +1172,7 @@ function glossary_print_attachments($entry, $return=NULL, $align="left") {
return $imagereturn;
}

function glossary_print_tabbed_table_start($data, $currenttab, $tTHEME = NULL) {

if ( !$tTHEME ) {
global $THEME;
$tTHEME = $THEME;
}

$tabcolor = $tTHEME->InactiveTabColor;
$inactivefontcolor = $tTHEME->InactiveFontColor;

$tablewidth = $tTHEME->TabTableWidth;
$tabsperrow = $tTHEME->TabsPerRow;
$tabseparation = $tTHEME->TabSeparation;
function glossary_print_tabbed_table_start($data, $currenttab, $tabsperrow=4) {

$tabs = count($data);
$tabwidth = (int) (100 / $tabsperrow);
Expand All @@ -1194,11 +1182,11 @@ function glossary_print_tabbed_table_start($data, $currenttab, $tTHEME = NULL) {
$numrows = (int) ( $tabs / $tabsperrow ) + 1;

?>
<table border="0" cellpadding="0" cellspacing="0" width="<?php p($tablewidth) ?>">
<table cellspacing="0" class="glossarydisplay">
<tr>
<td width="100%">

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<table cellspacing="0" class="tabs" width="100%">

<?php
$tabproccessed = 0;
Expand All @@ -1208,14 +1196,14 @@ function glossary_print_tabbed_table_start($data, $currenttab, $tTHEME = NULL) {
for ($col = 0; $col < $tabsperrow; $col++) {
if ( $tabproccessed < $tabs ) {
if ( $col == 0 ) {
echo "<td width=\"$tabseparation\" align=\"center\">&nbsp;</td>";
echo '<td class="separator">&nbsp;</td>';
}
if ($tabproccessed == $currenttab) {
$currentstyle = 'generaltabselected';
$currentstyle = 'selected';
} elseif ( !$data[$tabproccessed]->link ) {
$currentstyle = 'generaltabinactive';
$currentstyle = 'inactive';
} else {
$currentstyle = 'generaltab';
$currentstyle = 'general';
}

echo "<td class=\"$currentstyle\" width=\"$tabwidth%\" align=\"center\"><b>";
Expand All @@ -1231,7 +1219,7 @@ function glossary_print_tabbed_table_start($data, $currenttab, $tTHEME = NULL) {
echo "</b></td>";

if ( $col < $tabsperrow ) {
echo "<td width=\"$tabseparation\" align=\"center\">&nbsp;</td>";
echo '<td class="separator">&nbsp;</td>';
}
} else {
echo "<td colspan=\"".(2* $tabsperrow)."\"></td>\n";
Expand All @@ -1250,7 +1238,7 @@ function glossary_print_tabbed_table_start($data, $currenttab, $tTHEME = NULL) {
for ($col = 0; $col < $tabsperrow; $col++) {
if ( $tabproccessed < $tabs ) {
if ( $col == 0 ) {
echo "<td width=\"$tabseparation\" align=\"center\">&nbsp;</td>";
echo '<td class="separator">&nbsp;</td>';
}

if ($tabproccessed == $currenttab) {
Expand Down Expand Up @@ -1278,8 +1266,7 @@ function glossary_print_tabbed_table_start($data, $currenttab, $tTHEME = NULL) {
echo "</b></td>";

if ($col < $tabsperrow) {
echo "<td width=\"$tabseparation\" align=\"center\">&nbsp;</td>";
}
echo '<td class="separator">&nbsp;</td>'; }
} else {
echo "<td colspan = " . (2 * ($tabsperrow - $col)) . " align=\"center\">";
echo "</td>";
Expand Down Expand Up @@ -1634,22 +1621,21 @@ function glossary_print_entry_ratings($course, $entry, $ratings = NULL) {
}

function glossary_print_dynaentry($courseid, $entries, $displayformat = -1) {
global $THEME, $USER,$CFG;

$colour = $THEME->cellheading2;
global $USER,$CFG;

echo "\n<center><table width=\"95%\" border=\"0\"><tr>";
echo "<td width=\"100%\"\">";
echo '<center>';
echo '<table class="glossarypopup" cellspacing="0"><tr>';
echo '<td>';
if ( $entries ) {
foreach ( $entries as $entry ) {
if (! $glossary = get_record("glossary", "id", $entry->glossaryid)) {
error("Glossary ID was incorrect or no longer exists");
if (! $glossary = get_record('glossary', 'id', $entry->glossaryid)) {
error('Glossary ID was incorrect or no longer exists');
}
if (! $course = get_record("course", "id", $glossary->course)) {
error("Glossary is misconfigured - don't know what course it's from");
if (! $course = get_record('course', 'id', $glossary->course)) {
error('Glossary is misconfigured - don\'t know what course it\'s from');
}
if (!$cm = get_coursemodule_from_instance("glossary", $entry->glossaryid, $glossary->course) ) {
error("Glossary is misconfigured - don't know what course module it is ");
if (!$cm = get_coursemodule_from_instance('glossary', $entry->glossaryid, $glossary->course) ) {
error('Glossary is misconfigured - don\'t know what course module it is');
}

//If displayformat is present, override glossary->displayformat
Expand Down Expand Up @@ -1679,8 +1665,8 @@ function glossary_print_dynaentry($courseid, $entries, $displayformat = -1) {
}
}
}
echo "</td>";
echo "</tr></table></center>";
echo '</td>';
echo '</tr></table></center>';
}

function glossary_generate_export_file($glossary, $hook = "", $hook = 0) {
Expand Down
9 changes: 1 addition & 8 deletions mod/glossary/tabs.html
Expand Up @@ -7,13 +7,6 @@
}

echo '<center>';
$glossary_tCFG->TabTableBGColor = $THEME->cellheading;
$glossary_tCFG->ActiveTabColor = $THEME->cellheading;
$glossary_tCFG->InactiveTabColor = $THEME->cellcontent2;
$glossary_tCFG->InactiveFontColor= $THEME->hidden;
$glossary_tCFG->TabTableWidth = "70%";
$glossary_tCFG->TabsPerRow = 4;
$glossary_tCFG->TabSeparation = 4;

$data[GLOSSARY_STANDARD_VIEW]->caption = get_string("standardview", "glossary");
$data[GLOSSARY_CATEGORY_VIEW]->caption = get_string("categoryview", "glossary");
Expand Down Expand Up @@ -63,7 +56,7 @@
}

/// printing header of the current tab
glossary_print_tabbed_table_start($data, $tab, $glossary_tCFG);
glossary_print_tabbed_table_start($data, $tab, 4);

if (!isset($category)) {
$category = "";
Expand Down

0 comments on commit a846610

Please sign in to comment.