コード例 #1
0
ファイル: ebay.php プロジェクト: ambient-lounge/site
    $view->assign('ebay_international_shipping_services', fn_get_ebay_shippings($template_data['site_id'], $template_data['shipping_type'] == 'C' ? 'Calculated' : 'Flat', true));
    if (!empty($template_data['root_category'])) {
        $view->assign('ebay_child_categories', fn_get_ebay_categories($template_data['site_id'], $template_data['root_category'], true));
    }
    if (!empty($template_data['root_sec_category'])) {
        $view->assign('ebay_sec_child_categories', fn_get_ebay_categories($template_data['site_id'], $template_data['root_sec_category'], true));
    }
    if (!empty($template_data['category'])) {
        $view->assign('current_category', \Ebay\objects\Category::getCategory($template_data['site_id'], $template_data['category']));
    }
    $view->assign('template_data', $template_data)->assign('ebay_sites', fn_get_ebay_sites())->assign('ebay_root_categories', fn_get_ebay_categories($template_data['site_id'], 0));
} elseif ($mode == 'get_category_features') {
    $site_id = (int) $_REQUEST['site_id'];
    $category_id = (int) $_REQUEST['category_id'];
    $template_data = $features = array();
    if (\Ebay\objects\CategoryFeature::isNeedSynchronization($site_id, $category_id)) {
        \Ebay\objects\CategoryFeature::synchronization($site_id, $category_id);
    }
    $current_category = \Ebay\objects\Category::getCategory($site_id, $category_id);
    if (!empty($_REQUEST['template_id'])) {
        $template_data = fn_get_ebay_template($_REQUEST['template_id']);
    }
    Tygh::$app['view']->assign('template_data', $template_data);
    Tygh::$app['view']->assign('current_category', $current_category);
    Tygh::$app['view']->assign('data_id', $_REQUEST['data_id']);
    if (defined('AJAX_REQUEST')) {
        Tygh::$app['view']->display('addons/ebay/views/ebay/components/category_features.tpl');
        exit;
    } else {
        array(CONTROLLER_STATUS_REDIRECT, 'ebay.manage');
    }
コード例 #2
0
ファイル: func.php プロジェクト: ambient-lounge/site
/**
 * Return array objects need synchronization
 * @param int $site_id
 * @param int|null $category_id
 * @return array
 */
function fn_ebay_get_objects_needed_synchronization($site_id, $category_id = null)
{
    $result = array('Site' => \Ebay\objects\Site::isNeedSynchronization(), 'Category' => \Ebay\objects\Category::isNeedSynchronization($site_id), 'Shipping' => \Ebay\objects\Shipping::isNeedSynchronization($site_id));
    if ($category_id !== null) {
        $result['CategoryFeature'] = \Ebay\objects\CategoryFeature::isNeedSynchronization($site_id, $category_id);
    }
    return array_keys(array_filter($result));
}