Show
Ignore:
Timestamp:
06/06/10 14:41:17 (2 years ago)
Author:
ort
Message:

доработка плагина Page

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/page/classes/modules/page/mapper/Page.mapper.class.php

    r934 r935  
    100100        } 
    101101         
    102         public function GetPages() { 
     102        public function GetPages($aFilter) { 
     103                $sPidNULL=''; 
     104                if (array_key_exists('pid',$aFilter) and is_null($aFilter['pid'])) { 
     105                        $sPidNULL='and page_pid IS NULL'; 
     106                } 
    103107                $sql = "SELECT  
    104108                                        *,                                       
     
    106110                                        page_pid as PARENT_KEY 
    107111                                FROM  
    108                                         ".Config::Get('plugin.page.table.page')."                                
     112                                        ".Config::Get('plugin.page.table.page')."  
     113                                WHERE  
     114                                        1=1 
     115                                        { and page_active = ?d }                                         
     116                                        { and page_main = ?d }   
     117                                        { and page_pid = ? } {$sPidNULL}                                 
    109118                                ORDER by page_sort desc;         
    110119                                        "; 
    111                 if ($aRows=$this->oDb->select($sql)) { 
     120                if ($aRows=$this->oDb->select($sql, 
     121                                isset($aFilter['main']) ? $aFilter['main']:DBSIMPLE_SKIP, 
     122                                isset($aFilter['active']) ? $aFilter['active']:DBSIMPLE_SKIP, 
     123                                (array_key_exists('pid',$aFilter) and !is_null($aFilter['pid'])) ? $sPid : DBSIMPLE_SKIP 
     124                                )) { 
    112125                        return $aRows; 
    113126                }