protected function _setup() { parent::_setup(); $view = $this->getView(); $view->addTemplatePath(array($GLOBALS['fs_base'] . '/app/views/Screenshot')); $view->stable = HordeWeb_Utils::getStableApps(); }
<?php require_once dirname(__FILE__) . '/app/lib/base.php'; $horde_apps_stable = HordeWeb_Utils::getStableApps(); header('Content-Type: text/xml'); echo '<?xml version="1.0"?>'; ?> <versions> <stable> <?php foreach ($horde_apps_stable as $info) { ?> <application name="<?php echo $info['application']; ?> "> <version><?php echo $info['version']; ?> </version> <url><?php echo htmlspecialchars(HordeWeb_Utils::app_download_url($info['application'], $info)); ?> </url> </application> <?php } ?> </stable> </versions>
public function git_and_ver($module) { $stable = HordeWeb_Utils::getStableApps($module); $dev = HordeWeb_Utils::getDevApps($module); return '<td><a href="http://git.horde.org/horde-git/-/browse/' . htmlspecialchars($module) . '/">' . htmlspecialchars($module) . '</a>' . '</td><td>' . ($stable ? htmlspecialchars($stable['version']) : ($dev ? htmlspecialchars($dev['version']) : ' ')) . '</td>'; }
protected function _app(Horde_Controller_Response $response) { $app = $this->_matchDict->app; if (empty($app)) { exit; } $view = $this->getView(); $view->page_title = 'Downloads - The Horde Project'; $view->appListController = array('controller' => 'download', 'action' => 'app'); $view->appname = $app; $horde_apps_stable = $view->stable; $horde_apps_h4 = $view->h4Stable; $horde_apps_dev = HordeWeb_Utils::getDevApps(); $app_info = $h3app = $h4date = $stableapp = $stabledate = $devapp = $app_list = array(); if ($app != 'groupware' && $app != 'webmail') { $app_list[] = 'horde'; } if (in_array($app, array('dimp', 'mimp'))) { $app_list[] = 'imp'; } $app_list[] = $app; $app_list = array_unique($app_list); foreach ($app_list as $val) { $stable = HordeWeb_Utils::getStableApps($val); $h4 = HordeWeb_Utils::getH4Apps($val); $stabledate[$val] = $stable ? strtotime($stable['date']) : 0; $h4date[$val] = $h4 ? strtotime($h4['date']) : 0; } $stable = HordeWeb_Utils::getStableApps($app); if ($stable) { foreach ($app_list as $val) { $stableapp[] = HordeWeb_Utils::app_download_link($val, HordeWeb_Utils::getStableApps($val), false, $this); } $app_info = $stable; } else { $stableapp[] = 'No current stable release'; } $h3 = HordeWeb_Utils::getH3Apps($app); if ($h3) { foreach ($app_list as $val) { $h3app[] = HordeWeb_Utils::app_download_link($val, HordeWeb_Utils::getH3Apps($val), false, $this); } $h3app[] = '<a href="' . htmlspecialchars(HordeWeb_Utils::app_patches_url($val, $h3)) . '">Patches for Deprecated Horde 3 Stable Release</a>'; } $dev = HordeWeb_Utils::getDevApps($app); if ($dev && $stabledate[$app] < strtotime($dev['date']) && $h4date[$app] < strtotime($dev['date'])) { foreach ($app_list as $val) { $info = HordeWeb_Utils::getDevApps($val); if (!$info) { $devapp[] = HordeWeb_Utils::app_download_link($val, HordeWeb_Utils::getStableApps($val)); } elseif ($h4date[$val] > strtotime($dev['date'])) { $devapp[] = HordeWeb_Utils::app_download_link($val, HordeWeb_Utils::getH4Apps($val)); } elseif ($stabledate[$val] > strtotime($dev['date'])) { $devapp[] = HordeWeb_Utils::app_download_link($val, HordeWeb_Utils::getStableApps($val)); } else { $devapp[] = HordeWeb_Utils::app_download_link($val, HordeWeb_Utils::getDevApps($val)); } } if (empty($app_info)) { $app_info = $dev; } } if (!$stable && !$h3 && !$dev) { $this->_notFound($response); return; } if (empty($app_info)) { $app_info['name'] = ucfirst($app); } $view->h3app = $h3app; $view->stableapp = $stableapp; $view->stabledate = $stabledate; $view->devapp = $devapp; $view->app_info = $app_info; $layout = $this->getInjector()->getInstance('Horde_Core_Ui_Layout'); $layout->setView($view); $layout->setLayoutName('main'); $response->setBody($layout->render('app')); }