The best way to learn how to use the WebCore is by example. See the documentation for more information.
The requested URL is always shown first; if a page uses one or more WebCore templates, those are shown afterwards.
00 <?php
01 require_once ('quizzes/init.php');
02 require_once ('quizzes/db/quiz_query.php');
03 $quiz_query = new QUIZ_QUERY ($Page);
04 /** @var QUIZ $quiz */
05 $quiz = $quiz_query->object_at_id (read_var ('id'));
06
07 $valid_action = $quiz;
08
09 $Page->template_options->title = "Quiz";
10 $Page->location->add_root_link ();
11 $Page->location->append ("Quizzes", "./");
12
13 if ($valid_action)
14 {
15 $Page->title->subject = $quiz->title;
16 $Page->location->append ($quiz->title);
17 }
18 else
19 $Page->title->subject = '[Unknown Quiz]';
20
21 $Page->start_display ();
22
23 if ($valid_action)
24 {
25 ?>
26 <div class="main-box">
27 <div class="text-flow">
28 <?php
29 require_once ('quizzes/forms/quiz_form.php');
30 $form = new QUIZ_FORM ($quiz);
31 $form->process_existing ($quiz);
32 $form->action = 'view_quiz.php';
33 $form->display ();
34 ?>
35 </div>
36 </div>
37 <?php
38 }
39 else
40 $Page->raise_security_violation ('That quiz does not exist.');
41
42 $Page->finish_display ();
43 ?>
44
45