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 cContentTypeHtml 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_HTML which lets the editor enter HTML with the help of a
 20:  * WYSIWYG editor.
 21:  *
 22:  * @package Core
 23:  * @subpackage ContentType
 24:  */
 25: class cContentTypeHtml extends cContentTypeAbstract {
 26: 
 27:     /**
 28:      * Initialises class attributes and handles store events.
 29:      *
 30:      * @param string $rawSettings the raw settings in an XML structure or as
 31:      *        plaintext
 32:      * @param int $id ID of the content type, e.g. 3 if CMS_DATE[3] is
 33:      *        used
 34:      * @param array $contentTypes array containing the values of all content
 35:      *        types
 36:      */
 37:     public function __construct($rawSettings, $id, array $contentTypes) {
 38:         // change attributes from the parent class and call the parent
 39:         // constructor
 40:         parent::__construct($rawSettings, $id, $contentTypes);
 41:         $this->_type = 'CMS_HTML';
 42:         $this->_prefix = 'html';
 43:     }
 44: 
 45:     /**
 46:      * Generates the code which should be shown if this content type is shown in
 47:      * the frontend.
 48:      *
 49:      * @return string escaped HTML code which sould be shown if content type is
 50:      *         shown in frontend
 51:      */
 52:     public function generateViewCode() {
 53:         return $this->_encodeForOutput($this->_rawSettings);
 54:     }
 55: 
 56:     /**
 57:      * Generates the code which should be shown if this content type is edited.
 58:      *
 59:      * @return string escaped HTML code which should be shown if content type is
 60:      *         edited
 61:      */
 62:     public function generateEditCode() {
 63:         $wysiwygDiv = new cHTMLDiv();
 64: 
 65:         // generate the div ID - format: TYPEWITHOUTCMS_TYPEID_ID
 66:         // important because it is used to save the content accordingly
 67:         $id = str_replace('CMS_', '', $this->_type) . '_';
 68:         $db = cRegistry::getDb();
 69:         $sql = 'SELECT `idtype` FROM `' . $this->_cfg['tab']['type'] . '` WHERE `type`=\'' . $this->_type . '\'';
 70:         $db->query($sql);
 71:         $db->nextRecord();
 72:         $id .= $db->f('idtype') . '_' . $this->_id;
 73:         $wysiwygDiv->setId($id);
 74:         $wysiwygDiv->setClass(htmlentities($this->_type));
 75: 
 76:         $wysiwygDiv->setEvent('Focus', "this.style.border='1px solid #bb5577';");
 77:         $wysiwygDiv->setEvent('Blur', "this.style.border='1px dashed #bfbfbf';");
 78:         $wysiwygDiv->appendStyleDefinitions(array(
 79:             'border' => '1px dashed #bfbfbf',
 80:             'direction' => langGetTextDirection($this->_lang),
 81:             'min-height' => '20px'
 82:         ));
 83:         $wysiwygDiv->updateAttribute('contentEditable', 'true');
 84:         if (strlen($this->_rawSettings) == 0) {
 85:             $wysiwygDiv->setContent('&nbsp;');
 86:         } else {
 87:             $wysiwygDiv->setContent($this->_rawSettings);
 88:         }
 89: 
 90: 
 91:         // construct edit button
 92:         $editLink = $this->_session->url($this->_cfg['path']['contenido_fullhtml'] . 'external/backendedit/' . 'front_content.php?action=10&idcat=' . $this->_idCat . '&idart=' . $this->_idArt . '&idartlang=' . $this->_idArtLang . '&type=' . $this->_type . '&typenr=' . $this->_id. '&client=' . $this->_client);
 93:         $editAnchor = new cHTMLLink("javascript:Con.Tiny.setContent('" . $this->_idArtLang . "','" . $editLink . "');");
 94:         $editButton = new cHTMLImage($this->_cfg['path']['contenido_fullhtml'] . $this->_cfg['path']['images'] . 'but_edithtml.gif');
 95:         $editButton->appendStyleDefinition('margin-right', '2px');
 96:         $editButton->setClass('content_type_zindex');
 97:         $editAnchor->setContent($editButton);
 98: 
 99:         // construct save button
100:         $saveAnchor = new cHTMLLink();
101:         $saveAnchor->setLink("javascript:Con.Tiny.setContent('" . $this->_idArtLang . "', '0');");
102:         $saveButton = new cHTMLImage($this->_cfg['path']['contenido_fullhtml'] . $this->_cfg['path']['images'] . 'but_ok.gif');
103:         $saveAnchor->setContent($saveButton);
104: 
105:         return $this->_encodeForOutput($wysiwygDiv->render() . $editAnchor->render() . $saveAnchor->render());
106:     }
107: 
108:     /**
109:      * This content type and its derived types can be edited by a WYSIWYG editor
110:      * @return boolean
111:      */
112:     public function isWysiwygCompatible() {
113:         return true;
114:     }
115: 
116: }
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen