registerTask('show', 'display' ); $this->registerTask('check', 'checkstatus' ); } /** * Standard display control structure * */ function display( ) { $this->view = & $this->getView("statistics"); parent::display(); } /** * */ function checkstatus() { $type = JRequest::getString('type', '' ); $phase = JRequest::getInt('phase', 1 ); $statecheck_i = JRequest::getInt('statecheck_i', -1); $htmlResult = JText::_('MANAGEMENT_INTRO'); $link = ''; // get the view $this->_view = & $this->getView("statistics"); $this->_model = & $this->getModel('statistics'); switch ($type) { case 'translation_status': $message = ''; $session = JFactory::getSession(); $translationStatus = $session->get('translationState',array()); $translationStatus = $this->_model->testTranslationStatus($translationStatus, $phase, $statecheck_i, $message); $session->set('translationState', $translationStatus ); $htmlResult = $this->_view->renderTranslationStatusTable($translationStatus, $message); if( $phase<=3 ) { $link = 'index3.php?option=com_joomfish&task=statistics.check&type=translation_status&phase=' .$phase; if( $statecheck_i > -1) { $link .= '&statecheck_i='.$statecheck_i; } } else { $session->set('translationState', null ); } break; case 'original_status': $message = ''; $session = JFactory::getSession(); $originalStatus = $session->get('originalStatus', array()); $langCodes = array(); $jfManager = JoomFishManager::getInstance(); $languages = $jfManager->getLanguages(false); foreach ($languages as $lang) { $langCodes[] = $lang->getLanguageCode(); } $originalStatus = $this->_model->testOriginalStatus($originalStatus, $phase, $statecheck_i, $message, $languages); $session->set('originalStatus', $originalStatus ); $htmlResult = $this->_view->renderOriginalStatusTable($originalStatus, $message, $langCodes); if( $phase<=2 ) { $link = 'index3.php?option=com_joomfish&task=statistics.check&type=original_status&phase=' .$phase; if( $statecheck_i > -1) { $link .= '&statecheck_i='.$statecheck_i; } } else { $session->set('originalStatus', null ); } break; } // Set the layout $this->_view->setLayout('result'); $this->_view->assignRef('htmlResult', $htmlResult); $this->_view->assignRef('reload', $link); $this->_view->display(); } }