showAjaxView() public static method

return boolean True if the ajax view should be displayed.
public static showAjaxView ( )
Example #1
0
<?php

/**
 * Copyright 2001-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  Jan Schneider <*****@*****.**>
 * @package Kronolith
 */
require_once __DIR__ . '/lib/Application.php';
$app_ob = Horde_Registry::appInit('kronolith');
if (Kronolith::showAjaxView() && !Horde_Util::getPost('import_ajax') || !$conf['menu']['import_export']) {
    Horde::url('', true)->redirect();
}
/* Importable file types. */
$file_types = array('csv' => _("Comma separated values"), 'icalendar' => _("vCalendar/iCalendar"));
/* Templates for the different import steps. */
$templates = array(Horde_Data::IMPORT_CSV => array($registry->get('templates', 'horde') . '/data/csvinfo.inc'), Horde_Data::IMPORT_MAPPED => array($registry->get('templates', 'horde') . '/data/csvmap.inc'), Horde_Data::IMPORT_DATETIME => array($registry->get('templates', 'horde') . '/data/datemap.inc'));
$perms = $GLOBALS['injector']->getInstance('Horde_Core_Perms');
if ($perms->hasAppPermission('max_events') !== true && $perms->hasAppPermission('max_events') <= Kronolith::countEvents()) {
    Horde::permissionDeniedError('kronolith', 'max_events', sprintf(_("You are not allowed to create more than %d events."), $perms->hasAppPermission('max_events')));
    $templates[Horde_Data::IMPORT_FILE] = array(KRONOLITH_TEMPLATES . '/data/export.inc');
} else {
    $templates[Horde_Data::IMPORT_FILE] = array(KRONOLITH_TEMPLATES . '/data/import.inc', KRONOLITH_TEMPLATES . '/data/export.inc');
}
/* Initial values. */
$import_step = Horde_Util::getFormData('import_step', 0) + 1;
$actionID = Horde_Util::getFormData('actionID');
$next_step = Horde_Data::IMPORT_FILE;
Example #2
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();
Example #3
0
 /**
  */
 public function topbarCreate(Horde_Tree_Renderer_Base $tree, $parent = null, array $params = array())
 {
     switch ($params['id']) {
         case 'menu':
             $menus = array(array('new', _("New Event"), 'new.png', Horde::url('new.php')), array('day', _("Day"), 'dayview.png', Horde::url('day.php')), array('work', _("Work Week"), 'workweekview.png', Horde::url('workweek.php')), array('week', _("Week"), 'weekview.png', Horde::url('week.php')), array('month', _("Month"), 'monthview.png', Horde::url('month.php')), array('year', _("Year"), 'yearview.png', Horde::url('year.php')));
             if (Kronolith::showAjaxView()) {
                 if (Kronolith::hasApiPermission('tasks')) {
                     $menus[] = array('tasks', _("Tasks"), 'tasks.png', $GLOBALS['registry']->get('webroot') . '#tasks');
                 }
                 $menus[] = array('agenda', _("Agenda"), 'agenda.png', $GLOBALS['registry']->get('webroot') . '#agenda');
             }
             // Dynamic view has no dedicated search page.
             if (!Kronolith::showAjaxView()) {
                 $menus[] = array('search', _("Search"), 'search.png', Horde::url('search.php'));
             }
             foreach ($menus as $menu) {
                 $tree->addNode(array('id' => $parent . $menu[0], 'parent' => $parent, 'label' => $menu[1], 'expanded' => false, 'params' => array('icon' => Horde_Themes::img($menu[2]), 'url' => $menu[3])));
             }
             break;
     }
 }