DataObjects/I18n.php
[Pman.Core] / DataObjects / Images.php
index ec3083e..7687cfe 100644 (file)
@@ -82,6 +82,10 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
                 $roo->jerr("erro making image" . $q['_remote_upload']);
             }
             
+            if(!empty($q['_return_after_create'])){
+                return;
+            }
+            
             $roo->addEvent("ADD", $this, $this->toEventString());
         
             $r = DB_DataObject::factory($this->tableName());
@@ -94,7 +98,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         
     }
     
-    
+     
     /**
      * create an email from file.
      * these must have been set first.
@@ -144,12 +148,8 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
             $this->update();
         }
         
-        if(file_exists($file)){
-            print_r('in');
-        }else{
-            print_('not');
-        }
-        exit;
+        
+        
         $f = $this->getStoreName();
         $dest = dirname($f);
         if (!file_exists($dest)) {
@@ -357,7 +357,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)) {
@@ -501,7 +501,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..
      *