DataObjects/Core_watch.php
[Pman.Core] / DataObjects / Images.php
index 6df7804..e79ce72 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.
@@ -353,7 +353,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         }
         
         $c = clone($this);
-        $c->ontable = $obj->tableName();
+        $c->whereAddIn($this->tableName() . '.ontable', array( $obj->tableName(), $obj->__table) , 'string');
         $c->onid = $obj->id;
         $c->autoJoin();
         if (!empty($mime_like)) {
@@ -497,7 +497,25 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         
         
     }
-     
+    
+    /**
+     * 
+     * #2142 [new] CMS - image link urls
+     * 
+     * 
+     * 
+     */
+    function toLinkHTML($size, $provider = '/Images/Thumb')
+    {
+        if(empty($this->linkurl)){
+            return $this->toHTML($size, $provider = '/Images/Thumb');
+        }
+        
+        return '<a href="'.$this->linkurl.'" target="_blank">'.$this->toHTML($size, $provider = '/Images/Thumb').'</a>';
+        
+    }
+    
+    
     /**
      * to Fileconvert object..
      *