<?php echo JHtml::_('grid.id', $i, $item->name); ?> <?php } else { ?> <?php echo JHtml::_('jgrid.checkedout', $item->editor, $item->checked_out_time); ?> <?php } ?> </td> <td> <?php LocaliseHelper::loadLanguage($item->manifest, $item->client); ?> <span title="<?php echo JText::_($item->title); ?> ::<?php echo JText::_($item->description); ?> " class="hasTooltip localise-icon " style="background-image:url(<?php echo JURI::root(true) . '/' . $item->icon; ?> );"></span> <?php if (!$canAdmin) { ?> <span title="<?php
/** * Method to get the package. * * @return JObject the package */ public function getItem() { $id = $this->getState('package.id'); $package = new JObject(); $package->checked_out = 0; $package->standalone = true; $package->manifest = null; $package->title = null; $package->description = null; if (!empty($id)) { // If the package exists get it $table = $this->getTable(); if (is_array($id)) { $id = $id[0]; } $table->load($id); $package->setProperties($table->getProperties()); // Get the manifest $xml = simplexml_load_file($table->path); if ($xml) { $manifest = (string) $xml->manifest; $client = (string) $xml->manifest->attributes()->client; LocaliseHelper::loadLanguage($manifest, $client); // Set up basic information $name = basename($table->path); $name = substr($name, 0, strlen($name) - 4); $package->id = $id; $package->name = $name; $package->manifest = $manifest; $package->client = $client; $package->standalone = substr($manifest, 0, 4) == 'fil_'; $package->core = (string) $xml->attributes()->core == 'true'; $package->icon = (string) $xml->icon; $package->title = (string) $xml->title; $package->description = (string) $xml->description; $package->license = (string) $xml->license; $package->copyright = (string) $xml->copyright; $package->author = (string) $xml->author; $package->writable = LocaliseHelper::isWritable($package->path); $user = JFactory::getUser($table->checked_out); $package->setProperties($table->getProperties()); if ($package->checked_out == JFactory::getUser()->id) { $package->checked_out = 0; } $package->editor = JText::sprintf('COM_LOCALISE_TEXT_PACKAGE_EDITOR', $user->name, $user->username); // Get the translations $package->translations = array(); $package->administrator = array(); if ($xml->administrator) { foreach ($xml->administrator->children() as $file) { $data = (string) $file; if ($data) { $package->translations[] = "administrator_{$data}"; } else { $package->translations[] = "administrator_joomla"; } $package->administrator[] = $data; } } $package->site = array(); if ($xml->site) { foreach ($xml->site->children() as $file) { $data = (string) $file; if ($data) { $package->translations[] = "site_{$data}"; } else { $package->translations[] = "site_joomla"; } $package->site[] = $data; } } $package->installation = array(); if ($xml->installation) { foreach ($xml->installation->children() as $file) { $data = (string) $file->data(); if ($data) { $package->translations[] = "installation_{$data}"; } else { $package->translations[] = "installation_joomla"; } $package->installation[] = $data; } } } else { $package = null; $this->setError(JText::sprintf('COM_LOCALISE_ERROR_PACKAGE_FILEEDIT'), $table->path); } } return $package; }