Skip to content
20 changes: 17 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,17 @@
$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;

if ($max_vars > 0 && $item->total > $max_vars)
{
$limit = 1;
}
?>
<?php $canEdit = $user->authorise('localise.edit', 'com_localise' . (isset($item->id) ? ('.' . $item->id) : '')); ?>
<tr class="<?php echo $item->state; ?> row<?php echo $i % 2; ?>">
<td width="20" class="center hidden-phone"><?php echo $i + 1; ?></td>
Expand Down Expand Up @@ -63,9 +72,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 (Strings protection.)</font>"; ?>
<?php $app->enqueueMessage("The PHP directve 'max_input_vars' value is minor than the required one to edit the file: " . $item->tag . "." . $item->name . ".ini", '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