1: <?php
2:
3: /**
4: * This file contains the cContentTypeLinkdescr class.
5: *
6: * @package Core
7: * @subpackage ContentType
8: * @author Simon Sprankel
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_LINKDESCR which displays the link description.
19: *
20: * @package Core
21: * @subpackage ContentType
22: */
23: class cContentTypeLinkdescr extends cContentTypeLinkeditor {
24:
25: /**
26: * Initialises class attributes and handles store events.
27: *
28: * @param string $rawSettings
29: * the raw settings in an XML structure or as plaintext
30: * @param int $id
31: * ID of the content type, e.g. 3 if CMS_DATE[3] is used
32: * @param array $contentTypes
33: * array containing the values of all content types
34: */
35: public function __construct($rawSettings, $id, array $contentTypes) {
36:
37: // There are no raw settings here, because CMS_LINKEDITOR is now
38: // saved in con_upl_meta. So compute the appropriate raw settings
39: // and call the parent constructor with them.
40: if (!cXmlBase::isValidXML($rawSettings)) {
41: $rawSettings = $this->_getRawSettings("CMS_LINKEDITOR", $id, $contentTypes);
42: }
43:
44: // call parent constructor
45: parent::__construct($rawSettings, $id, $contentTypes);
46: }
47:
48: /**
49: * Generates the code which should be shown if this content type is shown in
50: * the frontend.
51: *
52: * @return string
53: * escaped HTML code which sould be shown if content type is shown in frontend
54: */
55: public function generateViewCode() {
56: return $this->_encodeForOutput($this->_settings['linkeditor_title']);
57: }
58:
59: /**
60: * Generates the code which should be shown if this content type is edited.
61: *
62: * @return string
63: * escaped HTML code which should be shown if content type is edited
64: */
65: public function generateEditCode() {
66: return $this->generateViewCode();
67: }
68:
69: }
70: