Skip to content

Instantly share code, notes, and snippets.

View chebanenko's full-sized avatar

Oleksii Chebanenko chebanenko

  • @parimatch-tech
  • Kyiv, Ukraine
View GitHub Profile
@chebanenko
chebanenko / notify.php
Created February 16, 2016 16:04
notify
if (IsModuleInstalled("im") && CModule::IncludeModule("im"))
{
$arMessageFields = array(
"TO_USER_ID" => 9,
"FROM_USER_ID" => 8,
"NOTIFY_TYPE" => IM_NOTIFY_FROM,
"NOTIFY_MODULE" => "blog",
"NOTIFY_TAG" => "",
"NOTIFY_MESSAGE" => 'FUCK IT ALL',
@chebanenko
chebanenko / getProperties.php
Created January 22, 2016 07:55
Get Properties D7
$dbElement = ElementTable::getList([
'select' => ['ID', 'XML_ID', 'NAME', 'LINK', 'PROPERTY.ID', 'IBLOCK_ID'],
'filter' => [
'=IBLOCK_ID' => 3,
'=LINK' => $elementID,
'=PROPERTY.CODE' => 'CML2_LINK'
],
'order' => ['ID'],
'runtime' => [
'PROPERTY' => [
AddEventHandler("main", "OnAdminContextMenuShow", "MyOnAdminContextMenuShow");
function MyOnAdminContextMenuShow(&$items)
{
//add custom button to the index page toolbar
if($GLOBALS["APPLICATION"]->GetCurPage(true) == "/bitrix/admin/iblock_element_edit.php")
{
$items[] = array("TEXT"=>"TEST", "ICON"=>"", "TITLE"=>"TEST", "LINK"=>"javascript:alert('asd');", "CLASS" =>"asdas");
// init jQuery from core
CJSCore::Init(array("jquery"));
}
(/.*/)\t(/.*/)
if ($uri ~ "^$1?.*/$"){
rewrite ^(.*)$ http://test.ua$2 permanent;
}
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Новая страница");
?>
<?
Bitrix\Main\Loader::includeModule('citrus.priceagregators');
$result = \Citrus\PriceAgregators\LinkProductTable::getList([
'select' => [
$price_agregator_hlblock_id = 8;
$link_hlblock_id = 7;
/**
* забираем инфу о сущности из БД
*/
$price_agregator_hlblock = HL\HighloadBlockTable::getById($price_agregator_hlblock_id)->fetch();
$link_hlblock = HL\HighloadBlockTable::getById($link_hlblock_id)->fetch();
/**
* инициализация сущности
* @var \Bitrix\Main\Entity\Base $entity
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Новая страница");
?>
<?
use \Bitrix\Main\Application;
use Bitrix\Highloadblock as HL;
use Bitrix\Main\Entity;