function configureTheme() { //THEME COLORS $theme_colors = array("orange" => 'Orange', "blue" => 'Blue', "red" => 'Red', "green" => 'Green', "purple" => 'Purple', "black" => 'Black', "yellow" => 'Yellow', "pink" => 'Pink', "grey" => 'Grey', "magenta" => 'Magenta'); //THEME WIDTHS $button_sizes = array("small" => 'Small', "medium" => 'Medium', "large" => 'Large'); //THEME WIDTHS $theme_widths = array("" => '980px', "w1200px" => '1200px', "w760px" => '760px', "w600px" => '600px'); //THEME FONTS $theme_fonts = array("" => 'Tahoma', "georgia" => 'Georga', "times" => 'Times', "helvetica" => 'Helvetica', "verdana" => 'Verdana', "arial" => 'Arial', "courier" => 'Courier'); $settings = expSettings::parseFile(BASE . "themes/" . $_GET['theme'] . "/config.php"); $form = new form(); $form->meta('controller', 'administration'); $form->meta('action', 'update_theme'); $form->meta('theme', $_GET['theme']); $form->register('multi_size', gt('Theme Width') . ': ', new dropdowncontrol($settings['MULTI_SIZE'], $theme_widths)); $form->register('multi_font', gt('Theme Font') . ': ', new dropdowncontrol($settings['MULTI_FONT'], $theme_fonts)); $form->register('multi_color', gt('Theme Color') . ': ', new dropdowncontrol($settings['MULTI_COLOR'], $theme_colors)); $form->register('btn_color', gt('Button Color') . ': ', new dropdowncontrol($settings['BTN_COLOR'], $theme_colors)); $form->register('btn_size', gt('Button Size') . ': ', new dropdowncontrol($settings['BTN_SIZE'], $button_sizes)); $form->register(null, '', new htmlcontrol('<br>')); $form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel'))); assign_to_template(array('name' => self::name(), 'form_html' => $form->tohtml())); }
flash('notice', gt('This Exponent Site has already been configured.')); header('Location: ../index.php'); exit(gt('This Exponent Site has already been configured.')); } if (isset($_POST['sc'])) { if (file_exists("../conf/config.php")) { // Update the config $config = $_POST['sc']; foreach ($config as $key => $value) { expSettings::change($key, addslashes($value)); } } else { // Initialize /conf/config $config = $_POST['sc']; $values = array('c' => $config, 'opts' => array(), 'configname' => 'Default', 'activate' => 1); expSettings::saveConfiguration($values); } } if (isset($_POST['install_sample'])) { $eql = BASE . $_POST['install_sample'] . ".eql"; if (file_exists($eql)) { $errors = array(); expFile::restoreDatabase($db, $eql, $errors, 0); $files = BASE . $_POST['install_sample'] . ".tar.gz"; // only install if there was an eql file if (file_exists($files)) { include_once BASE . 'external/Tar.php'; $tar = new Archive_Tar($files); // $dest_dir = BASE.'files/'; // @mkdir($dest_dir); // if (file_exists($dest_dir)) {
echo gt('If in doubt, contact your system administrator or hosting provider.'); ?> </div> </div> <div class="control" id="mysql_options"> <span class="label"><?php echo gt('Database Encoding'); ?> : </span> <select name="sc[DB_ENCODING]" value="<?php echo $config['DB_ENCODING']; ?> " > <?php foreach (expSettings::dropdownData("DB_ENCODING") as $key => $value) { echo '<option value="' . $key . '">' . $value . '</option>'; } ?> </select> <div class="control_help"> <?php echo gt('Don\'t change that unless you know what you are doing.'); ?> <br /><br /> <?php echo gt('If in doubt, contact your system administrator or hosting provider.'); ?> </div> <div class="control">
$section = null; $section->name = gt('Home'); //FIXME not sure if we should do this? $section->public = 1; $section->active = 1; $section->rank = 0; $section->parent = 0; $sid = $db->insertObject($section, 'section'); } echoSuccess(); } if ($passed) { echoStart(gt('Saving Configuration')); $config = $_POST['sc']; foreach ($config as $key => $value) { expSettings::change($key, addslashes($value)); } // version tracking $db->delete('version', 1); // clear table of old accumulated entries // $version = EXPONENT_VERSION_MAJOR.'.'.EXPONENT_VERSION_MINOR.'.'.EXPONENT_VERSION_REVISION.'-'.EXPONENT_VERSION_TYPE.''.EXPONENT_VERSION_ITERATION; $vo = null; // $vo->version = EXPONENT_VERSION_MAJOR.'.'.EXPONENT_VERSION_MINOR.'.'.EXPONENT_VERSION_REVISION; $vo->type = EXPONENT_VERSION_TYPE; $vo->major = EXPONENT_VERSION_MAJOR; $vo->minor = EXPONENT_VERSION_MINOR; $vo->revision = EXPONENT_VERSION_REVISION; $vo->type = EXPONENT_VERSION_TYPE; $vo->iteration = EXPONENT_VERSION_ITERATION; $vo->builddate = EXPONENT_VERSION_BUILDDATE; $vo->created_at = time(); $ins = $db->insertObject($vo, 'version') or die($db->error());
unset($output); //Update each language file based on default language and then attempt to translate // Initialize the exponent environment and language subsystem include_once '../exponent_bootstrap.php'; expLang::loadLang(); global $default_lang, $cur_lang; if (empty($default_lang)) { $default_lang = (include BASE . "framework/core/lang/English - US.php"); } $orig_lang = LANG; $lang_list = expLang::langList(); foreach ($lang_list as $key => $value) { if ($key != "English - US") { output("Now attempting to translate new " . $key . " phrases\n"); expSettings::change('LANGUAGE', $key); exec('php ./lang_translate.php', $output); output($output); unset($output); } } expSettings::change('LANGUAGE', $orig_lang); print "\nCompleted Updating the Exponent Language System!\n"; function output($text) { if (!is_array($text)) { $text = array($text); } foreach ($text as $string) { print $string . "\n"; } }
/** * Method to save/update theme settings * This generic routine parses the passed params * and saves them to the theme's config.php file * It attempts to remove non-theme params such as analytics, etc.. * * @param $params theme configuration parameters */ function saveThemeConfig($params) { $theme = $params['theme']; unset($params['theme']); $sv = $params['sv']; if (strtolower($sv) == 'default') { $sv = ''; } unset($params['sv']); unset($params['controller']); unset($params['action']); foreach ($params as $key => $value) { if (strpos($key, '_' == 1)) { unset($params[$key]); } } if ($params['sv'] != '') { expSettings::saveValues($params, BASE . "themes/" . $theme . "/config_" . $sv . ".php"); } else { expSettings::saveValues($params, BASE . "themes/" . $theme . "/config.php"); } expHistory::back(); }
function __realpath($path) { $path = str_replace('\\', '/', realpath($path)); if ($path[1] == ':') { // We can't just check for C:/, because windows users may have the IIS webroot on X: or F:, etc. $path = substr($path, 2); } return $path; } } // Process user-defined constants first in overrides.php (if it exists) include_once 'overrides.php'; // load constants for paths and other environment not overridden in overrides.php require_once dirname(__realpath(__FILE__)) . '/exponent_constants.php'; // load the code version require_once BASE . 'exponent_version.php'; /* * EXPONENT Constant * * The EXPONENT Constant signals to other parts of the system that they are operating within the confines * of the Exponent v2 Framework. (Module actions check this -- if it is not defined, they must abort). */ define('EXPONENT', EXPONENT_VERSION_MAJOR); // load the constants from the global config, theme config, and then default config settings require_once BASE . 'framework/core/subsystems/expSettings.php'; // we don't have our autoloader loaded yet expSettings::initialize(); // Process PHP-wrapper settings (ini_sets and settings, and autoloader) require_once BASE . 'exponent_php_setup.php'; $info = gd_info(); define('EXPONENT_HAS_GD', $info['GD Version'] == 'Not Supported' ? 0 : 1);
# Exponent 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; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## if (!defined('EXPONENT')) { exit(''); } global $db; $error = false; // We have to force the language name into the config.php file expSettings::change('LANGUAGE', LANGUAGE); $user = $db->selectObject('user', 'is_admin=1'); $user->username = $_POST['username']; if ($user->username == '') { $error = true; $errorstr = gt('You must specify a valid username.'); $errorflag = '&errusername=true'; echo $errorstr; } elseif ($_POST['password'] != $_POST['password2']) { $error = true; $errorstr = gt('Your passwords do not match. Please check your entries.'); $errorflag = '&errpassword=true'; echo $errorstr; } elseif (!expValidator::validate_email_address($_POST['email'])) { $error = true; $errorstr = gt('Your email address is invalid. Please check your entry.');