- Joined
- Jul 29, 2007
- Messages
- 134
- Reaction score
- 301
Make the mention system not to affect the text wrapped with CODE / PHP tags.
Example:
Example:
PHP:
/**
* setOption
* depending on the setting's field type, it will add a single option or an array
* of options, validating each one before setting them
*
* [USER=1333357818]param[/USER] string $option
* [USER=1333357818]param[/USER] string $title
* [USER=2000032449]Throws[/USER] Exception
*/
public function setOption($option, $title="") {
if(array_key_exists($this->lastIndex(), $this->_addedSettings)) {
$fieldType = $this->getFieldType();
$fieldInfo = $this->getFieldInfo($fieldType);
$validation = $this->getValidation();
if(!$this->validateSetting($option, $validation)) throw new Exception("[S012] Option validation error");
if($fieldInfo['multiOpt']) {
if(!check($title)) $title = $option;
if(!$option) $option = 0;
$this->_addedSettings[$this->lastIndex()]['option'][] = array('option'=> $option, 'title' => $title);
} else {
$this->_addedSettings[$this->lastIndex()]['option'] = $option;
}
} else {
//throw new Exception();
}
}