Beispiel #1
0
    $dates->setParameter('view_mode', $getViewMode);
    $dates->setDateRange($getDateFrom, $getDateTo);
} catch (AdmException $e) {
    $e->showHtml();
}
if ($getCatId > 0) {
    $calendar = new TableCategory($gDb, $getCatId);
}
// Number of events each page for default view 'html' or 'compact' view
if ($gPreferences['dates_per_page'] > 0 && $getViewMode === 'html') {
    $datesPerPage = $gPreferences['dates_per_page'];
} else {
    $datesPerPage = $dates->getDataSetCount();
}
// read relevant events from database
$datesResult = $dates->getDataset($getStart, $datesPerPage);
$datesTotalCount = $dates->getDataSetCount();
if ($getViewMode !== 'print' && $getId === 0) {
    // Navigation of the module starts here
    $gNavigation->addStartUrl(CURRENT_URL, $dates->getHeadline($getHeadline));
}
// create html page object
$page = new HtmlPage($dates->getHeadline($getHeadline));
$page->enableModal();
if ($getViewMode === 'html') {
    $datatable = true;
    $hoverRows = true;
    $classTable = 'table';
    if ($gPreferences['enable_rss'] == 1 && $gPreferences['enable_dates_module'] == 1) {
        $page->addRssFile($g_root_path . '/adm_program/modules/dates/rss_dates.php?headline=' . $getHeadline, $gL10n->get('SYS_RSS_FEED_FOR_VAR', $gCurrentOrganization->getValue('org_longname') . ' - ' . $getHeadline));
    }
Beispiel #2
0
// Nachschauen ob ical ueberhaupt aktiviert ist bzw. das Modul oeffentlich zugaenglich ist
if ($gPreferences['enable_dates_ical'] != 1) {
    $gMessage->setForwardUrl($gHomepage);
    $gMessage->show($gL10n->get('SYS_ICAL_DISABLED'));
}
//create Object
$dates = new ModuleDates();
// get parameters fom $_GET Array stored in class
$parameter = $dates->getParameters();
// set mode, viewmode, startdate and enddate manually
$parameter['mode'] = 2;
$parameter['view_mode'] = 'period';
$parameter['date_from'] = date('Y-m-d', time() - $gPreferences['dates_ical_days_past'] * 86400);
$parameter['date_to'] = date('Y-m-d', time() + $gPreferences['dates_ical_days_future'] * 86400);
// read events for output
$datesResult = $dates->getDataset();
//Headline für Dateinamen
if ($dates->getCatId() > 0) {
    $calendar = new TableCategory($gDb, $dates->getCatId());
    $getHeadline .= '_' . $calendar->getValue('cat_name');
}
$date = new TableDate($gDb);
$iCal = $date->getIcalHeader();
if ($datesResult['numResults'] > 0) {
    $date = new TableDate($gDb);
    foreach ($datesResult['recordset'] as $row) {
        $date->clear();
        $date->setArray($row);
        $iCal .= $date->getIcalVEvent($_SERVER['HTTP_HOST']);
    }
}
Beispiel #3
0
    require_once '../../system/login_valid.php';
}
// If Ical enabled and module is public
if ($gPreferences['enable_dates_ical'] != 1) {
    $gMessage->setForwardUrl($gHomepage);
    $gMessage->show($gL10n->get('SYS_ICAL_DISABLED'));
}
// create Object
$dates = new ModuleDates();
// set mode, viewmode, calendar, startdate and enddate manually
$dates->setParameter('mode', 2);
$dates->setParameter('view_mode', 'period');
$dates->setParameter('cat_id', $getCatId);
$dates->setDaterange($startDate, $endDate);
// read events for output
$datesResult = $dates->getDataset(0, 0);
// get parameters fom $_GET Array stored in class
$parameter = $dates->getParameters();
// Headline for file name
if ($getCatId > 0) {
    $calendar = new TableCategory($gDb, $dates->getCatId());
    $getHeadline .= '_' . $calendar->getValue('cat_name');
}
$date = new TableDate($gDb);
$iCal = $date->getIcalHeader();
if ($datesResult['numResults'] > 0) {
    $date = new TableDate($gDb);
    foreach ($datesResult['recordset'] as $row) {
        $date->clear();
        $date->setArray($row);
        $iCal .= $date->getIcalVEvent($_SERVER['HTTP_HOST']);