Dotclear

Changeset 833:e52d87b4cbd1


Ignore:
Timestamp:
05/24/12 09:04:39 (13 years ago)
Author:
Dsls <dsls@…>
Branch:
default
Children:
835:dbc60fa508df, 836:3a54ff018a83
Message:

Small tuning in scheduled entries management,
Updated TemplatePrepareParams? behavior

Location:
inc
Files:
2 edited

Legend:

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

    r831 r833  
    672672          $params = new ArrayObject($params); 
    673673          $this->core->callBehavior('coreBlogBeforeGetPosts',$params); 
    674           $params = (array)$params; 
    675674 
    676675          if ($count_only) 
     
    13931392           
    13941393          $now = dt::toUTC(time()); 
    1395           $to_change = array(); 
    1396            
     1394          $to_change = new ArrayObject(); 
     1395 
    13971396          if ($rs->isEmpty()) { 
    13981397               return; 
     
    14121411               } 
    14131412          } 
    1414            
    1415           if (!empty($to_change)) 
     1413          if (count($to_change)) 
    14161414          { 
    14171415               # --BEHAVIOR-- coreBeforeScheduledEntriesPublish 
    1418                $to_change = new ArrayObject($to_change); 
    14191416               $this->core->callBehavior('coreBeforeScheduledEntriesPublish',$this,$to_change); 
    1420                $to_change = (array)$to_change; 
    14211417 
    14221418               $strReq = 
     
    14241420               'post_status = 1 '. 
    14251421               "WHERE blog_id = '".$this->con->escape($this->id)."' ". 
    1426                'AND post_id '.$this->con->in($to_change).' '; 
    1427                 
     1422               'AND post_id '.$this->con->in((array)$to_change).' '; 
    14281423               $this->con->execute($strReq); 
    14291424               $this->triggerBlog(); 
    14301425 
    14311426               # --BEHAVIOR-- coreAfterScheduledEntriesPublish 
    1432                $to_change = new ArrayObject($to_change); 
    14331427               $this->core->callBehavior('coreAfterScheduledEntriesPublish',$this,$to_change); 
    14341428          } 
  • inc/public/class.dc.template.php

    r779 r833  
    572572          $res = "<?php\n"; 
    573573          $res .= $p; 
    574           $res .= $this->core->callBehavior("templatePrepareParams","Archives", $attr,$content); 
     574          $res .= $this->core->callBehavior("templatePrepareParams",  
     575               array("tag" => "Archives","method" => "blog::getDates"),  
     576               $attr,$content); 
    575577          $res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);'."\n"; 
    576578          $res .= "?>\n"; 
     
    680682          $res = "<?php\n"; 
    681683          $res .= $p; 
    682           $res .= $this->core->callBehavior("templatePrepareParams","ArchiveNext", $attr, $content); 
     684          $res .= $this->core->callBehavior("templatePrepareParams", 
     685               array("tag" => "ArchiveNext","method" => "blog::getDates"),  
     686               $attr, $content); 
    683687          $res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);'."\n"; 
    684688          $res .= "?>\n"; 
     
    717721           
    718722          $res = "<?php\n"; 
    719           $res .= $this->core->callBehavior("templatePrepareParams","ArchivePrevious", $attr, $content); 
     723          $res .= $this->core->callBehavior("templatePrepareParams", 
     724               array("tag" => "ArchivePrevious","method" => "blog::getDates"),  
     725               $attr, $content); 
    720726          $res .= $p; 
    721727          $res .= '$_ctx->archives = $core->blog->getDates($params); unset($params);'."\n"; 
     
    940946          $res = "<?php\n"; 
    941947          $res .= $p; 
    942           $res .= $this->core->callBehavior("templatePrepareParams","Categories", $attr, $content); 
     948          $res .= $this->core->callBehavior("templatePrepareParams",  
     949               array("tag" => "Categories","method" => "blog::getCategories"),  
     950               $attr,$content); 
    943951          $res .= '$_ctx->categories = $core->blog->getCategories($params);'."\n"; 
    944952          $res .= "?>\n"; 
     
    12101218          $res = "<?php\n"; 
    12111219          $res .= $p; 
    1212           $res .= $this->core->callBehavior("templatePrepareParams","Entries",$attr,$content); 
     1220          $res .= $this->core->callBehavior("templatePrepareParams",  
     1221               array("tag" => "Entries","method" => "blog::getPosts"),  
     1222               $attr,$content); 
    12131223          $res .= '$_ctx->post_params = $params;'."\n"; 
    12141224          $res .= '$_ctx->posts = $core->blog->getPosts($params); unset($params);'."\n"; 
     
    18801890          $res = "<?php\n"; 
    18811891          $res .= $p; 
    1882           $res .= $this->core->callBehavior("templatePrepareParams","Languages",$attr,$content); 
     1892          $res .= $this->core->callBehavior("templatePrepareParams",  
     1893               array("tag" => "Languages","method" => "blog::getLangs"),  
     1894               $attr,$content); 
    18831895          $res .= '$_ctx->langs = $core->blog->getLangs($params); unset($params);'."\n"; 
    18841896          $res .= "?>\n"; 
     
    19551967          $p = "<?php\n"; 
    19561968          $p .= '$params = $_ctx->post_params;'."\n"; 
     1969          $p .= $this->core->callBehavior("templatePrepareParams",  
     1970               array("tag" => "Pagination","method" => "blog::getPosts"),  
     1971               $attr,$content); 
    19571972          $p .= '$_ctx->pagination = $core->blog->getPosts($params,true); unset($params);'."\n"; 
    19581973          $p .= "?>\n"; 
     
    19641979          return 
    19651980               $p. 
    1966                $this->core->callBehavior("templatePrepareParams","Pagination",$attr,$content). 
    19671981               '<?php if ($_ctx->pagination->f(0) > $_ctx->posts->count()) : ?>'. 
    19681982               $content. 
     
    21042118           
    21052119          $res = "<?php\n"; 
    2106           $res .= $this->core->callBehavior("templatePrepareParams","Comments",$attr,$content); 
     2120          $res .= $this->core->callBehavior("templatePrepareParams",  
     2121               array("tag" => "Comments","method" => "blog::getComments"),  
     2122               $attr,$content); 
    21072123          $res .= $p; 
    21082124          $res .= '$_ctx->comments = $core->blog->getComments($params); unset($params);'."\n"; 
     
    27042720          $res = "<?php\n"; 
    27052721          $res .= $p; 
    2706           $res .= $this->core->callBehavior("templatePrepareParams","Pings",$attr,$content); 
     2722          $res .= $this->core->callBehavior("templatePrepareParams",  
     2723               array("tag" => "Pings","method" => "blog::getComments"),  
     2724               $attr,$content); 
    27072725          $res .= '$_ctx->pings = $core->blog->getComments($params); unset($params);'."\n"; 
    27082726          $res .= "if (\$_ctx->posts !== null) { \$core->blog->withoutPassword(true);}\n"; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map