Dotclear


Ignore:
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.media.php

    r1220 r1268  
    497497     @param    post_id   <b>integer</b>      Post ID 
    498498     @param    media_id  <b>integer</b>      Optionnal media ID 
    499      @return   <b>array</b> Array of fileItems 
    500      */ 
    501      public function getPostMedia($post_id,$media_id=null) 
     499     @param    $returnRs <b>boolean</b>      Whether to return a resultset (true) or an array (false, default value). 
     500     @return   <b>array</b> Array or ResultSet of fileItems 
     501     */ 
     502     public function getPostMedia($post_id,$media_id=null,$returnRs=false) 
    502503     { 
    503504          $params = array( 
     
    515516               $f = $this->fileRecord($rs); 
    516517               if ($f !== null) { 
    517                     $res[] = new ArrayObject($f); 
    518                } 
    519           } 
    520            
    521           return $res; 
     518                    $res[] = $returnRs ? new ArrayObject($f) : $f; 
     519               } 
     520          } 
     521           
     522          return $returnRs ? staticRecord::newFromArray($res) : $res; 
    522523     } 
    523524      
  • plugins/attachments/_public.php

    r1221 r1266  
    4040          "<?php\n". 
    4141          'if ($_ctx->posts !== null && $core->media) {'."\n". 
    42           '$_ctx->attachments = staticRecord::newFromArray($core->media->getPostMedia($_ctx->posts->post_id));'."\n". 
     42          '$_ctx->attachments = $core->media->getPostMedia($_ctx->posts->post_id, null, true);'."\n". 
    4343          "?>\n". 
    4444           
     
    4646          '<?php while ($_ctx->attachments->fetch()) : ?>'. 
    4747           
    48           '<?php $GLOBALS[\'attach_i\'] = $attach_i; $attach_f = $_ctx->attachments->row(); $GLOBALS[\'attach_f\'] = $attach_f;'. // LEGACY 
     48          '<?php $GLOBALS[\'attach_i\'] = $attach_i; $attach_f = $_ctx->attachments; $GLOBALS[\'attach_f\'] = $attach_f;'. // LEGACY 
    4949          '$_ctx->file_url = $attach_f->file_url; ?>'. // LEGACY 
    5050          $content. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map