Changeset 923

Show
Ignore:
Timestamp:
09/18/07 16:44:42 (1 year ago)
Author:
mikey
Message:

bugfixes: get list of configured frames, display page element when no part is configured for it

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisConfig.php

    r887 r923  
    132132    { 
    133133        if (isset($this->config['parts'][$part]) == true && isset($this->config['parts'][$part]['defaultElements']) == true) { 
    134             $this->config['parts'][$part]['defaultElements']; 
     134            return $this->config['parts'][$part]['defaultElements']; 
    135135        } 
    136136         
     
    158158 
    159159    /** 
     160     * returns a list of configured frames 
     161     * 
     162     * @return  string 
     163     */ 
     164    public function getFrames() 
     165    { 
     166        return array_keys($this->config['frames']); 
     167    } 
     168 
     169    /** 
    160170     * returns a list of meta tags 
    161171     * 
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisPageElement.php

    r802 r923  
    4141        } 
    4242         
     43        if (count($this->parts) == 0) { 
     44            return true; 
     45        } 
     46         
    4347        return in_array($context['part'], $this->parts); 
    4448    } 
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisProcessor.php

    r814 r923  
    147147    { 
    148148        if ($this->request->hasValue('frame') == true) { 
    149             $frame = $this->request->getValidatedValue(new stubPreSelectValidator(array_keys($this->config['frames'])), 'frame'); 
     149            $frame = $this->request->getValidatedValue(new stubPreSelectValidator(array_keys($this->config->getFrames())), 'frame'); 
     150        } elseif ($this->session->hasValue('net.stubbles.websites.memphis.frame') == true) { 
     151            $frame = $this->session->getValue('net.stubbles.websites.memphis.frame'); 
    150152        } else { 
    151153            $frame = $page->getProperty('frame'); 
  • trunk/src/test/php/net/stubbles/websites/memphis/stubMemphisPageElementTestCase.php

    r801 r923  
    8383        $context = array('part' => 'dummy'); 
    8484        $this->assertFalse($this->memphisPageElement->isAvailable($this->mockRequest, $this->mockSession, $this->mockResponse)); 
    85         $this->assertFalse($this->memphisPageElement->isAvailable($this->mockRequest, $this->mockSession, $this->mockResponse, $context)); 
     85        $this->assertTrue($this->memphisPageElement->isAvailable($this->mockRequest, $this->mockSession, $this->mockResponse, $context)); 
    8686        $this->memphisPageElement->setParts('foo,bar, baz'); 
    8787        $this->assertFalse($this->memphisPageElement->isAvailable($this->mockRequest, $this->mockSession, $this->mockResponse, $context));