Code Duplication    Length = 8-8 lines in 26 locations

framework/Web/UI/WebControls/TDataGrid.php 10 locations

@@ 304-311 (lines=8) @@
301
	/**
302
	 * @return TTableItemStyle the style for every item
303
	 */
304
	public function getItemStyle()
305
	{
306
		if (($style = $this->getViewState('ItemStyle', null)) === null) {
307
			$style = new TTableItemStyle;
308
			$this->setViewState('ItemStyle', $style, null);
309
		}
310
		return $style;
311
	}
312
313
	/**
314
	 * @return TTableItemStyle the style for each alternating item
@@ 316-323 (lines=8) @@
313
	/**
314
	 * @return TTableItemStyle the style for each alternating item
315
	 */
316
	public function getAlternatingItemStyle()
317
	{
318
		if (($style = $this->getViewState('AlternatingItemStyle', null)) === null) {
319
			$style = new TTableItemStyle;
320
			$this->setViewState('AlternatingItemStyle', $style, null);
321
		}
322
		return $style;
323
	}
324
325
	/**
326
	 * @return TTableItemStyle the style for selected item
@@ 328-335 (lines=8) @@
325
	/**
326
	 * @return TTableItemStyle the style for selected item
327
	 */
328
	public function getSelectedItemStyle()
329
	{
330
		if (($style = $this->getViewState('SelectedItemStyle', null)) === null) {
331
			$style = new TTableItemStyle;
332
			$this->setViewState('SelectedItemStyle', $style, null);
333
		}
334
		return $style;
335
	}
336
337
	/**
338
	 * @return TTableItemStyle the style for edit item
@@ 340-347 (lines=8) @@
337
	/**
338
	 * @return TTableItemStyle the style for edit item
339
	 */
340
	public function getEditItemStyle()
341
	{
342
		if (($style = $this->getViewState('EditItemStyle', null)) === null) {
343
			$style = new TTableItemStyle;
344
			$this->setViewState('EditItemStyle', $style, null);
345
		}
346
		return $style;
347
	}
348
349
	/**
350
	 * @return TTableItemStyle the style for header
@@ 352-359 (lines=8) @@
349
	/**
350
	 * @return TTableItemStyle the style for header
351
	 */
352
	public function getHeaderStyle()
353
	{
354
		if (($style = $this->getViewState('HeaderStyle', null)) === null) {
355
			$style = new TTableItemStyle;
356
			$this->setViewState('HeaderStyle', $style, null);
357
		}
358
		return $style;
359
	}
360
361
	/**
362
	 * @return TTableItemStyle the style for footer
@@ 364-371 (lines=8) @@
361
	/**
362
	 * @return TTableItemStyle the style for footer
363
	 */
364
	public function getFooterStyle()
365
	{
366
		if (($style = $this->getViewState('FooterStyle', null)) === null) {
367
			$style = new TTableItemStyle;
368
			$this->setViewState('FooterStyle', $style, null);
369
		}
370
		return $style;
371
	}
372
373
	/**
374
	 * @return TDataGridPagerStyle the style for pager
@@ 376-383 (lines=8) @@
373
	/**
374
	 * @return TDataGridPagerStyle the style for pager
375
	 */
376
	public function getPagerStyle()
377
	{
378
		if (($style = $this->getViewState('PagerStyle', null)) === null) {
379
			$style = new TDataGridPagerStyle;
380
			$this->setViewState('PagerStyle', $style, null);
381
		}
382
		return $style;
383
	}
384
385
	/**
386
	 * @return TStyle the style for thead element, if any
@@ 389-396 (lines=8) @@
386
	 * @return TStyle the style for thead element, if any
387
	 * @since 3.1.1
388
	 */
389
	public function getTableHeadStyle()
390
	{
391
		if (($style = $this->getViewState('TableHeadStyle', null)) === null) {
392
			$style = new TStyle;
393
			$this->setViewState('TableHeadStyle', $style, null);
394
		}
395
		return $style;
396
	}
397
398
	/**
399
	 * @return TStyle the style for tbody element, if any
@@ 402-409 (lines=8) @@
399
	 * @return TStyle the style for tbody element, if any
400
	 * @since 3.1.1
401
	 */
402
	public function getTableBodyStyle()
403
	{
404
		if (($style = $this->getViewState('TableBodyStyle', null)) === null) {
405
			$style = new TStyle;
406
			$this->setViewState('TableBodyStyle', $style, null);
407
		}
408
		return $style;
409
	}
410
411
	/**
412
	 * @return TStyle the style for tfoot element, if any
@@ 415-422 (lines=8) @@
412
	 * @return TStyle the style for tfoot element, if any
413
	 * @since 3.1.1
414
	 */
415
	public function getTableFootStyle()
416
	{
417
		if (($style = $this->getViewState('TableFootStyle', null)) === null) {
418
			$style = new TStyle;
419
			$this->setViewState('TableFootStyle', $style, null);
420
		}
421
		return $style;
422
	}
423
424
	/**
425
	 * @return string caption for the datagrid

framework/Web/UI/WebControls/TDataGridColumn.php 3 locations

@@ 158-165 (lines=8) @@
155
	 * @param bool $createStyle whether to create a style if previously not existing
156
	 * @return TTableItemStyle the style for header
157
	 */
158
	public function getHeaderStyle($createStyle = true)
159
	{
160
		if (($style = $this->getViewState('HeaderStyle', null)) === null && $createStyle) {
161
			$style = new TTableItemStyle;
162
			$this->setViewState('HeaderStyle', $style, null);
163
		}
164
		return $style;
165
	}
166
167
	/**
168
	 * @return string the text to be displayed in the footer of this column
@@ 211-218 (lines=8) @@
208
	 * @param bool $createStyle whether to create a style if previously not existing
209
	 * @return TTableItemStyle the style for footer
210
	 */
211
	public function getFooterStyle($createStyle = true)
212
	{
213
		if (($style = $this->getViewState('FooterStyle', null)) === null && $createStyle) {
214
			$style = new TTableItemStyle;
215
			$this->setViewState('FooterStyle', $style, null);
216
		}
217
		return $style;
218
	}
219
220
	/**
221
	 * @param bool $createStyle whether to create a style if previously not existing
@@ 224-231 (lines=8) @@
221
	 * @param bool $createStyle whether to create a style if previously not existing
222
	 * @return TTableItemStyle the style for item
223
	 */
224
	public function getItemStyle($createStyle = true)
225
	{
226
		if (($style = $this->getViewState('ItemStyle', null)) === null && $createStyle) {
227
			$style = new TTableItemStyle;
228
			$this->setViewState('ItemStyle', $style, null);
229
		}
230
		return $style;
231
	}
232
233
	/**
234
	 * @return string the name of the field or expression for sorting

framework/Web/UI/WebControls/TDataList.php 7 locations

@@ 423-430 (lines=8) @@
420
	/**
421
	 * @return TTableItemStyle the style for item
422
	 */
423
	public function getItemStyle()
424
	{
425
		if (($style = $this->getViewState('ItemStyle', null)) === null) {
426
			$style = new TTableItemStyle;
427
			$this->setViewState('ItemStyle', $style, null);
428
		}
429
		return $style;
430
	}
431
432
	/**
433
	 * @return ITemplate the template for each alternating item
@@ 456-463 (lines=8) @@
453
	/**
454
	 * @return TTableItemStyle the style for each alternating item
455
	 */
456
	public function getAlternatingItemStyle()
457
	{
458
		if (($style = $this->getViewState('AlternatingItemStyle', null)) === null) {
459
			$style = new TTableItemStyle;
460
			$this->setViewState('AlternatingItemStyle', $style, null);
461
		}
462
		return $style;
463
	}
464
465
	/**
466
	 * @return ITemplate the selected item template
@@ 489-496 (lines=8) @@
486
	/**
487
	 * @return TTableItemStyle the style for selected item
488
	 */
489
	public function getSelectedItemStyle()
490
	{
491
		if (($style = $this->getViewState('SelectedItemStyle', null)) === null) {
492
			$style = new TTableItemStyle;
493
			$this->setViewState('SelectedItemStyle', $style, null);
494
		}
495
		return $style;
496
	}
497
498
	/**
499
	 * @return ITemplate the edit item template
@@ 522-529 (lines=8) @@
519
	/**
520
	 * @return TTableItemStyle the style for edit item
521
	 */
522
	public function getEditItemStyle()
523
	{
524
		if (($style = $this->getViewState('EditItemStyle', null)) === null) {
525
			$style = new TTableItemStyle;
526
			$this->setViewState('EditItemStyle', $style, null);
527
		}
528
		return $style;
529
	}
530
531
	/**
532
	 * @return ITemplate the header template
@@ 555-562 (lines=8) @@
552
	/**
553
	 * @return TTableItemStyle the style for header
554
	 */
555
	public function getHeaderStyle()
556
	{
557
		if (($style = $this->getViewState('HeaderStyle', null)) === null) {
558
			$style = new TTableItemStyle;
559
			$this->setViewState('HeaderStyle', $style, null);
560
		}
561
		return $style;
562
	}
563
564
	/**
565
	 * @return TControl the header item
@@ 596-603 (lines=8) @@
593
	/**
594
	 * @return TTableItemStyle the style for footer
595
	 */
596
	public function getFooterStyle()
597
	{
598
		if (($style = $this->getViewState('FooterStyle', null)) === null) {
599
			$style = new TTableItemStyle;
600
			$this->setViewState('FooterStyle', $style, null);
601
		}
602
		return $style;
603
	}
604
605
	/**
606
	 * @return TControl the footer item
@@ 658-665 (lines=8) @@
655
	/**
656
	 * @return TTableItemStyle the style for separator
657
	 */
658
	public function getSeparatorStyle()
659
	{
660
		if (($style = $this->getViewState('SeparatorStyle', null)) === null) {
661
			$style = new TTableItemStyle;
662
			$this->setViewState('SeparatorStyle', $style, null);
663
		}
664
		return $style;
665
	}
666
667
	/**
668
	 * @return int the zero-based index of the selected item in {@link getItems Items}.

framework/Web/UI/WebControls/TWizard.php 6 locations

@@ 418-425 (lines=8) @@
415
	/**
416
	 * @return TStyle the style for the buttons displayed in the side bar.
417
	 */
418
	public function getSideBarButtonStyle()
419
	{
420
		if (($style = $this->getViewState('SideBarButtonStyle', null)) === null) {
421
			$style = new TStyle;
422
			$this->setViewState('SideBarButtonStyle', $style, null);
423
		}
424
		return $style;
425
	}
426
427
	/**
428
	 * @return TStyle the style common for all navigation buttons.
@@ 430-437 (lines=8) @@
427
	/**
428
	 * @return TStyle the style common for all navigation buttons.
429
	 */
430
	public function getNavigationButtonStyle()
431
	{
432
		if (($style = $this->getViewState('NavigationButtonStyle', null)) === null) {
433
			$style = new TStyle;
434
			$this->setViewState('NavigationButtonStyle', $style, null);
435
		}
436
		return $style;
437
	}
438
439
	/**
440
	 * @return TWizardNavigationButtonStyle the style for the next button in the start wizard step.
@@ 520-527 (lines=8) @@
517
	/**
518
	 * @return TPanelStyle the style for the side bar.
519
	 */
520
	public function getSideBarStyle()
521
	{
522
		if (($style = $this->getViewState('SideBarStyle', null)) === null) {
523
			$style = new TPanelStyle;
524
			$this->setViewState('SideBarStyle', $style, null);
525
		}
526
		return $style;
527
	}
528
529
	/**
530
	 * @return TPanelStyle the style for the header.
@@ 532-539 (lines=8) @@
529
	/**
530
	 * @return TPanelStyle the style for the header.
531
	 */
532
	public function getHeaderStyle()
533
	{
534
		if (($style = $this->getViewState('HeaderStyle', null)) === null) {
535
			$style = new TPanelStyle;
536
			$this->setViewState('HeaderStyle', $style, null);
537
		}
538
		return $style;
539
	}
540
541
	/**
542
	 * @return TPanelStyle the style for each internal wizard step.
@@ 544-551 (lines=8) @@
541
	/**
542
	 * @return TPanelStyle the style for each internal wizard step.
543
	 */
544
	public function getStepStyle()
545
	{
546
		if (($style = $this->getViewState('StepStyle', null)) === null) {
547
			$style = new TPanelStyle;
548
			$this->setViewState('StepStyle', $style, null);
549
		}
550
		return $style;
551
	}
552
553
	/**
554
	 * @return TPanelStyle the style for the navigation panel.
@@ 556-563 (lines=8) @@
553
	/**
554
	 * @return TPanelStyle the style for the navigation panel.
555
	 */
556
	public function getNavigationStyle()
557
	{
558
		if (($style = $this->getViewState('NavigationStyle', null)) === null) {
559
			$style = new TPanelStyle;
560
			$this->setViewState('NavigationStyle', $style, null);
561
		}
562
		return $style;
563
	}
564
565
	/**
566
	 * @return bool whether to use default layout to arrange side bar and the rest wizard components. Defaults to true.