Changeset 84
- Timestamp:
- 05/23/2006 06:10:49 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
handlers/page/edit.php (modified) (5 diffs)
-
setup/install.php (modified) (1 diff)
-
wikka.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/handlers/page/edit.php
r65 r84 10 10 <div class="page"<?php echo $ondblclick;?>> 11 11 <?php 12 if (!(preg_match("/^[A-Za-zÄÖÜßäöü]+[A-Za-z0-9ÄÖÜßäöü]*$/s", $this->tag))) { 12 if (!(preg_match("/^[A-Za-zÄÖÜßäöü]+[A-Za-z0-9ÄÖÜßäöü]*$/s", $this->tag))) { //TODO use central regex library 13 13 echo '<em>The page name is invalid. Valid page names must start with a letter and contain only letters and numbers.</em>'; 14 14 } … … 35 35 if ($this->page['id'] != $_POST['previous']) 36 36 { 37 $error = 'OVERWRITE ALERT: This page was modified by someone else while you were editing it.<br />'."\n".'Please copy your changes and re-edit this page. ';37 $error = 'OVERWRITE ALERT: This page was modified by someone else while you were editing it.<br />'."\n".'Please copy your changes and re-edit this page.<br />'; 38 38 } 39 } 40 // check for edit note 41 if (($this->config['require_edit_note'] == 1) && $_POST['note']=='') 42 { 43 $error .= 'MISSING EDIT NOTE: Please fill in an edit note!<br />'."\n"; 39 44 } 40 45 // store … … 83 88 { 84 89 $previewButtons = 85 "<hr />\n" .90 "<hr />\n"; 86 91 // We need to escape ALL entity refs before display so we display them _as_ entities instead of interpreting them 87 92 // so we use htmlspecialchars on the edit note (as on the body) 88 '<input size="50" type="text" name="note" value="'.htmlspecialchars($note).'"/> Note on your edit.<br />'."\n". 89 '<input name="submit" type="submit" value="Store" accesskey="s" />'."\n". 93 if ($this->config['require_edit_note'] != 2) //check if edit_notes are enabled 94 { 95 $previewButtons .= '<input size="50" type="text" name="note" value="'.htmlspecialchars($note).'"/> Note on your edit.<br />'."\n"; 96 } 97 $previewButtons .= '<input name="submit" type="submit" value="Store" accesskey="s" />'."\n". 90 98 '<input name="submit" type="submit" value="Re-Edit" accesskey="p" id="reedit_id" />'."\n". 91 99 '<input type="button" value="Cancel" onclick="document.location=\''.$this->href('').'\';" />'."\n"; … … 123 131 if ($error) 124 132 { 125 $output .= '< div class="error">'.$error.'</div>'."\n";133 $output .= '<em class="error">'.$error.'</em>'."\n"; 126 134 } 127 135 … … 137 145 // We need to escape ALL entity refs before display so we display them _as_ entities instead of interpreting them 138 146 // hence htmlspecialchars() instead of htmlspecialchars_ent() which UNescapes entities! 139 '<textarea id="body" name="body" style="width: 100%; height: 500px">'.htmlspecialchars($body).'</textarea><br />'."\n" .147 '<textarea id="body" name="body" style="width: 100%; height: 500px">'.htmlspecialchars($body).'</textarea><br />'."\n"; 140 148 //note add Edit 141 149 // We need to escape ALL entity refs before display so we display them _as_ entities instead of interpreting them 142 150 // so we use htmlspecialchars on the edit note (as on the body) 143 '<input size="40" type="text" name="note" value="'.htmlspecialchars($note).'" /> Please add a note on your edit.<br />'."\n". 144 //finish 145 '<input name="submit" type="submit" value="Store" accesskey="s" /> <input name="submit" type="submit" value="Preview" accesskey="p" /> <input type="button" value="Cancel" onclick="document.location=\''.$this->Href('').'\';" />'."\n". 151 if ($this->config['require_edit_note'] != 2) //check if edit_notes are enabled 152 { 153 $output .= '<input size="40" type="text" name="note" value="'.htmlspecialchars($note).'" /> Please add a note on your edit.<br />'."\n"; 154 } 155 //finish 156 $output .= '<input name="submit" type="submit" value="Store" accesskey="s" /> <input name="submit" type="submit" value="Preview" accesskey="p" /> <input type="button" value="Cancel" onclick="document.location=\''.$this->Href('').'\';" />'."\n". 146 157 $this->FormClose(); 147 158 148 if ($this-> GetConfigValue('gui_editor') == 1) {149 $output .=150 '<script language="JavaScript" src="3rdparty/plugins/wikiedit/protoedit.js"></script>'."\n".151 '<script language="JavaScript" src="3rdparty/plugins/wikiedit/wikiedit2.js"></script>'."\n";159 if ($this->config['gui_editor'] == 1) 160 { 161 $output .= '<script type="text/javascript" src="3rdparty/plugins/wikiedit/protoedit.js"></script>'."\n". 162 '<script type="text/javascript" src="3rdparty/plugins/wikiedit/wikiedit2.js"></script>'."\n"; 152 163 $output .= '<script type="text/javascript">'." wE = new WikiEdit(); wE.init('body','WikiEdit','editornamecss');".'</script>'."\n"; 153 164 } -
trunk/setup/install.php
r79 r84 285 285 test(sprintf(ADDING_CONFIG_ENTRY, 'wiki_suffix'), 1); 286 286 $config["wiki_suffix"] = '@wikka'; 287 test(sprintf(ADDING_CONFIG_ENTRY, 'require_edit_note'), 1); 288 $config["require_edit_note"] = '0'; 287 289 // cookie names have changed -- logout user and delete the old cookies 288 290 test(DELETING_COOKIES, 1); -
trunk/wikka.php
r83 r84 130 130 'xml_recent_changes' => '10', 131 131 'hide_comments' => '0', 132 'require_edit_note' => '0', # edit note optional (0, default), edit note required (1) edit note disabled (2) 132 133 'anony_delete_own_comments' => '1', 133 134 'double_doublequote_html' => 'safe',