openrat-cms

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

commit a10e9eb5650fece0afb62a0ed513025f9ea39eb1
parent 654116ed2b3d83c206dc6024d561961e956ad3cb
Author: dankert <devnull@localhost>
Date:   Sun, 23 Dec 2007 17:05:58 +0100

Anzeigen der Datei-Eigenschaften sowie Dialog f?r Bildgr??en-?nderung verbessert.

Diffstat:
actionClasses/FileAction.class.php | 37++++++++++++++++++++++++++++++-------
actionClasses/FileAction.ini.php | 2+-
objectClasses/File.class.php | 4++--
themes/default/css/default.css | 6++++--
themes/default/templates/file/prop.tpl.src.php | 6+++---
themes/default/templates/file/showprop.tpl.src.php | 85+++++++++++++++++++++++++++++++++++++++++++------------------------------------
themes/default/templates/file/size.tpl.src.php | 59+++++++++++++++++++++++++++++++++++------------------------
7 files changed, 121 insertions(+), 78 deletions(-)

diff --git a/actionClasses/FileAction.class.php b/actionClasses/FileAction.class.php @@ -207,14 +207,33 @@ class FileAction extends ObjectAction $height = intval($this->getRequestVar('height' )); $jpegcompression = $this->getRequestVar('jpeg_compression') ; $format = $this->getRequestVar('format' ) ; - $factor = $this->getRequestVar('factor' ) ; + $factor = $this->getRequestVar('factor' ) ; + + if ( $this->getRequestVar('factor') == '1' && + ! $this->hasRequestVar('width' ) && + ! $this->hasRequestVar('height') ) + { + $this->addValidationError('factor','INPUT_NEW_IMAGE_SIZE'); + $this->addValidationError('width','' ); + $this->addValidationError('height',''); + $this->callSubAction('size'); + return; + } + + if ( $this->hasRequestVar('copy') ) + { + // Datei neu anlegen. + $this->file->name = lang('copy_of').' '.$this->file->name; + $this->file->filename = $this->file->filename.'_resized_'.time(); + $this->file->add(); + Session::setObject( $this->file ); + } $this->file->imageResize( intval($width),intval($height),$factor,$this->imageFormat(),$format,$jpegcompression ); $this->file->save(); // Um z.B. Groesse abzuspeichern $this->file->saveValue(); $this->addNotice($this->file->getType(),$this->file->name,'IMAGE_RESIZED','ok'); - $this->callSubAction('edit'); } @@ -240,6 +259,7 @@ class FileAction extends ObjectAction // Eigenschaften der Datei uebertragen $this->setTemplateVars( $this->file->getProperties() ); + $this->setTemplateVar('size',number_format($this->file->size/1000,0,',','.').' kB' ); $this->setTemplateVar('full_filename',$this->file->full_filename()); // Alle Seiten mit dieser Datei ermitteln @@ -306,10 +326,7 @@ class FileAction extends ObjectAction $formats = array(); $sizes = array(); - foreach( array(10,25,50,75) as $s ) - $sizes[strval($s/100)] = $s.'%'; - $sizes[1] = '-'; - foreach( array(125,150,175,200,250,300,350,400,500,600,800) as $s ) + 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.'%'; $jpeglist = array(); @@ -319,7 +336,13 @@ class FileAction extends ObjectAction $this->setTemplateVar('factors' ,$sizes ); $this->setTemplateVar('jpeglist' ,$jpeglist ); $this->setTemplateVar('formats' ,$formats ); - $this->setTemplateVar('format' ,$format ); + $this->setTemplateVar('format' ,$format ); + $this->setTemplateVar('factor' ,1 ); + + $this->file->getImageSize(); + $this->setTemplateVar('width' ,$this->file->width ); + $this->setTemplateVar('height',$this->file->height ); + $this->setTemplateVar('type' ,'input' ); } diff --git a/actionClasses/FileAction.ini.php b/actionClasses/FileAction.ini.php @@ -84,6 +84,6 @@ goto=edit [menu] edit=edit,editvalue,compress,uncompress,extract -prop=showprop,prop,remove,size +prop=showprop,prop,size rights=rights,aclform pub=pub \ No newline at end of file diff --git a/objectClasses/File.class.php b/objectClasses/File.class.php @@ -632,9 +632,9 @@ EOF function setTimestamp() { - unlink( $this->tmpfile() ); + @unlink( $this->tmpfile() ); - $parent->setTimestamp(); + $this->setTimestamp(); } } diff --git a/themes/default/css/default.css b/themes/default/css/default.css @@ -366,7 +366,8 @@ textarea.longtext } /* Eingabfeld für Namen */ -input.name +input.name, +td.name { font-weight:bold; } @@ -374,7 +375,8 @@ input.name /* Eingabfeld für Dateiname */ input.filename, input.extension, -input.ansidate +input.ansidate, +td.filename { font-family:Courier; font-size:13px; diff --git a/themes/default/templates/file/prop.tpl.src.php b/themes/default/templates/file/prop.tpl.src.php @@ -1,6 +1,6 @@ page form - window icon:folder widths:50%,50% + window icon:folder widths:40%,60% width:70% row cell text text:global_name @@ -21,7 +21,7 @@ page text text:global_description cell inputarea name:description class:description - row class: - cell colspan:2 + row + cell colspan:2 class:act button type:ok focus field:name \ No newline at end of file diff --git a/themes/default/templates/file/showprop.tpl.src.php b/themes/default/templates/file/showprop.tpl.src.php @@ -1,59 +1,66 @@ page - window icon:folder widths:50%,50% + window icon:folder widths:40%,60% width:70% row - cell class:fx + cell text text:global_name - cell class:fx + cell class:name text var:name row - cell class:fx - text text:global_filename - cell class:fx - text var:filename - row - cell class:fx - text text:file_extension - cell class:fx - text var:extension - row - cell class:fx + cell text text:global_description - cell class:fx + cell text var:description row - cell class:fx - text text:global_created - cell class:fx - date date:create_date - text raw:,_ - user user:create_user + cell + text text:global_full_filename + cell class:filename + text var:full_filename + row + cell colspan:2 + fieldset title:message:prop_userinfo + row + cell + text text:global_created + cell + table + row + cell + image icon:el_date + date date:var:create_date + cell + image icon:user + user user:var:create_user + row + cell + text text:global_lastchange + cell + table + row + cell + image icon:el_date + date date:var:lastchange_date + cell + image icon:user + user user:var:lastchange_user + row + cell colspan:2 + fieldset title:message:additional_info row - cell class:fx - text text:global_lastchange - cell class:fx - date date:lastchange_date - text raw:,_ - user user:lastchange_user - - row - cell class:fx + cell text text:FILE_SIZE - cell class:fx -RAW -<?php echo number_format($size/1000,0,',','.') ?> kB -END - + cell + text var:size row - cell class:fx + cell text text:FILE_mimetype - cell class:fx + cell class:filename text var:mimetype row - cell class:fx + cell text text:FILE_PAGES - cell class:fx + cell list list:pages extract:true link url:url target:cms_main image type:page diff --git a/themes/default/templates/file/size.tpl.src.php b/themes/default/templates/file/size.tpl.src.php @@ -1,53 +1,63 @@ page form - window + window width:70% widths:5%,40%,55% row cell colspan:2 - fieldset title:message:IMAGE_NEW_SIZE + text text:IMAGE_OLD_SIZE + cell + text text:var:width + text raw:_*_ + text text:var:height row + cell colspan:3 + fieldset title:message:IMAGE_NEW_SIZE + row + cell + radio name:type value:factor cell - label for:factor + label for:type_factor text text:FILE_IMAGE_SIZE_FACTOR cell - set var:factor value:1 selectbox name:factor list:factors - - row - cell - label for:width - text text:FILE_IMAGE_NEW_WIDTH - cell - input name:width - - row + set var:factor value:1 + + row + cell + radio name:type value:input cell - label for:height - text text:FILE_IMAGE_NEW_HEIGHT + label for:type_input + text text:FILE_IMAGE_NEW_WIDTH_HEIGHT cell - input name:height + input name:width size:10 + text raw:_*_ + input name:height size:10 row - cell colspan:2 + cell colspan:3 fieldset title:message:options row - cell + cell colspan:2 label for:format text text:FILE_IMAGE_FORMAT cell selectbox name:format list:formats row - cell + cell colspan:2 label for:jpeglist_compression text text:FILE_IMAGE_JPEG_COMPRESSION cell set var:jpeg_compression value:70 selectbox list:jpeglist name:jpeg_compression row - cell class:act colspan:2 + cell + cell + cell + checkbox name:copy + label for:copy + text text:message:copy + row + cell class:act colspan:3 button type:ok - focus field:width - - - + focus field:width+ \ No newline at end of file