Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions component/admin/language/en-GB/en-GB.com_localise.ini
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ COM_LOCALISE_TOOLTIP_TRANSLATION_AZURE="<b>Windows Azure</b><br/>Click to find a
[Translations]

COM_LOCALISE_ERROR_CHOOSE_LANG_CLIENT="Please choose a location AND a language in the filters."
COM_LOCALISE_ERROR_MAX_INPUT_VAR="The value of the PHP directive <strong>max_input_vars</strong> is lower than the required one to edit the file: %1$s.%2$s.ini<br /><br />You have to modify your php.ini file to change this limit (which is set to 1000 per default). <br />Use for example <strong>max_input_vars = 10000</strong><br />If the environment is running on <strong>suhosin</strong>, and ONLY in this case, add/change: <br />suhosin.post.max_vars = 10000<br />suhosin.request.max_vars = 10000<br /> and restart Apache."
COM_LOCALISE_ERROR_MAX_INPUT_VAR_PROTECTION="(Strings protection)"
COM_LOCALISE_HEADER_TRANSLATIONS="Translations"
COM_LOCALISE_HEADING_TRANSLATIONS_AUTHOR="Author"
COM_LOCALISE_HEADING_TRANSLATIONS_INFORMATION="Information"
Expand Down
38 changes: 38 additions & 0 deletions component/admin/models/translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ public function getItem($pk = null)
'unchanged' => 0,
'extra' => 0,
'total' => 0,
'linespath' => 0,
'linesrefpath' => 0,
'linesdevpath' => 0,
'linescustompath' => 0,
'complete' => false,
'source' => '',
'error' => array()
Expand Down Expand Up @@ -441,6 +445,14 @@ public function getItem($pk = null)
}
}

if ($tag != $reftag)
{
if (JFile::exists($custompath))
{
$this->item->linescustompath = count(file($custompath));
}
}

$stream->close();
}

Expand Down Expand Up @@ -658,6 +670,32 @@ public function getItem($pk = null)
{
$cache->store($this->item, $keycache);
}

// Count the number of lines in the ini file to check max_input_vars
if ($tag != $reftag)
{
if (JFile::exists($path))
{
$this->item->linespath = count(file($path));
}

if (JFile::exists($refpath))
{
$this->item->linesrefpath = count(file($refpath));
}

if (JFile::exists($develop_file_path))
{
$this->item->linesdevpath = count(file($develop_file_path));
}
}
else
{
if (JFile::exists($path))
{
$this->item->linespath = count(file($path));
}
}
}
}

Expand Down
18 changes: 15 additions & 3 deletions component/admin/views/translations/tmpl/default_body.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@
$user = JFactory::getUser();
$userId = $user->get('id');
$lang = JFactory::getLanguage();
$max_vars = ini_get('max_input_vars');
?>
<?php foreach ($this->items as $i => $item) : ?>
<?php $limit = 0; ?>
<?php if ($max_vars > 0) : ?>
<?php if ($item->linespath > $max_vars || $item->linesrefpath > $max_vars || $item->linesdevpath > $max_vars || $item->linescustompath > $max_vars) : ?>
<?php $limit = 1; ?>
<?php endif; ?>
<?php endif; ?>
<?php $canEdit = $user->authorise('localise.edit', 'com_localise' . (isset($item->id) ? ('.' . $item->id) : '')); ?>
<?php $istranslation = $item->istranslation; ?>
<?php if (!empty($item->developdata)) :
Expand Down Expand Up @@ -73,9 +80,14 @@
<input type="checkbox" id="cb<?php echo $i; ?>" class="hidden" name="cid[]" value="<?php echo $item->id; ?>">
<?php endif; ?>
<?php if ($item->writable && !$item->error && $canEdit) : ?>
<a class="hasTooltip" href="<?php echo JRoute::_('index.php?option=com_localise&task=translation.edit&client='.$item->client.'&tag='.$item->tag.'&filename='.$item->filename.'&storage='.$item->storage.'&id='.LocaliseHelper::getFileId(LocaliseHelper::getTranslationPath($item->client,$item->tag, $item->filename, $item->storage)).($item->filename=='override' ? '&layout=raw' :'')); ?>" title="<?php echo JText::_('COM_LOCALISE_TOOLTIP_TRANSLATIONS_' . ($item->state=='unexisting' ? 'NEW' : 'EDIT')); ?>">
<?php echo $item->name; ?>.ini
</a>
<?php if ($limit == 0) : ?>
<a class="hasTooltip" href="<?php echo JRoute::_('index.php?option=com_localise&task=translation.edit&client='.$item->client.'&tag='.$item->tag.'&filename='.$item->filename.'&storage='.$item->storage.'&id='.LocaliseHelper::getFileId(LocaliseHelper::getTranslationPath($item->client,$item->tag, $item->filename, $item->storage))); ?>" title="<?php echo JText::_('COM_LOCALISE_TOOLTIP_TRANSLATIONS_' . ($item->state=='unexisting' ? 'NEW' : 'EDIT')); ?>">
<?php echo $item->name; ?>.ini
</a>
<?php else : ?>
<?php echo "<font color=\"red\">" . $item->name . ".ini " . JText::_('COM_LOCALISE_ERROR_MAX_INPUT_VAR_PROTECTION') . "</font>"; ?>
<?php $app->enqueueMessage(JText::sprintf('COM_LOCALISE_ERROR_MAX_INPUT_VAR', $item->tag, $item->name), 'warning'); ?>
<?php endif; ?>
<?php elseif (!$canEdit) : ?>
<?php echo JHtml::_('jgrid.action', $i, '', array('tip'=>true, 'inactive_title'=>JText::sprintf('COM_LOCALISE_TOOLTIP_TRANSLATIONS_NOTEDITABLE', substr($item->path, strlen(JPATH_ROOT))), 'inactive_class'=>'16-error', 'enabled' => false, 'translate'=>false)); ?>
<?php echo $item->name; ?>.ini
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
$client,
$last_source[$client],
$installed_version),
'warning');
'notice');
}
}

Expand Down Expand Up @@ -96,14 +96,14 @@
$equal_versions = 0;
}
}

if (($version['administrator'] == '0' || $version['administrator'] == $installed_version)
&& ($version['site'] == '0' || $version['site'] == $installed_version))
{
$matches = 1;

if ($has_installation && $matches == 1)
{
{
if ($version['installation'] == '0' || $version['installation'] == $installed_version)
{
$equal_versions = 2;
Expand Down Expand Up @@ -151,7 +151,7 @@
$report .= '<br />';
}
}

$report .= '</i>';
// End notes

Expand Down