mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Fixes #3622 - Reported broken downloads reworked
- Moved away from e107_admin/message.php to its own place in the Downloads admin area. - Notification of broken downloads now controlled by e_notify (see Admin Area > Settings > Notify) - Updated notification message - Added e_dashboard addon to show latest status on broken download reports
This commit is contained in:
@@ -16,7 +16,7 @@ $e_sub_cat = 'message';
|
||||
require_once("auth.php");
|
||||
$gen = new convert;
|
||||
|
||||
$messageTypes = array("Broken Download", "Dev Team Message");
|
||||
$messageTypes = array(/*"Broken Download",*/ "Dev Team Message");
|
||||
$queryString = "";
|
||||
foreach($messageTypes as $types) {
|
||||
$queryString .= " gen_type='$types' OR";
|
||||
|
@@ -467,7 +467,7 @@ class admin_shortcodes
|
||||
|
||||
$oldconfigs['e-upload'][0] = array('icon'=>E_16_UPLOADS, 'title'=>ADLAN_LAT_7, 'url'=> e_ADMIN."upload.php", 'total'=>$active_uploads);
|
||||
|
||||
$messageTypes = array('Broken Download', 'Dev Team Message');
|
||||
$messageTypes = array(/*'Broken Download',*/ 'Dev Team Message');
|
||||
$queryString = '';
|
||||
foreach($messageTypes as $types)
|
||||
{
|
||||
|
29
e107_plugins/download/e_dashboard.php
Normal file
29
e107_plugins/download/e_dashboard.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
class download_dashboard
|
||||
{
|
||||
function chart()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function status()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function latest()
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$reported_downloads = $sql->count('generic', '(*)', "WHERE gen_type='Broken Download'");
|
||||
|
||||
$var[0]['icon'] = "<img src='".e_PLUGIN_ABS."download/images/downloads_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='download plugin icon' /> ";
|
||||
$var[0]['title'] = LAN_DL_LATEST_01;
|
||||
$var[0]['url'] = e_PLUGIN."download/admin_download.php?mode=broken&action=list";
|
||||
$var[0]['total'] = $reported_downloads;
|
||||
|
||||
return $var;
|
||||
}
|
||||
}
|
@@ -39,7 +39,13 @@ class download_notify extends notify // plugin-folder + '_notify'
|
||||
$message = LAN_DL_NT_02;
|
||||
$message .= " <a href=".$download_url.">".$data['download_name']."</a><br>";
|
||||
$message .= str_replace("[x]", $data['user'], LAN_DL_NT_03)."<br>";
|
||||
$message .= $data['report_add'];
|
||||
$message .= $data['report_add']."<br><br>";
|
||||
|
||||
$admin_url = SITEURLBASE.e_PLUGIN_ABS."download/admin_download.php?mode=broken&action=list";
|
||||
$find = array('[', ']');
|
||||
$replace = array('<a href="'.$admin_url.'">', '</a>');
|
||||
|
||||
$message .= str_replace($find, $replace, LAN_DL_NT_04);
|
||||
}
|
||||
|
||||
$this->send('user_download_brokendownload_reported', LAN_DL_NT_01, $message);
|
||||
|
@@ -927,7 +927,7 @@ class download
|
||||
$user = USER ? USERNAME : LAN_GUEST;
|
||||
$ip = e107::getIPHandler()->getIP(false);
|
||||
|
||||
// Replaced with e_notify
|
||||
// Replaced by e_notify
|
||||
/*
|
||||
if ($pref['download_email'])
|
||||
{ // this needs to be moved into the NOTIFY, with an event.
|
||||
|
@@ -8,8 +8,6 @@
|
||||
*
|
||||
* Download Plugin Administration UI
|
||||
*
|
||||
* $URL: https://e107.svn.sourceforge.net/svnroot/e107/trunk/e107_0.8/e107_plugins/release/includes/admin.php $
|
||||
* $Id: admin.php 12212 2011-05-11 22:25:02Z e107coders $
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')){ exit; }
|
||||
@@ -26,22 +24,28 @@ class plugin_download_admin extends e_admin_dispatcher
|
||||
*/
|
||||
protected $modes = array (
|
||||
'main' => array (
|
||||
'controller' => 'download_main_admin_ui',
|
||||
'path' => null,
|
||||
'ui' => 'download_main_admin_form_ui',
|
||||
'uipath' => null
|
||||
'controller' => 'download_main_admin_ui',
|
||||
'path' => null,
|
||||
'ui' => 'download_main_admin_form_ui',
|
||||
'uipath' => null
|
||||
),
|
||||
'cat' => array (
|
||||
'controller' => 'download_cat_ui',
|
||||
'path' => null,
|
||||
'ui' => 'download_cat_form_ui',
|
||||
'uipath' => null
|
||||
'controller' => 'download_cat_ui',
|
||||
'path' => null,
|
||||
'ui' => 'download_cat_form_ui',
|
||||
'uipath' => null
|
||||
),
|
||||
'mirror' => array(
|
||||
'controller' => 'download_mirror_ui',
|
||||
'path' => null,
|
||||
'ui' => 'download_mirror_form_ui',
|
||||
'uipath' => null
|
||||
),
|
||||
'broken' => array(
|
||||
'controller' => 'download_broken_ui',
|
||||
'path' => null,
|
||||
'ui' => 'download_broken_form_ui',
|
||||
'uipath' => null
|
||||
),
|
||||
);
|
||||
|
||||
@@ -70,6 +74,10 @@ class plugin_download_admin extends e_admin_dispatcher
|
||||
'mirror/create' => array('caption'=> DOWLAN_143, 'perm' => 'P'),
|
||||
|
||||
'other2' => array('divider'=> true),
|
||||
|
||||
'broken/list' => array('caption'=> "Broken dowloads", 'perm' => 'P'),
|
||||
|
||||
'other3' => array('divider'=> true),
|
||||
|
||||
'main/settings' => array('caption'=> LAN_PREFS, 'perm' => 'P'),
|
||||
// 'main/maint' => array('caption'=> DOWLAN_165, 'perm' => 'P'),
|
||||
@@ -2580,4 +2588,71 @@ class download_mirror_ui extends e_admin_ui
|
||||
class download_mirror_form_ui extends e_admin_form_ui
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class download_broken_ui extends e_admin_ui
|
||||
{
|
||||
|
||||
protected $pluginTitle = LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
protected $pluginName = 'broken_download';
|
||||
protected $table = 'generic';
|
||||
protected $pid = 'gen_id';
|
||||
protected $perPage = 10;
|
||||
protected $listQry = "SELECT g.*,u.user_name FROM `#generic` AS g LEFT JOIN `#user` AS u ON g.gen_user_id = u.user_id WHERE g.gen_type='Broken Download' ORDER BY g.gen_datestamp DESC";
|
||||
|
||||
protected $fields = array (
|
||||
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
||||
'gen_id' => array ( 'title' => LAN_ID, 'nolist'=>true, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'gen_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'width' => '10%', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
//'gen_intdata' => array ( 'title' => LAN_ID, 'type' => 'number', 'batch'=>false, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||
'gen_ip' => array ( 'title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'gen_chardata' => array ( 'title' => LAN_DESCRIPTION, 'type' => 'text', 'data' => 'str', 'width' => '40%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'gen_user_id' => array ( 'title' => DOWLAN_199, 'type' => 'user', 'batch'=>false, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left nowrap', ),
|
||||
'options' => array ( 'title' => LAN_OPTIONS, 'type' => 'method', 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', 'readParms'=>'edit=0' ),
|
||||
);
|
||||
|
||||
protected $fieldpref = array('gen_datestamp', 'gen_ip', 'gen_chardata', 'gen_user_id');
|
||||
|
||||
protected $batchOptions = array();
|
||||
|
||||
// optional
|
||||
public function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function afterDelete($data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function renderHelp()
|
||||
{
|
||||
$help_text = str_replace("[br]", "<br />", DOWLAN_HELP_11);
|
||||
$help_text = str_replace(array("[", "]"), array("<a href='".e_ADMIN_ABS."notify.php'>"), $help_text);
|
||||
|
||||
return array('caption' => LAN_HELP, 'text' => $help_text);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
class download_broken_form_ui extends e_admin_form_ui
|
||||
{
|
||||
|
||||
function options($att, $value, $id, $attributes)
|
||||
{
|
||||
if($attributes['mode'] == 'read')
|
||||
{
|
||||
$download_id = $this->getController()->getListModel()->get('gen_intdata');
|
||||
|
||||
$text = "<div class='btn-group'>";
|
||||
$text .= "<a class='btn btn-default' href='".e_SELF."?mode=main&action=edit&id=". $download_id."'>".ADMIN_VIEW_ICON."</a>";
|
||||
$text .= $this->renderValue('options', $value, array('readParms' => 'edit=0'));
|
||||
$text .= "</div>";
|
||||
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
}
|
@@ -160,7 +160,7 @@ define("DOWLAN_146", "Custom Download-denial message or URL");
|
||||
// define("DOWLAN_147", "Icon for empty category");
|
||||
define("DOWLAN_148", "Check to update date stamp to current time");
|
||||
define("DOWLAN_149", "URL"); //FIXME Use Generic
|
||||
define("DOWLAN_150", "Email admin when broken download reported");
|
||||
//define("DOWLAN_150", "Email admin when broken download reported");
|
||||
define("DOWLAN_151", "Broken-download reporting available to");
|
||||
define("DOWLAN_152", "Couldn't move file");
|
||||
define("DOWLAN_153", "Move file into download folder");
|
||||
@@ -209,7 +209,7 @@ define("DOWLAN_195", "Mirror type");
|
||||
define("DOWLAN_196", "list"); //FIXME Use Generic
|
||||
define("DOWLAN_197", "random");
|
||||
// define("DOWLAN_198", "Filter"); //FIXME Use Generic
|
||||
|
||||
define("DOWLAN_199", "Submitted by");
|
||||
|
||||
// define('DOWLAN_FP_01', 'Front page');
|
||||
// define('DOWLAN_FP_02', 'Category list');
|
||||
@@ -226,6 +226,8 @@ define("DOWLAN_HELP_8", "Help for upload list");
|
||||
define("DOWLAN_HELP_9", "Help for upload types");
|
||||
define("DOWLAN_HELP_10", "Help for upload options");
|
||||
|
||||
define("DOWLAN_HELP_11", "Click the 'delete' button to delete the report.[br][br]Click the 'view' button to manage the download.[br][br]To be notified of any new reports, please see to the [notify settings].");
|
||||
|
||||
// define("DOWLAN_INSTALL_DONE", "Your download plugin is now installed");
|
||||
// define("DOWLAN_DESCRIPTION", "This plugin is a fully featured Download system");
|
||||
// define("DOWLAN_CAPTION", "Configure Download");
|
||||
|
@@ -7,3 +7,7 @@ define("LAN_PLUGIN_DOWNLOAD_DIZ", "This plugin is a fully featured File-downlo
|
||||
define("LAN_DL_NT_01", "Broken download reported");
|
||||
define("LAN_DL_NT_02", "The following download has been reported as broken:");
|
||||
define("LAN_DL_NT_03", "It was reported by [x] with the following comments:");
|
||||
define("LAN_DL_NT_04", "Click [here] to view the broken download reports.");
|
||||
|
||||
// Latest (e_dashboard)
|
||||
define("LAN_DL_LATEST_01", "Reported broken downloads");
|
Reference in New Issue
Block a user