public static function bulk_handle_delete() { if (isset($_REQUEST['bulk_action']) && isset($_REQUEST['bulk_action']['delete']) && $_REQUEST['bulk_action']['delete'] == 'yes' && self::can_i('delete', 'Files')) { // confirm deletion of these files: $file_ids = isset($_REQUEST['bulk_operation']) && is_array($_REQUEST['bulk_operation']) ? $_REQUEST['bulk_operation'] : array(); foreach ($file_ids as $file_id => $k) { if ($k != 'yes') { unset($file_ids[$file_id]); } else { $ucm_file = new ucm_file($file_id); if (!$ucm_file->can_i_access()) { unset($file_ids[$file_id]); } else { $file_data = $ucm_file->get_data(); $file_ids[$file_id] = $file_data['file_name']; } } } if (count($file_ids) > 0) { if (module_form::confirm_delete('file_id', _l("Really delete files: %s", implode(', ', $file_ids)), self::link_open(false))) { foreach ($file_ids as $file_id => $file_number) { $ucm_file = new ucm_file($file_id); $ucm_file->delete(); } set_message(_l("%s files deleted successfully", count($file_ids))); redirect_browser(self::link_open(false)); } } } }
* Licence: Please check CodeCanyon.net for licence details. * More licence clarification available here: http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca * Package Date: 2015-11-25 02:55:20 * IP Address: 67.79.165.254 */ if (!$file_safe) { die('wrong page'); } if (!module_file::can_i('edit', 'File Approval')) { die('no perms'); } $ucm_file = new ucm_file($file_id); $ucm_file->check_page_permissions(); $file = $ucm_file->get_data(); $file_id = (int) $file['file_id']; // sanatisation/permission check module_template::init_template('file_approval_email', 'Dear {CUSTOMER_NAME},<br> <br> This email is regarding your file <strong>{FILE_NAME}</strong>{if:JOB_LINK} related to the job <a href="{JOB_LINK}">{JOB_NAME}</a>{endif:JOB_LINK}.<br><br> Please view this file and comments online by <a href="{FILE_URL}">clicking here</a>.<br><br> Thank you,<br><br> {FROM_NAME} ', 'File for Approval: {FILE_NAME}', array('CUSTOMER_NAME' => 'Customers Name', 'FILE_NAME' => 'File Name', 'JOB_NAME' => 'Job Name', 'FROM_NAME' => 'Your name', 'FILE_URL' => 'Link to file for customer')); // template for sending emails. // are we sending the paid one? or the dueone. //$template_name = 'file_email'; $template_name = isset($_REQUEST['template_name']) ? $_REQUEST['template_name'] : 'file_approval_email'; $template = module_template::get_template_by_key($template_name); $file['from_name'] = module_security::get_loggedin_name();