1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14:
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16:
17: 18: 19: 20: 21: 22:
23: class cContentTypeHead extends cContentTypeText {
24:
25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36:
37: public function __construct($rawSettings, $id, array $contentTypes) {
38:
39:
40:
41: if (false === get_parent_class($this) || false === get_parent_class(get_parent_class($this))) {
42:
43: parent::__construct($rawSettings, $id, $contentTypes);
44: }
45:
46:
47: $nameParentParentClass = get_parent_class(get_parent_class($this));
48: $nameParentParentClass::__construct($rawSettings, $id, $contentTypes);
49:
50:
51: $this->_type = 'CMS_HEAD';
52: $this->_prefix = 'head';
53:
54:
55:
56:
57: if (isset($_POST[$this->_prefix . '_action']) && $_POST[$this->_prefix . '_action'] === 'store' && isset($_POST[$this->_prefix . '_id']) && (int) $_POST[$this->_prefix . '_id'] == $this->_id) {
58: $this->_settings = $_POST[$this->_prefix . '_text_' . $this->_id];
59: $this->_rawSettings = $this->_settings;
60: $this->_storeSettings();
61:
62:
63: $this->_settings = stripslashes($this->_settings);
64: $this->_settings = conHtmlSpecialChars($this->_settings);
65: $this->_rawSettings = stripslashes($this->_rawSettings);
66: $this->_rawSettings = conHtmlSpecialChars($this->_rawSettings);
67: }
68: }
69:
70: 71: 72: 73: 74: 75:
76: protected function _getEditJavaScript() {
77: $textbox = new cHTMLTextbox($this->_prefix . '_text_' . $this->_id, '', '', '', $this->_prefix . '_text_' . $this->_id, false, NULL, '', 'edit-textfield edit-' . $this->_prefix . '-textfield');
78: $textbox->setClass("$this->_id");
79:
80: $saveButton = new cHTMLImage($this->_cfg['path']['contenido_fullhtml'] . 'images/but_ok.gif');
81: $saveButton->setID($this->_prefix . '_savebutton_' . $this->_id);
82: $saveButton->appendStyleDefinitions(array(
83: 'margin-left' => '5px',
84: 'cursor' => 'pointer'
85: ));
86:
87: $template = new cTemplate();
88: $template->set('s', 'PREFIX', $this->_prefix);
89: $template->set('s', 'ID', $this->_id);
90: $template->set('s', 'TEXTBOX', $textbox->render());
91: $template->set('s', 'SAVEBUTTON', $saveButton->render());
92: $template->set('s', 'IDARTLANG', $this->_idArtLang);
93:
94: return $template->generate($this->_cfg['path']['contenido'] . 'templates/standard/template.cms_text_js.html', true);
95: }
96:
97: }
98: