If pages have been created using camel case, and this option is activated, those pages remain, but may not be linkable. If the option is disabled, they will be linked again.
-<P ALIGN=CENTER><B>Allow Binary Files</B></P>
+<P ALIGN=CENTER><B>Student Administration Options</B></P>
<P>Certain administration options can be turned 'on' or 'off' for students. When 'on', these options only
take affect for wikis that can be edited by the student. When 'off', they will not appear in the administrator
--- /dev/null
+<P ALIGN=CENTER><B>Wiki Auto-linking Options</B></P>
+
+<P>In certain situations, you may not want automatic linking based on CamelCase words.
+If this is so, check this box to disable CamelCase linking.
+</p>
+<p>
+<b>WARNING</b> -- CamelCase is a standard wiki feature, and disabling it may cause other
+imported wikis to work incorrectly. Use this feature <i>only</i> if you are absolutely certain
+you do not want CamelCase linking.
+</P>
$string['ewikiprinttitle'] = 'Print the wiki name on every page.';
$string['htmlmode'] = 'HTML Mode';
$string['ewikiacceptbinary'] = 'Allow binary files';
+$string['wikilinkoptions'] = 'Wiki auto-linking options';
$string['studentadminoptions'] = 'Student admin options';
$string['initialcontent'] = 'Choose an Initial Page';
$string['chooseafile'] = 'Choose/upload initial page';
.' ADD `revertchanges` TINYINT DEFAULT \'1\' NOT NULL AFTER `removepages`');
}
+ if ($oldversion < 2004062400) {
+ execute_sql('ALTER TABLE `'.$CFG->prefix.'wiki`'
+ .' ADD `disablecamelcase` TINYINT DEFAULT \'0\' NOT NULL AFTER `ewikiacceptbinary`');
+ }
+
return true;
}
`ewikiprinttitle` tinyint(4) NOT NULL default '1',
`htmlmode` tinyint(4) NOT NULL default '0',
`ewikiacceptbinary` tinyint(4) NOT NULL default '0',
+ `disablecamelcase` tinyint(4) NOT NULL default '0',
`setpageflags` tinyint(4) NOT NULL default '1',
`strippages` tinyint(4) NOT NULL default '1',
`removepages` tinyint(4) NOT NULL default '1',
define("EWIKI_AUTO_LOGIN", 1); # [auth_query] on startup
#-- allowed WikiPageNameCharacters
- define("EWIKI_CHARS_L", "a-z_µ¤$\337-\377");
- define("EWIKI_CHARS_U", "A-Z0-9\300-\336");
+
+#### BEGIN MOODLE CHANGES - to remove auto-camelcase linking.
+ global $moodle_disable_camel_case;
+ if ($moodle_disable_camel_case) {
+ define("EWIKI_CHARS_L", "");
+ define("EWIKI_CHARS_U", "");
+ }
+ else {
+#### END MOODLE CHANGES
+
+ define("EWIKI_CHARS_L", "a-z_µ¤$\337-\377");
+ define("EWIKI_CHARS_U", "A-Z0-9\300-\336");
+
+#### BEGIN MOODLE CHANGES
+ }
+#### END MOODLE CHANGES
+
define("EWIKI_CHARS", EWIKI_CHARS_L.EWIKI_CHARS_U);
#-- database
"script_url" => (defined("EWIKI_SCRIPT_URL")?EWIKI_SCRIPT_URL:NULL),
"script_binary" => EWIKI_SCRIPT_BINARY,
#-- heart of the wiki -- don't try to read this! ;)
+
"wiki_pre_scan_regex" => '/
(?<![~!])
((?:(?:\w+:)*['.EWIKI_CHARS_U.']+['.EWIKI_CHARS_L.']+){2,}[\w\d]*)
|\^([-'.EWIKI_CHARS_L.EWIKI_CHARS_U.']{3,})
|\[ (?:"[^\]\"]+" | \s+ | [^:\]#]+\|)* ([^\|\"\[\]\#]+) (?:\s+ | "[^\]\"]+")* [\]\#]
|(\w{3,9}:\/\/[^?#\s\[\]\'\"\)\,<]+) /x',
+
"wiki_link_regex" => "\007 [!~]?(
\#?\[[^<>\[\]\n]+\] |
\^[-".EWIKI_CHARS_U.EWIKI_CHARS_L."]{3,} |
\b([\w]{3,}:)*([".EWIKI_CHARS_U."]+[".EWIKI_CHARS_L."]+){2,}\#?[\w\d]* |
([a-z]{2,9}://|mailto:)[^\s\[\]\'\"\)\,<]+ |
\w[-_.+\w]+@(\w[-_\w]+[.])+\w{2,} ) \007x",
+
#-- rendering ruleset
"wm_indent" => '<div style="margin-left:15px;" class="indent">',
"wm_table_defaults" => 'cellpadding="2" border="1" cellspacing="0"',
$wiki->pagename = wiki_page_name($wiki);
/// Check 'check boxes'. The variables won't be set at all of they were deselected.
+ $wiki->disablecamelcase = (isset($wiki->disablecamelcase)) ? 1 : 0;
$wiki->setpageflags = (isset($wiki->setpageflags)) ? 1 : 0;
$wiki->removepages = (isset($wiki->removepages)) ? 1 : 0;
$wiki->strippages = (isset($wiki->strippages)) ? 1 : 0;
$wiki->pagename = wiki_page_name($wiki);
/// Check 'check boxes'. The variables won't be set at all of they were deselected.
+ $wiki->disablecamelcase = (isset($wiki->disablecamelcase)) ? 1 : 0;
$wiki->setpageflags = (isset($wiki->setpageflags)) ? 1 : 0;
$wiki->removepages = (isset($wiki->removepages)) ? 1 : 0;
$wiki->strippages = (isset($wiki->strippages)) ? 1 : 0;
</TD>
</TR>
+<tr valign="top">
+ <td align="right">
+ <?php helpbutton('wikilinkoptions', get_string('wikilinkoptions', 'wiki'), 'wiki') ?>
+ <b> <?php print_string('wikilinkoptions', 'wiki') ?>:</b></td>
+ <td>
+ <input type="checkbox" name="disablecamelcase" value="1" <?php echo $form->disablecamelcase?"CHECKED":""; ?> />
+ Disable CamelCase linking.<br />
+ </td>
+</tr>
+
<tr valign="top">
<td align="right">
<?php helpbutton('studentadminoptions', get_string('studentadminoptions', 'wiki'), 'wiki') ?>
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2004061300; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2004062400; // The current module version (Date: YYYYMMDDXX)
$module->cron = 0; // Period for cron to check this module (secs)
?>
### SAVE ID from Moodle
$moodleID=@$_REQUEST["id"];
+/// Globally disable CamelCase, if the option is selected for this wiki.
+ $moodle_disable_camel_case = ($wiki->disablecamelcase == 1);
+
if (($wiki_entry = wiki_get_default_entry($wiki, $course, $userid, $groupid))) {
/// ################# EWIKI Part ###########################