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

Classes

  • cHTML
  • cHTMLAlignmentTable
  • cHTMLArticle
  • cHTMLAside
  • cHTMLAudio
  • cHTMLButton
  • cHTMLCanvas
  • cHTMLCheckbox
  • cHTMLContentElement
  • cHTMLDiv
  • cHTMLFieldset
  • cHTMLFooter
  • cHTMLForm
  • cHTMLFormElement
  • cHTMLHeader
  • cHTMLHgroup
  • cHTMLHiddenField
  • cHTMLIFrame
  • cHTMLImage
  • cHTMLLabel
  • cHTMLLegend
  • cHTMLLink
  • cHTMLList
  • cHTMLListItem
  • cHTMLNav
  • cHTMLOptgroup
  • cHTMLOptionElement
  • cHTMLParagraph
  • cHTMLPasswordbox
  • cHTMLRadiobutton
  • cHTMLScript
  • cHTMLSection
  • cHTMLSelectElement
  • cHTMLSpan
  • cHTMLTable
  • cHTMLTableBody
  • cHTMLTableData
  • cHTMLTableHead
  • cHTMLTableHeader
  • cHTMLTableRow
  • cHTMLTextarea
  • cHTMLTextbox
  • cHTMLTime
  • cHTMLUpload
  • cHTMLVideo
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the cHTMLUpload class.
  5:  *
  6:  * @package Core
  7:  * @subpackage GUI_HTML
  8:  * @version SVN Revision $Rev:$
  9:  *
 10:  * @author Simon Sprankel
 11:  * @copyright four for business AG <www.4fb.de>
 12:  * @license http://www.contenido.org/license/LIZENZ.txt
 13:  * @link http://www.4fb.de
 14:  * @link http://www.contenido.org
 15:  */
 16: 
 17: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 18: 
 19: /**
 20:  * cHTMLUpload class represents a file upload element.
 21:  *
 22:  * @package Core
 23:  * @subpackage GUI_HTML
 24:  */
 25: class cHTMLUpload extends cHTMLFormElement {
 26: 
 27:     /**
 28:      * Constructor.
 29:      * Creates an HTML upload box.
 30:      *
 31:      * If no additional parameters are specified, the
 32:      * default width is 20 units.
 33:      *
 34:      * @param string $name
 35:      *         Name of the element
 36:      * @param int $width [optional]
 37:      *         width of the text box
 38:      * @param int $maxlength [optional]
 39:      *         maximum input length of the box
 40:      * @param string $id [optional]
 41:      *         ID of the element
 42:      * @param string $disabled [optional]
 43:      *         Item disabled flag (non-empty to set disabled)
 44:      * @param string $tabindex [optional]
 45:      *         Tab index for form elements
 46:      * @param string $accesskey [optional]
 47:      *         Key to access the field
 48:      * @param string $class [optional]
 49:      *         the class of this element
 50:      */
 51:     public function __construct($name, $width = '', $maxlength = '', $id = '', $disabled = false, $tabindex = NULL, $accesskey = '', $class = '') {
 52:         parent::__construct($name, $id, $disabled, $tabindex, $accesskey);
 53:         $this->_tag = 'input';
 54:         $this->_contentlessTag = true;
 55: 
 56:         $this->setWidth($width);
 57:         $this->setMaxLength($maxlength);
 58: 
 59:         $this->updateAttribute('type', 'file');
 60:         $this->setClass($class);
 61:     }
 62: 
 63:     /**
 64:      * Sets the width of the text box.
 65:      *
 66:      * @param int $width
 67:      *         width of the text box
 68:      * @return cHTMLUpload
 69:      *         $this for chaining
 70:      */
 71:     public function setWidth($width) {
 72:         $width = intval($width);
 73: 
 74:         if ($width <= 0) {
 75:             $width = 20;
 76:         }
 77: 
 78:         return $this->updateAttribute('size', $width);
 79:     }
 80: 
 81:     /**
 82:      * Sets the maximum input length of the text box.
 83:      *
 84:      * @param int $maxlen
 85:      *         maximum input length
 86:      * @return cHTMLUpload
 87:      *         $this for chaining
 88:      */
 89:     public function setMaxLength($maxlen) {
 90:         $maxlen = intval($maxlen);
 91: 
 92:         if ($maxlen <= 0) {
 93:             return $this->removeAttribute('maxlength');
 94:         } else {
 95:             return $this->updateAttribute('maxlength', $maxlen);
 96:         }
 97:     }
 98: 
 99: }
100: 
CMS CONTENIDO 4.9.8 API documentation generated by ApiGen 2.8.0