Changeset 25013

Show
Ignore:
Timestamp:
02/04/10 14:57:50 (7 months ago)
Author:
bergie
Message:

Reduce amount of configuration and context gets from route normalization

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgardmvc/midgardmvc_core/services/configuration/yaml.php

    r24963 r25013  
    412412        } 
    413413 
     414        $enable_webdav = $this->midgardmvc->configuration->get('enable_webdav'); 
     415 
     416        $root_page = false; 
     417        if (   isset($this->midgardmvc->context->page) 
     418            && $this->midgardmvc->context->page->id == $this->midgardmvc->context->root_page->id) 
     419        { 
     420            $root_page = true; 
     421        } 
     422 
    414423        $normalized_routes = array(); 
    415424        foreach ($routes as $identifier => $route) 
     
    417426            if (   isset($route['root_only']) 
    418427                && $route['root_only'] 
    419                 && isset($this->midgardmvc->context->page) 
    420                 && $this->midgardmvc->context->page->id != $this->midgardmvc->context->root_page->id) 
     428                && !$root_page) 
    421429            { 
    422430                // Drop root-only routes from subpages 
     
    452460            } 
    453461             
    454             if (!$this->midgardmvc->configuration->get('enable_webdav')
     462            if (!$enable_webdav
    455463            { 
    456464                // Only allow GET and POST