Keeping naming consistency resolved gh-265. Started adding the needed features for the new translation improvment gh-261

This commit is contained in:
2018-04-15 22:21:34 +02:00
parent 4e7d4af1d3
commit dfff74989e
11 changed files with 181 additions and 26 deletions

View File

@ -107,5 +107,31 @@ class ComponentbuilderControllerLanguages extends JControllerAdmin
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error');
return;
}
}
public function buildLanguages()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// check if user has the right
$user = JFactory::getUser();
if($user->authorise('core.create', 'com_componentbuilder'))
{
// get the model
$model = $this->getModel('languages');
if ($model->buildLanguages())
{
// set success message
$message = '<h1>'.JText::_('COM_COMPONENTBUILDER_IMPORT_SUCCESS').'</h1>';
$message .= '<p>'.JText::_('COM_COMPONENTBUILDER_ALL_THE_LANGUAGES_FOUND_IN_JOOMLA_WERE_SUCCESSFULLY_IMPORTED').'</p>';
// set redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=languages', false);
$this->setRedirect($redirect_url, $message);
}
}
// set redirect
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=languages', false);
$this->setRedirect($redirect_url);
return false;
}
}