summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d3e4552)
raw | patch | inline | side by side (parent: d3e4552)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 21 Apr 2010 08:14:40 +0000 (08:14 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 21 Apr 2010 08:14:40 +0000 (08:14 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17765 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/update-gosa | patch | blob | history |
diff --git a/gosa-core/update-gosa b/gosa-core/update-gosa
index 3277a3fbf28cacb41e8685a645515744000feae1..8107fd7c910f32433a4151d42df0cf0f14c61e4f 100755 (executable)
--- a/gosa-core/update-gosa
+++ b/gosa-core/update-gosa
<?php
/*
* This code is part of GOsa (http://www.gosa-project.org)
- * Copyright (C) 2003-2008 GONICUS GmbH
+ * Copyright (C) 2003-2010 GONICUS GmbH
*
* ID: $$Id: main.php 9254 2008-03-03 15:57:49Z cajus $$
*
}
+function get_themes()
+{
+ $themes= array();
+ $d = dir(GOSA_HOME."/html/themes");
+ while (false !== ($entry = $d->read())) {
+ if ($entry[0] != '.') {
+ $themes[]= basename($entry);
+ }
+ }
+ $d->close();
+
+ return $themes;
+}
+
/* Function to include all class_ files starting at a given directory base */
function get_classes($folder= ".")
{
$styles= array();
$duplicates= array();
+ echo "Updating master image for theme '$theme'...";
+
// Check for image magick convert
if (!function_exists("imageFilter")){
exec("which convert", $res, $ret);
}
// Scan for images in the given path
- echo "Scanning for images";
flush();
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $fileInfo) {
// Grey image if it is not already one
if (preg_match('/grey/', $indexPath)) {
echo "!";
- $warnings[]= "Warning: skipped possible *grey* image $path";
+ $warnings[]= "! Warning: skipped possible *grey* image $path";
flush();
continue;
}
// New image if it is not already one
if (preg_match('/new/', $indexPath) && !preg_match('/new\.png$/', $indexPath)) {
echo "!";
- $warnings[]= "Warning: skipped possible *new* image $path";
+ $warnings[]= "! Warning: skipped possible *new* image $path";
flush();
continue;
}
// Is this image already there?
$checksum= md5_file($path);
if (in_array($checksum, $checksums)) {
- $warnings[]= "Warning: images $indexPath seems to be a duplicate of ".array_search($checksum, $checksums);
+ $warnings[]= "! Warning: images $indexPath seems to be a duplicate of ".array_search($checksum, $checksums);
$duplicates[$indexPath]= array_search($checksum, $checksums);
$duplicates[$greyIndexPath]= preg_replace('/\.png$/', '-grey.png', array_search($checksum, $checksums));
continue;
rescan_classes();
rescan_i18n();
rescan_guide();
- rescan_images("html", "default");
- exit (0);
+ foreach (get_themes() as $theme) {
+ rescan_images(GOSA_HOME."/html", $theme);
+ }
+ exit (0);
}
switch ($argv[1]){
rescan_classes();
break;
case 'rescan-images':
- rescan_images("html", "default");
+ foreach (get_themes() as $theme) {
+ rescan_images("html", $theme);
+ }
break;
default:
echo "Error: Supplied command not known\n\n";