} elseif (Core_Array::getGet('shop_country_location_city_id')) {
        $oShop_Country_Location_City_Area = Core_Entity::factory('Shop_Country_Location_City_Area');
        $oShop_Country_Location_City_Area->queryBuilder()->where('shop_country_location_city_id', '=', intval(Core_Array::getGet('shop_country_location_city_id')));
        $aObjects = $oShop_Country_Location_City_Area->findAll();
    }
    $aArray = array('…');
    foreach ($aObjects as $Object) {
        $aArray['_' . $Object->id] = $Object->name;
    }
    echo json_encode($aArray);
    exit;
}
// Удаляение товара из корзины
if (Core_Array::getGet('delete')) {
    $shop_item_id = intval(Core_Array::getGet('delete'));
    if ($shop_item_id) {
        $oShop_Cart_Controller = Shop_Cart_Controller::instance();
        $oShop_Cart_Controller->shop_item_id($shop_item_id)->delete();
    }
}
if (Core_Array::getPost('recount') || Core_Array::getPost('step') == 1) {
    $oShop_Cart_Controller = Shop_Cart_Controller::instance();
    $aCart = $oShop_Cart_Controller->getAll($oShop);
    foreach ($aCart as $oShop_Cart) {
        $oShop_Cart_Controller->checkStock(FALSE)->shop_item_id($oShop_Cart->shop_item_id)->quantity(Core_Array::getPost('quantity_' . $oShop_Cart->shop_item_id))->postpone(is_null(Core_Array::getPost('postpone_' . $oShop_Cart->shop_item_id)) ? 0 : 1)->shop_warehouse_id(Core_Array::getPost('warehouse_' . $oShop_Cart->shop_item_id, 0))->update();
    }
    // Запоминаем купон
    $_SESSION['hostcmsOrder']['coupon_text'] = trim(strval(Core_Array::getPost('coupon_text')));
}
$Shop_Cart_Controller_Show = new Shop_Cart_Controller_Show($oShop);
Core_Page::instance()->object = $Shop_Cart_Controller_Show;
Ejemplo n.º 2
0
require_once '../../bootstrap.php';
Core_Auth::authorization('repairmanjacktwitterexport');
$oUser = Core_Entity::factory('User')->getCurrent();
$export = new repairmanjacktwitterexport_notifier($oUser->login);
ob_start();
////////////
$oAdmin_Form_Controller = new Admin_Form_Controller();
$oAdmin_Form_Controller->setUp();
$oAdmin_Form_Controller->path('/admin/repairmanjacktwitterexport/index.php');
$oAdmin_Form_Controller->title('Экспорт в Twitter');
$oAdmin_Form_Entity_Form = new Admin_Form_Entity_Form($oAdmin_Form_Controller);
$oAdmin_Form_Entity_Form->action($oAdmin_Form_Controller->getPath());
if ($oAdmin_Form_Controller->getAction() == 'accept') {
    try {
        $export->doAccessToken(Core_Array::getPost('pin', ''));
    } catch (Exception $e) {
        $oAdmin_Form_Entity_Form->add(Core::factory('Admin_Form_Entity_Code')->html('<div id="error">Ошибка ' . $e->getCode() . ': ' . $e->getMessage() . '</div>'));
    }
} elseif ($oAdmin_Form_Controller->getAction() == 'revoke') {
    $export->revokeAuthorization();
}
if (!$export->isAuthorized()) {
    try {
        $export->doRequestToken();
        $aData = $export->getData();
        $oAdmin_Form_Entity_Form->add(Core::factory('Admin_Form_Entity_Code')->html('<div id="message">Первый шаг - авторизация приложения в Twitter! Перейдите по кнопке ниже на страничку Twitter (откроется в новой вкладке/окне) и разрешите приложению доступ к Вашем аккаунту. Скопируйте выданный Twitter код доступа.</div>'))->add(new Admin_Form_Entity_Separator())->add(Core::factory('Admin_Form_Entity_Button')->name('button')->onclick("window.open('http://api.twitter.com/oauth/authorize?oauth_token=" . $aData['oauth_token'] . "')")->value('Авторизация')->class('applyButton'))->add(Core::factory('Admin_Form_Entity_Code')->html('<div id="message">Второй шаг - введите в текстовое поле полученный от Twitter код доступа и нажмите кнопку "Применить".</div>'))->add(new Admin_Form_Entity_Separator())->add(Core::factory('Admin_Form_Entity_Input')->name("pin")->style("width: 100px"))->add(new Admin_Form_Entity_Separator())->add(Core::factory('Admin_Form_Entity_Button')->name('accept')->value('Применить')->class('applyButton')->type('submit')->onclick($oAdmin_Form_Controller->getAdminSendForm('accept')));
    } catch (Exception $e) {
        $oAdmin_Form_Entity_Form->add(Core::factory('Admin_Form_Entity_Code')->html('<div id="error">Ошибка ' . $e->getCode() . ': ' . $e->getMessage() . '</div>'));
    }
} else {