summaryrefslogtreecommitdiff
path: root/lib/images/fileicons/generate.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-02-18 23:02:26 +0100
committerAndreas Gohr <andi@splitbrain.org>2014-02-18 23:02:26 +0100
commitfd3ec3c5b9b8af10dd89982ddbdf29ba7a13d700 (patch)
treea665ff7cf617d71ce107f6f17e4e6977d10077c1 /lib/images/fileicons/generate.php
parentdfe934f96f476bdcf60d82feceb4d2a78df28ca0 (diff)
downloadrpg-fd3ec3c5b9b8af10dd89982ddbdf29ba7a13d700.tar.gz
rpg-fd3ec3c5b9b8af10dd89982ddbdf29ba7a13d700.tar.bz2
file icon updates
now we no longer limit generation to the extensions in mime types, because file icons are used in downloadable code blocks, too. All icons were regenerated with the latest update of the generator.
Diffstat (limited to 'lib/images/fileicons/generate.php')
-rw-r--r--lib/images/fileicons/generate.php47
1 files changed, 28 insertions, 19 deletions
diff --git a/lib/images/fileicons/generate.php b/lib/images/fileicons/generate.php
index 2dd25eb33..b08749f49 100644
--- a/lib/images/fileicons/generate.php
+++ b/lib/images/fileicons/generate.php
@@ -9,27 +9,36 @@ if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__).'/../../.
define('NOSESSION', 1);
require_once(DOKU_INC.'inc/init.php');
+$extensions = array(
+ 'jpg', 'gif', 'png', 'ico',
+ 'swf', 'mp3', 'ogg', 'wav', 'webm', 'ogv', 'mp4',
+ 'tgz', 'tar', 'gz', 'bz2', 'zip', 'rar', '7z',
+ 'pdf', 'ps',
+ 'rpm', 'deb',
+ 'doc', 'xls', 'ppt', 'rtf',
+ 'docx', 'xlsx', 'pptx',
+ 'sxw', 'sxc', 'sxi', 'sxd',
+ 'odc', 'odf', 'odg', 'odi', 'odp', 'ods', 'odt',
+ 'html', 'htm', 'txt', 'conf', 'xml', 'csv',
+ // these might be used in downloadable code blocks:
+ 'c', 'cc', 'cpp', 'h', 'hpp', 'csh', 'diff', 'java', 'pas',
+ 'pl', 'py', 'sh', 'bash', 'asm', 'htm', 'css', 'js', 'json'
+);
-/**
- * Class DokuFileIconBuilder
- *
- * overwrite mime type loading with loading DokuWiki's mime type config instead
- */
-class DokuFileIconBuilder extends FileIconBuilder {
-
- protected function loadmimetypes(){
- $this->mimetypes = getMimeTypes();
- foreach(array_keys($this->mimetypes) as $ext) {
- $this->mimetypes[$ext] = ltrim($this->mimetypes[$ext], '!');
- }
- }
+// generate all the icons
+@mkdir('16x16');
+@mkdir('32x32');
+
+$DFIB = new FileIconBuilder();
+foreach($extensions as $ext) {
+ echo "$ext\n";
+ $DFIB->create16x16($ext,"16x16/$ext.png");
+ $DFIB->create32x32($ext,"32x32/$ext.png");
}
+copy("16x16/jpg.png", "16x16/jpeg.png");
+copy("32x32/jpg.png", "32x32/jpeg.png");
-echo "Important: you should enable the commented file types in mime.conf to make sure the icon are generated!\n";
-
-// generate all the icons
-$DFIB = new DokuFileIconBuilder();
-$DFIB->createAll(__DIR__);
+copy("16x16/htm.png", "16x16/html.png");
+copy("32x32/htm.png", "32x32/html.png");
-echo "generation done\n";