src/View/ThemeResourceLoader.php
public function findThemedResource($resource, $themes = null)
    {
        if ($themes === null) {
            $themes = SSViewer::get_themes();
        }

        $paths = $this->getThemePaths($themes);

        foreach ($paths as $themePath) {
            $relativePath = Path::join($themePath, $resource);
            $absolutePath = Path::join($this->base, $relativePath);
            if (file_exists($absolutePath)) {
                return $relativePath;
            }
        }

        // Resource exists in no context
        return null;
    }
public function findThemedResource($resource, $themes = null)
    {
        if ($themes === null) {
            $themes = SSViewer::get_themes();
        }

        $paths = $this->getThemePaths($themes);

        foreach ($paths as $themePath) {
            $relativePath = Path::join($themePath, $resource);
            $absolutePath = Path::join($this->base, $relativePath);
            if (file_exists($absolutePath)) {
                return $relativePath;
            }
        }

        // Resource exists in no context
        return null;
    }
public function findThemedResource ( $ resource , $ themes = null ) { if ( $ themes === null ) { $ themes = SSViewer :: get_themes ( ) ; } $ paths = $ this -> getThemePaths ( $ themes ) ; foreach ( $ paths as $ themePath ) { $ relativePath = Path :: join ( $ themePath , $ resource ) ; $ absolutePath = Path :: join ( $ this -> base , $ relativePath ) ; if ( file_exists ( $ absolutePath ) ) { return $ relativePath ; } } // Resource exists in no context return null ; }
Resolve a themed resource

A themed resource and be any file that resides in a theme folder.

@param string $resource A file path relative to the root folder of a theme
@param array $themes An order listed of themes to search, Defaults to {@see SSViewer::get_themes()}
@return string
Resolve a themed resource