mirror of
https://github.com/e107inc/e107.git
synced 2025-08-20 13:21:54 +02:00
#3622 - Download plugin - moving 'Report Broken Download' to e_notify
Work in progress: - Convert previous 'download_email' pref - Move broken download list to download plugin admin /e107_admin/message.php
This commit is contained in:
48
e107_plugins/download/e_notify.php
Normal file
48
e107_plugins/download/e_notify.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2014 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
// v2.x Standard
|
||||
class download_notify extends notify // plugin-folder + '_notify'
|
||||
{
|
||||
function config()
|
||||
{
|
||||
$config = array();
|
||||
|
||||
$config[] = array(
|
||||
'name' => LAN_DL_NT_01, // "Broken download reported"
|
||||
'function' => "user_download_brokendownload_reported",
|
||||
'category' => ''
|
||||
);
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
function user_download_brokendownload_reported($data)
|
||||
{
|
||||
$download_url = e107::url('download', 'item', $data, array('mode' => 'full'));
|
||||
|
||||
if (isset($data['id']) && isset($data['data']))
|
||||
{
|
||||
$message = 'Notify test: Broken download reported';
|
||||
}
|
||||
else
|
||||
{
|
||||
$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'];
|
||||
}
|
||||
|
||||
$this->send('user_download_brokendownload_reported', LAN_DL_NT_01, $message);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user