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 cHTMLTextbox 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:  * cHTMLTextbox class represents a textbox.
 20:  *
 21:  * @package Core
 22:  * @subpackage GUI_HTML
 23:  */
 24: class cHTMLTextbox extends cHTMLFormElement {
 25: 
 26:     /**
 27:      * Constructor.
 28:      * Creates an HTML text box.
 29:      *
 30:      * If no additional parameters are specified, the
 31:      * default width is 20 units.
 32:      *
 33:      * @param string $name Name of the element
 34:      * @param string $initvalue Initial value of the box
 35:      * @param int $width width of the text box
 36:      * @param int $maxlength maximum input length of the box
 37:      * @param string $id ID of the element
 38:      * @param string $disabled Item disabled flag (non-empty to set disabled)
 39:      * @param string $tabindex Tab index for form elements
 40:      * @param string $accesskey Key to access the field
 41:      * @param string $class the class of this element
 42:      */
 43:     public function __construct($name,
 44:                                 $initvalue = '',
 45:                                 $width = '',
 46:                                 $maxlength = '',
 47:                                 $id = '',
 48:                                 $disabled = false,
 49:                                 $tabindex = NULL,
 50:                                 $accesskey = '',
 51:                                 $class = ''
 52:     ) {
 53: 
 54:         parent::__construct($name, $id, $disabled, $tabindex, $accesskey);
 55: 
 56:         $this->_tag = 'input';
 57:         $this->_contentlessTag = true;
 58:         $this->setValue($initvalue);
 59: 
 60:         $this->setWidth($width);
 61:         $this->setMaxLength($maxlength);
 62: 
 63:         $this->updateAttribute('type', 'text');
 64:         $this->setClass($class);
 65:     }
 66: 
 67:     /**
 68:      * Sets the width of the text box.
 69:      *
 70:      * @param int $width width of the text box
 71:      * @return cHTMLTextbox $this
 72:      */
 73:     public function setWidth($width) {
 74:         $width = intval($width);
 75: 
 76:         if ($width <= 0) {
 77:             $width = 50;
 78:         }
 79: 
 80:         return $this->updateAttribute('size', $width);
 81:     }
 82: 
 83:     /**
 84:      * Sets the maximum input length of the text box.
 85:      *
 86:      * @param int $maxlen maximum input length
 87:      * @return cHTMLTextbox $this
 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:      * Sets the initial value of the text box.
101:      *
102:      * @param string $value Initial value
103:      * @return cHTMLTextbox $this
104:      */
105:     public function setValue($value) {
106:         return $this->updateAttribute('value', $value);
107:     }
108: 
109: }
110: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen