Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $fname = static::downloadFile($manualUrl);
- if ($fname !== '') {
- $info = \CFile::MakeFileArray($fname);
- $info['MODULE_ID'] = 'iblock';
- $fileId = \CFile::SaveFile($info, $info['MODULE_ID']);
- if ($fileId) {
- $item->setProperty(static::MANUAL_CODE, $fileId);
- }
- }
- // new version
- public static function downloadManual( $manualUrl )
- {
- $fileId = 0;
- if ($manualUrl !== '') {
- $fname = static::downloadFile($manualUrl);
- if ($fname !== '') {
- $info = CFile::MakeFileArray($fname);
- $info['MODULE_ID'] = 'iblock';
- $fileId = CFile::SaveFile($info, $info['MODULE_ID']);
- }
- }
- return $fileId;
- }
- $fileId = static::downloadManual( $item->getManualUrl() );
- if ($fileId) {
- $item->setProperty(static::MANUAL_CODE, $fileId);
- }
Advertisement
Add Comment
Please, Sign In to add comment