Changeset 16391
- Timestamp:
- 05/16/08 13:45:02 (5 months ago)
- Files:
-
- branches/MidCOM_2_8/net.nehmer.blog/handler/admin.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nehmer.blog/handler/view.php (modified) (5 diffs)
- branches/MidCOM_2_8/net.nehmer.blog/viewer.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/net.nehmer.blog/handler/admin.php
r12882 r16391 221 221 { 222 222 $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 */ 223 243 if (!$this->_article) 224 244 { branches/MidCOM_2_8/net.nehmer.blog/handler/view.php
r16371 r16391 93 93 function _can_handle_view ($handler_id, $args, &$data) 94 94 { 95 $this->_request_data['viewer_instance']->_enter_language(); 95 96 $qb = midcom_db_article::new_query_builder(); 96 97 … … 151 152 if (!$this->_article) 152 153 { 154 $this->_request_data['viewer_instance']->_exit_language(); 153 155 return false; 154 156 // This will 404 155 157 } 158 $this->_request_data['viewer_instance']->_exit_language(); 156 159 157 160 return true; … … 166 169 { 167 170 return false; 168 // This will 404171 // This will 500 169 172 } 170 173 … … 173 176 $_MIDCOM->skip_page_style = true; 174 177 } 175 178 179 /* This should not be neccessary, anymore 176 180 if ( isset($data['original_language']) 177 181 && $this->_article->lang == $data['original_language']) … … 180 184 $this->_article = new midcom_db_article($this->_article->guid); 181 185 } 186 */ 182 187 183 188 $this->_load_datamanager(); branches/MidCOM_2_8/net.nehmer.blog/viewer.php
r16371 r16391 342 342 function _enter_language() 343 343 { 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 } 344 351 $lang = $this->_config->get('language'); 345 352 if ($lang) … … 360 367 { 361 368 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(); 362 376 } 363 377 } … … 372 386 function _on_can_handle($handler, $args) 373 387 { 374 $this->_ enter_language();388 $this->_request_data['viewer_instance'] =& $this; 375 389 return true; 376 }377 378 function _on_can_handled($handler, $args)379 {380 $this->_exit_language();381 390 } 382 391
