PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/libraries/joomla/form/fields/hidden.php

https://gitlab.com/vitaliylukin91/alex-lavka
PHP | 48 lines | 14 code | 5 blank | 29 comment | 0 complexity | f0faba3fb05ab9e72effb467dc0b6001 MD5 | raw file
 1<?php
 2/**
 3 * @package     Joomla.Platform
 4 * @subpackage  Form
 5 *
 6 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 7 * @license     GNU General Public License version 2 or later; see LICENSE
 8 */
 9
10defined('JPATH_PLATFORM') or die;
11
12/**
13 * Form Field class for the Joomla Platform.
14 * Provides a hidden field
15 *
16 * @link   http://www.w3.org/TR/html-markup/input.hidden.html#input.hidden
17 * @since  11.1
18 */
19class JFormFieldHidden extends JFormField
20{
21	/**
22	 * The form field type.
23	 *
24	 * @var    string
25	 * @since  11.1
26	 */
27	protected $type = 'Hidden';
28
29	/**
30	 * Method to get the field input markup.
31	 *
32	 * @return  string  The field input markup.
33	 *
34	 * @since   11.1
35	 */
36	protected function getInput()
37	{
38		// Initialize some field attributes.
39		$class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
40		$disabled = $this->disabled ? ' disabled' : '';
41
42		// Initialize JavaScript field attributes.
43		$onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
44
45		return '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="'
46			. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $disabled . $onchange . ' />';
47	}
48}