Strict Standards: Declaration of PluginAceadminpanel_ModuleLang::Get() should be compatible with ModuleLang::Get($sName, $aReplace = Array, $bDelete = true) in /home/deer/pages.org.ua/blog/plugins/aceadminpanel/classes/modules/lang/Lang.class.php on line 21 Strict Standards: Declaration of PluginAceadminpanel_ModuleViewer::_SortBlocks() should be compatible with ModuleViewer::_SortBlocks($a, $b) in /home/deer/pages.org.ua/blog/plugins/aceadminpanel/classes/modules/viewer/Viewer.class.php on line 24 init.php / Поиск по тегам / BPOU - Bitrix blog

Получаем UF свойства пользователя (отдельная функция)

function get_user_prop ($id, $prop = "*") {
	if (!($id > 0)) return false;
	if (!is_array($prop)) $prop = array($prop);
	global $DB;
	$res = $DB->query("SELECT ".implode(",", array_map("mysql_real_escape_string", $prop))." FROM `b_uts_user` WHERE VALUE_ID = $id");
	$res = $res->Fetch();
	if (!empty($res)) {
		foreach ($res as $key => $value) {
			if (preg_match("/^a:\d+:{.*?}$/", $value)) {
				$res[$key] = unserialize($value);
			}
		}
	}
	return $res;
}

Подсветки PHP в редакторе

Для реализации подсветки php-синтаксиса в редакторе, вставляем в /bitrix/php_interface/init.php следующее:

<?
# code writen by Евгений Петриченко http://me.lt/327sA
if ($_SERVER['SCRIPT_NAME']=="/bitrix/admin/fileman_file_edit.php")
{
   AddEventHandler("main", "OnEpilog", "InitPHPHighlight");
   function InitPHPHighlight()
   {
      global $APPLICATION;
            $string='<link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css">
      <script src="http://codemirror.net/lib/codemirror.js"></script>
      <script src="http://codemirror.net/mode/xml/xml.js"></script>
      <link rel="stylesheet" href="http://codemirror.net/mode/javascript/javascript.css">
      <link rel="stylesheet" href="http://codemirror.net/mode/clike/clike.css">
      <script src="http://codemirror.net/mode/javascript/javascript.js"></script>
      <script src="http://codemirror.net/mode/php/php.js"></script>
      <script src="http://codemirror.net/mode/clike/clike.js"></script>
      <style>

      .CodeMirror {
        overflow: auto;
        background:white;
        height: 500px;
        width: 1000px;
        line-height: 1em;
        font-family: inherit;
      }
      .CodeMirror pre{

        font-size:15px;
        line-height: 1.2em;
      }
      </style>';
   $init='<script type=\'text/javascript\'>
            BX.ready(function(){
            var nl=document.getElementsByTagName("textarea");

            var editor = CodeMirror.fromTextArea(nl[0], {
                     lineNumbers: true,
                     matchBrackets: true,
                     mode: "application/x-httpd-php",
                     indentUnit: 8,
                     indentWithTabs: true,
                     enterMode: "keep",
                     tabMode: "classic"
                    });});
            </script>';
      
      $APPLICATION->AddHeadString($string);      
      $APPLICATION->AddHeadString($init);
   }
}
?>