/** * * @param File $file * @param Config $config * @return string */ public function getDefaultPadlockImagePathByConfig($file, $config) { if ($file->isExpired()) { $lockpadImage = $config->LockpadImageNoLongerAvailable(); if (!$lockpadImage || !$lockpadImage->exists()) { if ($file->isEmbargoed()) { $lockpadImage = $config->LockpadImageNotYetAvailable(); if (!$lockpadImage || !$lockpadImage->exists()) { $lockpadImage = $config->LockpadImageNoAccess(); } } } } else { if ($file->isEmbargoed()) { $lockpadImage = $config->LockpadImageNotYetAvailable(); if (!$lockpadImage || !$lockpadImage->exists()) { if ($file->isExpired()) { $lockpadImage = $config->LockpadImageNoLongerAvailable(); if (!$lockpadImage || !$lockpadImage->exists()) { $lockpadImage = $config->LockpadImageNoAccess(); } } } } else { $lockpadImage = $config->LockpadImageNoAccess(); } } if (isset($lockpadImage) && $lockpadImage && $lockpadImage->exists()) { return $relativePath = $lockpadImage->Filename; } }
/** * * @param File $file * @param Config $config * @return type * @todo ...umm refactor? */ public function getDefaultPadlockImagePathByConfig($file, $config) { if ($file->isExpired()) { if (!$this->_no_longer_image) { $lockpadImage = $config->LockpadImageNoLongerAvailable(); if (!$lockpadImage || !$lockpadImage->exists()) { if ($file->isEmbargoed()) { if (!$this->_not_yet_image) { $lockpadImage = $config->LockpadImageNotYetAvailable(); if (!$lockpadImage || !$lockpadImage->exists()) { if (!$this->_no_access_image) { $lockpadImage = $config->LockpadImageNoAccess(); if ($lockpadImage && $lockpadImage->exists()) { $this->_no_access_image = $lockpadImage->Filename; return $this->_no_access_image; } } else { return $this->_no_access_image; } } else { $this->_not_yet_image = $lockpadImage->Filename; return $this->_not_yet_image; } } else { return $this->_not_yet_image; } } } else { $this->_no_longer_image = $lockpadImage->Filename; return $this->_no_longer_image; } } else { return $this->_no_longer_image; } } else { if ($file->isEmbargoed()) { if (!$this->_not_yet_image) { $lockpadImage = $config->LockpadImageNotYetAvailable(); if (!$lockpadImage || !$lockpadImage->exists()) { if ($file->isExpired()) { if (!$this->_no_longer_image) { $lockpadImage = $config->LockpadImageNoLongerAvailable(); if (!$lockpadImage || !$lockpadImage->exists()) { if (!$this->_no_access_image) { $lockpadImage = $config->LockpadImageNoAccess(); if ($lockpadImage && $lockpadImage->exists()) { $this->_no_access_image = $lockpadImage->Filename; return $this->_no_access_image; } } else { return $this->_no_access_image; } } else { $this->_no_longer_image = $lockpadImage->Filename; return $this->_no_longer_image; } } else { return $this->_no_longer_image; } } } else { $this->_not_yet_image = $lockpadImage->Filename; return $this->_not_yet_image; } } else { return $this->_not_yet_image; } } else { if (!$this->_no_access_image) { $lockpadImage = $config->LockpadImageNoAccess(); if ($lockpadImage && $lockpadImage->exists()) { $this->_no_access_image = $lockpadImage->Filename; return $this->_no_access_image; } } else { return $this->_no_access_image; } } } }