示例#1
0
        if ($gr['registrationChoice'] == 'y' && isset($_REQUEST['registration_choices']) && !in_array($gr['groupName'], $_REQUEST['registration_choices'])) {
            // deselect
            $out[] = $gr['groupName'];
        } elseif ($gr['registrationChoice'] != 'y' && isset($_REQUEST['registration_choices']) && in_array($gr['groupName'], $_REQUEST['registration_choices'])) {
            //select
            $in[] = $gr['groupName'];
        }
    }
    check_ticket('admin-inc-general');
    $pref_toggles = array('feature_wiki_1like_redirection');
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    $pref_byref_values = array('server_timezone');
    foreach ($pref_byref_values as $britem) {
        byref_set_value($britem);
    }
    $tikilib->set_preference('display_timezone', $tikilib->get_preference('server_timezone'));
    // Special handling for tied fields: tikiIndex, urlIndex and useUrlIndex
}
$smarty->assign('now', $tikilib->now);
if (!empty($_REQUEST['testMail'])) {
    include_once 'lib/webmail/tikimaillib.php';
    $mail = new TikiMail();
    $mail->setSubject(tra('Tiki Email Test'));
    $mail->setText(tra('Tiki Test email from:') . ' ' . $_SERVER['SERVER_NAME']);
    if (!$mail->send(array($_REQUEST['testMail']))) {
        $msg = tra('Unable to send mail');
        if ($tiki_p_admin == 'y') {
            $mailerrors = print_r($mail->errors, true);
            $msg .= $mailerrors;
示例#2
0
$extendedHeader = array('site_header_extended_nav' => array('label' => 'Enable Header Navigation', 'note' => 'This feature will add a number of useful links to the <head> section. These will help improve accessibility on this site.', 'type' => 'checkbox'), 'site_header_help' => array('label' => 'Help Link', 'note' => 'Enter the URL of where you want the help link to point to.', 'type' => 'text'), 'site_header_index' => array('label' => 'Site Index', 'note' => 'This URL should point to a site index of your website.', 'type' => 'text'), 'site_header_contents' => array('label' => 'Site Contents', 'note' => 'This URL should point to a site map of your website.', 'type' => 'text'), 'site_header_copyright' => array('label' => 'Site Copyright', 'note' => 'This link should point to a page with copyright information.', 'type' => 'text'), 'site_header_glossary' => array('label' => 'Site Glossary', 'note' => 'This link should point to a page with a glossary of terms.', 'type' => 'text'));
$gBitSmarty->assign('extendedHeader', $extendedHeader);
$formMisc = array('site_direct_pagination' => array('label' => 'Use direct pagination links', 'note' => 'Use direct pagination links instead of the small pagination box. Links are cleverly generated depending on the number of pages available.'), 'site_output_obzip' => array('label' => 'Use gzipped output', 'note' => 'Send gzip compressed data via PHP\'s output compression to browsers that support it. This feature will reduce download times and bandwidth consumption. Use it only if your server has no such mechanism enabled already (e.g., Apache\'s output compression).'), 'users_count_admin_pageviews' => array('label' => 'Count admin pageviews', 'note' => ''));
$gBitSmarty->assign('formMisc', $formMisc);
if (!empty($_REQUEST['change_prefs'])) {
    $featureToggles = array_merge($formBit, $formHelp, $formMisc, $extendedHeader);
    foreach ($featureToggles as $item => $info) {
        if (empty($info['type']) || $info['type'] == 'checkbox') {
            simple_set_toggle($item, KERNEL_PKG_NAME);
        } elseif ($info['type'] == 'text') {
            simple_set_value($item, KERNEL_PKG_NAME);
        }
    }
    $simpleValues = array("max_records", "site_url_index");
    foreach ($simpleValues as $svitem) {
        simple_set_value($svitem, KERNEL_PKG_NAME);
    }
    simple_set_toggle('site_display_reltime', KERNEL_PKG_NAME);
    // Special handling for tied fields: bit_index and site_url_index
    if (!empty($_REQUEST["site_url_index"]) && $_REQUEST["bit_index"] == 'users_custom_home') {
        $_REQUEST["bit_index"] = $_REQUEST["site_url_index"];
    }
    $refValue = array("site_long_date_format", "site_long_time_format", "site_short_date_format", "site_short_time_format", "site_long_datetime_format", "site_short_datetime_format", "bit_index");
    foreach ($refValue as $britem) {
        byref_set_value($britem, "", KERNEL_PKG_NAME);
    }
}
if (defined('ROLE_MODEL')) {
    $gBitSmarty->assign("role_model", TRUE);
}
$gBitSystem->setHelpInfo('Features', 'Settings', 'Help with the features settings');
示例#3
0
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Handle Update
$processForm = set_tab();
if ($processForm) {
    $pref_toggles = array("site_hidden", "site_closed", "site_use_load_threshold", "site_use_proxy", "site_store_session_db");
    foreach ($pref_toggles as $item) {
        simple_set_toggle($item, KERNEL_PKG_NAME);
    }
    $pref_simple_values = array("kernel_server_name", "site_sender_email", "site_proxy_host", "site_proxy_port", "site_session_lifetime", "site_load_threshold", "site_busy_msg", "site_closed_msg", "storage_host");
    foreach ($pref_simple_values as $item) {
        simple_set_value($item, KERNEL_PKG_NAME);
    }
    $pref_byref_values = array("site_title", "site_slogan", "site_description", "site_notice", "site_error_title");
    foreach ($pref_byref_values as $item) {
        $_REQUEST['site_description'] = substr($_REQUEST['site_description'], 0, 180);
        byref_set_value($item);
    }
    if (!empty($_REQUEST['site_keywords'])) {
        $_REQUEST['site_keywords'] = substr($_REQUEST['site_keywords'], 0, 900);
        $keywords = str_split($_REQUEST['site_keywords'], 250);
        // we need to make sure we remove all settings for site_keywords first in case the new value is considerably shorter than the previous one
        $gBitSystem->storeConfig('site_keywords_1', NULL);
        $gBitSystem->storeConfig('site_keywords_2', NULL);
        $gBitSystem->storeConfig('site_keywords_3', NULL);
        foreach ($keywords as $key => $chunk) {
            $gBitSystem->storeConfig("site_keywords" . (!empty($key) ? '_' . $key : ''), $chunk, KERNEL_PKG_NAME);
        }
        // join keywords back together
        $gBitSystem->setConfig('site_keywords', $gBitSystem->getConfig('site_keywords') . $gBitSystem->getConfig('site_keywords_1') . $gBitSystem->getConfig('site_keywords_2') . $gBitSystem->getConfig('site_keywords_3'));
    }
    // Special handling for site_temp_dir, which has a default value
} elseif (isset($_REQUEST["prefs"])) {
    check_ticket('admin-inc-general');
    $pref_toggles = array("anonCanEdit", "cacheimages", "cachepages", "count_admin_pvs", "direct_pagination", "feature_menusfolderstyle", "feature_obzip", "feature_detect_language", "lang_use_db", "modallgroups", "modseparateanon", "popupLinks", "record_untranslated", "site_closed", "useGroupHome", "limitedGoGroupHome", "useUrlIndex", "use_load_threshold", "use_proxy", "session_db", "contact_anon");
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    $pref_simple_values = array("site_crumb_seper", "contact_user", "site_favicon", "site_favicon_type", "feature_server_name", "maxRecords", "sender_email", "system_os", "error_reporting_level", "default_mail_charset", "mail_crlf", "urlIndex", "proxy_host", "proxy_port", "session_lifetime", "load_threshold", "site_busy_msg", "site_closed_msg", "helpurl");
    foreach ($pref_simple_values as $svitem) {
        simple_set_value($svitem);
    }
    $pref_byref_values = array("display_timezone", "language", "long_date_format", "long_time_format", "short_date_format", "short_time_format", "siteTitle", "slide_style", "tikiIndex", "https");
    foreach ($pref_byref_values as $britem) {
        byref_set_value($britem);
    }
    // Set value(s) with alternate pref name
    byref_set_value("site_style", "style");
    // Special handling for tied fields: tikiIndex, urlIndex and useUrlIndex
    if (!empty($_REQUEST["urlIndex"]) && isset($_REQUEST["useUrlIndex"]) && $_REQUEST["useUrlIndex"] == 'on') {
        $_REQUEST["tikiIndex"] = $_REQUEST["urlIndex"];
        $tikilib->set_preference("tikiIndex", $_REQUEST["tikiIndex"]);
        $smarty->assign_by_ref("tikiIndex", $_REQUEST["tikiIndex"]);
    }
    // Special handling for tmpDir, which has a default value
    if (isset($_REQUEST["tmpDir"])) {
        $tikilib->set_preference("tmpDir", $_REQUEST["tmpDir"]);
        $smarty->assign_by_ref("tmpDir", $_REQUEST["tmpDir"]);
    } else {
        $tdir = TikiSetup::tempdir();
        $tikilib->set_preference("tmpDir", $tdir);
        $smarty->assign("tmpDir", $tdir);
    }
<?php

$formLanguageToggles = array('i18n_browser_languages' => array('label' => 'Browser Language Recognition', 'note' => 'This will automatically recognise what the browsers default language is set to and display that language.<br />Please make sure you import appropriate languages first and disable / remove languages you don\'t want to support since loading a language for the first time will induce a lot of database traffic and might cause your system to slow down temporarily.'), 'i18n_content_translation' => array('label' => 'Content Translation', 'note' => 'This will activate the content translation service. Users will be given links to content in alternate languages, and prompted to create translation while editing content.', 'warning' => 'Please note that this feature is experimental.'), 'i18n_interactive_translation' => array('label' => 'Interactive Translations', 'note' => 'This will help you translate your site very effitiently by giving you direct access to the correct translation page.<br />Once you are done translating, make sure you turn this feature off and clear the language cache.<br />This feature only works when you set <em>$smarty_force_compile</em> to TRUE in your <em>config/kernel/config_inc.php</em> file', 'page' => 'TranslationTutorial', 'link' => array('title' => 'Language cache', 'package' => 'languages', 'file' => 'edit_languages.php')), 'i18n_interactive_bittranslation' => array('label' => 'Interactive bitTranslations', 'note' => 'If you have a <a href="http://doc.bitweaver.org/forums/viewtopic.php?t=948">translators account</a> on bitweaver.org, the translation links will redirect you there that you can modify the tranlations there. Due to the different setup on bitweaver.org, there might be strings that are not available for translation on that server.'), 'i18n_record_untranslated' => array('label' => 'Record untranslated', 'note' => 'This will record any untranslated language strings.'), 'i18n_track_translation_usage' => array('label' => 'Track Translation Usage', 'note' => 'Track which strings are used in your version of bitweaver so only the currently used strings appear while editing translations. You must clear your language and templates cache after enabling this option.', 'link' => array('title' => 'Language cache', 'package' => 'languages', 'file' => 'edit_languages.php')));
$gBitSmarty->assign('formLanguageToggles', $formLanguageToggles);
// Handle Update
if (isset($_REQUEST["prefs"])) {
    foreach ($formLanguageToggles as $toggle => $data) {
        simple_set_toggle($toggle, LANGUAGES_PKG_NAME);
    }
    $pref_byref_values = array("bitlanguage");
    foreach ($pref_byref_values as $britem) {
        byref_set_value($britem, NULL, LANGUAGES_PKG_NAME);
    }
    global $gBitLanguage;
    $gBitLanguage->setLanguage($gBitSystem->getConfig('bitlanguage'));
    $gBitSystem->storeConfig('google_api_key', $_REQUEST['google_api_key']);
} else {
    $gBitSmarty->assign("language", $gBitSystem->getConfig("language", "en"));
}
// Get list of available languages
$languages = array();
$languages = $gBitLanguage->listLanguages();
$gBitSmarty->assignByRef("languages", $languages);