Liste des themes

@return array $array Passage des variables dans le template
themesActivated : theme qui sont activés
themesNotActivated : theme qui ne sont pas activés
flashMessages : flashMessages
557580
public function listAction()
    {
        $automaticTheme = $this->addAutomaticTheme();

        $themeMaper = $this->getAdminThemeService();

        $themesActivated = $themeMaper->findActiveTheme();
        $themesNotActivated = $themeMaper->findActiveTheme(false);

        return array('themesActivated'    => $themesActivated,
                     'themesNotActivated' => $themesNotActivated,
                     'automaticTheme'     => $automaticTheme,
                     'flashMessages'      => $this->flashMessenger()->getMessages());
    }
933962
public function get_parent_themes($theme_name)
	{
		$return = array($this->create_theme_array($theme_name));
		$theme_info = $this->load_info($theme_name);

		if ( ! empty($theme_info['parent']))
		{
			$return = array_merge($return, $this->get_parent_themes($theme_info['parent']));
		}
		elseif($theme_name !== $this->fallback['name'])
		{
			$return[] = $this->fallback;
		}

		return $return;
	}
1049007
public function toOptionArray()
    {
        return [
            ['label' => __('Auto'), 'value' => self::AUTO_DISPLAYED],
            ['label' => __('Always hidden'), 'value' => self::ALWAYS_HIDDEN],
            ['label' => __('Always displayed'), 'value' => self::ALWAYS_DISPLAYED],
        ];
    }
1226657
public function getThemeCustomizableStylePresets()
    {
        $presets = [];
        $env = Environment::get();
        if ($this->isThemeCustomizable()) {
            $directory = $env->getPath(
                DIRNAME_THEMES.'/'.$this->getThemeHandle(
                ).'/'.DIRNAME_CSS.'/'.DIRNAME_STYLE_CUSTOMIZER_PRESETS,
                $this->getPackageHandle()
            );
            $urlroot = $env->getURL(
                DIRNAME_THEMES.'/'.$this->getThemeHandle().'/'.DIRNAME_CSS,
                $this->getPackageHandle()
            );
            $dh = Loader::helper('file');
            $files = $dh->getDirectoryContents($directory);
            foreach ($files as $f) {
                if (strrchr($f, '.') == static::THEME_CUSTOMIZABLE_STYLESHEET_EXTENSION) {
                    $preset = Preset::getFromFile($directory.'/'.$f, $urlroot);
                    if (is_object($preset)) {
                        $presets[] = $preset;
                    }
                }
            }
        }
        usort(
            $presets,
            function ($a, $b) {
                if ($a->isDefaultPreset()) {
                    return -1;
                } else {
                    return strcasecmp($a->getPresetDisplayName('text'), $b->getPresetDisplayName('text'));
                }
            }
        );

        return $presets;
    }
731901
public function theme()
    {
        // nothing set, skip theme
        if (!$this->theme || !isset($this->theme->name)) {
            return false;
        }

        // only theme name is set
        if (is_string($this->theme)) {
            return (object)[
                'name'     => $this->theme,
                'mods'     => [],
                'options'  => [],
                'menus'    => [],
                'sidebars' => []
            ];
        }

        // read theme setting
        return (object)[
            'name'     => $this->theme->name,
            'mods'     => isset($this->theme->mods) ? $this->theme->mods : [],
            'options'  => isset($this->theme->options) ? $this->theme->options : [],
            'menus'    => isset($this->theme->menus) ? $this->theme->menus : [],
            'sidebars' => isset($this->theme->sidebars) ? $this->theme->sidebars : []
        ];
    }
838574
public function getAvailableThemes()
    {

        $returnValue = array();
        foreach ($this->getMap() as $target => $value) {
            //ugly
            if($target == ThemeRegistry::WEBSOURCE) {
                continue;
            }
            //retrieve all other value
            $returnValue[$target] = $value;

            // adapt path for all theme
            $returnValue[$target]['available'] = array();
            foreach ($value['available'] as $theme) {
                $returnValue[$target]['available'][] = $this->updatePath($theme);
            }

            $returnValue[$target]['base'] = $this->getResolvedBase($target);
        }
        return $returnValue;
    }
327234
public function listAction()
    {
        $request = $this->getRequest();

        $this->admin->checkAccess('list');

        $preResponse = $this->preList($request);
        if (null !== $preResponse) {
            return $preResponse;
        }

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $formView = $datagrid->getForm()->createView();

        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFilterTheme());

        // NEXT_MAJOR: Remove this line and use commented line below it instead
        $template = $this->admin->getTemplate('list');
        // $template = $this->templateRegistry->getTemplate('list');

        return $this->renderWithExtraParams($template, [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
            'export_formats' => $this->has('sonata.admin.admin_exporter') ?
                $this->get('sonata.admin.admin_exporter')->getAvailableFormats($this->admin) :
                $this->admin->getExportFormats(),
        ], null);
    }
1239970
public static function themes()
    {
        $themesUri = self::root() . '/style/';
        $themes = array();
        foreach (glob($themesUri . '/*.css') as $css) {
            $fn = trim(preg_replace("%.*/%", '', $css));
            switch ($fn) {
                // these are special, exclude these
                case 'luminous.css':
                case 'luminous_print.css':
                case 'luminous.min.css':
                    continue;
                default:
                    $themes[] = $fn;
            }
        }
        return $themes;
    }
324172
public function getDesignSettings() {
        return (array) array (
            'hosted' => array (
                'theme_color' => $this->getValue(
                    self::KEY_THEME_COLOR,
                    $this->storeManager->getStore()
                ),
                'button_label' => $this->getValue(
                    self::KEY_BUTTON_LABEL,
                    $this->storeManager->getStore()
                ),
                'box_title' => $this->getValue(
                    self::KEY_BOX_TITLE,
                    $this->storeManager->getStore()
                ),
                'box_subtitle' => $this->getValue(
                    self::KEY_BOX_SUBTITLE,
                    $this->storeManager->getStore()
                ),
                'logo_url' => $this->getLogoUrl()
            )
        );
    }
33478
public function detect()
    {
        $themes  = new Collection();
        $file    = $this->app->make('files');
        $path    = rtrim(__DIR__ . '/../' . array_get($this->config, 'indexes_path', ''));
        $folders = $file->directories($path);
        foreach ($folders as $folder) {
            $templateDir = class_basename($folder);
            $name        = $this->parseThemeNameFromPath($folder);
            $manifest    = new Manifest($file, $this->config + ['dir' => $templateDir], rtrim($folder, '/') . '/');
            $items       = $manifest->items();
            if (is_null($items)) {
                continue;
            }
            $themes[$name] = $items->getAttributes();
        }
        return $themes;
    }
630631
private function setActiveTheme()
    {
        if ($this->inAdministration()) {
            $themeName = $this->app['config']->get('society.core.core.admin-theme');

            return $this->app['stylist']->activate($themeName, true);
        }

        return $this->app['stylist']->activate($this->app['config']->get('society.core.core.frontend-theme'), true);
    }
927999
public function formatTemplateFiles() : array
    {
        list(, $presenter) = \Nette\Application\Helpers::splitName($this->getName());
        $dir = dirname($this->getReflection()->getFileName());
        $dir = is_dir("{$dir}/templates") ? $dir : dirname($dir);
        return [
            "{$dir}/template/page/view/{$this->view}",
            "{$dir}/template/page/view/{$presenter}{$this->view}",
        ];
    }
963659
public function getList()
    {
        $this->_aThemeList = [];
        $sOutDir = \OxidEsales\Eshop\Core\Registry::getConfig()->getViewsDir();
        foreach (glob($sOutDir . "*", GLOB_ONLYDIR) as $sDir) {
            $oTheme = oxNew(\OxidEsales\Eshop\Core\Theme::class);
            if ($oTheme->load(basename($sDir))) {
                $this->_aThemeList[$sDir] = $oTheme;
            }
        }

        return $this->_aThemeList;
    }
424695
private function theme_locations() {

		if ( isset( $this->theme_locations ) ) {
			return $this->theme_locations;
		}

		/**
		 * Filters the theme locations.
		 *
		 * @since 1.0.0
		 *
		 * @param string|string[] $theme_locations One or more theme locations.
		 */
		$theme_locations = (array) apply_filters( self::FILTER_THEME_LOCATIONS, [] );

		$this->theme_locations = array_map( 'strval', $theme_locations );

		return $this->theme_locations;
	}
467877
public function index()
    {
        $themes = Theme::all();
        $activeTheme = Configuration::getConfiguration('active_theme_identifier');

        return view('avored-ecommerce::theme.index')
            ->with('themes', $themes)
            ->with('activeTheme', $activeTheme);
    }
186900
public function getNotificationTemplateData()
    {
        $fields = $this->Context->getValues();
        if (!is_array($fields)) {
            $fields = [];
        }
        $fields['Content'] = $this->Content;
        return $fields;
    }
1003822
public function getAllowedThemes()
    {
        $event = new AllowListEvent(AllowListEvent::THEMES, variable_get('ucms_site_allowed_themes', []));
        $this->dispatcher->dispatch(AllowListEvent::EVENT_THEMES, $event);

        return $event->getAllowedItems();
    }