Source for file fielddate.php
Documentation is available at fielddate.php
* @package FrameworkOnFramework
* @copyright Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
// Protect from unauthorized access
* Generic field header, with text input (search) filter
* @package FrameworkOnFramework
* @return string The HTML
// Initialize some field attributes.
$format =
$this->element['format'] ? (string)
$this->element['format'] :
'%Y-%m-%d';
$attributes['size'] = (int)
$this->element['size'];
$attributes['maxlength'] = (int)
$this->element['maxlength'];
$attributes['class'] = (string)
$this->element['filterclass'];
if ((string)
$this->element['readonly'] ==
'true')
$attributes['readonly'] =
'readonly';
if ((string)
$this->element['disabled'] ==
'true')
$attributes['disabled'] =
'disabled';
$attributes['onchange'] = (string)
$this->element['onchange'];
$onchange =
'document.adminForm.submit()';
if ((string)
$this->element['placeholder'])
$attributes['placeholder'] =
JText::_((string)
$this->element['placeholder']);
$name =
$this->element['searchfieldname'] ?
$this->element['searchfieldname'] :
$this->name;
if ($this->element['searchfieldname'])
$model =
$this->form->getModel();
$searchvalue =
$model->getState((string)
$this->element['searchfieldname']);
$searchvalue =
$this->value;
// Get some system objects.
// If a known filter is given use it.
// Convert a date to UTC based on the server timezone.
// Get a date object based on the correct timezone.
$date->setTimezone(new DateTimeZone($config->get('offset')));
// Transform the date string.
$searchvalue =
$date->format('Y-m-d H:i:s', true, false);
// Convert a date to UTC based on the user timezone.
// Get a date object based on the correct timezone.
$date->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset'))));
// Transform the date string.
$searchvalue =
$date->format('Y-m-d H:i:s', true, false);
return JHtml::_('calendar', $searchvalue, $name, $name, $format, $attributes);
* Get the buttons HTML code
* @return string The HTML
Documentation generated on Tue, 19 Nov 2013 15:02:59 +0100 by phpDocumentor 1.4.3