diff --git a/component/admin/language/en-GB/en-GB.com_localise.ini b/component/admin/language/en-GB/en-GB.com_localise.ini index e0edf42c..abea910b 100644 --- a/component/admin/language/en-GB/en-GB.com_localise.ini +++ b/component/admin/language/en-GB/en-GB.com_localise.ini @@ -211,6 +211,8 @@ COM_LOCALISE_TOOLTIP_TRANSLATION_AZURE="Windows Azure
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 max_input_vars is lower than the required one to edit the file: %1$s.%2$s.ini

You have to modify your php.ini file to change this limit (which is set to 1000 per default).
Use for example max_input_vars = 10000
If the environment is running on suhosin, and ONLY in this case, add/change:
suhosin.post.max_vars = 10000
suhosin.request.max_vars = 10000
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" diff --git a/component/admin/models/translation.php b/component/admin/models/translation.php index f7a08eff..ccb4c61a 100644 --- a/component/admin/models/translation.php +++ b/component/admin/models/translation.php @@ -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() @@ -441,6 +445,14 @@ public function getItem($pk = null) } } + if ($tag != $reftag) + { + if (JFile::exists($custompath)) + { + $this->item->linescustompath = count(file($custompath)); + } + } + $stream->close(); } @@ -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)); + } + } } } diff --git a/component/admin/views/translations/tmpl/default_body.php b/component/admin/views/translations/tmpl/default_body.php index 2a4ad829..b752b921 100644 --- a/component/admin/views/translations/tmpl/default_body.php +++ b/component/admin/views/translations/tmpl/default_body.php @@ -16,8 +16,15 @@ $user = JFactory::getUser(); $userId = $user->get('id'); $lang = JFactory::getLanguage(); +$max_vars = ini_get('max_input_vars'); ?> items as $i => $item) : ?> + + 0) : ?> + linespath > $max_vars || $item->linesrefpath > $max_vars || $item->linesdevpath > $max_vars || $item->linescustompath > $max_vars) : ?> + + + authorise('localise.edit', 'com_localise' . (isset($item->id) ? ('.' . $item->id) : '')); ?> istranslation; ?> developdata)) : @@ -73,9 +80,14 @@ writable && !$item->error && $canEdit) : ?> - - name; ?>.ini - + + + name; ?>.ini + + + " . $item->name . ".ini " . JText::_('COM_LOCALISE_ERROR_MAX_INPUT_VAR_PROTECTION') . ""; ?> + enqueueMessage(JText::sprintf('COM_LOCALISE_ERROR_MAX_INPUT_VAR', $item->tag, $item->name), 'warning'); ?> + true, 'inactive_title'=>JText::sprintf('COM_LOCALISE_TOOLTIP_TRANSLATIONS_NOTEDITABLE', substr($item->path, strlen(JPATH_ROOT))), 'inactive_class'=>'16-error', 'enabled' => false, 'translate'=>false)); ?> name; ?>.ini diff --git a/component/admin/views/translations/tmpl/default_references.php b/component/admin/views/translations/tmpl/default_references.php index 7f30ca7b..59ebd4d7 100644 --- a/component/admin/views/translations/tmpl/default_references.php +++ b/component/admin/views/translations/tmpl/default_references.php @@ -50,7 +50,7 @@ $client, $last_source[$client], $installed_version), - 'warning'); + 'notice'); } } @@ -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; @@ -151,7 +151,7 @@ $report .= '
'; } } - + $report .= ''; // End notes