$cal_templates->set_var('cal_displaymo_num', $month); $cal_templates->set_var('cal_displayyr_num', $year); if ($mode == 'personal') { $cal_templates->set_var('lang_addevent', $LANG_CAL_2[8]); $cal_templates->set_var('addevent_formurl', '/calendar/index.php'); $cal_templates->set_var('addevent_name', 'addpersonalevent'); } else { if ($_CA_CONF['only_admin_submit'] == 1) { if (SEC_hasRights('calendar.edit')) { $cal_templates->set_var('lang_addevent', $LANG_CAL_2[42]); $cal_templates->set_var('addevent_formurl', '/calendar/index.php'); $cal_templates->set_var('addevent_name', 'addevent'); } } else { if (COM_isAnonUser() && ($_CONF['loginrequired'] == 1 || $_CONF['submitloginrequired'] == 1)) { $cal_templates->set_var('lang_addevent', ''); } else { $cal_templates->set_var('lang_addevent', $LANG_CAL_2[42]); $cal_templates->set_var('addevent_formurl', '/calendar/index.php'); $cal_templates->set_var('addevent_name', 'addevent'); } } } $cal_templates->parse('add_event_option', 'addevent', true); $cal_templates->parse('output', 'calendar'); $display .= $cal_templates->finish($cal_templates->get_var('output')); $display .= CALENDAR_siteFooter(); break; } // end switch echo $display;
} else { if (SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) == 3 && SEC_hasRights('calendar.edit')) { $editurl = $_CONF['site_admin_url'] . '/plugins/calendar/index.php?edit=x&eid=' . $A['eid']; $cal_templates->set_var('event_edit', COM_createLink($LANG01[4], $editurl)); $img = '<img src="' . $_CONF['layout_url'] . '/images/edit.' . $_IMAGE_TYPE . '" alt="' . $LANG01[4] . '" title="' . $LANG01[4] . '"/>'; $cal_templates->set_var('edit_icon', COM_createLink($img, $editurl)); $cal_templates->set_var('hits_admin', COM_numberFormat($A['hits'])); $cal_templates->set_var('lang_hits_admin', $LANG10[30]); } else { $cal_templates->set_var('event_edit', ''); $cal_templates->set_var('edit_icon', ''); } } if ($mode == 'personal') { // personal events don't have a hits counter $cal_templates->set_var('lang_hits', ''); $cal_templates->set_var('hits', ''); } else { $cal_templates->set_var('lang_hits', $LANG10[30]); $cal_templates->set_var('hits', COM_numberFormat($A['hits'])); } $cal_templates->parse('event_details', 'details', true); } } $cal_templates->parse('output', 'events'); $display .= $cal_templates->finish($cal_templates->get_var('output')); } $display .= COM_endBlock() . CALENDAR_siteFooter(); } // end switch echo $display;