DataObjects/core.sql
[Pman.Core] / DataObjects / Images.php
index 20ad83a..287b1c9 100644 (file)
@@ -94,7 +94,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         
     }
     
-    
+     
     /**
      * create an email from file.
      * these must have been set first.
@@ -264,7 +264,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
     /// ctrl not used??
     function onUpload($roo)
     {
-        
+//        echo $_FILES['imageUpload']['type'];exit;
         if (empty($_FILES['imageUpload']['tmp_name']) || 
             empty($_FILES['imageUpload']['name']) || 
             empty($_FILES['imageUpload']['type'])
@@ -485,8 +485,15 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             $sy = $sz[1];
         }
         // create it?
-         
-        return '<img src="' . $this->URL($size, $provider) . '" width="'. $sx . '" height="'. $sy . '">';
+        $extra = '';
+        if (strlen($this->title)) {
+            $extra = ' title="'. htmlspecialchars($this->title) . '"';
+        }
+        
+        return '<img src="' . $this->URL($size, $provider) . '"' .
+                $extra .
+                ' width="'. $sx . '"' .
+                ' height="'. $sy . '">';
         
         
     }
@@ -526,10 +533,6 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
     {
         // not sure why we do this.. 
         
-        
-        
-        
-        
         // if imgtype starts with '-' ? then we set the 'old' (probably to delete later)
         if (!empty($ar['imgtype']) && !empty($ar['ontable']) && !empty($ar['onid']) && ($ar['imgtype'][0] == '-')) {
             $this->setFrom($ar);