From 8ca9717b8828ee0b520e61ee6daaba27e18cb835 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 21 Mar 2012 11:55:14 +0100 Subject: [PATCH] Fixing fatal error "showquestion redeclare" see #4493 --- main/exercice/tests_category.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/main/exercice/tests_category.php b/main/exercice/tests_category.php index 53faec1e37..15fe4e5fc2 100644 --- a/main/exercice/tests_category.php +++ b/main/exercice/tests_category.php @@ -26,17 +26,14 @@ $htmlHeadXtra[] = ' $language_file='exercice'; $nameTools= ""; -include('question.class.php'); -include('testcategory.class.php'); -include('../inc/global.inc.php'); -include('exercise.lib.php'); - -//Library already added in global.inc.php -//require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); +require_once '../inc/global.inc.php'; +require_once 'exercise.lib.php'; +require_once 'question.class.php'; +require_once 'testcategory.class.php'; $this_section=SECTION_COURSES; -if(!api_is_allowed_to_edit()) { +if (!api_is_allowed_to_edit()) { api_not_allowed(true); } @@ -226,36 +223,32 @@ function display_categories() { echo $row['description']; echo ''; echo '
'; - echo ''.Display::return_icon('edit.gif', get_lang('Edit')).''; + echo ''.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).''; if ($nb_question > 0) { echo ''; - echo Display::return_icon('delete_na.gif', get_lang('CannotDeleteCategory')); + echo Display::return_icon('delete_na.png', get_lang('CannotDeleteCategory'), array(), ICON_SIZE_SMALL); echo ''; } else { $rowname = protectJSDialogQuote($row['title']); - echo ''; - echo Display::return_icon('delete.gif', get_lang('Delete')).''; + echo Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).''; } echo '
'; } } -// ------------------------------------------------------------------------ // display goback to category list page link -// ------------------------------------------------------------------------ function display_goback() { echo '
'; echo ''.Display::return_icon('back.png', get_lang('BackToCategoryList'), array(), 32).''; echo '
'; } -// ------------------------------------------------------------------------ // To allowed " in javascript dialog box without bad surprises // replace " with two ' -// ------------------------------------------------------------------------ function protectJSDialogQuote($in_txt) { $res = $in_txt; $res = str_replace("'", "\'", $res);