# shiftcontroller/4.9.66/sh4/calendars/presenter.php

ShiftController Employee Shift Scheduling, version 4.9.66. 50 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/sh4/calendars/presenter.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/raw/sh4/calendars/presenter.php
- Modified: 2024-08-24T09:59:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/sh4/calendars/presenter.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
class SH4_Calendars_Presenter
{
	public $ui;

	public function __construct( HC3_Ui $ui )
	{
		$this->ui = $ui;
	}

	public function presentDescription( SH4_Calendars_Model $calendar )
	{
		$return = $calendar->getDescription();

		if( defined('WPINC') ){
			$return = do_shortcode( $return );
		}

		return $return;
	}

	public function presentTitle( SH4_Calendars_Model $calendar )
	{
		$ret = $calendar->getTitle();
		$ret = esc_html( $ret );

		if( $calendar->isTimeoff() ){
			$label = '(' . '__Time Off__' . ')';
			$ret = $this->ui->makeListInline( array($ret, $label) );
		}

		if( $calendar->isAvailability() ){
			$label = '(' . '__Availability__' . ')';
			$ret = $this->ui->makeListInline( array($ret, $label) );
		}

		$ret = $this->ui->makeBlockInline( $ret )
			->paddingX(1)
			->tag('bgcolor', $calendar->getColor() )
			->tag('color', 'white')
			;
		if( $calendar->isArchived() ){
			$ret
				->tag('font-style', 'line-through')
				;
		}

		return $ret;
	}
}
```
