/** * Month view * * @param String $handler_id Name of the request handler * @param array $args Variable arguments * @param array &$data Public request data, passed by reference */ public function _handler_month($handler_id, array $args, array &$data) { midcom::get('auth')->require_valid_user(); $this->_generate_date($args); // Instantiate calendar widget $this->_calendar = new org_openpsa_widgets_calendar(date('Y', $this->_selected_time), date('m', $this->_selected_time), date('d', $this->_selected_time)); $this->_calendar->type = org_openpsa_widgets_calendar::MONTH; $this->_calendar->cell_height = 100; $this->_calendar->column_width = 60; $this->_populate_toolbar('month'); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => 'week/' . $this->_get_datestring() . '/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('week view'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/properties.png')); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => 'day/' . $this->_get_datestring() . '/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('day view'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/properties.png')); // Clicking a free slot should bring up 'new event' dialogue $nap = new midcom_helper_nav(); $this_node = $nap->get_node($nap->get_current_node()); $this->_calendar->reservation_div_options = array('onclick' => org_openpsa_calendar_interface::calendar_editevent_js('__GUID__', $this_node)); if ($this->_root_event->can_do('midgard:create')) { $this->_calendar->free_div_options = array('onclick' => org_openpsa_calendar_interface::calendar_newevent_js($this_node, '__START__', '__RESOURCE__')); } // Populate contacts $this->_populate_calendar_contacts($this->_calendar->get_month_start(), $this->_calendar->get_month_end()); $this->_request_data['calendar'] =& $this->_calendar; // Set the breadcrumb $this->add_breadcrumb('year/' . date('Y-01-01', $this->_calendar->get_week_start()) . '/', strftime('%Y', $this->_selected_time)); $this->add_breadcrumb('month/' . date('Y-m-01', $this->_calendar->get_week_start()) . '/', strftime('%B', $this->_selected_time)); midcom::get('head')->set_pagetitle(strftime("%B %Y", $this->_selected_time)); }