2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
2008-02-25 03:10:37 +01:00
|
|
|
/**
|
|
|
|
* Represents a short text field that is intended to contain HTML content.
|
|
|
|
*
|
|
|
|
* This behaves similarly to Varchar, but the template processor won't escape any HTML content within it.
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage model
|
2007-07-19 12:40:28 +02:00
|
|
|
*/
|
|
|
|
class HTMLVarchar extends Varchar {
|
2008-08-06 04:43:46 +02:00
|
|
|
|
2009-10-11 02:06:58 +02:00
|
|
|
public static $escape_type = 'xml';
|
|
|
|
|
|
|
|
public function forTemplate() {
|
2009-10-11 02:06:59 +02:00
|
|
|
return ShortcodeParser::get_active()->parse($this->value);
|
2009-10-11 02:06:58 +02:00
|
|
|
}
|
|
|
|
|
2012-04-11 04:48:06 +02:00
|
|
|
public function exists() {
|
|
|
|
return parent::exists() && $this->value != '<p></p>';
|
2009-10-11 02:06:58 +02:00
|
|
|
}
|
|
|
|
|
2008-10-14 00:20:41 +02:00
|
|
|
public function scaffoldFormField($title = null, $params = null) {
|
2008-10-19 02:18:55 +02:00
|
|
|
return new HtmlEditorField($this->name, $title, 1);
|
2008-08-06 04:43:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function scaffoldSearchField($title = null) {
|
|
|
|
return new TextField($this->name, $title);
|
|
|
|
}
|
2011-12-17 00:27:14 +01:00
|
|
|
|
|
|
|
}
|