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 cHTMLImage class.
  4:  *
  5:  * @package Core
  6:  * @subpackage GUI_HTML
  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:  * cHTMLImage class represents an image.
 20:  *
 21:  * @package Core
 22:  * @subpackage GUI_HTML
 23:  */
 24: class cHTMLImage extends cHTML {
 25: 
 26:     /**
 27:      * Constructor.
 28:      * Creates an HTML IMG element.
 29:      *
 30:      * @param mixed $content String or object with the contents
 31:      * @param string $class the class of this element
 32:      */
 33:     public function __construct($src = NULL, $class = '') {
 34:         parent::__construct();
 35: 
 36:         $this->_tag = 'img';
 37:         $this->_contentlessTag = true;
 38: 
 39:         $this->setSrc($src);
 40:         $this->setClass($class);
 41:     }
 42: 
 43:     /**
 44:      * Sets the image's source file
 45:      *
 46:      * @param string $src source location
 47:      * @return cHTMLImage $this
 48:      */
 49:     public function setSrc($src) {
 50:         if ($src === NULL) {
 51:             $src = 'images/spacer.gif';
 52:         }
 53: 
 54:         return $this->updateAttribute('src', $src);
 55:     }
 56: 
 57:     /**
 58:      * Sets the image's width
 59:      *
 60:      * @param int $width Image width
 61:      * @return cHTMLImage $this
 62:      */
 63:     public function setWidth($width) {
 64:         return $this->updateAttribute('width', $width);
 65:     }
 66: 
 67:     /**
 68:      * Sets the image's height
 69:      *
 70:      * @param int $height Image height
 71:      * @return cHTMLImage $this
 72:      */
 73:     public function setHeight($height) {
 74:         return $this->updateAttribute('height', $height);
 75:     }
 76: 
 77:     /**
 78:      * Sets the border size
 79:      *
 80:      * @param int $border Border size
 81:      * @return cHTMLImage $this
 82:      */
 83:     public function setBorder($border) {
 84:         return $this->updateAttribute('border', $border);
 85:     }
 86: 
 87:     /**
 88:      * Apply dimensions from the source image
 89:      */
 90:     public function applyDimensions() {
 91:         // Try to open the image
 92:         list($width, $height) = @getimagesize(cRegistry::getBackendPath() . $this->getAttribute('src'));
 93: 
 94:         if (!empty($width) && !empty($height)) {
 95:             $this->setWidth($width);
 96:             $this->setHeight($height);
 97:         }
 98:     }
 99: 
100: }
101: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen