37 lines
805 B
PHP
37 lines
805 B
PHP
<?php
|
|
|
|
namespace Bx\Discount\Handlers;
|
|
|
|
use Bitrix\Main\Page\Asset;
|
|
use Bitrix\Main\Page\AssetLocation;
|
|
use Bx\Discount\Tools;
|
|
use Wt\Core\Templater\Shell;
|
|
|
|
class SaleDiscountEditPage
|
|
{
|
|
public static function onPageStartHandler()
|
|
{
|
|
if(!Tools::isEnable()){
|
|
return;
|
|
}
|
|
|
|
$isSaleDiscountEditPage = Tools::isSaleDiscountEditPage();
|
|
if(!$isSaleDiscountEditPage){
|
|
return;
|
|
}
|
|
|
|
$discountID = 0;
|
|
$copy = false;
|
|
if (isset($_REQUEST['ID']))
|
|
{
|
|
$discountID = (int)$_REQUEST['ID'];
|
|
if ($discountID < 0)
|
|
$discountID = 0;
|
|
}
|
|
if ($discountID > 0)
|
|
{
|
|
$copy = (isset($_REQUEST['action']) && (string)$_REQUEST['action'] == 'copy');
|
|
}
|
|
|
|
}
|
|
} |