Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
 1: <?php
 2: /**
 3:  * This file contains the cContentTypeHead class.
 4:  *
 5:  * @package Core
 6:  * @subpackage ContentType
 7:  * @version SVN Revision $Rev:$
 8:  *
 9:  * @author Simon Sprankel
10:  * @copyright four for business AG <www.4fb.de>
11:  * @license http://www.contenido.org/license/LIZENZ.txt
12:  * @link http://www.4fb.de
13:  * @link http://www.contenido.org
14:  */
15: 
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: /**
19:  * Content type CMS_HEAD which lets the editor enter a single-line text.
20:  *
21:  * @package Core
22:  * @subpackage ContentType
23:  */
24: class cContentTypeHead extends cContentTypeText {
25: 
26:     /**
27:      * Initialises class attributes and handles store events.
28:      *
29:      * @param string $rawSettings the raw settings in an XML structure or as
30:      *        plaintext
31:      * @param int $id ID of the content type, e.g. 3 if CMS_DATE[3] is
32:      *        used
33:      * @param array $contentTypes array containing the values of all content
34:      *        types
35:      */
36:     public function __construct($rawSettings, $id, array $contentTypes) {
37:         // change attributes from the parent class and call the parent
38:         // constructor
39:         parent::__construct($rawSettings, $id, $contentTypes);
40:         $this->_type = 'CMS_HEAD';
41:         $this->_prefix = 'head';
42: 
43:         // if form is submitted, store the current text
44:         // notice: also check the ID of the content type (there could be more
45:         // than one content type of the same type on the same page!)
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:             // make sure to escape variables before any output on page
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:      * Generates the JS code for this content type.
61:      *
62:      * @return string the JS code for the content type
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: }
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen