MDL-10689:
[moodle-linuxchix.git] / lib / form / editorhelp.php
blob794e14f5259b7478591570ee004ad9d07ac85175
1 <?php
2 require_once('../../config.php');
3 $topics = array();
4 $titles = array();
5 for ($i=1; ; $i++){
6 $button = optional_param("button$i", '', PARAM_ALPHAEXT);
7 if ($button){
8 switch ($button){
9 case 'reading' :
10 $topics[$i] = helplink('reading', get_string('helpreading'), 'moodle', false, true);
11 break;
12 case 'writing' :
13 $topics[$i] = helplink('writing', get_string('helpwriting'));
14 break;
15 case 'questions' :
16 $topics[$i] = helplink('questions', get_string('helpquestions'));
17 break;
18 case 'emoticons' :
19 $topics[$i] = helplink('emoticons', get_string('helpemoticons'));
20 break;
21 case 'richtext' :
22 $topics[$i] = helplink('richtext', get_string('helprichtext'));
23 break;
24 case 'text' :
25 $topics[$i] = helplink('text', get_string('helptext'));
26 break;
27 default :
28 error('Unknown help topic '.$item);
30 } else {
31 $keyword = optional_param("keyword$i", '', PARAM_ALPHAEXT);
32 if ('' == $keyword) {
33 break;//exit for loop - no more help items
35 $title = optional_param("title$i", '', PARAM_NOTAGS);
36 $module = optional_param("module$i", 'moodle', PARAM_ALPHAEXT);
37 $func[$i] = 'helpbutton';
38 $topics[$i] = helplink($keyword, $title, $module);
42 print_header();
43 print_simple_box_start('center', '96%');
44 print_heading(get_string('editorhelptopics'));
47 echo '<ul>';
48 foreach ($topics as $i => $topic){
49 echo('<li>'.$topics[$i].'</li>');
51 echo '</ul>';
52 print_simple_box_end();
53 // End of page.
54 close_window_button();
55 global $CFG;
56 echo '<p align="center"><a href="'.$CFG->wwwroot.'/help.php?file=index.html">'. get_string('helpindex') .'</a></p>';
58 $CFG->docroot = ''; // We don't want a doc link here
59 print_footer('none');
60 die;
61 /**
62 * A function to return a simple link to a help page. We don't want a popup here
63 * since these links are displayed in a pop up already.
65 * @param string $page
66 * @param string $linktext
67 * @param string $module
68 * @return string
70 function helplink($page, $linktext='', $module='moodle'){
71 global $CFG;
72 return "<a href=\"$CFG->wwwroot/help.php?module=$module&amp;file=$page.html\">$linktext</a>";