Changeset 9930

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

Poll gadget upgrade to version 0.8.1

Files:

Legend:

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

    r9926 r9930  
    7575    function UpdateGadget($old, $new) 
    7676    { 
    77         $result = $this->installSchema('schema.xml', '', "$old.xml"); 
     77        if (version_compare($old, '0.8.0', '<')) { 
     78            $result = $this->installSchema('schema.xml', '', "$old.xml"); 
     79            if (Jaws_Error::IsError($result)) { 
     80                return $result; 
     81            } 
     82 
     83            $result = $this->installSchema('insert.xml', '', 'schema.xml', true); 
     84            if (Jaws_Error::IsError($result)) { 
     85                return $result; 
     86            } 
     87 
     88            // ACL keys 
     89            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Poll/ManagePolls',  'true'); 
     90            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Poll/ManageGroups', 'true'); 
     91            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Poll/ViewReports',  'true'); 
     92            $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Poll/AddPoll'); 
     93            $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Poll/EditPoll'); 
     94            $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Poll/DeletePoll'); 
     95            $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Poll/UpdateProperties'); 
     96 
     97            // Registry keys. 
     98            $GLOBALS['app']->Registry->NewKey('/gadgets/Poll/cookie_period',  '150'); 
     99        } 
     100 
     101        //rename layout action 
     102        $layoutModel = $GLOBALS['app']->LoadGadget('Layout', 'AdminModel'); 
     103        $result = $layoutModel->ChangeGadgetActionName('Poll', 'Display', 'ViewPoll'); 
    78104        if (Jaws_Error::IsError($result)) { 
    79105            return $result; 
    80106        } 
    81  
    82         $result = $this->installSchema('insert.xml', '', 'schema.xml', true); 
    83         if (Jaws_Error::IsError($result)) { 
    84             return $result; 
    85         } 
    86  
    87         // ACL keys 
    88         $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Poll/ManagePolls',  'true'); 
    89         $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Poll/ManageGroups', 'true'); 
    90         $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Poll/ViewReports',  'true'); 
    91         $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Poll/AddPoll'); 
    92         $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Poll/EditPoll'); 
    93         $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Poll/DeletePoll'); 
    94         $GLOBALS['app']->ACL->DeleteKey('/ACL/gadgets/Poll/UpdateProperties'); 
    95  
    96         // Registry keys. 
    97         $GLOBALS['app']->Registry->NewKey('/gadgets/Poll/cookie_period',  '150'); 
    98107 
    99108        return true; 
  • branches/0.8/jaws/html/gadgets/Poll/Info.php

    r8755 r9930  
    1717        $this->GadgetName(_t('POLL_NAME')); 
    1818        $this->GadgetDescription(_t('POLL_DESCRIPTION')); 
    19         $this->GadgetVersion('0.8.0'); 
     19        $this->GadgetVersion('0.8.1'); 
    2020        $this->Doc('gadget/Poll'); 
    2121