DataObjects/Core_watch.php
[Pman.Core] / DataObjects / Images.php
index 6eef147..446fda1 100644 (file)
@@ -26,7 +26,6 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
     public $linkurl;                         // string(254)  not_null
     public $descript;                        // blob(65535)  not_null blob
     public $title;                           // string(128)  not_null
-
     
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
@@ -35,14 +34,13 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
     {
         // default permissons are to
         // allow create / edit / if the user has
+        
         if (!$au) {
             
           
             
             return false;
         }
-         
-        
         
         $o = $this->object();
         //print_r($o);
@@ -150,7 +148,6 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         ));
           
     }
-
      
     /**
      * deletes all the image instances of it...
@@ -228,6 +225,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
     }
     
     // direct via roo...
+    /// ctrl not used??
     function onUpload($ctrl)
     {
         
@@ -287,6 +285,8 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
          
     }
      
+    
+    
     /**
      * return a list of images for an object, optionally with a mime regex.
      * eg. '%/pdf' or 'image/%'
@@ -353,7 +353,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             $ff = HTML_FlexyFramework::get();
         }
         
-        $ret['public_baseURL'] = iseet($ff->Pman_Images['public_baseURL']) ?
+        $ret['public_baseURL'] = isset($ff->Pman_Images['public_baseURL']) ?
                     $ff->Pman_Images['public_baseURL'] : $ff->baseURL;
         
         if (!empty($req['query']['imagesize'])) {
@@ -392,8 +392,10 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         if (preg_match('#^http[s]*://#', $provider)) {
             $baseURL = '';
         }
-        
+       
         if ($size < 0) {
+            $provider = preg_replace('#/Thumb$#', '', $provider);
+            
             return $baseURL . $provider . "/{$this->id}/{$this->filename}";
         }
         //-- max?
@@ -428,8 +430,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             $sy = $sz[1];
         }
         // create it?
-        
-        
+         
         return '<img src="' . $this->URL($size, $provider) . '" width="'. $sx . '" height="'. $sy . '">';
         
         
@@ -448,6 +449,17 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         return $fc;
         
     }
+    
+    function fileExt()
+    {
+        require_once 'File/MimeType.php';
+        
+        $y = new File_MimeType();
+        return  $y->toExt($this->mimetype);
+        
+        
+    }
+    
     /**
      *
      *