public static function makeFileName(\Freetrix\Iblock\InheritedProperty\BaseTemplate $ipropTemplates, $templateName, $arFields, $arFile) { if (preg_match("/^(.+)(\\.[a-zA-Z0-9]+)\$/", $arFile["name"], $fileName)) { if (!isset($arFields["IPROPERTY_TEMPLATES"]) || $arFields["IPROPERTY_TEMPLATES"][$templateName] == "") { $templates = $ipropTemplates->findTemplates(); $TEMPLATE = $templates[$templateName]["TEMPLATE"]; } else { $TEMPLATE = $arFields["IPROPERTY_TEMPLATES"][$templateName]; } if ($TEMPLATE != "") { list($template, $modifiers) = Helper::splitTemplate($TEMPLATE); if ($template != "") { $values = $ipropTemplates->getValuesEntity(); $entity = $values->createTemplateEntity(); $entity->setFields($arFields); return \Freetrix\Iblock\Template\Engine::process($entity, $TEMPLATE) . $fileName[2]; } elseif ($modifiers != "") { $simpleTemplate = new NodeRoot(); $simpleTemplate->addChild(new NodeText($fileName[1])); $simpleTemplate->setModifiers($modifiers); $baseEntity = new Entity\Base(0); return $simpleTemplate->process($baseEntity) . $fileName[2]; } } } return $arFile["name"]; }
function __construct($iblock_id, $element_id) { $entity = new ElementValues($iblock_id, $element_id); parent::__construct($entity); }
function exportInheritedTemplates($level, \Freetrix\Iblock\InheritedProperty\BaseTemplate $template) { $templates = $template->get(); if (!empty($templates)) { $ws = str_repeat("\t", $level); fwrite($this->fp, $ws."<".GetMessage("IBLOCK_XML2_INHERITED_TEMPLATES").">\n"); foreach ($templates as $CODE => $TEMPLATE) { fwrite($this->fp, $ws."\t<".GetMessage("IBLOCK_XML2_TEMPLATE").">\n"); fwrite($this->fp, $ws."\t\t<".GetMessage("IBLOCK_XML2_ID").">".htmlspecialcharsbx($CODE)."</".GetMessage("IBLOCK_XML2_ID").">\n"); fwrite($this->fp, $ws."\t\t<".GetMessage("IBLOCK_XML2_VALUE").">".htmlspecialcharsbx($TEMPLATE["TEMPLATE"])."</".GetMessage("IBLOCK_XML2_VALUE").">\n"); fwrite($this->fp, $ws."\t</".GetMessage("IBLOCK_XML2_TEMPLATE").">\n"); } fwrite($this->fp, $ws."</".GetMessage("IBLOCK_XML2_INHERITED_TEMPLATES").">\n"); } }