/** * @param $data * @param $path */ protected static function mergeLangData(&$data, $path) { if (is_file($path)) { $messages = (include $path); $data = \TAO::mergeArgs($data, $messages); } }
public static function check($type, $data = false) { $data = self::canonizeData($type, $data); $type = trim($data['ID']); $result = \CIBlockType::GetByID($type); $cdata = $result->Fetch(); if ($cdata) { $cdata['LANG'] = array(); foreach (array_keys(\TAO::getLangs()) as $lang) { $l = \CIBlockType::GetByIDLang($type, $lang); $cdata['LANG'][$lang] = array('NAME' => $l['NAME'], 'ELEMENT_NAME' => $l['ELEMENT_NAME'], 'SECTION_NAME' => $l['SECTION_NAME']); } $cdata = \TAO::mergeArgs($cdata, $data); self::updateType($cdata); } else { self::addNewType($data); } }
/** * @param array $cfg */ public static function init($cfg = array()) { foreach ($cfg as $k => $v) { self::$config[$k] = $v; } if (isset($GLOBALS['TAO_INITED'])) { return; } $GLOBALS['TAO_INITED'] = true; $cfgFile = \TAO::localDir('.config.php'); if (is_file($cfgFile)) { $extraConfig = (include $cfgFile); self::$config = \TAO::mergeArgs(self::$config, $extraConfig); } self::initAdmin(); if (self::$config['fs_pages']) { self::addBundle('FSPages'); } if (self::$config['elements']) { self::addBundle('Elements'); } \TAO\Auth::init(); AddEventHandler("main", "OnBeforeProlog", function () { }); }