Skip to content

Commit

Permalink
Change install.xml name to name of language
Browse files Browse the repository at this point in the history
  • Loading branch information
infograf768 committed Sep 5, 2016
1 parent a21e24e commit 2e8e491
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions component/admin/models/package.php
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,13 @@ public function download($data)
if (JFile::exists($path))
{
$xmldata = file_get_contents($path);

// Fetch the language name for the install.xml
if (!empty($xmldata))
{
$xml = simplexml_load_file($path);
$installName = (string) $xml->name;
}
}

if (!JFile::exists($path) || empty($xmldata))
Expand All @@ -691,7 +698,7 @@ public function download($data)

$site_txt = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
$site_txt .= '<extension version="' . $small_version . '" client="site" type="language" method="upgrade">' . "\n";
$site_txt .= "\t" . '<name>' . $data['name'] . '</name>' . "\n";
$site_txt .= "\t" . '<name>' . $installName . '</name>' . "\n";
$site_txt .= "\t" . '<tag>' . $data['language'] . '</tag>' . "\n";
$site_txt .= "\t" . '<version>' . $data['version'] . '.' . $data['packversion'] . '</version>' . "\n";
$site_txt .= "\t" . '<creationDate>' . date('d/m/Y') . '</creationDate>' . "\n";
Expand Down Expand Up @@ -898,7 +905,7 @@ public function download($data)

$admin_txt = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
$admin_txt .= '<extension version="' . $small_version . '" client="administrator" type="language" method="upgrade">' . "\n";
$admin_txt .= "\t" . '<name>' . $data['name'] . '</name>' . "\n";
$admin_txt .= "\t" . '<name>' . $installName . '</name>' . "\n";
$admin_txt .= "\t" . '<tag>' . $data['language'] . '</tag>' . "\n";
$admin_txt .= "\t" . '<version>' . $data['version'] . '.' . $data['packversion'] . '</version>' . "\n";
$admin_txt .= "\t" . '<creationDate>' . date('d/m/Y') . '</creationDate>' . "\n";
Expand Down

0 comments on commit 2e8e491

Please sign in to comment.