Changeset 9929

Show
Ignore:
Timestamp:
11/14/08 14:26:12 (2 months ago)
Author:
afz
Message:

Block gadget upgrade to version 0.3.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.8/jaws/html/gadgets/Blocks/AdminModel.php

    r9921 r9929  
    6464    function UpdateGadget($old, $new) 
    6565    { 
    66         $result = $this->installSchema('schema.xml', '', "$old.xml"); 
     66        if (version_compare($old, '0.3.0', '<')) { 
     67            $result = $this->installSchema('schema.xml', '', "$old.xml"); 
     68            if (Jaws_Error::IsError($result)) { 
     69                return $result; 
     70            } 
     71 
     72            // Registry keys. 
     73            $GLOBALS['app']->Registry->DeleteKey('/gadgets/Blocks/searchable'); 
     74        } 
     75 
     76        //rename layout action 
     77        $layoutModel = $GLOBALS['app']->LoadGadget('Layout', 'AdminModel'); 
     78        $result = $layoutModel->ChangeGadgetActionName('Blocks', 'Display', 'ViewBlock'); 
    6779        if (Jaws_Error::IsError($result)) { 
    6880            return $result; 
    6981        } 
    70  
    71         // Registry keys. 
    72         $GLOBALS['app']->Registry->DeleteKey('/gadgets/Blocks/searchable'); 
    7382 
    7483        return true; 
     
    171180 
    172181        //remove cached file 
    173         $GLOBALS['app']->Cache->delete('Blocks'); 
     182        $GLOBALS['app']->Cache->delete('Blocks', 'ViewBlock', $id); 
    174183 
    175184        $GLOBALS['app']->Session->PushLastResponse(_t('BLOCKS_UPDATED', $title), RESPONSE_NOTICE); 
     
    201210 
    202211        //remove cached file 
    203         $GLOBALS['app']->Cache->delete('Blocks'); 
     212        $GLOBALS['app']->Cache->delete('Blocks', 'ViewBlock', $id); 
    204213 
    205214        $GLOBALS['app']->Session->PushLastResponse(_t('BLOCKS_DELETED', $b['title']), RESPONSE_NOTICE); 
  • branches/0.8/jaws/html/gadgets/Blocks/HTML.php

    r7926 r9929  
    4545 
    4646        $layout = $GLOBALS['app']->LoadGadget('Blocks', 'LayoutHTML'); 
    47         return $layout->Display($id); 
     47        return $layout->ViewBlock($id); 
    4848    } 
    4949} 
  • branches/0.8/jaws/html/gadgets/Blocks/Info.php

    r8755 r9929  
    1717        $this->GadgetName(_t('BLOCKS_NAME')); 
    1818        $this->GadgetDescription(_t('BLOCKS_DESC')); 
    19         $this->GadgetVersion('0.3.0'); 
     19        $this->GadgetVersion('0.3.1'); 
    2020        $this->Doc('gadget/Blocks'); 
    2121 
  • branches/0.8/jaws/html/gadgets/Blocks/LayoutHTML.php

    r9911 r9929  
    2424        if (!Jaws_Error::isError($blocks)) { 
    2525            foreach ($blocks as $b) { 
    26                 $actions['Display(' . $b['id'] . ')'] = array( 
     26                $actions['ViewBlock(' . $b['id'] . ')'] = array( 
    2727                    'mode' => 'LayoutAction', 
    2828                    'name' => $b['title'], 
     
    4141     * @return  string  Template content 
    4242     */ 
    43     function Display($id) 
     43    function ViewBlock($id) 
    4444    { 
    4545        //cache output of this action