Renders theme's "screenshot.png"

@param string $themeName Theme's name
@return \Cake\Network\Response
497991
public function screenshot($themeName)
    {
        $theme = plugin($themeName); // throws
        $this->response->file("{$theme->path}/webroot/screenshot.png");

        return $this->response;
    }
1297259
public function getThemes($moduleName)
    {
        $dir = $this->kernel->getBundle('SiteBundle')->getPath().'/Resources/modules/'.$moduleName;

        if (!is_dir($dir)) {
            return [];
        }

        $finder = new Finder();
        $finder->directories()->sortByName()->depth('== 0')->in($dir);

        $themes = [];
        /** @var \Symfony\Component\Finder\SplFileInfo $file */
        foreach ($finder as $file) {
            $themes[] = $file->getFilename();
        }

        return $themes;
    }
361972
public function showAction($filename)
    {
        $message = $this->get('cocorico.swift_reader.message_manager')
            ->getOneByFileName($filename);

        return $this->render(
            'CocoricoSwiftReaderBundle:Message:_show.html.twig',
            array(
                'filename' => $filename,
                'message' => $message
            )
        );
    }
631885
public function render($templateName = null, $data = [])
    {
        $this->setTemplate($templateName, $data);

        return json_encode($this->_data);
    }
1172325
public function showPage($pageName = 'index')
    {
        if (!$this->page->exists($pageName)) {
            return \Response::view($this->theme.'.404', array('global' => $this->global), 404);
        }

        $page = $this->page->get($pageName);

        $viewParamaters = array(
            'global' => $this->global,
            'page' => $page
        );

        if (\View::exists($this->theme.'.'.$pageName)) {
            return \View::make($this->theme.'.'.$pageName, $viewParamaters);
        } else {
            return \View::make($this->theme.'.page', $viewParamaters);
        }
    }
951676
public function renderBlock(string $blockName): string
    {
        if (!$this->template->hasBlock($blockName, $this->context, $this->blocks)) {
            return '';
        }

        $level = ob_get_level();
        ob_start();

        try {
            $this->template->displayBlock($blockName, $this->context, $this->blocks);
        } catch (Throwable $t) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }

            throw $t;
        }

        return (string) ob_get_clean();
    }
740340
public function url($filename)
    {
        // If no Theme set, return /$filename
        if (!$this->current()) {
            return "/" . ltrim($filename, '/');
        }

        return $this->current()->url($filename);
    }
820777
public function takePicture($filename)
    {
        if (empty($filename)) {
            throw new \InvalidArgumentException('Filename required');
        }

        # TODO check filepath and create missing dirs?

        $this->valueArguments['output'] = $filename;

        $this->execute(
            $this->buildCommand()
        );
    }
602179
protected function getFluidTemplateObject($filename)
    {
        $view = GeneralUtility::makeInstance(StandaloneView::class);
        $view->setLayoutRootPaths(['EXT:backend/Resources/Private/Layouts']);
        if (\Gilbertsoft\Warranty\Utility\Adapter::isCompatVersion('8.7')) {
            $view->setPartialRootPaths(['EXT:backend/Resources/Private/Partials/ToolbarItems']);
            $view->assignMultiple([
                    'iconSize'  => 'default',
                ]);
        } else {
            $view->setPartialRootPaths(['EXT:gswarranty/Resources/Private/Partials/ToolbarItems']);
            $view->assignMultiple([
                    'iconSize'  => 'small',
                ]);
        }
        $view->setTemplateRootPaths(['EXT:gswarranty/Resources/Private/Templates/ToolbarItems']);
        $view->setTemplate($filename);

        return $view;
    }
515841
public function render($custom = null)
    {
        $messages = $this->toArray();

        if ( ! empty ($messages)) {
            $this->clearMessages();
            return $this->theme->render(
                $custom,
                ['messages' => $this->withDefaults($messages)],
                'alert'
            );
        }

        return '';
    }
646264
public function cacheAction($filename)
    {
        $filePath = $this->getParameter('kernel.root_dir').'/../var/storage/cache/'.$filename;
        if (!file_exists($filePath)) {
            return new Response('File not found.', 404);
        }
        $file = file_get_contents($filePath);

        $headers = array();
        if (preg_match('/.png$/', $filename)) {
            $headers = array(
                'Cache-Control'     => 'max-age=3600',
                'Content-Type'     => 'image/png',
                'Content-Disposition' => 'inline; filename="'.$filename.'"',
            );
        } elseif (preg_match('/.jpg/', $filename)) {
            $headers = array(
                'Cache-Control'     => 'max-age=3600',
                'Content-Type'     => 'image/jpg',
                'Content-Disposition' => 'inline; filename="'.$filename.'"',
            );
        } elseif (preg_match('/.pdf/', $filename) || preg_match('/.xlsx/', $filename)) {
            $headers = array(
                'Cache-Control'     => 'private',
                'Content-Type'     => mime_content_type($filePath),
                'Content-length'     => filesize($filePath),
                'Content-Disposition' => 'attachment; filename="'.$filename.'"',
            );
        }

        return new Response($file, 200, $headers);
    }
553087
public function setActiveTheme($themeName = '')
    {
        Event::fire('theme.before_is_set', [$this]);

        if($themeName) {
            if(!self::ifExists($themeName)) {
                throw new \Exception($themeName . ' Theme  could not be found in file directory.');
            }
        }else{
            // return mobile theme if site is accessed from mobile or tablet
            if(settings('activateMobileTheme') && (MobileDetect::isMobile() || MobileDetect::isTablet()) ) {
                $themeName = settings('mobileActiveTheme');
            }else {
                // Theme from settings
                $themeName = settings('activeTheme');

                // Or return default theme of no theme is selected in settings
                if (!$themeName) {
                    $themeName = config('project.defaultTheme');
                }
            }
        }

        // Ensure theme exist
        if(!self::ifExists($themeName)) {
            throw new \Exception("Theme '$themeName' does not exist in Themes directory!");
        }

        self::$activeTheme = $themeName;

        $this->setConfig();

        Event::fire('theme.after_is_set', [$this]);
    }
1309739
public function find($themeName)
    {
        // Search for registered themes
        foreach ($this->themes as $theme) {
            if ($theme->name == $themeName) {
                return $theme;
            }

        }

        throw new Exceptions\themeNotFound($themeName);
    }
639995
public function themeOption($name)
    {
        return isset($this->themeOptions[$name]) ? $this->themeOptions[$name] : null;
    }
1100389
public function render($FileName)
    {
        if ($this->TransparentBackground) {
            imagealphablending($this->Picture, false);
            imagesavealpha($this->Picture, true);
        }
        imagepng($this->Picture, $FileName);
    }
19604
public function render($migrationName)
    {
        $loader = new FilesystemLoader(__DIR__ . '/views/%name%');

        $view = new PhpEngine(new TemplateNameParser(), $loader);

        $this->templateInitialization->setMigrationName($migrationName);

        return $view->render($this->getTemplatePath(), array(
            'migrationName' => $migrationName,
            'initUp' => $this->templateInitialization->getInitUp(),
            'initDown' => $this->templateInitialization->getInitDown(),
        ));
    }
1216246
public function img($file, $ext=null, $theme=null) {
        
        $this->secondaryTheme($theme);
        
        $img = $this->enqueueFiles($file, $this->container->getIMG(), $ext);
        
        return $img;
        
    }