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 cHTMLForm 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:  * cHTMLForm class represents a form.
20:  *
21:  * @package Core
22:  * @subpackage GUI_HTML
23:  */
24: class cHTMLForm extends cHTMLContentElement {
25: 
26:     protected $_name;
27: 
28:     protected $_action;
29: 
30:     protected $_method;
31: 
32:     /**
33:      * Creates an HTML form element.
34:      *
35:      * @param string $name the name of the form
36:      * @param string $action the action which should be performed when this form
37:      *        is submitted
38:      * @param string $method the method to use - post or get
39:      * @param string $class the class of this element
40:      */
41:     public function __construct($name = '', $action = 'main.php', $method = 'post', $class = '') {
42:         parent::__construct('', $class);
43:         $this->_tag = 'form';
44:         $this->_name = $name;
45:         $this->_action = $action;
46:         $this->_method = $method;
47:     }
48: 
49:     /**
50:      * Sets the given var.
51:      *
52:      * @param string $var
53:      * @param string $value
54:      * @return cHTMLForm $this
55:      */
56:     public function setVar($var, $value) {
57:         $this->_vars[$var] = $value;
58: 
59:         return $this;
60:     }
61: 
62:     /**
63:      * Renders the form element
64:      *
65:      * @return string Rendered HTML
66:      */
67:     public function toHTML() {
68:         $out = '';
69:         if (is_array($this->_vars)) {
70:             foreach ($this->_vars as $var => $value) {
71:                 $f = new cHTMLHiddenField($var, $value);
72:                 $out .= $f->render();
73:             }
74:         }
75:         if ($this->getAttribute('name') == '') {
76:             $this->setAttribute('name', $this->_name);
77:         }
78:         if ($this->getAttribute('method') == '') {
79:             $this->setAttribute('method', $this->_method);
80:         }
81:         if ($this->getAttribute('action') == '') {
82:             $this->setAttribute('action', $this->_action);
83:         }
84: 
85:         $attributes = $this->getAttributes(true);
86: 
87:         return $this->fillSkeleton($attributes) . $out . $this->_content . $this->fillCloseSkeleton();
88:     }
89: 
90: }
91: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen