[ Index ] |
|
Code source de Horde 3.1.3 |
1 <?php 2 /** 3 * $Horde: horde/util/icon_browser.php,v 1.4.2.4 2006/01/01 21:29:17 jan Exp $ 4 * 5 * Copyright 2004-2006 Chuck Hagenbuch <chuck@horde.org> 6 * 7 * See the enclosed file COPYING for license information (LGPL). If you 8 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. 9 */ 10 11 @define('AUTH_HANDLER', true); 12 @define('HORDE_BASE', dirname(__FILE__) . '/..'); 13 require_once HORDE_BASE . '/lib/core.php'; 14 15 $registry = &Registry::singleton(); 16 $apps = $registry->listApps(array('notoolbar', 'active', 'admin', 'inactive', 'hidden'), true); 17 ksort($apps); 18 19 if (($app = basename(Util::getFormData('app'))) && isset($apps[$app])) { 20 // Provide a non-white background for eyeballing transparency. 21 echo '<html><body bgcolor="#aaaaaa">'; 22 23 $themeDir = $registry->get('themesfs', $app); 24 if (!is_dir($themeDir)) { 25 exit(sprintf(_("Themes directory \"%s\" not found."), $themeDir)); 26 } 27 28 // Base graphics for now, feel free to add theme support. 29 $basedir = $dir = $themeDir . DIRECTORY_SEPARATOR . 'graphics'; 30 if (!is_dir($dir)) { 31 exit(sprintf(_("Base graphics directory \"%s\" not found."), $dir)); 32 } 33 34 if (($subdir = basename(Util::getFormData('subdir')))) { 35 $dir .= DIRECTORY_SEPARATOR . $subdir; 36 if (!is_dir($dir)) { 37 exit(sprintf(_("Subdirectory \"%s\" not found."), $dir)); 38 } 39 } 40 41 // Breadcrumbs. 42 echo Horde::link('icon_browser.php') . _("Application List") . '</a><br />'; 43 if (!empty($subdir)) { 44 echo Horde::link('icon_browser.php?app=' . $app) . $registry->get('name', $app) . '</a><br />'; 45 } 46 echo '<br />'; 47 48 // Show icons for app. 49 echo '<h2>' . sprintf(_("Icons for %s"), $registry->get('name', $app)) . (!empty($subdir) ? '/' . $subdir : '') . '</h2>'; 50 51 52 // List subdirectories. 53 $subdirs = glob($dir . DIRECTORY_SEPARATOR . '*', GLOB_ONLYDIR); 54 if ($subdirs && count($subdirs)) { 55 foreach ($subdirs as $subdir) { 56 if (basename($subdir) == 'CVS') { 57 continue; 58 } 59 echo Horde::link(Util::addParameter('icon_browser.php', array('subdir' => basename($subdir), 60 'app' => $app))) . basename($subdir) . '</a><br />'; 61 } 62 echo '<br />'; 63 } 64 65 $images = glob($dir . DIRECTORY_SEPARATOR . '*.png'); 66 if ($images && count($images)) { 67 foreach ($images as $png) { 68 echo Horde::img(str_replace($basedir . DIRECTORY_SEPARATOR, '', $png), $png, array('hspace' => 10, 'vspace' => 10), $registry->getImageDir($app)); 69 } 70 } else { 71 echo _("No icons found."); 72 } 73 74 echo '</body></html>'; 75 } else { 76 // List apps. 77 foreach ($apps as $app) { 78 echo Horde::link(Util::addParameter('icon_browser.php', 'app', $app)) . $registry->get('name', $app) . '</a><br />'; 79 } 80 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |