try {
$api = $this->getApiInstance($app, 'application');
- return $api->mobileView;
+ return !empty($api->mobileView);
+ } catch (Horde_Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Does the given application have an ajax view?
+ *
+ * @param string $app The application to check.
+ *
+ * @return boolean Whether app has an ajax view.
+ */
+ public function hasAjaxView($app = null)
+ {
+ if (empty($app)) {
+ $app = $this->getApp();
+ }
+
+ try {
+ $api = $this->getApiInstance($app, 'application');
+ return !empty($api->ajaxView);
} catch (Horde_Exception $e) {
return false;
}
class IMP_Application extends Horde_Registry_Application
{
/**
+ * Does this application support an ajax view?
+ *
+ * @var boolean
+ */
+ public $ajaxView = true;
+
+ /**
* Does this application support a mobile view?
*
* @var boolean
this._addHistory(loc);
this.view = 'iframe';
break;
+
+ case 'app':
+ this.closeView('iframe');
+ var app = locParts.shift();
+ if (data) {
+ this.iframeContent(loc, data);
+ } else if (Kronolith.conf.app_urls[app]) {
+ this.iframeContent(loc, Kronolith.conf.app_urls[app]);
+ }
+ this.updateMinical(this.date);
+ this._addHistory(fullloc);
+ this.view = 'iframe';
+ break;
}
},
class Kronolith_Application extends Horde_Registry_Application
{
/**
+ * Does this application support an ajax view?
+ *
+ * @var boolean
+ */
+ public $ajaxView = true;
+
+ /**
* The application's version.
*
* @var string
$kronolith_webroot = $registry->get('webroot');
$horde_webroot = $registry->get('webroot', 'horde');
$has_tasks = $GLOBALS['registry']->hasInterface('tasks');
+ $app_urls = array();
+ if (isset($GLOBALS['conf']['menu']['apps']) &&
+ is_array($GLOBALS['conf']['menu']['apps'])) {
+ foreach ($GLOBALS['conf']['menu']['apps'] as $app) {
+ $app_urls[$app] = (string) Horde::url($GLOBALS['registry']->getInitialPage($app), true);
+ }
+ }
/* Variables used in core javascript files. */
$code['conf'] = array(
'SESSION_ID' => defined('SID') ? SID : '',
'user' => Horde_Auth::getAuth(),
'prefs_url' => str_replace('&', '&', Horde::getServiceLink('options', 'kronolith')),
+ 'app_urls' => $app_urls,
'name' => $registry->get('name'),
'has_tasks' => $has_tasks,
'is_ie6' => ($browser->isBrowser('msie') && ($browser->getMajor() < 7)),
<?php if (count($GLOBALS['conf']['menu']['apps'])): ?>
<div id="kronolithApplications">
<ul>
- <li class="kronolithApplicationSelected"><a href="" id="kronolithApplication-kronolith" title="<?php echo $GLOBALS['registry']->get('name') ?>"><img src="<?php echo $GLOBALS['registry']->get('icon') ?>" /> <?php echo $GLOBALS['registry']->get('name') ?></a></li>
+ <li class="kronolithApplicationSelected"><a href="#" id="kronolithApplication-kronolith" title="<?php echo $GLOBALS['registry']->get('name') ?>"><img src="<?php echo $GLOBALS['registry']->get('icon') ?>" /> <?php echo $GLOBALS['registry']->get('name') ?></a></li>
<?php foreach ($GLOBALS['conf']['menu']['apps'] as $app): ?>
+ <?php if ($GLOBALS['registry']->hasAjaxView($app)): ?>
<li><a href="<?php echo $GLOBALS['registry']->get('webroot', $app) ?>" id="kronolithApplication-<?php echo $app ?>" title="<?php echo $GLOBALS['registry']->get('name', $app) ?>"><img src="<?php echo $GLOBALS['registry']->get('icon', $app) ?>" /> <?php echo $GLOBALS['registry']->get('name', $app) ?></a></li>
+ <?php else: ?>
+ <li><a href="#" onclick="KronolithCore.go('app:<?php echo $app ?>')" id="kronolithApplication-<?php echo $app ?>" title="<?php echo $GLOBALS['registry']->get('name', $app) ?>"><img src="<?php echo $GLOBALS['registry']->get('icon', $app) ?>" /> <?php echo $GLOBALS['registry']->get('name', $app) ?></a></li>
+ <?php endif; ?>
<?php endforeach; ?>
</ul>
<span class="kronolithSeparator">|</span>