コード例 #1
0
ファイル: products.php プロジェクト: arpad9/bygmarket
        } elseif (!empty($field_groups['L'][$field])) {
            $filled_groups['L'][$field] = __($desc);
            continue;
        } elseif (!empty($field_groups['W'][$field])) {
            $filled_groups['W'][$field] = __($desc);
            continue;
        }
        $field_names[$field] = __($desc);
    }
    ksort($filled_groups, SORT_STRING);
    Tygh::$app['view']->assign('field_groups', $field_groups);
    Tygh::$app['view']->assign('filled_groups', $filled_groups);
    Tygh::$app['view']->assign('field_names', $field_names);
    Tygh::$app['view']->assign('products_data', $products_data);
} elseif ($mode == 'get_file') {
    if (fn_get_product_file($_REQUEST['file_id'], !empty($_REQUEST['file_type'])) == false) {
        return array(CONTROLLER_STATUS_DENIED);
    }
    exit;
} elseif ($mode == 'update_file') {
    if (!empty($_REQUEST['product_id'])) {
        if (!empty($_REQUEST['file_id'])) {
            $params = array('product_id' => $_REQUEST['product_id'], 'file_ids' => $_REQUEST['file_id']);
            list($product_files) = fn_get_product_files($params);
            $product_file = reset($product_files);
            $product_file['company_id'] = db_get_field('SELECT company_id FROM ?:products WHERE product_id = ?i', $_REQUEST['product_id']);
            Tygh::$app['view']->assign('product_file', $product_file);
        }
        list($product_file_folders) = fn_get_product_file_folders(array('product_id' => $_REQUEST['product_id']));
        Tygh::$app['view']->assign('product_file_folders', $product_file_folders);
        Tygh::$app['view']->assign('product_id', $_REQUEST['product_id']);
コード例 #2
0
ファイル: orders.php プロジェクト: heg-arc-ne/cscart
            return array(CONTROLLER_STATUS_NO_PAGE);
        }
        fn_add_breadcrumb(__('order') . ' #' . $_REQUEST['order_id'], "orders.details?order_id=" . $_REQUEST['order_id']);
        fn_add_breadcrumb(__('downloads'));
        $params = array('user_id' => $order['user_id'], 'order_ids' => $order['order_id']);
        list($products) = fn_get_user_edp($params);
        Registry::get('view')->assign('products', $products);
    } else {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
} elseif ($mode == 'get_file') {
    if (empty($_REQUEST['file_id']) || empty($_REQUEST['ekey']) && empty($_REQUEST['preview'])) {
        return array(CONTROLLER_STATUS_NO_PAGE);
    }
    $ekey = !empty($_REQUEST['ekey']) ? $_REQUEST['ekey'] : '';
    if (fn_get_product_file($_REQUEST['file_id'], !empty($_REQUEST['preview']), $ekey) == false) {
        return array(CONTROLLER_STATUS_DENIED);
    }
    exit;
    //
    // Display list of files for downloadable product
    //
} elseif ($mode == 'download') {
    if (!empty($_REQUEST['ekey'])) {
        $ekey_info = fn_get_product_edp_info($_REQUEST['product_id'], $_REQUEST['ekey']);
        if (empty($ekey_info)) {
            return array(CONTROLLER_STATUS_DENIED);
        }
        $product = array('ekey' => $_REQUEST['ekey'], 'product_id' => $ekey_info['product_id']);
        if (!empty($product['product_id'])) {
            $product['product'] = db_get_field("SELECT product FROM ?:product_descriptions WHERE product_id = ?i AND lang_code = ?s", $product['product_id'], CART_LANGUAGE);