mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +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);
|
$provider = $this->getProvider($details);
|
||||||
$status = $this->getStatus($details);
|
$status = $this->getStatus($details);
|
||||||
$homepage = $this->getHomepage($details);
|
$links = $this->getLinks($details);
|
||||||
$download = $this->getDownload($details);
|
|
||||||
|
|
||||||
$html .= '<tr>';
|
$html .= '<tr>';
|
||||||
$html .= '<td>' . $details['name'] . '</td>';
|
$html .= '<td>' . $details['name'] . '</td>';
|
||||||
@@ -104,7 +103,7 @@ class library_list_ui extends e_admin_ui
|
|||||||
$html .= '<td>' . $details['version'] . '</td>';
|
$html .= '<td>' . $details['version'] . '</td>';
|
||||||
$html .= '<td>' . $status . '</td>';
|
$html .= '<td>' . $status . '</td>';
|
||||||
$html .= '<td>' . $details['error_message'] . '</td>';
|
$html .= '<td>' . $details['error_message'] . '</td>';
|
||||||
$html .= '<td>' . $homepage . ' | ' . $download . '</td>';
|
$html .= '<td>' . $links . '</td>';
|
||||||
$html .= '</tr>';
|
$html .= '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,11 +113,40 @@ class library_list_ui extends e_admin_ui
|
|||||||
return '<div class="table-responsive">' . $html . '</div>';
|
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.
|
* Helper function to get homepage link.
|
||||||
*/
|
*/
|
||||||
private function getHomepage($details)
|
private function getHomepage($details)
|
||||||
{
|
{
|
||||||
|
if (empty($details['vendor_url']))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$href = $details['vendor_url'];
|
$href = $details['vendor_url'];
|
||||||
$title = $details['name'];
|
$title = $details['name'];
|
||||||
|
|
||||||
@@ -130,6 +158,11 @@ class library_list_ui extends e_admin_ui
|
|||||||
*/
|
*/
|
||||||
private function getDownload($details)
|
private function getDownload($details)
|
||||||
{
|
{
|
||||||
|
if (empty($details['download_url']))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$href = $details['download_url'];
|
$href = $details['download_url'];
|
||||||
$title = $details['name'];
|
$title = $details['name'];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user