Changeset 16391

Show
Ignore:
Timestamp:
05/16/08 13:45:02 (5 months ago)
Author:
rambo
Message:

INCOMPLETE, trying to make the ML work correctly, works for all but edit mode (which seems like core bug)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/net.nehmer.blog/handler/admin.php

    r12882 r16391  
    221221    { 
    222222        $this->_article = new midcom_db_article($args[0]); 
     223        /* 
     224        $qb = midcom_db_article::new_query_builder(); 
     225        if (mgd_is_guid($args[0])) 
     226        { 
     227            $qb->add_constraint('guid', '=', $args[0]); 
     228        } 
     229        elseif (is_numeric($args[0])) 
     230        { 
     231            $qb->add_constraint('id', '=', $args[0]); 
     232        } 
     233        else 
     234        { 
     235            return false; 
     236        } 
     237        $articles = $qb->execute(); 
     238        if (!empty($articles)) 
     239        { 
     240            $thius->_article = $articles[0]; 
     241        } 
     242        */ 
    223243        if (!$this->_article) 
    224244        { 
  • branches/MidCOM_2_8/net.nehmer.blog/handler/view.php

    r16371 r16391  
    9393    function _can_handle_view ($handler_id, $args, &$data) 
    9494    { 
     95        $this->_request_data['viewer_instance']->_enter_language(); 
    9596        $qb = midcom_db_article::new_query_builder(); 
    9697 
     
    151152        if (!$this->_article) 
    152153        { 
     154            $this->_request_data['viewer_instance']->_exit_language(); 
    153155            return false; 
    154156            // This will 404 
    155157        } 
     158        $this->_request_data['viewer_instance']->_exit_language(); 
    156159         
    157160        return true; 
     
    166169        { 
    167170            return false; 
    168             // This will 404 
     171            // This will 500 
    169172        } 
    170173 
     
    173176            $_MIDCOM->skip_page_style = true; 
    174177        } 
    175          
     178 
     179        /* This should not be neccessary, anymore 
    176180        if (   isset($data['original_language']) 
    177181            && $this->_article->lang == $data['original_language']) 
     
    180184            $this->_article = new midcom_db_article($this->_article->guid); 
    181185        } 
     186        */ 
    182187 
    183188        $this->_load_datamanager(); 
  • branches/MidCOM_2_8/net.nehmer.blog/viewer.php

    r16371 r16391  
    342342    function _enter_language() 
    343343    { 
     344        if (isset($this->_request_data['original_language'])) 
     345        { 
     346            debug_push_class(__CLASS__, __FUNCTION__); 
     347            $GLOBALS['midcom_debugger']->print_function_stack('_enter_language called for second time', MIDCOM_LOG_ERROR); 
     348            debug_pop(); 
     349            return; 
     350        } 
    344351        $lang = $this->_config->get('language'); 
    345352        if ($lang) 
     
    360367        { 
    361368            mgd_set_lang($this->_request_data['original_language']); 
     369            unset($this->_request_data['original_language']); 
     370        } 
     371        else 
     372        { 
     373            debug_push_class(__CLASS__, __FUNCTION__); 
     374            $GLOBALS['midcom_debugger']->print_function_stack('_exit_language called without being in language context', MIDCOM_LOG_ERROR); 
     375            debug_pop(); 
    362376        } 
    363377    } 
     
    372386    function _on_can_handle($handler, $args) 
    373387    { 
    374         $this->_enter_language()
     388        $this->_request_data['viewer_instance'] =& $this
    375389        return true; 
    376     } 
    377  
    378     function _on_can_handled($handler, $args) 
    379     { 
    380         $this->_exit_language(); 
    381390    } 
    382391