/** * Automatically activate all core themes in the "themes" directory. */ function activate_core_themes() { include_once PHPWG_ROOT_PATH . 'admin/include/themes.class.php'; $themes = new themes(); foreach ($themes->fs_themes as $theme_id => $fs_theme) { if (in_array($theme_id, array('elegant', 'smartpocket'))) { $themes->perform_action('activate', $theme_id); } } }
// | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ if (!defined("PHPWG_ROOT_PATH")) { die("Hacking attempt!"); } include_once PHPWG_ROOT_PATH . 'admin/include/themes.class.php'; $base_url = get_root_url() . 'admin.php?page=' . $page['page']; $themes = new themes(); // +-----------------------------------------------------------------------+ // | perform actions | // +-----------------------------------------------------------------------+ if (isset($_GET['action']) and isset($_GET['theme'])) { $page['errors'] = $themes->perform_action($_GET['action'], $_GET['theme']); if (empty($page['errors'])) { if ($_GET['action'] == 'activate' or $_GET['action'] == 'deactivate') { $template->delete_compiled_templates(); } redirect($base_url); } } // +-----------------------------------------------------------------------+ // | start template output | // +-----------------------------------------------------------------------+ $themes->sort_fs_themes(); $default_theme = get_default_theme(); $db_themes = $themes->get_db_themes(); $db_theme_ids = array(); foreach ($db_themes as $db_theme) {
// +-----------------------------------------------------------------------+ // | Piwigo - a PHP based photo gallery | // +-----------------------------------------------------------------------+ // | Copyright(C) 2008-2016 Piwigo Team http://piwigo.org | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | // +-----------------------------------------------------------------------+ // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published by | // | the Free Software Foundation | // | | // | This program is distributed in the hope that it will be useful, but | // | WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | // | General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | // | USA. | // +-----------------------------------------------------------------------+ if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } $upgrade_description = 'Automatically activate mobile theme.'; include_once PHPWG_ROOT_PATH . 'include/constants.php'; include_once PHPWG_ROOT_PATH . 'admin/include/themes.class.php'; $themes = new themes(); $themes->perform_action('activate', 'smartpocket'); echo "\n" . $upgrade_description . "\n";
/** * API method * Performs an action on a theme * @param mixed[] $params * @option string action * @option string theme * @option string pwg_token */ function ws_themes_performAction($params, $service) { global $template; if (get_pwg_token() != $params['pwg_token']) { return new PwgError(403, 'Invalid security token'); } define('IN_ADMIN', true); include_once PHPWG_ROOT_PATH . 'admin/include/themes.class.php'; $themes = new themes(); $errors = $themes->perform_action($params['action'], $params['theme']); if (!empty($errors)) { return new PwgError(500, $errors); } else { if (in_array($params['action'], array('activate', 'deactivate'))) { $template->delete_compiled_templates(); } return true; } }