ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
form.php
Go to the documentation of this file.
1 <?php
2 
4 {
7  return;
8  }
9 
10  global $PHORUM;
11 
13 
14  $frm = new PhorumInputForm ("", "post", "Save");
15  $frm->hidden("module", "modsettings");
16  $frm->hidden("mod", "htmlpurifier"); // this is the directory name that the Settings file lives in
17 
18  if (!empty($error)){
19  echo "$error<br />";
20  }
21 
22  $frm->addbreak("Edit settings for the HTML Purifier module");
23 
24  $frm->addMessage('<p>The box below sets <code>$PHORUM[\'mod_htmlpurifier\'][\'wysiwyg\']</code>.
25  When checked, contents sent for edit are now purified and the
26  informative message is disabled. If your WYSIWYG editor is disabled for
27  admin edits, you can safely keep this unchecked.</p>');
28  $frm->addRow('Use WYSIWYG?', $frm->checkbox('wysiwyg', '1', '', $PHORUM['mod_htmlpurifier']['wysiwyg']));
29 
30  $frm->addMessage('<p>The box below sets <code>$PHORUM[\'mod_htmlpurifier\'][\'suppress_message\']</code>,
31  which removes the big how-to use
32  HTML Purifier message.</p>');
33  $frm->addRow('Suppress information?', $frm->checkbox('suppress_message', '1', '', $PHORUM['mod_htmlpurifier']['suppress_message']));
34 
35  $frm->addMessage('<p>Click on directive links to read what each option does
36  (links do not open in new windows).</p>
37  <p>For more flexibility (for instance, you want to edit the full
38  range of configuration directives), you can create a <tt>config.php</tt>
39  file in your <tt>mods/htmlpurifier/</tt> directory. Doing so will,
40  however, make the web configuration interface unavailable.</p>');
41 
42  require_once 'HTMLPurifier/Printer/ConfigForm.php';
43  $htmlpurifier_form = new HTMLPurifier_Printer_ConfigForm('config', 'http://htmlpurifier.org/live/configdoc/plain.html#%s');
44  $htmlpurifier_form->setTextareaDimensions(23, 7); // widen a little, since we have space
45 
46  $frm->addMessage($htmlpurifier_form->render(
47  $config, $PHORUM['mod_htmlpurifier']['directives'], false));
48 
49  $frm->addMessage("<strong>Warning: Changing HTML Purifier's configuration will invalidate
50  the cache. Expect to see a flurry of database activity after you change
51  any of these settings.</strong>");
52 
53  $frm->addrow('Reset to defaults:', $frm->checkbox("reset", "1", "", false));
54 
55  // hack to include extra styling
56  echo '<style type="text/css">' . $htmlpurifier_form->getCSS() . '
57  .hp-config {margin-left:auto;margin-right:auto;}
58  </style>';
59  $js = $htmlpurifier_form->getJavaScript();
60  echo '<script type="text/javascript">'."<!--\n$js\n//-->".'</script>';
61 
62  $frm->show();
63 }
64 
66 {
67  global $PHORUM;
68 
69  // update mod_htmlpurifier for housekeeping
71 
72  // politely tell user how to edit settings manually
73 ?>
74  <div class="input-form-td-break">How to edit settings for HTML Purifier module</div>
75  <p>
76  A <tt>config.php</tt> file exists in your <tt>mods/htmlpurifier/</tt>
77  directory. This file contains your custom configuration: in order to
78  change it, please navigate to that file and edit it accordingly.
79  You can also set <code>$GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg']</code>
80  or <code>$GLOBALS['PHORUM']['mod_htmlpurifier']['suppress_message']</code>
81  </p>
82  <p>
83  To use the web interface, delete <tt>config.php</tt> (or rename it to
84  <tt>config.php.bak</tt>).
85  </p>
86  <p>
87  <strong>Warning: Changing HTML Purifier's configuration will invalidate
88  the cache. Expect to see a flurry of database activity after you change
89  any of these settings.</strong>
90  </p>
91 <?php
92 
93 }
94 
95 // vim: et sw=4 sts=4
File written to
$js
$PHORUM['mod_htmlpurifier']['directives']
Definition: settings.php:28
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
phorum_htmlpurifier_show_form()
Definition: form.php:3
phorum_htmlpurifier_get_config($default=false)
Initializes the appropriate configuration from either a PHP file or a module configuration value...
Definition: init-config.php:8
$error
Definition: Error.php:17
phorum_htmlpurifier_show_config_info()
Definition: form.php:65
Reload workbook from saved file
settings()
Definition: settings.php:2
phorum_htmlpurifier_config_file_exists()
Definition: init-config.php:25
phorum_htmlpurifier_commit_settings()
Definition: save.php:23