diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php index 67c51f7fa..1a10deebe 100644 --- a/e107_plugins/download/includes/admin.php +++ b/e107_plugins/download/includes/admin.php @@ -258,10 +258,13 @@ class download_main_admin_ui extends e_admin_ui // default - true - TODO - move to displaySettings protected $batchDelete = true; + protected $url = array('route'=>'download/view/item', 'vars' => array('id' => 'download_id', 'name' => 'download_sef'), 'name' => 'download_name', 'description' => ''); // 'link' only needed if profile not provided. + + protected $fields = array( 'checkboxes' => array('title'=> '', 'type' => null, 'data' => null, 'width'=>'5%', 'thclass' =>'center', 'forced'=> TRUE, 'class'=>'center', 'toggle' => 'e-multiselect'), - 'download_id' => array('title'=> ID, 'type' => 'number', 'data' => 'int', 'width'=>'5%', 'thclass' => '', 'forced'=> TRUE, 'primary'=>TRUE/*, 'noedit'=>TRUE*/), //Primary ID is not editable + 'download_id' => array('title'=> LAN_ID, 'type' => 'text', 'data' => 'int', 'width'=>'5%', 'thclass' => '', 'forced'=> TRUE, 'readParms'=>'link=sef&target=blank', 'primary'=>TRUE/*, 'noedit'=>TRUE*/), //Primary ID is not editable 'download_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'thclass' => ''), 'download_url' => array('title'=> DOWLAN_13, 'type' => 'url', 'data' => 'str', 'width'=>'auto', 'thclass' => '', 'batch' => TRUE, 'filter'=>TRUE), 'download_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline'=>true, 'data' => 'str', 'width'=>'auto', 'thclass' => '', 'batch' => TRUE, 'filter'=>TRUE, 'writeParms'=>'sef=download_name'), diff --git a/e107_plugins/download/request.php b/e107_plugins/download/request.php index 979731318..11414e549 100644 --- a/e107_plugins/download/request.php +++ b/e107_plugins/download/request.php @@ -215,8 +215,11 @@ if ($type == "file") echo $binary_data; exit(); } - if (strstr($download_url, "http://") || strstr($download_url, "ftp://") || strstr($download_url, "https://")) { - header("Location: {$download_url}"); + if (strstr($download_url, "http://") || strstr($download_url, "ftp://") || strstr($download_url, "https://")) + { + $download_url = e107::getParser()->parseTemplate($download_url,true); // support for shortcode-driven dynamic URLS. + e107::redirect($download_url); + // header("Location: {$download_url}"); exit(); } else