Changeset 57056

Show
Ignore:
Timestamp:
29/06/08 14:18:56 (2 months ago)
Author:
ischommer
Message:

ENHANCEMENT Added has_many fields to SiteTree? Decorators (Versioned, Hierarchy) so they are detected by DataFormatter?
ENHANCEMENT Added $searchable_fields to SiteTree?

Location:
modules/sapphire/branches/roa/core/model
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • modules/sapphire/branches/roa/core/model/Hierarchy.php

    r49795 r57056  
    2323         
    2424        function augmentWrite(&$manipulation) { 
     25        } 
     26         
     27        function extraDbFields() { 
     28                return array( 
     29                        'has_many' => array( 
     30                                'Children' => 'SiteTree', 
     31                                'StageChildren' => 'SiteTree', 
     32                                'LiveChildren' => 'SiteTree', 
     33                        ) 
     34                ); 
    2535        } 
    2636 
  • modules/sapphire/branches/roa/core/model/SiteTree.php

    r55671 r57056  
    185185         */ 
    186186        public static $breadcrumbs_delimiter = " » "; 
     187         
     188        static $searchable_fields = array( 
     189                'Title', 
     190        ); 
    187191 
    188192 
     
    564568         * @return boolean True if the current user can view this page. 
    565569         */ 
    566         public function canView($member) { 
     570        public function canView($member = null) { 
    567571                return $this->can('view'); 
    568572        } 
     
    652656        /** 
    653657         * Return the title, description, keywords and language metatags. 
     658         *  
     659         * @todo Make generator tag dynamically determine version number (currently defaults to "2.0") 
     660         * @todo Move <title> tag in separate getter for easier customization and more obvious usage 
     661         *  
    654662         * @param boolean|string $includeTitle Show default <title>-tag, set to false for custom templating 
    655          * 
    656663         * @param boolean $includeTitle Show default <title>-tag, set to false for 
    657664         *                              custom templating 
  • modules/sapphire/branches/roa/core/model/Versioned.php

    r50723 r57056  
    5353                $this->defaultStage = reset($stages); 
    5454                $this->liveStage = array_pop($stages); 
     55        } 
     56         
     57        function extraDbFields() { 
     58                return array( 
     59                        'has_many' => array( 
     60                                'Versions' => 'SiteTree', 
     61                        ) 
     62                ); 
    5563        } 
    5664         
     
    434442        } 
    435443         
     444        function Versions($filter = "") { 
     445                return $this->allVersions($filter); 
     446        } 
     447         
    436448        /** 
    437449         * Return a list of all the versions available.