queryBuilder() ->where('sites.active', '=', 1) ->clearOrderBy() ->orderBy('sites.id', 'ASC'); $aSites = $oSites->findAll(); foreach ($aSites as $oSite) { ?>xsl_dir_id) { $oXsl_Dir = $oXsl->Xsl_Dir; do { $aReturn[] = $oXsl_Dir->name; $oXsl_Dir = $oXsl_Dir->getParent(); } while ($oXsl_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп TPL-шаблонов static public function getTplDirName(Tpl_Model $oTpl) { $aReturn = array(); if ($oTpl->tpl_dir_id) { $oTpl_Dir = $oTpl->Tpl_Dir; do { $aReturn[] = $oTpl_Dir->name; $oTpl_Dir = $oTpl_Dir->getParent(); } while ($oTpl_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп констант static public function getConstantDirName(Constant_Model $oConstant) { $aReturn = array(); if ($oConstant->constant_dir_id) { $oConstant_Dir = $oConstant->Constant_Dir; do { $aReturn[] = $oConstant_Dir->name; $oConstant_Dir = $oConstant_Dir->getParent(); } while ($oConstant_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп XSL-шаблонов static public function getLibDirName(Lib_Model $oLib) { $aReturn = array(); if ($oLib->lib_dir_id) { $oLib_Dir = $oLib->Lib_Dir; do { $aReturn[] = $oLib_Dir->name; $oLib_Dir = $oLib_Dir->getParent(); } while ($oLib_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп макетов static public function getTemplateDirName(Template_Model $oTemplate) { $aReturn = array(); if ($oTemplate->template_id) { $oTemplate_Dir = $oTemplate->Template_Dir; do { $aReturn[] = $oTemplate_Dir->name; $oTemplate_Dir = $oTemplate_Dir->getParent(); } while ($oTemplate_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп документов static public function getDocumentDirName(Document_Model $oDocument) { $aReturn = array(); if ($oDocument->document_dir_id) { $oDocument_Dir = $oDocument->Document_Dir; do { $aReturn[] = $oDocument_Dir->name; $oDocument_Dir = $oDocument_Dir->getParent(); } while ($oDocument_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп списков static public function getListDirName(List_Model $oList) { $aReturn = array(); if ($oList->list_dir_id) { $oList_Dir = $oList->List_Dir; do { $aReturn[] = $oList_Dir->name; $oList_Dir = $oList_Dir->getParent(); } while ($oList_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп поля формы static public function getFormFieldDirName(Form_Field_Model $oForm_Field) { $aReturn = array(); if ($oForm_Field->form_field_dir_id) { $oForm_Field_Dir = $oForm_Field->Form_Field_Dir; do { $aReturn[] = $oForm_Field_Dir->name; $oForm_Field_Dir = $oForm_Field_Dir->getParent(); } while ($oForm_Field_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп табов static public function getShopTabDirName(Shop_Tab_Model $oShop_Tab) { $aReturn = array(); if ($oShop_Tab->shop_tab_dir_id) { $oShop_Tab_Dir = $oShop_Tab->Shop_Tab_Dir; do { $aReturn[] = $oShop_Tab_Dir->name; $oShop_Tab_Dir = $oShop_Tab_Dir->getParent(); } while ($oShop_Tab_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение групп пользовательских полей static public function getFieldDirName(Field_Model $oField) { $aReturn = array(); if ($oField->field_dir_id) { $oField_Dir = $oField->Field_Dir; do { $aReturn[] = $oField_Dir->name; $oField_Dir = $oField_Dir->getParent(); } while ($oField_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } // Получение меток ИС static public function getInformationsystemTags(Informationsystem_Item_Model $oInformationsystem_Item) { $aReturn = array(); if ($oInformationsystem_Item->id) { $aTags = $oInformationsystem_Item->Tags->findAll(FALSE); foreach ($aTags as $oTag) { $aReturn[] = $oTag->name; } } return implode(',', $aReturn); } // Получение меток магазина static public function getShopTags(Shop_Item_Model $oShop_Item) { $aReturn = array(); if ($oShop_Item->id) { $aTags = $oShop_Item->Tags->findAll(FALSE); foreach ($aTags as $oTag) { $aReturn[] = $oTag->name; } } return implode(',', $aReturn); } // Получение групп свойств товара static public function getPropertyDirName(Property_Model $oProperty) { $aReturn = array(); if ($oProperty->property_dir_id) { $oProperty_Dir = $oProperty->Property_Dir; do { $aReturn[] = $oProperty_Dir->name; $oProperty_Dir = $oProperty_Dir->getParent(); } while ($oProperty_Dir); $aReturn = array_reverse($aReturn); } return implode('/', $aReturn); } /** * Массив id -> название XSL-шаблонов, используемых в макетах и ТДС * @var array */ static public $_aXsls = array(); /** * Массив id -> название ТДС, используемых в структуре сайта * @var array */ static protected $_aLibs = array(); /** * Массив внешних файлов * @var array */ static protected $_aFiles = array(); static public function getArrayOfFiles() { return self::$_aFiles; } /** * Поиск использования JS/CSS файлов в переданном $content * @param string $content */ static public function findFiles($content) { preg_match_all('/->(?:prependJs|js)\([\'\"](.*?)[\'\"]\)/mi', $content, $matches); if (isset($matches[1][0])) { foreach ($matches[1] as $sScript) { if (strpos($sScript, '/') === 0 && strpos($sScript, '//') === FALSE) { self::$_aFiles[] = Core_Str::ltrimUri($sScript); } } } preg_match_all('/\