• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fn_set_hook函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fn_twg_exim_get_product_mobile_url

/**
 * Gets mobile product url
 *
 * @param $product_id
 * @param string $lang_code
 * @return bool
 */
function fn_twg_exim_get_product_mobile_url($product_id, $lang_code = '')
{
    $company_id = 0;
    $company_url = '';
    if (fn_allowed_for('ULTIMATE')) {
        if (Registry::get('runtime.company_id')) {
            $company_id = Registry::get('runtime.company_id');
        } else {
            $company_id = db_get_field('SELECT company_id FROM ?:products WHERE product_id = ?i', $product_id);
        }
        $company_url = '&company_id=' . $company_id;
    } else {
        $company_url = '';
    }
    $settings = TwigmoSettings::get('customer_connections.' . $company_id);
    $use_twg = !empty($settings['access_id']) && ($settings['use_for_phones'] == 'Y' || $settings['use_for_tablets'] == 'Y');
    if ($use_twg && fn_twg_use_https_for_customer($company_id)) {
        $protocol = 'https';
    } else {
        $protocol = 'http';
    }
    $url = fn_url('products.view?product_id=' . $product_id . $company_url, 'C', $protocol, $lang_code);
    fn_set_hook('exim_get_product_url', $url, $product_id, $options, $lang_code);
    return $url;
}
开发者ID:askzap,项目名称:ultimate,代码行数:32,代码来源:products.functions.php


示例2: smarty_block_styles

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */
function smarty_block_styles($params, $content, &$smarty, &$repeat)
{
    if ($repeat == true) {
        return;
    }
    $prepend_prefix = Embedded::isEnabled() ? 'html#tygh_html body#tygh_body .tygh' : '';
    $styles = array();
    $internal_styles = '';
    //if (preg_match_all('/\<link(.*?href ?= ?"([^"]+)")?[^\>]*\>/is', $content, $m)) {
    if (preg_match_all('/\\<link(.*?href\\s?=\\s?(?:"|\')([^"]+)(?:"|\'))?[^\\>]*\\>/is', $content, $m)) {
        foreach ($m[2] as $k => $v) {
            $v = preg_replace('/\\?.*?$/', '', $v);
            $media = '';
            if (strpos($m[1][$k], 'media=') !== false && preg_match('/media="(.*?)"/', $m[1][$k], $_m)) {
                $media = $_m[1];
            }
            $styles[] = array('file' => str_replace(Registry::get('config.current_location'), Registry::get('config.dir.root'), $v), 'relative' => str_replace(Registry::get('config.current_location') . '/', '', $v), 'media' => $media);
        }
    }
    if (preg_match_all('/\\<style.*\\>(.*)\\<\\/style\\>/isU', $content, $m)) {
        $internal_styles = implode("\n\n", $m[1]);
    }
    if (!empty($styles) || !empty($internal_styles)) {
        fn_set_hook('styles_block_files', $styles);
        list($_area) = Registry::get('view')->getArea();
        $filename = fn_merge_styles($styles, $internal_styles, $prepend_prefix, $params, $_area);
        $content = '<link type="text/css" rel="stylesheet" href="' . $filename . '" />';
    }
    return $content;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:35,代码来源:block.styles.php


示例3: generate

 /**
  * Generates menu items from scheme
  * @param  array $request request params
  * @return array menu items
  */
 public function generate($request)
 {
     $menu = fn_get_schema('menu', 'menu', 'php');
     $this->_request = $request;
     $actions = array();
     foreach ($menu as $group => &$menu_data) {
         // Get static section
         foreach ($menu_data as $root => &$items) {
             $items['items'] = $this->_processItems($items['items'], $root, '');
             if (empty($items['items'])) {
                 unset($menu[$group][$root]);
                 continue;
             }
         }
     }
     unset($items, $menu_data);
     $menu['top'] = $this->_sort($menu['top']);
     $menu['central'] = $this->_sort($menu['central']);
     $menu = $this->_getSettingsSections($menu);
     fn_preload_lang_vars($this->_lang_cache);
     $selected = $this->_selected;
     /**
      * Changes generated menu items
      *
      * @param  array $request request params
      * @param array $menu items
      * @param array $actions items Action value, if exists. See: fn_get_route
      * @param array $this->selected Menu item, selected by the dispatch
      */
     fn_set_hook('backend_menu_generate_post', $request, $menu, $actions, $this->_selected);
     return array($menu, $actions, $this->_selected);
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:37,代码来源:BackendMenu.php


示例4: fn_image_zoom_check_image

/**
 * Check detail image sizes ration
 *
 * @param array $image_data Image data
 * @param array $images Array with initial images
 */
function fn_image_zoom_check_image(&$image_data, &$images)
{
    $precision = 80;
    $ratio_detailed = round(round($images['detailed']['image_x'] / $images['detailed']['image_y'] * $precision) / $precision, 2);
    $ratio_original = round(round($image_data['width'] / $image_data['height'] * $precision) / $precision, 2);
    if ($ratio_detailed != $ratio_original) {
        if ($ratio_detailed < $ratio_original) {
            $new_x = ceil($images['detailed']['image_y'] / $image_data['height'] * $image_data['width']);
            $new_y = $images['detailed']['image_y'];
        } else {
            $new_y = ceil($images['detailed']['image_x'] / $image_data['width'] * $image_data['height']);
            $new_x = $images['detailed']['image_x'];
        }
        $file_path = fn_generate_thumbnail($images['detailed']['relative_path'], $new_x, $new_y, false, true);
        /**
         * Post hook for check detail image sizes ration
         * @param string $file_path File path
         * @param array $image_data Image data
         * @param array $images Array with initial images
         */
        fn_set_hook('image_zoom_check_image_post', $file_path, $image_data, $images);
        if ($file_path) {
            $image_data['detailed_image_path'] = \Tygh\Storage::instance('images')->getUrl($file_path);
        }
    }
}
开发者ID:ambient-lounge,项目名称:site,代码行数:32,代码来源:func.php


示例5: getPath

 protected function getPath()
 {
     $path = Registry::get('config.dir.root');
     if ($this->default) {
         $path .= '/var';
     }
     $path .= '/robots.txt';
     fn_set_hook('robots_get_path', $this, $path);
     return $path;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:10,代码来源:Robots.php


示例6: fn_get_tag_objects

function fn_get_tag_objects()
{
    $types = array();
    if (Registry::get('addons.tags.tags_for_products') == 'Y') {
        $types['P'] = array('name' => 'products', 'url' => 'products.manage');
    }
    if (Registry::get('addons.tags.tags_for_pages') == 'Y') {
        $types['A'] = array('name' => 'pages', 'url' => 'pages.manage');
    }
    fn_set_hook('get_tag_objects', $types);
    return $types;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:12,代码来源:tags.php


示例7: getPath

 /**
  * Gets patterns absolute path
  * @param  string $style_id style ID
  * @return string patterns absolute path
  */
 public function getPath($style_id)
 {
     $path = fn_get_theme_path('[themes]/[theme]/media/images/patterns/', 'C');
     /**
      * Modifies path to patterns
      *
      * @param object  $this Patterns object
      * @param string  $path current path
      * @param string  $style_id style to get path for
      */
     fn_set_hook('patterns_get_path', $this, $path, $style_id);
     return $path . fn_basename($style_id);
 }
开发者ID:askzap,项目名称:ultimate,代码行数:18,代码来源:Patterns.php


示例8: addLink

 /**
  * Adds new node the breadcrumbs
  *
  * @param  string  $lang_value name of language variable
  * @param  string  $link       breadcrumb URL
  * @param  boolean $nofollow   Include or not "nofollow" attribute
  * @param  boolean $is_first   Flag that defines if parameter should be added to the beging (default false)
  * @return boolean True if breadcrumbs were added, false otherwise
  */
 public function addLink($title, $link = '', $nofollow = false, $is_first = false)
 {
     if ($this->_area == 'A' && !fn_check_view_permissions($link, 'GET')) {
         return false;
     }
     fn_set_hook('add_breadcrumb', $title, $link);
     $item = array('title' => $title, 'link' => $link, 'nofollow' => $nofollow);
     if ($is_first) {
         array_unshift($this->_links, $item);
     } else {
         $this->_links[] = $item;
     }
     return true;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:23,代码来源:Breadcrumbs.php


示例9: fn_get_status_params_definition

function fn_get_status_params_definition($type)
{
    $status_params = array();
    if ($type == STATUSES_ORDER) {
        $status_params = array('color' => array('type' => 'color', 'label' => 'color'), 'notify' => array('type' => 'checkbox', 'label' => 'notify_customer', 'default_value' => 'Y'), 'notify_department' => array('type' => 'checkbox', 'label' => 'notify_orders_department'), 'notify_vendor' => array('type' => 'checkbox', 'label' => 'notify_vendor'), 'inventory' => array('type' => 'select', 'label' => 'inventory', 'variants' => array('I' => 'increase', 'D' => 'decrease')), 'remove_cc_info' => array('type' => 'checkbox', 'label' => 'remove_cc_info', 'default_value' => 'Y'), 'repay' => array('type' => 'checkbox', 'label' => 'pay_order_again'), 'appearance_type' => array('type' => 'select', 'label' => 'invoice_credit_memo', 'variants' => array('D' => 'default', 'I' => 'invoice', 'C' => 'credit_memo', 'O' => 'order')));
        if (fn_allowed_for('ULTIMATE:FREE')) {
            unset($status_params['notify_vendor']);
        } elseif (fn_allowed_for('MULTIVENDOR')) {
            $status_params['calculate_for_payouts'] = array('type' => 'checkbox', 'label' => 'charge_to_vendor_account');
        } elseif (fn_allowed_for('ULTIMATE')) {
            unset($status_params['notify_vendor']);
        }
    }
    fn_set_hook('get_status_params_definition', $status_params, $type);
    return $status_params;
}
开发者ID:askzap,项目名称:ultimate,代码行数:16,代码来源:statuses.php


示例10: smarty_block_styles

/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */
function smarty_block_styles($params, $content, &$smarty, &$repeat)
{
    if ($repeat == true) {
        return;
    }
    $prepend_prefix = Embedded::isEnabled() ? 'html#tygh_html body#tygh_body .tygh' : '';
    $current_location = Registry::get('config.current_location');
    $styles = array();
    $inline_styles = '';
    $external_styles = array();
    //if (preg_match_all('/\<link(.*?href ?= ?"([^"]+)")?[^\>]*\>/is', $content, $m)) {
    if (preg_match_all('/\\<link(.*?href\\s?=\\s?(?:"|\')([^"]+)(?:"|\'))?[^\\>]*\\>/is', $content, $m)) {
        foreach ($m[2] as $k => $v) {
            $v = preg_replace('/\\?.*?$/', '', $v);
            $media = '';
            if (strpos($m[1][$k], 'media=') !== false && preg_match('/media="(.*?)"/', $m[1][$k], $_m)) {
                $media = $_m[1];
            }
            if (strpos($v, $current_location) === false || strpos($m[1][$k], 'data-ca-external') !== false) {
                // Location is different OR style is skipped for minification
                $external_styles[] = str_replace(' data-ca-external="Y"', '', $m[0][$k]);
            } else {
                $styles[] = array('file' => str_replace($current_location, Registry::get('config.dir.root'), $v), 'relative' => str_replace($current_location . '/', '', $v), 'media' => $media);
            }
        }
    }
    if (preg_match_all('/\\<style.*\\>(.*)\\<\\/style\\>/isU', $content, $m)) {
        $inline_styles = implode("\n\n", $m[1]);
    }
    if (!empty($styles) || !empty($inline_styles)) {
        fn_set_hook('styles_block_files', $styles);
        list($_area) = Tygh::$app['view']->getArea();
        $params['compressed'] = true;
        $filename = fn_merge_styles($styles, $inline_styles, $prepend_prefix, $params, $_area);
        $content = '<link type="text/css" rel="stylesheet" href="' . $filename . '" />';
        if (!empty($external_styles)) {
            $content .= PHP_EOL . implode(PHP_EOL, $external_styles);
        }
    }
    return $content;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:46,代码来源:block.styles.php


示例11: backupFiles

 /**
  * Makes store files backup
  *
  * @param array $params Extra params
  *  backup_files - array List of files/folders to be added to backup
  *  pack_name - string name of result pack. Will be stored in Registry::get('config.dir.backups') . 'files/' . $pack_name
  *  fs_compress - bool Compress result dir
  * @return string Path to backuped files/archve
  */
 public static function backupFiles($params = array())
 {
     $backup_files = array('app', 'design', 'js', '.htaccess', 'api.php', 'config.local.php', 'config.php', 'index.php', 'init.php', 'robots.txt', 'var/themes_repository', 'var/snapshots');
     $backup_files[] = Registry::get('config.admin_index');
     if (fn_allowed_for('MULTIVENDOR')) {
         $backup_files[] = Registry::get('config.vendor_index');
     }
     if (!empty($params['backup_files'])) {
         $backup_files = $params['backup_files'];
     }
     if (!empty($params['extra_folders'])) {
         $params['extra_folders'] = array_map(function ($path) {
             return fn_normalize_path($path);
         }, $params['extra_folders']);
         $backup_files = array_merge($backup_files, $params['extra_folders']);
     }
     fn_set_hook('data_keeper_backup_files', $backup_files);
     $pack_name = !empty($params['pack_name']) ? $params['pack_name'] : 'backup_' . date('dMY_His', TIME);
     $destination_path = fn_get_cache_path(false) . 'tmp/backup/_files/' . $pack_name;
     $source_path = Registry::get('config.dir.root' . '/');
     fn_set_progress('step_scale', (sizeof($backup_files) + 1) * 2);
     fn_set_progress('echo', __('backup_files'), false);
     fn_rm($destination_path);
     fn_mkdir($destination_path);
     foreach ($backup_files as $file) {
         fn_set_progress('echo', __('uc_copy_files') . ': <b>' . $file . '</b>', true);
         fn_copy($source_path . $file, $destination_path . '/' . $file);
     }
     if (!empty($params['fs_compress'])) {
         fn_set_progress('echo', __('compressing_backup'), true);
         $ext = $params['fs_compress'] == 'tgz' ? '.tgz' : '.zip';
         $result = fn_compress_files($pack_name . $ext, $pack_name, fn_get_cache_path(false) . 'tmp/backup/_files/');
         $destination_path = rtrim($destination_path, '/');
         if ($result) {
             fn_rename($destination_path . $ext, Registry::get('config.dir.backups') . $pack_name . $ext);
         }
         fn_rm($destination_path);
         $destination_path .= $ext;
     }
     return $destination_path;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:50,代码来源:DataKeeper.php


示例12: fn_amazon_validate_cart_data

function fn_amazon_validate_cart_data($cart, $request)
{
    $items = array();
    $_items = $request->CallbackOrderCart->CallbackOrderCartItems;
    if (empty($_items)) {
        $_items = $request->ProcessedOrder->ProcessedOrderItems;
        foreach ($_items->ProcessedOrderItem as $item) {
            $items[] = $item;
        }
    } else {
        foreach ($_items->CallbackOrderCartItem as $item) {
            $items[] = $item;
        }
    }
    $cart_items_amount = count($cart['products']);
    fn_set_hook('amazon_validate_cart', $items, $cart, $cart_items_amount);
    if (count($items) == $cart_items_amount || count($items) - 1 == $cart_items_amount) {
        foreach ($items as $item) {
            $sku = (string) $item->Item->SKU;
            if (empty($sku)) {
                $sku = (string) $item->SKU;
                $qty = (string) $item->Quantity;
                $cart_id = (string) $item->ItemCustomData->CartID;
            } else {
                $qty = (string) $item->Item->Quantity;
                $cart_id = (string) $item->Item->ItemCustomData->CartID;
            }
            $is_valid = false;
            fn_set_hook('amazon_validate_cart_item', $cart, $sku, $qty, $cart_id, $is_valid);
            if ($is_valid || $sku == 'taxes' && empty($cart_id)) {
                continue;
            } elseif (!isset($cart['products'][$cart_id]) || $cart['products'][$cart_id]['amount'] != $qty) {
                return false;
            }
        }
    } else {
        return false;
    }
    return true;
}
开发者ID:askzap,项目名称:ultimate,代码行数:40,代码来源:amazon_func.php


示例13: preloadLangVars

 /**
  * Loads received language variables into language cache
  *
  * @param array  $var_names Language variable that to be loaded
  * @param string $lang_code 2-letter language code
  *
  * @return boolean True if any of received language variables were added into cache; false otherwise
  */
 public static function preloadLangVars($var_names, $lang_code = CART_LANGUAGE)
 {
     Registry::registerCache('lang_cache', array('language_values', 'ult_language_values'), Registry::cacheLevel('dispatch'), true);
     $values = Registry::get('lang_cache.' . $lang_code);
     if (empty($values)) {
         $values = array();
     }
     $var_names = array_diff($var_names, array_keys($values));
     if ($var_names) {
         foreach ($var_names as $index => $var_name) {
             $var_names[$index] = strtolower($var_name);
             if (isset($values[$var_name])) {
                 unset($var_names[$index]);
             }
         }
         if (empty($var_names)) {
             return true;
         }
         $fields = array('lang.name' => true, 'lang.value' => true);
         $tables = array('?:language_values lang');
         $left_join = array();
         $condition = array(db_quote('lang.lang_code = ?s', $lang_code), db_quote('lang.name IN (?a)', $var_names));
         $params = array();
         fn_set_hook('get_lang_var', $fields, $tables, $left_join, $condition, $params);
         $joins = !empty($left_join) ? ' LEFT JOIN ' . implode(', ', $left_join) : '';
         $new_values = db_get_hash_single_array('SELECT ' . implode(', ', array_keys($fields)) . ' FROM ' . implode(', ', $tables) . $joins . ' WHERE ' . implode(' AND ', $condition), array('name', 'value'));
         foreach ($var_names as $var_name) {
             if (!isset($new_values[$var_name])) {
                 $new_values[$var_name] = '_' . $var_name;
             }
         }
         $values = fn_array_merge($values, $new_values);
         Registry::set('lang_cache.' . $lang_code, $values);
         return true;
     }
     return false;
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:45,代码来源:Helper.php


示例14: fn_rssf_get_items

function fn_rssf_get_items($params, $lang_code = CART_LANGUAGE)
{
    $items_data = $additional_data = $block_data = array();
    if (!empty($params['bid']) && !empty($params['sid']) && empty($params['category_id'])) {
        $block_data = Block::instance()->getById($params['bid'], $params['sid'], array(), $lang_code);
        if (!empty($block_data['content']['filling']) && $block_data['content']['filling'] == 'products') {
            $_params = array('sort_by' => $block_data['properties']['filling']['products']['rss_sort_by'] == 'U' ? 'updated_timestamp' : 'timestamp', 'sort_order' => 'desc');
            $max_items = !empty($block_data['properties']['max_item']) ? $block_data['properties']['max_item'] : 5;
            list($products) = fn_get_products($_params, $max_items, $lang_code);
            fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_options' => false, 'get_discounts' => false));
            $additional_data['title'] = !empty($block_data['properties']['feed_title']) ? $block_data['properties']['feed_title'] : __('products') . '::' . __('page_title', '', $lang_code);
            $additional_data['description'] = !empty($block_data['properties']['feed_description']) ? $block_data['properties']['feed_description'] : $additional_data['title'];
            $additional_data['link'] = fn_url('', 'C', 'http', $lang_code);
            $additional_data['language'] = $lang_code;
            $additional_data['lastBuildDate'] = !empty($products[0]['updated_timestamp']) ? $products[0]['updated_timestamp'] : TIME;
            $items_data = fn_format_products_items($products, $block_data['properties']['filling']['products'], $lang_code);
        }
    } else {
        //show rss feed for categories page
        list($items_data, $additional_data) = fn_format_categories_items($params, $lang_code);
    }
    fn_set_hook('generate_rss_feed', $items_data, $additional_data, $block_data, $lang_code);
    return array($items_data, $additional_data);
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:24,代码来源:rss.php


示例15: fn_get_banners

function fn_get_banners($params, $lang_code = CART_LANGUAGE)
{
    $default_params = array('items_per_page' => 0, 'sort_by' => 'name');
    $params = array_merge($default_params, $params);
    $sortings = array('timestamp' => '?:banners.timestamp', 'name' => '?:banner_descriptions.banner');
    $directions = array('asc' => 'asc', 'desc' => 'desc');
    $condition = $limit = '';
    if (!empty($params['limit'])) {
        $limit = db_quote(' LIMIT 0, ?i', $params['limit']);
    }
    if (empty($params['sort_order']) || empty($directions[$params['sort_order']])) {
        $params['sort_order'] = 'asc';
    }
    if (empty($params['sort_by']) || empty($sortings[$params['sort_by']])) {
        $params['sort_by'] = 'name';
    }
    $sorting = $sortings[$params['sort_by']] . ' ' . $directions[$params['sort_order']];
    $condition = AREA == 'A' ? '' : " AND ?:banners.status = 'A' ";
    $condition .= fn_get_localizations_condition('?:banners.localization');
    if (!empty($params['item_ids'])) {
        $condition .= db_quote(' AND ?:banners.banner_id IN (?n)', explode(',', $params['item_ids']));
    }
    if (!empty($params['period']) && $params['period'] != 'A') {
        list($params['time_from'], $params['time_to']) = fn_create_periods($params);
        $condition .= db_quote(" AND (?:banners.timestamp >= ?i AND ?:banners.timestamp <= ?i)", $params['time_from'], $params['time_to']);
    }
    $banners = db_get_array("SELECT ?:banners.banner_id, ?:banners.type, ?:banners.target, ?:banners.status, ?:banners.url, ?:banner_descriptions.banner, ?:banner_descriptions.description FROM ?:banners LEFT JOIN ?:banner_descriptions ON ?:banner_descriptions.banner_id = ?:banners.banner_id AND ?:banner_descriptions.lang_code = ?s WHERE 1 ?p ORDER BY ?p ?p", $lang_code, $condition, $sorting, $limit);
    foreach ($banners as $k => $v) {
        $banners[$k]['main_pair'] = fn_get_image_pairs($v['banner_id'], 'banner', 'M', true, false, $lang_code);
    }
    if (!empty($params['item_ids'])) {
        $banners = fn_sort_by_ids($banners, explode(',', $params['item_ids']), 'banner_id');
    }
    fn_set_hook('get_banners', $banners);
    return array($banners, $params);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:36,代码来源:func.php


示例16: fn_get_storefront_url

/**
 * Gets storefront URL
 * @param string $protocol protocol (http/https/current)
 * @param integer $company_id company ID
 * @return string storefront URL
 */
function fn_get_storefront_url($protocol = 'current', $company_id = 0)
{
    $url = Registry::get('config.' . $protocol . '_location');
    /**
     * Changes storefront URL
     * @param string  $protocol   protocol (http/https/current)
     * @param integer $company_id company ID
     * @param string  $url        storefront URL
     */
    fn_set_hook('get_storefront_url', $protocol, $company_id, $url);
    return $url;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:18,代码来源:fn.control.php


示例17: getStyleFile

 /**
  * Gets style file path
  * @param  string $style_id style ID
  * @param  string $type     file type (less/css/png)
  * @return string style file path
  */
 public function getStyleFile($style_id, $type = 'less')
 {
     $path = $this->getStylesPath();
     /**
      * Modifies the path to style file
      *
      * @param object  $this Styles object
      * @param string  $path current path
      * @param string  $style_id style ID
      * @param string  $type file type
      */
     fn_set_hook('styles_get_style_file', $this, $path, $style_id, $type);
     return $path . '/' . $style_id . '.' . $type;
 }
开发者ID:askzap,项目名称:ask-zap,代码行数:20,代码来源:Styles.php


示例18: fn_update_product_filter

function fn_update_product_filter($filter_data, $filter_id, $lang_code = DESCR_SL)
{
    if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
        if (!empty($filter_id) && !fn_check_company_id('product_filters', 'filter_id', $filter_id)) {
            fn_company_access_denied_notification();
            return false;
        }
        if (!empty($filter_id)) {
            unset($filter_data['company_id']);
        }
    }
    // Parse filter type
    if (strpos($filter_data['filter_type'], 'FF-') === 0 || strpos($filter_data['filter_type'], 'RF-') === 0 || strpos($filter_data['filter_type'], 'DF-') === 0) {
        $filter_data['feature_id'] = str_replace(array('RF-', 'FF-', 'DF-'), '', $filter_data['filter_type']);
        $filter_data['feature_type'] = db_get_field("SELECT feature_type FROM ?:product_features WHERE feature_id = ?i", $filter_data['feature_id']);
    } else {
        $filter_data['field_type'] = str_replace(array('R-', 'B-'), '', $filter_data['filter_type']);
        $filter_fields = fn_get_product_filter_fields();
    }
    if (!empty($filter_id)) {
        db_query('UPDATE ?:product_filters SET ?u WHERE filter_id = ?i', $filter_data, $filter_id);
        db_query('UPDATE ?:product_filter_descriptions SET ?u WHERE filter_id = ?i AND lang_code = ?s', $filter_data, $filter_id, $lang_code);
    } else {
        $filter_data['filter_id'] = $filter_id = db_query('INSERT INTO ?:product_filters ?e', $filter_data);
        foreach (fn_get_translation_languages() as $filter_data['lang_code'] => $_d) {
            db_query("INSERT INTO ?:product_filter_descriptions ?e", $filter_data);
        }
    }
    fn_set_hook('update_product_filter', $filter_data, $filter_id, $lang_code);
    return $filter_id;
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:product_filters.php


示例19: fn_check_uploaded_data

/**
 * Checks uploaded file can be processed
 * @param array $uploaded_data uploaded file data
 * @param array $filter_by_ext allowed file extensions
 * @return boolean true if file can be processed, false - otherwise
 */
function fn_check_uploaded_data($uploaded_data, $filter_by_ext)
{
    $result = true;
    $processed = false;
    /**
     * Actions before check uploaded data
     *
     * @param array $uploaded_data Uploaded data
     * @param array $filter_by_ext Allowed file extensions
     * @param bool  $result        Result status
     * @param bool  $processed     Processed flag
     */
    fn_set_hook('check_uploaded_data_pre', $uploaded_data, $filter_by_ext, $result, $processed);
    if ($processed) {
        return $result;
    }
    if (!empty($uploaded_data) && is_array($uploaded_data) && !empty($uploaded_data['name'])) {
        $ext = fn_get_file_ext($uploaded_data['name']);
        if (empty($ext)) {
            $types = fn_get_ext_mime_types('mime');
            $mime = fn_get_mime_content_type($uploaded_data['path']);
            $ext = isset($types[$mime]) ? $types[$mime] : '';
        }
        if (!$processed && !empty($filter_by_ext) && !in_array(fn_strtolower($ext), $filter_by_ext)) {
            fn_set_notification('E', __('error'), __('text_not_allowed_to_upload_file_extension', array('[ext]' => $ext)));
            $result = false;
            $processed = true;
        }
        if (!$processed && in_array(fn_strtolower($ext), Registry::get('config.forbidden_file_extensions'))) {
            fn_set_notification('E', __('error'), __('text_forbidden_file_extension', array('[ext]' => $ext)));
            $result = false;
            $processed = true;
        }
        $mime_type = fn_get_mime_content_type($uploaded_data['path'], true, 'text/plain');
        if (!$processed && !empty($uploaded_data['path']) && in_array($mime_type, Registry::get('config.forbidden_mime_types'))) {
            fn_set_notification('E', __('error'), __('text_forbidden_file_mime', array('[mime]' => $mime_type)));
            $result = false;
            $processed = true;
        }
    }
    /**
     * Actions after check uploaded data
     *
     * @param array $uploaded_data Uploaded data
     * @param array $filter_by_ext Allowed file extensions
     * @param bool  $result        Result status
     * @param bool  $processed     Processed flag
     */
    fn_set_hook('check_uploaded_data_post', $uploaded_data, $filter_by_ext, $result, $processed);
    return $result;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:57,代码来源:fn.fs.php


示例20: fn_auth_routines

function fn_auth_routines($request)
{
    $status = true;
    $user_login = $_REQUEST['user_login'];
    $password = $_POST['password'];
    $field = Registry::get('settings.General.use_email_as_login') == 'Y' ? 'email' : 'user_login';
    $user_data = db_get_row("SELECT * FROM ?:users WHERE {$field} = ?s", $user_login);
    if (!empty($user_data)) {
        $user_data['usergroups'] = fn_get_user_usergroups($user_data['user_id']);
    }
    fn_set_hook('auth_routines', $status, $user_data);
    if (!empty($user_data['user_type']) && $user_data['user_type'] != 'A' && AREA == 'A') {
        fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('error_area_access_denied'));
        $status = false;
    }
    if (!empty($user_data['status']) && $user_data['status'] == 'D') {
        fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('error_account_disabled'));
        $status = false;
    }
    return array($status, $user_data, $user_login, $password);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:21,代码来源:auth.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fn_set_notification函数代码示例发布时间:2022-05-15
下一篇:
PHP fn_save_post_data函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap