1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00

Merge pull request #2106 from rica-carv/rica-carv-download

Download plugin custom captions
This commit is contained in:
Cameron
2017-01-10 16:15:48 -08:00
committed by GitHub
3 changed files with 13 additions and 7 deletions

View File

@@ -44,6 +44,7 @@ if (!e107::isInstalled('download'))
$dl = new download();
if(!defined("e_PAGETITLE")) {define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME);}
if(!defined("USER_WIDTH") && !deftrue('BOOTSTRAP')) { define("USER_WIDTH","width:100%"); }
@@ -51,7 +52,7 @@ if (!e107::isInstalled('download'))
if(deftrue('BOOTSTRAP'))
{
define("IMAGE_DOWNLOAD", (file_exists(THEME."images/download.png") ? THEME."images/download.png" : e_IMAGE."generic/download.png"));
define("IMAGE_DOWNLOAD", (file_exists(THEME."images/download.png") ? THEME."images/download.png" : 'icon-download.glyph'));
define("IMAGE_NEW", (file_exists(THEME."images/new.png") ? THEME."images/new.png" : 'icon-star.glyph'));
}
else
@@ -101,4 +102,4 @@ if (!e107::isInstalled('download'))
exit ;
?>
?>

View File

@@ -211,7 +211,7 @@ class download
if ($dlcat->down_count == 0)
{
return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "<div style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>",'download-categories',true);
return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "<div ".(deftrue('BOOTSTRAP')?"class='alert alert-warning' >":"")."style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>",'download-categories',true);
}
$download_cat_table_string = "";
@@ -419,6 +419,7 @@ class download
{
$template = e107::getTemplate('download','download');
$DOWNLOAD_LIST_CAPTION = $template['list']['caption'];
$DOWNLOAD_LIST_TABLE_START = $template['list']['start'];
$DOWNLOAD_LIST_TABLE = $template['list']['item'];
$DOWNLOAD_LIST_TABLE_END = $template['list']['end'];
@@ -578,6 +579,8 @@ class download
if($filetotal)
{
$caption = varset($DOWNLOAD_LIST_CAPTION) ? $tp->parseTemplate($DOWNLOAD_LIST_CAPTION, TRUE, $sc) : LAN_PLUGIN_DOWNLOAD_NAME;
// Only show list if some files in it
$dl_text .= $tp->parseTemplate($DOWNLOAD_LIST_TABLE_START, TRUE, $sc);
@@ -610,8 +613,8 @@ class download
}
$dl_text .= $tp->parseTemplate($this->templateFooter, TRUE, $sc);
$text .= $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, $dl_text, 'download-list', true);
$text .= $ns->tablerender($caption, $dl_text, 'download-list', true);
}
if(!isset($DOWNLOAD_LIST_NEXTPREV))
@@ -1011,4 +1014,4 @@ function sort_download_mirror_order($a, $b)
}
return ($a[1] < $b[1]) ? -1 : 1;
}
?>
?>

View File

@@ -524,6 +524,8 @@ $DOWNLOAD_TEMPLATE['view']['nextprev'] = '
// ##### ------------------------------------------------------------------------------------------
//$DOWNLOAD_TEMPLATE['list']['caption'] = "Test custom caption";
$DOWNLOAD_TEMPLATE['list']['start'] = "
<form method='post' action='".e_SELF."?".e_QUERY."'>
<div class='table-responsive'>
@@ -655,4 +657,4 @@ $DOWNLOAD_TEMPLATE['footer'] = '';
?>
?>