本文整理汇总了PHP中fn_notification_exists函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_notification_exists函数的具体用法?PHP fn_notification_exists怎么用?PHP fn_notification_exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_notification_exists函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fn_magiczoom_install
function fn_magiczoom_install()
{
$moduleDirectory = str_replace(array("//", "\\"), array("/", "/"), Registry::get('config.dir.addons') . '/magiczoom');
$cancel = false;
if (!defined('PRODUCT_VERSION') || version_compare(PRODUCT_VERSION, '4.0.0', '<')) {
$cancel = true;
if (!fn_notification_exists('E', 'magiczoom_module_version_notification')) {
$message = "<br/><span style=\"font-size: 16px; line-height: 20px; margin-top: 5px; display: block;\">This Magic Zoom module is intended only for CS Cart Version 4 and above." . "<br/>Your version of CS Cart is " . PRODUCT_VERSION . "</span>";
fn_set_notification('E', __('error'), $message, true, 'magiczoom_module_version_notification');
}
}
if ($cancel) {
$args = func_get_args();
if (!empty($args)) {
fn_redirect("addons.manage");
}
return;
}
//fix url's in css files
$cancel = fn_magiczoom_fix_css();
if ($cancel) {
$args = func_get_args();
if (!empty($args)) {
fn_redirect("addons.manage");
}
return;
}
//NOTE: fix the order in which modules call
$magicAddons = db_get_fields("SELECT addon FROM ?:addons WHERE addon LIKE 'magic%'");
if (!empty($magicAddons)) {
$magicAddonsData = array();
foreach ($magicAddons as $addon) {
$magicAddonsData[$addon] = db_get_row("SELECT * FROM ?:addons WHERE addon='{$addon}'");
db_query("DELETE FROM ?:addons WHERE addon='{$addon}'");
}
if (isset($magicAddonsData['magiczoom'])) {
db_query("INSERT INTO ?:addons ?e", $magicAddonsData['magiczoom']);
unset($magicAddonsData['magiczoom']);
}
foreach ($magicAddonsData as $addon => $data) {
db_query("INSERT INTO ?:addons ?e", $data);
}
}
fn_magiczoom_send_stat('install');
}
开发者ID:ambient-lounge,项目名称:site,代码行数:45,代码来源:func.php
示例2: delete
public function delete($id)
{
$data = array();
$status = Response::STATUS_BAD_REQUEST;
if (LLanguages::deleteLanguages(array($id))) {
$status = Response::STATUS_NO_CONTENT;
} elseif (!fn_notification_exists('extra', 'language_is_default')) {
$status = Response::STATUS_NOT_FOUND;
}
return array('status' => $status, 'data' => $data);
}
开发者ID:askzap,项目名称:ultimate,代码行数:11,代码来源:Languages.php
示例3: update
public function update($id, $params)
{
$data = array();
$status = Response::STATUS_BAD_REQUEST;
unset($params['category_id']);
$lang_code = $this->safeGet($params, 'lang_code', DEFAULT_LANGUAGE);
$category_id = fn_update_category($params, $id, $lang_code);
$this->prepareImages($params, $id);
$updated = fn_attach_image_pairs('category_main', 'category', $id, DESCR_SL);
if ($category_id || $updated) {
if ($updated && fn_notification_exists('extra', '404')) {
fn_delete_notification('404');
}
$status = Response::STATUS_OK;
$data = array('category_id' => $id);
}
return array('status' => $status, 'data' => $data);
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:18,代码来源:Categories.php
示例4: fn_dispatch
//.........这里部分代码省略.........
}
if (!empty($auth['this_login']) && Registry::ifGet($auth['this_login'], 'N') === 'Y') {
fn_set_notification('E', __('error'), __(ACCOUNT_TYPE . LOGIN_STATUS_USER_DISABLED));
$status = CONTROLLER_STATUS_DENIED;
}
// [Block manager]
// block manager is disabled for vendors.
if (!(fn_allowed_for('MULTIVENDOR') && Registry::get('runtime.company_id') || fn_allowed_for('ULTIMATE') && !Registry::get('runtime.company_id'))) {
if (fn_check_permissions('block_manager', 'manage', 'admin')) {
$dynamic_object = SchemesManager::getDynamicObject($_REQUEST['dispatch'], $area, $_REQUEST);
if (!empty($dynamic_object)) {
if ($area == 'A' && Registry::get('runtime.mode') != 'add' && !empty($_REQUEST[$dynamic_object['key']])) {
$object_id = $_REQUEST[$dynamic_object['key']];
$location = Location::instance()->get($dynamic_object['customer_dispatch'], $dynamic_object, CART_LANGUAGE);
if (!empty($location) && $location['is_default'] != 1) {
$params = array('dynamic_object' => array('object_type' => $dynamic_object['object_type'], 'object_id' => $object_id), $dynamic_object['key'] => $object_id, 'manage_url' => Registry::get('config.current_url'));
Registry::set('navigation.tabs.blocks', array('title' => __('layouts'), 'href' => 'block_manager.manage_in_tab?' . http_build_query($params), 'ajax' => true));
}
}
}
}
}
// [/Block manager]
// Redirect if controller returned successful/redirect status only
if (in_array($status, array(CONTROLLER_STATUS_OK, CONTROLLER_STATUS_REDIRECT)) && !empty($_REQUEST['redirect_url']) && !$external) {
$redirect_url = $_REQUEST['redirect_url'];
}
// If controller returns "Redirect" status, check if redirect url exists
if ($status == CONTROLLER_STATUS_REDIRECT && empty($redirect_url)) {
$status = CONTROLLER_STATUS_NO_PAGE;
}
// In backend show "changes saved" notification
if ($area == 'A' && $_SERVER['REQUEST_METHOD'] == 'POST' && in_array($status, array(CONTROLLER_STATUS_OK, CONTROLLER_STATUS_REDIRECT))) {
if (strpos($mode, 'update') !== false && $mode != 'update_status' && $mode != 'update_mode' && !fn_notification_exists('extra', 'demo_mode') && !fn_notification_exists('type', 'E')) {
fn_set_notification('N', __('notice'), __('text_changes_saved'), 'I', 'changes_saved');
}
}
// Attach params and redirect if needed
if (in_array($status, array(CONTROLLER_STATUS_OK, CONTROLLER_STATUS_REDIRECT)) && !empty($redirect_url)) {
if (!isset($_REQUEST['return_to_list'])) {
$params = array('page', 'selected_section', 'active_tab');
$url_params = array();
foreach ($params as $param) {
if (!empty($_REQUEST[$param])) {
$url_params[$param] = $_REQUEST[$param];
}
}
if (!empty($url_params)) {
$redirect_url = fn_link_attach($redirect_url, http_build_query($url_params));
}
}
if (!isset($external)) {
$external = false;
}
if (!isset($permanent)) {
$permanent = false;
}
fn_redirect($redirect_url, $external, $permanent);
}
if (!$view->getTemplateVars('content_tpl') && $status == CONTROLLER_STATUS_OK) {
// FIXME
$status = CONTROLLER_STATUS_NO_PAGE;
}
if ($status != CONTROLLER_STATUS_OK) {
if ($status == CONTROLLER_STATUS_NO_PAGE) {
if ($area == 'A' && empty($auth['user_id'])) {
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:67,代码来源:fn.control.php
示例5: list
list($cart_products, $product_groups) = fn_calculate_cart_content($cart, $auth, Registry::get('settings.General.estimate_shipping_cost') == 'Y' ? 'A' : 'S', true, 'F', true);
fn_gather_additional_products_data($cart_products, array('get_icon' => true, 'get_detailed' => true, 'get_options' => true, 'get_discounts' => false));
fn_add_breadcrumb(__('cart_contents'));
fn_update_payment_surcharge($cart, $auth);
$cart_products = array_reverse($cart_products, true);
Tygh::$app['view']->assign('cart_products', $cart_products);
Tygh::$app['view']->assign('product_groups', $cart['product_groups']);
if (fn_allowed_for('MULTIVENDOR')) {
Tygh::$app['view']->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($cart['products']));
}
// Check if any outside checkout is enbaled
if (fn_cart_is_empty($cart) != true) {
$checkout_buttons = fn_get_checkout_payment_buttons($cart, $cart_products, $auth);
if (!empty($checkout_buttons)) {
Tygh::$app['view']->assign('checkout_add_buttons', $checkout_buttons, false);
} elseif (empty($payment_methods) && !fn_notification_exists('extra', 'no_payment_notification')) {
fn_set_notification('W', __('notice'), __('cannot_proccess_checkout_without_payment_methods'));
}
}
// All checkout steps
} elseif ($mode == 'checkout') {
if (Registry::get('settings.General.min_order_amount_type') == 'only_products' && Registry::get('settings.General.min_order_amount') > $cart['subtotal']) {
Tygh::$app['view']->assign('value', Registry::get('settings.General.min_order_amount'));
$min_amount = Tygh::$app['view']->fetch('common/price.tpl');
fn_set_notification('W', __('notice'), __('text_min_products_amount_required') . ' ' . $min_amount);
return array(CONTROLLER_STATUS_REDIRECT, 'checkout.cart');
}
fn_add_breadcrumb(__('checkout'));
$profile_fields = fn_get_profile_fields('O');
// Display steps
$display_steps = array('step_one' => true, 'step_two' => true, 'step_three' => true, 'step_four' => true);
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:checkout.php
示例6: fn_promotion_check_coupon
/**
* Pre/Post coupon checking/applying
*
* @param array $cart cart
* @param boolean $initial_check true for pre-check, false - for post-check
* @param array $applied_promotions list of applied promotions
* @return boolean true if coupon is applied, false - otherwise
*/
function fn_promotion_check_coupon(&$cart, $initial_check, $applied_promotions = array())
{
$result = true;
// Pre-check: find if coupon is already used or only single coupon is allowed
if ($initial_check == true) {
fn_set_hook('pre_promotion_check_coupon', $cart['pending_coupon'], $cart);
if (!empty($cart['coupons'][$cart['pending_coupon']])) {
$_SESSION['promotion_notices']['promotion']['messages'][] = 'coupon_already_used';
unset($cart['pending_coupon']);
$result = false;
} elseif (Registry::get('settings.General.use_single_coupon') == 'Y' && sizeof($cart['coupons']) > 0) {
$_SESSION['promotion_notices']['promotion']['messages'][] = 'single_coupon_is_allowed';
unset($cart['pending_coupon']);
$result = false;
} else {
$cart['coupons'][$cart['pending_coupon']] = true;
}
// Post-check: check if coupon was applied successfully
} else {
if (!empty($cart['pending_coupon'])) {
if (!empty($applied_promotions)) {
$params = array('active' => true, 'coupon_code' => !empty($cart['pending_original_coupon']) ? $cart['pending_original_coupon'] : $cart['pending_coupon'], 'promotion_id' => array_keys($applied_promotions));
list($coupon) = fn_get_promotions($params);
}
if (empty($coupon)) {
if (!fn_notification_exists('extra', 'error_coupon_already_used')) {
$_SESSION['promotion_notices']['promotion']['messages'][] = 'no_such_coupon';
}
unset($cart['coupons'][$cart['pending_coupon']]);
$result = false;
} else {
$cart['coupons'][$cart['pending_coupon']] = array_keys($coupon);
fn_set_hook('promotion_check_coupon', $cart['pending_coupon'], $cart);
}
unset($cart['pending_coupon'], $cart['pending_original_coupon']);
}
}
return $result;
}
开发者ID:askzap,项目名称:ultimate,代码行数:47,代码来源:fn.promotions.php
示例7: delete
public function delete($id)
{
$data = array();
$status = Response::STATUS_BAD_REQUEST;
if (fn_delete_user($id)) {
$status = Response::STATUS_OK;
$data['message'] = 'Ok';
} elseif (!fn_notification_exists('extra', 'user_delete_no_permissions')) {
$status = Response::STATUS_NOT_FOUND;
}
return array('status' => $status, 'data' => $data);
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:12,代码来源:Users.php
示例8: fn_delete_notification
if (!isset($auth['first_expire_check'])) {
$auth['first_expire_check'] = true;
}
// Make user change the password if:
// - password has expired
// - this is the first admin's login and change_admin_password_on_first_login is enabled
// - this is the first vendor admin's login
if (empty($auth['password_change_timestamp']) && (Registry::get('settings.Security.change_admin_password_on_first_login') == 'Y' || !empty($auth['company_id'])) || $expire && $time_diff >= $expire) {
$_SESSION['auth']['forced_password_change'] = true;
if ($auth['first_expire_check']) {
// we can redirect only on first check, else we can corrupt some admin's working processes ( such as ajax requests
fn_delete_notification('insecure_password');
$return_url = !empty($_REQUEST['return_url']) ? $_REQUEST['return_url'] : Registry::get('config.current_url');
return array(CONTROLLER_STATUS_REDIRECT, "auth.password_change?return_url=" . urlencode($return_url));
} else {
if (!fn_notification_exists('E', 'password_expire')) {
fn_set_notification('E', fn_get_lang_var('warning'), str_replace('[link]', fn_url('profiles.update', 'A'), fn_get_lang_var('error_password_expired_change')), true, 'password_expire');
}
}
} else {
$auth['first_expire_check'] = false;
}
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
return;
}
// Get base menu
$menues = fn_get_schema('menu', 'menu', 'xml');
if (fn_check_suppliers_functionality()) {
if (PRODUCT_TYPE == 'MULTIVENDOR') {
$menues .= fn_get_schema('menu', 'menu_mve', 'xml');
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:init.php
示例9: send
/**
* Sends request
*
* Method does not return result. It's exit from script.
*/
public function send()
{
if (fn_notification_exists('extra', 'company_access_denied')) {
$this->status = Response::STATUS_FORBIDDEN;
} elseif (fn_notification_exists('extra', '404')) {
$this->status = Response::STATUS_NOT_FOUND;
}
if ($this->status == self::STATUS_UNAUTHORIZED) {
header('WWW-Authenticate: Basic realm="User email/API key"');
}
$this->sendStatusCode($this->status);
if ($this->status == self::STATUS_NO_CONTENT) {
exit;
}
header('Content-type: ' . $this->content_type);
if (!self::isSuccessStatus($this->status)) {
$messages = array();
if (is_array($this->body)) {
if (!empty($this->body['message'])) {
$messages = array($this->body['message']);
} else {
$messages = $this->body;
}
} elseif (!empty($this->body)) {
$messages = array($this->body);
}
$this->body = array();
$codes = self::getAvailableCodes();
$this->body['message'] = $codes[$this->status];
$notifications = fn_get_notifications();
foreach ($notifications as $notice) {
if ($notice['type'] == 'E') {
$messages[] = $notice['message'];
}
}
foreach ($notifications as $notice) {
if ($notice['type'] == 'W') {
$messages[] = $notice['message'];
}
}
if (!empty($messages)) {
$this->body['message'] .= ': ' . implode('. ', $messages);
}
$this->body['status'] = $this->status;
}
$body = FormatManager::instance()->encode($this->body, $this->content_type);
echo $body;
exit;
}
开发者ID:askzap,项目名称:ultimate,代码行数:54,代码来源:Response.php
示例10: delete
public function delete($id)
{
$data = array();
$status = Response::STATUS_BAD_REQUEST;
if (fn_delete_company($id)) {
$status = Response::STATUS_NO_CONTENT;
} elseif (!fn_notification_exists('extra', 'company_has_orders')) {
$status = Response::STATUS_NOT_FOUND;
}
return array('status' => $status, 'data' => $data);
}
开发者ID:askzap,项目名称:ultimate,代码行数:11,代码来源:Stores.php
注:本文中的fn_notification_exists函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论