1: <?php
 2: 
 3: /**
 4:  * This file contains the cContentTypeRaw class.
 5:  *
 6:  * @package Core
 7:  * @subpackage ContentType
 8:  * @author Frederic Schneider
 9:  * @copyright four for business AG <www.4fb.de>
10:  * @license http://www.contenido.org/license/LIZENZ.txt
11:  * @link http://www.4fb.de
12:  * @link http://www.contenido.org
13:  */
14: 
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16: 
17: /**
18:  * Content type CMS_RAW which contains hidding texts
19:  *
20:  * @package Core
21:  * @subpackage ContentType
22:  */
23: class cContentTypeRaw extends cContentTypeAbstract {
24: 
25:     /**
26:      * Constructor to create an instance of this class.
27:      *
28:      * Initialises class attributes and handles store events.
29:      *
30:      * @param string $rawSettings
31:      *         the raw settings in an XML structure or as plaintext
32:      * @param int $id
33:      *         ID of the content type, e.g. 3 if CMS_RAW[3] is used
34:      * @param array $contentTypes
35:      *         array containing the values of all content types
36:      */
37:     public function __construct($rawSettings, $id, array $contentTypes) {
38: 
39:         // call parent constructor
40:         parent::__construct($rawSettings, $id, $contentTypes);
41: 
42:         // set props
43:         $this->_type = 'CMS_RAW';
44:         $this->_prefix = 'raw';
45: 
46:     }
47: 
48:     /**
49:      * @see cContentTypeAbstract::generateViewCode()
50:      * @return string
51:      *         encoded raw settings
52:      */
53:     public function generateViewCode() {
54:         return $this->_encodeForOutput($this->_rawSettings);
55:     }
56: 
57:     /**
58:      * @see cContentTypeAbstract::generateEditCode()
59:      * @return string
60:      *         encoded raw settings
61:      */
62:     public function generateEditCode() {
63:         return $this->_encodeForOutput($this->_rawSettings);
64:     }
65: 
66: }
67: