Changeset 16392

Show
Ignore:
Timestamp:
05/16/08 13:48:32 (2 months ago)
Author:
rambo
Message:

forward porting r16391

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/net.nehmer.blog/handler/admin.php

    r14385 r16392  
    226226    { 
    227227        $this->_article = new midcom_db_article($args[0]); 
     228        /* 
     229        $qb = midcom_db_article::new_query_builder(); 
     230        if (mgd_is_guid($args[0])) 
     231        { 
     232            $qb->add_constraint('guid', '=', $args[0]); 
     233        } 
     234        elseif (is_numeric($args[0])) 
     235        { 
     236            $qb->add_constraint('id', '=', $args[0]); 
     237        } 
     238        else 
     239        { 
     240            return false; 
     241        } 
     242        $articles = $qb->execute(); 
     243        if (!empty($articles)) 
     244        { 
     245            $thius->_article = $articles[0]; 
     246        } 
     247        */ 
    228248        if (!$this->_article) 
    229249        { 
  • trunk/midcom/net.nehmer.blog/handler/view.php

    r14385 r16392  
    9898    function _can_handle_view ($handler_id, $args, &$data) 
    9999    { 
     100        $this->_request_data['viewer_instance']->_enter_language(); 
    100101        $qb = midcom_db_article::new_query_builder(); 
    101102 
     
    156157        if (!$this->_article) 
    157158        { 
     159            $this->_request_data['viewer_instance']->_exit_language(); 
    158160            return false; 
    159161            // This will 404 
    160162        } 
    161  
     163        $this->_request_data['viewer_instance']->_exit_language(); 
    162164        return true; 
    163165    } 
     
    176178        { 
    177179            return false; 
    178             // This will 404 
    179         } 
    180  
     180            // This will 500 
     181        } 
     182 
     183        if ($handler_id == 'view-raw') 
     184        { 
     185            $_MIDCOM->skip_page_style = true; 
     186        } 
     187 
     188        /* This should not be neccessary, anymore 
    181189        if (   isset($data['original_language']) 
    182190            && $this->_article->lang == $data['original_language']) 
     
    185193            $this->_article = new midcom_db_article($this->_article->guid); 
    186194        } 
     195        */ 
    187196 
    188197        $this->_load_datamanager(); 
  • trunk/midcom/net.nehmer.blog/viewer.php

    r16063 r16392  
    329329    function _enter_language() 
    330330    { 
     331        if (isset($this->_request_data['original_language'])) 
     332        { 
     333            debug_push_class(__CLASS__, __FUNCTION__); 
     334            $GLOBALS['midcom_debugger']->print_function_stack('_enter_language called for second time', MIDCOM_LOG_ERROR); 
     335            debug_pop(); 
     336            return; 
     337        } 
    331338        $lang = $this->_config->get('language'); 
    332339        if ($lang) 
     
    347354        { 
    348355            mgd_set_lang($this->_request_data['original_language']); 
     356            unset($this->_request_data['original_language']); 
     357        } 
     358        else 
     359        { 
     360            debug_push_class(__CLASS__, __FUNCTION__); 
     361            $GLOBALS['midcom_debugger']->print_function_stack('_exit_language called without being in language context', MIDCOM_LOG_ERROR); 
     362            debug_pop(); 
    349363        } 
    350364    } 
     
    359373    function _on_can_handle($handler, $args) 
    360374    { 
    361         $this->_enter_language()
     375        $this->_request_data['viewer_instance'] =& $this
    362376        return true; 
    363     } 
    364  
    365     function _on_can_handled($handler, $args) 
    366     { 
    367         $this->_exit_language(); 
    368377    } 
    369378