1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Downloads: Introduced {DOWNLOAD_REQUEST_URL} which is just the file download url.

This commit is contained in:
Cameron
2017-01-31 17:12:04 -08:00
parent f8121774e3
commit a7d21dbe90
2 changed files with 18 additions and 6 deletions

View File

@@ -378,13 +378,21 @@ class download_shortcodes extends e_shortcode
} }
else else
{ {
$url = e107::getUrl()->create('download/request/item',array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef'])); $url = $this->sc_download_request_url();
return ($pref['agree_flag'] ? "<a class='e-tip' title='".LAN_DOWNLOAD."' href='".$url."' onclick= \"return confirm('{$agreetext}');\">{$img}</a>" : "<a class='e-tip' title='".LAN_DOWNLOAD."' href='".$url."' >{$img}</a>"); return ($pref['agree_flag'] ? "<a class='e-tip' title='".LAN_DOWNLOAD."' href='".$url."' onclick= \"return confirm('{$agreetext}');\">{$img}</a>" : "<a class='e-tip' title='".LAN_DOWNLOAD."' href='".$url."' >{$img}</a>");
// return ($pref['agree_flag'] ? "<a class='e-tip' title='".LAN_DOWNLOAD."' href='".e_PLUGIN_ABS."download/request.php?".$this->var['download_id']."' onclick= \"return confirm('{$agreetext}');\">{$img}</a>" : "<a class='e-tip' title='".LAN_DOWNLOAD."' href='".e_PLUGIN_ABS."download/request.php?".$this->var['download_id']."' >{$img}</a>"); // return ($pref['agree_flag'] ? "<a class='e-tip' title='".LAN_DOWNLOAD."' href='".e_PLUGIN_ABS."download/request.php?".$this->var['download_id']."' onclick= \"return confirm('{$agreetext}');\">{$img}</a>" : "<a class='e-tip' title='".LAN_DOWNLOAD."' href='".e_PLUGIN_ABS."download/request.php?".$this->var['download_id']."' >{$img}</a>");
} }
} }
function sc_download_request_url($parm=null)
{
return e107::getUrl()->create('download/request/item',array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef']));
}
function sc_download_list_icon($parm='') //XXX FIXME $img. function sc_download_list_icon($parm='') //XXX FIXME $img.
{ {
@@ -484,7 +492,7 @@ class download_shortcodes extends e_shortcode
$tp = e107::getParser(); $tp = e107::getParser();
$viewUrl = e107::getUrl()->create('download/view/item',array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef'])); $viewUrl = e107::getUrl()->create('download/view/item',array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef']));
$requestUrl = e107::getUrl()->create('download/request/item',array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef'])); $requestUrl = $this->sc_download_request_url();
$link['view'] = "<a href='".$viewUrl."'>".$this->var['download_name']."</a>"; $link['view'] = "<a href='".$viewUrl."'>".$this->var['download_name']."</a>";
$link['request'] = "<a href='".$requestUrl."' title='".LAN_dl_46."'>".$this->var['download_name']."</a>"; $link['request'] = "<a href='".$requestUrl."' title='".LAN_dl_46."'>".$this->var['download_name']."</a>";
@@ -506,7 +514,7 @@ class download_shortcodes extends e_shortcode
global $dl; global $dl;
$tp = e107::getParser(); $tp = e107::getParser();
$pref = e107::getPref(); $pref = e107::getPref();
$url = e107::getUrl()->create('download/request/item',array('id'=>$dl['download_id'], 'name'=>$dl['download_sef'])); $url = $this->sc_download_request_url();
if ($pref['agree_flag'] == 1) if ($pref['agree_flag'] == 1)
{ {
@@ -641,7 +649,7 @@ class download_shortcodes extends e_shortcode
$click = " onclick='return confirm(\"".$tp->toJS($tp->toHTML($pref['agree_text'],true,'emotes, no_tags'))."\")'"; $click = " onclick='return confirm(\"".$tp->toJS($tp->toHTML($pref['agree_text'],true,'emotes, no_tags'))."\")'";
} }
$url = e107::getUrl()->create('download/request/item',array('id'=>$this->var['download_id'], 'name'=>$this->var['download_sef'])); $url = $this->sc_download_request_url();
if(varset($parm['type']) == 'href') if(varset($parm['type']) == 'href')
{ {

View File

@@ -1,5 +1,9 @@
body { padding-top: 75px; } body { padding-top: 75px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
}
@media (max-width: 992px) { @media (max-width: 992px) {
body { height: 100vh; overflow-y: auto!important; } body { height: 100vh; overflow-y: auto!important; }