コード例 #1
0
ファイル: helper.php プロジェクト: ASDAFF/open_bx
 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"];
 }
コード例 #2
0
ファイル: elementtemplates.php プロジェクト: ASDAFF/open_bx
 function __construct($iblock_id, $element_id)
 {
     $entity = new ElementValues($iblock_id, $element_id);
     parent::__construct($entity);
 }
コード例 #3
0
ファイル: cml2.php プロジェクト: ASDAFF/open_bx
	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");
		}
	}