_modelName; } /** * Method to prepare the language list for the translation backend * The method defines that all languages are being presented except the default language * if defined in the config. * @return array of languages */ function getLanguages() { $jfManager = JoomFishManager::getInstance(); return $jfManager->getLanguages(false); } /** * Deletes the selected translations (only the translations of course) * @return string message */ function _removeTranslation( $catid, $cid ) { $message = ''; $db =& JFactory::getDBO(); foreach( $cid as $cid_row ) { list($translationid, $contentid, $language_id) = explode('|', $cid_row); $jfManager =& JoomFishManager::getInstance(); $contentElement = $jfManager->getContentElement( $catid ); $contentTable = $contentElement->getTableName(); $contentid= intval($contentid); $translationid = intval($translationid); // safety check -- complete overkill but better to be safe than sorry // get the translation details JLoader::import( 'models.JFContent',JOOMFISH_ADMINPATH); $translation = new jfContent($db); $translation->load($translationid); if (!isset($translation) || $translation->id == 0) { $this->setState('message', JText::sprintf('NO_SUCH_TRANSLATION', $translationid)); continue; } // make sure translation matches the one we wanted if ($contentid != $translation->reference_id){ $this->setState('message', JText::_('Something dodgy going on here')); continue; } $sql= "DELETE from #__jf_content WHERE reference_table='$catid' and language_id=$language_id and reference_id=$contentid"; $db->setQuery($sql); $db->query(); if( $db->getErrorNum() != 0 ) { $this->setError(JText::_('Something dodgy going on here')); echo $db->getErrorMsg(); continue; } else { $this->setState('message', JText::_('Translation successfully deleted')); } } return $message; } } ?>