public function configure_site() { expHistory::set('manageable', $this->params); // TYPES OF ANTISPAM CONTROLS... CURRENTLY ONLY ReCAPTCHA $as_types = array('0' => '-- ' . gt('Please Select an Anti-Spam Control') . ' --', "recaptcha" => 'reCAPTCHA'); //THEMES FOR RECAPTCHA $as_themes = array("red" => gt('DEFAULT RED'), "white" => gt('White'), "blackglass" => gt('Black Glass'), "clean" => gt('Clean (very generic)')); // Available Themes $themes = array(); if (is_readable(BASE . 'themes')) { $theme_dh = opendir(BASE . 'themes'); while (($theme_file = readdir($theme_dh)) !== false) { if (is_readable(BASE . 'themes/' . $theme_file . '/class.php')) { // Need to avoid the duplicate theme problem. if (!class_exists($theme_file)) { include_once BASE . 'themes/' . $theme_file . '/class.php'; } if (class_exists($theme_file)) { // Need to avoid instantiating non-existent classes. $t = new $theme_file(); $themes[$theme_file] = $t->name(); } } } } uasort($themes, 'strnatcmp'); // Available Languages $langs = expLang::langList(); // ksort($langs); // smtp protocol $protocol = array('ssl' => 'SSL', 'tls' => 'TLS'); // attribution $attribution = array('firstlast' => 'John Doe', 'lastfirst' => 'Doe, John', 'first' => 'John', 'username' => 'jdoe'); // These funcs need to be moved up in to new subsystems // Date/Time Format $datetime_format = expSettings::dropdownData('datetime_format'); // Date Format $date_format = expSettings::dropdownData('date_format'); // Time Format $time_format = expSettings::dropdownData('time_format'); // Start of Week $start_of_week = expSettings::dropdownData('start_of_week'); // File Permissions $file_permisions = expSettings::dropdownData('file_permissions'); // File Permissions $dir_permissions = expSettings::dropdownData('dir_permissions'); // Homepage Dropdown $section_dropdown = navigationmodule::levelDropDownControlArray(0); // Timezone Dropdown $list = DateTimeZone::listAbbreviations(); $idents = DateTimeZone::listIdentifiers(); $data = $offset = $added = array(); foreach ($list as $abbr => $info) { foreach ($info as $zone) { if (!empty($zone['timezone_id']) and !in_array($zone['timezone_id'], $added) and in_array($zone['timezone_id'], $idents)) { $z = new DateTimeZone($zone['timezone_id']); $c = new DateTime(null, $z); $zone['time'] = $c->format('H:i a'); $data[] = $zone; $offset[] = $z->getOffset($c); $added[] = $zone['timezone_id']; } } } array_multisort($offset, SORT_ASC, $data); $tzoptions = array(); foreach ($data as $key => $row) { $tzoptions[$row['timezone_id']] = self::formatOffset($row['offset']) . ' ' . $row['timezone_id']; } assign_to_template(array('as_types' => $as_types, 'as_themes' => $as_themes, 'themes' => $themes, 'langs' => $langs, 'protocol' => $protocol, 'attribution' => $attribution, 'datetime_format' => $datetime_format, 'date_format' => $date_format, 'time_format' => $time_format, 'start_of_week' => $start_of_week, 'timezones' => $tzoptions, 'file_permisions' => $file_permisions, 'dir_permissions' => $dir_permissions, 'section_dropdown' => $section_dropdown)); }
# # Copyright (c) 2004-2006 OIC Group, Inc. # Copyright (c) 2006 Maxim Mueller # Written and Designed by James Hunt # # This file is part of Exponent # # 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(''); } $i18n = exponent_lang_loadFile('conf/extensions/site.structure.php'); foreach (glob(BASE . "external/editors/*.glue") as $installed_glue_file) { $installed_editor = basename($installed_glue_file, ".glue"); $installed_editors[$installed_editor] = $installed_editor; } $stuff = array($i18n['title'], array('SITE_TITLE' => array('title' => $i18n['site_title'], 'description' => $i18n['site_title_desc'], 'control' => new textcontrol()), 'USE_LANG' => array('title' => $i18n['use_lang'], 'description' => $i18n['use_lang_desc'], 'control' => new dropdowncontrol(0, exponent_lang_list())), 'SITE_ALLOW_REGISTRATION' => array('title' => $i18n['allow_registration'], 'description' => $i18n['allow_registration_desc'], 'control' => new checkboxcontrol()), 'SITE_USE_CAPTCHA' => array('title' => $i18n['use_captcha'], 'description' => $i18n['use_captcha_desc'], 'control' => new checkboxcontrol()), 'SITE_KEYWORDS' => array('title' => $i18n['site_keywords'], 'description' => $i18n['site_keywords_desc'], 'control' => new texteditorcontrol('', 10, 30)), 'SITE_DESCRIPTION' => array('title' => $i18n['site_description'], 'description' => $i18n['site_description_desc'], 'control' => new texteditorcontrol('', 15, 50)), 'SITE_404_HTML' => array('title' => $i18n['site_404'], 'description' => $i18n['site_404_desc'], 'control' => new texteditorcontrol('', 15, 50)), 'SITE_403_REAL_HTML' => array('title' => $i18n['site_403'], 'description' => $i18n['site_403_desc'], 'control' => new texteditorcontrol('', 15, 50)), 'SITE_DEFAULT_SECTION' => array('title' => $i18n['default_section'], 'description' => $i18n['default_section_desc'], 'control' => new dropdowncontrol('', navigationmodule::levelDropDownControlArray(0))), 'SITE_WYSIWYG_EDITOR' => array('title' => $i18n['wysiwyg_editor'], 'description' => $i18n['wysiwyg_editor_desc'], 'control' => new dropdowncontrol(null, $installed_editors)), 'SESSION_TIMEOUT' => array('title' => $i18n['session_timeout'], 'description' => $i18n['session_timeout_desc'], 'control' => new textcontrol()), 'SESSION_TIMEOUT_HTML' => array('title' => $i18n['timeout_error'], 'description' => $i18n['timeout_error_desc'], 'control' => new texteditorcontrol('', 15, 50)), 'FILE_DEFAULT_MODE_STR' => array('title' => $i18n['fileperms'], 'description' => $i18n['fileperms_desc'], 'control' => new dropdowncontrol(null, exponent_config_dropdownData('file_permissions'))), 'DIR_DEFAULT_MODE_STR' => array('title' => $i18n['dirperms'], 'description' => $i18n['dirperms_desc'], 'control' => new dropdowncontrol(null, exponent_config_dropdownData('dir_permissions'))), 'ENABLE_SSL' => array('title' => $i18n['ssl'], 'description' => $i18n['ssl_desc'], 'control' => new checkboxcontrol()), 'NONSSL_URL' => array('title' => $i18n['nonssl_url'], 'description' => $i18n['nonssl_url_desc'], 'control' => new textcontrol()), 'SSL_URL' => array('title' => $i18n['ssl_url'], 'description' => $i18n['ssl_url_desc'], 'control' => new textcontrol()), 'WORKFLOW_REVISION_LIMIT' => array('title' => $i18n['revision_limit'], 'description' => $i18n['revision_limit_desc'], 'control' => new textcontrol()))); $info = gd_info(); if (!EXPONENT_HAS_GD) { $stuff[1]['SITE_USE_CAPTCHA']['description'] = $i18n['use_captcha_desc'] . '<br /><br />' . $i18n['no_gd_support']; $stuff[1]['SITE_USE_CAPTCHA']['control']->disabled = true; } return $stuff;
/** * Internal Alias Form method * * This method returns a form object to be used when allowing the user * to create a new section that is actually a link to another page in the * Exponent site hierarchy. * * @param Object $object The section object to build the form from. * * @return Form A form object that can be used to create a new section, or * edit an existing one. */ static function internalAliasForm($object = null) { // Initialize the forms subsystem for use. // Initialization if (!isset($object->id)) { $object->internal_id = 0; } // Grab the basic form that all page types share // This has the name and positional dropdowns registered. // This call also initializes the section object, if it is not an existing section. $form = section::_commonForm($object); // the sef_name is already set in this existing page $form->unregister('sef_name'); // Add a dropdown to allow the user to choose an internal page. $form->register('internal_id', gt('Page'), new dropdowncontrol($object->internal_id, navigationmodule::levelDropDownControlArray(0, 0, array(), false, 'manage'))); // Add the'Public?' checkbox. The 'Active?' checkbox is omitted, because it makes no sense. $form->register('public', gt('Public'), new checkboxcontrol($object->public)); // Add a Submit / Cancel button. $form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel'))); // Return the form to the calling scope (usually an action in the navigation module). return $form; }
function internalAliasForm($object = null) { $i18n = exponent_lang_loadFile('datatypes/section.php'); // Initialize the forms subsystem for use. if (!defined('SYS_FORMS')) { require_once BASE . 'subsystems/forms.php'; } exponent_forms_initialize(); // Initialization if (!isset($object->id)) { $object->internal_id = 0; } // Grab the basic form that all page types share // This has the name and positional dropdowns registered. // This call also initializes the section object, if it is not an existing section. $form = section::_commonForm($object); // Add a dropdown to allow the user to choose an internal page. $form->register('internal_id', $i18n['internal_link'], new dropdowncontrol($object->internal_id, navigationmodule::levelDropDownControlArray(0, 0))); // Add the'Public?' checkbox. The 'Active?' checkbox is omitted, because it makes no sense. $form->register('public', $i18n['public'], new checkboxcontrol($object->public)); // Add a Submit / Cancel button. $form->register('submit', '', new buttongroupcontrol($i18n['save'], '', $i18n['cancel'])); // Return the form to the calling scope (usually an action in the navigation module). return $form; }