本文整理汇总了PHP中fn_get_file函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_file函数的具体用法?PHP fn_get_file怎么用?PHP fn_get_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_file函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
foreach ($patterns as $p_id => $p) {
Registry::set('navigation.tabs.' . $p_id, array('title' => $p['name'], 'href' => "exim.import?pattern_id=" . $p_id . '§ion=' . $_REQUEST['section'], 'ajax' => true));
}
Registry::set('navigation.dynamic.sections', $sections);
Registry::set('navigation.dynamic.active_section', $_REQUEST['section']);
unset($patterns[$pattern_id]['options']['lang_code']);
Tygh::$app['view']->assign('pattern', $patterns[$pattern_id]);
Tygh::$app['view']->assign('sections', $sections);
} elseif ($mode == 'get_file' && !empty($_REQUEST['filename'])) {
$file = fn_basename($_REQUEST['filename']);
if (!empty($_REQUEST['to_screen'])) {
header("Content-type: text/plain");
readfile(fn_get_files_dir_path() . $file);
exit;
} else {
fn_get_file(fn_get_files_dir_path() . $file);
}
} elseif ($mode == 'select_range') {
$_SESSION['export_ranges'][$_REQUEST['section']] = array('pattern_id' => $_REQUEST['pattern_id'], 'data' => array());
$pattern = fn_get_pattern_definition($_REQUEST['pattern_id']);
return array(CONTROLLER_STATUS_REDIRECT, $pattern['range_options']['selector_url']);
}
// --------- ExIm core functions ------------------
//
// Import data using pattern
// Parameters:
// @pattern - import/export pattern
// @import_data - data to import
// @options - import options
function fn_import($pattern, $import_data, $options)
{
示例2: export
//.........这里部分代码省略.........
list($values) = LanguageValues::getVariables(array(), 0, $lang_code);
foreach ($values as $_id => $value) {
$values[$_id]['msgctxt'] = 'Languages' . \I18n_Pofile::DELIMITER . $value['name'];
}
$values = fn_array_value_to_key($values, 'msgctxt');
$addons_lang_vars = array();
list($addons) = fn_get_addons(array('type' => 'installed'), 0, $lang_code);
foreach ($addons as $addon_id => $addon) {
$addons_lang_vars = array_merge($addons_lang_vars, self::exportAddonsPo($addon_id, $pack_path . 'addons/' . $addon_id . '.po', $lang_code, $values));
}
$original_values = self::getOriginalValues('Languages');
$values = array_diff_key($values, $addons_lang_vars);
foreach ($values as $_id => $value) {
$values[$_id]['original_value'] = isset($original_values['Languages::' . $value['name']]) ? $original_values['Languages::' . $value['name']]['msgid'] : '';
}
$values = Po::convert($values, array(), $allow_overlap);
list($values, $excluded) = self::excludeEditionVariables('Languages', $values, $mve_lang_variables);
Po::putValues('Languages', $values, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('Languages', $excluded, $mve_pack_path);
}
// Export Settings Sections
$sections = Settings::instance()->getCoreSections($lang_code);
$original_values = self::getOriginalValues('SettingsSections');
foreach ($sections as $_id => $value) {
$sections[$_id]['original_value'] = isset($original_values['SettingsSections::' . $value['section_id']]) ? $original_values['SettingsSections::' . $value['section_id']]['msgid'] : '';
}
$_sections = Po::convert($sections, array('id' => 'section_id', 'value' => 'description'), $allow_overlap);
list($_sections, $excluded) = self::excludeEditionVariables('SettingsSections', $_sections, $mve_lang_variables);
Po::putValues('SettingsSections', $_sections, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('SettingsSections', $excluded, $mve_pack_path);
}
unset($_sections);
$original_options = self::getOriginalValues('SettingsOptions');
$original_variants = self::getOriginalValues('SettingsVariants');
$original_tooltips = self::getOriginalValues('SettingsTooltips');
foreach ($sections as $section) {
$options = Settings::instance()->getList($section['object_id'], 0, false, null, $lang_code);
$_options = array();
$_tooltips = array();
foreach ($options['main'] as $option) {
$_options[] = array('name' => $option['name'], 'value' => $option['description'], 'original_value' => isset($original_options['SettingsOptions' . \I18n_Pofile::DELIMITER . $option['name']]) ? $original_options['SettingsOptions' . \I18n_Pofile::DELIMITER . $option['name']]['msgid'] : '');
if (!empty($option['variants'])) {
$_variants = array();
foreach ($option['variants'] as $variant_id => $variant) {
$_variants[] = array('name' => $variant_id, 'value' => $variant, 'original_value' => isset($original_variants['SettingsVariants' . \I18n_Pofile::DELIMITER . $option['name'] . \I18n_Pofile::DELIMITER . $variant_id]) ? $original_variants['SettingsVariants' . \I18n_Pofile::DELIMITER . $option['name'] . \I18n_Pofile::DELIMITER . $variant_id]['msgid'] : '');
}
$_variants = Po::convert($_variants, array(), $allow_overlap);
list($_variants, $excluded) = self::excludeEditionVariables('SettingsVariants', $_variants, $mve_lang_variables);
Po::putValues('SettingsVariants' . \I18n_Pofile::DELIMITER . $option['name'], $_variants, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('SettingsVariants', $excluded, $mve_pack_path);
}
unset($_variants);
}
if (!empty($option['tooltip'])) {
$_tooltips[] = array('name' => $option['name'], 'value' => $option['tooltip'], 'original_value' => isset($original_tooltips['SettingsTooltips' . \I18n_Pofile::DELIMITER . $option['name']]) ? $original_tooltips['SettingsTooltips' . \I18n_Pofile::DELIMITER . $option['name']]['msgid'] : '');
}
}
$_options = Po::convert($_options, array(), $allow_overlap);
list($_options, $excluded) = self::excludeEditionVariables('SettingsOptions', $_options, $mve_lang_variables);
Po::putValues('SettingsOptions', $_options, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('SettingsOptions', $excluded, $mve_pack_path);
}
$_tooltips = Po::convert($_tooltips, array(), $allow_overlap);
list($_tooltips, $excluded) = self::excludeEditionVariables('SettingsTooltips', $_tooltips, $mve_lang_variables);
Po::putValues('SettingsTooltips', $_tooltips, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('SettingsTooltips', $excluded, $mve_pack_path);
}
}
// Export Profile fields
$profile_fields = fn_get_profile_fields('ALL', array(), $lang_code);
$original_values = self::getOriginalValues('ProfileFields');
$values = array();
foreach ($profile_fields as $zone => $fields) {
foreach ($fields as $field_id => $field) {
$values[] = array('name' => $field['field_name'], 'value' => $field['description'], 'original_value' => isset($original_values['ProfileFields::' . $field['field_name']]) ? $original_values['ProfileFields::' . $field['field_name']]['msgid'] : '');
}
}
$values = Po::convert($values, array(), $allow_overlap);
list($values, $excluded) = self::excludeEditionVariables('ProfileFields', $values, $mve_lang_variables);
Po::putValues('ProfileFields', $values, $core_pack_path);
if (!empty($excluded)) {
Po::putValues('ProfileFields', $excluded, $mve_pack_path);
}
fn_compress_files($lang_code . '.zip', './', $pack_path);
$filename = $pack_path . $lang_code . '.zip';
switch ($output) {
case 'server':
fn_copy($filename, Registry::get('config.dir.lang_packs') . $lang_code . '.zip');
break;
case 'download':
fn_get_file($filename, $lang_code . '.zip');
break;
}
return true;
}
示例3: die
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if ($mode == 'qwintry_create_shipment') {
$order_info = fn_get_order_info($_REQUEST['order_id']);
$result = fn_qwintry_create_shipment($order_info, $_REQUEST['qwintry_data']);
if ($result === true) {
fn_set_notification('N', __('notice'), __('done'));
} else {
fn_set_notification('E', __('error'), __('error_ajax', $result));
}
return array(CONTROLLER_STATUS_REDIRECT, 'orders.details?order_id=' . $_REQUEST['order_id']);
} elseif ($mode == 'qwintry_download_label') {
fn_get_file(QWINTRY_DIR_LABELS . $_REQUEST['order_id'] . '.pdf');
}
if ($mode == 'details') {
$order_info = fn_get_order_info($_REQUEST['order_id']);
foreach ($order_info['shipping'] as $shipping) {
if ($shipping['module'] == 'qwintry') {
$qwintry_data = $shipping;
}
}
if (!empty($qwintry_data) && !fn_qwintry_check_label($order_info['order_id'])) {
$navigation_tabs = Registry::get('navigation.tabs');
$navigation_tabs['qwintry'] = array('title' => __('qwintry_air'), 'js' => true);
Registry::set('navigation.tabs', $navigation_tabs);
Registry::get('view')->assign('qwintry_data', $qwintry_data);
}
}
示例4: array
}
}
if (!empty($data_shipments)) {
Registry::set('navigation.tabs.sdek_orders', array('title' => __('shippings.sdek.sdek_orders'), 'js' => true));
Tygh::$app['view']->assign('data_shipments', $data_shipments);
Tygh::$app['view']->assign('sdek_pvz', $sdek_pvz);
Tygh::$app['view']->assign('rec_city_code', $rec_city_code);
Tygh::$app['view']->assign('order_id', $params['order_id']);
}
}
}
} elseif ($mode == 'sdek_get_ticket') {
$params = $_REQUEST;
$file = $params['order_id'] . '.pdf';
$path = fn_get_files_dir_path() . 'sdek/' . $params['shipment_id'] . '/';
fn_get_file($path . $file);
if (defined('AJAX_REQUEST') && !empty($url)) {
Registry::get('ajax')->assign('force_redirection', $url);
exit;
}
return array(CONTROLLER_STATUS_OK);
}
function fn_sdek_get_ticket_order($data_auth, $order_id, $chek_id)
{
unset($data_auth['Number']);
$xml = ' ' . RusSdek::arraySimpleXml('OrdersPrint', $data_auth, 'open');
$order_sdek = array('Number' => $order_id . '_' . $chek_id, 'Date' => $data_auth['Date']);
$xml .= ' ' . RusSdek::arraySimpleXml('Order', $order_sdek);
$xml .= ' ' . '</OrdersPrint>';
$response = RusSdek::xmlRequest('http://gw.edostavka.ru:11443/orders_print.php', $xml, $data_auth);
$download_file_dir = fn_get_files_dir_path() . '/sdek' . '/' . $chek_id . '/';
示例5: die
/***************************************************************************
* *
* (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev *
* *
* This is commercial software, only users who have purchased a valid *
* license and accept to the terms of the License Agreement can install *
* and use this program. *
* *
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if ($mode == 'get') {
$schema = fn_get_schema('price_list', 'schema');
if (empty($_REQUEST['display']) || empty($schema['types'][$_REQUEST['display']])) {
return array(CONTROLLER_STATUS_NO_PAGE);
}
$class_name = '\\Tygh\\PriceList\\' . fn_camelize($_REQUEST['display']);
if (class_exists($class_name)) {
$generator = new $class_name();
$filename = $generator->getFileName();
if (file_exists($filename)) {
fn_get_file($filename, 'price_list.' . $schema['types'][$_REQUEST['display']]['extension']);
}
}
}
示例6: fn_update_attachments
//
// Update attachments
//
if ($mode == 'update') {
if (!empty($_REQUEST['attachment_data'])) {
fn_update_attachments($_REQUEST['attachment_data'], $_REQUEST['attachment_id'], $_REQUEST['object_type'], $_REQUEST['object_id']);
}
}
return array(CONTROLLER_STATUS_OK);
// redirect should be performed via redirect_url always
}
if ($mode == 'getfile') {
if (!empty($_REQUEST['attachment_id']) && !empty($_REQUEST['object_type']) && !empty($_REQUEST['object_id'])) {
$data = fn_get_attachment($_REQUEST['attachment_id'], $_REQUEST['object_type'], $_REQUEST['object_id']);
if (!empty($data['path'])) {
fn_get_file($data['path']);
}
}
exit;
} elseif ($mode == 'delete') {
fn_delete_attachments(array($_REQUEST['attachment_id']), $_REQUEST['object_type'], $_REQUEST['object_id']);
$attachments = fn_get_attachments($_REQUEST['object_type'], $_REQUEST['object_id']);
if (empty($attachments)) {
$view->display('addons/attachments/views/attachments/manage.tpl');
}
exit;
} elseif ($mode == 'update') {
// Assign attachments files for products
$attachments = fn_get_attachments($_REQUEST['object_type'], $_REQUEST['object_id']);
Registry::set('navigation.tabs.attachments', array('title' => fn_get_lang_var('attachments'), 'js' => true));
$view->assign('attachments', $attachments);
示例7: get
/**
* Push file contents to browser
*
* @param string $file file to push
* @param string $filename file name to be displayed in download dialog
* @return void
*/
public function get($file, $filename = '')
{
fn_get_file($this->prefix($file), $filename);
}
示例8: elseif
Tygh::$app['view']->assign('extra_id', $_REQUEST['extra_id']);
}
$block_types = SchemesManager::getBlockDescriptions($block_types, DESCR_SL);
Tygh::$app['view']->assign('block_types', $block_types);
Tygh::$app['view']->assign('unique_blocks', $unique_blocks);
} elseif ($mode == 'get_file' && !empty($_REQUEST['filename'])) {
$file = fn_basename($_REQUEST['filename']);
if (Registry::get('runtime.company_id')) {
$file = Registry::get('runtime.company_id') . '/' . $file;
}
if (!empty($_REQUEST['to_screen'])) {
header("Content-type: text/xml");
readfile(Registry::get('config.dir.layouts') . $file);
exit;
} else {
fn_get_file(Registry::get('config.dir.layouts') . $file);
}
} elseif ($mode == 'show_objects') {
if (!empty($_REQUEST['object_type']) && !empty($_REQUEST['block_id'])) {
Tygh::$app['view']->assign('object_type', $_REQUEST['object_type']);
Tygh::$app['view']->assign('block_id', $_REQUEST['block_id']);
Tygh::$app['view']->assign('object_ids', Block::instance()->getChangedContentsIds($_REQUEST['object_type'], $_REQUEST['block_id']));
Tygh::$app['view']->assign('params', array('type' => 'links'));
Tygh::$app['view']->assign('dynamic_object_scheme', SchemesManager::getDynamicObjectByType($_REQUEST['object_type'], $_REQUEST));
}
}
function fn_get_selected_location($params)
{
if (isset($params['selected_location']) && !empty($params['selected_location'])) {
$selected_location = Location::instance()->getById($params['selected_location'], DESCR_SL);
} else {
示例9: fn_save_cart_content
fn_save_cart_content($cart, $auth['user_id']);
$cart['recalculate'] = true;
if (defined('AJAX_REQUEST')) {
fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('text_product_has_been_deleted'));
if ($action == 'from_status') {
fn_calculate_cart_content($cart, $auth, 'S', true, 'F', true);
$view->assign('force_items_deletion', true);
$view->display('views/checkout/components/cart_status.tpl');
exit;
}
}
return array(CONTROLLER_STATUS_REDIRECT, "checkout." . $_REQUEST['redirect_mode']);
} elseif ($mode == 'get_custom_file' && isset($_REQUEST['cart_id']) && isset($_REQUEST['option_id']) && isset($_REQUEST['file'])) {
if (isset($cart['products'][$_REQUEST['cart_id']]['extra']['custom_files'][$_REQUEST['option_id']][$_REQUEST['file']])) {
$file = $cart['products'][$_REQUEST['cart_id']]['extra']['custom_files'][$_REQUEST['option_id']][$_REQUEST['file']];
fn_get_file($file['path'], $file['name']);
}
} elseif ($mode == 'delete_file' && isset($_REQUEST['cart_id'])) {
if (isset($cart['products'][$_REQUEST['cart_id']]['extra']['custom_files'][$_REQUEST['option_id']][$_REQUEST['file']])) {
// Delete saved custom file
$file = $cart['products'][$_REQUEST['cart_id']]['extra']['custom_files'][$_REQUEST['option_id']][$_REQUEST['file']];
@unlink($file['path']);
@unlink($file['path'] . '_thumb');
unset($cart['products'][$_REQUEST['cart_id']]['extra']['custom_files'][$_REQUEST['option_id']][$_REQUEST['file']]);
}
fn_save_cart_content($cart, $auth['user_id']);
$cart['recalculate'] = true;
if (defined('AJAX_REQUEST')) {
fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('text_product_file_has_been_deleted'));
if ($action == 'from_status') {
fn_calculate_cart_content($cart, $auth, 'S', true, 'F', true);
示例10: elseif
} elseif ($mode == 'chmod') {
$file = basename($_REQUEST['file']);
$fname = fn_normalize_path(DIR_SKINS . $current_path . $file);
if ($r == 'Y') {
$res = fn_rchmod($fname, octdec($_REQUEST['perms']));
} else {
$res = @chmod($fname, octdec($_REQUEST['perms']));
}
fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var($res ? 'text_permissions_changed' : 'error_permissions_not_changed'));
Registry::get('ajax')->assign('action_type', $res ? '' : 'error');
exit;
} elseif ($mode == 'get_file') {
$file = basename($_REQUEST['file']);
if (!in_array(fn_get_file_ext($file), Registry::get('config.forbidden_file_extensions'))) {
$pname = fn_normalize_path(DIR_SKINS . $current_path);
fn_get_file($pname . $file);
}
exit;
} elseif ($mode == 'edit') {
$file = basename($_REQUEST['file']);
$fname = fn_normalize_path(DIR_SKINS . $current_path . $file);
if (!in_array(fn_get_file_ext($fname), Registry::get('config.forbidden_file_extensions'))) {
if (fn_get_image_size($fname)) {
$ajax->assign('img', Registry::get('config.http_location') . str_replace(DIR_ROOT, '', $fname));
} else {
$ajax->assign('content', fn_get_contents($fname));
}
}
exit;
} elseif ($mode == 'restore') {
$copied = false;
示例11: fn_echo
if (!empty($fields['is_global'])) {
// Sort table by is_global field
fn_echo(fn_get_lang_var('sorting_data') . " <b>{$table}</b>...<br />");
db_query("ALTER TABLE {$table} ORDER BY is_global DESC");
} elseif (!empty($fields['position'])) {
// Sort table by position field
fn_echo(fn_get_lang_var('sorting_data') . " <b>{$table}</b>...<br />");
db_query("ALTER TABLE {$table} ORDER BY position");
}
}
fn_stop_scroller();
}
return array(CONTROLLER_STATUS_OK, "database.manage{$suffix}");
}
if ($mode == 'getfile' && !empty($_REQUEST['file'])) {
fn_get_file(DIR_DATABASE . 'backup/' . basename($_REQUEST['file']));
} elseif ($mode == 'manage') {
Registry::set('navigation.tabs', array('backup' => array('title' => fn_get_lang_var('backup'), 'js' => true), 'restore' => array('title' => fn_get_lang_var('restore'), 'js' => true), 'maintenance' => array('title' => fn_get_lang_var('maintenance'), 'js' => true)));
// Calculate database size and fill tables array
$status_data = db_get_array("SHOW TABLE STATUS");
$database_size = 0;
$all_tables = array();
foreach ($status_data as $k => $v) {
$database_size += $v['Data_length'] + $v['Index_length'];
$all_tables[] = $v['Name'];
}
$view->assign('database_size', $database_size);
$view->assign('all_tables', $all_tables);
$files = fn_get_dir_contents(DIR_DATABASE . 'backup', false, true, array('.sql', '.tgz'));
sort($files, SORT_STRING);
$backup_files = array();
示例12: db_get_field
echo ' .';
$google_info_new = db_get_field("SELECT data FROM ?:order_data WHERE order_id = ?i AND type = ?s", $_REQUEST['order_id'], GOOGLE_ORDER_DATA);
if ($google_info_new != $_SESSION['google_info']) {
unset($_SESSION['google_info']);
return array(CONTROLLER_STATUS_REDIRECT, "orders.details?order_id={$_REQUEST['order_id']}");
}
sleep(1);
} while (time() - TIME < 59);
return array(CONTROLLER_STATUS_REDIRECT, "orders.google.wait_response?order_id={$_REQUEST['order_id']}");
}
} elseif ($mode == 'get_custom_file') {
if (!empty($_REQUEST['file']) && !empty($_REQUEST['order_id'])) {
$file_path = DIR_CUSTOM_FILES . 'order_data/' . $_REQUEST['order_id'] . '/' . $_REQUEST['file'];
if (file_exists($file_path)) {
$filename = !empty($_REQUEST['filename']) ? $_REQUEST['filename'] : '';
fn_get_file($file_path, $filename);
}
}
}
//
// Calculate gross total and totally paid values for the current set of orders
//
function fn_display_order_totals($orders)
{
$result = array();
$result['gross_total'] = 0;
$result['totally_paid'] = 0;
if (is_array($orders)) {
foreach ($orders as $k => $v) {
$result['gross_total'] += $v['total'];
if ($v['status'] == 'C' || $v['status'] == 'P') {
示例13: array
return array(CONTROLLER_STATUS_REDIRECT, "products.manage");
} elseif ($mode == 'getfile') {
if (!empty($_REQUEST['file_id'])) {
$revisions = Registry::get('revisions');
if (!empty($revisions['objects']['product']['tables'])) {
$revision_subdir = '_rev';
} else {
$revision_subdir = '';
}
if (empty($_REQUEST['file_type'])) {
$column = 'file_path';
} else {
$column = 'preview_path';
}
$file_path = db_get_row("SELECT {$column}, product_id FROM ?:product_files WHERE file_id = ?i", $_REQUEST['file_id']);
fn_get_file(DIR_DOWNLOADS . $file_path['product_id'] . '/' . $file_path[$column]);
}
} elseif ($mode == 'clone') {
if (!empty($_REQUEST['product_id'])) {
$pid = $_REQUEST['product_id'];
$pdata = fn_clone_product($pid);
if (!empty($pdata['product_id'])) {
$pid = $pdata['product_id'];
$msg = fn_get_lang_var('text_product_cloned');
$msg = str_replace('[product]', $pdata['orig_name'], $msg);
fn_set_notification('N', fn_get_lang_var('notice'), $msg);
}
return array(CONTROLLER_STATUS_REDIRECT, "products.update?product_id={$pid}");
}
} elseif ($mode == 'delete_file') {
if (!empty($_REQUEST['file_id'])) {
示例14: array
Registry::get('view')->assign('pattern', $pattern);
if (empty($datafeed_data['datafeed_id'])) {
return array(CONTROLLER_STATUS_NO_PAGE);
}
Registry::get('view')->assign('export_fields', $pattern['export_fields']);
Registry::get('view')->assign('feature_fields', fn_data_feeds_get_features_fields());
// [Page sections]
Registry::set('navigation.tabs', array('detailed' => array('title' => __('general'), 'js' => true), 'exported_items' => array('title' => __('exported_items'), 'js' => true), 'fields' => array('title' => __('map_fields'), 'js' => true)));
// [/Page sections]
} elseif ($mode == 'download') {
$params['datafeed_id'] = $_REQUEST['datafeed_id'];
$params['single'] = true;
$datafeed_data = fn_data_feeds_get_data($params, DESCR_SL);
$filename = fn_get_files_dir_path() . $datafeed_data['file_name'];
if (file_exists($filename)) {
fn_get_file($filename);
}
exit;
}
function fn_data_feeds_update_feed($feed_data, $feed_id = 0, $lang_code = CART_LANGUAGE)
{
if (!empty($feed_data['fields'])) {
$_fields = array();
foreach ($feed_data['fields'] as $key => $field) {
if (empty($field['export_field_name'])) {
unset($feed_data['fields'][$key]);
} else {
$_fields[intval($field['position'])][] = $field;
}
}
}
示例15: list
$_REQUEST['section'] = 'products';
}
list($sections, $patterns) = fn_get_patterns($_REQUEST['section'], 'import');
$pattern_id = empty($_REQUEST['pattern_id']) ? key($patterns) : $_REQUEST['pattern_id'];
$patterns = $parser->enchancePattern($patterns);
foreach ($patterns as $p_id => $p) {
Registry::set('navigation.tabs.' . $p_id, array('title' => $p['name'], 'href' => "exim.import?pattern_id=" . $p_id . '§ion=' . $_REQUEST['section'], 'ajax' => true));
}
Registry::set('navigation.dynamic.sections', $sections);
Registry::set('navigation.dynamic.active_section', $_REQUEST['section']);
$patterns['product_images']['analogs_dev'] = 1;
$view->assign('pattern', $patterns[$pattern_id]);
$view->assign('sections', $sections);
} elseif ($mode == 'get_file' && !empty($_REQUEST['filename'])) {
$file = basename($_REQUEST['filename']);
fn_get_file(DIR_EXIM . $file);
} elseif ($mode == 'delete_file' && !empty($_REQUEST['filename'])) {
$file = basename($_REQUEST['filename']);
fn_rm(DIR_EXIM . $file);
return array(CONTROLLER_STATUS_REDIRECT);
} elseif ($mode == 'delete_range') {
unset($_SESSION['export_ranges'][$_REQUEST['section']]);
return array(CONTROLLER_STATUS_REDIRECT, "exim.export?section={$_REQUEST['section']}&pattern_id={$_REQUEST['pattern_id']}");
} elseif ($mode == 'select_range') {
$_SESSION['export_ranges'][$_REQUEST['section']] = array('pattern_id' => $_REQUEST['pattern_id'], 'data' => array());
$pattern = fn_get_pattern_definition($_REQUEST['pattern_id']);
return array(CONTROLLER_STATUS_REDIRECT, $pattern['range_options']['selector_url']);
} elseif ($mode == 'export_simple') {
$products = db_get_array("SELECT `product_id`, `product_code` FROM `cscart_products`");
$date = date('d-m-Y');
$myFile = '' . DIR_EXIM . 'simple_products_' . $date . '.csv';