Changeset 10001

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

synchronizing some other gadgets with branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/jaws/html/gadgets/Preferences/HTML.php

    r9217 r10001  
    5959    } 
    6060} 
    61 ?> 
  • trunk/jaws/html/gadgets/ServerTime/HTML.php

    r9217 r10001  
    3333    } 
    3434} 
    35 ?> 
  • trunk/jaws/html/gadgets/Skeleton/HTML.php

    r9218 r10001  
    3333    }   
    3434} 
    35 ?> 
  • trunk/jaws/html/gadgets/Skeleton/Model.php

    r9218 r10001  
    2424    } 
    2525} 
    26 ?> 
  • trunk/jaws/html/gadgets/StaticPage/AdminModel.php

    r9349 r10001  
    306306        $result = $GLOBALS['db']->query($sql, $params); 
    307307        if (Jaws_Error::IsError($result)) { 
     308            $GLOBALS['app']->Session->PushLastResponse(_t('STATICPAGE_ERROR_PAGE_NOT_ADDED'), RESPONSE_ERROR); 
    308309            return new Jaws_Error(_t('STATICPAGE_ERROR_PAGE_NOT_ADDED'), _t('STATICPAGE_NAME')); 
    309310        } 
     
    380381        $params['id']         = (int)$id; 
    381382        $params['language']   = $language; 
    382         $params['fast_url'] = $fast_url; 
     383        $params['fast_url']   = $fast_url; 
    383384        $params['show_title'] = (bool)$show_title; 
    384385        $params['now']        = MDB2_Date::mdbNow(); 
  • trunk/jaws/html/gadgets/StaticPage/Model.php

    r9334 r10001  
    271271    } 
    272272 
    273     /** 
    274      * Find a record related on fast url 
    275      * 
    276      * @access  public 
    277      * @param   string  $fasturl    The FastURL string 
    278      * @return  array   An array containing the page info and Jaws_Error on error 
    279      */ 
    280     function GetFastURL($fasturl) 
    281     { 
    282         $params = array(); 
    283         $params['fasturl'] = $fasturl; 
    284  
    285         $sql = ' 
    286             SELECT 
    287                 [page_id] as id, [title], [fast_url] 
    288             FROM [[static_pages]] 
    289             WHERE [fast_url] = {fasturl}'; 
    290  
    291         $types = array('integer', 'text', 'text'); 
    292  
    293         $res = $GLOBALS['db']->queryRow($sql, $params, $types); 
    294         if (Jaws_Error::IsError($res)) { 
    295             return false; 
    296         } 
    297  
    298         return $res; 
    299     } 
    300273} 
  • trunk/jaws/html/gadgets/VisitCounter/AdminModel.php

    r8212 r10001  
    8484        } 
    8585 
    86         // Registry keys. 
    87         $GLOBALS['app']->Registry->NewKey('/gadgets/VisitCounter/visit_counters',  'online,today,total'); 
    88         $GLOBALS['app']->Registry->NewKey('/gadgets/VisitCounter/custom_text',  
    89                                           $GLOBALS['app']->Registry->Get('/gadgets/VisitCounter/custom')); 
    90         $GLOBALS['app']->Registry->DeleteKey('/gadgets/VisitCounter/online'); 
    91         $GLOBALS['app']->Registry->DeleteKey('/gadgets/VisitCounter/today'); 
    92         $GLOBALS['app']->Registry->DeleteKey('/gadgets/VisitCounter/total'); 
    93         $GLOBALS['app']->Registry->DeleteKey('/gadgets/VisitCounter/custom'); 
     86        if (version_compare($old, '0.8.0', '<')) { 
     87            // Registry keys. 
     88            $GLOBALS['app']->Registry->NewKey('/gadgets/VisitCounter/visit_counters',  'online,today,total'); 
     89            $GLOBALS['app']->Registry->NewKey('/gadgets/VisitCounter/custom_text',  
     90                                              $GLOBALS['app']->Registry->Get('/gadgets/VisitCounter/custom')); 
     91            $GLOBALS['app']->Registry->DeleteKey('/gadgets/VisitCounter/online'); 
     92            $GLOBALS['app']->Registry->DeleteKey('/gadgets/VisitCounter/today'); 
     93            $GLOBALS['app']->Registry->DeleteKey('/gadgets/VisitCounter/total'); 
     94            $GLOBALS['app']->Registry->DeleteKey('/gadgets/VisitCounter/custom'); 
     95        } 
     96 
     97        // fix using Y-m-d G:i:s instead of Y-m-d H:i:s in version 0.6.x 
     98        $startDate = $GLOBALS['app']->Registry->Get('/gadgets/VisitCounter/start'); 
     99        if (strlen($startDate) == 18) { 
     100            $startDate = substr_replace($startDate, '0', 11, 0); 
     101            $GLOBALS['app']->Registry->Set('/gadgets/VisitCounter/start', $startDate); 
     102        } 
    94103 
    95104        return true; 
     
    194203    } 
    195204} 
    196 ?> 
  • trunk/jaws/html/gadgets/VisitCounter/HTML.php

    r9218 r10001  
    3434    } 
    3535} 
    36 ?> 
  • trunk/jaws/html/gadgets/VisitCounter/Info.php

    r9218 r10001  
    1818        $this->GadgetName(_t('VISITCOUNTER_NAME')); 
    1919        $this->GadgetDescription(_t('VISITCOUNTER_DESC')); 
    20         $this->GadgetVersion('0.8.0'); 
     20        $this->GadgetVersion('0.8.1'); 
    2121        $this->Doc('gadget/VisitCounter'); 
    2222 
  • trunk/jaws/html/gadgets/VisitCounter/Model.php

    r9218 r10001  
    154154    function GetStartDate() 
    155155    { 
    156         $rs = $GLOBALS['app']->Registry->Get('/gadgets/VisitCounter/start');        
     156        $rs = $GLOBALS['app']->Registry->Get('/gadgets/VisitCounter/start'); 
    157157        if (!$rs || Jaws_Error::IsError($rs)) { 
    158158            $rs = date('Y-m-d H:i:s'); 
  • trunk/jaws/html/gadgets/Weather/HTML.php

    r9218 r10001  
    3535    } 
    3636} 
    37 ?>