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


PHP cw_get_langvar_by_name函数代码示例

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


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

示例1: cw_error_check

function cw_error_check(&$array_to_check, $rules, $attributes_type = '')
{
    $error = array();
    $index = 1;
    foreach ($rules as $k => $v) {
        $func = is_array($v) && isset($v['func']) ? $v['func'] : $v;
        if ($func && function_exists($func)) {
            $is_error = $func($array_to_check[$k], $k, $array_to_check);
        } else {
            $is_error = empty($array_to_check[$k]) || !$array_to_check[$k];
        }
        if ($is_error) {
            $var = 'err_field_' . ($v['lng'] ? $v['lng'] : $k);
            $lng = cw_get_langvar_by_name($var, '', false, true);
            $error[] = $index++ . '. ' . ($lng ? $lng : $var);
        }
    }
    if ($attributes_type) {
        $error = array_merge($error, cw_call('cw_attributes_check', array($array_to_check['attribute_class_id'], &$array_to_check['attributes'], $attributes_type, $index)));
    }
    if (!count($error)) {
        return false;
    }
    return implode("<br/>\n", $error);
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:25,代码来源:cw.error.php

示例2: cw_ac_tabs_js_abstract

function cw_ac_tabs_js_abstract($params, $return)
{
    if ($return['name'] == 'product_data') {
        if (!isset($return['js_tabs']['accessories'])) {
            $return['js_tabs']['accessories'] = array('title' => cw_get_langvar_by_name('lbl_ac_accessories'), 'template' => 'addons/accessories/product_modify_accessories.tpl');
        }
        if (!isset($return['js_tabs']['upselling'])) {
            $return['js_tabs']['upselling'] = array('title' => cw_get_langvar_by_name('lbl_upselling_links'), 'template' => 'addons/accessories/product_modify_upselling.tpl');
        }
    }
    if ($return['name'] == 'product_data_customer') {
        global $product_accessories, $recommended_products;
        if (!isset($return['js_tabs']['accessories']) && !empty($product_accessories)) {
            $return['js_tabs']['accessories'] = array('title' => cw_get_langvar_by_name('lbl_ac_accessories'), 'template' => 'addons/accessories/product_accessories_list.tpl');
        }
        /*
                if (!isset($return['js_tabs']['accessories_rec']) && !empty($recommended_products)) {
                    $return['js_tabs']['accessories_rec'] = array(
                        'title' => cw_get_langvar_by_name('lbl_ac_recommended_products'),
                        'template' => 'addons/accessories/product_recommended_list.tpl',
                    );
                }
        */
    }
    return $return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:26,代码来源:func.hooks.php

示例3: cw_in_images_get_image_info

function cw_in_images_get_image_info($image_id, $title)
{
    global $tables;
    $tmp = cw_query_first("select * from {$tables['webmaster_images']} where id='{$image_id}'");
    $tmp = cw_image_info('webmaster_images', $tmp);
    $tmp['id'] = $image_id;
    $tmp['title'] = cw_get_langvar_by_name('image_' . $title);
    return $tmp;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:9,代码来源:cw.in_images.php

示例4: cw_config_process_options

function cw_config_process_options($options)
{
    global $tables;
    if ($options) {
        foreach ($options as $k => $v) {
            switch ($v['name']) {
                case 'cmpi_currency':
                    $currs = cw_query_hash("SELECT code, name FROM {$tables['currencies']}", "code", false, true);
                    if (empty($currs)) {
                        unset($options[$k]);
                        continue;
                    }
                    $v['variants'] = "";
                    foreach ($currs as $ek => $ev) {
                        $v['variants'] .= $ek . ":({$ek}) " . $ev . "\n";
                    }
                    break;
            }
            if (in_array($v['type'], array("selector", "multiselector"))) {
                if (empty($v['variants'])) {
                    unset($options[$k]);
                    continue;
                }
                $vars = cw_parse_str(trim($v['variants']), "\n", ":");
                $vars = cw_array_map("trim", $vars);
                if ($v['type'] == "multiselector") {
                    $v['value'] = explode(";", $v['value']);
                    foreach ($v['value'] as $vk => $vv) {
                        if (!isset($vars[$vv])) {
                            unset($v['value'][$vk]);
                        }
                    }
                    $options[$k]['value'] = $v['value'] = array_values($v['value']);
                }
                $options[$k]['variants'] = array();
                foreach ($vars as $vk => $vv) {
                    $options[$k]['variants'][$vk] = array("name" => $vv);
                    if (strpos($vv, " ") === false) {
                        $name = cw_get_langvar_by_name($vv, NULL, false, true);
                        if (!empty($name)) {
                            $options[$k]['variants'][$vk] = array("name" => $name);
                        }
                    }
                    if ($v['type'] == "selector") {
                        $options[$k]['variants'][$vk]['selected'] = $v['value'] == $vk;
                    } else {
                        $options[$k]['variants'][$vk]['selected'] = in_array($vk, $v['value']);
                    }
                }
            }
            if (in_array($v['type'], array('shipping', 'memberships', 'doc_status'))) {
                $options[$k]['value'] = unserialize($v['value']);
            }
        }
    }
    return $options;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:57,代码来源:cw.config.php

示例5: cw_order_messages_tabs_js_abstract

function cw_order_messages_tabs_js_abstract($params, $return)
{
    if ($return['name'] == 'doc_O_info') {
        if (AREA_TYPE != 'A') {
            return $return;
        }
        $return['js_tabs']['order_messages'] = array('title' => cw_get_langvar_by_name('lbl_messages'), 'template' => 'addons/order_messages/doc_O_info.tpl');
    }
    return $return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:10,代码来源:func.php

示例6: cw_dpi_tabs_js_abstract

function cw_dpi_tabs_js_abstract($params, $return)
{
    if ($return['name'] == 'product_data') {
        if (AREA_TYPE != 'A') {
            return $return;
        }
        if (!isset($return['js_tabs']['dpi'])) {
            $return['js_tabs']['dpi'] = array('title' => cw_get_langvar_by_name('lbl_detailed_images'), 'template' => 'addons/detailed_product_images/product_images_modify.tpl');
        }
    }
    return $return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:12,代码来源:func.hooks.php

示例7: cw_product_options_tabs_js_abstract

function cw_product_options_tabs_js_abstract($params, $return)
{
    if ($return['name'] == 'product_data') {
        if (AREA_TYPE != 'A') {
            return $return;
        }
        $return['js_tabs']['product_options'] = array('title' => cw_get_langvar_by_name('lbl_product_options'), 'template' => 'addons/product_options/main/products/product/options.tpl');
        # kornev, need a condition here
        $return['js_tabs']['product_variants'] = array('title' => cw_get_langvar_by_name('lbl_product_variants'), 'template' => 'addons/product_options/main/products/product/variants.tpl');
    }
    return $return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:12,代码来源:func.product_options.php

示例8: tabs_js_abstract

function tabs_js_abstract($params, $return)
{
    if ($return['name'] == 'product_data') {
        if (AREA_TYPE != 'A') {
            return $return;
        }
        if (!isset($return['js_tabs']['cms'])) {
            $return['js_tabs']['cms'] = array('title' => cw_get_langvar_by_name('lbl_cs_content_sections'), 'template' => 'addons/cms/product_banners.tpl');
        }
    }
    return $return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:12,代码来源:func.hooks.php

示例9: cw_tabs_js_abstract

/**
 * Declare product tabs
 * 
 * @see cw_tabs_js_abstract
 * 
 * @param OLD params notation
 */
function cw_tabs_js_abstract($params, $return)
{
    global $product_video;
    if ($return['name'] == 'product_data' && AREA_TYPE == 'A') {
        if (!isset($return['js_tabs']['product_video'])) {
            $return['js_tabs']['product_video'] = array('title' => cw_get_langvar_by_name('lbl_product_video'), 'template' => 'addons/' . addon_name . '/admin/product.tpl');
        }
    }
    if ($return['name'] == 'product_data_customer' && !empty($product_video) && AREA_TYPE == 'C') {
        $return['js_tabs']['product_data'] = array('title' => cw_get_langvar_by_name('lbl_product_video'), 'template' => 'addons/' . addon_name . '/customer/product.tpl');
    }
    return $return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:20,代码来源:func.php

示例10: smarty_function_lng

function smarty_function_lng($params, &$smarty)
{
    extract($params);
    if (empty($name)) {
        $smarty->trigger_error("lng: missing 'name' parameter");
        return;
    }
    if ($assign) {
        $smarty->assign($assign, cw_get_langvar_by_name($name));
    } else {
        return cw_get_langvar_by_name($name);
    }
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:13,代码来源:function.lng.php

示例11: cw_csv2table

function cw_csv2table($fn, $delimiter = '')
{
    global $tables;
    $h = fopen($fn, 'r');
    $tab = '';
    $fields = '';
    $brf_err = cw_get_langvar_by_name('lbl_imp_err_br_file');
    $wrtab_err = cw_get_langvar_by_name('lbl_imp_err_tab_not_exst');
    while ($tab == '') {
        $tab = trim(fgets($h));
    }
    if (!preg_match("'^\\[[^\\s]*\\]\$'i", $tab)) {
        return $brf_err;
    }
    $tab = preg_replace("'^\\[(.*)\\]\$'i", "\$1", $tab);
    if (!isset($tables[$tab])) {
        return $wrtab_err;
    }
    while ($fields == '') {
        $fields = trim(fgets($h));
    }
    if (!preg_match("'^\\![^\\s\\!]+\\!.+'i", $fields)) {
        return $brf_err;
    }
    if ($delimiter == '') {
        $delimiter = preg_replace("'^\\![^\\s\\!]+(.)\\!.+'", "\$1", $fields);
    }
    $fields = explode($delimiter, $fields);
    foreach ($fields as $k => $v) {
        if (!preg_match("'^\\![^\\s]+\$'i", trim($v))) {
            return $brf_err;
        }
        $v = preg_replace("'^\\!(.*)\$'", "\$1", trim($v));
        $fields[$k] = $v;
    }
    while (($data = fgetcsv($h, 0, $delimiter)) !== false) {
        if (sizeof($data) != sizeof($fields)) {
            return $brf_err;
        }
        foreach ($fields as $k => $v) {
            $data2[$v] = $data[$k];
        }
        $arr[] = $data2;
    }
    db_query("TRUNCATE TABLE {$tables[$tab]}");
    foreach ($arr as $data) {
        cw_array2insert_esc($tab, $data);
    }
    return true;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:50,代码来源:cw.import_export_csv.php

示例12: dashboard_action_update

function dashboard_action_update()
{
    if ($_SERVER['REQUEST_METHOD'] != 'POST') {
        dashboard_redirect();
    }
    $dashboard = $_POST['dashboard'];
    if (empty($dashboard)) {
        dashboard_redirect();
    }
    foreach ($dashboard as $name => $dash) {
        $data = array('name' => $name, 'pos' => intval($dash['pos']), 'active' => intval($dash['active']));
        cw_array2insert('dashboard', $data, true);
    }
    $top_message = array('content' => cw_get_langvar_by_name('msg_ppd_filetypes_updated_succes'), 'type' => 'I');
    dashboard_redirect();
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:16,代码来源:configuration.php

示例13: ppd_get_pathto_file

function ppd_get_pathto_file($file = null)
{
    global $var_dirs, $config;
    static $files_dir;
    if (empty($file)) {
        return null;
    }
    if (!isset($files_dir)) {
        $files_dir = ppd_correct_dirname($config['ppd']['ppd_product_files_dir']);
    }
    $path = realpath($var_dirs['files'] . $files_dir . $file);
    if (empty($path)) {
        $path = cw_get_langvar_by_name('txt_ppd_file_not_found');
    }
    return $path;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:16,代码来源:func.php

示例14: cw_is_catalog_product

function cw_is_catalog_product(&$params)
{
    $product = $params;
    if (empty($params['product_id'])) {
        // function is called from smarty
        global $smarty;
        $smarty_product = $smarty->get_template_vars('product');
        if ($smarty_product) {
            $product = $smarty_product;
            if ($product['product_type'] == PRODUCT_TYPE_CATALOG) {
                $params['button_title'] = cw_get_langvar_by_name('lbl_catalog_product_button');
                $params['href'] = "index.php?target=catalog_redirect&product_id={$product['product_id']}";
            }
        }
        return false;
        // prevent real template replacement because href is already replaced
    }
    return $product['product_type'] == PRODUCT_TYPE_CATALOG;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:19,代码来源:func.php

示例15: cw_tabs_get_section_tabs

function cw_tabs_get_section_tabs($section_id, $first = false)
{
    global $tables, $accl;
    $tabs = cw_query("select nt.*, n.visible, n.target from {$tables['navigation_tabs']} as nt, {$tables['navigation_targets']} as n left join {$tables['addons']} as m on m.addon=n.addon where (m.active or (m.addon is null and n.addon='')) and nt.tab_id=n.tab_id and n.section_id='{$section_id}' order by nt.orderby");
    $return = array();
    if ($tabs) {
        foreach ($tabs as $k => $tab) {
            if ($tab['access_level'] && !$accl[$tab['access_level']]) {
                continue;
            }
            if ($first) {
                return $tab;
            }
            $return[$tab['tab_id']] = $tab;
            $return[$tab['tab_id']]['title_lng'] = cw_get_langvar_by_name($tab['title']);
        }
    }
    return $return;
}
开发者ID:CartworksPlatform,项目名称:cartworksplatform,代码行数:19,代码来源:cw.tabs.php


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