themes = new dcThemes($core); $core->themes->loadModules($core->blog->themes_path, null); # -- Page helper -- $list = new adminThemesList( $core->themes, $core->blog->themes_path, $core->blog->settings->system->store_theme_url ); adminThemesList::$distributed_modules = explode(',', DC_DISTRIB_THEMES); # -- Theme screenshot -- if (!empty($_GET['shot']) && $list->modules->moduleExists($_GET['shot'])) { $f= path::real(empty($_GET['src']) ? $core->blog->themes_path.'/'.$_GET['shot'].'/screenshot.jpg' : $core->blog->themes_path.'/'.$_GET['shot'].'/'.path::clean($_GET['src']) ); if (!file_exists($f)) { $f = dirname(__FILE__).'/images/noscreenshot.png'; } http::cache(array_merge(array($f), get_included_files())); header('Content-Type: '.files::getMimeType($f)); header('Content-Length: '.filesize($f)); readfile($f); exit; } # -- Display module configuration page -- if ($list->setConfiguration($core->blog->settings->system->theme)) { # Get content before page headers include $list->includeConfiguration(); # Gather content $list->getConfiguration(); # Display page dcPage::open(__('Blog appearance'), dcPage::jsPageTabs(). dcPage::jsColorPicker(). # --BEHAVIOR-- themesToolsHeaders $core->callBehavior('themesToolsHeaders', $core, true), dcPage::breadcrumb( array( html::escapeHTML($core->blog->name) => '', __('Blog appearance') => $list->getURL('',false), ''.__('Theme configuration').'' => '' )) ); # Display previously gathered content $list->displayConfiguration(); dcPage::helpBlock('core_blog_theme_conf'); dcPage::close(); # Stop reading code here return; } # -- Execute actions -- try { $list->doActions(); } catch (Exception $e) { $core->error->add($e->getMessage()); } # -- Page header -- dcPage::open(__('Themes management'), dcPage::jsLoad('js/_blog_theme.js'). dcPage::jsPageTabs(). dcPage::jsColorPicker(). # --BEHAVIOR-- themesToolsHeaders $core->callBehavior('themesToolsHeaders', $core, false), dcPage::breadcrumb( array( html::escapeHTML($core->blog->name) => '', ''.__('Blog appearance').'' => '' )) ); # -- Display modules lists -- if ($core->auth->isSuperAdmin() && $list->isWritablePath()) { # Updated modules from repo $modules = $list->store->get(true); if (!empty($modules)) { echo '
'.sprintf( __('There is one theme to update available from repository.', 'There are %s themes to update available from repository.', count($modules)), count($modules) ).'
'; $list ->setList('theme-update') ->setTab('themes') ->setModules($modules) ->displayModules( /*cols */ array('checkbox', 'name', 'sshot', 'desc', 'author', 'version', 'current_version', 'parent'), /* actions */ array('update', 'delete') ); echo ''.sprintf( __("Visit %s repository, the resources center for Dotclear."), 'Dotaddict' ). '
'. ''.__('You can configure and manage installed themes from this list.').'
'; $list ->setList('theme-activate') ->setTab('themes') ->setModules($modules) ->displayModules( /* cols */ array('sshot', 'distrib', 'name', 'config', 'desc', 'author', 'version', 'parent'), /* actions */ array('select', 'behavior', 'deactivate', 'delete') ); echo ''.__('Deactivated themes are installed but not usable. You can activate them from here.').'
'; $list ->setList('theme-deactivate') ->setTab('themes') ->setModules($modules) ->displayModules( /* cols */ array('name', 'distrib'), /* actions */ array('activate', 'delete') ); echo ''.__('Search and install themes directly from repository.').'
'; $list ->setList('theme-new') ->setTab('new') ->setModules($modules) ->displaySearch() ->displayIndex() ->displayModules( /* cols */ array('expander', 'sshot', 'name', 'score', 'config', 'desc', 'author', 'version', 'parent', 'details', 'support'), /* actions */ array('install'), /* nav limit */ true ); echo ''.sprintf( __("Visit %s repository, the resources center for Dotclear."), 'Dotaddict' ). '
'. ''.__('You can install themes by uploading or downloading zip files.').'
'; $list->displayManualForm(); echo '