|
|
|
|
@ -7015,6 +7015,25 @@ class DocumentManager |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* It gest extra value to define if download icon is visible or not. |
|
|
|
|
* |
|
|
|
|
* @param $documentId |
|
|
|
|
* |
|
|
|
|
* @return bool |
|
|
|
|
*/ |
|
|
|
|
public static function getHideDownloadIcon($documentId) |
|
|
|
|
{ |
|
|
|
|
$extraFieldValue = new ExtraFieldValue('document'); |
|
|
|
|
$extraValue = $extraFieldValue->get_values_by_handler_and_field_variable($documentId, 'can_be_downloaded'); |
|
|
|
|
$canBeDownloadedIcon = false; |
|
|
|
|
if (!empty($extraValue) && isset($extraValue['value'])) { |
|
|
|
|
$canBeDownloadedIcon = (bool) $extraValue['value']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $canBeDownloadedIcon; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Parse file information into a link. |
|
|
|
|
* |
|
|
|
|
@ -7471,23 +7490,4 @@ class DocumentManager |
|
|
|
|
|
|
|
|
|
return $btn; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* It gest extra value to define if download icon is visible or not. |
|
|
|
|
* |
|
|
|
|
* @param $documentId |
|
|
|
|
* |
|
|
|
|
* @return bool |
|
|
|
|
*/ |
|
|
|
|
public static function getHideDownloadIcon($documentId) |
|
|
|
|
{ |
|
|
|
|
$extraFieldValue = new ExtraFieldValue('document'); |
|
|
|
|
$extraValue = $extraFieldValue->get_values_by_handler_and_field_variable($documentId, 'can_be_downloaded'); |
|
|
|
|
$canBeDownloadedIcon = false; |
|
|
|
|
if (!empty($extraValue) && isset($extraValue['value'])) { |
|
|
|
|
$canBeDownloadedIcon = (bool) $extraValue['value']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $canBeDownloadedIcon; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|