protected function populateState() { $input = JFactory::getApplication()->input; // Get the infos $client = $input->getCmd('client', ''); $tag = $input->getCmd('tag', ''); $filename = $input->getCmd('filename', ''); $storage = $input->getCmd('storage', ''); $this->setState('translation.client', !empty($client) ? $client : 'site'); $this->setState('translation.tag', $tag); $this->setState('translation.filename', $filename); $this->setState('translation.storage', $storage); // Get the id $id = $input->getInt('id', '0'); $this->setState('translation.id', $id); // Get the layout $layout = $input->getCmd('layout', 'edit'); $this->setState('translation.layout', $layout); // Get the parameters $params = JComponentHelper::getParams('com_localise'); // Get the reference tag $ref = $params->get('language.reference', 'en-GB'); $this->setState('translation.reference', $ref); // Get the paths $path = LocaliseHelper::getTranslationPath($client, $tag, $filename, $storage); if ($filename == 'lib_joomla') { $refpath = LocaliseHelper::findTranslationPath('administrator', $ref, $filename); if (!JFile::exists($path)) { $path2 = LocaliseHelper::getTranslationPath($client == 'administrator' ? 'site' : 'administrator', $tag, $filename, $storage); if (JFile::exists($path2)) { $path = $path2; } } } else { $refpath = LocaliseHelper::findTranslationPath($client, $ref, $filename); } $this->setState('translation.path', $path); $this->setState('translation.refpath', $refpath); }
<?php echo JHtml::_('jgrid.action', $i, '', array('tip' => true, 'inactive_title' => JText::sprintf('COM_LOCALISE_TOOLTIP_TRANSLATIONS_ERROR', substr($item->path, strlen(JPATH_ROOT)), implode(', ', $item->error)), 'inactive_class' => '16-error', 'enabled' => false, 'translate' => false)); ?> <?php echo $item->name; ?> <?php } ?> </td> <td dir="ltr"> <?php if ($item->writable && $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)) . '&layout=raw'); ?> " title="<?php echo JText::_('COM_LOCALISE_TOOLTIP_TRANSLATIONS_' . ($item->state == 'unexisting' ? 'NEWRAW' : 'EDITRAW')); ?> "> <?php echo substr($item->path, strlen(JPATH_ROOT)); ?> </a> <?php } else { ?> <?php echo substr($item->path, strlen(JPATH_ROOT)); ?>