Skip to content

Commit

Permalink
Revert "Overriden strings for both Back-end and Front-end"
Browse files Browse the repository at this point in the history
This reverts commit ff42db0.
  • Loading branch information
eshiol committed Oct 26, 2016
1 parent 5b0d13c commit 3a8a7a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
17 changes: 6 additions & 11 deletions administrator/components/com_languages/models/override.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand Down Expand Up @@ -89,7 +89,7 @@ protected function loadFormData()
*/
public function getItem($pk = null)
{
JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
require_once JPATH_COMPONENT . '/helpers/languages.php';

$input = JFactory::getApplication()->input;
$pk = (!empty($pk)) ? $pk : $input->get('id');
Expand All @@ -107,11 +107,6 @@ public function getItem($pk = null)
$result->override = $strings[$pk];
}

$opposite_filename = constant('JPATH_' . strtoupper($this->getState('filter.client') == 'site' ? 'administrator' : 'site'))
. '/language/overrides/' . $this->getState('filter.language', 'en-GB') . '.override.ini';
$opposite_strings = LanguagesHelper::parseFile($opposite_filename);
$result->both = isset($opposite_strings[$pk]) && ($opposite_strings[$pk] == $strings[$pk]);

return $result;
}

Expand All @@ -127,10 +122,9 @@ public function getItem($pk = null)
*/
public function save($data, $opposite_client = false)
{
JLoader::register('LanguagesHelper', JPATH_ADMINISTRATOR . '/components/com_languages/helpers/languages.php');
jimport('joomla.filesystem.file');

$app = JFactory::getApplication();
require_once JPATH_COMPONENT . '/helpers/languages.php';
jimport('joomla.filesystem.file');

$client = $app->getUserState('com_languages.overrides.filter.client', 0);
$language = $app->getUserState('com_languages.overrides.filter.language', 'en-GB');
Expand Down Expand Up @@ -185,7 +179,8 @@ public function save($data, $opposite_client = false)
}

// Write override.ini file with the strings.
$registry = new Registry($strings);
$registry = new Registry;
$registry->loadObject($strings);
$reg = $registry->toString('INI');

if (!JFile::write($filename, $reg))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @package Joomla.Administrator
* @subpackage com_languages
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand All @@ -16,13 +16,7 @@
$client = $this->state->get('filter.client') == '0' ? JText::_('JSITE') : JText::_('JADMINISTRATOR');
$language = $this->state->get('filter.language');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));

$opposite_client = $this->state->get('filter.client') == '1' ? JText::_('JSITE') : JText::_('JADMINISTRATOR');
$opposite_filename = constant('JPATH_' . strtoupper(1 - $this->state->get('filter.client')? 'administrator' : 'site'))
. '/language/overrides/' . $this->state->get('filter.language', 'en-GB') . '.override.ini';
$opposite_strings = LanguagesHelper::parseFile($opposite_filename);
?>
$listDirn = $this->escape($this->state->get('list.direction')); ?>

<form action="<?php echo JRoute::_('index.php?option=com_languages&view=overrides'); ?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty( $this->sidebar)) : ?>
Expand Down Expand Up @@ -100,12 +94,7 @@
<?php echo $language; ?>
</td>
<td class="hidden-phone">
<?php echo $client; ?><?php
if (isset($opposite_strings[$key]) && ($opposite_strings[$key] == $text))
{
echo '/' . $opposite_client;
}
?>
<?php echo $client; ?>
</td>
</tr>
<?php $i++; ?>
Expand Down

0 comments on commit 3a8a7a0

Please sign in to comment.