예제 #1
0
// $Header$
// Initialization
require_once '../kernel/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage('suggestion');
require_once SUGGESTION_PKG_PATH . 'lookup_suggestion_inc.php';
// Now check permissions to access this page
if ($gContent->isValid()) {
    $gContent->verifyUpdatePermission();
} else {
    $gContent->verifyCreatePermission();
}
// Display settings
$displayParams = array();
// Convenience for ajax request checks
if ($ajax = BitThemes::isAjaxRequest()) {
    if (!empty($_REQUEST["preview"]) || !empty($_REQUEST["save_suggestion"])) {
        // Remove encoding
        $gContent->decodeAjaxRequest($_REQUEST);
    }
    // Just return HTML
    $displayParams['format'] = 'center_only';
}
// Preview
if (!empty($_REQUEST["preview"])) {
    $gContent->preparePreview($_REQUEST);
    $gBitSmarty->assign('preview', TRUE);
    $gContent->invokeServices('content_preview_function');
    // Store
} elseif (!empty($_REQUEST["save_suggestion"])) {
    // force hide suggestions unless person has permission to auto publish
예제 #2
0
<?php

$registerHash = array('package_name' => 'themes', 'package_path' => dirname(__FILE__) . '/', 'activatable' => FALSE, 'required_package' => TRUE);
$gBitSystem->registerPackage($registerHash);
define('DEFAULT_ICON_STYLE', $gBitSystem->getConfig('default_icon_style', 'tango'));
$gLibertySystem->registerService(LIBERTY_SERVICE_THEMES, THEMES_PKG_NAME, array('content_display_function' => 'themes_content_display', 'content_list_function' => 'themes_content_list'), array('description' => 'Applied when user themes are enabled; See theme pkg administration to enable.'));
require_once THEMES_PKG_PATH . "BitThemes.php";
BitThemes::loadSingleton();
global $gBitThemes, $gBitSmarty;
$gBitSmarty->verifyCompileDir();
// setStyle first, in case package decides it wants to reset the style in it's own <package>/bit_setup_inc.php
if (!$gBitThemes->getStyle()) {
    $gBitThemes->setStyle(DEFAULT_THEME);
}
$gBitSmarty->assignByRef('gBitThemes', $gBitThemes);
// load some core javascript files
$gBitThemes->loadJavascript(UTIL_PKG_PATH . 'javascript/bitweaver.js', TRUE, 1);
$gBitThemes->loadAjax($gBitSystem->getConfig('themes_jquery_hosting', 'jquery'));
if (!$gBitSystem->isFeatureActive('site_disable_fat')) {
    $gBitThemes->loadJavascript(UTIL_PKG_PATH . 'javascript/fat.js', TRUE, 50);
}
if ($gBitSystem->isFeatureActive('site_top_bar_js') && $gBitSystem->isFeatureActive('site_top_bar_dropdown')) {
    $gBitThemes->loadJavascript(UTIL_PKG_PATH . 'javascript/fsmenu.js', TRUE, 60);
}
if ($gBitSystem->isFeatureActive('site_fancy_zoom')) {
    $gBitThemes->loadJavascript(UTIL_PKG_PATH . 'javascript/fancyzoom/js-global/FancyZoom.js', TRUE, 80);
    $gBitThemes->loadJavascript(UTIL_PKG_PATH . 'javascript/fancyzoom/js-global/FancyZoomHTML.js', TRUE, 81);
    $gBitSystem->setOnloadScript('setupZoom();');
}
$gBitSystem->mOnload[] = 'BitBase.setupShowHide();';