Example #1
0
        exit;
    }
    $slerror = '';
    COM_clearSpeedlimit($_CONF['speedlimit'], 'submit');
    $last = COM_checkSpeedlimit('submit');
    if ($last > 0) {
        $slerror .= COM_showMessageText($LANG12[30] . $last . $LANG12[31], $LANG12[26], true);
    }
    echo CALENDAR_siteHeader();
    if ($slerror != '') {
        echo $slerror;
    } else {
        if ($mode != 'personal' && $_CA_CONF['only_admin_submit'] == 1 && !SEC_hasRights('calendar.edit')) {
            echo 'Invalid request';
        } else {
            echo plugin_submit_calendar($mode);
        }
    }
    echo CALENDAR_siteFooter();
    exit;
}
if (isset($_POST['savecal'])) {
    echo CALENDAR_siteHeader();
    echo plugin_savesubmission_calendar($_POST);
    echo CALENDAR_siteFooter();
    exit;
}
if ($mode != 'personal' && $mode != 'quickadd') {
    $mode = '';
}
if ($mode == 'personal') {
Example #2
0
         }
         if ($nrows == 0) {
             $cal_templates->set_var('event_starttime', ' ');
             $cal_templates->set_var('event_endtime', '');
             $cal_templates->set_var('event_title_and_link', '');
             $cal_templates->set_var('delete_imagelink', '');
             $cal_templates->parse('events_day' . $i, 'events', true);
         }
         // Go to next day
         $thedate = COM_getUserDateTimeFormat(mktime(0, 0, 0, $monthnum, $daynum + 1, $yearnum));
     }
     $display .= $cal_templates->parse('output', 'week');
     $display = COM_createHTMLDocument($display, array('pagetitle' => $pagetitle));
     break;
 case 'addentry':
     $display .= plugin_submit_calendar($mode);
     $display = COM_createHTMLDocument($display, array('pagetitle' => $pagetitle));
     break;
 case 'savepersonal':
     if (SEC_checkToken()) {
         $display = plugin_savesubmission_calendar($_POST);
     } else {
         COM_redirect($_CONF['site_url'] . '/calendar/index.php');
     }
     break;
 default:
     // month view
     // Load templates
     $cal_templates = COM_newTemplate(CTL_plugin_templatePath('calendar'));
     $cal_templates->set_file(array('calendar' => 'calendar.thtml', 'week' => 'calendarweek.thtml', 'day' => 'calendarday.thtml', 'event' => 'calendarevent.thtml', 'mastercal' => 'mastercalendaroption.thtml', 'personalcal' => 'personalcalendaroption.thtml', 'addevent' => 'addeventoption.thtml'));
     $cal_templates->set_var('mode', $mode);