@@ -20,6 +20,10 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | public function getView($viewName); |
| 22 | 22 | public function getViewNames(); |
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @return void |
|
| 26 | + */ |
|
| 23 | 27 | public function onDataSourceChanged($param); |
| 24 | 28 | } |
| 25 | 29 | |
@@ -95,6 +99,9 @@ discard block |
||
| 95 | 99 | private $_dataSource; |
| 96 | 100 | private $_dataMember; |
| 97 | 101 | |
| 102 | + /** |
|
| 103 | + * @param Traversable $dataSource |
|
| 104 | + */ |
|
| 98 | 105 | public function __construct($dataSource,$dataMember) |
| 99 | 106 | { |
| 100 | 107 | if(!is_array($dataSource) && !($dataSource instanceof IDataSource) && !($dataSource instanceof Traversable)) |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function onDataSourceChanged($param) |
| 46 | 46 | { |
| 47 | - $this->raiseEvent('OnDataSourceChanged',$this,$param); |
|
| 47 | + $this->raiseEvent('OnDataSourceChanged', $this, $param); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function focus() |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | private $_dataSource; |
| 96 | 96 | private $_dataMember; |
| 97 | 97 | |
| 98 | - public function __construct($dataSource,$dataMember) |
|
| 98 | + public function __construct($dataSource, $dataMember) |
|
| 99 | 99 | { |
| 100 | 100 | if(!is_array($dataSource) && !($dataSource instanceof IDataSource) && !($dataSource instanceof Traversable)) |
| 101 | 101 | throw new TInvalidDataTypeException('readonlydatasource_datasource_invalid'); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if($this->_dataSource instanceof IDataSource) |
| 109 | 109 | return $this->_dataSource->getView($viewName); |
| 110 | 110 | else |
| 111 | - return new TReadOnlyDataSourceView($this,$this->_dataMember,$this->_dataSource); |
|
| 111 | + return new TReadOnlyDataSourceView($this, $this->_dataMember, $this->_dataSource); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -106,6 +106,7 @@ discard block |
||
| 106 | 106 | /** |
| 107 | 107 | * Sets the format of the date string. |
| 108 | 108 | * @param string the format of the date string |
| 109 | + * @param string $value |
|
| 109 | 110 | */ |
| 110 | 111 | public function setDateFormat($value) |
| 111 | 112 | { |
@@ -245,6 +246,7 @@ discard block |
||
| 245 | 246 | |
| 246 | 247 | /** |
| 247 | 248 | * @param integer date picker starting year, default is 2000. |
| 249 | + * @param integer $value |
|
| 248 | 250 | */ |
| 249 | 251 | public function setFromYear($value) |
| 250 | 252 | { |
@@ -354,6 +356,7 @@ discard block |
||
| 354 | 356 | |
| 355 | 357 | /** |
| 356 | 358 | * @param string date string |
| 359 | + * @param string $value |
|
| 357 | 360 | */ |
| 358 | 361 | public function setDate($value) |
| 359 | 362 | { |
@@ -731,6 +734,7 @@ discard block |
||
| 731 | 734 | * "MMMM" will return the month names, "MM" or "MMM" return abbr. month names |
| 732 | 735 | * and "M" return month digits. |
| 733 | 736 | * @param DateTimeFormatInfo localized date format information. |
| 737 | + * @param DateTimeFormatInfo $info |
|
| 734 | 738 | * @return array localized month names. |
| 735 | 739 | */ |
| 736 | 740 | protected function getLocalizedMonthNames($info) |
@@ -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,30 +481,30 @@ discard block |
||
| 481 | 481 | */ |
| 482 | 482 | protected function getDateFromPostData($key, $values) |
| 483 | 483 | { |
| 484 | - $date = @getdate(); |
|
| 484 | + $date=@getdate(); |
|
| 485 | 485 | |
| 486 | 486 | if(isset($values[$key.'$day'])) |
| 487 | - $day = intval($values[$key.'$day']); |
|
| 487 | + $day=intval($values[$key.'$day']); |
|
| 488 | 488 | else |
| 489 | - $day = $date['mday']; |
|
| 489 | + $day=$date['mday']; |
|
| 490 | 490 | |
| 491 | 491 | if(isset($values[$key.'$month'])) |
| 492 | - $month = intval($values[$key.'$month']) + 1; |
|
| 492 | + $month=intval($values[$key.'$month']) + 1; |
|
| 493 | 493 | else |
| 494 | - $month = $date['mon']; |
|
| 494 | + $month=$date['mon']; |
|
| 495 | 495 | |
| 496 | 496 | if(isset($values[$key.'$year'])) |
| 497 | - $year = intval($values[$key.'$year']); |
|
| 497 | + $year=intval($values[$key.'$year']); |
|
| 498 | 498 | else |
| 499 | - $year = $date['year']; |
|
| 499 | + $year=$date['year']; |
|
| 500 | 500 | |
| 501 | - $s = Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 502 | - $date = $s->getTimeStamp(0, 0, 0, $month, $day, $year); |
|
| 501 | + $s=Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 502 | + $date=$s->getTimeStamp(0, 0, 0, $month, $day, $year); |
|
| 503 | 503 | //$date = @mktime(0, 0, 0, $month, $day, $year); |
| 504 | 504 | |
| 505 | - $pattern = $this->getDateFormat(); |
|
| 506 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
| 507 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 505 | + $pattern=$this->getDateFormat(); |
|
| 506 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
| 507 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 508 | 508 | return $formatter->format($date); |
| 509 | 509 | } |
| 510 | 510 | |
@@ -514,31 +514,31 @@ discard block |
||
| 514 | 514 | */ |
| 515 | 515 | protected function getDatePickerOptions() |
| 516 | 516 | { |
| 517 | - $options['ID'] = $this->getClientID(); |
|
| 518 | - $options['InputMode'] = $this->getInputMode(); |
|
| 519 | - $options['Format'] = $this->getDateFormat(); |
|
| 520 | - $options['FirstDayOfWeek'] = $this->getFirstDayOfWeek(); |
|
| 517 | + $options['ID']=$this->getClientID(); |
|
| 518 | + $options['InputMode']=$this->getInputMode(); |
|
| 519 | + $options['Format']=$this->getDateFormat(); |
|
| 520 | + $options['FirstDayOfWeek']=$this->getFirstDayOfWeek(); |
|
| 521 | 521 | if(($cssClass=$this->getCssClass())!=='') |
| 522 | - $options['ClassName'] = $cssClass; |
|
| 523 | - $options['CalendarStyle'] = $this->getCalendarStyle(); |
|
| 524 | - $options['FromYear'] = $this->getFromYear(); |
|
| 525 | - $options['UpToYear'] = $this->getUpToYear(); |
|
| 522 | + $options['ClassName']=$cssClass; |
|
| 523 | + $options['CalendarStyle']=$this->getCalendarStyle(); |
|
| 524 | + $options['FromYear']=$this->getFromYear(); |
|
| 525 | + $options['UpToYear']=$this->getUpToYear(); |
|
| 526 | 526 | switch($this->getMode()) |
| 527 | 527 | { |
| 528 | 528 | case TDatePickerMode::Basic: |
| 529 | 529 | break; |
| 530 | 530 | case TDatePickerMode::Clickable: |
| 531 | - $options['TriggerEvent'] = "click"; |
|
| 531 | + $options['TriggerEvent']="click"; |
|
| 532 | 532 | break; |
| 533 | 533 | default: |
| 534 | - $options['Trigger'] = $this->getDatePickerButtonID(); |
|
| 534 | + $options['Trigger']=$this->getDatePickerButtonID(); |
|
| 535 | 535 | break; |
| 536 | 536 | } |
| 537 | - $options['PositionMode'] = $this->getPositionMode(); |
|
| 537 | + $options['PositionMode']=$this->getPositionMode(); |
|
| 538 | 538 | |
| 539 | - $options = array_merge($options, $this->getCulturalOptions()); |
|
| 539 | + $options=array_merge($options, $this->getCulturalOptions()); |
|
| 540 | 540 | if($this->_clientScript!==null) |
| 541 | - $options = array_merge($options, |
|
| 541 | + $options=array_merge($options, |
|
| 542 | 542 | $this->_clientScript->getOptions()->toArray()); |
| 543 | 543 | return $options; |
| 544 | 544 | } |
@@ -549,13 +549,13 @@ discard block |
||
| 549 | 549 | */ |
| 550 | 550 | protected function getCulturalOptions() |
| 551 | 551 | { |
| 552 | - if($this->getCurrentCulture() == 'en') |
|
| 552 | + if($this->getCurrentCulture()=='en') |
|
| 553 | 553 | return array(); |
| 554 | 554 | |
| 555 | - $date = $this->getLocalizedCalendarInfo(); |
|
| 556 | - $options['MonthNames'] = $date->getMonthNames(); |
|
| 557 | - $options['AbbreviatedMonthNames'] = $date->getAbbreviatedMonthNames(); |
|
| 558 | - $options['ShortWeekDayNames'] = $date->getAbbreviatedDayNames(); |
|
| 555 | + $date=$this->getLocalizedCalendarInfo(); |
|
| 556 | + $options['MonthNames']=$date->getMonthNames(); |
|
| 557 | + $options['AbbreviatedMonthNames']=$date->getAbbreviatedMonthNames(); |
|
| 558 | + $options['ShortWeekDayNames']=$date->getAbbreviatedDayNames(); |
|
| 559 | 559 | |
| 560 | 560 | return $options; |
| 561 | 561 | } |
@@ -565,8 +565,8 @@ discard block |
||
| 565 | 565 | */ |
| 566 | 566 | protected function getCurrentCulture() |
| 567 | 567 | { |
| 568 | - $app = $this->getApplication()->getGlobalization(false); |
|
| 569 | - return $this->getCulture() == '' ? |
|
| 568 | + $app=$this->getApplication()->getGlobalization(false); |
|
| 569 | + return $this->getCulture()=='' ? |
|
| 570 | 570 | ($app ? $app->getCulture() : 'en') : $this->getCulture(); |
| 571 | 571 | } |
| 572 | 572 | |
@@ -576,9 +576,9 @@ discard block |
||
| 576 | 576 | protected function getLocalizedCalendarInfo() |
| 577 | 577 | { |
| 578 | 578 | //expensive operations |
| 579 | - $culture = $this->getCurrentCulture(); |
|
| 579 | + $culture=$this->getCurrentCulture(); |
|
| 580 | 580 | Prado::using('System.I18N.core.DateTimeFormatInfo'); |
| 581 | - $info = Prado::createComponent('System.I18N.core.CultureInfo', $culture); |
|
| 581 | + $info=Prado::createComponent('System.I18N.core.CultureInfo', $culture); |
|
| 582 | 582 | return $info->getDateTimeFormat(); |
| 583 | 583 | } |
| 584 | 584 | |
@@ -587,19 +587,19 @@ discard block |
||
| 587 | 587 | */ |
| 588 | 588 | protected function renderDropDownListCalendar($writer) |
| 589 | 589 | { |
| 590 | - if($this->getMode() == TDatePickerMode::Basic) |
|
| 590 | + if($this->getMode()==TDatePickerMode::Basic) |
|
| 591 | 591 | $this->setMode(TDatePickerMode::ImageButton); |
| 592 | 592 | parent::addAttributesToRender($writer); |
| 593 | 593 | $writer->removeAttribute('name'); |
| 594 | 594 | $writer->removeAttribute('type'); |
| 595 | 595 | $writer->addAttribute('id', $this->getClientID()); |
| 596 | 596 | |
| 597 | - if(strlen($class = $this->getCssClass()) > 0) |
|
| 597 | + if(strlen($class=$this->getCssClass()) > 0) |
|
| 598 | 598 | $writer->addAttribute('class', $class); |
| 599 | 599 | $writer->renderBeginTag('span'); |
| 600 | 600 | |
| 601 | - $s = Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 602 | - $date = $s->getDate($this->getTimeStampFromText()); |
|
| 601 | + $s=Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 602 | + $date=$s->getDate($this->getTimeStampFromText()); |
|
| 603 | 603 | //$date = @getdate($this->getTimeStampFromText()); |
| 604 | 604 | |
| 605 | 605 | $this->renderCalendarSelections($writer, $date); |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | |
| 617 | 617 | protected function hasDayPattern() |
| 618 | 618 | { |
| 619 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 619 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 620 | 620 | $this->getDateFormat()); |
| 621 | 621 | return ($formatter->getDayPattern()!==null); |
| 622 | 622 | } |
@@ -628,17 +628,17 @@ discard block |
||
| 628 | 628 | */ |
| 629 | 629 | protected function renderCalendarSelections($writer, $date) |
| 630 | 630 | { |
| 631 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 631 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 632 | 632 | $this->getDateFormat()); |
| 633 | 633 | |
| 634 | 634 | foreach($formatter->getDayMonthYearOrdering() as $type) |
| 635 | 635 | { |
| 636 | - if($type == 'day') |
|
| 637 | - $this->renderCalendarDayOptions($writer,$date['mday']); |
|
| 638 | - elseif($type == 'month') |
|
| 639 | - $this->renderCalendarMonthOptions($writer,$date['mon']); |
|
| 640 | - elseif($type == 'year') |
|
| 641 | - $this->renderCalendarYearOptions($writer,$date['year']); |
|
| 636 | + if($type=='day') |
|
| 637 | + $this->renderCalendarDayOptions($writer, $date['mday']); |
|
| 638 | + elseif($type=='month') |
|
| 639 | + $this->renderCalendarMonthOptions($writer, $date['mon']); |
|
| 640 | + elseif($type=='year') |
|
| 641 | + $this->renderCalendarYearOptions($writer, $date['year']); |
|
| 642 | 642 | } |
| 643 | 643 | } |
| 644 | 644 | |
@@ -648,9 +648,9 @@ discard block |
||
| 648 | 648 | */ |
| 649 | 649 | protected function getTimeStampFromText() |
| 650 | 650 | { |
| 651 | - $pattern = $this->getDateFormat(); |
|
| 652 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
| 653 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern); |
|
| 651 | + $pattern=$this->getDateFormat(); |
|
| 652 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
| 653 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 654 | 654 | return $formatter->parse($this->getText()); |
| 655 | 655 | } |
| 656 | 656 | |
@@ -660,12 +660,12 @@ discard block |
||
| 660 | 660 | * @param array list of selection options |
| 661 | 661 | * @param mixed selected key. |
| 662 | 662 | */ |
| 663 | - private function renderDropDownListOptions($writer,$options,$selected=null) |
|
| 663 | + private function renderDropDownListOptions($writer, $options, $selected=null) |
|
| 664 | 664 | { |
| 665 | 665 | foreach($options as $k => $v) |
| 666 | 666 | { |
| 667 | 667 | $writer->addAttribute('value', $k); |
| 668 | - if($k == $selected) |
|
| 668 | + if($k==$selected) |
|
| 669 | 669 | $writer->addAttribute('selected', 'selected'); |
| 670 | 670 | $writer->renderBeginTag('option'); |
| 671 | 671 | $writer->write($v); |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | */ |
| 681 | 681 | protected function renderCalendarDayOptions($writer, $selected=null) |
| 682 | 682 | { |
| 683 | - $days = $this->getDropDownDayOptions(); |
|
| 683 | + $days=$this->getDropDownDayOptions(); |
|
| 684 | 684 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'day'); |
| 685 | 685 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'day'); |
| 686 | 686 | $writer->addAttribute('class', 'datepicker_day_options'); |
@@ -696,13 +696,13 @@ discard block |
||
| 696 | 696 | */ |
| 697 | 697 | protected function getDropDownDayOptions() |
| 698 | 698 | { |
| 699 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 699 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 700 | 700 | $this->getDateFormat()); |
| 701 | - $days = array(); |
|
| 702 | - $requiresPadding = $formatter->getDayPattern() === 'dd'; |
|
| 703 | - for($i=1;$i<=31;$i++) |
|
| 701 | + $days=array(); |
|
| 702 | + $requiresPadding=$formatter->getDayPattern()==='dd'; |
|
| 703 | + for($i=1; $i <= 31; $i++) |
|
| 704 | 704 | { |
| 705 | - $days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
|
| 705 | + $days[$i]=$requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
|
| 706 | 706 | } |
| 707 | 707 | return $days; |
| 708 | 708 | } |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | */ |
| 715 | 715 | protected function renderCalendarMonthOptions($writer, $selected=null) |
| 716 | 716 | { |
| 717 | - $info = $this->getLocalizedCalendarInfo(); |
|
| 717 | + $info=$this->getLocalizedCalendarInfo(); |
|
| 718 | 718 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'month'); |
| 719 | 719 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'month'); |
| 720 | 720 | $writer->addAttribute('class', 'datepicker_month_options'); |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | $writer->addAttribute('disabled', 'disabled'); |
| 723 | 723 | $writer->renderBeginTag('select'); |
| 724 | 724 | $this->renderDropDownListOptions($writer, |
| 725 | - $this->getLocalizedMonthNames($info), $selected-1); |
|
| 725 | + $this->getLocalizedMonthNames($info), $selected - 1); |
|
| 726 | 726 | $writer->renderEndTag(); |
| 727 | 727 | } |
| 728 | 728 | |
@@ -735,18 +735,18 @@ discard block |
||
| 735 | 735 | */ |
| 736 | 736 | protected function getLocalizedMonthNames($info) |
| 737 | 737 | { |
| 738 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 738 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 739 | 739 | $this->getDateFormat()); |
| 740 | 740 | switch($formatter->getMonthPattern()) |
| 741 | 741 | { |
| 742 | 742 | case 'MMM': return $info->getAbbreviatedMonthNames(); |
| 743 | 743 | case 'MM': |
| 744 | - $array = array(); |
|
| 745 | - for($i=1;$i<=12;$i++) |
|
| 746 | - $array[$i-1] = $i < 10 ? '0'.$i : $i; |
|
| 744 | + $array=array(); |
|
| 745 | + for($i=1; $i <= 12; $i++) |
|
| 746 | + $array[$i - 1]=$i < 10 ? '0'.$i : $i; |
|
| 747 | 747 | return $array; |
| 748 | 748 | case 'M': |
| 749 | - $array = array(); for($i=1;$i<=12;$i++) $array[$i-1] = $i; |
|
| 749 | + $array=array(); for($i=1; $i <= 12; $i++) $array[$i - 1]=$i; |
|
| 750 | 750 | return $array; |
| 751 | 751 | default : return $info->getMonthNames(); |
| 752 | 752 | } |
@@ -759,9 +759,9 @@ discard block |
||
| 759 | 759 | */ |
| 760 | 760 | protected function renderCalendarYearOptions($writer, $selected=null) |
| 761 | 761 | { |
| 762 | - $years = array(); |
|
| 763 | - for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++) |
|
| 764 | - $years[$i] = $i; |
|
| 762 | + $years=array(); |
|
| 763 | + for($i=$this->getFromYear(); $i <= $this->getUpToYear(); $i++) |
|
| 764 | + $years[$i]=$i; |
|
| 765 | 765 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'year'); |
| 766 | 766 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'year'); |
| 767 | 767 | $writer->addAttribute('class', 'datepicker_year_options'); |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | $writer->addAttribute('id', $this->getDatePickerButtonID()); |
| 791 | 791 | $writer->addAttribute('type', 'button'); |
| 792 | 792 | $writer->addAttribute('class', $this->getCssClass().' TDatePickerButton'); |
| 793 | - $writer->addAttribute('value',$this->getButtonText()); |
|
| 793 | + $writer->addAttribute('value', $this->getButtonText()); |
|
| 794 | 794 | if(!$this->getEnabled(true)) |
| 795 | 795 | $writer->addAttribute('disabled', 'disabled'); |
| 796 | 796 | $writer->renderBeginTag("input"); |
@@ -803,8 +803,8 @@ discard block |
||
| 803 | 803 | */ |
| 804 | 804 | protected function renderImageButtonDatePicker($writer) |
| 805 | 805 | { |
| 806 | - $url = $this->getButtonImageUrl(); |
|
| 807 | - $url = empty($url) ? $this->getAssetUrl('calendar.png') : $url; |
|
| 806 | + $url=$this->getButtonImageUrl(); |
|
| 807 | + $url=empty($url) ? $this->getAssetUrl('calendar.png') : $url; |
|
| 808 | 808 | $writer->addAttribute('id', $this->getDatePickerButtonID()); |
| 809 | 809 | $writer->addAttribute('src', $url); |
| 810 | 810 | $writer->addAttribute('alt', ' '); |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | */ |
| 824 | 824 | protected function getAssetUrl($file='') |
| 825 | 825 | { |
| 826 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
| 826 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
| 827 | 827 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
| 828 | 828 | } |
| 829 | 829 | |
@@ -833,8 +833,8 @@ discard block |
||
| 833 | 833 | */ |
| 834 | 834 | protected function publishCalendarStyle() |
| 835 | 835 | { |
| 836 | - $url = $this->getAssetUrl($this->getCalendarStyle().'.css'); |
|
| 837 | - $cs = $this->getPage()->getClientScript(); |
|
| 836 | + $url=$this->getAssetUrl($this->getCalendarStyle().'.css'); |
|
| 837 | + $cs=$this->getPage()->getClientScript(); |
|
| 838 | 838 | if(!$cs->isStyleSheetFileRegistered($url)) |
| 839 | 839 | $cs->registerStyleSheetFile($url, $url); |
| 840 | 840 | return $url; |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | protected function addAttributesToRender($writer) |
| 848 | 848 | { |
| 849 | 849 | parent::addAttributesToRender($writer); |
| 850 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 850 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | /** |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | { |
| 858 | 858 | if($this->getShowCalendar()) |
| 859 | 859 | { |
| 860 | - $cs = $this->getPage()->getClientScript(); |
|
| 860 | + $cs=$this->getPage()->getClientScript(); |
|
| 861 | 861 | $cs->registerPradoScript("datepicker"); |
| 862 | 862 | } |
| 863 | 863 | } |
@@ -866,16 +866,16 @@ discard block |
||
| 866 | 866 | { |
| 867 | 867 | if($this->getShowCalendar()) |
| 868 | 868 | { |
| 869 | - $cs = $this->getPage()->getClientScript(); |
|
| 869 | + $cs=$this->getPage()->getClientScript(); |
|
| 870 | 870 | if(!$cs->isEndScriptRegistered('TDatePicker.spacer')) |
| 871 | 871 | { |
| 872 | - $spacer = $this->getAssetUrl('spacer.gif'); |
|
| 873 | - $code = "Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 872 | + $spacer=$this->getAssetUrl('spacer.gif'); |
|
| 873 | + $code="Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 874 | 874 | $cs->registerEndScript('TDatePicker.spacer', $code); |
| 875 | 875 | } |
| 876 | 876 | |
| 877 | - $options = TJavaScript::encode($this->getDatePickerOptions()); |
|
| 878 | - $code = "new Prado.WebUI.TDatePicker($options);"; |
|
| 877 | + $options=TJavaScript::encode($this->getDatePickerOptions()); |
|
| 878 | + $code="new Prado.WebUI.TDatePicker($options);"; |
|
| 879 | 879 | $cs->registerEndScript("prado:".$this->getClientID(), $code); |
| 880 | 880 | } |
| 881 | 881 | } |
@@ -189,8 +189,7 @@ discard block |
||
| 189 | 189 | return file_put_contents($fileName,file_get_contents($this->_localName))!==false; |
| 190 | 190 | else |
| 191 | 191 | return false; |
| 192 | - } |
|
| 193 | - else |
|
| 192 | + } else |
|
| 194 | 193 | return false; |
| 195 | 194 | } |
| 196 | 195 | |
@@ -211,8 +210,7 @@ discard block |
||
| 211 | 210 | $this->_errorCode=$_FILES[$key]['error']; |
| 212 | 211 | $this->_localName=$_FILES[$key]['tmp_name']; |
| 213 | 212 | return $this->_dataChanged=true; |
| 214 | - } |
|
| 215 | - else |
|
| 213 | + } else |
|
| 216 | 214 | return false; |
| 217 | 215 | } |
| 218 | 216 | |
@@ -234,7 +234,11 @@ |
||
| 234 | 234 | * @param string button caption |
| 235 | 235 | * @param boolean whether the button should cause validation |
| 236 | 236 | * @param string the validation group that the button belongs to |
| 237 | - * @return mixed the newly created button. |
|
| 237 | + * @param string $commandName |
|
| 238 | + * @param string $text |
|
| 239 | + * @param boolean $causesValidation |
|
| 240 | + * @param string $validationGroup |
|
| 241 | + * @return TComponent the newly created button. |
|
| 238 | 242 | */ |
| 239 | 243 | protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
| 240 | 244 | { |
@@ -211,8 +211,7 @@ discard block |
||
| 211 | 211 | $button=$this->createButton('Edit',$this->getEditText(),false,''); |
| 212 | 212 | $cell->getControls()->add($button); |
| 213 | 213 | $cell->registerObject('EditButton',$button); |
| 214 | - } |
|
| 215 | - else if($itemType===TListItemType::EditItem) |
|
| 214 | + } else if($itemType===TListItemType::EditItem) |
|
| 216 | 215 | { |
| 217 | 216 | $controls=$cell->getControls(); |
| 218 | 217 | $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
@@ -222,8 +221,7 @@ discard block |
||
| 222 | 221 | $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
| 223 | 222 | $controls->add($button); |
| 224 | 223 | $cell->registerObject('CancelButton',$button); |
| 225 | - } |
|
| 226 | - else |
|
| 224 | + } else |
|
| 227 | 225 | parent::initializeCell($cell,$columnIndex,$itemType); |
| 228 | 226 | } |
| 229 | 227 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function getButtonType() |
| 58 | 58 | { |
| 59 | - return $this->getViewState('ButtonType',TButtonColumnType::LinkButton); |
|
| 59 | + return $this->getViewState('ButtonType', TButtonColumnType::LinkButton); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function setButtonType($value) |
| 66 | 66 | { |
| 67 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TButtonColumnType'),TButtonColumnType::LinkButton); |
|
| 67 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'TButtonColumnType'), TButtonColumnType::LinkButton); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function getEditText() |
| 74 | 74 | { |
| 75 | - return $this->getViewState('EditText','Edit'); |
|
| 75 | + return $this->getViewState('EditText', 'Edit'); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function setEditText($value) |
| 82 | 82 | { |
| 83 | - $this->setViewState('EditText',$value,'Edit'); |
|
| 83 | + $this->setViewState('EditText', $value, 'Edit'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getEditImageUrl() |
| 90 | 90 | { |
| 91 | - return $this->getViewState('EditImageUrl',''); |
|
| 91 | + return $this->getViewState('EditImageUrl', ''); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function setEditImageUrl($value) |
| 98 | 98 | { |
| 99 | - $this->setViewState('EditImageUrl',$value,''); |
|
| 99 | + $this->setViewState('EditImageUrl', $value, ''); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function getUpdateText() |
| 106 | 106 | { |
| 107 | - return $this->getViewState('UpdateText','Update'); |
|
| 107 | + return $this->getViewState('UpdateText', 'Update'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function setUpdateText($value) |
| 114 | 114 | { |
| 115 | - $this->setViewState('UpdateText',$value,'Update'); |
|
| 115 | + $this->setViewState('UpdateText', $value, 'Update'); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function getUpdateImageUrl() |
| 122 | 122 | { |
| 123 | - return $this->getViewState('UpdateImageUrl',''); |
|
| 123 | + return $this->getViewState('UpdateImageUrl', ''); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function setUpdateImageUrl($value) |
| 130 | 130 | { |
| 131 | - $this->setViewState('UpdateImageUrl',$value,''); |
|
| 131 | + $this->setViewState('UpdateImageUrl', $value, ''); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /** |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function getCancelText() |
| 138 | 138 | { |
| 139 | - return $this->getViewState('CancelText','Cancel'); |
|
| 139 | + return $this->getViewState('CancelText', 'Cancel'); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function setCancelText($value) |
| 146 | 146 | { |
| 147 | - $this->setViewState('CancelText',$value,'Cancel'); |
|
| 147 | + $this->setViewState('CancelText', $value, 'Cancel'); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function getCancelImageUrl() |
| 154 | 154 | { |
| 155 | - return $this->getViewState('CancelImageUrl',''); |
|
| 155 | + return $this->getViewState('CancelImageUrl', ''); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function setCancelImageUrl($value) |
| 162 | 162 | { |
| 163 | - $this->setViewState('CancelImageUrl',$value,''); |
|
| 163 | + $this->setViewState('CancelImageUrl', $value, ''); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | public function getCausesValidation() |
| 170 | 170 | { |
| 171 | - return $this->getViewState('CausesValidation',true); |
|
| 171 | + return $this->getViewState('CausesValidation', true); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public function setCausesValidation($value) |
| 178 | 178 | { |
| 179 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
| 179 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function getValidationGroup() |
| 186 | 186 | { |
| 187 | - return $this->getViewState('ValidationGroup',''); |
|
| 187 | + return $this->getViewState('ValidationGroup', ''); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function setValidationGroup($value) |
| 194 | 194 | { |
| 195 | - $this->setViewState('ValidationGroup',$value,''); |
|
| 195 | + $this->setViewState('ValidationGroup', $value, ''); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -204,27 +204,27 @@ discard block |
||
| 204 | 204 | * @param integer the index to the Columns property that the cell resides in. |
| 205 | 205 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
| 206 | 206 | */ |
| 207 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
| 207 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
| 208 | 208 | { |
| 209 | 209 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem) |
| 210 | 210 | { |
| 211 | - $button=$this->createButton('Edit',$this->getEditText(),false,''); |
|
| 211 | + $button=$this->createButton('Edit', $this->getEditText(), false, ''); |
|
| 212 | 212 | $cell->getControls()->add($button); |
| 213 | - $cell->registerObject('EditButton',$button); |
|
| 213 | + $cell->registerObject('EditButton', $button); |
|
| 214 | 214 | } |
| 215 | 215 | else if($itemType===TListItemType::EditItem) |
| 216 | 216 | { |
| 217 | 217 | $controls=$cell->getControls(); |
| 218 | - $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
|
| 218 | + $button=$this->createButton('Update', $this->getUpdateText(), $this->getCausesValidation(), $this->getValidationGroup()); |
|
| 219 | 219 | $controls->add($button); |
| 220 | - $cell->registerObject('UpdateButton',$button); |
|
| 220 | + $cell->registerObject('UpdateButton', $button); |
|
| 221 | 221 | $controls->add(' '); |
| 222 | - $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
|
| 222 | + $button=$this->createButton('Cancel', $this->getCancelText(), false, ''); |
|
| 223 | 223 | $controls->add($button); |
| 224 | - $cell->registerObject('CancelButton',$button); |
|
| 224 | + $cell->registerObject('CancelButton', $button); |
|
| 225 | 225 | } |
| 226 | 226 | else |
| 227 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
| 227 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @param string the validation group that the button belongs to |
| 237 | 237 | * @return mixed the newly created button. |
| 238 | 238 | */ |
| 239 | - protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
|
| 239 | + protected function createButton($commandName, $text, $causesValidation, $validationGroup) |
|
| 240 | 240 | { |
| 241 | 241 | if($this->getButtonType()===TButtonColumnType::LinkButton) |
| 242 | 242 | $button=Prado::createComponent('System.Web.UI.WebControls.TLinkButton'); |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | else // image buttons |
| 246 | 246 | { |
| 247 | 247 | $button=Prado::createComponent('System.Web.UI.WebControls.TImageButton'); |
| 248 | - if(strcasecmp($commandName,'Update')===0) |
|
| 248 | + if(strcasecmp($commandName, 'Update')===0) |
|
| 249 | 249 | $url=$this->getUpdateImageUrl(); |
| 250 | - else if(strcasecmp($commandName,'Cancel')===0) |
|
| 250 | + else if(strcasecmp($commandName, 'Cancel')===0) |
|
| 251 | 251 | $url=$this->getCancelImageUrl(); |
| 252 | 252 | else |
| 253 | 253 | $url=$this->getEditImageUrl(); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Returns an array of javascript validator options. |
| 58 | - * @return array javascript validator options. |
|
| 58 | + * @return boolean javascript validator options. |
|
| 59 | 59 | */ |
| 60 | 60 | public function evaluateIsValid() |
| 61 | 61 | { |
@@ -70,8 +70,7 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $domain=substr($value,$pos+1); |
| 72 | 72 | return $domain===''?false:checkdnsrr($domain,'MX'); |
| 73 | - } |
|
| 74 | - else |
|
| 73 | + } else |
|
| 75 | 74 | return false; |
| 76 | 75 | } |
| 77 | 76 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function getRegularExpression() |
| 51 | 51 | { |
| 52 | 52 | $regex=parent::getRegularExpression(); |
| 53 | - return $regex===''?self::EMAIL_REGEXP:$regex; |
|
| 53 | + return $regex==='' ? self::EMAIL_REGEXP : $regex; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -60,16 +60,16 @@ discard block |
||
| 60 | 60 | public function evaluateIsValid() |
| 61 | 61 | { |
| 62 | 62 | $value=$this->getValidationValue($this->getValidationTarget()); |
| 63 | - $valid=$valid=is_string($value) && strlen($value)<=254 && parent::evaluateIsValid(); |
|
| 63 | + $valid=$valid=is_string($value) && strlen($value) <= 254 && parent::evaluateIsValid(); |
|
| 64 | 64 | |
| 65 | 65 | if($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) |
| 66 | 66 | { |
| 67 | 67 | if($value!=='') |
| 68 | 68 | { |
| 69 | - if(($pos=strpos($value,'@'))!==false) |
|
| 69 | + if(($pos=strpos($value, '@'))!==false) |
|
| 70 | 70 | { |
| 71 | - $domain=substr($value,$pos+1); |
|
| 72 | - return $domain===''?false:checkdnsrr($domain,'MX'); |
|
| 71 | + $domain=substr($value, $pos + 1); |
|
| 72 | + return $domain==='' ? false : checkdnsrr($domain, 'MX'); |
|
| 73 | 73 | } |
| 74 | 74 | else |
| 75 | 75 | return false; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function getCheckMXRecord() |
| 85 | 85 | { |
| 86 | - return $this->getViewState('CheckMXRecord',false); |
|
| 86 | + return $this->getViewState('CheckMXRecord', false); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function setCheckMXRecord($value) |
| 94 | 94 | { |
| 95 | - $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),false); |
|
| 95 | + $this->setViewState('CheckMXRecord', TPropertyValue::ensureBoolean($value), false); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
@@ -177,6 +177,7 @@ discard block |
||
| 177 | 177 | * @param string the file name used to save the uploaded file |
| 178 | 178 | * @param boolean whether to delete the temporary file after saving. |
| 179 | 179 | * If true, you will not be able to save the uploaded file again. |
| 180 | + * @param string $fileName |
|
| 180 | 181 | * @return boolean true if the file saving is successful |
| 181 | 182 | */ |
| 182 | 183 | public function saveAs($fileName,$deleteTempFile=true) |
@@ -199,6 +200,7 @@ discard block |
||
| 199 | 200 | * This method is primarly used by framework developers. |
| 200 | 201 | * @param string the key that can be used to retrieve data from the input data collection |
| 201 | 202 | * @param array the input data collection |
| 203 | + * @param boolean $key |
|
| 202 | 204 | * @return boolean whether the data of the control has been changed |
| 203 | 205 | */ |
| 204 | 206 | public function loadPostData($key,$values) |
@@ -251,7 +253,7 @@ discard block |
||
| 251 | 253 | /** |
| 252 | 254 | * Returns the original file name as the property value to be validated. |
| 253 | 255 | * This method is required by IValidatable property. |
| 254 | - * @return mixed the property value to be validated |
|
| 256 | + * @return string the property value to be validated |
|
| 255 | 257 | */ |
| 256 | 258 | public function getValidationPropertyValue() |
| 257 | 259 | { |
@@ -463,14 +463,14 @@ |
||
| 463 | 463 | */ |
| 464 | 464 | public function getIsValid() |
| 465 | 465 | { |
| 466 | - return $this->_isValid; |
|
| 466 | + return $this->_isValid; |
|
| 467 | 467 | } |
| 468 | 468 | /** |
| 469 | 469 | * @param bool wether this control is valid. |
| 470 | 470 | */ |
| 471 | 471 | public function setIsValid($value) |
| 472 | 472 | { |
| 473 | - $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
| 473 | + $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | /** |
@@ -189,8 +189,7 @@ discard block |
||
| 189 | 189 | return file_put_contents($fileName,file_get_contents($this->_localName))!==false; |
| 190 | 190 | else |
| 191 | 191 | return false; |
| 192 | - } |
|
| 193 | - else |
|
| 192 | + } else |
|
| 194 | 193 | return false; |
| 195 | 194 | } |
| 196 | 195 | |
@@ -211,8 +210,7 @@ discard block |
||
| 211 | 210 | $this->_errorCode=$_FILES[$key]['error']; |
| 212 | 211 | $this->_localName=$_FILES[$key]['tmp_name']; |
| 213 | 212 | return $this->_dataChanged=true; |
| 214 | - } |
|
| 215 | - else |
|
| 213 | + } else |
|
| 216 | 214 | return false; |
| 217 | 215 | } |
| 218 | 216 | |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $this->getPage()->ensureRenderInForm($this); |
| 78 | 78 | parent::addAttributesToRender($writer); |
| 79 | - $writer->addAttribute('type','file'); |
|
| 80 | - $writer->addAttribute('name',$this->getUniqueID()); |
|
| 79 | + $writer->addAttribute('type', 'file'); |
|
| 80 | + $writer->addAttribute('name', $this->getUniqueID()); |
|
| 81 | 81 | $isEnabled=$this->getEnabled(true); |
| 82 | 82 | if(!$isEnabled && $this->getEnabled()) // in this case parent will not render 'disabled' |
| 83 | - $writer->addAttribute('disabled','disabled'); |
|
| 83 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | parent::onPreRender($param); |
| 94 | 94 | if(($form=$this->getPage()->getForm())!==null) |
| 95 | 95 | $form->setEnctype('multipart/form-data'); |
| 96 | - $this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE',$this->getMaxFileSize()); |
|
| 96 | + $this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE', $this->getMaxFileSize()); |
|
| 97 | 97 | if($this->getEnabled(true)) |
| 98 | 98 | $this->getPage()->registerRequiresPostData($this); |
| 99 | 99 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function getMaxFileSize() |
| 106 | 106 | { |
| 107 | - return $this->getViewState('MaxFileSize',self::MAX_FILE_SIZE); |
|
| 107 | + return $this->getViewState('MaxFileSize', self::MAX_FILE_SIZE); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function setMaxFileSize($size) |
| 119 | 119 | { |
| 120 | - $this->setViewState('MaxFileSize',TPropertyValue::ensureInteger($size),self::MAX_FILE_SIZE); |
|
| 120 | + $this->setViewState('MaxFileSize', TPropertyValue::ensureInteger($size), self::MAX_FILE_SIZE); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | * If true, you will not be able to save the uploaded file again. |
| 180 | 180 | * @return boolean true if the file saving is successful |
| 181 | 181 | */ |
| 182 | - public function saveAs($fileName,$deleteTempFile=true) |
|
| 182 | + public function saveAs($fileName, $deleteTempFile=true) |
|
| 183 | 183 | { |
| 184 | 184 | if($this->_errorCode===UPLOAD_ERR_OK) |
| 185 | 185 | { |
| 186 | 186 | if($deleteTempFile) |
| 187 | - return move_uploaded_file($this->_localName,$fileName); |
|
| 187 | + return move_uploaded_file($this->_localName, $fileName); |
|
| 188 | 188 | else if(is_uploaded_file($this->_localName)) |
| 189 | - return file_put_contents($fileName,file_get_contents($this->_localName))!==false; |
|
| 189 | + return file_put_contents($fileName, file_get_contents($this->_localName))!==false; |
|
| 190 | 190 | else |
| 191 | 191 | return false; |
| 192 | 192 | } |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | * @param array the input data collection |
| 202 | 202 | * @return boolean whether the data of the control has been changed |
| 203 | 203 | */ |
| 204 | - public function loadPostData($key,$values) |
|
| 204 | + public function loadPostData($key, $values) |
|
| 205 | 205 | { |
| 206 | 206 | if(isset($_FILES[$key])) |
| 207 | 207 | { |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function onFileUpload($param) |
| 237 | 237 | { |
| 238 | - $this->raiseEvent('OnFileUpload',$this,$param); |
|
| 238 | + $this->raiseEvent('OnFileUpload', $this, $param); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | - * @return Tells whether buffering of output can continue after this point |
|
| 52 | + * @return boolean whether buffering of output can continue after this point |
|
| 53 | 53 | */ |
| 54 | 54 | public function getContinueBuffering() |
| 55 | 55 | { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function __construct() |
| 46 | 46 | { |
| 47 | 47 | parent::__construct(); |
| 48 | - $this->EnableViewState = false; |
|
| 48 | + $this->EnableViewState=false; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function setContinueBuffering($value) |
| 63 | 63 | { |
| 64 | - $this->_continueBuffering = TPropertyValue::ensureBoolean($value); |
|
| 64 | + $this->_continueBuffering=TPropertyValue::ensureBoolean($value); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | //$writer->write('<!-- flush -->'); |
| 74 | 74 | // ajax responses can't be parsed by the client side before loaded and returned completely, |
| 75 | 75 | // so don't bother with flushing output somewhere mid-page if refreshing in a callback |
| 76 | - if (!$this->Page->IsCallback) |
|
| 76 | + if(!$this->Page->IsCallback) |
|
| 77 | 77 | { |
| 78 | 78 | $this->Page->flushWriter(); |
| 79 | 79 | // $this->Application->flushOutput($this->ContinueBuffering); |
@@ -422,6 +422,7 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | /** |
| 424 | 424 | * Parse additional options set in the Options property. |
| 425 | + * @param string $string |
|
| 425 | 426 | * @return array additional custom options |
| 426 | 427 | */ |
| 427 | 428 | protected function parseEditorOptions($string) |
@@ -446,6 +447,7 @@ discard block |
||
| 446 | 447 | } |
| 447 | 448 | |
| 448 | 449 | /** |
| 450 | + * @param string $culture |
|
| 449 | 451 | * @return string localized editor interface language extension. |
| 450 | 452 | */ |
| 451 | 453 | protected function getLanguageSuffix($culture) |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | /** |
| 61 | 61 | * @var array list of locale => language file pairs. |
| 62 | 62 | */ |
| 63 | - private static $_langs = array( |
|
| 63 | + private static $_langs=array( |
|
| 64 | 64 | 'ar' => 'ar', |
| 65 | 65 | 'bg_BG' => 'bg_BG', |
| 66 | 66 | 'bs' => 'bs', |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | /** |
| 119 | 119 | * @var array list of default plugins to load, override using getAvailablePlugins(); |
| 120 | 120 | */ |
| 121 | - private static $_plugins = array( |
|
| 121 | + private static $_plugins=array( |
|
| 122 | 122 | 'advlist', |
| 123 | 123 | 'anchor', |
| 124 | 124 | 'autolink', |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * @var array default themes to load |
| 164 | 164 | */ |
| 165 | - private static $_themes = array( |
|
| 165 | + private static $_themes=array( |
|
| 166 | 166 | 'modern', |
| 167 | 167 | ); |
| 168 | 168 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public function getEnableVisualEdit() |
| 211 | 211 | { |
| 212 | - return $this->getViewState('EnableVisualEdit',true); |
|
| 212 | + return $this->getViewState('EnableVisualEdit', true); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function setEnableVisualEdit($value) |
| 220 | 220 | { |
| 221 | - $this->setViewState('EnableVisualEdit',TPropertyValue::ensureBoolean($value),true); |
|
| 221 | + $this->setViewState('EnableVisualEdit', TPropertyValue::ensureBoolean($value), true); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | { |
| 304 | 304 | if($this->getEnableVisualEdit() && $this->getEnabled(true)) |
| 305 | 305 | { |
| 306 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 306 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 307 | 307 | $this->registerEditorClientScript($writer); |
| 308 | 308 | } |
| 309 | 309 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | |
| 339 | 339 | protected function loadJavascriptLibrary() |
| 340 | 340 | { |
| 341 | - $scripts = $this->getPage()->getClientScript(); |
|
| 341 | + $scripts=$this->getPage()->getClientScript(); |
|
| 342 | 342 | $scripts->registerPradoScript('htmlarea4'); |
| 343 | 343 | $scripts->registerScriptFile('prado:THtmlArea4', $this->getScriptUrl()); |
| 344 | 344 | } |
@@ -349,14 +349,14 @@ discard block |
||
| 349 | 349 | protected function registerEditorClientScript($writer) |
| 350 | 350 | { |
| 351 | 351 | $this->loadJavascriptLibrary(); |
| 352 | - $scripts = $this->getPage()->getClientScript(); |
|
| 353 | - $options = array( |
|
| 352 | + $scripts=$this->getPage()->getClientScript(); |
|
| 353 | + $options=array( |
|
| 354 | 354 | 'EditorOptions' => $this->getEditorOptions() |
| 355 | 355 | ); |
| 356 | 356 | |
| 357 | - $options = TJavaScript::encode($options,true,true); |
|
| 358 | - $script = "new {$this->getClientClassName()}($options)"; |
|
| 359 | - $scripts->registerEndScript('prado:THtmlArea4'.$this->ClientID,$script); |
|
| 357 | + $options=TJavaScript::encode($options, true, true); |
|
| 358 | + $script="new {$this->getClientClassName()}($options)"; |
|
| 359 | + $scripts->registerEndScript('prado:THtmlArea4'.$this->ClientID, $script); |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | /** |
@@ -373,19 +373,19 @@ discard block |
||
| 373 | 373 | */ |
| 374 | 374 | protected function getScriptDeploymentPath() |
| 375 | 375 | { |
| 376 | - $basedir = Prado::getPathOfNamespace('System.Web.Javascripts.source.tinymce-405'); |
|
| 377 | - $url = $this->getApplication()->getAssetManager()->publishFilePath($basedir); |
|
| 376 | + $basedir=Prado::getPathOfNamespace('System.Web.Javascripts.source.tinymce-405'); |
|
| 377 | + $url=$this->getApplication()->getAssetManager()->publishFilePath($basedir); |
|
| 378 | 378 | $this->copyCustomPlugins($url); |
| 379 | 379 | return $url; |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | protected function copyCustomPlugins($url) |
| 383 | 383 | { |
| 384 | - if($plugins = $this->getCustomPluginPath()) |
|
| 384 | + if($plugins=$this->getCustomPluginPath()) |
|
| 385 | 385 | { |
| 386 | - $assets = $this->getApplication()->getAssetManager(); |
|
| 387 | - $path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
| 388 | - $dest = $assets->getBasePath().'/'.basename($url).'/plugins/'; |
|
| 386 | + $assets=$this->getApplication()->getAssetManager(); |
|
| 387 | + $path=is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
| 388 | + $dest=$assets->getBasePath().'/'.basename($url).'/plugins/'; |
|
| 389 | 389 | if(!is_dir($dest) || $this->getApplication()->getMode()!==TApplicationMode::Performance) |
| 390 | 390 | $assets->copyDirectory($path, $dest); |
| 391 | 391 | } |
@@ -397,26 +397,26 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | protected function getEditorOptions() |
| 399 | 399 | { |
| 400 | - $options['mode'] = 'exact'; |
|
| 401 | - $options['elements'] = $this->getClientID(); |
|
| 402 | - $options['language'] = $this->getLanguageSuffix($this->getCulture()); |
|
| 400 | + $options['mode']='exact'; |
|
| 401 | + $options['elements']=$this->getClientID(); |
|
| 402 | + $options['language']=$this->getLanguageSuffix($this->getCulture()); |
|
| 403 | 403 | //$options['theme'] = 'modern'; //default |
| 404 | 404 | // mimic previous (tinyMCE3) sizing behaviour |
| 405 | - $options['width'] = $this->getWidth(); |
|
| 406 | - $options['height'] = $this->getHeight(); |
|
| 407 | - $options['resize'] = 'both'; |
|
| 408 | - $options['menubar'] = false; |
|
| 405 | + $options['width']=$this->getWidth(); |
|
| 406 | + $options['height']=$this->getHeight(); |
|
| 407 | + $options['resize']='both'; |
|
| 408 | + $options['menubar']=false; |
|
| 409 | 409 | if($this->getReadOnly()) |
| 410 | 410 | { |
| 411 | - $options['readonly'] = true; |
|
| 412 | - $options['toolbar'] = false; |
|
| 413 | - $options['menubar'] = false; |
|
| 414 | - $options['statusbar'] = false; |
|
| 411 | + $options['readonly']=true; |
|
| 412 | + $options['toolbar']=false; |
|
| 413 | + $options['menubar']=false; |
|
| 414 | + $options['statusbar']=false; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | - $options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'; |
|
| 417 | + $options['extended_valid_elements']='a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'; |
|
| 418 | 418 | |
| 419 | - $options = array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
| 419 | + $options=array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
| 420 | 420 | return $options; |
| 421 | 421 | } |
| 422 | 422 | |
@@ -426,20 +426,20 @@ discard block |
||
| 426 | 426 | */ |
| 427 | 427 | protected function parseEditorOptions($string) |
| 428 | 428 | { |
| 429 | - $options = array(); |
|
| 430 | - $substrings = preg_split('/,\s*\n|\n/', trim($string)); |
|
| 429 | + $options=array(); |
|
| 430 | + $substrings=preg_split('/,\s*\n|\n/', trim($string)); |
|
| 431 | 431 | foreach($substrings as $bits) |
| 432 | 432 | { |
| 433 | - $option = explode(":",$bits,2); |
|
| 433 | + $option=explode(":", $bits, 2); |
|
| 434 | 434 | |
| 435 | - if(count($option) == 2) |
|
| 435 | + if(count($option)==2) |
|
| 436 | 436 | { |
| 437 | - $value=trim(trim($option[1]),"'\""); |
|
| 438 | - if (($s=strtolower($value))==='false') |
|
| 437 | + $value=trim(trim($option[1]), "'\""); |
|
| 438 | + if(($s=strtolower($value))==='false') |
|
| 439 | 439 | $value=false; |
| 440 | - elseif ($s==='true') |
|
| 440 | + elseif($s==='true') |
|
| 441 | 441 | $value=true; |
| 442 | - $options[trim($option[0])] = $value; |
|
| 442 | + $options[trim($option[0])]=$value; |
|
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | return $options; |
@@ -450,12 +450,12 @@ discard block |
||
| 450 | 450 | */ |
| 451 | 451 | protected function getLanguageSuffix($culture) |
| 452 | 452 | { |
| 453 | - $app = $this->getApplication()->getGlobalization(); |
|
| 453 | + $app=$this->getApplication()->getGlobalization(); |
|
| 454 | 454 | if(empty($culture) && ($app!==null)) |
| 455 | - $culture = $app->getCulture(); |
|
| 456 | - $variants = array(); |
|
| 455 | + $culture=$app->getCulture(); |
|
| 456 | + $variants=array(); |
|
| 457 | 457 | if($app!==null) |
| 458 | - $variants = $app->getCultureVariants($culture); |
|
| 458 | + $variants=$app->getCultureVariants($culture); |
|
| 459 | 459 | |
| 460 | 460 | foreach($variants as $variant) |
| 461 | 461 | { |
@@ -147,6 +147,7 @@ discard block |
||
| 147 | 147 | /** |
| 148 | 148 | * Sets the height of the image in the THyperLink |
| 149 | 149 | * @param string height of the image in the THyperLink |
| 150 | + * @param string $value |
|
| 150 | 151 | */ |
| 151 | 152 | public function setImageHeight($value) |
| 152 | 153 | { |
@@ -181,6 +182,7 @@ discard block |
||
| 181 | 182 | /** |
| 182 | 183 | * Sets the width of the image in the THyperLink |
| 183 | 184 | * @param string width of the image |
| 185 | + * @param string $value |
|
| 184 | 186 | */ |
| 185 | 187 | public function setImageWidth($value) |
| 186 | 188 | { |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | if ($this->sourcepath === NULL) |
| 59 | 59 | { |
| 60 | 60 | $this->sourcepath = $sourcepath; |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $this->sourcepath->append($sourcepath); |
| 65 | 64 | } |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $isEnabled=$this->getEnabled(true); |
| 48 | 48 | if($this->getEnabled() && !$isEnabled) |
| 49 | - $writer->addAttribute('disabled','disabled'); |
|
| 49 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 50 | 50 | parent::addAttributesToRender($writer); |
| 51 | 51 | if(($url=$this->getNavigateUrl())!=='' && $isEnabled) |
| 52 | - $writer->addAttribute('href',$url); |
|
| 52 | + $writer->addAttribute('href', $url); |
|
| 53 | 53 | if(($target=$this->getTarget())!=='') |
| 54 | - $writer->addAttribute('target',$target); |
|
| 54 | + $writer->addAttribute('target', $target); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function getText() |
| 106 | 106 | { |
| 107 | - return $this->getViewState('Text',''); |
|
| 107 | + return $this->getViewState('Text', ''); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function setText($value) |
| 115 | 115 | { |
| 116 | - $this->setViewState('Text',$value,''); |
|
| 116 | + $this->setViewState('Text', $value, ''); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function getImageAlign() |
| 123 | 123 | { |
| 124 | - return $this->getViewState('ImageAlign',''); |
|
| 124 | + return $this->getViewState('ImageAlign', ''); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function setImageAlign($value) |
| 135 | 135 | { |
| 136 | - $this->setViewState('ImageAlign',$value,''); |
|
| 136 | + $this->setViewState('ImageAlign', $value, ''); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function getImageHeight() |
| 143 | 143 | { |
| 144 | - return $this->getViewState('ImageHeight',''); |
|
| 144 | + return $this->getViewState('ImageHeight', ''); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function setImageHeight($value) |
| 152 | 152 | { |
| 153 | - $this->setViewSTate('ImageHeight',$value,''); |
|
| 153 | + $this->setViewSTate('ImageHeight', $value, ''); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function getImageUrl() |
| 160 | 160 | { |
| 161 | - return $this->getViewState('ImageUrl',''); |
|
| 161 | + return $this->getViewState('ImageUrl', ''); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | public function setImageUrl($value) |
| 169 | 169 | { |
| 170 | - $this->setViewState('ImageUrl',$value,''); |
|
| 170 | + $this->setViewState('ImageUrl', $value, ''); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function getImageWidth() |
| 177 | 177 | { |
| 178 | - return $this->getViewState('ImageWidth',''); |
|
| 178 | + return $this->getViewState('ImageWidth', ''); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function setImageWidth($value) |
| 186 | 186 | { |
| 187 | - $this->setViewState('ImageWidth',$value,''); |
|
| 187 | + $this->setViewState('ImageWidth', $value, ''); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function getNavigateUrl() |
| 194 | 194 | { |
| 195 | - return $this->getViewState('NavigateUrl',''); |
|
| 195 | + return $this->getViewState('NavigateUrl', ''); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function setNavigateUrl($value) |
| 203 | 203 | { |
| 204 | - $this->setViewState('NavigateUrl',$value,''); |
|
| 204 | + $this->setViewState('NavigateUrl', $value, ''); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function getTarget() |
| 237 | 237 | { |
| 238 | - return $this->getViewState('Target',''); |
|
| 238 | + return $this->getViewState('Target', ''); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | public function setTarget($value) |
| 246 | 246 | { |
| 247 | - $this->setViewState('Target',$value,''); |
|
| 247 | + $this->setViewState('Target', $value, ''); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
@@ -212,6 +212,7 @@ discard block |
||
| 212 | 212 | * If you override this method, be sure to call the parent implementation |
| 213 | 213 | * so that the event handler can be invoked. |
| 214 | 214 | * @param TImageMapEventParameter event parameter to be passed to the event handlers |
| 215 | + * @param TImageMapEventParameter $param |
|
| 215 | 216 | */ |
| 216 | 217 | public function onClick($param) |
| 217 | 218 | { |
@@ -303,6 +304,7 @@ discard block |
||
| 303 | 304 | * that must be kept in viewstate. |
| 304 | 305 | * @param string the name of the viewstate value to be returned |
| 305 | 306 | * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned |
| 307 | + * @param string $key |
|
| 306 | 308 | * @return mixed the viewstate value corresponding to $key |
| 307 | 309 | */ |
| 308 | 310 | protected function getViewState($key,$defaultValue=null) |
@@ -319,6 +321,7 @@ discard block |
||
| 319 | 321 | * @param string the name of the viewstate value |
| 320 | 322 | * @param mixed the viewstate value to be set |
| 321 | 323 | * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate. |
| 324 | + * @param string $key |
|
| 322 | 325 | */ |
| 323 | 326 | protected function setViewState($key,$value,$defaultValue=null) |
| 324 | 327 | { |
@@ -59,13 +59,13 @@ discard block |
||
| 59 | 59 | protected function addAttributesToRender($writer) |
| 60 | 60 | { |
| 61 | 61 | parent::addAttributesToRender($writer); |
| 62 | - if($this->getHotSpots()->getCount()>0) |
|
| 62 | + if($this->getHotSpots()->getCount() > 0) |
|
| 63 | 63 | { |
| 64 | - $writer->addAttribute('usemap','#'.self::MAP_NAME_PREFIX.$this->getClientID()); |
|
| 65 | - $writer->addAttribute('id',$this->getUniqueID()); |
|
| 64 | + $writer->addAttribute('usemap', '#'.self::MAP_NAME_PREFIX.$this->getClientID()); |
|
| 65 | + $writer->addAttribute('id', $this->getUniqueID()); |
|
| 66 | 66 | } |
| 67 | 67 | if($this->getEnabled() && !$this->getEnabled(true)) |
| 68 | - $writer->addAttribute('disabled','disabled'); |
|
| 68 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -78,20 +78,20 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $hotspots=$this->getHotSpots(); |
| 80 | 80 | |
| 81 | - if($hotspots->getCount()>0) |
|
| 81 | + if($hotspots->getCount() > 0) |
|
| 82 | 82 | { |
| 83 | 83 | $clientID=$this->getClientID(); |
| 84 | 84 | $cs=$this->getPage()->getClientScript(); |
| 85 | 85 | $writer->writeLine(); |
| 86 | - $writer->addAttribute('name',self::MAP_NAME_PREFIX.$clientID); |
|
| 86 | + $writer->addAttribute('name', self::MAP_NAME_PREFIX.$clientID); |
|
| 87 | 87 | $writer->renderBeginTag('map'); |
| 88 | 88 | $writer->writeLine(); |
| 89 | 89 | if(($mode=$this->getHotSpotMode())===THotSpotMode::NotSet) |
| 90 | 90 | $mode=THotSpotMode::Navigate; |
| 91 | 91 | $target=$this->getTarget(); |
| 92 | 92 | $i=0; |
| 93 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 94 | - $options['StopEvent'] = true; |
|
| 93 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 94 | + $options['StopEvent']=true; |
|
| 95 | 95 | $cs=$this->getPage()->getClientScript(); |
| 96 | 96 | foreach($hotspots as $hotspot) |
| 97 | 97 | { |
@@ -102,13 +102,13 @@ discard block |
||
| 102 | 102 | if($hotspot->getHotSpotMode()===THotSpotMode::PostBack) |
| 103 | 103 | { |
| 104 | 104 | $id=$clientID.'_'.$i; |
| 105 | - $writer->addAttribute('id',$id); |
|
| 106 | - $writer->addAttribute('href','#'.$id); //create unique no-op url references |
|
| 105 | + $writer->addAttribute('id', $id); |
|
| 106 | + $writer->addAttribute('href', '#'.$id); //create unique no-op url references |
|
| 107 | 107 | $options['ID']=$id; |
| 108 | 108 | $options['EventParameter']="$i"; |
| 109 | 109 | $options['CausesValidation']=$hotspot->getCausesValidation(); |
| 110 | 110 | $options['ValidationGroup']=$hotspot->getValidationGroup(); |
| 111 | - $cs->registerPostBackControl($this->getClientClassName(),$options); |
|
| 111 | + $cs->registerPostBackControl($this->getClientClassName(), $options); |
|
| 112 | 112 | } |
| 113 | 113 | $hotspot->render($writer); |
| 114 | 114 | $writer->writeLine(); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | { |
| 142 | 142 | $index=TPropertyValue::ensureInteger($param); |
| 143 | 143 | $hotspots=$this->getHotSpots(); |
| 144 | - if($index>=0 && $index<$hotspots->getCount()) |
|
| 144 | + if($index >= 0 && $index < $hotspots->getCount()) |
|
| 145 | 145 | { |
| 146 | 146 | $hotspot=$hotspots->itemAt($index); |
| 147 | 147 | if(($mode=$hotspot->getHotSpotMode())===THotSpotMode::NotSet) |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function getHotSpotMode() |
| 165 | 165 | { |
| 166 | - return $this->getViewState('HotSpotMode',THotSpotMode::NotSet); |
|
| 166 | + return $this->getViewState('HotSpotMode', THotSpotMode::NotSet); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | public function setHotSpotMode($value) |
| 176 | 176 | { |
| 177 | - $this->setViewState('HotSpotMode',TPropertyValue::ensureEnum($value,'THotSpotMode'),THotSpotMode::NotSet); |
|
| 177 | + $this->setViewState('HotSpotMode', TPropertyValue::ensureEnum($value, 'THotSpotMode'), THotSpotMode::NotSet); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -182,10 +182,10 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public function getHotSpots() |
| 184 | 184 | { |
| 185 | - if(($hotspots=$this->getViewState('HotSpots',null))===null) |
|
| 185 | + if(($hotspots=$this->getViewState('HotSpots', null))===null) |
|
| 186 | 186 | { |
| 187 | 187 | $hotspots=new THotSpotCollection; |
| 188 | - $this->setViewState('HotSpots',$hotspots); |
|
| 188 | + $this->setViewState('HotSpots', $hotspots); |
|
| 189 | 189 | } |
| 190 | 190 | return $hotspots; |
| 191 | 191 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | public function getTarget() |
| 197 | 197 | { |
| 198 | - return $this->getViewState('Target',''); |
|
| 198 | + return $this->getViewState('Target', ''); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | public function setTarget($value) |
| 205 | 205 | { |
| 206 | - $this->setViewState('Target',TPropertyValue::ensureString($value),''); |
|
| 206 | + $this->setViewState('Target', TPropertyValue::ensureString($value), ''); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /** |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function onClick($param) |
| 217 | 217 | { |
| 218 | - $this->raiseEvent('OnClick',$this,$param); |
|
| 218 | + $this->raiseEvent('OnClick', $this, $param); |
|
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | * @param mixed new item |
| 272 | 272 | * @throws TInvalidDataTypeException if the item to be inserted is not a THotSpot. |
| 273 | 273 | */ |
| 274 | - public function insertAt($index,$item) |
|
| 274 | + public function insertAt($index, $item) |
|
| 275 | 275 | { |
| 276 | 276 | if($item instanceof THotSpot) |
| 277 | - parent::insertAt($index,$item); |
|
| 277 | + parent::insertAt($index, $item); |
|
| 278 | 278 | else |
| 279 | 279 | throw new TInvalidDataTypeException('hotspotcollection_hotspot_required'); |
| 280 | 280 | } |
@@ -305,9 +305,9 @@ discard block |
||
| 305 | 305 | * @param mixed the default value. If $key is not found in viewstate, $defaultValue will be returned |
| 306 | 306 | * @return mixed the viewstate value corresponding to $key |
| 307 | 307 | */ |
| 308 | - protected function getViewState($key,$defaultValue=null) |
|
| 308 | + protected function getViewState($key, $defaultValue=null) |
|
| 309 | 309 | { |
| 310 | - return isset($this->_viewState[$key])?$this->_viewState[$key]:$defaultValue; |
|
| 310 | + return isset($this->_viewState[$key]) ? $this->_viewState[$key] : $defaultValue; |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * @param mixed the viewstate value to be set |
| 321 | 321 | * @param mixed default value. If $value===$defaultValue, the item will be cleared from the viewstate. |
| 322 | 322 | */ |
| 323 | - protected function setViewState($key,$value,$defaultValue=null) |
|
| 323 | + protected function setViewState($key, $value, $defaultValue=null) |
|
| 324 | 324 | { |
| 325 | 325 | if($value===$defaultValue) |
| 326 | 326 | unset($this->_viewState[$key]); |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | public function getAccessKey() |
| 344 | 344 | { |
| 345 | - return $this->getViewState('AccessKey',''); |
|
| 345 | + return $this->getViewState('AccessKey', ''); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | */ |
| 351 | 351 | public function setAccessKey($value) |
| 352 | 352 | { |
| 353 | - $this->setViewState('AccessKey',TPropertyValue::ensureString($value),''); |
|
| 353 | + $this->setViewState('AccessKey', TPropertyValue::ensureString($value), ''); |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /** |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | public function getAlternateText() |
| 360 | 360 | { |
| 361 | - return $this->getViewState('AlternateText',''); |
|
| 361 | + return $this->getViewState('AlternateText', ''); |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | /** |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | */ |
| 367 | 367 | public function setAlternateText($value) |
| 368 | 368 | { |
| 369 | - $this->setViewState('AlternateText',TPropertyValue::ensureString($value),''); |
|
| 369 | + $this->setViewState('AlternateText', TPropertyValue::ensureString($value), ''); |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /** |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | public function getHotSpotMode() |
| 376 | 376 | { |
| 377 | - return $this->getViewState('HotSpotMode',THotSpotMode::NotSet); |
|
| 377 | + return $this->getViewState('HotSpotMode', THotSpotMode::NotSet); |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /** |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | */ |
| 383 | 383 | public function setHotSpotMode($value) |
| 384 | 384 | { |
| 385 | - $this->setViewState('HotSpotMode',TPropertyValue::ensureEnum($value,'THotSpotMode'),THotSpotMode::NotSet); |
|
| 385 | + $this->setViewState('HotSpotMode', TPropertyValue::ensureEnum($value, 'THotSpotMode'), THotSpotMode::NotSet); |
|
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /** |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | */ |
| 391 | 391 | public function getNavigateUrl() |
| 392 | 392 | { |
| 393 | - return $this->getViewState('NavigateUrl',''); |
|
| 393 | + return $this->getViewState('NavigateUrl', ''); |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | /** |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | public function setNavigateUrl($value) |
| 400 | 400 | { |
| 401 | - $this->setViewState('NavigateUrl',TPropertyValue::ensureString($value),''); |
|
| 401 | + $this->setViewState('NavigateUrl', TPropertyValue::ensureString($value), ''); |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | /** |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | public function getPostBackValue() |
| 408 | 408 | { |
| 409 | - return $this->getViewState('PostBackValue',''); |
|
| 409 | + return $this->getViewState('PostBackValue', ''); |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | /** |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | public function setPostBackValue($value) |
| 416 | 416 | { |
| 417 | - $this->setViewState('PostBackValue',TPropertyValue::ensureString($value),''); |
|
| 417 | + $this->setViewState('PostBackValue', TPropertyValue::ensureString($value), ''); |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | */ |
| 423 | 423 | public function getTabIndex() |
| 424 | 424 | { |
| 425 | - return $this->getViewState('TabIndex',0); |
|
| 425 | + return $this->getViewState('TabIndex', 0); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | /** |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | */ |
| 431 | 431 | public function setTabIndex($value) |
| 432 | 432 | { |
| 433 | - $this->setViewState('TabIndex',TPropertyValue::ensureInteger($value),0); |
|
| 433 | + $this->setViewState('TabIndex', TPropertyValue::ensureInteger($value), 0); |
|
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | /** |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | public function getCausesValidation() |
| 440 | 440 | { |
| 441 | - return $this->getViewState('CausesValidation',true); |
|
| 441 | + return $this->getViewState('CausesValidation', true); |
|
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | /** |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | */ |
| 447 | 447 | public function setCausesValidation($value) |
| 448 | 448 | { |
| 449 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
| 449 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | /** |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | public function getValidationGroup() |
| 456 | 456 | { |
| 457 | - return $this->getViewState('ValidationGroup',''); |
|
| 457 | + return $this->getViewState('ValidationGroup', ''); |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /** |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | */ |
| 463 | 463 | public function setValidationGroup($value) |
| 464 | 464 | { |
| 465 | - $this->setViewState('ValidationGroup',$value,''); |
|
| 465 | + $this->setViewState('ValidationGroup', $value, ''); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | /** |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | */ |
| 472 | 472 | public function getTarget() |
| 473 | 473 | { |
| 474 | - return $this->getViewState('Target',''); |
|
| 474 | + return $this->getViewState('Target', ''); |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | /** |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | */ |
| 481 | 481 | public function setTarget($value) |
| 482 | 482 | { |
| 483 | - $this->setViewState('Target',TPropertyValue::ensureString($value),''); |
|
| 483 | + $this->setViewState('Target', TPropertyValue::ensureString($value), ''); |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /** |
@@ -488,8 +488,8 @@ discard block |
||
| 488 | 488 | */ |
| 489 | 489 | public function getHasAttributes() |
| 490 | 490 | { |
| 491 | - if($attributes=$this->getViewState('Attributes',null)) |
|
| 492 | - return $attributes->getCount()>0; |
|
| 491 | + if($attributes=$this->getViewState('Attributes', null)) |
|
| 492 | + return $attributes->getCount() > 0; |
|
| 493 | 493 | else |
| 494 | 494 | return false; |
| 495 | 495 | } |
@@ -502,12 +502,12 @@ discard block |
||
| 502 | 502 | */ |
| 503 | 503 | public function getAttributes() |
| 504 | 504 | { |
| 505 | - if($attributes=$this->getViewState('Attributes',null)) |
|
| 505 | + if($attributes=$this->getViewState('Attributes', null)) |
|
| 506 | 506 | return $attributes; |
| 507 | 507 | else |
| 508 | 508 | { |
| 509 | 509 | $attributes=new TAttributeCollection; |
| 510 | - $this->setViewState('Attributes',$attributes,null); |
|
| 510 | + $this->setViewState('Attributes', $attributes, null); |
|
| 511 | 511 | return $attributes; |
| 512 | 512 | } |
| 513 | 513 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | */ |
| 518 | 518 | public function hasAttribute($name) |
| 519 | 519 | { |
| 520 | - if($attributes=$this->getViewState('Attributes',null)) |
|
| 520 | + if($attributes=$this->getViewState('Attributes', null)) |
|
| 521 | 521 | return $attributes->contains($name); |
| 522 | 522 | else |
| 523 | 523 | return false; |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | */ |
| 529 | 529 | public function getAttribute($name) |
| 530 | 530 | { |
| 531 | - if($attributes=$this->getViewState('Attributes',null)) |
|
| 531 | + if($attributes=$this->getViewState('Attributes', null)) |
|
| 532 | 532 | return $attributes->itemAt($name); |
| 533 | 533 | else |
| 534 | 534 | return null; |
@@ -539,9 +539,9 @@ discard block |
||
| 539 | 539 | * @param string attribute name |
| 540 | 540 | * @param string value of the attribute |
| 541 | 541 | */ |
| 542 | - public function setAttribute($name,$value) |
|
| 542 | + public function setAttribute($name, $value) |
|
| 543 | 543 | { |
| 544 | - $this->getAttributes()->add($name,$value); |
|
| 544 | + $this->getAttributes()->add($name, $value); |
|
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | /** |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | public function removeAttribute($name) |
| 553 | 553 | { |
| 554 | - if($attributes=$this->getViewState('Attributes',null)) |
|
| 554 | + if($attributes=$this->getViewState('Attributes', null)) |
|
| 555 | 555 | return $attributes->remove($name); |
| 556 | 556 | else |
| 557 | 557 | return null; |
@@ -563,29 +563,29 @@ discard block |
||
| 563 | 563 | */ |
| 564 | 564 | public function render($writer) |
| 565 | 565 | { |
| 566 | - $writer->addAttribute('shape',$this->getShape()); |
|
| 567 | - $writer->addAttribute('coords',$this->getCoordinates()); |
|
| 566 | + $writer->addAttribute('shape', $this->getShape()); |
|
| 567 | + $writer->addAttribute('coords', $this->getCoordinates()); |
|
| 568 | 568 | if(($mode=$this->getHotSpotMode())===THotSpotMode::NotSet) |
| 569 | 569 | $mode=THotSpotMode::Navigate; |
| 570 | 570 | if($mode===THotSpotMode::Navigate) |
| 571 | 571 | { |
| 572 | - $writer->addAttribute('href',$this->getNavigateUrl()); |
|
| 572 | + $writer->addAttribute('href', $this->getNavigateUrl()); |
|
| 573 | 573 | if(($target=$this->getTarget())!=='') |
| 574 | - $writer->addAttribute('target',$target); |
|
| 574 | + $writer->addAttribute('target', $target); |
|
| 575 | 575 | } |
| 576 | 576 | else if($mode===THotSpotMode::Inactive) |
| 577 | - $writer->addAttribute('nohref','true'); |
|
| 577 | + $writer->addAttribute('nohref', 'true'); |
|
| 578 | 578 | $text=$this->getAlternateText(); |
| 579 | - $writer->addAttribute('title',$text); |
|
| 580 | - $writer->addAttribute('alt',$text); |
|
| 579 | + $writer->addAttribute('title', $text); |
|
| 580 | + $writer->addAttribute('alt', $text); |
|
| 581 | 581 | if(($accessKey=$this->getAccessKey())!=='') |
| 582 | - $writer->addAttribute('accesskey',$accessKey); |
|
| 582 | + $writer->addAttribute('accesskey', $accessKey); |
|
| 583 | 583 | if(($tabIndex=$this->getTabIndex())!==0) |
| 584 | - $writer->addAttribute('tabindex',"$tabIndex"); |
|
| 584 | + $writer->addAttribute('tabindex', "$tabIndex"); |
|
| 585 | 585 | if($this->getHasAttributes()) |
| 586 | 586 | { |
| 587 | 587 | foreach($this->getAttributes() as $name=>$value) |
| 588 | - $writer->addAttribute($name,$value); |
|
| 588 | + $writer->addAttribute($name, $value); |
|
| 589 | 589 | } |
| 590 | 590 | $writer->renderBeginTag('area'); |
| 591 | 591 | $writer->renderEndTag(); |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | */ |
| 626 | 626 | public function getRadius() |
| 627 | 627 | { |
| 628 | - return $this->getViewState('Radius',0); |
|
| 628 | + return $this->getViewState('Radius', 0); |
|
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | /** |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | */ |
| 634 | 634 | public function setRadius($value) |
| 635 | 635 | { |
| 636 | - $this->setViewState('Radius',TPropertyValue::ensureInteger($value),0); |
|
| 636 | + $this->setViewState('Radius', TPropertyValue::ensureInteger($value), 0); |
|
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | /** |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | */ |
| 642 | 642 | public function getX() |
| 643 | 643 | { |
| 644 | - return $this->getViewState('X',0); |
|
| 644 | + return $this->getViewState('X', 0); |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | /** |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | */ |
| 650 | 650 | public function setX($value) |
| 651 | 651 | { |
| 652 | - $this->setViewState('X',TPropertyValue::ensureInteger($value),0); |
|
| 652 | + $this->setViewState('X', TPropertyValue::ensureInteger($value), 0); |
|
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | /** |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | */ |
| 658 | 658 | public function getY() |
| 659 | 659 | { |
| 660 | - return $this->getViewState('Y',0); |
|
| 660 | + return $this->getViewState('Y', 0); |
|
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | /** |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | */ |
| 666 | 666 | public function setY($value) |
| 667 | 667 | { |
| 668 | - $this->setViewState('Y',TPropertyValue::ensureInteger($value),0); |
|
| 668 | + $this->setViewState('Y', TPropertyValue::ensureInteger($value), 0); |
|
| 669 | 669 | } |
| 670 | 670 | } |
| 671 | 671 | |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | */ |
| 703 | 703 | public function getBottom() |
| 704 | 704 | { |
| 705 | - return $this->getViewState('Bottom',0); |
|
| 705 | + return $this->getViewState('Bottom', 0); |
|
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | /** |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | */ |
| 711 | 711 | public function setBottom($value) |
| 712 | 712 | { |
| 713 | - $this->setViewState('Bottom',TPropertyValue::ensureInteger($value),0); |
|
| 713 | + $this->setViewState('Bottom', TPropertyValue::ensureInteger($value), 0); |
|
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | /** |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | */ |
| 719 | 719 | public function getLeft() |
| 720 | 720 | { |
| 721 | - return $this->getViewState('Left',0); |
|
| 721 | + return $this->getViewState('Left', 0); |
|
| 722 | 722 | } |
| 723 | 723 | |
| 724 | 724 | /** |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | */ |
| 727 | 727 | public function setLeft($value) |
| 728 | 728 | { |
| 729 | - $this->setViewState('Left',TPropertyValue::ensureInteger($value),0); |
|
| 729 | + $this->setViewState('Left', TPropertyValue::ensureInteger($value), 0); |
|
| 730 | 730 | } |
| 731 | 731 | |
| 732 | 732 | /** |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | */ |
| 735 | 735 | public function getRight() |
| 736 | 736 | { |
| 737 | - return $this->getViewState('Right',0); |
|
| 737 | + return $this->getViewState('Right', 0); |
|
| 738 | 738 | } |
| 739 | 739 | |
| 740 | 740 | /** |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | */ |
| 743 | 743 | public function setRight($value) |
| 744 | 744 | { |
| 745 | - $this->setViewState('Right',TPropertyValue::ensureInteger($value),0); |
|
| 745 | + $this->setViewState('Right', TPropertyValue::ensureInteger($value), 0); |
|
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | /** |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | */ |
| 751 | 751 | public function getTop() |
| 752 | 752 | { |
| 753 | - return $this->getViewState('Top',0); |
|
| 753 | + return $this->getViewState('Top', 0); |
|
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | /** |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | */ |
| 759 | 759 | public function setTop($value) |
| 760 | 760 | { |
| 761 | - $this->setViewState('Top',TPropertyValue::ensureInteger($value),0); |
|
| 761 | + $this->setViewState('Top', TPropertyValue::ensureInteger($value), 0); |
|
| 762 | 762 | } |
| 763 | 763 | } |
| 764 | 764 | |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | */ |
| 790 | 790 | public function getCoordinates() |
| 791 | 791 | { |
| 792 | - return $this->getViewState('Coordinates',''); |
|
| 792 | + return $this->getViewState('Coordinates', ''); |
|
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | /** |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | */ |
| 800 | 800 | public function setCoordinates($value) |
| 801 | 801 | { |
| 802 | - $this->setViewState('Coordinates',$value,''); |
|
| 802 | + $this->setViewState('Coordinates', $value, ''); |
|
| 803 | 803 | } |
| 804 | 804 | } |
| 805 | 805 | |
@@ -572,8 +572,7 @@ |
||
| 572 | 572 | $writer->addAttribute('href',$this->getNavigateUrl()); |
| 573 | 573 | if(($target=$this->getTarget())!=='') |
| 574 | 574 | $writer->addAttribute('target',$target); |
| 575 | - } |
|
| 576 | - else if($mode===THotSpotMode::Inactive) |
|
| 575 | + } else if($mode===THotSpotMode::Inactive) |
|
| 577 | 576 | $writer->addAttribute('nohref','true'); |
| 578 | 577 | $text=$this->getAlternateText(); |
| 579 | 578 | $writer->addAttribute('title',$text); |