/* Чистим сессиии и куки
11966
public function removeData()
    {
        $cookies = \Yii::$app->response->cookies;

        \Yii::$app->session->remove($this->timezoneSessionKey);
        $cookies->remove($this->timezoneCookieName);

        \Yii::$app->session->remove($this->citySessionKey);
        $cookies->remove($this->cityCookieName);

        \Yii::$app->session->remove($this->regionSessionKey);
        $cookies->remove($this->regionCookieName);

        \Yii::$app->session->remove($this->countrySessionKey);
        $cookies->remove($this->countryCookieName);
    }
401386
function send(data, params) {
    const p = params;
    const {
        name = '',
        cache,
        query,
        mime,
        response,
    } = params;
    
    checkParams(params);
    
    const isGzip = p.gzip && isGZIP(p.request);
    const head = generateHeaders({
        name,
        cache,
        query,
        mime,
        gzip: isGzip,
    });
    
    fillHeader(head, response);
    
    logData(data);
    
    /* если браузер поддерживает gzip-сжатие - сжимаем данные*/
    exec.if(!isGzip,
        () => {
            if (!p.data)
                p.data = data;
            
            response.statusCode = p.status || OK;
            response.end(p.data);
        },
        
        (callback) => {
            zlib.gzip(data, (error, data) => {
                if (!error)
                    p.data = data;
                else {
                    p.status = FILE_NOT_FOUND;
                    p.data = error.message;
                }
                
                callback();
            });
        });
}
1284679
private function add()
    {
        $data = array();

        /* Составляем список доступных плагинов */
        $files = glob(Eresus_CMS::getLegacyKernel()->froot . 'ext/*.php');
        if (false === $files)
        {
            $files = array();
        }

        /* Составляем список установленных плагинов */
        $items = Eresus_CMS::getLegacyKernel()->db->select('plugins', '', 'name, version');
        $installed = array();
        foreach ($items as $item)
        {
            $installed []= Eresus_CMS::getLegacyKernel()->froot . 'ext/' . $item['name'] . '.php';
        }
        // Оставляем только неустановленные
        $files = array_diff($files, $installed);

        /*
         * Собираем информацию о неустановленных плагинах
         */
        $data['plugins'] = array();
        if (count($files))
        {
            // Удаляем из версии CMS все буквы, чтобы сравнивать только цифры
            $kernelVersion = preg_replace('/[^\d\.]/', '', Eresus_Kernel::app()->version);

            foreach ($files as $file)
            {
                $errors = array();
                try
                {
                    $info = Eresus_PluginInfo::loadFromFile($file);
                    $required = $info->getRequiredKernel();
                    if (
                        version_compare($kernelVersion, $required[0], '<')/* ||
						version_compare($kernelVersion, $required[1], '>')*/
                    )
                    {
                        $msg =  I18n::getInstance()->getText('admPluginsInvalidVersion', $this);
                        $errors []= sprintf($msg, /*implode(' - ', */$required[0]/*)*/);
                    }
                }
                catch (RuntimeException $e)
                {
                    $errors []= $e->getMessage();
                    $info = new Plugin(); // TODO: Придумать решение без Plugin
                    $info->title = $info->name = basename($file, '.php');
                    $info->version = '';
                }
                $available[$info->name] = $info->version;
                $data['plugins'][$info->title] = array('info' => $info, 'errors' => $errors);
            }
        }

        $plugins = Eresus_Plugin_Registry::getInstance();

        foreach ($data['plugins'] as &$item)
        {
            if ($item['info'] instanceof Eresus_PluginInfo)
            {
                $required = $item['info']->getRequiredPlugins();
                foreach ($required as $plugin)
                {
                    list ($name, $minVer, $maxVer) = $plugin;
                    if (
                        !isset($plugins->items[$name]) ||
                        ($minVer && version_compare($plugins->items[$name]->version, $minVer, '<')) ||
                        ($maxVer && version_compare($plugins->items[$name]->version, $maxVer, '>'))
                    )
                    {
                        {
                            $msg = I18n::getInstance()->getText('Requires plugin: %s', $this);
                            $item['errors'] []= sprintf($msg, $name . ' ' . $minVer . '-' . $maxVer);
                        }
                    }
                }
            }
        }

        ksort($data['plugins']);

        /* @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $tmpl = $page->getUITheme()->getTemplate('PluginManager/add-dialog.html');
        $html = $tmpl->compile($data);

        return $html;
    }
1089302
function() {
        var builder = this.builder;

        builder.register( 'View', new ViewBuilder() );
        builder.register( 'InlineView', new InlineViewBuilder() );
        builder.register( 'AutoView', new MetadataViewBuilder() );

        builder.register( 'StackPanel', new StackPanelBuilder() );
        builder.register( 'GridPanel', new GridPanelBuilder() );
        builder.register( 'ScrollPanel', new ScrollPanelBuilder() );
        builder.register( 'Panel', new PanelBuilder() );
        builder.register( 'ScrollPanel', new ScrollPanelBuilder() );
        builder.register( 'ViewPanel', new ViewPanelBuilder() );
        builder.register( 'TabPanel', new TabPanelBuilder() );
        builder.register( 'TabPage', new TabPageBuilder() );

        builder.register( 'TablePanel', new TablePanelBuilder() );
        builder.register( 'Cell', new CellBuilder() );
        builder.register( 'Row', new RowBuilder() );

        builder.register( 'MenuBar', new MenuBarBuilder() );

        builder.register( 'DataGrid', new DataGridBuilder() );
        // служебный элемент, в документировании не нуждается
        builder.register( 'DataGridRow', new DataGridRowBuilder() );

        builder.register( 'DataGridColumn', new DataGridColumnBuilder() );
        builder.register( 'ListBox', new ListBoxBuilder() );

        builder.register( 'TextBox', new TextBoxBuilder() );
        builder.register( 'PasswordBox', new PasswordBoxBuilder() );
        builder.register( 'CheckBox', new CheckBoxBuilder() );
        builder.register( 'IndeterminateCheckBox', new IndeterminateCheckBoxBuilder() );
        builder.register( 'ImageBox', new ImageBoxBuilder() );
        builder.register( 'FileBox', new FileBoxBuilder() );
        builder.register( 'Label', new LabelBuilder() );
        builder.register( 'Link', new LinkBuilder() );
        builder.register( 'Form', new FormBuilder() );
        builder.register( 'Icon', new IconBuilder() );
        builder.register( 'DateTimePicker', new DateTimePickerBuilder() );
        builder.register( 'DatePicker', new DatePickerBuilder() );
        builder.register( 'TimePicker', new TimePickerBuilder() );
        builder.register( 'ToggleButton', new ToggleButtonBuilder() );
        builder.register( 'NumericBox', new NumericBoxBuilder() );
        builder.register( 'Button', new ButtonBuilder() );
        builder.register( 'ToolBar', new ToolBarBuilder() );
        builder.register( 'ToolBarButton', new ButtonBuilder() );
        builder.register( 'ComboBox', new ComboBoxBuilder() );
        builder.register( 'RadioGroup', new RadioGroupBuilder() );
        builder.register( 'ExtensionPanel', new ExtensionPanelBuilder() );
        builder.register( 'PopupButton', new PopupButtonBuilder() );
        builder.register( 'DataNavigation', new DataNavigationBuilder() );
        builder.register( 'TreeView', new TreeViewBuilder() );
        builder.register( 'Frame', new FrameBuilder() );
        builder.register( 'ButtonEdit', new ButtonEditBuilder() );

        builder.register( 'RestDataSource', new RestDataSourceBuilder() );
        builder.register( 'DocumentDataSource', new DocumentDataSourceBuilder() );
        builder.register( 'PropertyBinding', new DataBindingBuilder() );
        builder.register( 'ObjectDataSource', new ObjectDataSourceBuilder() );
        builder.register( 'Parameter', new ParameterBuilder() );

        builder.register( 'AcceptAction', new AcceptActionBuilder() );
        builder.register( 'AddAction', new AddActionBuilder() );
        builder.register( 'CreateItemAction', new CreateItemActionBuilder() );
        builder.register( 'CancelAction', new CancelActionBuilder() );
        builder.register( 'DeleteAction', new DeleteActionBuilder() );
        builder.register( 'EditAction', new EditActionBuilder() );
        builder.register( 'OpenAction', new OpenActionBuilder() );
        builder.register( 'SaveAction', new SaveActionBuilder() );
        builder.register( 'SelectAction', new SelectActionBuilder() );
        builder.register( 'UpdateAction', new UpdateActionBuilder() );
        builder.register( 'ServerAction', new ServerActionBuilder() );

        builder.register( 'RouteToAction', new RouteToActionBuilder() );

        builder.register( 'BooleanFormat', new BooleanFormatBuilder() );
        builder.register( 'DateTimeFormat', new DateTimeFormatBuilder() );
        builder.register( 'NumberFormat', new NumberFormatBuilder() );
        builder.register( 'ObjectFormat', new ObjectFormatBuilder() );

        builder.register( 'Script', new ScriptBuilder() );

        builder.register( 'Divider', new DividerBuilder() );
        builder.register( 'ContextMenu', new ContextMenuBuilder() );

        // служебный элемент, в документировании не нуждается
        builder.register( 'ToolTip', new InfinniUI.TooltipBuilder() );

        var registerQueue = ApplicationBuilder.registerQueue;

        for( var i = 0, ii = registerQueue.length; i < ii; i++ ) {
            builder.register( registerQueue[ i ].name, registerQueue[ i ].builder );
        }
    }
905149
public function validate()
    {
        $preFunctions = $this->getPreFunctions();
        $postFunctions = $this->getPostFunctions();
        $validators = $this->getValidators();

        ValidationHelper::validate($preFunctions);
        ValidationHelper::validate($postFunctions);
        ValidationHelper::validate($validators);

        $split = $this->getSplit();
        $join = $this->getJoin();

        $parent = $this->getParent();
        if ((null === $split) && (null === $join) && !($parent instanceof ActionDescriptor && ($parent->isFinish()))) {
            $errMsg = '';
            $id = (integer)$this->getId();
            if (is_numeric($id)) {
                $errMsg .= sprintf('#%s:', $id);
            }
            $errMsg .= 'Если не указано значение атрибутов split или join, необходимо указать';

            if (!$this->hasStep) {
                $errMsg .= ' id следующего шага';
                throw new InvalidWorkflowDescriptorException($errMsg);
            }

            $status = $this->getStatus();
            if (!$status) {
                $errMsg .= ' статус';
                throw new InvalidWorkflowDescriptorException($errMsg);
            }
        }
    }
106120
function __content() // пока не используется, т.к. более древнее в base_object
	{
		if(($render_class = $this->render_class()))
		{
			if($render_class == 'self')
				$render = $this;
			elseif(!($render = bors_load($render_class)))
				debug_exit("Can't load global render engine {$render_class} for object '{$this}'");

			return $render->rendering($this);
		}
	}
1126603
private function clientCheckRequest()
    {
        /* @var TClientUI $page */
        $page = Eresus_Kernel::app()->getPage();
        /* Собираем вместе ожидаемые элементы URL */
        $acceptUrl = Eresus_CMS::getLegacyKernel()->request['path'] .
            ($page->subpage !== 0 ? 'p' . $page->subpage . '/' : '');

        if ($page->topic)
        {
            $acceptUrl .= $page->topic !== false ? $page->topic . '/' : '';
        }

        /* Сравниваем с переданным URL */
        if ($acceptUrl != Eresus_CMS::getLegacyKernel()->request['url'])
        {
            throw new Eresus_CMS_Exception_NotFound;
        }
    }
676866
public function main()
    {
        Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'starting...');

        try
        {
            /* Общая инициализация */
            $this->checkEnvironment();
            $this->createFileStructure();



            /* Подключение старого ядра */
            Eresus_Kernel::log(__METHOD__, LOG_DEBUG, 'Init legacy kernel');
            include_once 'kernel-legacy.php';

            /**
             * @global Eresus Eresus
             * @todo Обратная совместимость — удалить
             * @deprecated с 3.01 используйте Eresus_Kernel::app()->getLegacyKernel()
             */
            $GLOBALS['Eresus'] = new Eresus;

            TemplateSettings::setGlobalValue('cms', $this);

            $this->initConf();
            $i18n = I18n::getInstance();
            TemplateSettings::setGlobalValue('i18n', $i18n);
            Eresus_CMS::getLegacyKernel()->init();
            TemplateSettings::setGlobalValue('Eresus', Eresus_CMS::getLegacyKernel());
            $this->runWeb();
        }
        catch (Exception $e)
        {
            Eresus_Kernel::logException($e);
            ob_end_clean();
            $this->fatalError($e, false);
        }
        return 0;
    }
1001965
protected function _initAutoColumns()
    {

        //Если автоопределение колонок не включено
        if (!$this->isEnabledAutoColumns) {
            return $this;
        }

        $dataProvider = clone $this->dataProvider;
        $models = $dataProvider->getModels();

        /**
         * @var $model ActiveQuery
         */
        $model = reset($models);

        if (!$model) {
            if ($dataProvider && isset($dataProvider->query) && $dataProvider->query->modelClass) {
                $modelClass = $dataProvider->query->modelClass;
                $model = new $modelClass();
            }
        }


        if (is_array($model) || is_object($model)) {
            foreach ($model as $name => $value) {
                if ($value === null || is_scalar($value) || is_callable([$value, '__toString'])) {

                    $key = $name;
                    if (!empty($key) && strcasecmp($key, 'id')) {
                        if (substr_compare($key, 'id', -2, 2, true) === 0) {
                            $key = rtrim(substr($key, 0, -2), '_');
                        } elseif (substr_compare($key, 'id', 0, 2, true) === 0) {
                            $key = ltrim(substr($key, 2, strlen($key)), '_');
                        }
                    }

                    $keyMany = Inflector::pluralize($key);

                    $keyName = lcfirst(Inflector::id2camel($key, '_'));
                    $keyManyName = lcfirst(Inflector::id2camel($keyMany, '_'));

                    if ($model instanceof Component && $model->hasProperty($keyName)) {
                        $this->_autoColumns[(string)$name] = [
                            'attribute' => $name,
                            'format'    => 'raw',
                            'value'     => function ($model, $key, $index) use ($name, $keyName) {
                                return $model->{$keyName};
                            },
                        ];
                    } else if ($model instanceof Component && $model->hasProperty(lcfirst($keyManyName))) {
                        $this->_autoColumns[(string)$name] = [
                            'attribute' => $name,
                            'format'    => 'raw',
                            'value'     => function ($model, $key, $index) use ($name, $keyManyName) {
                                return count($model->{$keyManyName});
                            },
                        ];
                    } else {
                        $this->_autoColumns[(string)$name] = [
                            'attribute' => $name,
                            'format'    => 'raw',
                            'value'     => function ($model, $key, $index) use ($name) {
                                if (is_array($model)) {
                                    $v = $model[$name];
                                } else {
                                    $v = $model->{$name};
                                }

                                if (is_array($v)) {
                                    return implode(",", $v);
                                } else {
                                    return $v;
                                }
                            },
                        ];
                    }

                }
            }
        }

        return $this;
    }
1123751
function convertGrammar( $word, $case ) {
		global $wgGrammarForms;
		if ( isset( $wgGrammarForms['сu'][$case][$word] ) ) {
			return $wgGrammarForms['сu'][$case][$word];
		}

		# These rules are not perfect, but they are currently only used for site names so it doesn't
		# matter if they are wrong sometimes. Just add a special case for your site name if necessary.

		# join and array_slice instead mb_substr
		$ar = array();
		preg_match_all( '/./us', $word, $ar );
		if ( !preg_match( "/[a-zA-Z_]/us", $word ) )
			switch ( $case ) {
				case 'genitive': # родительный падеж
					if ( ( join( '', array_slice( $ar[0], -4 ) ) == 'вики' ) || ( join( '', array_slice( $ar[0], -4 ) ) == 'Вики' ) )
						{ }
					elseif ( join( '', array_slice( $ar[0], -2 ) ) == 'ї' )
						$word = join( '', array_slice( $ar[0], 0, -2 ) ) . 'їѩ';
					break;
				case 'accusative': # винительный падеж
					# stub
					break;
			}
		return $word;
	}
1285853
public function isSameUrlFull($url1, $url2) {
		$url1 = mb_strtolower($url1);
		$url2 = mb_strtolower($url2);

		if (self::isSameUrl($url1, $url2)) {
			return true;
		}

		// проверим пуникоду ссылки
		$pyni = self::convertToPunycode($url1);
		$urlDec = urldecode($url1);

		if (strcasecmp($url1, $url2) == 0) {
			return true;
		} elseif (strcasecmp($urlDec, $url2) == 0) {
			return true;
		} elseif (strcasecmp($pyni['linkPunyEnc'], $url2) == 0) {
			return true;
		} elseif (strcasecmp($pyni['linkPunyDec'], $url2) == 0) {
			return true;
		} else {
			return false;
		}
	}
259905
private function move()
    {
        $item = Eresus_CMS::getLegacyKernel()->sections->get(arg('id', 'int'));
        if (!is_null(arg('to')))
        {
            $item['owner'] = arg('to', 'int');
            $item['position'] = count(Eresus_CMS::getLegacyKernel()->sections->children($item['owner']));

            /* Проверяем, нет ли в разделе назначения раздела с таким же именем */
            $q = Eresus_DB::getHandler()->createSelectQuery();
            $e = $q->expr;
            $q->select($q->alias($e->count('id'), 'count'));
            $q->from('pages');
            $q->where($e->lAnd(
                $e->eq('owner', $q->bindValue($item['owner'], null, PDO::PARAM_INT)),
                $e->eq('name', $q->bindValue($item['name']))
            ));
            $count = $q->fetch();
            if ($count['count'])
            {
                Eresus_Kernel::app()->getPage()->addErrorMessage(
                    'В разделе назначения уже есть раздел с таким же именем!');
                HTTP::goback();
            }

            Eresus_CMS::getLegacyKernel()->sections->update($item);
            HTTP::redirect(Eresus_Kernel::app()->getPage()->url(array('id'=>'')));
        }
        else
        {
            $select = $this->selectList($item['id']);
            array_unshift($select[0], 0);
            array_unshift($select[1], admPagesRoot);
            $form = array(
                'name' => 'MoveForm',
                'caption' => admPagesMove,
                'fields' => array(
                    array('type'=>'hidden', 'name'=>'mod', 'value' => 'pages'),
                    array('type'=>'hidden', 'name'=>'action', 'value' => 'move'),
                    array('type'=>'hidden', 'name'=>'id', 'value' => $item['id']),
                    array('type'=>'select', 'label'=>strMove.' "<b>'.$item['caption'].'</b>" в',
                        'name'=>'to', 'items'=>$select[1], 'values'=>$select[0], 'value' => $item['owner']),
                ),
                'buttons' => array('ok', 'cancel'),
            );
            /** @var TAdminUI $page */
            $page = Eresus_Kernel::app()->getPage();
            $result = $page->renderForm($form);
            return $result;
        }
        return '';
    }
396157
public function sendQuestions($data)
	{
		$mail = new MailHelper;

		$this->ips 			= $this->getIPs();
		$this->ip				= $this->getIP();
		$this->host 		= $this->getHOST();

		// Заголовок письма с датой
		$subject = date("d.m.y_G:i", strtotime($data['date']));
		// Подготовка тела письма
		$message = '';
		$message .= "Имя: $this->name\n\n";
		foreach ($data as $key => $value) {
			if (is_array($value)){
				$message .=	"Вопрос $key: ";
				$message .=  $value['question']."\n";
				$message .=  $value['answer']."\n";
			}
		}
		$message .= "\n";
		$message .= "ID клиента: ".$data['id'];
		$message .="\n\n\nВопросы были заполнены на сайте - $this->q_url";
		$message.= "\n\n\nВсе варианты ip: $this->q_ip\n";
		$message.= "\n http://sypexgeo.net/ru/demo/";
		$mail->mailSend($subject, $message);
	}
240473
function getExternal($as_html = true) {
        if(!$as_html) {
            return $this->css_external;
        }
        if(!count($this->css_external)) {
            return '';
        }
        $css_code = '';
        /* если не надо собирать файлы в один */
        if(!config('larakit.lk-staticfiles.css.external.build', false)) {
            foreach($this->css_external as $css => $_css) {
                $css_code .= '        ' . $this->getLink($css, Arr::get($_css, 'media'), Arr::get($_css, 'condition')) . PHP_EOL;
            }
        } else {
            $build     = [];
            $no_builds = [];
            $css_code  = '';
            foreach($this->css_external as $css => $_css) {
                $condition = Arr::get($_css, 'condition');
                $media     = Arr::get($_css, 'media');
                $no_build  = Arr::get($_css, 'no_build');
                if($no_build) {
                    $no_builds[$condition . '|' . $media][] = $css;
                } else {
                    $build[$condition . '|' . $media][] = $css;
                }
            }
            foreach($no_builds as $key => $css) {
                list($condition, $media) = explode('|', $key);
                $css_code .= '<!-- [no build] -->' . PHP_EOL;
                foreach($css as $_css) {
                    $css_code .= $this->getLink($_css, $media, $condition, false) . PHP_EOL;
                }
                $css_code .= '<!-- [/no build] -->' . PHP_EOL;
            }
            foreach($build as $key => $css) {
                list($condition, $media) = explode('|', $key);
                $prefix = ['css'];
                if($condition) {
                    $prefix[] = str_replace(' ', '', $condition);
                }
                if($media) {
                    $prefix[] = $media;
                }
                $build_name = $this->makeFileName($css, implode('/', $prefix), 'css');
                $build_file = $this->buildFile($build_name);
                if(!file_exists($build_file)) {
                    //соберем билд в первый раз
                    $build = [];
                    foreach($css as $url) {
                        $_css    = $this->replaceRelativePath($url);
                        $_css    = $this->prepare($_css, config('larakit.lk-staticfiles.css.external.min') || (mb_strpos($url, '.min.') !== false));
                        $build[] = "/**********************************************************************" . PHP_EOL;
                        $build[] = '* ' . $url . PHP_EOL;
                        $build[] = "**********************************************************************/" . PHP_EOL;
                        $build[] = $_css . PHP_EOL . PHP_EOL;
                    }
                    if(!file_exists(dirname($build_file))) {
                        mkdir(dirname($build_file), 0777, true);
                    }
                    
                    $this->save($build_file, implode('', $build));
                }
                $css_code .= $this->getLink($this->buildUrl($build_name), $media, $condition) . "\n";
            }
        }
        
        return $css_code;
    }
1296774
public static function giveMeLinksDom($page, $withSlash = false, $withWww = false) {
		// символ 00 мешает DOM-парсеру
		$page = preg_replace('/\x00/', ' ', $page);

		// лишние углы
		$page = preg_replace('/<{2,}/', '<', $page);
		$page = str_replace(["&nbsp;", "\xc2\xa0"], ' ', $page);

		// приходит уже перекодированный в ютф8 текс, нужно заменить объявляения кодировки в тексте
		$page = preg_replace(['/windows-1251/i', '/cp1251/i'], 'utf-8', $page);
		// некоторые символы в ссылках кодируются, исправим это
		$page = preg_replace(['/&#0?61;/', '/&#0?38;/', '/&amp;/', '/&#0?37;/', '/&ndash;/'], ['=', '&', '&', '%', '–'], $page);
		// заменим закоменченый тег <!--noindex--> на обычный
		$c = 1;
		while ($c && $c > 0) {
			$page = preg_replace('/(\<\!--noindex--\>)(.*)(\<\!--\/noindex--\>)/ismU', '<noindex>$2</noindex>', $page, -1, $c);
		}
		$xml = new \DOMDocument();
		@$xml->loadHTML('<?xml encoding="UTF-8">' . $page);
		$links = array();
		foreach($xml->getElementsByTagName('a') as $link) {
			$href = $link->getAttribute('href');
			// ссылка без урла
			if(!$href || in_array($href, ["#", '/', 'javascript:void(0);'])) {
				continue;
			}
			// проверим элемент в <noindex>
			$noindex = self::inNoIndexDom($link);
			// проверим чтобы только элемент находился в noindex
			$noindexOnly = $noindex ? self::inNoIndexDom($link, true) : false;
			if(mb_strlen(utf8_decode($href)) <  mb_strlen($href)) {
				$href = utf8_decode($href);
			}
			$href = urldecode($href);

			$href = self::httpLess(trim($href));
			if (!$withWww) {
				$href = self::wwwLess($href);
			}

			if (!$withSlash) {
				$href = preg_replace(['/(\/\s*)$/i', '/(\/?#\s*)$/i'], '', $href);
			} else {
				$href = preg_replace(['/(\s*)$/i', '/(?#\s*)$/i'], '', $href);
			}

			$links[] = array(
				'acceptor' => mb_strtolower($href),
				'anchor' => $link->nodeValue,
				'rel' => $link->getAttribute('rel'),
				'noindex' => $noindex,
				'noindexOnly' => $noindexOnly
			);
		}

		return $links;
	}
1247452
private function _smsc_send_cmd($cmd, $arg = "")
    {
        $url = ($this->https ? "https" : "http")."://smsc.ru/sys/$cmd.php?login=".urlencode($this->login)."&psw=".urlencode($this->password)."&fmt=1&charset=".$this->charset."&".$arg;

        $i = 0;
        do {
            if ($i) {
                sleep(2);

                if ($i == 2)
                    $url = str_replace('://smsc.ru/', '://www2.smsc.ru/', $url);
            }

            $ret = $this->_smsc_read_url($url);
        }
        while ($ret == "" && ++$i < 3);

        if ($ret == "") {
            if ($this->debug)
                echo "Ошибка чтения адреса: $url\n";

            $ret = ","; // фиктивный ответ
        }

        return explode(",", $ret);
    }
746143
function prop_join($class_name, $conditions = array())
	{
		$conditions['id IN'] = $this->keys();
		// Ищем все присоединяемые объекты с такими же ID, как у нас
		foreach(b2::find($class_name, $conditions)->all() as $x)
		{
			if($obj = $this->get($x->id()))
				$obj->_set_prop_joined($x);
		}
	}