mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Hide homepage/download link if its not set.
This commit is contained in:
@@ -95,8 +95,7 @@ class library_list_ui extends e_admin_ui
|
||||
|
||||
$provider = $this->getProvider($details);
|
||||
$status = $this->getStatus($details);
|
||||
$homepage = $this->getHomepage($details);
|
||||
$download = $this->getDownload($details);
|
||||
$links = $this->getLinks($details);
|
||||
|
||||
$html .= '<tr>';
|
||||
$html .= '<td>' . $details['name'] . '</td>';
|
||||
@@ -104,7 +103,7 @@ class library_list_ui extends e_admin_ui
|
||||
$html .= '<td>' . $details['version'] . '</td>';
|
||||
$html .= '<td>' . $status . '</td>';
|
||||
$html .= '<td>' . $details['error_message'] . '</td>';
|
||||
$html .= '<td>' . $homepage . ' | ' . $download . '</td>';
|
||||
$html .= '<td>' . $links . '</td>';
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
@@ -114,11 +113,40 @@ class library_list_ui extends e_admin_ui
|
||||
return '<div class="table-responsive">' . $html . '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to get links.
|
||||
*/
|
||||
private function getLinks($details)
|
||||
{
|
||||
$homepage = $this->getHomepage($details);
|
||||
$download = $this->getDownload($details);
|
||||
|
||||
if ($homepage && $download)
|
||||
{
|
||||
return $homepage . ' | ' . $download;
|
||||
}
|
||||
|
||||
if($homepage)
|
||||
{
|
||||
return $homepage;
|
||||
}
|
||||
|
||||
if($download)
|
||||
{
|
||||
return $download;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to get homepage link.
|
||||
*/
|
||||
private function getHomepage($details)
|
||||
{
|
||||
if (empty($details['vendor_url']))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$href = $details['vendor_url'];
|
||||
$title = $details['name'];
|
||||
|
||||
@@ -130,6 +158,11 @@ class library_list_ui extends e_admin_ui
|
||||
*/
|
||||
private function getDownload($details)
|
||||
{
|
||||
if (empty($details['download_url']))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$href = $details['download_url'];
|
||||
$title = $details['name'];
|
||||
|
||||
|
Reference in New Issue
Block a user