Minor - flint fixes

pull/2744/head
Julio Montoya 6 years ago
parent fc0c99cca6
commit 0831f38d86
  1. 9
      main/inc/lib/link.lib.php
  2. 6
      main/install/configuration.dist.php
  3. 4
      main/lp/learnpath.class.php

@ -1572,14 +1572,11 @@ class Link extends Model
*
* @version 1.0
*/
public static function is_pdf_link($url)
public static function isPdfLink($url)
{
$is_pdf_link = strrpos($url, ".pdf") || strrpos(
$url,
".PDF"
);
$isPdfLink = strrpos(strtolower($url), '.pdf');
return $is_pdf_link;
return $isPdfLink;
}
/**

@ -874,12 +874,12 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
]
];*/
// Activate the view with ViewerJS for PDF files within the lessons for IPad and IPhone
// $_configuration['allow_pdf_viewerjs_in_lp'] = false;
// ------ Custom DB changes (keep this at the end)
// Add user activation by confirmation email
// This option prevents the new user to login in the platform if your account is not confirmed via email
// You need add a new option called "confirmation" to the registration settings
//INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_registration', 'confirmation', 'MailConfirmation');
// ------ (End) Custom DB changes
// Activate the view with ViewerJS for PDF files within the lessons for IPad and IPhone
// $_configuration['allow_pdf_viewerjs_in_lp'] = false;

@ -3666,8 +3666,8 @@ class learnpath
switch ($lp_item_type) {
case 'document':
if(api_get_configuration_value('allow_pdf_viewerjs_in_lp')){
if(Link::is_pdf_link($file)){
if (api_get_configuration_value('allow_pdf_viewerjs_in_lp')) {
if (Link::isPdfLink($file)) {
$pdfUrl = api_get_path(WEB_LIBRARY_PATH).'javascript/ViewerJS/index.html#'.$file;
$file = $pdfUrl;
}

Loading…
Cancel
Save