Beispiel #1
0
 echo '<tr class="op-row op-row-day ' . $row_classes . ' ' . $highlighted_day . '">';
 echo '<th scope="row" class="op-cell op-cell-heading ' . $cell_heading_classes . ' ' . $cell_classes . '">';
 echo Weekdays::getDaysCaption($day, $short);
 echo '</th>';
 echo '<td class="op-cell op-cell-periods ' . $cell_periods_classes . ' ' . $cell_classes . '">';
 if ($include_io) {
     $io = $set->getActiveIrregularOpeningOnWeekday($day);
     if ($io instanceof IrregularOpening) {
         Shortcode::renderIrregularOpening($io, $attributes);
         continue;
     }
 }
 if ($include_holidays) {
     $holiday = $set->getActiveHolidayOnWeekday($day);
     if ($holiday instanceof Holiday) {
         Shortcode::renderHoliday($holiday, $attributes);
         continue;
     }
 }
 if (!count($d_periods)) {
     echo '<span class="op-closed">' . $caption_closed . '</span>';
 }
 foreach ($d_periods as $period) {
     /**
      * @var     $period     \OpeningHours\Entity\Period
      */
     $highlighted_period = ($highlight == 'period' and $period->isOpen()) ? $highlighted_period_class : null;
     echo '<span class="op-period-time ' . $span_period_classes . ' ' . $highlighted_period . '">' . $period->getFormattedTimeRange($time_format) . '</span>';
 }
 echo '</td>';
 echo '</tr>';
 /** Constructor for OpeningHours module */
 protected function __construct()
 {
     $this->registerHookCallbacks();
     $this->modules = array('OpeningHours' => Module\OpeningHours::getInstance(), 'I18n' => Module\I18n::getInstance(), 'Ajax' => Module\Ajax::getInstance(), 'CustomPostType\\Set' => Module\CustomPostType\Set::getInstance(), 'Shortcode\\IsOpen' => Module\Shortcode\IsOpen::getInstance(), 'Shortcode\\Overview' => Module\Shortcode\Overview::getInstance(), 'Shortcode\\Holidays' => Module\Shortcode\Holidays::getInstance(), 'Shortcode\\IrregularOpenings' => Module\Shortcode\IrregularOpenings::getInstance());
     $this->widgets = array('OpeningHours\\Module\\Widget\\Overview', 'OpeningHours\\Module\\Widget\\IsOpen', 'OpeningHours\\Module\\Widget\\Holidays', 'OpeningHours\\Module\\Widget\\IrregularOpenings');
 }
Beispiel #3
0
 public function __construct()
 {
     $title = __('Opening Hours: Overview', I18n::TEXTDOMAIN);
     $description = __('Displays a Table with your Opening Hours. Alternatively use the op-overview Shortcode.', I18n::TEXTDOMAIN);
     parent::__construct('widget_op_overview', $title, $description, OverviewShortcode::getInstance());
 }