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