DataObjects/Images.php
[Pman.Core] / DataObjects / Images.php
index 8a495c9..ecbb381 100644 (file)
@@ -96,35 +96,6 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             $roo->jok($r->URL(-1,'/Images') . '#attachment-'.  $r->id);
         }
         
-        if(isset($q['_auto_save'])){
-            require_once 'System.php';
-            
-            $tmpdir  = System::mktemp("-d auto_save");
-            
-            $path = $tmpdir . '/' . time() . '.json';
-            
-            if(!file_exists($path)){
-               file_put_contents($path, $q['_source']); 
-            }
-            
-             $imageInfo = getimagesize($path);
-            
-            require_once 'File/MimeType.php';
-            $y = new File_MimeType();
-            $ext = $y->toExt(trim((string) $imageInfo['mime'] ));
-            
-            if (!preg_match("/\." . $ext."$/", $path, $matches)) {
-                rename($path,$path.".".$ext);
-                $path.= ".".$ext;
-            }
-            
-            if (!$this->createFrom($path)) {
-                $roo->jerr("error on auto save making image");
-            }
-            
-            $roo->addEvent("AUTOSAVE", $this, $this->toEventString());
-        }
-        
     }
     
      
@@ -392,6 +363,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         if (!empty($mime_like)) {
             $c->whereAdd("Images.mimetype LIKE '". $c->escape($mime_like) ."'");
         }
+        $c->orderBy('created DESC');
 
         return $c->fetchAll();
     }