@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * Script path relative to the TClientScriptManager::SCRIPT_PATH |
| 82 | 82 | */ |
| 83 | - const SCRIPT_PATH = 'prado/datepicker'; |
|
| 83 | + const SCRIPT_PATH='prado/datepicker'; |
|
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | 86 | * @var TDatePickerClientScript validator client-script options. |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function getDateFormat() |
| 102 | 102 | { |
| 103 | - return $this->getViewState('DateFormat','dd-MM-yyyy'); |
|
| 103 | + return $this->getViewState('DateFormat', 'dd-MM-yyyy'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function setDateFormat($value) |
| 111 | 111 | { |
| 112 | - $this->setViewState('DateFormat',$value,'dd-MM-yyyy'); |
|
| 112 | + $this->setViewState('DateFormat', $value, 'dd-MM-yyyy'); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function getShowCalendar() |
| 119 | 119 | { |
| 120 | - return $this->getViewState('ShowCalendar',true); |
|
| 120 | + return $this->getViewState('ShowCalendar', true); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function setShowCalendar($value) |
| 128 | 128 | { |
| 129 | - $this->setViewState('ShowCalendar',TPropertyValue::ensureBoolean($value),true); |
|
| 129 | + $this->setViewState('ShowCalendar', TPropertyValue::ensureBoolean($value), true); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | public function setFromYear($value) |
| 250 | 250 | { |
| 251 | - $this->setViewState('FromYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))-5); |
|
| 251 | + $this->setViewState('FromYear', TPropertyValue::ensureInteger($value), intval(@date('Y')) - 5); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function getFromYear() |
| 258 | 258 | { |
| 259 | - return $this->getViewState('FromYear', intval(@date('Y'))-5); |
|
| 259 | + return $this->getViewState('FromYear', intval(@date('Y')) - 5); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | */ |
| 265 | 265 | public function setUpToYear($value) |
| 266 | 266 | { |
| 267 | - $this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))+10); |
|
| 267 | + $this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y')) + 10); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public function getUpToYear() |
| 274 | 274 | { |
| 275 | - return $this->getViewState('UpToYear', intval(@date('Y'))+10); |
|
| 275 | + return $this->getViewState('UpToYear', intval(@date('Y')) + 10); |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /** |
@@ -312,8 +312,8 @@ discard block |
||
| 312 | 312 | $this->setText(''); |
| 313 | 313 | else |
| 314 | 314 | { |
| 315 | - $date = TPropertyValue::ensureFloat($value); |
|
| 316 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat()); |
|
| 315 | + $date=TPropertyValue::ensureFloat($value); |
|
| 316 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $this->getDateFormat()); |
|
| 317 | 317 | $this->setText($formatter->format($date)); |
| 318 | 318 | } |
| 319 | 319 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | public function getClientSide() |
| 374 | 374 | { |
| 375 | 375 | if($this->_clientScript===null) |
| 376 | - $this->_clientScript = $this->createClientScript(); |
|
| 376 | + $this->_clientScript=$this->createClientScript(); |
|
| 377 | 377 | return $this->_clientScript; |
| 378 | 378 | } |
| 379 | 379 | |
@@ -392,10 +392,10 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | public function getValidationPropertyValue() |
| 394 | 394 | { |
| 395 | - if(($text = $this->getText()) === '') |
|
| 395 | + if(($text=$this->getText())==='') |
|
| 396 | 396 | return ''; |
| 397 | - $date = $this->getTimeStamp(); |
|
| 398 | - return $date == null ? $text : $date; |
|
| 397 | + $date=$this->getTimeStamp(); |
|
| 398 | + return $date==null ? $text : $date; |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | /** |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | public function render($writer) |
| 418 | 418 | { |
| 419 | - if($this->getInputMode() == TDatePickerInputMode::TextBox) |
|
| 419 | + if($this->getInputMode()==TDatePickerInputMode::TextBox) |
|
| 420 | 420 | { |
| 421 | 421 | parent::render($writer); |
| 422 | 422 | $this->renderDatePickerButtons($writer); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | { |
| 440 | 440 | if($this->getShowCalendar()) |
| 441 | 441 | { |
| 442 | - switch ($this->getMode()) |
|
| 442 | + switch($this->getMode()) |
|
| 443 | 443 | { |
| 444 | 444 | case TDatePickerMode::Button: |
| 445 | 445 | $this->renderButtonDatePicker($writer); |
@@ -459,11 +459,11 @@ discard block |
||
| 459 | 459 | * @param array the input data collection |
| 460 | 460 | * @return boolean whether the data of the component has been changed |
| 461 | 461 | */ |
| 462 | - public function loadPostData($key,$values) |
|
| 462 | + public function loadPostData($key, $values) |
|
| 463 | 463 | { |
| 464 | - if($this->getInputMode() == TDatePickerInputMode::TextBox) |
|
| 464 | + if($this->getInputMode()==TDatePickerInputMode::TextBox) |
|
| 465 | 465 | return parent::loadPostData($key, $values); |
| 466 | - $value = $this->getDateFromPostData($key, $values); |
|
| 466 | + $value=$this->getDateFromPostData($key, $values); |
|
| 467 | 467 | if(!$this->getReadOnly() && $this->getText()!==$value) |
| 468 | 468 | { |
| 469 | 469 | $this->setText($value); |
@@ -481,34 +481,34 @@ discard block |
||
| 481 | 481 | */ |
| 482 | 482 | protected function getDateFromPostData($key, $values) |
| 483 | 483 | { |
| 484 | - $date = @getdate(); |
|
| 484 | + $date=@getdate(); |
|
| 485 | 485 | |
| 486 | - $pattern = $this->getDateFormat(); |
|
| 487 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
| 488 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 486 | + $pattern=$this->getDateFormat(); |
|
| 487 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
| 488 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 489 | 489 | |
| 490 | - $order = $formatter->getDayMonthYearOrdering(); |
|
| 490 | + $order=$formatter->getDayMonthYearOrdering(); |
|
| 491 | 491 | |
| 492 | 492 | if(isset($values[$key.'$day'])) { |
| 493 | - $day = intval($values[$key.'$day']); |
|
| 493 | + $day=intval($values[$key.'$day']); |
|
| 494 | 494 | } elseif(in_array('day', $order)) { |
| 495 | - $day = $date['mday']; |
|
| 495 | + $day=$date['mday']; |
|
| 496 | 496 | } else { |
| 497 | - $day = 1; |
|
| 497 | + $day=1; |
|
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | if(isset($values[$key.'$month'])) |
| 501 | - $month = intval($values[$key.'$month']) + 1; |
|
| 501 | + $month=intval($values[$key.'$month']) + 1; |
|
| 502 | 502 | else |
| 503 | - $month = $date['mon']; |
|
| 503 | + $month=$date['mon']; |
|
| 504 | 504 | |
| 505 | 505 | if(isset($values[$key.'$year'])) |
| 506 | - $year = intval($values[$key.'$year']); |
|
| 506 | + $year=intval($values[$key.'$year']); |
|
| 507 | 507 | else |
| 508 | - $year = $date['year']; |
|
| 508 | + $year=$date['year']; |
|
| 509 | 509 | |
| 510 | - $s = Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 511 | - $date = $s->getTimeStamp(0, 0, 0, $month, $day, $year); |
|
| 510 | + $s=Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 511 | + $date=$s->getTimeStamp(0, 0, 0, $month, $day, $year); |
|
| 512 | 512 | //$date = @mktime(0, 0, 0, $month, $day, $year); |
| 513 | 513 | |
| 514 | 514 | return $formatter->format($date); |
@@ -520,31 +520,31 @@ discard block |
||
| 520 | 520 | */ |
| 521 | 521 | protected function getDatePickerOptions() |
| 522 | 522 | { |
| 523 | - $options['ID'] = $this->getClientID(); |
|
| 524 | - $options['InputMode'] = $this->getInputMode(); |
|
| 525 | - $options['Format'] = $this->getDateFormat(); |
|
| 526 | - $options['FirstDayOfWeek'] = $this->getFirstDayOfWeek(); |
|
| 523 | + $options['ID']=$this->getClientID(); |
|
| 524 | + $options['InputMode']=$this->getInputMode(); |
|
| 525 | + $options['Format']=$this->getDateFormat(); |
|
| 526 | + $options['FirstDayOfWeek']=$this->getFirstDayOfWeek(); |
|
| 527 | 527 | if(($cssClass=$this->getCssClass())!=='') |
| 528 | - $options['ClassName'] = $cssClass; |
|
| 529 | - $options['CalendarStyle'] = $this->getCalendarStyle(); |
|
| 530 | - $options['FromYear'] = $this->getFromYear(); |
|
| 531 | - $options['UpToYear'] = $this->getUpToYear(); |
|
| 528 | + $options['ClassName']=$cssClass; |
|
| 529 | + $options['CalendarStyle']=$this->getCalendarStyle(); |
|
| 530 | + $options['FromYear']=$this->getFromYear(); |
|
| 531 | + $options['UpToYear']=$this->getUpToYear(); |
|
| 532 | 532 | switch($this->getMode()) |
| 533 | 533 | { |
| 534 | 534 | case TDatePickerMode::Basic: |
| 535 | 535 | break; |
| 536 | 536 | case TDatePickerMode::Clickable: |
| 537 | - $options['TriggerEvent'] = "click"; |
|
| 537 | + $options['TriggerEvent']="click"; |
|
| 538 | 538 | break; |
| 539 | 539 | default: |
| 540 | - $options['Trigger'] = $this->getDatePickerButtonID(); |
|
| 540 | + $options['Trigger']=$this->getDatePickerButtonID(); |
|
| 541 | 541 | break; |
| 542 | 542 | } |
| 543 | - $options['PositionMode'] = $this->getPositionMode(); |
|
| 543 | + $options['PositionMode']=$this->getPositionMode(); |
|
| 544 | 544 | |
| 545 | - $options = array_merge($options, $this->getCulturalOptions()); |
|
| 545 | + $options=array_merge($options, $this->getCulturalOptions()); |
|
| 546 | 546 | if($this->_clientScript!==null) |
| 547 | - $options = array_merge($options, |
|
| 547 | + $options=array_merge($options, |
|
| 548 | 548 | $this->_clientScript->getOptions()->toArray()); |
| 549 | 549 | return $options; |
| 550 | 550 | } |
@@ -555,13 +555,13 @@ discard block |
||
| 555 | 555 | */ |
| 556 | 556 | protected function getCulturalOptions() |
| 557 | 557 | { |
| 558 | - if($this->getCurrentCulture() == 'en') |
|
| 558 | + if($this->getCurrentCulture()=='en') |
|
| 559 | 559 | return array(); |
| 560 | 560 | |
| 561 | - $date = $this->getLocalizedCalendarInfo(); |
|
| 562 | - $options['MonthNames'] = $date->getMonthNames(); |
|
| 563 | - $options['AbbreviatedMonthNames'] = $date->getAbbreviatedMonthNames(); |
|
| 564 | - $options['ShortWeekDayNames'] = $date->getAbbreviatedDayNames(); |
|
| 561 | + $date=$this->getLocalizedCalendarInfo(); |
|
| 562 | + $options['MonthNames']=$date->getMonthNames(); |
|
| 563 | + $options['AbbreviatedMonthNames']=$date->getAbbreviatedMonthNames(); |
|
| 564 | + $options['ShortWeekDayNames']=$date->getAbbreviatedDayNames(); |
|
| 565 | 565 | |
| 566 | 566 | return $options; |
| 567 | 567 | } |
@@ -571,8 +571,8 @@ discard block |
||
| 571 | 571 | */ |
| 572 | 572 | protected function getCurrentCulture() |
| 573 | 573 | { |
| 574 | - $app = $this->getApplication()->getGlobalization(false); |
|
| 575 | - return $this->getCulture() == '' ? |
|
| 574 | + $app=$this->getApplication()->getGlobalization(false); |
|
| 575 | + return $this->getCulture()=='' ? |
|
| 576 | 576 | ($app ? $app->getCulture() : 'en') : $this->getCulture(); |
| 577 | 577 | } |
| 578 | 578 | |
@@ -582,9 +582,9 @@ discard block |
||
| 582 | 582 | protected function getLocalizedCalendarInfo() |
| 583 | 583 | { |
| 584 | 584 | //expensive operations |
| 585 | - $culture = $this->getCurrentCulture(); |
|
| 585 | + $culture=$this->getCurrentCulture(); |
|
| 586 | 586 | Prado::using('System.I18N.core.DateTimeFormatInfo'); |
| 587 | - $info = Prado::createComponent('System.I18N.core.CultureInfo', $culture); |
|
| 587 | + $info=Prado::createComponent('System.I18N.core.CultureInfo', $culture); |
|
| 588 | 588 | return $info->getDateTimeFormat(); |
| 589 | 589 | } |
| 590 | 590 | |
@@ -593,19 +593,19 @@ discard block |
||
| 593 | 593 | */ |
| 594 | 594 | protected function renderDropDownListCalendar($writer) |
| 595 | 595 | { |
| 596 | - if($this->getMode() == TDatePickerMode::Basic) |
|
| 596 | + if($this->getMode()==TDatePickerMode::Basic) |
|
| 597 | 597 | $this->setMode(TDatePickerMode::ImageButton); |
| 598 | 598 | parent::addAttributesToRender($writer); |
| 599 | 599 | $writer->removeAttribute('name'); |
| 600 | 600 | $writer->removeAttribute('type'); |
| 601 | 601 | $writer->addAttribute('id', $this->getClientID()); |
| 602 | 602 | |
| 603 | - if(strlen($class = $this->getCssClass()) > 0) |
|
| 603 | + if(strlen($class=$this->getCssClass()) > 0) |
|
| 604 | 604 | $writer->addAttribute('class', $class); |
| 605 | 605 | $writer->renderBeginTag('span'); |
| 606 | 606 | |
| 607 | - $s = Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 608 | - $date = $s->getDate($this->getTimeStampFromText()); |
|
| 607 | + $s=Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 608 | + $date=$s->getDate($this->getTimeStampFromText()); |
|
| 609 | 609 | //$date = @getdate($this->getTimeStampFromText()); |
| 610 | 610 | |
| 611 | 611 | $this->renderCalendarSelections($writer, $date); |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | |
| 623 | 623 | protected function hasDayPattern() |
| 624 | 624 | { |
| 625 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 625 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 626 | 626 | $this->getDateFormat()); |
| 627 | 627 | return ($formatter->getDayPattern()!==null); |
| 628 | 628 | } |
@@ -634,17 +634,17 @@ discard block |
||
| 634 | 634 | */ |
| 635 | 635 | protected function renderCalendarSelections($writer, $date) |
| 636 | 636 | { |
| 637 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 637 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 638 | 638 | $this->getDateFormat()); |
| 639 | 639 | |
| 640 | 640 | foreach($formatter->getDayMonthYearOrdering() as $type) |
| 641 | 641 | { |
| 642 | - if($type == 'day') |
|
| 643 | - $this->renderCalendarDayOptions($writer,$date['mday']); |
|
| 644 | - elseif($type == 'month') |
|
| 645 | - $this->renderCalendarMonthOptions($writer,$date['mon']); |
|
| 646 | - elseif($type == 'year') |
|
| 647 | - $this->renderCalendarYearOptions($writer,$date['year']); |
|
| 642 | + if($type=='day') |
|
| 643 | + $this->renderCalendarDayOptions($writer, $date['mday']); |
|
| 644 | + elseif($type=='month') |
|
| 645 | + $this->renderCalendarMonthOptions($writer, $date['mon']); |
|
| 646 | + elseif($type=='year') |
|
| 647 | + $this->renderCalendarYearOptions($writer, $date['year']); |
|
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | |
@@ -654,9 +654,9 @@ discard block |
||
| 654 | 654 | */ |
| 655 | 655 | protected function getTimeStampFromText() |
| 656 | 656 | { |
| 657 | - $pattern = $this->getDateFormat(); |
|
| 658 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
| 659 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern); |
|
| 657 | + $pattern=$this->getDateFormat(); |
|
| 658 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
| 659 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 660 | 660 | return $formatter->parse($this->getText()); |
| 661 | 661 | } |
| 662 | 662 | |
@@ -666,12 +666,12 @@ discard block |
||
| 666 | 666 | * @param array list of selection options |
| 667 | 667 | * @param mixed selected key. |
| 668 | 668 | */ |
| 669 | - private function renderDropDownListOptions($writer,$options,$selected=null) |
|
| 669 | + private function renderDropDownListOptions($writer, $options, $selected=null) |
|
| 670 | 670 | { |
| 671 | 671 | foreach($options as $k => $v) |
| 672 | 672 | { |
| 673 | 673 | $writer->addAttribute('value', $k); |
| 674 | - if($k == $selected) |
|
| 674 | + if($k==$selected) |
|
| 675 | 675 | $writer->addAttribute('selected', 'selected'); |
| 676 | 676 | $writer->renderBeginTag('option'); |
| 677 | 677 | $writer->write($v); |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | */ |
| 687 | 687 | protected function renderCalendarDayOptions($writer, $selected=null) |
| 688 | 688 | { |
| 689 | - $days = $this->getDropDownDayOptions(); |
|
| 689 | + $days=$this->getDropDownDayOptions(); |
|
| 690 | 690 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'day'); |
| 691 | 691 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'day'); |
| 692 | 692 | $writer->addAttribute('class', 'datepicker_day_options'); |
@@ -702,13 +702,13 @@ discard block |
||
| 702 | 702 | */ |
| 703 | 703 | protected function getDropDownDayOptions() |
| 704 | 704 | { |
| 705 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 705 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 706 | 706 | $this->getDateFormat()); |
| 707 | - $days = array(); |
|
| 708 | - $requiresPadding = $formatter->getDayPattern() === 'dd'; |
|
| 709 | - for($i=1;$i<=31;$i++) |
|
| 707 | + $days=array(); |
|
| 708 | + $requiresPadding=$formatter->getDayPattern()==='dd'; |
|
| 709 | + for($i=1; $i <= 31; $i++) |
|
| 710 | 710 | { |
| 711 | - $days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
|
| 711 | + $days[$i]=$requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
|
| 712 | 712 | } |
| 713 | 713 | return $days; |
| 714 | 714 | } |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | */ |
| 721 | 721 | protected function renderCalendarMonthOptions($writer, $selected=null) |
| 722 | 722 | { |
| 723 | - $info = $this->getLocalizedCalendarInfo(); |
|
| 723 | + $info=$this->getLocalizedCalendarInfo(); |
|
| 724 | 724 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'month'); |
| 725 | 725 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'month'); |
| 726 | 726 | $writer->addAttribute('class', 'datepicker_month_options'); |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $writer->addAttribute('disabled', 'disabled'); |
| 729 | 729 | $writer->renderBeginTag('select'); |
| 730 | 730 | $this->renderDropDownListOptions($writer, |
| 731 | - $this->getLocalizedMonthNames($info), $selected-1); |
|
| 731 | + $this->getLocalizedMonthNames($info), $selected - 1); |
|
| 732 | 732 | $writer->renderEndTag(); |
| 733 | 733 | } |
| 734 | 734 | |
@@ -741,18 +741,18 @@ discard block |
||
| 741 | 741 | */ |
| 742 | 742 | protected function getLocalizedMonthNames($info) |
| 743 | 743 | { |
| 744 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 744 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 745 | 745 | $this->getDateFormat()); |
| 746 | 746 | switch($formatter->getMonthPattern()) |
| 747 | 747 | { |
| 748 | 748 | case 'MMM': return $info->getAbbreviatedMonthNames(); |
| 749 | 749 | case 'MM': |
| 750 | - $array = array(); |
|
| 751 | - for($i=1;$i<=12;$i++) |
|
| 752 | - $array[$i-1] = $i < 10 ? '0'.$i : $i; |
|
| 750 | + $array=array(); |
|
| 751 | + for($i=1; $i <= 12; $i++) |
|
| 752 | + $array[$i - 1]=$i < 10 ? '0'.$i : $i; |
|
| 753 | 753 | return $array; |
| 754 | 754 | case 'M': |
| 755 | - $array = array(); for($i=1;$i<=12;$i++) $array[$i-1] = $i; |
|
| 755 | + $array=array(); for($i=1; $i <= 12; $i++) $array[$i - 1]=$i; |
|
| 756 | 756 | return $array; |
| 757 | 757 | default : return $info->getMonthNames(); |
| 758 | 758 | } |
@@ -765,9 +765,9 @@ discard block |
||
| 765 | 765 | */ |
| 766 | 766 | protected function renderCalendarYearOptions($writer, $selected=null) |
| 767 | 767 | { |
| 768 | - $years = array(); |
|
| 769 | - for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++) |
|
| 770 | - $years[$i] = $i; |
|
| 768 | + $years=array(); |
|
| 769 | + for($i=$this->getFromYear(); $i <= $this->getUpToYear(); $i++) |
|
| 770 | + $years[$i]=$i; |
|
| 771 | 771 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'year'); |
| 772 | 772 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'year'); |
| 773 | 773 | $writer->addAttribute('class', 'datepicker_year_options'); |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | $writer->addAttribute('id', $this->getDatePickerButtonID()); |
| 797 | 797 | $writer->addAttribute('type', 'button'); |
| 798 | 798 | $writer->addAttribute('class', $this->getCssClass().' TDatePickerButton'); |
| 799 | - $writer->addAttribute('value',$this->getButtonText()); |
|
| 799 | + $writer->addAttribute('value', $this->getButtonText()); |
|
| 800 | 800 | if(!$this->getEnabled(true)) |
| 801 | 801 | $writer->addAttribute('disabled', 'disabled'); |
| 802 | 802 | $writer->renderBeginTag("input"); |
@@ -809,8 +809,8 @@ discard block |
||
| 809 | 809 | */ |
| 810 | 810 | protected function renderImageButtonDatePicker($writer) |
| 811 | 811 | { |
| 812 | - $url = $this->getButtonImageUrl(); |
|
| 813 | - $url = empty($url) ? $this->getAssetUrl('calendar.png') : $url; |
|
| 812 | + $url=$this->getButtonImageUrl(); |
|
| 813 | + $url=empty($url) ? $this->getAssetUrl('calendar.png') : $url; |
|
| 814 | 814 | $writer->addAttribute('id', $this->getDatePickerButtonID()); |
| 815 | 815 | $writer->addAttribute('src', $url); |
| 816 | 816 | $writer->addAttribute('alt', ' '); |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | */ |
| 830 | 830 | protected function getAssetUrl($file='') |
| 831 | 831 | { |
| 832 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
| 832 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
| 833 | 833 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
| 834 | 834 | } |
| 835 | 835 | |
@@ -839,8 +839,8 @@ discard block |
||
| 839 | 839 | */ |
| 840 | 840 | protected function publishCalendarStyle() |
| 841 | 841 | { |
| 842 | - $url = $this->getAssetUrl($this->getCalendarStyle().'.css'); |
|
| 843 | - $cs = $this->getPage()->getClientScript(); |
|
| 842 | + $url=$this->getAssetUrl($this->getCalendarStyle().'.css'); |
|
| 843 | + $cs=$this->getPage()->getClientScript(); |
|
| 844 | 844 | if(!$cs->isStyleSheetFileRegistered($url)) |
| 845 | 845 | $cs->registerStyleSheetFile($url, $url); |
| 846 | 846 | return $url; |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | protected function addAttributesToRender($writer) |
| 854 | 854 | { |
| 855 | 855 | parent::addAttributesToRender($writer); |
| 856 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 856 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | /** |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | { |
| 864 | 864 | if($this->getShowCalendar()) |
| 865 | 865 | { |
| 866 | - $cs = $this->getPage()->getClientScript(); |
|
| 866 | + $cs=$this->getPage()->getClientScript(); |
|
| 867 | 867 | $cs->registerPradoScript("datepicker"); |
| 868 | 868 | } |
| 869 | 869 | } |
@@ -872,16 +872,16 @@ discard block |
||
| 872 | 872 | { |
| 873 | 873 | if($this->getShowCalendar()) |
| 874 | 874 | { |
| 875 | - $cs = $this->getPage()->getClientScript(); |
|
| 875 | + $cs=$this->getPage()->getClientScript(); |
|
| 876 | 876 | if(!$cs->isEndScriptRegistered('TDatePicker.spacer')) |
| 877 | 877 | { |
| 878 | - $spacer = $this->getAssetUrl('spacer.gif'); |
|
| 879 | - $code = "Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 878 | + $spacer=$this->getAssetUrl('spacer.gif'); |
|
| 879 | + $code="Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 880 | 880 | $cs->registerEndScript('TDatePicker.spacer', $code); |
| 881 | 881 | } |
| 882 | 882 | |
| 883 | - $options = TJavaScript::encode($this->getDatePickerOptions()); |
|
| 884 | - $code = "new Prado.WebUI.TDatePicker($options);"; |
|
| 883 | + $options=TJavaScript::encode($this->getDatePickerOptions()); |
|
| 884 | + $code="new Prado.WebUI.TDatePicker($options);"; |
|
| 885 | 885 | $cs->registerEndScript("prado:".$this->getClientID(), $code); |
| 886 | 886 | } |
| 887 | 887 | } |