<?php/********************************************************************************************
* BlueShoes Framework; This file is part of the php application framework.
* NOTE: This code is stripped (obfuscated). To get the clean documented code goto 
*       www.blueshoes.org and register for the free open source *DEVELOPER* version or 
*       buy the commercial version.
*       
*       In case you've already got the developer version, then this is one of the few 
*       packages/classes that is only available to *PAYING* customers.
*       To get it go to www.blueshoes.org and buy a commercial version.
* 
* @copyright www.blueshoes.org
* @author    Samuel Blume <sam at blueshoes dot org>
* @author    Andrej Arn <andrej at blueshoes dot org>
*/?><?php
define('BS_FORMFIELDDATEPICKER_VERSION',      '4.5.$Revision: 1.5 $');if (!@$APP) require_once($_SERVER['DOCUMENT_ROOT'] . $GLOBALS['APP']['path']['diffFromDocRootToGlobalConf'] . 'global.conf.php');class Bs_FormFieldDatePicker extends Bs_FormFieldText {var $openByInit;var $dateRangeLower;var $dateRangeUpper;var $monthLongEn;var $monthNumChars;var $daysEn;var $daysNumChars;var $dayHeaderFontColor;var $dayHeaderBgColor;var $dayFontColor;var $dayBgColor;var $dayFontColorActive;var $dayBgColorActive;var $dayTableBgColor;var $dayBgColorOver;var $dateInputClassName;var $monthSelectClassName;var $yearInputClassName;var $dayHeaderClassName;var $dayClassName;var $dayClassNameByWeekday;var $dayClassNameByDay;var $dayTableClassName;var $dayTableAttributeString;var $width;var $validateErrorMsgEn;var $validateErrorMsgDe;var $dateFormat;function Bs_FormFieldDatePicker() {$this->Bs_FormFieldText(); $this->caption    = 'Date';$this->bsDataType = 'date';$this->bsDataInfo = 2;$this->persister->setVarSettings(&$this->persisterVarSettings);}
function &getField($explodeKey=NULL, $addEnforceCheckbox=TRUE) {$ret = '';$fieldName = $this->_getFieldNameForHtml($this->name);$value = $this->getValue($explodeKey);switch ($this->getVisibility()) {case 'omit':
return $ret;break;case 'invisible':
$this->_markAsUsed();return $this->getFieldAsHidden();break;case 'read':
case 'readonly':
$this->_markAsUsed();$fieldName .= '_readonly';$ret .= $this->getFieldAsHidden();$ret .= $value;return $ret;break;case 'show':
$ret .= $value;return $ret;break;default: $this->_markAsUsed();}
$aolc  = ''; $this->_form->addIncludeOnce('/_bsJavascript/core/lang/Bs_Misc.lib.js');$this->_form->addIncludeOnce('/_bsJavascript/components/toolbar/Bs_Button.class.js');$this->_form->addIncludeOnce('/_bsJavascript/components/numberfield/Bs_NumberField.class.js');$this->_form->addIncludeOnce('/_bsJavascript/components/datepicker/Bs_DatePicker.class.js');$this->_form->addIncludeOnce('/_bsJavascript/core/form/Bs_FormFieldSelect.class.js');$this->_form->addIncludeOnce('/_bsJavascript/components/toolbar/win2k_ie.css');$jsVarName  = 'bsDp'    . $fieldName;$divVarName = 'bsDpDiv' . $fieldName;if (!is_null($explodeKey)) {$jsVarName  .= $explodeKey;$divVarName .= $explodeKey;}
$aolc .= "{$jsVarName} = new Bs_DatePicker('{$jsVarName}');\n";$aolc .= "{$jsVarName}.fieldName = '{$fieldName}';\n";if (!empty($value))                        $aolc .= "{$jsVarName}.setDateByIso('{$value}');\n";if (isSet($this->openByInit))              $aolc .= "{$jsVarName}.openByInit              = " . boolToString($this->openByInit) . ";\n";if (isSet($this->dateRangeLower))          $aolc .= "{$jsVarName}.dateRangeLower          = '{$this->dateRangeLower}';\n";if (isSet($this->dateRangeUpper))          $aolc .= "{$jsVarName}.dateRangeUpper          = '{$this->dateRangeUpper}';\n";if (isSet($this->monthLongEn)) {$aolc .= "{$jsVarName}.monthLongEn = new Array();\n";foreach($this->monthLongEn as $monthCaption) {$aolc .= "{$jsVarName}.monthLongEn[{$jsVarName}.monthLongEn.length] = '{$monthCaption}';\n";}
}
if (isSet($this->monthNumChars))           $aolc .= "{$jsVarName}.monthNumChars           = {$this->monthNumChars};\n";if (isSet($this->daysEn)) {$aolc .= "{$jsVarName}.daysEn = new Array();\n";foreach($this->daysEn as $dayCaption) {$aolc .= "{$jsVarName}.daysEn[{$jsVarName}.daysEn.length] = '{$dayCaption}';\n";}
}
if (isSet($this->daysNumChars))            $aolc .= "{$jsVarName}.daysNumChars            = {$this->daysNumChars};\n";if (isSet($this->dayHeaderFontColor))      $aolc .= "{$jsVarName}.dayHeaderFontColor      = '{$this->dayHeaderFontColor}';\n";if (isSet($this->dayHeaderBgColor))        $aolc .= "{$jsVarName}.dayHeaderBgColor        = '{$this->dayHeaderBgColor}';\n";if (isSet($this->dayFontColor))            $aolc .= "{$jsVarName}.dayFontColor            = '{$this->dayFontColor}';\n";if (isSet($this->dayBgColor))              $aolc .= "{$jsVarName}.dayBgColor              = '{$this->dayBgColor}';\n";if (isSet($this->dayFontColorActive))      $aolc .= "{$jsVarName}.dayFontColorActive      = '{$this->dayFontColorActive}';\n";if (isSet($this->dayBgColorActive))        $aolc .= "{$jsVarName}.dayBgColorActive        = '{$this->dayBgColorActive}';\n";if (isSet($this->dayTableBgColor))         $aolc .= "{$jsVarName}.dayTableBgColor         = '{$this->dayTableBgColor}';\n";if (isSet($this->dayBgColorOver))          $aolc .= "{$jsVarName}.dayBgColorOver          = '{$this->dayBgColorOver}';\n";if (isSet($this->dateInputClassName))      $aolc .= "{$jsVarName}.dateInputClassName      = '{$this->dateInputClassName}';\n";if (isSet($this->monthSelectClassName))    $aolc .= "{$jsVarName}.monthSelectClassName    = '{$this->monthSelectClassName}';\n";if (isSet($this->yearInputClassName))      $aolc .= "{$jsVarName}.yearInputClassName      = '{$this->yearInputClassName}';\n";if (isSet($this->dayHeaderClassName))      $aolc .= "{$jsVarName}.dayHeaderClassName      = '{$this->dayHeaderClassName}';\n";if (isSet($this->dayClassName))            $aolc .= "{$jsVarName}.dayClassName            = '{$this->dayClassName}';\n";if (isSet($this->dayTableClassName))       $aolc .= "{$jsVarName}.dayTableClassName       = '{$this->dayTableClassName}';\n";if (isSet($this->dayTableAttributeString)) $aolc .= "{$jsVarName}.dayTableAttributeString = '{$this->dayTableAttributeString}';\n";if (isSet($this->width))                   $aolc .= "{$jsVarName}.width                   = {$this->width};\n";if (isSet($this->validateErrorMsgEn))      $aolc .= "{$jsVarName}.validateErrorMsgEn      = '{$this->validateErrorMsgEn}';\n";if (isSet($this->validateErrorMsgDe))      $aolc .= "{$jsVarName}.validateErrorMsgDe      = '{$this->validateErrorMsgDe}';\n";if (isSet($this->dateFormat))              $aolc .= "{$jsVarName}.dateFormat              = '{$this->dateFormat}';\n";$aolc .= "{$jsVarName}.drawInto('{$divVarName}');\n";$this->_form->addOnLoadCode($aolc);$ret .= '<div id="' . $divVarName . '"></div>';if ($addEnforceCheckbox) $ret .= $this->addEnforceCheckbox();return $this->_doElementStringFormat($ret);}
}
?>