public function __construct() { $this->config = json_decode(file_get_contents(BFactory::getDir() . '/config/block.json')); $this->setLanguage($this->config->languages->default); CModule::IncludeModule("iblock"); CModule::AddAutoloadClasses('', array('BitrixAdapterBlockPrototype' => '/bitrixadapter/core/prototype.php')); }
/** * Format Bitrix date with format. * */ public function dateFormat($format, $_date) { $date = is_int($_date) ? $_date : strtotime($_date); $ret = date($format, $date); $lang = BFactory::getLanguage(); if ($lang != 'en') { $ret = preg_replace('#january|february|march|april|may|june|july|august|september|october|november|december#i', self::getMonthName(date('n', $date), $lang), $ret); } return $ret; }
public static function getJso() { if (!self::$jso) { self::load('JS'); self::$jso = new BitrixAdapterJS(); } return self::$jso; }
public function detail($item) { $sectionAlias = BFactory::_()->sections()->getSectionById($item['PROPERTY_SECTION_VALUE']); return $this->trim("/{$sectionAlias}/akcii/detail.php?ID=" . $this->getId($item)); }
/** * Init common classes * */ public function init() { CModule::AddAutoloadClasses('', array('BFactory' => '/bitrixadapter/factory.php')); BFactory::init(); }