From 7221d319be53fa69ece51b3456c801e618fc7f6e Mon Sep 17 00:00:00 2001 From: defacer Date: Tue, 1 Feb 2005 07:34:17 +0000 Subject: [PATCH] Fixing all the details in the block instance configuration screen. That wasn't so hard! --- lib/pagelib.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/pagelib.php b/lib/pagelib.php index 6964c00c15..228a2c919b 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -519,6 +519,7 @@ class page_quiz extends page_base { // initialized correctly and ready for use. var $courserecord = NULL; var $modulerecord = NULL; + var $quizrecord = NULL; // Do any validation of the officially recognized bits of the data and forward to parent. // Do NOT load up "expensive" resouces (e.g. SQL data) here! @@ -544,7 +545,11 @@ class page_quiz extends page_base { } $this->courserecord = get_record('course', 'id', $this->modulerecord->course); if(empty($this->courserecord)) { - error('Cannot fully initialize page: invalid course id '. $this->id); + error('Cannot fully initialize page: invalid course id '. $this->modulerecord->course); + } + $this->quizrecord = get_record('quiz', 'id', $this->id); + if(empty($this->courserecord)) { + error('Cannot fully initialize page: invalid quiz id '. $this->id); } $this->full_init_done = true; } @@ -572,18 +577,17 @@ class page_quiz extends page_base { $this->init_full(); $replacements = array( - '%fullname%' => $this->courserecord->fullname + '%fullname%' => $this->quizrecord->name ); foreach($replacements as $search => $replace) { $title = str_replace($search, $replace, $title); } - if($this->courserecord->id == SITEID) { - $breadcrumbs = array(); - } - else { - $breadcrumbs = array($this->courserecord->shortname => $CFG->wwwroot.'/course/view.php?id='.$this->courserecord->id); - } + $breadcrumbs = array( + $this->courserecord->shortname => $CFG->wwwroot.'/course/view.php?id='.$this->courserecord->id, + get_string('modulenameplural', 'quiz') => $CFG->wwwroot.'/mod/quiz/index.php?id='.$this->courserecord->id, + $this->quizrecord->name => $CFG->wwwroot.'/mod/quiz/view.php?id='.$this->modulerecord->id, + ); if(!empty($morebreadcrumbs)) { $breadcrumbs = array_merge($breadcrumbs, $morebreadcrumbs); -- 2.39.5