Themes::index PHP Méthode

index() public méthode

public index ( )
    public function index()
    {
        $this->user->restrict('Site.Themes.Access');
        $this->template->setTitle($this->lang->line('text_title'));
        $this->template->setHeading($this->lang->line('text_heading'));
        $this->template->setButton($this->lang->line('button_new'), array('class' => 'btn btn-primary', 'href' => page_url() . '/add'));
        $data['themes'] = array();
        $themes = $this->Themes_model->getList();
        foreach ($themes as $name => $theme) {
            if ($theme['name'] === trim($this->config->item(MAINDIR, 'default_themes'), '/')) {
                $active = '1';
            } else {
                $active = FALSE;
            }
            $data['themes'][$name] = array('name' => $theme['name'], 'title' => $theme['title'], 'version' => $theme['version'], 'description' => $theme['description'], 'author' => $theme['author'], 'parent' => $theme['parent'], 'child' => $theme['child'], 'parent_title' => (!empty($theme['parent']) and !empty($themes[$theme['parent']]['title'])) ? $themes[$theme['parent']]['title'] : '', 'active' => $active, 'screenshot' => $theme['screenshot'], 'activate' => site_url('themes/activate/' . $theme['name']), 'edit' => site_url('themes/edit/' . $theme['name']), 'delete' => site_url('themes/delete/' . $theme['name']), 'copy' => site_url('themes/copy/' . $theme['name']));
        }
        $this->template->render('themes', $data);
    }