public function index()
 {
     $view = new View('admin/shortcodes/index');
     $view->render(array('title' => 'Shortcodes', 'locations' => Location::get_visible_locations($this->entity_manager), 'available_widgets' => Shortcode::available_widgets(), 'valid_widget_attributes' => Shortcode::valid_widget_attributes()));
 }
Ejemplo n.º 2
0
 public function weekly($attributes)
 {
     $locations_repo = $this->entity_manager->getRepository('Hoo\\Model\\Location');
     if (isset($attributes['location'])) {
         $location = Location::get_location_by_id_or_shortname($attributes['location'], $this->entity_manager);
         if ($location) {
             $locations = array($location);
         } else {
             return 'Invalid Location';
         }
     } else {
         $locations = $locations_repo->findBy(array('is_visible' => true));
     }
     $view = new View('shortcode/weekly');
     $locations_hours = array();
     foreach ($locations as $location) {
         $locations_hours[] = array('location' => $location, 'hours' => $location->get_weekly_hours());
     }
     return $view->fetch(array('header' => $attributes['header'], 'locations' => $locations_hours));
 }