1: <?php
2:
3:
4: 5: 6: 7: 8:
9: class QDatepickerBox_BeforeShowEvent extends QJqUiPropertyEvent {
10: const EventName = 'QDatepickerBox_BeforeShow';
11: protected $strJqProperty = 'beforeShow';
12: }
13:
14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
25: class QDatepickerBox_BeforeShowDayEvent extends QJqUiPropertyEvent {
26: const EventName = 'QDatepickerBox_BeforeShowDay';
27: protected $strJqProperty = 'beforeShowDay';
28: }
29:
30: 31: 32: 33: 34:
35: class QDatepickerBox_CalculateWeekEvent extends QJqUiPropertyEvent {
36: const EventName = 'QDatepickerBox_CalculateWeek';
37: protected $strJqProperty = 'calculateWeek';
38: }
39:
40: 41: 42: 43: 44: 45:
46: class QDatepickerBox_ChangeMonthYearEvent extends QJqUiPropertyEvent {
47: const EventName = 'QDatepickerBox_ChangeMonthYear';
48: protected $strJqProperty = 'onChangeMonthYear';
49: }
50:
51: 52: 53: 54: 55: 56:
57: class QDatepickerBox_CloseEvent extends QJqUiPropertyEvent {
58: const EventName = 'QDatepickerBox_Close';
59: protected $strJqProperty = 'onClose';
60: }
61:
62: 63: 64: 65: 66:
67: class QDatepickerBox_SelectEvent extends QJqUiPropertyEvent {
68: const EventName = 'QDatepickerBox_Select';
69: protected $strJqProperty = 'onSelect';
70: }
71:
72:
73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370:
371:
372: class QDatepickerBoxGen extends QTextBox {
373: protected $strJavaScripts = __JQUERY_EFFECTS__;
374: protected $strStyleSheets = __JQUERY_CSS__;
375:
376: protected $mixAltField = null;
377:
378: protected $strAltFormat = null;
379:
380: protected $strAppendText = null;
381:
382: protected $blnAutoSize = null;
383:
384: protected $mixOnBeforeShow = null;
385:
386: protected $mixOnBeforeShowDay = null;
387:
388: protected $strButtonImage = null;
389:
390: protected $blnButtonImageOnly = null;
391:
392: protected $strButtonText = null;
393:
394: protected $mixOnCalculateWeek = null;
395:
396: protected $blnChangeMonth = null;
397:
398: protected $blnChangeYear = null;
399:
400: protected $strCloseText = null;
401:
402: protected $blnConstrainInput = null;
403:
404: protected $strCurrentText = null;
405:
406: protected $strJqDateFormat = null;
407:
408: protected $arrDayNames = null;
409:
410: protected $arrDayNamesMin = null;
411:
412: protected $arrDayNamesShort = null;
413:
414: protected $mixDefaultDate = null;
415:
416: protected $mixDuration = null;
417:
418: protected $intFirstDay;
419:
420: protected $blnGotoCurrent = null;
421:
422: protected $blnHideIfNoPrevNext = null;
423:
424: protected $blnIsRTL = null;
425:
426: protected $mixMaxDate = null;
427:
428: protected $mixMinDate = null;
429:
430: protected $arrMonthNames = null;
431:
432: protected $arrMonthNamesShort = null;
433:
434: protected $blnNavigationAsDateFormat = null;
435:
436: protected $strNextText = null;
437:
438: protected $mixNumberOfMonths = null;
439:
440: protected $mixOnChangeMonthYear = null;
441:
442: protected $mixOnClose = null;
443:
444: protected $mixOnSelect = null;
445:
446: protected $strPrevText = null;
447:
448: protected $blnSelectOtherMonths = null;
449:
450: protected $mixShortYearCutoff = null;
451:
452: protected $strShowAnim = null;
453:
454: protected $blnShowButtonPanel = null;
455:
456: protected $intShowCurrentAtPos;
457:
458: protected $blnShowMonthAfterYear = null;
459:
460: protected $strShowOn = null;
461:
462: protected $mixShowOptions = null;
463:
464: protected $blnShowOtherMonths = null;
465:
466: protected $blnShowWeek = null;
467:
468: protected $intStepMonths = null;
469:
470: protected $strWeekHeader = null;
471:
472: protected $strYearRange = null;
473:
474: protected $strYearSuffix = null;
475:
476: 477: 478: 479: 480:
481: protected function MakeJqOptions() {
482: $jqOptions = null;
483: if (!is_null($val = $this->AltField)) {$jqOptions['altField'] = $val;}
484: if (!is_null($val = $this->AltFormat)) {$jqOptions['altFormat'] = $val;}
485: if (!is_null($val = $this->AppendText)) {$jqOptions['appendText'] = $val;}
486: if (!is_null($val = $this->AutoSize)) {$jqOptions['autoSize'] = $val;}
487: if (!is_null($val = $this->OnBeforeShow)) {$jqOptions['beforeShow'] = $val;}
488: if (!is_null($val = $this->OnBeforeShowDay)) {$jqOptions['beforeShowDay'] = $val;}
489: if (!is_null($val = $this->ButtonImage)) {$jqOptions['buttonImage'] = $val;}
490: if (!is_null($val = $this->ButtonImageOnly)) {$jqOptions['buttonImageOnly'] = $val;}
491: if (!is_null($val = $this->ButtonText)) {$jqOptions['buttonText'] = $val;}
492: if (!is_null($val = $this->OnCalculateWeek)) {$jqOptions['calculateWeek'] = $val;}
493: if (!is_null($val = $this->ChangeMonth)) {$jqOptions['changeMonth'] = $val;}
494: if (!is_null($val = $this->ChangeYear)) {$jqOptions['changeYear'] = $val;}
495: if (!is_null($val = $this->CloseText)) {$jqOptions['closeText'] = $val;}
496: if (!is_null($val = $this->ConstrainInput)) {$jqOptions['constrainInput'] = $val;}
497: if (!is_null($val = $this->CurrentText)) {$jqOptions['currentText'] = $val;}
498: if (!is_null($val = $this->JqDateFormat)) {$jqOptions['dateFormat'] = $val;}
499: if (!is_null($val = $this->DayNames)) {$jqOptions['dayNames'] = $val;}
500: if (!is_null($val = $this->DayNamesMin)) {$jqOptions['dayNamesMin'] = $val;}
501: if (!is_null($val = $this->DayNamesShort)) {$jqOptions['dayNamesShort'] = $val;}
502: if (!is_null($val = $this->DefaultDate)) {$jqOptions['defaultDate'] = $val;}
503: if (!is_null($val = $this->Duration)) {$jqOptions['duration'] = $val;}
504: if (!is_null($val = $this->FirstDay)) {$jqOptions['firstDay'] = $val;}
505: if (!is_null($val = $this->GotoCurrent)) {$jqOptions['gotoCurrent'] = $val;}
506: if (!is_null($val = $this->HideIfNoPrevNext)) {$jqOptions['hideIfNoPrevNext'] = $val;}
507: if (!is_null($val = $this->IsRTL)) {$jqOptions['isRTL'] = $val;}
508: if (!is_null($val = $this->MaxDate)) {$jqOptions['maxDate'] = $val;}
509: if (!is_null($val = $this->MinDate)) {$jqOptions['minDate'] = $val;}
510: if (!is_null($val = $this->MonthNames)) {$jqOptions['monthNames'] = $val;}
511: if (!is_null($val = $this->MonthNamesShort)) {$jqOptions['monthNamesShort'] = $val;}
512: if (!is_null($val = $this->NavigationAsDateFormat)) {$jqOptions['navigationAsDateFormat'] = $val;}
513: if (!is_null($val = $this->NextText)) {$jqOptions['nextText'] = $val;}
514: if (!is_null($val = $this->NumberOfMonths)) {$jqOptions['numberOfMonths'] = $val;}
515: if (!is_null($val = $this->OnChangeMonthYear)) {$jqOptions['onChangeMonthYear'] = $val;}
516: if (!is_null($val = $this->OnClose)) {$jqOptions['onClose'] = $val;}
517: if (!is_null($val = $this->OnSelect)) {$jqOptions['onSelect'] = $val;}
518: if (!is_null($val = $this->PrevText)) {$jqOptions['prevText'] = $val;}
519: if (!is_null($val = $this->SelectOtherMonths)) {$jqOptions['selectOtherMonths'] = $val;}
520: if (!is_null($val = $this->ShortYearCutoff)) {$jqOptions['shortYearCutoff'] = $val;}
521: if (!is_null($val = $this->ShowAnim)) {$jqOptions['showAnim'] = $val;}
522: if (!is_null($val = $this->ShowButtonPanel)) {$jqOptions['showButtonPanel'] = $val;}
523: if (!is_null($val = $this->ShowCurrentAtPos)) {$jqOptions['showCurrentAtPos'] = $val;}
524: if (!is_null($val = $this->ShowMonthAfterYear)) {$jqOptions['showMonthAfterYear'] = $val;}
525: if (!is_null($val = $this->ShowOn)) {$jqOptions['showOn'] = $val;}
526: if (!is_null($val = $this->ShowOptions)) {$jqOptions['showOptions'] = $val;}
527: if (!is_null($val = $this->ShowOtherMonths)) {$jqOptions['showOtherMonths'] = $val;}
528: if (!is_null($val = $this->ShowWeek)) {$jqOptions['showWeek'] = $val;}
529: if (!is_null($val = $this->StepMonths)) {$jqOptions['stepMonths'] = $val;}
530: if (!is_null($val = $this->WeekHeader)) {$jqOptions['weekHeader'] = $val;}
531: if (!is_null($val = $this->YearRange)) {$jqOptions['yearRange'] = $val;}
532: if (!is_null($val = $this->YearSuffix)) {$jqOptions['yearSuffix'] = $val;}
533: return $jqOptions;
534: }
535:
536: 537: 538: 539: 540:
541: public function GetJqSetupFunction() {
542: return 'datepicker';
543: }
544:
545: 546: 547: 548: 549:
550: public function GetEndScript() {
551: $strId = $this->GetJqControlId();
552: $jqOptions = $this->makeJqOptions();
553: $strFunc = $this->getJqSetupFunction();
554:
555: if ($strId !== $this->ControlId && QApplication::$RequestMode == QRequestMode::Ajax) {
556:
557:
558: QApplication::ExecuteControlCommand($strId, 'off', QJsPriority::High);
559: }
560:
561:
562: if (empty($jqOptions)) {
563: QApplication::ExecuteControlCommand($strId, $strFunc, QJsPriority::High);
564: } else {
565: QApplication::ExecuteControlCommand($strId, $strFunc, $jqOptions, QJsPriority::High);
566: }
567:
568: return parent::GetEndScript();
569: }
570:
571: 572: 573: 574: 575: 576:
577: public function Destroy() {
578: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "destroy", QJsPriority::Low);
579: }
580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595:
596: public function Dialog($date, $onSelect = null, $options = null, $pos = null) {
597: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "dialog", $date, $onSelect, $options, $pos, QJsPriority::Low);
598: }
599: 600: 601: 602: 603: 604:
605: public function GetDate() {
606: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "getDate", QJsPriority::Low);
607: }
608: 609: 610: 611: 612:
613: public function Hide() {
614: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "hide", QJsPriority::Low);
615: }
616: 617: 618: 619: 620:
621: public function IsDisabled() {
622: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "isDisabled", QJsPriority::Low);
623: }
624: 625: 626: 627: 628: 629: 630: 631: 632: 633:
634: public function Option($optionName) {
635: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "option", $optionName, QJsPriority::Low);
636: }
637: 638: 639: 640: 641: 642:
643: public function Option1() {
644: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "option", QJsPriority::Low);
645: }
646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659:
660: public function Option2($optionName, $value) {
661: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "option", $optionName, $value, QJsPriority::Low);
662: }
663: 664: 665: 666: 667: 668:
669: public function Option3($options) {
670: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "option", $options, QJsPriority::Low);
671: }
672: 673: 674: 675: 676:
677: public function Refresh() {
678: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "refresh", QJsPriority::Low);
679: }
680: 681: 682: 683: 684: 685: 686: 687: 688: 689:
690: public function SetDate($date) {
691: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "setDate", $date, QJsPriority::Low);
692: }
693: 694: 695: 696: 697: 698:
699: public function Show() {
700: QApplication::ExecuteControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), "show", QJsPriority::Low);
701: }
702:
703:
704: public function __get($strName) {
705: switch ($strName) {
706: case 'AltField': return $this->mixAltField;
707: case 'AltFormat': return $this->strAltFormat;
708: case 'AppendText': return $this->strAppendText;
709: case 'AutoSize': return $this->blnAutoSize;
710: case 'OnBeforeShow': return $this->mixOnBeforeShow;
711: case 'OnBeforeShowDay': return $this->mixOnBeforeShowDay;
712: case 'ButtonImage': return $this->strButtonImage;
713: case 'ButtonImageOnly': return $this->blnButtonImageOnly;
714: case 'ButtonText': return $this->strButtonText;
715: case 'OnCalculateWeek': return $this->mixOnCalculateWeek;
716: case 'ChangeMonth': return $this->blnChangeMonth;
717: case 'ChangeYear': return $this->blnChangeYear;
718: case 'CloseText': return $this->strCloseText;
719: case 'ConstrainInput': return $this->blnConstrainInput;
720: case 'CurrentText': return $this->strCurrentText;
721: case 'JqDateFormat': return $this->strJqDateFormat;
722: case 'DayNames': return $this->arrDayNames;
723: case 'DayNamesMin': return $this->arrDayNamesMin;
724: case 'DayNamesShort': return $this->arrDayNamesShort;
725: case 'DefaultDate': return $this->mixDefaultDate;
726: case 'Duration': return $this->mixDuration;
727: case 'FirstDay': return $this->intFirstDay;
728: case 'GotoCurrent': return $this->blnGotoCurrent;
729: case 'HideIfNoPrevNext': return $this->blnHideIfNoPrevNext;
730: case 'IsRTL': return $this->blnIsRTL;
731: case 'MaxDate': return $this->mixMaxDate;
732: case 'MinDate': return $this->mixMinDate;
733: case 'MonthNames': return $this->arrMonthNames;
734: case 'MonthNamesShort': return $this->arrMonthNamesShort;
735: case 'NavigationAsDateFormat': return $this->blnNavigationAsDateFormat;
736: case 'NextText': return $this->strNextText;
737: case 'NumberOfMonths': return $this->mixNumberOfMonths;
738: case 'OnChangeMonthYear': return $this->mixOnChangeMonthYear;
739: case 'OnClose': return $this->mixOnClose;
740: case 'OnSelect': return $this->mixOnSelect;
741: case 'PrevText': return $this->strPrevText;
742: case 'SelectOtherMonths': return $this->blnSelectOtherMonths;
743: case 'ShortYearCutoff': return $this->mixShortYearCutoff;
744: case 'ShowAnim': return $this->strShowAnim;
745: case 'ShowButtonPanel': return $this->blnShowButtonPanel;
746: case 'ShowCurrentAtPos': return $this->intShowCurrentAtPos;
747: case 'ShowMonthAfterYear': return $this->blnShowMonthAfterYear;
748: case 'ShowOn': return $this->strShowOn;
749: case 'ShowOptions': return $this->mixShowOptions;
750: case 'ShowOtherMonths': return $this->blnShowOtherMonths;
751: case 'ShowWeek': return $this->blnShowWeek;
752: case 'StepMonths': return $this->intStepMonths;
753: case 'WeekHeader': return $this->strWeekHeader;
754: case 'YearRange': return $this->strYearRange;
755: case 'YearSuffix': return $this->strYearSuffix;
756: default:
757: try {
758: return parent::__get($strName);
759: } catch (QCallerException $objExc) {
760: $objExc->IncrementOffset();
761: throw $objExc;
762: }
763: }
764: }
765:
766: public function __set($strName, $mixValue) {
767: switch ($strName) {
768: case 'AltField':
769: $this->mixAltField = $mixValue;
770: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'altField', $mixValue);
771: break;
772:
773: case 'AltFormat':
774: try {
775: $this->strAltFormat = QType::Cast($mixValue, QType::String);
776: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'altFormat', $this->strAltFormat);
777: break;
778: } catch (QInvalidCastException $objExc) {
779: $objExc->IncrementOffset();
780: throw $objExc;
781: }
782:
783: case 'AppendText':
784: try {
785: $this->strAppendText = QType::Cast($mixValue, QType::String);
786: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'appendText', $this->strAppendText);
787: break;
788: } catch (QInvalidCastException $objExc) {
789: $objExc->IncrementOffset();
790: throw $objExc;
791: }
792:
793: case 'AutoSize':
794: try {
795: $this->blnAutoSize = QType::Cast($mixValue, QType::Boolean);
796: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'autoSize', $this->blnAutoSize);
797: break;
798: } catch (QInvalidCastException $objExc) {
799: $objExc->IncrementOffset();
800: throw $objExc;
801: }
802:
803: case 'OnBeforeShow':
804: try {
805: $this->mixOnBeforeShow = new QJsClosure($mixValue, array("input","inst"));
806: break;
807: } catch (QInvalidCastException $objExc) {
808: $objExc->IncrementOffset();
809: throw $objExc;
810: }
811:
812: case 'OnBeforeShowDay':
813: try {
814: $this->mixOnBeforeShowDay = new QJsClosure($mixValue, array("date"));
815: break;
816: } catch (QInvalidCastException $objExc) {
817: $objExc->IncrementOffset();
818: throw $objExc;
819: }
820:
821: case 'ButtonImage':
822: try {
823: $this->strButtonImage = QType::Cast($mixValue, QType::String);
824: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'buttonImage', $this->strButtonImage);
825: break;
826: } catch (QInvalidCastException $objExc) {
827: $objExc->IncrementOffset();
828: throw $objExc;
829: }
830:
831: case 'ButtonImageOnly':
832: try {
833: $this->blnButtonImageOnly = QType::Cast($mixValue, QType::Boolean);
834: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'buttonImageOnly', $this->blnButtonImageOnly);
835: break;
836: } catch (QInvalidCastException $objExc) {
837: $objExc->IncrementOffset();
838: throw $objExc;
839: }
840:
841: case 'ButtonText':
842: try {
843: $this->strButtonText = QType::Cast($mixValue, QType::String);
844: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'buttonText', $this->strButtonText);
845: break;
846: } catch (QInvalidCastException $objExc) {
847: $objExc->IncrementOffset();
848: throw $objExc;
849: }
850:
851: case 'OnCalculateWeek':
852: try {
853: $this->mixOnCalculateWeek = new QJsClosure($mixValue, array(""));
854: break;
855: } catch (QInvalidCastException $objExc) {
856: $objExc->IncrementOffset();
857: throw $objExc;
858: }
859:
860: case 'ChangeMonth':
861: try {
862: $this->blnChangeMonth = QType::Cast($mixValue, QType::Boolean);
863: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'changeMonth', $this->blnChangeMonth);
864: break;
865: } catch (QInvalidCastException $objExc) {
866: $objExc->IncrementOffset();
867: throw $objExc;
868: }
869:
870: case 'ChangeYear':
871: try {
872: $this->blnChangeYear = QType::Cast($mixValue, QType::Boolean);
873: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'changeYear', $this->blnChangeYear);
874: break;
875: } catch (QInvalidCastException $objExc) {
876: $objExc->IncrementOffset();
877: throw $objExc;
878: }
879:
880: case 'CloseText':
881: try {
882: $this->strCloseText = QType::Cast($mixValue, QType::String);
883: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'closeText', $this->strCloseText);
884: break;
885: } catch (QInvalidCastException $objExc) {
886: $objExc->IncrementOffset();
887: throw $objExc;
888: }
889:
890: case 'ConstrainInput':
891: try {
892: $this->blnConstrainInput = QType::Cast($mixValue, QType::Boolean);
893: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'constrainInput', $this->blnConstrainInput);
894: break;
895: } catch (QInvalidCastException $objExc) {
896: $objExc->IncrementOffset();
897: throw $objExc;
898: }
899:
900: case 'CurrentText':
901: try {
902: $this->strCurrentText = QType::Cast($mixValue, QType::String);
903: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'currentText', $this->strCurrentText);
904: break;
905: } catch (QInvalidCastException $objExc) {
906: $objExc->IncrementOffset();
907: throw $objExc;
908: }
909:
910: case 'JqDateFormat':
911: try {
912: $this->strJqDateFormat = QType::Cast($mixValue, QType::String);
913: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'dateFormat', $this->strJqDateFormat);
914: break;
915: } catch (QInvalidCastException $objExc) {
916: $objExc->IncrementOffset();
917: throw $objExc;
918: }
919:
920: case 'DayNames':
921: try {
922: $this->arrDayNames = QType::Cast($mixValue, QType::ArrayType);
923: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'dayNames', $this->arrDayNames);
924: break;
925: } catch (QInvalidCastException $objExc) {
926: $objExc->IncrementOffset();
927: throw $objExc;
928: }
929:
930: case 'DayNamesMin':
931: try {
932: $this->arrDayNamesMin = QType::Cast($mixValue, QType::ArrayType);
933: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'dayNamesMin', $this->arrDayNamesMin);
934: break;
935: } catch (QInvalidCastException $objExc) {
936: $objExc->IncrementOffset();
937: throw $objExc;
938: }
939:
940: case 'DayNamesShort':
941: try {
942: $this->arrDayNamesShort = QType::Cast($mixValue, QType::ArrayType);
943: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'dayNamesShort', $this->arrDayNamesShort);
944: break;
945: } catch (QInvalidCastException $objExc) {
946: $objExc->IncrementOffset();
947: throw $objExc;
948: }
949:
950: case 'DefaultDate':
951: $this->mixDefaultDate = $mixValue;
952: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'defaultDate', $mixValue);
953: break;
954:
955: case 'Duration':
956: try {
957: $this->mixDuration = QType::Cast($mixValue, 'QJsClosure');
958: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'duration', $this->mixDuration);
959: break;
960: } catch (QInvalidCastException $objExc) {
961: $objExc->IncrementOffset();
962: throw $objExc;
963: }
964:
965: case 'FirstDay':
966: try {
967: $this->intFirstDay = QType::Cast($mixValue, QType::Integer);
968: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'firstDay', $this->intFirstDay);
969: break;
970: } catch (QInvalidCastException $objExc) {
971: $objExc->IncrementOffset();
972: throw $objExc;
973: }
974:
975: case 'GotoCurrent':
976: try {
977: $this->blnGotoCurrent = QType::Cast($mixValue, QType::Boolean);
978: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'gotoCurrent', $this->blnGotoCurrent);
979: break;
980: } catch (QInvalidCastException $objExc) {
981: $objExc->IncrementOffset();
982: throw $objExc;
983: }
984:
985: case 'HideIfNoPrevNext':
986: try {
987: $this->blnHideIfNoPrevNext = QType::Cast($mixValue, QType::Boolean);
988: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'hideIfNoPrevNext', $this->blnHideIfNoPrevNext);
989: break;
990: } catch (QInvalidCastException $objExc) {
991: $objExc->IncrementOffset();
992: throw $objExc;
993: }
994:
995: case 'IsRTL':
996: try {
997: $this->blnIsRTL = QType::Cast($mixValue, QType::Boolean);
998: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'isRTL', $this->blnIsRTL);
999: break;
1000: } catch (QInvalidCastException $objExc) {
1001: $objExc->IncrementOffset();
1002: throw $objExc;
1003: }
1004:
1005: case 'MaxDate':
1006: $this->mixMaxDate = $mixValue;
1007: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'maxDate', $mixValue);
1008: break;
1009:
1010: case 'MinDate':
1011: $this->mixMinDate = $mixValue;
1012: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'minDate', $mixValue);
1013: break;
1014:
1015: case 'MonthNames':
1016: try {
1017: $this->arrMonthNames = QType::Cast($mixValue, QType::ArrayType);
1018: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'monthNames', $this->arrMonthNames);
1019: break;
1020: } catch (QInvalidCastException $objExc) {
1021: $objExc->IncrementOffset();
1022: throw $objExc;
1023: }
1024:
1025: case 'MonthNamesShort':
1026: try {
1027: $this->arrMonthNamesShort = QType::Cast($mixValue, QType::ArrayType);
1028: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'monthNamesShort', $this->arrMonthNamesShort);
1029: break;
1030: } catch (QInvalidCastException $objExc) {
1031: $objExc->IncrementOffset();
1032: throw $objExc;
1033: }
1034:
1035: case 'NavigationAsDateFormat':
1036: try {
1037: $this->blnNavigationAsDateFormat = QType::Cast($mixValue, QType::Boolean);
1038: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'navigationAsDateFormat', $this->blnNavigationAsDateFormat);
1039: break;
1040: } catch (QInvalidCastException $objExc) {
1041: $objExc->IncrementOffset();
1042: throw $objExc;
1043: }
1044:
1045: case 'NextText':
1046: try {
1047: $this->strNextText = QType::Cast($mixValue, QType::String);
1048: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'nextText', $this->strNextText);
1049: break;
1050: } catch (QInvalidCastException $objExc) {
1051: $objExc->IncrementOffset();
1052: throw $objExc;
1053: }
1054:
1055: case 'NumberOfMonths':
1056: $this->mixNumberOfMonths = $mixValue;
1057: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'numberOfMonths', $mixValue);
1058: break;
1059:
1060: case 'OnChangeMonthYear':
1061: try {
1062: $this->mixOnChangeMonthYear = new QJsClosure($mixValue, array("year","month","inst"));
1063: break;
1064: } catch (QInvalidCastException $objExc) {
1065: $objExc->IncrementOffset();
1066: throw $objExc;
1067: }
1068:
1069: case 'OnClose':
1070: try {
1071: $this->mixOnClose = new QJsClosure($mixValue, array("dateText","inst"));
1072: break;
1073: } catch (QInvalidCastException $objExc) {
1074: $objExc->IncrementOffset();
1075: throw $objExc;
1076: }
1077:
1078: case 'OnSelect':
1079: try {
1080: $this->mixOnSelect = new QJsClosure($mixValue, array("dateText","inst"));
1081: break;
1082: } catch (QInvalidCastException $objExc) {
1083: $objExc->IncrementOffset();
1084: throw $objExc;
1085: }
1086:
1087: case 'PrevText':
1088: try {
1089: $this->strPrevText = QType::Cast($mixValue, QType::String);
1090: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'prevText', $this->strPrevText);
1091: break;
1092: } catch (QInvalidCastException $objExc) {
1093: $objExc->IncrementOffset();
1094: throw $objExc;
1095: }
1096:
1097: case 'SelectOtherMonths':
1098: try {
1099: $this->blnSelectOtherMonths = QType::Cast($mixValue, QType::Boolean);
1100: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'selectOtherMonths', $this->blnSelectOtherMonths);
1101: break;
1102: } catch (QInvalidCastException $objExc) {
1103: $objExc->IncrementOffset();
1104: throw $objExc;
1105: }
1106:
1107: case 'ShortYearCutoff':
1108: $this->mixShortYearCutoff = $mixValue;
1109: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'shortYearCutoff', $mixValue);
1110: break;
1111:
1112: case 'ShowAnim':
1113: try {
1114: $this->strShowAnim = QType::Cast($mixValue, QType::String);
1115: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'showAnim', $this->strShowAnim);
1116: break;
1117: } catch (QInvalidCastException $objExc) {
1118: $objExc->IncrementOffset();
1119: throw $objExc;
1120: }
1121:
1122: case 'ShowButtonPanel':
1123: try {
1124: $this->blnShowButtonPanel = QType::Cast($mixValue, QType::Boolean);
1125: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'showButtonPanel', $this->blnShowButtonPanel);
1126: break;
1127: } catch (QInvalidCastException $objExc) {
1128: $objExc->IncrementOffset();
1129: throw $objExc;
1130: }
1131:
1132: case 'ShowCurrentAtPos':
1133: try {
1134: $this->intShowCurrentAtPos = QType::Cast($mixValue, QType::Integer);
1135: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'showCurrentAtPos', $this->intShowCurrentAtPos);
1136: break;
1137: } catch (QInvalidCastException $objExc) {
1138: $objExc->IncrementOffset();
1139: throw $objExc;
1140: }
1141:
1142: case 'ShowMonthAfterYear':
1143: try {
1144: $this->blnShowMonthAfterYear = QType::Cast($mixValue, QType::Boolean);
1145: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'showMonthAfterYear', $this->blnShowMonthAfterYear);
1146: break;
1147: } catch (QInvalidCastException $objExc) {
1148: $objExc->IncrementOffset();
1149: throw $objExc;
1150: }
1151:
1152: case 'ShowOn':
1153: try {
1154: $this->strShowOn = QType::Cast($mixValue, QType::String);
1155: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'showOn', $this->strShowOn);
1156: break;
1157: } catch (QInvalidCastException $objExc) {
1158: $objExc->IncrementOffset();
1159: throw $objExc;
1160: }
1161:
1162: case 'ShowOptions':
1163: $this->mixShowOptions = $mixValue;
1164: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'showOptions', $mixValue);
1165: break;
1166:
1167: case 'ShowOtherMonths':
1168: try {
1169: $this->blnShowOtherMonths = QType::Cast($mixValue, QType::Boolean);
1170: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'showOtherMonths', $this->blnShowOtherMonths);
1171: break;
1172: } catch (QInvalidCastException $objExc) {
1173: $objExc->IncrementOffset();
1174: throw $objExc;
1175: }
1176:
1177: case 'ShowWeek':
1178: try {
1179: $this->blnShowWeek = QType::Cast($mixValue, QType::Boolean);
1180: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'showWeek', $this->blnShowWeek);
1181: break;
1182: } catch (QInvalidCastException $objExc) {
1183: $objExc->IncrementOffset();
1184: throw $objExc;
1185: }
1186:
1187: case 'StepMonths':
1188: try {
1189: $this->intStepMonths = QType::Cast($mixValue, QType::Integer);
1190: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'stepMonths', $this->intStepMonths);
1191: break;
1192: } catch (QInvalidCastException $objExc) {
1193: $objExc->IncrementOffset();
1194: throw $objExc;
1195: }
1196:
1197: case 'WeekHeader':
1198: try {
1199: $this->strWeekHeader = QType::Cast($mixValue, QType::String);
1200: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'weekHeader', $this->strWeekHeader);
1201: break;
1202: } catch (QInvalidCastException $objExc) {
1203: $objExc->IncrementOffset();
1204: throw $objExc;
1205: }
1206:
1207: case 'YearRange':
1208: try {
1209: $this->strYearRange = QType::Cast($mixValue, QType::String);
1210: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'yearRange', $this->strYearRange);
1211: break;
1212: } catch (QInvalidCastException $objExc) {
1213: $objExc->IncrementOffset();
1214: throw $objExc;
1215: }
1216:
1217: case 'YearSuffix':
1218: try {
1219: $this->strYearSuffix = QType::Cast($mixValue, QType::String);
1220: $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'yearSuffix', $this->strYearSuffix);
1221: break;
1222: } catch (QInvalidCastException $objExc) {
1223: $objExc->IncrementOffset();
1224: throw $objExc;
1225: }
1226:
1227:
1228: default:
1229: try {
1230: parent::__set($strName, $mixValue);
1231: break;
1232: } catch (QCallerException $objExc) {
1233: $objExc->IncrementOffset();
1234: throw $objExc;
1235: }
1236: }
1237: }
1238:
1239: 1240: 1241: 1242: 1243:
1244: public static function GetModelConnectorParams() {
1245: return array_merge(parent::GetModelConnectorParams(), array(
1246: new QModelConnectorParam (get_called_class(), 'AltFormat', 'The dateFormat to be used for the altField option. This allows onedate format to be shown to the user for selection purposes, while adifferent format is actually sent behind the scenes. For a full listof the possible formats see the formatDate function', QType::String),
1247: new QModelConnectorParam (get_called_class(), 'AppendText', 'The text to display after each date field, e.g., to show the requiredformat.', QType::String),
1248: new QModelConnectorParam (get_called_class(), 'AutoSize', 'Set to true to automatically resize the input field to accommodatedates in the current dateFormat.', QType::Boolean),
1249: new QModelConnectorParam (get_called_class(), 'OnBeforeShow', 'Type:Function( Element input, Object inst )Default:nullA function thattakes an input field and current datepicker instance and returns anoptions object to update the datepicker with. It is called just beforethe datepicker is displayed.', 'QJsClosure'),
1250: new QModelConnectorParam (get_called_class(), 'OnBeforeShowDay', 'Type:Function( Date date )Default:nullA function that takes a date asa parameter and must return an array with: * [0]: true/false indicating whether or not this date is selectable * [1]: a CSS class name to add to the dates cell or \"\" for thedefault presentation * [2]: an optional popup tooltip for this date The function is called for each day in the datepicker before it isdisplayed.', 'QJsClosure'),
1251: new QModelConnectorParam (get_called_class(), 'ButtonImage', 'A URL of an image to use to display the datepicker when the showOnoption is set to \"button\" or \"both\". If set, the buttonText optionbecomes the alt value and is not directly displayed.', QType::String),
1252: new QModelConnectorParam (get_called_class(), 'ButtonImageOnly', 'Whether the button image should be rendered by itself instead ofinside a button element. This option is only relevant if thebuttonImage option has also been set.', QType::Boolean),
1253: new QModelConnectorParam (get_called_class(), 'ButtonText', 'The text to display on the trigger button. Use in conjunction with theshowOn option set to \"button\" or \"both\".', QType::String),
1254: new QModelConnectorParam (get_called_class(), 'OnCalculateWeek', 'Type:Function()Default:jQuery.datepicker.iso8601WeekA function tocalculate the week of the year for a given date. The defaultimplementation uses the ISO 8601 definition: weeks start on a Monday;the first week of the year contains the first Thursday of the year.', 'QJsClosure'),
1255: new QModelConnectorParam (get_called_class(), 'ChangeMonth', 'Whether the month should be rendered as a dropdown instead of text.', QType::Boolean),
1256: new QModelConnectorParam (get_called_class(), 'ChangeYear', 'Whether the year should be rendered as a dropdown instead of text. Usethe yearRange option to control which years are made available forselection.', QType::Boolean),
1257: new QModelConnectorParam (get_called_class(), 'CloseText', 'The text to display for the close link. Use the showButtonPanel optionto display this button.', QType::String),
1258: new QModelConnectorParam (get_called_class(), 'ConstrainInput', 'When true, entry in the input field is constrained to those charactersallowed by the current dateFormat option.', QType::Boolean),
1259: new QModelConnectorParam (get_called_class(), 'CurrentText', 'The text to display for the current day link. Use the showButtonPaneloption to display this button.', QType::String),
1260: new QModelConnectorParam (get_called_class(), 'JqDateFormat', 'The format for parsed and displayed dates. For a full list of thepossible formats see the formatDate function.', QType::String),
1261: new QModelConnectorParam (get_called_class(), 'DayNames', 'The list of long day names, starting from Sunday, for use as requestedvia the dateFormat option.', QType::ArrayType),
1262: new QModelConnectorParam (get_called_class(), 'DayNamesMin', 'The list of minimised day names, starting from Sunday, for use ascolumn headers within the datepicker.', QType::ArrayType),
1263: new QModelConnectorParam (get_called_class(), 'DayNamesShort', 'The list of abbreviated day names, starting from Sunday, for use asrequested via the dateFormat option.', QType::ArrayType),
1264: new QModelConnectorParam (get_called_class(), 'Duration', 'Control the speed at which the datepicker appears, it may be a time inmilliseconds or a string representing one of the three predefinedspeeds (\"slow\", \"normal\", \"fast\").', 'QJsClosure'),
1265: new QModelConnectorParam (get_called_class(), 'FirstDay', 'Set the first day of the week: Sunday is 0, Monday is 1, etc.', QType::Integer),
1266: new QModelConnectorParam (get_called_class(), 'GotoCurrent', 'When true, the current day link moves to the currently selected dateinstead of today.', QType::Boolean),
1267: new QModelConnectorParam (get_called_class(), 'HideIfNoPrevNext', 'Normally the previous and next links are disabled when not applicable(see the minDate and maxDate options). You can hide them altogether bysetting this attribute to true.', QType::Boolean),
1268: new QModelConnectorParam (get_called_class(), 'IsRTL', 'Whether the current language is drawn from right to left.', QType::Boolean),
1269: new QModelConnectorParam (get_called_class(), 'MonthNames', 'The list of full month names, for use as requested via the dateFormatoption.', QType::ArrayType),
1270: new QModelConnectorParam (get_called_class(), 'MonthNamesShort', 'The list of abbreviated month names, as used in the month header oneach datepicker and as requested via the dateFormat option.', QType::ArrayType),
1271: new QModelConnectorParam (get_called_class(), 'NavigationAsDateFormat', 'Whether the currentText, prevText and nextText options should beparsed as dates by the formatDate function, allowing them to displaythe target month names for example.', QType::Boolean),
1272: new QModelConnectorParam (get_called_class(), 'NextText', 'The text to display for the next month link. With the standardThemeRoller styling, this value is replaced by an icon.', QType::String),
1273: new QModelConnectorParam (get_called_class(), 'OnChangeMonthYear', 'Type:Function( Integer year, Integer month, Object inst)Default:nullCalled when the datepicker moves to a new month and/oryear. The function receives the selected year, month (1-12), and thedatepicker instance as parameters. this refers to the associated inputfield.', 'QJsClosure'),
1274: new QModelConnectorParam (get_called_class(), 'OnClose', 'Type:Function( String dateText, Object inst )Default:nullCalled whenthe datepicker is closed, whether or not a date is selected. Thefunction receives the selected date as text (\"\" if none) and thedatepicker instance as parameters. this refers to the associated inputfield.', 'QJsClosure'),
1275: new QModelConnectorParam (get_called_class(), 'OnSelect', 'Type:Function( String dateText, Object inst )Default:nullCalled whenthe datepicker is selected. The function receives the selected date astext and the datepicker instance as parameters. this refers to theassociated input field.', 'QJsClosure'),
1276: new QModelConnectorParam (get_called_class(), 'PrevText', 'The text to display for the previous month link. With the standardThemeRoller styling, this value is replaced by an icon.', QType::String),
1277: new QModelConnectorParam (get_called_class(), 'SelectOtherMonths', 'Whether days in other months shown before or after the current monthare selectable. This only applies if the showOtherMonths option is setto true.', QType::Boolean),
1278: new QModelConnectorParam (get_called_class(), 'ShowAnim', 'The name of the animation used to show and hide the datepicker. Use\"show\" (the default), \"slideDown\", \"fadeIn\", any of the jQuery UIeffects. Set to an empty string to disable animation.', QType::String),
1279: new QModelConnectorParam (get_called_class(), 'ShowButtonPanel', 'Whether to display a button pane underneath the calendar. The buttonpane contains two buttons, a Today button that links to the currentday, and a Done button that closes the datepicker. The buttons textcan be customized using the currentText and closeText optionsrespectively.', QType::Boolean),
1280: new QModelConnectorParam (get_called_class(), 'ShowCurrentAtPos', 'When displaying multiple months via the numberOfMonths option, theshowCurrentAtPos option defines which position to display the currentmonth in.', QType::Integer),
1281: new QModelConnectorParam (get_called_class(), 'ShowMonthAfterYear', 'Whether to show the month after the year in the header.', QType::Boolean),
1282: new QModelConnectorParam (get_called_class(), 'ShowOn', 'When the datepicker should appear. The datepicker can appear when thefield receives focus (\"focus\"), when a button is clicked (\"button\"),or when either event occurs (\"both\").', QType::String),
1283: new QModelConnectorParam (get_called_class(), 'ShowOtherMonths', 'Whether to display dates in other months (non-selectable) at the startor end of the current month. To make these days selectable use theselectOtherMonths option.', QType::Boolean),
1284: new QModelConnectorParam (get_called_class(), 'ShowWeek', 'When true, a column is added to show the week of the year. ThecalculateWeek option determines how the week of the year iscalculated. You may also want to change the firstDay option.', QType::Boolean),
1285: new QModelConnectorParam (get_called_class(), 'StepMonths', 'Set how many months to move when clicking the previous/next links.', QType::Integer),
1286: new QModelConnectorParam (get_called_class(), 'WeekHeader', 'The text to display for the week of the year column heading. Use theshowWeek option to display this column.', QType::String),
1287: new QModelConnectorParam (get_called_class(), 'YearRange', 'The range of years displayed in the year drop-down: either relative totodays year (\"-nn:+nn\"), relative to the currently selected year(\"c-nn:c+nn\"), absolute (\"nnnn:nnnn\"), or combinations of theseformats (\"nnnn:-nn\"). Note that this option only affects what appearsin the drop-down, to restrict which dates may be selected use theminDate and/or maxDate options.', QType::String),
1288: new QModelConnectorParam (get_called_class(), 'YearSuffix', 'Additional text to display after the year in the month headers.', QType::String),
1289: ));
1290: }
1291: }