currentDate() public static method

public static currentDate ( ) : Horde_Date
return Horde_Date
Esempio n. 1
0
<?php

/**
 * Copyright 1999-2015 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author  Chuck Hagenbuch <*****@*****.**>
 * @package Kronolith
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('kronolith');
if (Kronolith::showAjaxView()) {
    Horde::url('', true)->setAnchor('day:' . Kronolith::currentDate()->dateString())->redirect();
}
$view = Kronolith::getView('Day');
$page_output->addScriptFile('tooltips.js', 'horde');
Kronolith::addCalendarLinks();
$page_output->header(array('body_class' => $prefs->getValue('show_panel') ? 'rightPanel' : null, 'title' => $view->getTime($prefs->getValue('date_format'))));
require KRONOLITH_TEMPLATES . '/javascript_defs.php';
$notification->notify(array('listeners' => 'status'));
Kronolith::tabs($view);
$view->html(KRONOLITH_TEMPLATES);
require KRONOLITH_TEMPLATES . '/calendar_titles.inc';
$page_output->footer();
Esempio n. 2
0
<?php

/**
 * Copyright 2005-2014 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author Chuck Hagenbuch <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('kronolith');
if (Kronolith::showAjaxView()) {
    Horde::url('', true)->redirect();
}
$view = Kronolith::getView(Horde_Util::getFormData('view'));
if ($view) {
    Kronolith::tabs(strtolower(str_replace('kronolith_view_', '', Horde_String::lower(get_class($view)))));
    $view->html();
    echo '<div style="display:none" id="view_vars" view="' . htmlspecialchars(Horde_Util::getFormData('view')) . '" date="' . Kronolith::currentDate()->format(DATE_RFC2822) . '">';
}
Esempio n. 3
0
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author  Chuck Hagenbuch <*****@*****.**>
 * @package Kronolith
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('kronolith');
$viewName = Horde_Util::getFormData('view', 'Event');
$view = Kronolith::getView($viewName);
if (is_string($view->event)) {
    $notification->push($view->event, 'horde.error');
    Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect();
}
if (Kronolith::showAjaxView()) {
    Horde::url('', true)->setAnchor('event:' . $view->event->calendarType . '|' . $view->event->calendar . ':' . $view->event->id . ':' . Horde_Util::getFormData('datetime', Kronolith::currentDate()->dateString()))->redirect();
}
switch ($viewName) {
    case 'DeleteEvent':
        /* Shortcut when we're deleting events and don't want confirmation. */
        if (!$view->event->recurs() && !($prefs->getValue('confirm_delete') || Horde_Util::getFormData('confirm'))) {
            Horde::url('delete.php?' . $_SERVER['QUERY_STRING'], true)->redirect();
        }
        break;
    case 'EditEvent':
        if ($view->event->private && $view->event->creator != $GLOBALS['registry']->getAuth()) {
            $url = $url = Horde_Util::getFormData('url');
            if (!empty($url)) {
                $url = new Horde_Url($url, true);
            } else {
                $url = Horde::url($prefs->getValue('defaultview') . '.php', true);
Esempio n. 4
0
<?php

/**
 * JavaScript variables for the traditional interface.
 */
$currentDate = Kronolith::currentDate();
/* Variables used in core javascript files. */
$var = array('calendar_info_url' => (string) Horde::url('calendars/info.php', true), 'page_title' => $GLOBALS['registry']->get('name') . ' :: ', 'twentyFour' => intval($GLOBALS['prefs']->getValue('twentyFour')), 'view_url' => (string) Horde::url('view.php'), 'URI_AJAX' => $GLOBALS['registry']->getServiceLink('ajax', 'kronolith')->url, 'TOKEN' => $GLOBALS['session']->getToken(), 'deletetag_img' => (string) Horde_Themes::img('delete-small.png'));
/* Gettext strings used in core javascript files. */
$gettext = array('close' => _("Close"), 'enddate_error' => _("The end date must be later than the start date."), 'loading' => _("Loading ..."));
$GLOBALS['page_output']->addInlineJsVars(array('-var KronolithDate' => 'new Date(' . sprintf('%d, %d, %d', $currentDate->year, $currentDate->month - 1, $currentDate->mday) . ')', 'var KronolithText' => $gettext, 'var KronolithVar' => $var, 'var KronolithView' => isset($view) && is_object($view) ? $view->getName() : ''), array('top' => true));