Changeset 10028

Show
Ignore:
Timestamp:
11/28/08 14:39:34 (1 month ago)
Author:
afz
Message:

fix issue in adding maps in gadget upgrading stuff

Files:

Legend:

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

    r9858 r10028  
    109109        if (file_exists($file)) { 
    110110            include_once $file; 
    111             $GLOBALS['app']->Map->CreateMapFile(); 
     111            Jaws_Utils::Delete(JAWS_DATA . 'maps/core.php'); 
    112112        } 
    113113 
     
    123123    function UpdateGadgetMaps($gadget) 
    124124    { 
     125        $params = array(); 
     126        $params['gadget'] = $gadget; 
     127        $params['custom'] = false; 
     128 
     129        $sql = ' 
     130            DELETE FROM [[url_maps]] 
     131            WHERE 
     132                [gadget] = {gadget} 
     133              AND 
     134                [custom] = {custom}'; 
     135 
     136        $result = $GLOBALS['db']->query($sql, $params); 
     137        if (Jaws_Error::IsError($result)) { 
     138            $GLOBALS['app']->Session->PushLastResponse(_t('GLOBAL_ERROR_QUERY_FAILED'), RESPONSE_ERROR); 
     139            return false; 
     140        } 
     141 
    125142        $file = JAWS_PATH . 'gadgets/' . $gadget . '/Map.php'; 
    126143        if (file_exists($file)) { 
    127144            include_once $file; 
    128             $GLOBALS['app']->Map->CreateMapFile(); 
     145            Jaws_Utils::Delete(JAWS_DATA . 'maps/core.php'); 
    129146        } 
    130147 
     
    154171        } 
    155172 
    156         $GLOBALS['app']->Map->CreateMapFile(); 
     173        Jaws_Utils::Delete(JAWS_DATA . 'maps/core.php'); 
     174        Jaws_Utils::Delete(JAWS_DATA . 'maps/custom.php'); 
    157175        return true; 
    158176    }