Source for file TimeTextInput.class.php
Documentation is available at TimeTextInput.class.php
* For including this file you have to define the constant "CLASSPATH".
* Because every include in the framework depends on the CLASSPATH definition.
* The CLASSPATH means the relative path to the folder that contains the
echo "<h3>You have to define the constant CLASSPATH!</h3>\n";
echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\n";
* Including language specific messages.
require_once CLASSPATH. "forms/items/TimeTextInput/". LANG. ".inc.php";
* Including language specific messages.
require_once CLASSPATH. "core/lang_spec_values/". LANG. ".inc.php";
echo "<h3>You have to define the constant LANG!</h3>\n";
echo "Example for german: define( 'LANG', 'de' );\n";
require_once CLASSPATH. "forms/items/HTMLTextInput.class.php";
include_once CLASSPATH. "core/DateFormatter.class.php";
include_once CLASSPATH. "core/DateFormatter.class.php";
* A class to generate text input fields to fill in Dates.
* @author Daniel Plücken <daniel@debakel.net>
* @license http://www.gnu.org/copyleft/lesser.html
* GNU Lesser General Public License
* @copyright Copyright (C) 2003 Daniel Plücken <daniel@debakel.net>
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
* The template for how to interpret the date.
* The standardvalue follows ISO 8601.
* - a - Lowercase Ante meridiem and Post meridiem - am or pm
* - A - Uppercase Ante meridiem and Post meridiem - AM or PM
* - B - Swatch Internet time - 000 through 999
* - g - 12-hour format of an hour without leading zeros - 1 through 12
* - G - 24-hour format of an hour without leading zeros - 0 through 23
* - h - 12-hour format of an hour with leading zeros - 01 through 12
* - H - 24-hour format of an hour with leading zeros - 00 through 23
* - i - Minutes with leading zeros - 00 to 59
* - s - Seconds, with leading zeros - 00 through 59
* @see http://www.php.net/manual/en/function.date.php (under Time)
* @var string $template_date_format
* Stores whether this object has been output already.
* @author Daniel Plücken <daniel@debakel.net>
* @param string $name The value of the "name"-attribute of the text
* @param string $value The value of the "value"-attribute of the text
* @param integer $size The value of the "size"-attribute of the text
$this->setOnBlur( "checkTextTime( this );" );
* Returns a javascript functions to validate the correctness of a time.
* @author Daniel Plücken <daniel@debakel.net>
<script language="javascript">
function checkTextTime( inputItem )
if ( inputItem.value == "" )
regExpress = /${ tmp_js_validate}/;
if ( !regExpress.test( inputItem.value ) )
alert( unescape( '${ tmp_js_msg_invalid}' ) );
* Returns the value of this item in ISO format.
* @author Daniel Plücken <daniel@debakel.net>
* @return string The value of this input in ISO format.
$str_template = "h:i:s a";
* Returns a generated string based on the attributes of this object.
* @author Daniel Plücken <daniel@debakel.net>
$str_template = "h:i:s a";
$tmp_arr[0], $tmp_arr[1], $tmp_arr[2],
1, 1, 1970 // <- is extraneous
} // End of class TimeTextInput
|