Minor - format code

pull/2650/head^2
Julio Montoya 6 years ago
parent 96d59e808f
commit 4b8468a825
  1. 2
      main/document/showinframes.php
  2. 22
      main/inc/lib/api.lib.php
  3. 2
      src/CoreBundle/Controller/ResourceController.php

@ -27,7 +27,7 @@ require_once __DIR__.'/../inc/global.inc.php';
api_protect_course_script();
$header_file = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null;
$document_id = intval($_GET['id']);
$document_id = (int) $_GET['id'];
$originIsLearnpath = isset($_GET['origin']) && $_GET['origin'] === 'learnpathitem';
$courseInfo = api_get_course_info();
$course_code = api_get_course_id();

@ -8833,13 +8833,10 @@ function api_create_protected_dir($name, $parentDirectory)
}
/**
* Sends an HTML email using the phpmailer class (and multipart/alternative to downgrade gracefully)
* Sends an email
* Sender name and email can be specified, if not specified
* name and email of the platform admin are used.
*
* @author Bert Vanderkimpen ICT&O UGent
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*
* @param string name of recipient
* @param string email of recipient
* @param string email subject
@ -8851,9 +8848,8 @@ function api_create_protected_dir($name, $parentDirectory)
* @param bool True for attaching a embedded file inside content html (optional)
* @param array Additional parameters
*
* @return int true if mail was sent
* @return bool true if mail was sent
*
* @see class.phpmailer.php
*/
function api_mail_html(
$recipientName,
@ -8864,9 +8860,13 @@ function api_mail_html(
$senderEmail = '',
$extra_headers = [],
$data_file = [],
$embedded_image = false,
$embeddedImage = false,
$additionalParameters = []
) {
if (!api_valid_email($recipientEmail)) {
return false;
}
// Default values
$notification = new Notification();
$defaultEmail = $notification->getDefaultPlatformSenderEmail();
@ -8902,10 +8902,6 @@ function api_mail_html(
);*/
if (!api_valid_email($recipientEmail)) {
return 0;
}
/*if (is_array($extra_headers) && count($extra_headers) > 0) {
foreach ($extra_headers as $key => $value) {
switch (strtolower($key)) {
@ -8943,7 +8939,7 @@ function api_mail_html(
}
}
// Attachment ...
// Attachment
if (!empty($data_file)) {
foreach ($data_file as $file_attach) {
if (!empty($file_attach['path']) && !empty($file_attach['filename'])) {
@ -9006,8 +9002,6 @@ function api_mail_html(
$type = $message->getHeaders()->get('Content-Type');
$type->setCharset('utf-8');
//$type->setValue('text/html');
Container::getMailer()->send($message);
return true;

@ -280,10 +280,8 @@ class ResourceController extends BaseResourceController implements CourseControl
case 'user':
// Only for me
if (isset($share['only_me'])) {
error_log('only_me');
$repository->addResourceOnlyToMe($resourceNode);
} else {
error_log('others');
// To other users
$repository->addResourceToUserList($resourceNode, $idList);
}

Loading…
Cancel
Save