Kronolith::showAjaxView PHP Method

showAjaxView() public static method

return boolean True if the ajax view should be displayed.
public static showAjaxView ( )
    public static function showAjaxView()
    {
        return $GLOBALS['registry']->getView() == Horde_Registry::VIEW_DYNAMIC && $GLOBALS['prefs']->getValue('dynamic_view');
    }

Usage Example

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;
All Usage Examples Of Kronolith::showAjaxView