/** * Add an optional icon to the BackendLayout * * @param array $fileInformation pathinfo() of the given file * @param BackendLayout $backendLayout * @return void */ protected function addIcon($fileInformation, BackendLayout $backendLayout) { $imageExtensions = explode(',', self::FILE_TYPES_ICON); $filePath = $fileInformation['dirname'] . '/' . $fileInformation['filename']; foreach ($imageExtensions as $extension) { $icon = $filePath . '.' . $extension; // First check if icon is available in public folder $iconPublic = str_replace('/Private/', '/Public/', $icon); $icon = is_file($iconPublic) ? $iconPublic : $icon; if (is_file($icon)) { $icon = '../' . str_replace(PATH_site, '', $icon); $backendLayout->setIconPath($icon); break; } } }
/** * Registers icon for the backend layout * * @param array $fileInformation Information about the backend layout file * @param BackendLayout $backendLayout * @return void */ protected function addIcon($fileInformation, BackendLayout $backendLayout) { $file = ExtensionManagementUtility::extPath('bdp_template', '/Resources/Public/Backend/Images/' . $fileInformation['filename'] . '.'); $extensions = array('png', 'gif'); foreach ($extensions as $extension) { if (is_file($file . $extension)) { $backendLayout->setIconPath(ExtensionManagementUtility::extRelPath('bdp_template') . '/Resources/Public/Backend/Images/' . $fileInformation['filename'] . '.' . $extension); break; } } }