Minor - format code

pull/2729/head
Julio Montoya 7 years ago
parent 4863b42ef1
commit 015cb70646
  1. 9
      main/inc/lib/link.lib.php
  2. 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;
}
/**

@ -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