$ignoreLinks = array();
foreach ($links as $id => $link) {
$links[$id]['id'] = $id;
+ $skipCopyAsset = false;
if (isset($link['image']) && $link['image']) {
$workingFile = $workingDir . '/' . $link['image'];
$assetId = 'link_datas_i_' . md5($link['image']);
if (isset($imagesassets[$assetId])) {
- continue;
- }
- if (file_exists($workingFile)) {
- if ($link['page'] <= 1) {
- $flexLight->addBitmap($workingFile, $assetId);
- } else {
- $flex->addBitmap($workingFile, $assetId);
+
+ } else {
+ if (file_exists($workingFile)) {
+ if ($link['page'] <= 1) {
+ $flexLight->addBitmap($workingFile, $assetId);
+ } else {
+ $flex->addBitmap($workingFile, $assetId);
+ }
}
+ $imagesassets[$assetId] = true;
}
- $imagesassets[$assetId] = true;
}
if ($link['type'] == 16 && $book->parametres->linkFilePrefix) {
if (!CubeIT_Util_Url::isDistant($link['to'])) {
- $link['to'] = $book->parametres->linkFilePrefix . $link['to'];
- $links[$id] = $link;
+ $skipCopyAsset = true;
+ $links[$id]['to'] = $book->parametres->linkFilePrefix . $link['to'];
}
}
}
$imagesassets[$id] = true;
} else if (in_array($link['type'], array(4, 6, 7, 9, 16, 17, 25))) {
- $workingFile = $workingDir . '/' . $link['to'];
- if (file_exists($workingFile)) {
- $filesToCopy['data/' . $link['to']] = $workingFile;
- }
+ if (!$skipCopyAsset) {
+ $workingFile = $workingDir . '/' . $link['to'];
+ if (file_exists($workingFile)) {
+ $filesToCopy['data/' . $link['to']] = $workingFile;
+ }
- if ($link['type'] == 4) {
- $poster = $link['to'];
- $e = explode('.', $poster);
- array_pop($e);
- array_push($e, 'jpg');
- $poster = implode('.', $e);
+ if ($link['type'] == 4) {
+ $poster = $link['to'];
+ $e = explode('.', $poster);
+ array_pop($e);
+ array_push($e, 'jpg');
+ $poster = implode('.', $e);
- $workingFile = $workingDir . '/' . $poster;
- if (file_exists($workingFile)) {
- $filesToCopy['data/' . $poster] = $workingFile;
+ $workingFile = $workingDir . '/' . $poster;
+ if (file_exists($workingFile)) {
+ $filesToCopy['data/' . $poster] = $workingFile;
+ }
}
}
}