/**
 * Store or update an array of values
 * @param $pArray an array of values to set
 * @param $pPackageName name of the package the feature belongs to
 * @return none
 */
function simple_set_configs($pArray, $pPackageName = NULL)
{
    foreach ($pArray as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, $pPackageName);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, $pPackageName);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, $pPackageName);
        }
    }
}
    simple_set_value('wiki_forum_id');
}
if (isset($_REQUEST["setwikiregex"])) {
    check_ticket('admin-inc-wiki');
    simple_set_value('wiki_page_regex');
    simple_set_value('wiki_pagename_strip');
}
if (isset($_REQUEST['wikilistprefs'])) {
    check_ticket('admin-inc-wiki');
    $pref_toggles = array('wiki_list_name', 'wiki_list_hits', 'wiki_list_lastmodif', 'wiki_list_creator', 'wiki_list_user', 'wiki_list_lastver', 'wiki_list_comment', 'wiki_list_description', 'wiki_list_status', 'wiki_list_versions', 'wiki_list_links', 'wiki_list_backlinks', 'wiki_list_size', 'wiki_list_language', 'wiki_list_categories', 'wiki_list_categories_path', 'wiki_list_id');
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    simple_set_int('wiki_list_name_len');
    simple_set_int('wiki_list_comment_len');
    simple_set_int('wiki_list_description_len');
    simple_set_value('wiki_list_sortorder');
    simple_set_value('wiki_list_sortdirection');
}
if (isset($_REQUEST["wikifeatures"])) {
    check_ticket('admin-inc-wiki');
    $pref_toggles = array('feature_lastChanges', 'feature_wiki_comments', 'feature_wiki_pictures', 'feature_wiki_description', 'wiki_spellcheck', 'feature_warn_on_edit', 'feature_page_title', 'feature_wiki_pageid', 'feature_wikiwords', 'feature_wikiwords_usedash', 'feature_wiki_plurals', 'feature_wiki_paragraph_formatting', 'feature_wiki_paragraph_formatting_add_br', 'feature_dump', 'feature_wiki_export', 'feature_wiki_rankings', 'feature_wiki_ratings', 'feature_wiki_footnotes', 'feature_wiki_monosp', 'feature_wiki_usrlock', 'feature_wiki_undo', 'feature_wiki_save_draft', 'feature_wiki_icache', 'feature_wiki_import_html', 'wiki_creator_admin', 'feature_wiki_templates', 'feature_wiki_multiprint', 'feature_listPages', 'feature_history', 'feature_source', 'feature_sandbox', 'feature_wiki_print', 'feature_wiki_replace', 'feature_antibot', 'feature_backlinks', 'feature_likePages', 'wiki_uses_slides', 'feature_wiki_open_as_structure', 'feature_wiki_make_structure', 'feature_wiki_categorize_structure', 'feature_create_webhelp', 'feature_wiki_ext_icon', 'feature_wiki_userpage', 'feature_wiki_protect_email', 'feature_wiki_1like_redirection', 'feature_wiki_show_hide_before', 'feature_wiki_allowhtml', 'wiki_show_version', 'feature_wiki_import_page', 'wiki_edit_section', 'feature_actionlog_bytes', 'wiki_authors_style_by_page');
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    $pref_values = array('wiki_cache', 'warn_on_edit_time', 'feature_wiki_tables', 'feature_wiki_userpage_prefix', 'wiki_authors_style', 'feature_wiki_mandatory_category', 'wiki_page_navigation_bar', 'wiki_actions_bar');
    foreach ($pref_values as $value) {
        simple_set_value($value);
    }
}
if (isset($_REQUEST["wikisetprefs"])) {
示例#3
0
$gBitSmarty->assign('formTagLists', $formTagLists);
// list of content types that can be tagged
// 'sample' is presented anyways, if sample package is installed
// 'bitcomment' (?) ... isFeatureActive('tags_on_comments')
$exclude = array('bituser', 'tikisticky', 'sample', 'bitcomment');
foreach ($gLibertySystem->mContentTypes as $cType) {
    if (!in_array($cType['content_type_guid'], $exclude)) {
        $formTaggable['guids']['tags_tag_' . $cType['content_type_guid']] = $gLibertySystem->getContentTypeName($cType['content_type_guid']);
    }
}
if (!empty($_REQUEST['tags_preferences'])) {
    $tags = array_merge($formTagsDisplayOptions, $formTagsStripOptions, $formTagLists);
    //	$tags = array_merge( $formTagsOptions );
    foreach ($tags as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, TAGS_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, TAGS_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, TAGS_PKG_NAME);
        }
    }
    foreach (array_keys($formTaggable['guids']) as $taggable) {
        $gBitSystem->storeConfig($taggable, !empty($_REQUEST['taggable_content']) && in_array($taggable, $_REQUEST['taggable_content']) ? 'y' : NULL, TAGS_PKG_NAME);
    }
}
// check the correct packages in the package selection
foreach ($gLibertySystem->mContentTypes as $cType) {
    if ($gBitSystem->getConfig('tags_tag_' . $cType['content_type_guid'])) {
        $formTaggable['checked'][] = 'tags_tag_' . $cType['content_type_guid'];
    }
<?php

/**
 * @version  $Header$
 * @package  semaphore
 */
$limit = array('60' => 1, '120' => 2, '180' => 3, '240' => 4, '300' => 5, '360' => 6, '420' => 7, '480' => 8, '540' => 9, '600' => 10, '900' => 15);
$gBitSmarty->assign('limit', $limit);
if (!empty($_REQUEST['change_prefs'])) {
    simple_set_int('semaphore_limit', SEMAPHORE_PKG_NAME);
}
示例#5
0
<?php

require_once '../../../kernel/setup_inc.php';
include_once KERNEL_PKG_PATH . 'simple_form_functions_lib.php';
$gBitSystem->verifyPermission('p_admin');
$feedback = array();
$pdfSettings = array('pdf2swf_path' => array('label' => 'Path to pdf2swf', 'note' => 'Path to the pdf2swf executable.', 'type' => 'text'), 'swfcombine_path' => array('label' => 'Path to swfcombine', 'note' => 'Path to the swfcombine executable.', 'type' => 'text'), 'mwconvert_path' => array('label' => 'Path to ImageMagick convert', 'note' => 'Path to the ImageMagick convert executable.', 'type' => 'text'), 'pdf_thumbnails' => array('label' => 'PDF Upload Thumbnails', 'note' => 'Create thumbnails for PDF uploads.', 'type' => 'checkbox'));
if (function_exists('shell_exec')) {
    $pdfSettings['pdf2swf_path']['default'] = shell_exec('which pdf2swf');
    $pdfSettings['swfcombine_path']['default'] = shell_exec('which swfcombine');
    $pdfSettings['mwconvert_path']['default'] = shell_exec('which convert');
} else {
    $feedback['error'] = "You can not execute binaries on your server. You can not make use of this plugin.";
}
$gBitSmarty->assign('pdfSettings', $pdfSettings);
if (!empty($_REQUEST['plugin_settings'])) {
    foreach ($pdfSettings as $item => $data) {
        if ($data['type'] == 'checkbox') {
            simple_set_toggle($item, LIBERTY_PKG_NAME);
        } elseif ($data['type'] == 'numeric') {
            simple_set_int($item, LIBERTY_PKG_NAME);
        } else {
            simple_set_value($item, LIBERTY_PKG_NAME);
        }
    }
    $feedback['success'] = tra('The plugin was successfully updated');
}
$gBitSmarty->assign('feedback', $feedback);
$gBitSystem->display('bitpackage:liberty/mime/pdf/adminx.tpl', tra('PDF Plugin Settings'), array('display_mode' => 'admin'));
示例#6
0
<?php

// $Header$
require_once GAMES_PKG_PATH . 'BitGameSystem.php';
$formGamesLists = array("games_list_summary" => array('label' => 'Summary', 'note' => 'Display the summary.'), "games_list_description" => array('label' => 'Description', 'note' => 'Display the description.'));
$gBitSmarty->assign('formGamesLists', $formGamesLists);
// Process the form if we've made some changes
if (!empty($_REQUEST['games_settings'])) {
    $gamesToggles = array_merge($formGamesLists);
    foreach ($gamesToggles as $item => $data) {
        simple_set_toggle($item, GAMES_PKG_NAME);
    }
    simple_set_int('games_home_id', GAMES_PKG_NAME);
}
$gameSystem = new BitGameSystem();
$gBitSmarty->assign_by_ref('gameSystem', $gameSystem);
// get list of games to register
$games = array();
foreach ($gBitSystem->mPackages as $pkg) {
    // parse each yaml file
    $infoFile = $pkg['path'] . "games.yaml";
    $gamesArray = $gameSystem->parseInfoFile($infoFile);
    foreach ($gamesArray as $gameDefaults) {
        // if the game is already registered
        // we dont want to override the title and description
        // which can be changed by the user
        // merge in data from database
        if ($game = $gameSystem->getGameType($gameDefaults['type'])) {
            $game = array_merge($gameDefaults, $game);
            // first time registration
        } else {
示例#7
0
        $formRSSFeeds[$pkg . '_rss'] = array('label' => $pkg);
    }
}
$gBitSmarty->assign("formRSSFeeds", $formRSSFeeds);
$formRSSSettings = array('rssfeed_language' => array('label' => 'Language'), 'rssfeed_creator' => array('label' => 'Creator'), 'rssfeed_editor' => array('label' => 'Editor', 'note' => 'Email address for person responsible for editorial content. For RDF 2.0'), 'rssfeed_webmaster' => array('label' => 'Webmaster', 'note' => 'Email address for person responsible for technical issues relating to channel. For RDF 2.0'), 'rssfeed_image_url' => array('label' => 'Image URL', 'note' => 'Enter the full URL to an image that you want to associate with your RSS channels'), 'rssfeed_css_url' => array('label' => 'CSS File URL', 'note' => 'Enter the full URL to a CSS file you want to use to style your RSS Feeds.'), 'rssfeed_truncate' => array('label' => 'Truncate RSS feed', 'note' => 'Enter the number of characters you want to feed per item in the rss feeds. Default is 5000 characters.'));
$gBitSmarty->assign("formRSSSettings", $formRSSSettings);
$formRSSOptions = array('rssfeed_httpauth' => array('label' => 'Enable HTTP Authentication', 'note' => 'Use HTTP Authentication with SSL to enable Registered Users to gain access to Private Content Feeds.'));
$gBitSmarty->assign("formRSSOptions", $formRSSOptions);
$cacheTimes = array(0 => tra("(no cache)"), 60 => "1 " . tra("minute"), 300 => "5 " . tra("minutes"), 600 => "10 " . tra("minutes"), 1800 => "30 " . tra("minutes"), 3600 => "1 " . tra("hour"), 7200 => "2 " . tra("hours"), 14400 => "4 " . tra("hours"));
$gBitSmarty->assign("cacheTimes", $cacheTimes);
$feedTypes = array(0 => "RSS 0.91", 1 => "RSS 1.0", 2 => "RSS 2.0", 3 => "PIE 0.1", 4 => "MBOX", 5 => "ATOM", 6 => "ATOM 0.3", 7 => "OPML", 8 => "HTML", 9 => "JS");
$gBitSmarty->assign("feedTypes", $feedTypes);
if (!empty($_REQUEST['feed_settings'])) {
    // save package specific RSS feed settings
    foreach (array_keys($formRSSFeeds) as $item) {
        $package = preg_replace("/^rss_/", "", $item);
        simple_set_toggle($item, $package);
        simple_set_int($item . '_max_records', $package);
        simple_set_value($item . '_title', $package);
        simple_set_value($item . '_description', $package);
    }
    // deal with the RSS settings
    foreach (array_keys($formRSSSettings) as $item) {
        simple_set_value($item, RSS_PKG_NAME);
    }
    simple_set_value('rssfeed_default_version');
    simple_set_int('rssfeed_cache_time');
    foreach ($formRSSOptions as $item => $data) {
        simple_set_toggle($item, RSS_PKG_NAME);
    }
}
示例#8
0
<?php

/**
 * @version $Header$
 *
 * @author lsces
 * @package nlpg
 * @subpackage functions
 */
/**
 * required setup
 */
$formNlpgDisplayOptions = array("nlpg_maplink" => array('label' => 'Include links to map pages', 'note' => 'Expand coordinate displays to include links to map packages. The maps packagas available are defined separatly.', 'type' => 'toggle'), "nlpg_default_ordering" => array('label' => 'Initial ordering of results', 'note' => 'Used to supply the initial display ordering.', 'type' => 'input'));
$gBitSmarty->assign('formNlpgDisplayOptions', $formNlpgDisplayOptions);
$formNlpgFeatureOptions = array("nlpg_edit" => array('label' => 'On-line editing', 'note' => 'Enable on-line edit pages for NLPG information. Additional to edit permission controls to allow finer management.', 'type' => 'toggle'));
$gBitSmarty->assign('formNlpgFeatureOptions', $formNlpgFeatureOptions);
if (!empty($_REQUEST['nlpg_preferences'])) {
    $nlpg_opt = array_merge($formNlpgDisplayOptions, $formNlpgFeatureOptions);
    foreach ($nlpg_opt as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, NLPG_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, NLPG_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, NLPG_PKG_NAME);
        }
    }
}
示例#9
0
$gBitSmarty->assign('formGroupServiceDisplayOptions', $formGroupServiceDisplayOptions);
// get data for module preferences
$allModules = $gBitThemes->getAllModules();
ksort($allModules);
foreach ($allModules as $package => $modules) {
    foreach ($modules as $tpl => $desc) {
        $ref = 'gm_' . strtolower($package) . "_" . str_replace(' ', '_', $desc);
        $formGroupModules[$package][$ref] = $desc;
    }
}
$gBitSmarty->assign_by_ref('formGroupModules', $formGroupModules);
// store the prefs
if (!empty($_REQUEST['group_preferences'])) {
    foreach ($formGroupServiceDisplayOptions as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, GROUP_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, GROUP_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, GROUP_PKG_NAME);
        }
    }
    $groupToggles = array_merge($formGroupLists, $formGroupFeatures);
    foreach ($groupToggles as $item => $data) {
        simple_set_toggle($item, GROUP_PKG_NAME);
    }
    foreach (array_keys($formGroupContent['guids']) as $type) {
        $gBitSystem->storeConfig($type, !empty($_REQUEST['group_content']) && in_array($type, $_REQUEST['group_content']) ? 'y' : NULL, GROUP_PKG_NAME);
    }
    foreach ($formGroupModules as $package) {
        foreach ($package as $conf => $desc) {
示例#10
0
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
$formWikiLists = array("wiki_list_page_id" => array('label' => 'Page ID', 'note' => 'Page ID of the wikipage.'), "wiki_list_content_id" => array('label' => 'Content ID', 'note' => 'Content ID of the wikipage.'), "wiki_list_name" => array('label' => 'Name', 'note' => 'Name of the wikipage.'), "wiki_list_hits" => array('label' => 'Hits', 'note' => 'How often the page has been viewed.'), "wiki_list_lastmodif" => array('label' => 'Last modification date', 'note' => 'Date of the last modification of a page.'), "wiki_list_creator" => array('label' => 'Creator', 'note' => 'Name of the creator of a page.'), "wiki_list_user" => array('label' => 'User', 'note' => 'Last user to modify the page.'), "wiki_list_lastver" => array('label' => 'Last version number', 'note' => 'Shows the currently active version number.'), "wiki_list_comment" => array('label' => 'Comment', 'note' => 'Display the comment added on the last commit.'), "wiki_list_status" => array('label' => 'Status', 'note' => 'Displays wether the page is locked or open for modifications.'), "wiki_list_versions" => array('label' => 'Versions', 'note' => 'Display the number of available versions of a page.'), "wiki_list_links" => array('label' => 'Links', 'note' => 'Displays the number of links within a page.'), "wiki_list_backlinks" => array('label' => 'Backlinks', 'note' => 'Number of pages that link to a page.'), "wiki_list_format_guid" => array('label' => 'Format GUID', 'note' => 'Display the format GUID the page was saved in.'), "wiki_list_size" => array('label' => 'Size', 'note' => 'Size of page in bytes.'));
$gBitSmarty->assign('formWikiLists', $formWikiLists);
if (isset($_REQUEST["wikilistconf"])) {
    foreach ($formWikiLists as $item => $data) {
        simple_set_toggle($item, WIKI_PKG_NAME);
    }
}
$formWikiFeatures = array("wiki_backlinks" => array('label' => 'Backlinks', 'note' => 'Display a dropdown list of pages that link to a page.'), "wiki_like_pages" => array('label' => 'Like Pages', 'note' => 'Display a list of pages that have a common word in the names.'), "wiki_allow_dup_page_names" => array('label' => 'Allow Duplicate Page Names', 'note' => 'Allow Wiki Pages with duplicate page names'), "wiki_history" => array('label' => 'History', 'note' => 'Allow access to the page\'s history.'), "wiki_list_orphans" => array('label' => 'List Orphans', 'note' => 'Allow access to a listing of all orphaned wikipages.'), "wiki_attachments" => array('label' => 'Attachments', 'note' => 'Allow the attachment of files to a wikipage.'), "wiki_comments" => array('label' => 'Comments', 'note' => 'Allow the addition of user comments at the end of every wikipage.'), "wiki_undo" => array('label' => 'Undo', 'note' => 'Reverts a wikipage to the previous version held in its page history.'), "wiki_rankings" => array('label' => 'Rankings', 'note' => 'Creates a ranking system based on the number of times a page is accessed.'), "wiki_usrlock" => array('label' => 'Users can lock pages', 'note' => 'Users who have the right permissions can lock pages preventing changes by other users.'), "wiki_creator_admin" => array('label' => 'Page creators are admin of their pages', 'note' => 'Users who create a page, have all permissions regarding that particular page.'), "wiki_url_import" => array('label' => 'Allow URL Import', 'note' => 'Allow urls to be imported and saved to the wiki.'), "wiki_preserve_leading_blanks" => array('label' => 'Preserve leading blanks', 'note' => 'Preserve leading blanks on Wiki Pages, provided for compatiblity with sites migrated from Tikiwiki.'));
$gBitSmarty->assign('formWikiFeatures', $formWikiFeatures);
if (!empty($_REQUEST["wikifeatures"])) {
    foreach ($formWikiFeatures as $item => $data) {
        simple_set_toggle($item, WIKI_PKG_NAME);
    }
    simple_set_int('wiki_section_edit', WIKI_PKG_NAME);
    if (isset($_REQUEST["warn_on_edit"]) && $_REQUEST["warn_on_edit"][0] == "y") {
        $gBitSystem->storeConfig("warn_on_edit", 'y', WIKI_PKG_NAME);
        $gBitSmarty->assign("warn_on_edit", 'y');
    } else {
        $gBitSystem->storeConfig("warn_on_edit", 'n', WIKI_PKG_NAME);
        $gBitSmarty->assign("warn_on_edit", 'n');
    }
    //$gBitSystem->storeConfig("wiki_link_type", $_REQUEST["link_type"], WIKI_PKG_NAME);
    /* not sure if the following are still required */
    $gBitSystem->storeConfig('wiki_tables', $_REQUEST['wiki_tables'], WIKI_PKG_NAME);
    $gBitSmarty->assign('wiki_tables', $_REQUEST['wiki_tables']);
    if (isset($_REQUEST["wiki_user_versions"]) && $_REQUEST["wiki_user_versions"] == "y") {
        $gBitSystem->storeConfig("wiki_user_versions", 'y', WIKI_PKG_NAME);
        $gBitSmarty->assign("wiki_user_versions", 'y');
    } else {
示例#11
0
<?php

// $Header$
require_once SAMPLE_PKG_PATH . 'BitSample.php';
$formSampleLists = array("sample_list_sample_id" => array('label' => 'Id', 'note' => 'Display the sample id.'), "sample_list_title" => array('label' => 'Title', 'note' => 'Display the title.'), "sample_list_description" => array('label' => 'Description', 'note' => 'Display the description.'), "sample_list_data" => array('label' => 'Text', 'note' => 'Display the text.'));
$gBitSmarty->assign('formSampleLists', $formSampleLists);
// Process the form if we've made some changes
if (!empty($_REQUEST['sample_settings'])) {
    $sampleToggles = array_merge($formSampleLists);
    foreach ($sampleToggles as $item => $data) {
        simple_set_toggle($item, SAMPLE_PKG_NAME);
    }
    simple_set_int('sample_home_id', SAMPLE_PKG_NAME);
}
// The list of sample data is used to pick one to set the home
// we need to make sure that all sample records are displayed
$_REQUEST['max_records'] = 0;
$sample = new BitSample();
$sample_data = $sample->getList($_REQUEST);
$gBitSmarty->assign_by_ref('sample_data', $sample_data);
$sample_home_id = $gBitSystem->getConfig("sample_home_id");
$gBitSmarty->assign('sample_home_id', $sample_home_id);
示例#12
0
require_once EVENTS_PKG_PATH . 'BitEvents.php';
/**
 * required setup
 */
$formEventsDisplayOptions = array("events_use_24" => array('label' => 'Use 24 Hour', 'note' => 'Time display uses 24 hour format.', 'type' => 'toggle'), "events_minute_interval" => array('label' => 'Minutes Interval', 'note' => 'Number of minute steps for the event time minute drop down ( default is 15 minutes ). Multiple of this time should be 60 minutes.', 'type' => 'input'), "events_end_year" => array('label' => 'Events End Year', 'note' => 'End year in events date set. Can be a specific year or +# (i.e. +1) to allow events a certain number of years in the future.', 'type' => 'input'), "events_upcoming_limit" => array('label' => 'Look ahead limit', 'note' => 'Number of days look ahead period to be used with upcoming events displays such as upcoming module.', 'type' => 'input'));
$gBitSmarty->assign('formEventsDisplayOptions', $formEventsDisplayOptions);
$formEventsFeatureOptions = array("events_moderation" => array('label' => 'Events Moderation', 'note' => 'Use content status to moderate events. Note, there is no UI for doing the moderation yet.', 'type' => 'toggle'), "events_show_primary" => array('label' => 'Auto Show Primary', 'note' => 'Automatically show the primary attachment.', 'type' => 'toggle'), "events_use_types" => array('label' => 'Use Event Types', 'note' => 'Use the event types features.', 'type' => 'toggle'), "events_allow_no_type" => array('label' => 'Allow No Types', 'note' => 'Include in the event types an empty choice.', 'type' => 'toggle'));
$gBitSmarty->assign('formEventsFeatureOptions', $formEventsFeatureOptions);
$be = new BitEvents();
$eventTypes = $be->loadEventTypes(true);
$gBitSmarty->assign('eventTypes', $eventTypes);
if (!empty($_REQUEST['events_preferences'])) {
    $events = array_merge($formEventsDisplayOptions, $formEventsFeatureOptions);
    foreach ($events as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, EVENTS_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, EVENTS_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, EVENTS_PKG_NAME);
        }
    }
    // Update some types?
    foreach ($eventTypes as $id => $data) {
        if (isset($_REQUEST['update'][$id])) {
            if ($eventTypes[$id]['name'] != $_REQUEST['update'][$id]['name'] or $eventTypes[$id]['description'] != $_REQUEST['update'][$id]['desc']) {
                $be->storeType($id, $_REQUEST['update'][$id]['name'], $_REQUEST['update'][$id]['desc']);
            }
        }
    }
    // Delete some types ?
示例#13
0
    delete_index_content_type($_REQUEST["where"]);
    $feedback['success'] = tra("The search index was successfully deleted.");
}
if (!empty($_REQUEST['del_index_reindex'])) {
    require_once SEARCH_PKG_PATH . '/refresh_functions.php';
    $count = rebuild_index($_REQUEST["where"]);
    $feedback['success'] = tra("The search index was successfully deleted.") . tra("Number of items re-indexed") . ": " . $count;
}
if (!empty($_REQUEST['del_searchwords'])) {
    require_once SEARCH_PKG_PATH . '/refresh_functions.php';
    delete_search_words_and_syllables();
    $feedback['success'] = tra("The searchwords were successfully purged from the database.");
}
if (!empty($_REQUEST['store_prefs'])) {
    foreach ($formSearchInts as $item => $data) {
        simple_set_int($item, SEARCH_PKG_NAME);
        $formSearchInts[$item]['value'] = $_REQUEST[$item];
    }
    foreach ($formSearchToggles as $item => $data) {
        simple_set_toggle($item, SEARCH_PKG_NAME);
    }
}
foreach ($formSearchInts as $item => $data) {
    $formSearchInts[$item]['value'] = $gBitSystem->getConfig($item);
}
$gBitSmarty->assign('formSearchToggles', $formSearchToggles);
$gBitSmarty->assign('formSearchInts', $formSearchInts);
$gBitSmarty->assign('feedback', $feedback);
$formSearchTypeToggles = array('search_restrict_types' => array('label' => 'Restrict Types', 'note' => 'If selected the search will be limited to those selected below.'));
$gBitSmarty->assign('formSearchTypeToggles', $formSearchTypeToggles);
// allow selection of what packages can have search
if (isset($_REQUEST["cmsprefs"])) {
    check_ticket('admin-inc-cms');
    simple_set_value("maxArticles");
    simple_set_value('art_home_title');
}
if (isset($_REQUEST["articlecomprefs"])) {
    check_ticket('admin-inc-cms');
    simple_set_value("article_comments_per_page");
    simple_set_value("article_comments_default_ordering");
}
if (isset($_REQUEST['artlist'])) {
    check_ticket('admin-inc-cms');
    $pref_toggles = array('art_list_title', 'art_list_type', 'art_list_topic', 'art_list_date', 'art_list_expire', 'art_list_visible', 'art_list_lang', 'art_list_author', 'art_list_reads', 'art_list_size', 'art_list_img');
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    simple_set_int("art_list_title_len");
}
if (isset($_REQUEST['import'])) {
    global $artlib;
    include_once 'lib/articles/artlib.php';
    check_ticket('admin-inc-cms');
    $fname = $_FILES['csvlist']['tmp_name'];
    $msgs = array();
    $artlib->import_csv($fname, $msgs);
    if (!empty($msgs)) {
        print_r($msgs);
        $smarty->assign_by_ref('msgs', $msgs);
    }
}
ask_ticket('admin-inc-cms');
示例#15
0
for ($i = 25; $i <= 100; $i += 5) {
    $imageCompression[$i] = $i;
}
$gBitSmarty->assign('imageCompression', $imageCompression);
$formImageFeatures = array("liberty_thumbnail_pdf" => array('label' => 'Create PDF Thumbnails', 'note' => 'Create thumbnails from PDF files. This is a <strong>very resource intensive process</strong>. Even the simplest text files can take up hundreds of MB of memory to convert. Additionally, any PDF files that can not be converted will cause the upload process to be aborted without the uploaded file being stored on the server. This option requires that you have <strong>GhostScript</strong> installed.', 'page' => ''), "liberty_jpeg_originals" => array('label' => 'JPEG Originals', 'note' => 'Automatically create JPEG versions of original images named \'original.jpg\' in the attachment directory with other thumbnails.', 'page' => ''), "liberty_original_image" => array('label' => 'Display Original', 'note' => 'Display a link to the original image file. This allows users to link to the originally uploaded image file. For some users this might be disorienting, since it will only display the image in the browser window. We can recommend enabling the fancy zoom option as well.', 'page' => ''));
$gBitSmarty->assign('formImageFeatures', $formImageFeatures);
$thumbFormats = array('' => tra('Automatically select the best format'), 'jpg' => tra('Force JPEG thumbnails'), 'png' => tra('Force PNG thumbnails'), 'gif' => tra('Force GIF thumbnails'));
$gBitSmarty->assign('thumbFormats', $thumbFormats);
$gBitSmarty->assign('imageSizes', get_image_size_options());
$formValues = array('image_processor', 'liberty_attachment_link_format', 'comments_per_page', 'comments_default_ordering', 'comments_default_display_mode');
if (!empty($_REQUEST['change_prefs'])) {
    $formFeatures = array_merge($formLibertyFeatures, $formImageFeatures, $formCaptcha, $attachmentOptions);
    foreach ($formFeatures as $item => $data) {
        simple_set_toggle($item, LIBERTY_PKG_NAME);
    }
    foreach ($formLibertyTextareaFeatures as $item => $data) {
        simple_set_value($item, LIBERTY_PKG_NAME);
    }
    foreach ($formCaptchaTextareaFeatures as $item => $data) {
        simple_set_value($item, LIBERTY_PKG_NAME);
    }
    simple_set_int('liberty_thumbnail_quality', LIBERTY_PKG_NAME);
    simple_set_value('liberty_thumbnail_format', LIBERTY_PKG_NAME);
    simple_set_value('liberty_thumbnail_size', LIBERTY_PKG_NAME);
    simple_set_value('liberty_attachment_style', LIBERTY_PKG_NAME);
    $gBitSystem->storeConfig('liberty_cache', $_REQUEST['liberty_cache'], LIBERTY_PKG_NAME);
    $gBitSystem->storeConfig('liberty_auto_display_attachment_thumbs', $_REQUEST['liberty_auto_display_attachment_thumbs'], LIBERTY_PKG_NAME);
    foreach ($formValues as $item) {
        simple_set_value($item, LIBERTY_PKG_NAME);
    }
}
    header("location: index.php");
    exit;
}
if (isset($_REQUEST["searchprefs"])) {
    check_ticket('admin-inc-search');
    simple_set_toggle("feature_search_fulltext");
    simple_set_toggle("feature_search_stats");
    simple_set_toggle("feature_referer_highlight");
    simple_set_toggle("feature_search_show_forbidden_obj");
    simple_set_toggle("feature_search_show_forbidden_cat");
    simple_set_int("search_refresh_rate");
    simple_set_int("search_min_wordlength");
    simple_set_int("search_max_syllwords");
    simple_set_int("search_syll_age");
    simple_set_int("search_lru_purge_rate");
    simple_set_int("search_lru_length");
    simple_set_value("search_refresh_index_mode");
    simple_set_toggle("search_parsed_snippet");
}
global $tiki_p_admin;
if ($tiki_p_admin == 'y' && !empty($_REQUEST['refresh_files_index_now']) && $_REQUEST['refresh_files_index_now'] == 'y') {
    require_once 'lib/search/refresh-functions.php';
    refresh_index('files');
    $smarty->assign('refresh_files_index_now', $_REQUEST['refresh_files_index_now']);
}
if ($tiki_p_admin == 'y' && !empty($_REQUEST['refresh_index_now']) && $_REQUEST['refresh_index_now'] == 'y') {
    require_once 'lib/search/refresh-functions.php';
    refresh_index('pages');
    $smarty->assign('refresh_index_now', $_REQUEST['refresh_index_now']);
}
if ($tiki_p_admin == 'y' && !empty($_REQUEST['refresh_tracker_index_now']) && $_REQUEST['refresh_tracker_index_now'] == 'y') {
$gBitSmarty->assign('memberLimit', $memberLimit);
// various image sizes
$gBitSmarty->assign('imageSizes', get_image_size_options());
// Which kinds of content?
$exclude = array('tikisticky', 'pigeonholes');
foreach ($gLibertySystem->mContentTypes as $cType) {
    if (!in_array($cType['content_type_guid'], $exclude)) {
        $formPigeonholeable['guids']['pigeonhole_no_' . $cType['content_type_guid']] = $gLibertySystem->getContentTypeName($cType['content_type_guid']);
    }
}
if (!empty($_REQUEST['pigeonhole_settings'])) {
    $pigeonholeSettings = array_merge($pigeonholeDisplaySettings, $pigeonholeListSettings, $pigeonholeEditSettings, $pigeonholeContentEditSettings);
    foreach (array_keys($pigeonholeSettings) as $item) {
        simple_set_toggle($item, PIGEONHOLES_PKG_NAME);
    }
    simple_set_int('pigeonholes_display_columns', PIGEONHOLES_PKG_NAME);
    simple_set_int('pigeonholes_limit_member_number', PIGEONHOLES_PKG_NAME);
    simple_set_int('pigeonholes_scrolling_list_number', PIGEONHOLES_PKG_NAME);
    simple_set_value('pigeonholes_member_thumb', PIGEONHOLES_PKG_NAME);
    simple_set_value('pigeonholes_list_style', PIGEONHOLES_PKG_NAME);
    foreach (array_keys($formPigeonholeable['guids']) as $holeable) {
        $gBitSystem->storeConfig($holeable, !empty($_REQUEST['pigeonholeable_content']) && in_array($holeable, $_REQUEST['pigeonholeable_content']) ? NULL : 'y', PIGEONHOLES_PKG_NAME);
    }
}
// check the correct packages in the package selection
foreach ($gLibertySystem->mContentTypes as $cType) {
    if (!$gBitSystem->isFeatureActive('pigeonhole_no_' . $cType['content_type_guid'])) {
        $formPigeonholeable['checked'][] = 'pigeonhole_no_' . $cType['content_type_guid'];
    }
}
$gBitSmarty->assign('formPigeonholeable', $formPigeonholeable);
<?php

// $Header$
require_once CHATTERBOX_PKG_PATH . 'Chatterbox.php';
$gChatterbox = new Chatterbox();
if (!empty($_REQUEST['chatterbox_settings']) && !empty($_REQUEST['clear_logs'])) {
    $gChatterbox->pruneList(0);
}
// get the chatterbox data
$listHash = array('page' => !empty($_REQUEST['curPage']) ? $_REQUEST['curPage'] : 1, 'max_records' => !empty($_REQUEST['max_records']) ? $_REQUEST['max_records'] : 60, 'last_id' => !empty($_REQUEST['last_id']) ? $_REQUEST['last_id'] : -1, 'get_count' => TRUE);
$chatterbox = $gChatterbox->getList($listHash);
$gBitSmarty->assign('chatterbox', $chatterbox);
// pagination
$offset = !empty($_REQUEST['offset']) ? $_REQUEST['offset'] : 0;
$gBitSmarty->assign('curPage', $curPage = !empty($_REQUEST['curPage']) ? $_REQUEST['curPage'] : 1);
// calculate page number
$numPages = ceil($chatterbox['cant'] / $listHash['max_records']);
$gBitSmarty->assign('numPages', $numPages);
$pruneThreshold = array('-1' => tra('None'), '3600' => tra('Hour'), '86400' => tra('Day'), '604800' => tra('Week'), '2629743' => tra('Month'), '31556926' => tra('Year'), '999999999' => tra('Unlimited'));
$gBitSmarty->assign('pruneThreshold', $pruneThreshold);
if (!empty($_REQUEST['chatterbox_settings'])) {
    simple_set_value('chatterbox_prune_threshold', CHATTERBOX_PKG_NAME);
    simple_set_int('online_user_timeout', CHATTERBOX_PKG_NAME);
}
    check_ticket('admin-inc-blogs');
    $pref_toggles = array("feature_blog_rankings", "blog_spellcheck", "feature_blog_comments", "feature_blogposts_comments", "feature_blog_heading", "feature_trackbackpings", "feature_blogposts_pings");
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    simple_set_value("blog_list_order");
    simple_set_value("blog_list_user");
    simple_set_value('feature_blog_mandatory_category');
}
if (isset($_REQUEST['bloglistconf'])) {
    check_ticket('admin-inc-blogs');
    $pref_toggles = array("blog_list_title", "blog_list_description", "blog_list_activity", "blog_list_visits", "blog_list_posts", "blog_list_created", "blog_list_lastmodif");
    foreach ($pref_toggles as $toggle) {
        simple_set_toggle($toggle);
    }
    simple_set_value("blog_list_user");
    simple_set_int("blog_list_title_len");
}
if (isset($_REQUEST["blogcomprefs"])) {
    check_ticket('admin-inc-blogs');
    simple_set_value("blog_comments_per_page");
    simple_set_value("blog_comments_default_ordering");
}
if ($prefs['feature_categories'] == 'y') {
    include_once 'lib/categories/categlib.php';
    $catree = $categlib->get_all_categories();
    $smarty->assign('catree', $catree);
}
ask_ticket('admin-inc-blogs');
$blogs = $tikilib->list_blogs(0, -1, 'created_desc', '');
$smarty->assign_by_ref('blogs', $blogs["data"]);
示例#20
0
    if (!in_array($cType['content_type_guid'], $exclude)) {
        $formRatable['guids']['stars_rate_' . $cType['content_type_guid']] = $gLibertySystem->getContentTypeName($cType['content_type_guid']);
    }
}
if (!empty($_REQUEST['stars_preferences'])) {
    $stars = array_merge($formStarsOptions, $formStarsWeight);
    foreach ($stars as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, STARS_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, STARS_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, STARS_PKG_NAME);
        }
        simple_set_int('stars_icon_width', STARS_PKG_NAME);
        simple_set_int('stars_icon_height', STARS_PKG_NAME);
        simple_set_value('stars_rating_names', STARS_PKG_NAME);
    }
    foreach (array_keys($formRatable['guids']) as $ratable) {
        $gBitSystem->storeConfig($ratable, !empty($_REQUEST['ratable_content']) && in_array($ratable, $_REQUEST['ratable_content']) ? 'y' : NULL, STARS_PKG_NAME);
    }
}
if (!empty($_REQUEST['recalculate'])) {
    $stars = new LibertyStars();
    if ($stars->reCalculateRating()) {
        $feedback['success'] = tra('All ratings have been brought up to speed.');
    } else {
        $feedback['error'] = tra('There was a problem updating all the ratings in your database.');
    }
}
// check the correct packages in the package selection
示例#21
0
<?php

require_once '../../kernel/setup_inc.php';
include_once KERNEL_PKG_PATH . 'simple_form_functions_lib.php';
$gBitSystem->verifyPermission('p_admin');
$settings = array('mime_import_file_import_path' => array('label' => 'Root Import Directory', 'note' => 'Absolute path to directory you want to use as base to import files from. <strong>For security reasons this has to be the true path and can not have any symbolic links in it. <em>Requires trailing slash</em></strong>. e.g.: /home/ftp/public/', 'type' => 'text'));
$gBitSmarty->assign('settings', $settings);
$feedback = array();
if (!empty($_REQUEST['settings_store'])) {
    foreach ($settings as $item => $data) {
        if ($data['type'] == 'checkbox') {
            simple_set_toggle($item, TREASURY_PKG_NAME);
        } elseif ($data['type'] == 'numeric') {
            simple_set_int($item, TREASURY_PKG_NAME);
        } else {
            if ($item == 'mime_import_file_import_path') {
                if (is_dir($_REQUEST[$item])) {
                    $gBitSystem->storeConfig($item, str_replace("//", "/", $_REQUEST[$item] . "/"), TREASURY_PKG_NAME);
                } elseif (empty($_REQUEST[$item])) {
                    $gBitSystem->storeConfig($item, NULL, TREASURY_PKG_NAME);
                } else {
                    $feedback['error'] = "You did not specify a valid path.";
                }
            } else {
                $gBitSystem->storeConfig($item, !empty($_REQUEST[$item]) ? $_REQUEST[$item] : NULL, TREASURY_PKG_NAME);
            }
        }
    }
}
$gBitSmarty->assign('feedback', $feedback);
$gBitSystem->display('bitpackage:treasury/admin_mime_import.tpl', tra('Import Plugin Settings'), array('display_mode' => 'admin'));
示例#22
0
<?php

// $Header$
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
$formCmsSettings = array('articles_attachments' => array('label' => 'File Attachments', 'note' => 'Allow the attachment of files to an article. This feature is required if you want to have individual article images.'), 'articles_display_filter_bar' => array('label' => 'Articles Filter', 'note' => 'Allows admins to quickly filter articles based on status, topic and type.'), 'articles_submissions_rnd_img' => array('label' => 'Prevent Spam', 'note' => 'This will generate a random number as an image which the user has to confirm.'), 'articles_auto_approve' => array('label' => 'Auto Approve Articles', 'note' => 'Allow User ratings to Auto Approve Articles'));
$gBitSmarty->assign('formCmsSettings', $formCmsSettings);
$articleDateThreshold = array('' => tra('never'), 'always' => tra('always'), 'year' => tra('up to a year'), 'month' => tra('up to a month'), 'week' => tra('up to a week'), 'day' => tra('up to a day'), 'hour' => tra('up to an hour'));
$gBitSmarty->assign('articleDateThreshold', $articleDateThreshold);
$formArticleListing = array("articles_list_title" => array('label' => 'Title', 'note' => 'List the title of the article.'), "articles_list_type" => array('label' => 'Type', 'note' => 'Display what type of article it is.'), "articles_list_topic" => array('label' => 'Topic', 'note' => 'Display the article topic.'), "articles_list_date" => array('label' => 'Creation Date', 'note' => 'Display when the article was submitted first.'), "articles_list_expire" => array('label' => 'Expiration Date', 'note' => 'Display when the article will expire.'), "articles_list_author" => array('label' => 'Author', 'note' => 'Display the name of the author of an article.'), "articles_list_reads" => array('label' => 'Hits', 'note' => 'Display the number of times a given article has been accessed.'), "articles_list_size" => array('label' => 'Size', 'note' => 'Display the size of any given article.'), "articles_list_img" => array('label' => 'Image', 'note' => 'Display the image that is associated with a given article.'), "articles_list_status" => array('label' => 'Status', 'note' => 'This will indicate whether a given article has been submitted or has been approved.'));
$gBitSmarty->assign('formArticleListing', $formArticleListing);
$gBitSmarty->assign('imageSizes', get_image_size_options(FALSE));
if (!empty($_REQUEST['store_settings'])) {
    $featureToggles = array_merge($formArticleListing, $formCmsSettings);
    foreach ($featureToggles as $item => $data) {
        simple_set_toggle($item, ARTICLES_PKG_NAME);
    }
    simple_set_int("articles_max_list", ARTICLES_PKG_NAME);
    simple_set_int("articles_description_length", ARTICLES_PKG_NAME);
    simple_set_value("articles_image_size", ARTICLES_PKG_NAME);
}
$exclude = array('bituser', 'tikisticky', 'pigeonholes');
foreach ($gLibertySystem->mContentTypes as $cType) {
    if (!in_array($cType['content_type_guid'], $exclude)) {
        $formRecommendable['guids']['recommends_recommend_' . $cType['content_type_guid']] = $gLibertySystem->getContentTypeName($cType['content_type_guid']);
    }
}
if (!empty($_REQUEST['recommends_preferences'])) {
    $recommends = array_merge($formRecommendsDisplayOptions, $formRecommendsOptions);
    //	$recommends = $formRecommendsOptions;
    foreach ($recommends as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, RECOMMENDS_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, RECOMMENDS_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, RECOMMENDS_PKG_NAME);
        }
        simple_set_int('recommends_icon_width', RECOMMENDS_PKG_NAME);
        simple_set_int('recommends_icon_height', RECOMMENDS_PKG_NAME);
    }
    foreach (array_keys($formRecommendable['guids']) as $recommendable) {
        $gBitSystem->storeConfig($recommendable, !empty($_REQUEST['recommendable_content']) && in_array($recommendable, $_REQUEST['recommendable_content']) ? 'y' : NULL, RECOMMENDS_PKG_NAME);
    }
}
// check the correct packages in the package selection
foreach ($gLibertySystem->mContentTypes as $cType) {
    if ($gBitSystem->getConfig('recommends_recommend_' . $cType['content_type_guid'])) {
        $formRecommendable['checked'][] = 'recommends_recommend_' . $cType['content_type_guid'];
    }
}
$gBitSmarty->assign('formRecommendable', $formRecommendable);
示例#24
0
<?php

require_once '../../../kernel/setup_inc.php';
include_once KERNEL_PKG_PATH . 'simple_form_functions_lib.php';
$gBitSystem->verifyPermission('p_admin');
$settings = array('mime_image_panoramas' => array('label' => 'Panorama Images', 'note' => 'When users upload 360&deg; panoramic images, they can enable a flash viewer to view these. This can greatly enhance the image viewing experience for panoramic images. (<a class="external" href="http://pan0.net/fspp">example</a>)', 'type' => 'checkbox'));
$gBitSmarty->assign('settings', $settings);
$panWidth = array(1500 => '1500 x 750', 2000 => '2000 x 1000 (about 1MB)', 2500 => '2500 x 1250', 3000 => '3000 x 1500 (about 2MB)', 3500 => '3500 x 1750', 4000 => '4000 x 2000 (about 3-4MB)', 4500 => '4500 x 2250', 5000 => '5000 x 2500 (about 5-6MB)');
$gBitSmarty->assign('panWidth', $panWidth);
if ($gBitSystem->getConfig('image_processor') != 'magickwand') {
    $gBitSmarty->assign('image_processor_warning', TRUE);
}
$feedback = array();
if (!empty($_REQUEST['settings_store'])) {
    foreach ($settings as $item => $data) {
        if ($data['type'] == 'checkbox') {
            simple_set_toggle($item, TREASURY_PKG_NAME);
        } elseif ($data['type'] == 'numeric') {
            simple_set_int($item, TREASURY_PKG_NAME);
        } else {
            $gBitSystem->storeConfig($item, !empty($_REQUEST[$item]) ? $_REQUEST[$item] : NULL, TREASURY_PKG_NAME);
        }
    }
    simple_set_int('mime_image_panorama_width', $_REQUEST['mime_image_panorama_width']);
}
$gBitSmarty->assign('feedback', $feedback);
$gBitSystem->display('bitpackage:liberty/mime/image/admin.tpl', tra('Image Plugin Settings'), array('display_mode' => 'admin'));
示例#25
0
$gBitSmarty->assign('formServiceOptions', $formServiceOptions);
// allow selection of what packages display sharethis box
$exclude = array('bituser', 'tikisticky', 'pigeonholes');
foreach ($gLibertySystem->mContentTypes as $cType) {
    if (!in_array($cType['content_type_guid'], $exclude)) {
        $formContentTypes['guids']['sharethis_' . $cType['content_type_guid']] = $gLibertySystem->getContentTypeName($cType['content_type_guid']);
    }
}
// store the prefs
if (!empty($_REQUEST['sharethis_preferences'])) {
    $gBitSystem->storeConfig('sharethis_api_key', $_REQUEST['sharethis_api_key'], SHARETHIS_PKG_NAME);
    $gBitSystem->storeConfig('sharethis_style_button', $_REQUEST['sharethis_style_button'], SHARETHIS_PKG_NAME);
    $formFeatures = array_merge($formServiceOptions, $formTabStylesOptions, $formColorStylesOptions);
    foreach ($formFeatures as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, SHARETHIS_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, SHARETHIS_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, SHARETHIS_PKG_NAME);
        }
    }
    /*
    	foreach( $formTabStylesOptions as $key => $params ) {
    		$gBitSystem->storeConfig( $key, ( !empty( $_REQUEST[$key] ) ? $params['value'] : NULL ), SHARETHIS_PKG_NAME );
    	}
    */
    foreach (array_keys($formContentTypes['guids']) as $val) {
        $gBitSystem->storeConfig($val, !empty($_REQUEST['sharethis_content']) && in_array($val, $_REQUEST['sharethis_content']) ? 'y' : NULL, SHARETHIS_PKG_NAME);
    }
}
示例#26
0
<?php

// $Header$
// any setting preceded by packager_rem_ will be copied to the client when they update.
// we could copy settings like: pretty urls and the like to the client
$packagerSettings = array('packager_rem_host' => array('label' => 'Hostname', 'note' => 'Set this to your package repository host, such as www.bitweaver.org. Leave blank to access packages hosted on www.bitweaver.org.', 'type' => 'text'));
$gBitSmarty->assign('packagerSettings', $packagerSettings);
if (!empty($_REQUEST['packager_settings'])) {
    foreach ($packagerSettings as $item => $data) {
        if ($data['type'] == 'checkbox') {
            simple_set_toggle($item, PACKAGER_PKG_NAME);
        } elseif ($data['type'] == 'numeric') {
            simple_set_int($item, PACKAGER_PKG_NAME);
        } else {
            $gBitSystem->storeConfig($item, !empty($_REQUEST[$item]) ? $_REQUEST[$item] : NULL, PACKAGER_PKG_NAME);
        }
    }
    $copySettings = array('packager_rem_pretty_urls' => 'pretty_urls');
    foreach ($copySettings as $packager => $kernel) {
        $gBitSystem->storeConfig($packager, $gBitSystem->getConfig($kernel));
    }
}
示例#27
0
require_once GMAP_PKG_PATH . 'BitGmap.php';
// allow selection of what packages can have gmaps
$exclude = array('bitgmap', 'bitgmapmarker', 'bitgmarkerset', 'bitgmappolyline', 'bitgpolylineset', 'bitgmappolygon', 'bitgpolygonset', 'tikisticky', 'pigeonholes');
foreach ($gLibertySystem->mContentTypes as $cType) {
    if (!in_array($cType['content_type_guid'], $exclude)) {
        $formMappable['guids']['gmap_map_' . $cType['content_type_guid']] = $gLibertySystem->getContentTypeName($cType['content_type_guid']);
    }
}
// where to display content permalinks to mapped-content map
$formGmapServiceDisplayOptions = array("gmap_in_icon" => array('label' => 'Map Icon', 'note' => 'This will show a link to the map as an icon among the other page icons. Visible both in listings and when the full content page is loaded.', 'type' => 'toggle'), "gmap_in_nav" => array('label' => 'Navigation Link', 'note' => 'Shows a link to the content map at the top of a page. Only visible when the full content page is loaded.', 'type' => 'toggle'), "gmap_in_body" => array('label' => 'In Body Area', 'note' => 'Shows a link to the content map including a small inline map above the body text of content. Visible both in listings and when the full content page is loaded.', 'type' => 'toggle'), "gmap_in_view" => array('label' => 'Bottom of Page', 'note' => 'Shows a link to the content map including a small inline map below the body text. Only visible when the full content page is loaded.', 'type' => 'toggle'), "gmap_inline_map_width" => array('label' => 'Inline Map Width', 'note' => 'Set the width in pixels of the inline map.', 'type' => 'numeric', 'default' => 190), "gmap_inline_map_height" => array('label' => 'Inline Map Height', 'note' => 'Set the height in pixels of the inline map.', 'type' => 'numeric', 'default' => 190));
$gBitSmarty->assign('formGmapServiceDisplayOptions', $formGmapServiceDisplayOptions);
// store the prefs
if (!empty($_REQUEST['gmap_preferences'])) {
    foreach ($formGmapServiceDisplayOptions as $item => $data) {
        if ($data['type'] == 'numeric') {
            simple_set_int($item, GMAP_PKG_NAME);
        } elseif ($data['type'] == 'toggle') {
            simple_set_toggle($item, GMAP_PKG_NAME);
        } elseif ($data['type'] == 'input') {
            simple_set_value($item, GMAP_PKG_NAME);
        }
    }
    foreach (array_keys($formMappable['guids']) as $mappable) {
        $gBitSystem->storeConfig($mappable, !empty($_REQUEST['mappable_content']) && in_array($mappable, $_REQUEST['mappable_content']) ? 'y' : NULL, GMAP_PKG_NAME);
    }
}
// check the correct packages in the package selection
foreach ($gLibertySystem->mContentTypes as $cType) {
    if ($gBitSystem->getConfig('gmap_map_' . $cType['content_type_guid'])) {
        $formMappable['checked'][] = 'gmap_map_' . $cType['content_type_guid'];
    }