Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/landing/lib/node/ |
Upload File : |
<?php namespace Bitrix\Landing\Node; class Type { const COMPONENT = 'component'; const MEDIA = 'embed'; const ICON = 'icon'; const IMAGE = 'img'; const LINK = 'link'; const MAP = 'map'; const TEXT = 'text'; const STYLE_IMAGE = 'styleimg'; protected static $classes = []; /** * Gets class handler for type of node. * @param string $type Node type. * @return string */ public static function getClassName(string $type): string { $type = mb_strtolower($type); if ($type === '' || $type === 'type') { throw new \Bitrix\Main\ArgumentTypeException( 'Invalid node type' ); } if (isset(self::$classes[$type])) { return self::$classes[$type]; } $class = __NAMESPACE__ . '\\' . $type; // check custom classes $event = new \Bitrix\Main\Event( 'landing', 'onGetNodeClass', [ 'type' => $type ] ); $event->send(); /** @var \Bitrix\Main\ORM\EventResult $result */ foreach ($event->getResults() as $result) { if ($result->getType() != \Bitrix\Main\EventResult::ERROR) { if ( ($modified = $result->getModified()) && isset($modified['class']) && is_subclass_of($modified['class'], '\\Bitrix\\Landing\\Node') ) { $class = $modified['class']; } } } self::$classes[$type] = $class; return self::$classes[$type]; } }