From 677038ee7dcfd6c6cc70e4f619bdfaeb8c8c6e5c Mon Sep 17 00:00:00 2001 From: willcast Date: Mon, 20 Oct 2003 16:42:49 +0000 Subject: [PATCH] - Removing notices when debug is on - Deleting entries with attachments now delete the attachments properly --- mod/glossary/deleteentry.php | 2 +- mod/glossary/dynalink.php | 18 ++-- mod/glossary/lib.php | 182 ++++++++++++++++++----------------- 3 files changed, 103 insertions(+), 99 deletions(-) diff --git a/mod/glossary/deleteentry.php b/mod/glossary/deleteentry.php index 3a59a765b70..5d01b6a8f17 100644 --- a/mod/glossary/deleteentry.php +++ b/mod/glossary/deleteentry.php @@ -61,7 +61,7 @@ } } else { if ( $entry->attachment ) { - glossary_delete_old_attachments($entry->id); + glossary_delete_old_attachments($entry); } delete_records("glossary_entries","id", $entry->id); } diff --git a/mod/glossary/dynalink.php b/mod/glossary/dynalink.php index 3b39bf3aaff..2c1c27d1cfc 100644 --- a/mod/glossary/dynalink.php +++ b/mod/glossary/dynalink.php @@ -1,8 +1,5 @@ showalphabet) { - $output .= get_string("explainalphabet","glossary").'
'; + $output = ""; + if ($glossary->showalphabet) { + $output .= get_string("explainalphabet","glossary").'
'; + } + + echo "
$output

"; + + if ( $glossary->showspecial ) { + if ( $l == "SPECIAL" ) { + echo "$strspecial | "; + } else { + $strexplainspecial = strip_tags(get_string("explainspecial","glossary")); + echo "wwwroot/mod/glossary/view.php?id=$cm->id&l=SPECIAL\">$strspecial | "; + } } - - echo "

$output

"; - if ( $glossary->showspecial ) { - if ( $l == "SPECIAL" ) { - echo "$strspecial | "; - } else { - $strexplainspecial = strip_tags(get_string("explainspecial","glossary")); - echo "wwwroot/mod/glossary/view.php?id=$cm->id&l=SPECIAL\">$strspecial | "; + if ( $glossary->showalphabet ) { + $alphabet = explode("|", get_string("alphabet","glossary")); + $letters_by_line = 14; + for ($i = 0; $i < count($alphabet); $i++) { + if ( $l == $alphabet[$i] and $l) { + echo "$alphabet[$i]"; + } else { + echo "wwwroot/mod/glossary/view.php?id=$cm->id&l=$alphabet[$i]\">$alphabet[$i]"; + } + if ((int) ($i % $letters_by_line) != 0 or $i == 0) { + echo " | "; + } else { + echo "
"; + } } - } + } - if ( $glossary->showalphabet ) { - $alphabet = explode("|", get_string("alphabet","glossary")); - $letters_by_line = 14; - for ($i = 0; $i < count($alphabet); $i++) { - if ( $l == $alphabet[$i] and $l) { - echo "$alphabet[$i]"; - } else { - echo "wwwroot/mod/glossary/view.php?id=$cm->id&l=$alphabet[$i]\">$alphabet[$i]"; - } - if ((int) ($i % $letters_by_line) != 0 or $i == 0) { - echo " | "; - } else { - echo "
"; - } - } - } + if ( $glossary->showall ) { + if ( $l == "ALL" ) { + echo "$strallentries"; + } else { + $strexplainall = strip_tags(get_string("explainall","glossary")); + echo "wwwroot/mod/glossary/view.php?id=$cm->id&l=ALL\">$strallentries"; + } + } + $neworder = ""; + if ( $sortorder ) { + if ( $sortorder == "asc" ) { + $neworder = "&sortorder=desc"; + $ordertitle = get_string("descending","glossary"); + } else { + $neworder = "&sortorder=asc"; + $ordertitle = get_string("ascending","glossary"); + } + $icon = " "; + } else { + if ( $sortkey != "CREATION" and $sortkey != "UPDATE" ) { + $icon = ""; + $ordertitle = get_string("ascending","glossary"); + } else { + $ordertitle = get_string("descending","glossary"); + $neworder = "&sortorder=desc"; + $icon = " "; + } + } + $cicon = ""; + $cneworder = ""; + $cbtag = ""; + $cendbtag = ""; - if ( $glossary->showall ) { - if ( $l == "ALL" ) { - echo "$strallentries"; - } else { - $strexplainall = strip_tags(get_string("explainall","glossary")); - echo "wwwroot/mod/glossary/view.php?id=$cm->id&l=ALL\">$strallentries"; - } - } - $neworder = ""; - if ( $sortorder ) { - if ( $sortorder == "asc" ) { - $neworder = "&sortorder=desc"; - $ordertitle = get_string("descending","glossary"); - } else { - $neworder = "&sortorder=asc"; - $ordertitle = get_string("ascending","glossary"); - } - $icon = " "; - } else { - if ( $sortkey != "CREATION" and $sortkey != "UPDATE" ) { - $icon = ""; - $ordertitle = get_string("ascending","glossary"); - } else { - $ordertitle = get_string("descending","glossary"); - $neworder = "&sortorder=desc"; - $icon = " "; - } - } - $cicon = ""; - $cneworder = ""; - $cbtag = ""; - $cendbtag = ""; + $uicon = ""; + $uneworder = ""; + $ubtag = ""; + $uendbtag = ""; - $uicon = ""; - $uneworder = ""; - $ubtag = ""; - $uendbtag = ""; - - if ( $sortkey == "CREATION" ) { - $cicon = $icon; - $cneworder = $neworder; - $cordertitle = $ordertitle; - $uordertitle = get_string("ascending","glossary"); - $cbtag = ""; - $cendbtag = ""; - } elseif ($sortkey == "UPDATE") { - $uicon = $icon; - $uneworder = $neworder; - $cordertitle = get_string("ascending","glossary"); - $uordertitle = $ordertitle; - $ubtag = ""; - $uendbtag = ""; - } else { - $cordertitle = get_string("ascending","glossary"); - $uordertitle = get_string("ascending","glossary"); - } - echo "
$strsort: $ubtagwwwroot/mod/glossary/view.php?id=$cm->id&sortkey=UPDATE$uneworder\">$strsortbylastupdate$uicon$uendbtag | ". - "$cbtagwwwroot/mod/glossary/view.php?id=$cm->id&sortkey=CREATION$cneworder\">$strsortbycreation$cicon$cendbtag

"; + if ( $sortkey == "CREATION" ) { + $cicon = $icon; + $cneworder = $neworder; + $cordertitle = $ordertitle; + $uordertitle = get_string("ascending","glossary"); + $cbtag = ""; + $cendbtag = ""; + } elseif ($sortkey == "UPDATE") { + $uicon = $icon; + $uneworder = $neworder; + $cordertitle = get_string("ascending","glossary"); + $uordertitle = $ordertitle; + $ubtag = ""; + $uendbtag = ""; + } else { + $cordertitle = get_string("ascending","glossary"); + $uordertitle = get_string("ascending","glossary"); + } + echo "
$strsort: $ubtagwwwroot/mod/glossary/view.php?id=$cm->id&sortkey=UPDATE$uneworder\">$strsortbylastupdate$uicon$uendbtag | ". + "$cbtagwwwroot/mod/glossary/view.php?id=$cm->id&sortkey=CREATION$cneworder\">$strsortbycreation$cicon$cendbtag

"; } + function glossary_print_categories_menu($course, $cm, $glossary, $cat, $category) { global $CFG, $THEME; echo "";