2008-07-18 16:02:46 +02:00
|
|
|
<?php
|
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (C) 2007 Easter-eggs
|
|
|
|
* http://ldapsaisie.labs.libre-entreprise.org
|
|
|
|
*
|
|
|
|
* Author: See AUTHORS file in top-level directory.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Type d'attribut HTML date
|
|
|
|
*
|
|
|
|
* @author Benjamin Renard <brenard@easter-eggs.com>
|
|
|
|
*/
|
|
|
|
class LSattr_html_date extends LSattr_html {
|
|
|
|
|
2008-10-15 20:54:05 +02:00
|
|
|
var $LSformElement_type = 'date';
|
|
|
|
|
2008-07-18 16:02:46 +02:00
|
|
|
/**
|
|
|
|
* Ajoute l'attribut au formualaire passer en paramètre
|
|
|
|
*
|
|
|
|
* @param[in] &$form LSform Le formulaire
|
|
|
|
* @param[in] $idForm L'identifiant du formulaire
|
|
|
|
* @param[in] $data Valeur du champs du formulaire
|
|
|
|
*
|
|
|
|
* @retval LSformElement L'element du formulaire ajouté
|
|
|
|
*/
|
|
|
|
function addToForm (&$form,$idForm,$data=NULL) {
|
2008-10-15 20:54:05 +02:00
|
|
|
$element = parent::addToForm($form,$idForm,$data);
|
2017-10-12 14:49:24 +02:00
|
|
|
$form -> addRule($this -> name, 'date', array('msg' => _('Invalid value'), 'params' => array('format' => $element -> getFormat())) );
|
2008-07-18 16:02:46 +02:00
|
|
|
return $element;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2019-03-11 22:42:20 +01:00
|
|
|
|