commit d13c4523d86a36f402a6b6775e5805e9892a52cd
parent b10f4f4414fa8b2006f9ae0a70d27df541bd2814
Author: dankert <devnull@localhost>
Date: Mon, 20 Dec 2004 21:01:20 +0100
Benutzen von switch() in filename()
Diffstat:
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/objectClasses/Object.class.php b/objectClasses/Object.class.php
@@ -20,7 +20,10 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------
// $Log$
-// Revision 1.13 2004-12-19 15:23:56 dankert
+// Revision 1.14 2004-12-20 20:01:20 dankert
+// Benutzen von switch() in filename()
+//
+// Revision 1.13 2004/12/19 15:23:56 dankert
// Anpassung Session-Funktionen
//
// Revision 1.12 2004/12/15 23:18:09 dankert
@@ -352,16 +355,24 @@ class Object
{
global $conf;
- if ( $conf['publish']['filename'] == 'id' )
- $this->filename = $this->objectid;
- elseif ( $conf['publish']['filename'] == 'crc32' )
- $this->filename = crc32($this->objectid);
- elseif ( $conf['publish']['filename'] == 'md5' )
- $this->filename = md5($this->objectid);
- elseif ( $conf['publish']['filename'] == 'ss' )
- $this->filename = '0,'.abs(crc32($this->objectid)).','.abs(crc32($this->objectid+1)).',00';
-
- if ($this->filename != '')
+
+ switch( $conf['publish']['filename'] )
+ {
+ case 'crc32':
+ $this->filename = crc32($this->objectid);
+ break;
+ case 'md5':
+ $this->filename = md5($this->objectid);
+ break;
+ case 'ss':
+ $this->filename = '0,'.abs(crc32($this->objectid)).','.abs(crc32($this->objectid+1)).',00';
+ break;
+ case 'id':
+ $this->filename = $this->objectid;
+ break;
+ }
+
+ if ( $this->filename != '' )
return $this->filename;
$this->load();