当前位置: 首页>>代码示例>>PHP>>正文


PHP osc_redirect_to函数代码示例

本文整理汇总了PHP中osc_redirect_to函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_redirect_to函数的具体用法?PHP osc_redirect_to怎么用?PHP osc_redirect_to使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了osc_redirect_to函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mdh_emailmagick_bump_me

/**
 * Makes this plugin the first to be loaded.
 * - Bumps this plugin at the top of the active_plugins stack.
 */
function mdh_emailmagick_bump_me()
{
    if (OC_ADMIN) {
        // @legacy : ALWAYS remove this if active.
        if (osc_plugin_is_enabled("madhouse_utils/index.php")) {
            Plugins::deactivate("madhouse_utils/index.php");
        }
        // Sanitize & get the {PLUGIN_NAME}/index.php.
        $path = str_replace(osc_plugins_path(), '', osc_plugin_path(__FILE__));
        if (osc_plugin_is_installed($path)) {
            // Get the active plugins.
            $plugins_list = unserialize(osc_active_plugins());
            if (!is_array($plugins_list)) {
                return false;
            }
            // Remove $path from the active plugins list
            foreach ($plugins_list as $k => $v) {
                if ($v == $path) {
                    unset($plugins_list[$k]);
                }
            }
            // Re-add the $path at the beginning of the active plugins.
            array_unshift($plugins_list, $path);
            // Serialize the new active_plugins list.
            osc_set_preference('active_plugins', serialize($plugins_list));
            if (Params::getParam("page") === "plugins" && Params::getParam("action") === "enable" && Params::getParam("plugin") === $path) {
                //osc_redirect_to(osc_admin_base_url(true) . "?page=plugins");
            } else {
                osc_redirect_to(osc_admin_base_url(true) . "?" . http_build_query(Params::getParamsAsArray("get")));
            }
        }
    }
}
开发者ID:bomvendador,项目名称:soroka_r,代码行数:37,代码来源:index.php

示例2: nm_copypaste_plugin_actions

function nm_copypaste_plugin_actions()
{
    $dao_preference = new Preference();
    $option = Params::getParam('nomoreoption');
    if (Params::getParam('file') != 'nm_copypaste_plugin/admin/settings.php') {
        return '';
    }
    if ($option == 'nomoresettings') {
        osc_set_preference('nm_id', Params::getParam("nm_id") ? Params::getParam("nm_id") : '0', 'nm_copypaste_plugin', 'STRING');
        osc_add_flash_ok_message(__('Nomore copy/paste settings has been updated', 'nm_copypaste_plugin'), 'admin');
        osc_redirect_to(osc_admin_render_plugin_url('nm_copypaste_plugin/admin/settings.php'));
    }
}
开发者ID:krahamath,项目名称:nm_copypaste_plugin,代码行数:13,代码来源:index.php

示例3: google_analytics_actions

function google_analytics_actions()
{
    $dao_preference = new Preference();
    $option = Params::getParam('option');
    if (Params::getParam('file') != 'google_analytics/admin.php') {
        return '';
    }
    if ($option == 'stepone') {
        $webid = Params::getParam('webid');
        Preference::newInstance()->update(array("s_value" => $webid), array("s_section" => "plugin-google_analytics", "s_name" => "google_analytics_id"));
        osc_add_flash_ok_message(__('The tracking ID has been updated', 'google_analytics'), 'admin');
        osc_redirect_to(osc_admin_render_plugin_url('google_analytics/admin.php'));
    }
}
开发者ID:mylastof,项目名称:os-class,代码行数:14,代码来源:index.php

示例4: seo_init_admin

function seo_init_admin()
{
    //scripts
    osc_enqueue_style('seoCSS', osc_plugin_url(SEO_PLUGIN_FOLDER . '/css/style.css') . 'style.css');
    //admin menu pages
    osc_add_admin_menu_page(__('SEO Wiz', SEO_PLUGIN_FOLDER), osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'configure.php'), 'seo_dashboard');
    osc_add_admin_submenu_page('seo_dashboard', __('Configure Plugin', SEO_PLUGIN_FOLDER), osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'configure.php'), 'configure');
    osc_add_admin_submenu_page('seo_dashboard', __('Titles & Metas', SEO_PLUGIN_FOLDER), osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'titles_metas.php'), 'titles_metas');
    //form actions
    switch (Params::getParam('seo_action')) {
        //configure page
        case 'seo_configure':
            $page_title_separator = Params::getParam('page_title_separator', false, false, false);
            osc_set_preference('page_title_separator', $page_title_separator, 'seo_plugin');
            osc_add_flash_ok_message(__('Saved correctly', SEO_PLUGIN_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'configure.php'));
            break;
            //titles_metas_home
        //titles_metas_home
        case 'titles_metas_home':
            $seo_titles = Params::getParam('seo_titles');
            if (!empty($seo_titles)) {
                foreach ($seo_titles as $key => $value) {
                    osc_set_preference($key, trim($value), 'seo_plugin');
                }
            }
            osc_add_flash_ok_message(__('Saved correctly', SEO_PLUGIN_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'titles_metas.php#home'));
            break;
            //titles_metas_pages
        //titles_metas_pages
        case 'titles_metas_pages':
            $seo_titles = Params::getParam('seo_titles');
            if (!empty($seo_titles)) {
                foreach ($seo_titles as $key => $value) {
                    osc_set_preference($key, trim($value), 'seo_plugin');
                }
            }
            osc_add_flash_ok_message(__('Saved correctly', SEO_PLUGIN_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_plugin_url(osc_plugin_folder(__FILE__) . 'titles_metas.php#pages'));
            break;
    }
}
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:43,代码来源:index.php

示例5: theme_modern_actions_admin

function theme_modern_actions_admin()
{
    if (Params::getParam('file') == 'oc-content/themes/modern/admin/settings.php') {
        if (Params::getParam('donation') == 'successful') {
            osc_set_preference('donation', '1', 'modern_theme');
            osc_reset_preferences();
        }
    }
    switch (Params::getParam('action_specific')) {
        case 'settings':
            $footerLink = Params::getParam('footer_link');
            $defaultLogo = Params::getParam('default_logo');
            osc_set_preference('keyword_placeholder', Params::getParam('keyword_placeholder'), 'modern_theme');
            osc_set_preference('footer_link', $footerLink ? '1' : '0', 'modern_theme');
            osc_set_preference('default_logo', $defaultLogo ? '1' : '0', 'modern_theme');
            osc_add_flash_ok_message(__('Theme settings updated correctly', 'modern'), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/modern/admin/settings.php'));
            break;
        case 'upload_logo':
            $package = Params::getFiles('logo');
            if ($package['error'] == UPLOAD_ERR_OK) {
                if (move_uploaded_file($package['tmp_name'], WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
                    osc_add_flash_ok_message(__('The logo image has been uploaded correctly', 'modern'), 'admin');
                } else {
                    osc_add_flash_error_message(__("An error has occurred, please try again", 'modern'), 'admin');
                }
            } else {
                osc_add_flash_error_message(__("An error has occurred, please try again", 'modern'), 'admin');
            }
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/modern/admin/header.php'));
            break;
        case 'remove':
            if (file_exists(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
                @unlink(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg");
                osc_add_flash_ok_message(__('The logo image has been removed', 'modern'), 'admin');
            } else {
                osc_add_flash_error_message(__("Image not found", 'modern'), 'admin');
            }
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/modern/admin/header.php'));
            break;
    }
}
开发者ID:jmcclenon,项目名称:Osclass,代码行数:42,代码来源:functions.php

示例6: fb_page_plugin_actions

function fb_page_plugin_actions()
{
    $dao_preference = new Preference();
    $option = Params::getParam('fbpageoption');
    if (Params::getParam('file') != 'fb_page_plugin/admin.php') {
        return '';
    }
    if ($option == 'fbpagesettings') {
        osc_set_preference('fb_page_url', Params::getParam("fb_page_url") ? Params::getParam("fb_page_url") : '0', 'fb_page_plugin', 'STRING');
        osc_set_preference('fb_page_width', Params::getParam("fb_page_width") ? Params::getParam("fb_page_width") : '0', 'fb_page_plugin', 'STRING');
        osc_set_preference('fb_page_height', Params::getParam("fb_page_height") ? Params::getParam("fb_page_height") : '0', 'fb_page_plugin', 'STRING');
        osc_set_preference('fb_show_faces', Params::getParam("fb_show_faces") ? Params::getParam("fb_show_faces") : '0', 'fb_page_plugin', 'STRING');
        osc_set_preference('show_page_posts', Params::getParam("show_page_posts") ? Params::getParam("show_page_posts") : '0', 'fb_page_plugin', 'STRING');
        osc_set_preference('hide_page_cover', Params::getParam("hide_page_cover") ? Params::getParam("hide_page_cover") : '0', 'fb_page_plugin', 'STRING');
        osc_set_preference('use_small_header', Params::getParam("use_small_header") ? Params::getParam("use_small_header") : '0', 'fb_page_plugin', 'STRING');
        osc_set_preference('adapt_container_width', Params::getParam("adapt_container_width") ? Params::getParam("adapt_container_width") : '0', 'fb_page_plugin', 'STRING');
        osc_add_flash_ok_message(__('Facebook page plugin has been updated', 'fb_page_plugin'), 'admin');
        osc_redirect_to(osc_admin_render_plugin_url('fb_page_plugin/admin.php'));
    }
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:20,代码来源:index.php

示例7: theme_osclasswizards_actions_admin

function theme_osclasswizards_actions_admin()
{
    if (Params::getParam('file') == 'oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php') {
        if (Params::getParam('donation') == 'successful') {
            osc_set_preference('donation', '1', 'osclasswizards_theme');
            osc_reset_preferences();
        }
    }
    switch (Params::getParam('action_specific')) {
        case 'settings':
            osc_set_preference('welcome_message', Params::getParam('welcome_message'), 'osclasswizards_theme');
            osc_set_preference('defaultShowAs@all', Params::getParam('defaultShowAs@all'), 'osclasswizards_theme');
            osc_set_preference('defaultShowAs@search', Params::getParam('defaultShowAs@all'));
            osc_add_flash_ok_message(__('Theme settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php'));
            break;
        case 'templates_home':
            osc_set_preference('show_banner', Params::getParam('show_banner') ? '1' : '0', 'osclasswizards_theme');
            osc_set_preference('keyword_placeholder', Params::getParam('keyword_placeholder'), 'osclasswizards_theme');
            osc_set_preference('show_search_country', Params::getParam('show_search_country') ? '1' : '0', 'osclasswizards_theme');
            osc_set_preference('premium_listings_shown_home', Params::getParam('premium_listings_shown_home'), 'osclasswizards_theme');
            osc_set_preference('sub_cat_limit', Params::getParam('sub_cat_limit'), 'osclasswizards_theme');
            osc_set_preference('show_popular', Params::getParam('show_popular'), 'osclasswizards_theme');
            osc_set_preference('show_popular_regions', Params::getParam('show_popular_regions'), 'osclasswizards_theme');
            osc_set_preference('show_popular_cities', Params::getParam('show_popular_cities'), 'osclasswizards_theme');
            osc_set_preference('show_popular_searches', Params::getParam('show_popular_searches'), 'osclasswizards_theme');
            osc_set_preference('popular_regions_limit', Params::getParam('popular_regions_limit'), 'osclasswizards_theme');
            osc_set_preference('popular_cities_limit', Params::getParam('popular_cities_limit'), 'osclasswizards_theme');
            osc_set_preference('popular_searches_limit', Params::getParam('popular_searches_limit'), 'osclasswizards_theme');
            osc_add_flash_ok_message(__('Templates settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#templates'));
            break;
        case 'templates_search':
            osc_set_preference('premium_listings_shown', Params::getParam('premium_listings_shown'), 'osclasswizards_theme');
            osc_add_flash_ok_message(__('Templates settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#templates'));
            break;
        case 'templates_item_post':
            $locations_input_as = Params::getParam('locations_input_as', 'osclasswizards_theme');
            $locations_required = Params::getParam('locations_required', 'osclasswizards_theme');
            $category_multiple_selects = Params::getParam('category_multiple_selects', 'osclasswizards_theme');
            osc_set_preference('title_minimum_length', Params::getParam('title_minimum_length', 'osclasswizards_theme'), 'osclasswizards_theme');
            osc_set_preference('description_minimum_length', Params::getParam('description_minimum_length', 'osclasswizards_theme'), 'osclasswizards_theme');
            osc_set_preference('locations_input_as', $locations_input_as, 'osclasswizards_theme');
            osc_set_preference('locations_required', $locations_required ? '1' : '0', 'osclasswizards_theme');
            osc_set_preference('category_multiple_selects', $category_multiple_selects ? '1' : '0', 'osclasswizards_theme');
            osc_add_flash_ok_message(__('Templates settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#templates'));
            break;
        case 'ads_mgmt':
            osc_set_preference('header-728x90', trim(Params::getParam('header-728x90', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('homepage-728x90', trim(Params::getParam('homepage-728x90', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('sidebar-300x250', trim(Params::getParam('sidebar-300x250', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('search-results-top-728x90', trim(Params::getParam('search-results-top-728x90', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('search-results-middle-728x90', trim(Params::getParam('search-results-middle-728x90', false, false, false)), 'osclasswizards_theme');
            osc_add_flash_ok_message(__('Ads management updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#ads'));
            break;
        case 'categories_icons':
            $catsIcons = Params::getParam('cat-icons');
            foreach ($catsIcons as $catId => $iconName) {
                osc_set_preference('cat-icons-' . $catId, $iconName, 'osclasswizards_theme_cat_icons');
            }
            osc_add_flash_ok_message(__('Category icons settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#category-icons'));
            break;
        case 'theme_style':
            $color_mode = Params::getParam('theme_color_mode');
            osc_set_preference('theme_color_mode', $color_mode, 'osclasswizards_theme');
            osc_set_preference('google_fonts', Params::getParam('google_fonts'), 'osclasswizards_theme');
            $rtl_view = Params::getParam('rtl_view', 'osclasswizards_theme');
            osc_set_preference('rtl_view', $rtl_view ? '1' : '0', 'osclasswizards_theme');
            osc_set_preference('custom_css', trim(Params::getParam('custom_css', false, false, false)), 'osclasswizards_theme');
            osc_add_flash_ok_message(__('Theme color settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#theme-style'));
            break;
        case 'facebook':
            osc_set_preference('facebook-url', trim(Params::getParam('facebook-url', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('facebook-width', trim(Params::getParam('facebook-width', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('facebook-height', trim(Params::getParam('facebook-height', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('facebook-hidecover', trim(Params::getParam('facebook-hidecover', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('facebook-showface', trim(Params::getParam('facebook-showface', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('facebook-showpost', trim(Params::getParam('facebook-showpost', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('facebook-showitem', trim(Params::getParam('facebook-showitem', false, false, false)), 'osclasswizards_theme');
            osc_set_preference('facebook-showsearch', trim(Params::getParam('facebook-showsearch', false, false, false)), 'osclasswizards_theme');
            osc_add_flash_ok_message(__('Facebook Page settings updated correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/' . OSCLASSWIZARDS_THEME_FOLDER . '/admin/settings.php#facebook'));
            break;
        case 'upload_favicon':
            $package = Params::getFiles('favicon');
            if ($package['error'] == UPLOAD_ERR_OK) {
                $img = ImageResizer::fromFile($package['tmp_name']);
                $ext = $img->getExt();
                $logo_name = 'favicon';
                $logo_name .= '.' . $ext;
                $path = osc_uploads_path() . $logo_name;
                $img->saveToFile($path);
                osc_set_preference('favicon', $logo_name, 'osclasswizards_theme');
                osc_add_flash_ok_message(__('The favicon image has been uploaded correctly', OSCLASSWIZARDS_THEME_FOLDER), 'admin');
            } else {
//.........这里部分代码省略.........
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:101,代码来源:functions.php

示例8: osc_add_flash_ok_message

        // PAID
        ModelPaymentPro::newInstance()->enableItem($id);
        ModelPaymentPro::newInstance()->payPublishFee($id, 'ADMIN');
        osc_add_flash_ok_message(__('Listing paid', 'payment_pro'), 'admin');
        break;
    case 2:
        // BLOCK
        if (ModelPaymentPro::newInstance()->publishFeeIsPaid($id)) {
            $mItems = new ItemActions(false);
            $mItems->disable($id);
        } else {
            ModelPaymentPro::newInstance()->disableItem($id);
        }
        osc_add_flash_ok_message(__('Listing disabled', 'payment_pro'), 'admin');
        break;
    case 3:
        // UNBLOCK
        if (ModelPaymentPro::newInstance()->publishFeeIsPaid($id)) {
            //$mItems = new ItemActions(false);
            //$mItems->enable($id);
        } else {
            ModelPaymentPro::newInstance()->enableItem($id);
        }
        osc_add_flash_ok_message(__('Listing enabled', 'payment_pro'), 'admin');
        break;
    default:
        break;
}
ob_get_clean();
osc_redirect_to(osc_admin_base_url(true) . '?page=items');
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:30,代码来源:pay.php

示例9: dirname

<?php

/**
 * delete selected files
 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
 * @link www.phpletter.com
 * @since 22/April/2007
 *
 */
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php";
if (!osc_is_admin_user_logged_in()) {
    exit('Direct access is not allowed.');
}
if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) {
    $path = $_GET['path'];
    //check if the file size
    $fileSize = @filesize($path);
    if ($fileSize > getMemoryLimit()) {
        //larger then the php memory limit, redirect to the file
        osc_redirect_to($path);
    } else {
        //open it up and send out with php
        downloadFile($path);
    }
} else {
    die(ERR_DOWNLOAD_FILE_NOT_FOUND);
}
开发者ID:oanav,项目名称:closetshare,代码行数:27,代码来源:ajax_download.php

示例10: breadcrumbs_help

function breadcrumbs_help()
{
    if (osc_version() < 320) {
        osc_admin_render_plugin(osc_plugin_path(dirname(__FILE__)) . '/help.php');
    } else {
        osc_redirect_to(osc_route_admin_url('breadcrumbs-admin-help'));
    }
}
开发者ID:oanav,项目名称:closetshare,代码行数:8,代码来源:index.php

示例11: secureFileName

//include different config base file according to query string "config"
$configBaseFileName = 'config.base.php';
if (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config.' . secureFileName($_GET['config']) . ".php") {
    $configBaseFileName = 'config.' . secureFileName($_GET['config']) . ".php";
}
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName;
require_once DIR_AJAX_LANGS . CONFIG_LANG_DEFAULT . ".php";
require_once DIR_AJAX_INC . "function.base.php";
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php";
$session = new MySession();
$auth = new Auth();
if (CONFIG_ACCESS_CONTROL_MODE == 1) {
    //access control enabled
    if (!$auth->isLoggedIn() && strtolower(basename($_SERVER['PHP_SELF']) != strtolower(basename(CONFIG_LOGIN_PAGE)))) {
        //
        osc_redirect_to(appendQueryString(CONFIG_LOGIN_PAGE, makeQueryString()));
    }
}
addNoCacheHeaders();
//URL Declartions
define('CONFIG_URL_IMAGE_PREVIEW', 'ajax_image_preview.php');
define('CONFIG_URL_CREATE_FOLDER', 'ajax_create_folder.php');
define('CONFIG_URL_DELETE', 'ajax_delete_file.php');
define('CONFIG_URL_HOME', 'ajaxfilemanager.php');
define("CONFIG_URL_UPLOAD", 'ajax_file_upload.php');
define('CONFIG_URL_PREVIEW', 'ajax_preview.php');
define('CONFIG_URL_SAVE_NAME', 'ajax_save_name.php');
define('CONFIG_URL_IMAGE_EDITOR', 'ajax_image_editor.php');
define('CONFIG_URL_IMAGE_SAVE', 'ajax_image_save.php');
define('CONFIG_URL_IMAGE_RESET', 'ajax_editor_reset.php');
define('CONFIG_URL_IMAGE_UNDO', 'ajax_image_undo.php');
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:config.php

示例12: theme_pop_actions_admin

function theme_pop_actions_admin()
{
    //if(OC_ADMIN)
    if (Params::getParam('file') == 'oc-content/themes/pop/admin/settings.php') {
        if (Params::getParam('donation') == 'successful') {
            osc_set_preference('donation', '1', 'pop_theme');
            osc_reset_preferences();
        }
    }
    switch (Params::getParam('subaction')) {
        case 'color-update':
            /* theme color staff here */
            $aParams = Params::getParamsAsArray();
            unset($aParams['page']);
            unset($aParams['action']);
            unset($aParams['file']);
            unset($aParams['CSRFName']);
            unset($aParams['CSRFToken']);
            osc_set_preference('pop-theme-colors', json_encode($aParams), 'pop_theme');
            osc_add_flash_ok_message(__('Theme settings updated correctly', 'pop'), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/pop/admin/color_settings.php'));
            break;
        case 'color-restore':
            $aParams = pop_getColorScheme(true);
            osc_set_preference('pop-theme-colors', json_encode($aParams), 'pop_theme');
            osc_add_flash_ok_message(__('Theme settings updated correctly', 'pop'), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/pop/admin/color_settings.php'));
            break;
        default:
            break;
    }
    switch (Params::getParam('action_specific')) {
        case 'settings':
            $footerLink = Params::getParam('footer_link');
            osc_set_preference('pop_max_premium', Params::getParam('pop_max_premium'), 'pop_theme');
            osc_set_preference('keyword_placeholder', Params::getParam('keyword_placeholder'), 'pop_theme');
            osc_set_preference('footer_link', $footerLink ? '1' : '0', 'pop_theme');
            osc_set_preference('header-728x90', trim(Params::getParam('header-728x90', false, false, false)), 'pop_theme');
            osc_set_preference('search-results-300x250', trim(Params::getParam('search-results-300x250', false, false, false)), 'pop_theme');
            osc_set_preference('item-detail-300x250', trim(Params::getParam('item-detail-300x250', false, false, false)), 'pop_theme');
            osc_add_flash_ok_message(__('Theme settings updated correctly', 'pop'), 'admin');
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/pop/admin/settings.php'));
            break;
        case 'upload_logo':
            $package = Params::getFiles('logo');
            if ($package['error'] == UPLOAD_ERR_OK) {
                $img = ImageResizer::fromFile($package['tmp_name']);
                $ext = $img->getExt();
                $logo_name = 'pop_logo';
                $logo_name .= '.' . $ext;
                $path = osc_uploads_path() . $logo_name;
                move_uploaded_file($package['tmp_name'], $path);
                osc_set_preference('logo', $logo_name, 'pop_theme');
                osc_add_flash_ok_message(__('The logo image has been uploaded correctly', 'pop'), 'admin');
            } else {
                osc_add_flash_error_message(__("An error has occurred, please try again", 'pop'), 'admin');
            }
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/pop/admin/header.php'));
            break;
        case 'remove':
            $logo = osc_get_preference('logo', 'pop_theme');
            $path = osc_uploads_path() . $logo;
            if (file_exists($path)) {
                @unlink($path);
                osc_delete_preference('logo', 'pop_theme');
                osc_reset_preferences();
                osc_add_flash_ok_message(__('The logo image has been removed', 'pop'), 'admin');
            } else {
                osc_add_flash_error_message(__("Image not found", 'pop'), 'admin');
            }
            osc_redirect_to(osc_admin_render_theme_url('oc-content/themes/pop/admin/header.php'));
            break;
    }
}
开发者ID:michaelxizhou,项目名称:myeden69-original-backup,代码行数:74,代码来源:functions.php

示例13: userlogin

function userlogin()
{
    osc_redirect_to(osc_user_dashboard_url());
}
开发者ID:jhalendra,项目名称:classmandu,代码行数:4,代码来源:functions.php

示例14: osc_csrf_check

    /**
     * Check is CSRF token is valid, die in other case
     *
     * @since 3.1
     */

    function osc_csrf_check() {
        $error      = false;
        $str_error  = '';
        if(Params::getParam('CSRFName')=='' || Params::getParam('CSRFToken')=='') {
            $str_error = _m('Probable invalid request.') ;
            $error = true;
        } else {
            $name   = Params::getParam('CSRFName');
            $token  = Params::getParam('CSRFToken');
            if (!osc_csrfguard_validate_token($name, $token)) {
                $str_error = _m('Invalid CSRF token.');
                $error = true;
            }
        }

        if( defined('IS_AJAX') ) {
            if($error && IS_AJAX === true ) {
                echo json_encode(array(
                    'error' => 1,
                    'msg'   => $str_error
                ));
                exit;
            }
        }

        // ¿ check if is ajax request ?
        if($error) {
            if(OC_ADMIN) {
                osc_add_flash_error_message($str_error, 'admin');
            } else {
                osc_add_flash_error_message($str_error);
            }

            $url = osc_get_http_referer();
            // be sure that drop session referer
            Session::newInstance()->_dropReferer();
            if($url!='') {
                osc_redirect_to($url);
            }

            if(OC_ADMIN) {
                osc_redirect_to( osc_admin_base_url(true) );
            } else {
                osc_redirect_to( osc_base_url(true) );
            }
        }
    }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:53,代码来源:hSecurity.php

示例15: foreach

 *             GNU Affero General Public License for more details.
 *
 *      You should have received a copy of the GNU Affero General Public
 * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
$mp = ModelPayment::newInstance();
if (Params::getParam('plugin_action') == 'done') {
    $pub_prices = Params::getParam("pub_prices");
    $pr_prices = Params::getParam("pr_prices");
    foreach ($pr_prices as $k => $v) {
        $mp->insertPrice($k, $pub_prices[$k] == '' ? NULL : $pub_prices[$k], $v == '' ? NULL : $v);
    }
    // HACK : This will make possible use of the flash messages ;)
    ob_get_clean();
    osc_add_flash_ok_message(__('Congratulations, the plugin is now configured', 'payment'), 'admin');
    osc_redirect_to(osc_route_admin_url('payment-admin-prices'));
}
$categories = Category::newInstance()->toTreeAll();
$prices = ModelPayment::newInstance()->getCategoriesPrices();
$cat_prices = array();
foreach ($prices as $p) {
    $cat_prices[$p['fk_i_category_id']]['f_publish_cost'] = $p['f_publish_cost'];
    $cat_prices[$p['fk_i_category_id']]['f_premium_cost'] = $p['f_premium_cost'];
}
function drawCategories($categories, $depth = 0, $cat_prices)
{
    foreach ($categories as $c) {
        ?>
            <tr>
                <td>
                    <?php 
开发者ID:syedfiraat4,项目名称:bikade.com,代码行数:31,代码来源:conf_prices.php


注:本文中的osc_redirect_to函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。