openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 2182e48af2ebc8171487e0955151ccb24fcb7482
parent 045156da41fd357f297029be852300a4cfa39d96
Author: dankert <devnull@localhost>
Date:   Mon, 15 Mar 2010 20:59:50 +0100

Korrekte Ermittlung, ob die Größe beim Bild-Typ veränderbar ist. Alt: Falsche Fehlermeldung.

Diffstat:
actionClasses/FileAction.class.php | 14++++++++------
actionClasses/FilemanagerAction.class.php | 2+-
language/de.ini.php | 5+++--
language/en.ini.php | 3++-
language/es.ini.php | 1+
language/fr.ini.php | 1+
language/it.ini.php | 1+
language/ru.ini.php | 1+
objectClasses/File.class.php | 39++++++++++++++++++++++++++-------------
9 files changed, 44 insertions(+), 23 deletions(-)

diff --git a/actionClasses/FileAction.class.php b/actionClasses/FileAction.class.php @@ -162,7 +162,7 @@ class FileAction extends ObjectAction if ( ! function_exists( 'imagetypes' ) ) return 0; - $ext = strtolower($this->file->extension); + $ext = strtolower($this->file->getRealExtension()); $types = imagetypes(); $formats = array( 'gif' =>IMG_GIF, 'jpg' =>IMG_JPG, @@ -350,14 +350,16 @@ class FileAction extends ObjectAction $format = $this->imageFormat(); - if ( $format != 0 ) - $formats = $this->imageFormats(); - else - $formats = array(); + if ( $format == 0 ) + { + $this->addNotice( 'image','','IMAGE_RESIZING_UNKNOWN_TYPE',OR_NOTICE_WARN); + } + + $formats = $this->imageFormats(); if ( empty($formats) ) $this->addNotice( 'image','','IMAGE_RESIZING_NOT_AVAILABLE',OR_NOTICE_WARN); - + $sizes = array(); foreach( array(10,25,50,75,100,125,150,175,200,250,300,350,400,500,600,800) as $s ) $sizes[strval($s/100)] = $s.'%'; diff --git a/actionClasses/FilemanagerAction.class.php b/actionClasses/FilemanagerAction.class.php @@ -99,7 +99,7 @@ class FilemanagerAction extends ObjectAction Logger::debug($this->command); Logger::debug($this->resourceType); Logger::debug($this->currentFolder); - Logger::debug($this->folder->objectid); + //Logger::debug($this->folder->objectid); // Get the main request information. diff --git a/language/de.ini.php b/language/de.ini.php @@ -792,9 +792,9 @@ MENU_SEARCH_CONTENT_DESC = "Nach einem Inhalt suchen" MENU_SEARCH_CONTENT = "Inhalt" MENU_SEARCH_PROP_DESC = "Nach einer Eigenschaft suchen" MENU_SEARCH_PROP = "Eigenschaft" -MENU_SHOW_DESC = "Die Vorschau anzeigen" +MENU_SHOW_DESC = "Anzeigen" MENU_SHOW_KEY = A -MENU_SHOW = "Vorschau" +MENU_SHOW = "Anzeigen" MENU_SRC_DESC = "Quellcode" MENU_SRC_KEY = Q MENU_SRC = Quellcode @@ -910,6 +910,7 @@ NOTICE_DONE ="Der Vorgang wurde ausgefhrt." NOTICE_ERROR = "Bei der Aktion trat ein Fehler auf." NOTICE_GROUPS_MAY_CONFLICT_WITH_LDAP="Die in der Benutzerverwaltung eingetragenen Gruppenzugehrigkeiten stehen mglicherweise in Konflikt mit den Gruppenzugehrigkeiten aus dem Verzeichnisdienst. Beim Login ueber den Verzeichnisdienst werden die hier eingetragenenen Gruppenzugehrigkeiten berschrieben." NOTICE_IMAGE_RESIZED = "Das Bild wurde gendert." +NOTICE_IMAGE_RESIZING_UNKNOWN_TYPE="Das Verndern dieses Bildtyps ist leider nicht mglich." NOTICE_IMAGE_RESIZING_NOT_AVAILABLE="Das Verndern der Bildgre ist momentan nicht mglich. Bitte stellen Sie sicher, dass die GD-Bibliothek installiert ist." NOTICE_IMPORTED ="Datei wurde importiert." NOTICE_INPUT_NEW_IMAGE_SIZE = "Bitte geben Sie die neue Bildgre an, entweder Grenfaktor oder Breite oder Hhe." diff --git a/language/en.ini.php b/language/en.ini.php @@ -21,7 +21,7 @@ ACCESSKEY_MAIN_PW="P" ACCESSKEY_MAIN_RIGHTS=R ACCESSKEY_MAIN_SHOW=V ACCESSKEY_MAIN_SRC=S -ACCESSKEY_WINDOW_ACLFORM=G +ACCESSKEY_WINDOW_ACL=G ACCESSKEY_WINDOW_ADDEL=G ACCESSKEY_WINDOW_ADD=G ACCESSKEY_WINDOW_ADMINISTRATION=A @@ -1119,3 +1119,4 @@ EL_LINKDATE_DATE_PUBLISHED = "Linked object: Date/Time of last publishing" EL_LINKDATE_DATE_SAVED = "Linked object: Date/Time of last save" EL_LINKDATE_DESC = "The Link-Info-Date is a date of a linked object" EL_LINKDATE = "Link-Info-Date" +NOTICE_IMAGE_RESIZING_UNKNOWN_TYPE="This image type is not supported." diff --git a/language/es.ini.php b/language/es.ini.php @@ -1136,3 +1136,4 @@ EL_LINKDATE_DATE_PUBLISHED = "Linked object: Date/Time of last publishing" EL_LINKDATE_DATE_SAVED = "Linked object: Date/Time of last save" EL_LINKDATE_DESC = "The Link-Info-Date is a date of a linked object" EL_LINKDATE = "Link-Info-Date" +NOTICE_IMAGE_RESIZING_UNKNOWN_TYPE="This image type is not supported." diff --git a/language/fr.ini.php b/language/fr.ini.php @@ -1135,3 +1135,4 @@ EL_LINKDATE_DATE_PUBLISHED = "Linked object: Date/Time of last publishing" EL_LINKDATE_DATE_SAVED = "Linked object: Date/Time of last save" EL_LINKDATE_DESC = "The Link-Info-Date is a date of a linked object" EL_LINKDATE = "Link-Info-Date" +NOTICE_IMAGE_RESIZING_UNKNOWN_TYPE="This image type is not supported." diff --git a/language/it.ini.php b/language/it.ini.php @@ -1135,3 +1135,4 @@ EL_LINKDATE_DATE_PUBLISHED = "Linked object: Date/Time of last publishing" EL_LINKDATE_DATE_SAVED = "Linked object: Date/Time of last save" EL_LINKDATE_DESC = "The Link-Info-Date is a date of a linked object" EL_LINKDATE = "Link-Info-Date" +NOTICE_IMAGE_RESIZING_UNKNOWN_TYPE="This image type is not supported." diff --git a/language/ru.ini.php b/language/ru.ini.php @@ -1134,3 +1134,4 @@ EL_LINKDATE_DATE_PUBLISHED = "Linked object: Date/Time of last publishing" EL_LINKDATE_DATE_SAVED = "Linked object: Date/Time of last save" EL_LINKDATE_DESC = "The Link-Info-Date is a date of a linked object" EL_LINKDATE = "Link-Info-Date" +NOTICE_IMAGE_RESIZING_UNKNOWN_TYPE="This image type is not supported." diff --git a/objectClasses/File.class.php b/objectClasses/File.class.php @@ -209,20 +209,9 @@ class File extends Object global $conf; $mime_types = $conf['mime-types']; - if ( !empty($this->extension)) - { - $ext = $this->extension; - } - else - { - $pos = strrpos($this->filename,'.'); - if ( $pos === false ) - $ext = ''; - else - $ext = substr($this->filename,$pos+1); - } + - $ext = strtolower($ext); + $ext = strtolower( $this->getRealExtension() ); if ( !empty($mime_types[$ext]) ) $this->mime_type = $mime_types[$ext]; @@ -689,6 +678,30 @@ EOF parent::setTimestamp(); } + + + /** + * Ermittelt die wirksame Datei-Endung. Diese kann sich + * in der Extra-Dateiendung, aber auch direkt im Dateiname + * befinden. + * + * @return Dateiendung + */ + function getRealExtension() + { + if ( !empty($this->extension)) + { + return $this->extension; + } + else + { + $pos = strrpos($this->filename,'.'); + if ( $pos === false ) + return ''; + else + return substr($this->filename,$pos+1); + } + } } ?> \ No newline at end of file