/**
  * @param FieldType $fieldType
  * @param $value
  * @return string
  */
 protected static function formatValuePrintable(FieldType $fieldType, $value)
 {
     if (isset($value['VALUE'])) {
         $value = $value['VALUE'];
     }
     if (isset($value['TEXT'])) {
         $value = $value['TEXT'];
     }
     return HTMLToTxt(htmlspecialcharsback((string) $value));
 }
Esempio n. 2
0
 static function getRightsLinks($arPage)
 {
     global $arParams, $APPLICATION;
     if (!is_array($arPage)) {
         $arPage = array($arPage);
     }
     $arLinks = array();
     $arParams['ELEMENT_NAME'] = htmlspecialcharsback($arParams['ELEMENT_NAME']);
     $arParams['ELEMENT_NAME'] = urlencode($arParams['ELEMENT_NAME']);
     if (in_array('categories', $arPage)) {
         return array();
     }
     if (in_array('article', $arPage) && !in_array('add', $arPage)) {
         $arLinks['article'] = array('NAME' => GetMessage('PAGE_ARTICLE'), 'TITLE' => GetMessage('PAGE_ARTICLE_TITLE'), 'CURRENT' => in_array('article', $arPage), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), 'ID' => 'article', 'TYPE' => 'page', 'IS_RED' => in_array('add', $arPage) ? 'Y' : 'N');
     }
     if (self::IsWriteable() && ((!in_array('history', $arPage) || in_array('history_diff', $arPage)) && (!in_array('add', $arPage) && !in_array('edit', $arPage) && !in_array('delete', $arPage) && !in_array('rename', $arPage)))) {
         if (IsModuleInstalled('bizproc')) {
             $arLinks['history'] = array('NAME' => GetMessage('PAGE_HISTORY'), 'TITLE' => GetMessage('PAGE_HISTORY_TITLE'), 'CURRENT' => in_array('history', $arPage), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_HISTORY'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'history') : array()), 'ID' => 'history', 'TYPE' => 'page', 'IS_RED' => 'N');
         }
     }
     if ($arParams['USE_REVIEW'] == 'Y') {
         $arLinks['discussion'] = array('NAME' => GetMessage('PAGE_DISCUSSION'), 'TITLE' => GetMessage('PAGE_DISCUSSION_TITLE'), 'CURRENT' => in_array('discussion', $arPage), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DISCUSSION'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'discussion') : array()), 'ID' => 'discussion', 'TYPE' => 'page', 'IS_RED' => 'N');
     }
     if (self::IsWriteable() && (!in_array('history', $arPage) && !in_array('history_diff', $arPage))) {
         $arLinks['add'] = array('NAME' => GetMessage('PAGE_ADD'), 'TITLE' => GetMessage('PAGE_ADD_TITLE'), 'CURRENT' => in_array('add', $arPage), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => GetMessage('WIKI_NEW_PAGE_TITLE'), 'group_id' => CWikiSocnet::$iSocNetId)), array($arParams['OPER_VAR'] => 'add')), 'ID' => 'add', 'TYPE' => 'edit', 'IS_RED' => in_array('add', $arPage) ? 'Y' : 'N');
         if (!in_array('add', $arPage)) {
             $arLinks['edit'] = array('NAME' => GetMessage('PAGE_EDIT'), 'TITLE' => GetMessage('PAGE_EDIT_TITLE'), 'CURRENT' => in_array('edit', $arPage), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => $arParams['ELEMENT_NAME'], 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'edit') : array()), 'ID' => 'edit', 'TYPE' => 'edit', 'IS_RED' => in_array('add', $arPage) ? 'Y' : 'N');
             $url = $APPLICATION->GetPopupLink(array('URL' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array($arParams['OPER_VAR'] => 'rename')), 'PARAMS' => array('width' => 400, 'height' => 150, 'resizable' => false)));
             $arLinks['rename'] = array('NAME' => GetMessage('WIKI_PAGE_RENAME'), 'TITLE' => GetMessage('WIKI_PAGE_RENAME_TITLE'), 'CURRENT' => in_array('rename', $arPage), 'LINK' => 'javascript:' . $url, 'ID' => 'rename', 'TYPE' => 'page');
             if (self::IsDeleteable()) {
                 $url = $APPLICATION->GetPopupLink(array('URL' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'], array('wiki_name' => $arParams['ELEMENT_ID'], 'group_id' => CWikiSocnet::$iSocNetId)), array($arParams['OPER_VAR'] => 'delete')), 'PARAMS' => array('width' => 400, 'height' => 150, 'resizable' => false)));
                 $arLinks['delete'] = array('NAME' => GetMessage('PAGE_DELETE'), 'TITLE' => GetMessage('PAGE_DELETE_TITLE'), 'CURRENT' => in_array('delete', $arPage), 'LINK' => 'javascript:' . $url, 'ID' => 'delete', 'TYPE' => 'edit', 'IS_RED' => 'N');
             }
         }
         /**	$arLinks['access'] = array(
         				'NAME' => GetMessage('PAGE_ACCESS'),
         				'TITLE' => GetMessage('PAGE_ACCESS_TITLE'),
         				'CURRENT' => in_array('access', $arPage),
         				'LINK' => CHTTP::urlAddParams(
         					CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST_EDIT'],
         						array(
         							'wiki_name' => $arParams['ELEMENT_NAME'],
         							'group_id' => CWikiSocnet::$iSocNetId
         						)
         					),
         					array($arParams['OPER_VAR'] => 'access')
         				),
         				'ID' => 'access',
         				'TYPE' => 'edit',
         				'IS_RED' => 'N'
         			); **/
     }
     return $arLinks;
 }
Esempio n. 3
0
function CheckFilter(&$str_error)
{
    global $strError, $MESS, $HTTP_GET_VARS, $arrFORM_FILTER;
    global $find_date_create_1, $find_date_create_2;
    $str = "";
    CheckFilterDates($find_date_create_1, $find_date_create_2, $date1_wrong, $date2_wrong, $date2_less);
    if ($date1_wrong == "Y") {
        $str .= GetMessage("FORM_WRONG_DATE_CREATE_FROM") . "<br>";
    }
    if ($date2_wrong == "Y") {
        $str .= GetMessage("FORM_WRONG_DATE_CREATE_TO") . "<br>";
    }
    if ($date2_less == "Y") {
        $str .= GetMessage("FORM_FROM_TILL_DATE_CREATE") . "<br>";
    }
    if (is_array($arrFORM_FILTER)) {
        reset($arrFORM_FILTER);
        foreach ($arrFORM_FILTER as $arrF) {
            if (is_array($arrF)) {
                foreach ($arrF as $arr) {
                    $title = $arr["TITLE_TYPE"] == "html" ? strip_tags(htmlspecialcharsback($arr["TITLE"])) : $arr["TITLE"];
                    if ($arr["FILTER_TYPE"] == "date") {
                        $date1 = $HTTP_GET_VARS["find_" . $arr["FID"] . "_1"];
                        $date2 = $HTTP_GET_VARS["find_" . $arr["FID"] . "_2"];
                        CheckFilterDates($date1, $date2, $date1_wrong, $date2_wrong, $date2_less);
                        if ($date1_wrong == "Y") {
                            $str .= str_replace("#TITLE#", $title, GetMessage("FORM_WRONG_DATE1")) . "<br>";
                        }
                        if ($date2_wrong == "Y") {
                            $str .= str_replace("#TITLE#", $title, GetMessage("FORM_WRONG_DATE2")) . "<br>";
                        }
                        if ($date2_less == "Y") {
                            $str .= str_replace("#TITLE#", $title, GetMessage("FORM_DATE2_LESS")) . "<br>";
                        }
                    }
                    if ($arr["FILTER_TYPE"] == "integer") {
                        $int1 = intval($HTTP_GET_VARS["find_" . $arr["FID"] . "_1"]);
                        $int2 = intval($HTTP_GET_VARS["find_" . $arr["FID"] . "_2"]);
                        if ($int1 > 0 && $int2 > 0 && $int2 < $int1) {
                            $str .= str_replace("#TITLE#", $title, GetMessage("FORM_INT2_LESS")) . "<br>";
                        }
                    }
                }
            }
        }
    }
    $strError .= $str;
    $str_error .= $str;
    if (strlen($str) > 0) {
        return false;
    } else {
        return true;
    }
}
Esempio n. 4
0
	function __FormResultListCheckFilter(&$str_error, &$arrFORM_FILTER) // check of filter values
	{
		global $strError, $_GET;
		global $find_date_create_1, $find_date_create_2;
		$str = "";

		CheckFilterDates($find_date_create_1, $find_date_create_2, $date1_wrong, $date2_wrong, $date2_less);
		if ($date1_wrong=="Y") $str.= GetMessage("FORM_WRONG_DATE_CREATE_FROM")."<br />";
		if ($date2_wrong=="Y") $str.= GetMessage("FORM_WRONG_DATE_CREATE_TO")."<br />";
		if ($date2_less=="Y") $str.= GetMessage("FORM_FROM_TILL_DATE_CREATE")."<br />";

		if (is_array($arrFORM_FILTER))
		{
			reset($arrFORM_FILTER);
			foreach ($arrFORM_FILTER as $arrF)
			{
				if (is_array($arrF))
				{
					foreach ($arrF as $arr)
					{
						$title = ($arr["TITLE_TYPE"]=="html") ? strip_tags(htmlspecialcharsback($arr["TITLE"])) : $arr["TITLE"];
						if ($arr["FILTER_TYPE"]=="date")
						{
							$date1 = $_GET["find_".$arr["FID"]."_1"];
							$date2 = $_GET["find_".$arr["FID"]."_2"];

							CheckFilterDates($date1, $date2, $date1_wrong, $date2_wrong, $date2_less);

							if ($date1_wrong=="Y")
								$str .= str_replace("#TITLE#", $title, GetMessage("FORM_WRONG_DATE1"))."<br />";
							if ($date2_wrong=="Y")
								$str .= str_replace("#TITLE#", $title, GetMessage("FORM_WRONG_DATE2"))."<br />";
							if ($date2_less=="Y")
								$str .= str_replace("#TITLE#", $title, GetMessage("FORM_DATE2_LESS"))."<br />";
						}
						if ($arr["FILTER_TYPE"]=="integer")
						{
							$int1 = intval($_GET["find_".$arr["FID"]."_1"]);
							$int2 = intval($_GET["find_".$arr["FID"]."_2"]);
							if ($int1>0 && $int2>0 && $int2<$int1)
							{
								$str .= str_replace("#TITLE#", $title, GetMessage("FORM_INT2_LESS"))."<br />";
							}
						}
					}
				}
			}
		}

		$strError .= $str;
		$str_error .= $str;

		return strlen($str) <= 0;
	}
Esempio n. 5
0
function __GetSubmenu($menu)
{
	global $aUserOpt, $bSkipRecent;

	$aPopup = array();
	if (is_array($menu))
	{
		foreach($menu as $item)
		{
			if(!is_array($item))
				continue;

			$aItem = array(
				"TEXT"=>$item["text"],
				"TITLE"=>($aUserOpt['start_menu_title'] <> 'N'? $item["title"] : ''),
				"ICON"=>$item["icon"],
			);
			if($item["url"] <> "")
			{
				$link = htmlspecialcharsback($item["url"]);
				if(strpos($link, "/bitrix/admin/") !== 0)
					$link = "/bitrix/admin/".$link;

				if ($_REQUEST['back_url_pub'])
					$link .= (strpos($link, '?') > 0 ? '&' : '?')."back_url_pub=".urlencode($_REQUEST["back_url_pub"]);

				$aItem['LINK'] = $link;

				if (!$bSkipRecent)
					$aItem['ONCLICK'] = 'BX.admin.startMenuRecent('.CUtil::PhpToJsObject($aItem).')';
			}

			if(is_array($item["items"]) && count($item["items"])>0)
			{
				$aItem["MENU"] = __GetSubmenu($item["items"]);
				if($item["url"] <> "" && $aUserOpt['start_menu_title'] <> 'N')
					$aItem["TITLE"] .= ' '.GetMessage("get_start_menu_dbl");
			}
			elseif($item["dynamic"] == true)
			{
				$aItem["MENU_URL"] = '/bitrix/admin/get_start_menu.php?mode=dynamic&lang='.LANGUAGE_ID.'&admin_mnu_module_id='.urlencode($item['module_id']).'&admin_mnu_menu_id='.urlencode($item['items_id']).($bSkipRecent?'&skip_recent=Y':'').($_REQUEST["back_url_pub"]<>''? '&back_url_pub='.urlencode($_REQUEST["back_url_pub"]):'').'&'.bitrix_sessid_get();
				$aItem['MENU_PRELOAD'] = false;

				if($item["url"] <> "" && $aUserOpt['start_menu_title'] <> 'N')
					$aItem["TITLE"] .= ' '.GetMessage("get_start_menu_dbl");
			}

			$aPopup[] = $aItem;
		}
	}

	return $aPopup;
}
Esempio n. 6
0
 static function getMap()
 {
     $arMap = parent::getMap();
     static::$_metadata = static::getMetadata();
     $IBLOCK_VERSION = CIBlock::GetArrayByID(static::$IBLOCK_ID, 'VERSION');
     $singleEntity = SinglePropertyElementTable::createEntity(static::$IBLOCK_ID, $IBLOCK_VERSION);
     $arMap['PROPERTY'] = new ReferenceField('PROPERTY', $singleEntity->getDataClass(), array('ref.IBLOCK_ELEMENT_ID' => 'this.ID'), array('join_type' => 'INNER'));
     $multiEntity = MultiplePropertyElementTable::createEntity(static::$IBLOCK_ID, $IBLOCK_VERSION);
     foreach (static::$_metadata['props'] as $arProp) {
         $arPropParams = [];
         $arFetchDataModifications = [];
         if ($arProp['PROPERTY_TYPE'] == 'N') {
             $arFetchDataModifications[] = function ($value) {
                 return (double) $value;
             };
         }
         if ($arProp['MULTIPLE'] == 'Y') {
             $refCode = 'PROPERTY_' . $arProp['CODE'] . '_ENTITY';
             $arMap[] = new ReferenceField($refCode, $multiEntity->getDataClass(), array('ref.IBLOCK_ELEMENT_ID' => 'this.ID', 'ref.IBLOCK_PROPERTY_ID' => array('?i', $arProp['ID'])), array('join_type' => 'INNER'));
             foreach (self::getAliases($arProp['CODE'], true) as $alias) {
                 $arMap[] = new ExpressionField($alias, '%s', 'PROPERTY.' . $arProp['CODE'], ['fetch_data_modification' => function () {
                     return [function ($value) {
                         return unserialize(htmlspecialcharsback($value))['VALUE'];
                     }];
                 }]);
             }
             $expressionCode = 'PROPERTY_' . $arProp['CODE'] . '_ENTITY.VALUE';
         } else {
             $expressionCode = 'PROPERTY.' . $arProp['CODE'];
         }
         if ($arFetchDataModifications) {
             $arPropParams['fetch_data_modification'] = function () use($arFetchDataModifications) {
                 return $arFetchDataModifications;
             };
         }
         foreach (self::getAliases($arProp['CODE']) as $alias) {
             $arMap[$alias] = new ExpressionField($alias, '%s', $expressionCode, $arPropParams);
         }
     }
     foreach (static::$arFieldsAlias as $PHP => $JS) {
         $params = [];
         if ($JS == 'id') {
             $params['fetch_data_modification'] = function () {
                 return [function ($value) {
                     return (int) $value;
                 }];
             };
         }
         $arMap[] = new ExpressionField($JS, '%s', [$PHP], $params);
     }
     return $arMap;
 }
Esempio n. 7
0
function convert_image($img = "", $query = "", $param = "")
{
    if (is_array($img)) {
        $param = $img[3];
        $query = $img[2];
        $img = $img[1];
    } else {
        $param = stripslashes($param);
        $query = stripslashes($query);
        $img = stripslashes($img);
    }
    $params = array();
    parse_str(htmlspecialcharsback($query), $params);
    return $img . $params['fname'] . $param;
}
Esempio n. 8
0
 protected function tryToGetValue($srcName, &$srcData, &$value, &$map, $htmldecode = false)
 {
     if ($value !== '') {
         $value = '';
     }
     if (!isset($map[$srcName])) {
         return false;
     }
     $k = $map[$srcName];
     $value = isset($srcData[$k]) ? $srcData[$k] : '';
     if ($htmldecode) {
         $value = htmlspecialcharsback($value);
     }
     return true;
 }
Esempio n. 9
0
 public static function convertHtmlToBbCode($html)
 {
     $html = strval($html);
     if ($html === '') {
         return '';
     }
     $eventManager = \Bitrix\Main\EventManager::getInstance();
     $eventKey = $eventManager->addEventHandlerCompatible("main", "TextParserBeforeTags", array("\\Bitrix\\Crm\\Format\\TextHelper", "onTextParserBeforeTags"));
     $textParser = new \CTextParser();
     $textParser->allow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "VIDEO" => "Y", "TABLE" => "Y", "CUT_ANCHOR" => "Y", "ALIGN" => "Y");
     $result = $textParser->convertText($html);
     $result = htmlspecialcharsback($result);
     $result = preg_replace("/\\<br\\s*\\/*\\>/is" . BX_UTF_PCRE_MODIFIER, "\n", $result);
     $result = preg_replace("/&nbsp;/is" . BX_UTF_PCRE_MODIFIER, "", $result);
     $result = preg_replace("/\\<([^>]*?)>/is" . BX_UTF_PCRE_MODIFIER, "", $result);
     $result = htmlspecialcharsbx($result);
     $eventManager->removeEventHandler("main", "TextParserBeforeTags", $eventKey);
     return $result;
 }
Esempio n. 10
0
?>
',
					controller : <?php 
echo $controller;
?>
,
					CID : "<?php 
echo $arResult['CONTROL_UID'];
?>
",
					id : "<?php 
echo $arParams['CONTROL_ID'];
?>
",
					upload_path : "<?php 
echo CUtil::JSEscape(htmlspecialcharsback(POST_FORM_ACTION_URI));
?>
",
					multiple : <?php 
echo $arParams['MULTIPLE'] == 'N' ? 'false' : 'true';
?>
,
					inputName : "<?php 
echo CUtil::JSEscape($controlName);
?>
",
					status : status
			});
		});
		<?php 
if (sizeof($arValue) >= 1) {
Esempio n. 11
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("photogallery")) {
    // !important
    return ShowError(GetMessage("P_MODULE_IS_NOT_INSTALLED"));
} elseif (!IsModuleInstalled("iblock")) {
    // !important
    return ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
}
if (!isset($arParams["ACTION_URL"])) {
    $arParams["ACTION_URL"] = htmlspecialcharsback(POST_FORM_ACTION_URI);
} else {
    $arParams["CHECK_ACTION_URL"] = "Y";
}
// Used to rerequest ACTION_URL from POST_FORM_ACTION_URI in GET request for make action_url work correct with no mod_rewrite installed
$arParams["ACTION_URL"] = CHTTP::urlDeleteParams($arParams["ACTION_URL"], array("clear_cache", "bitrix_include_areas", "bitrix_show_mode", "back_url_admin", "bx_photo_ajax", "change_view_mode_data", "sessid", "load_comments"));
/********************************************************************
				For custom components
********************************************************************/
$arParams["PROPERTY_CODE"] = !is_array($arParams["PROPERTY_CODE"]) ? array() : $arParams["PROPERTY_CODE"];
$arParams["ELEMENT_SORT_FIELD"] = strtoupper($arParams["ELEMENT_SORT_FIELD"]);
$arParams["ELEMENT_SORT_FIELD1"] = strtoupper($arParams["ELEMENT_SORT_FIELD1"]);
$arParams["COMMENTS_TYPE"] = strtoupper($arParams["COMMENTS_TYPE"]);
$arParams["IS_SOCNET"] = $arParams["IS_SOCNET"] == "Y" ? "Y" : "N";
$arParams["USE_RATING"] = $arParams["USE_RATING"] == "Y" || $arParams["SHOW_RATING"] == "Y" ? "Y" : "N";
$arParams["SHOW_TAGS"] = $arParams["SHOW_TAGS"] != "N" ? "Y" : "N";
$arParams["MODERATION"] = $arParams["MODERATION"] == "Y" ? "Y" : "N";
if (!isset($arParams["DISPLAY_AS_RATING"]) || !$arParams["DISPLAY_AS_RATING"]) {
Esempio n. 12
0
include $_SERVER["DOCUMENT_ROOT"] . $this->GetFolder() . "/lang/" . LANGUAGE_ID . "/result_modifier.php";
$arActiveFeatures = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $arParams["SOCNET_USER_ID"]);
$events = GetModuleEvents("socialnetwork", "OnFillSocNetMenu");
while ($arEvent = $events->Fetch()) {
    ExecuteModuleEventEx($arEvent, array(&$arMenuTmp, array("ENTITY_TYPE" => SONET_ENTITY_USER, "ENTITY_ID" => $arParams["SOCNET_USER_ID"])));
}
$arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
foreach ($arSocNetFeaturesSettings as $feature_id => $arFeatureTmp) {
    if (array_key_exists("allowed", $arFeatureTmp) && is_array($arFeatureTmp["allowed"]) && count($arFeatureTmp["allowed"]) > 0 && !in_array(SONET_ENTITY_USER, $arFeatureTmp["allowed"])) {
        continue;
    }
    $arFeaturesTitles[$feature_id] = array_key_exists($feature_id, $arActiveFeatures) && StrLen($arActiveFeatures[$feature_id]) > 0 ? $arActiveFeatures[$feature_id] : (is_array($arMenuTmp) && array_key_exists("Title", $arMenuTmp) && is_array($arMenuTmp["Title"]) && array_key_exists($feature_id, $arMenuTmp["Title"]) && strlen($arMenuTmp["Title"][$feature_id]) > 0 ? $arMenuTmp["Title"][$feature_id] : GetMessage("SEARCH_CONTENT_TYPE_" . strtoupper($feature_id) . "_" . SONET_ENTITY_USER));
}
if (array_key_exists("PATH_TO_USER_TASKS_SECTION", $arParams)) {
    $arParams["PATH_TO_USER_TASKS_SECTION"] .= (strpos($arParams["PATH_TO_USER_TASKS_SECTION"], "?") !== false ? "&" : "?") . "flt_iblock_section=#section_id#";
    $arParams["~PATH_TO_USER_TASKS_SECTION"] = htmlspecialcharsback($arParams["PATH_TO_USER_TASKS_SECTION"]);
}
$strParams = "q=" . urlencode($_REQUEST["q"]);
if ($_REQUEST["where"] !== false && strlen(trim($_REQUEST["where"])) > 0) {
    $strParams .= "&amp;where=" . urlencode(trim($_REQUEST["where"]));
}
if ($GLOBALS[$arParams["FILTER_NAME"]]["SONET_FEATURE"] !== false && strlen(trim($GLOBALS[$arParams["FILTER_NAME"]]["SONET_FEATURE"])) > 0) {
    $strParams .= "&amp;" . $arParams["FILTER_NAME"] . "=" . urlencode(trim($GLOBALS[$arParams["FILTER_NAME"]]["SONET_FEATURE"]));
}
if ($_REQUEST[$arParams["FILTER_DATE_NAME"] . "_from"] !== false && strlen(trim($_REQUEST[$arParams["FILTER_DATE_NAME"] . "_from"])) > 0) {
    $strParams .= "&amp;" . $arParams["FILTER_DATE_NAME"] . "_from" . "=" . urlencode(trim($_REQUEST[$arParams["FILTER_DATE_NAME"] . "_from"]));
}
if ($_REQUEST[$arParams["FILTER_DATE_NAME"] . "_to"] !== false && strlen(trim($_REQUEST[$arParams["FILTER_DATE_NAME"] . "_to"])) > 0) {
    $strParams .= "&amp;" . $arParams["FILTER_DATE_NAME"] . "_to" . "=" . urlencode(trim($_REQUEST[$arParams["FILTER_DATE_NAME"] . "_to"]));
}
if ($_REQUEST["tags"] !== false && strlen(trim($_REQUEST["tags"])) > 0) {
Esempio n. 13
0
 public function DeleteUser($chatId, $userId, $checkPermission = true)
 {
     global $DB;
     $chatId = intval($chatId);
     $userId = intval($userId);
     if ($chatId <= 0 || $userId <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_EMPTY_USER_OR_CHAT"), "EMPTY_USER_OR_CHAT");
         return false;
     }
     $strSql = "\n\t\t\tSELECT R.CHAT_ID, C.TITLE CHAT_TITLE, C.AUTHOR_ID CHAT_AUTHOR_ID, C.EXTRANET CHAT_EXTRANET, C.TYPE CHAT_TYPE\n\t\t\tFROM b_im_relation R LEFT JOIN b_im_chat C ON R.CHAT_ID = C.ID\n\t\t\tWHERE R.USER_ID = " . $userId . " AND R.MESSAGE_TYPE IN ('" . IM_MESSAGE_OPEN . "','" . IM_MESSAGE_CHAT . "') AND R.CHAT_ID = " . $chatId;
     $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if ($arRes = $dbRes->Fetch()) {
         $extranetFlag = $arRes["CHAT_EXTRANET"] == "" ? "" : ($arRes["CHAT_EXTRANET"] == "Y" ? true : false);
         $chatTitle = $arRes['CHAT_TITLE'];
         $chatType = $arRes['CHAT_TYPE'];
         $chatAuthorId = intval($arRes['CHAT_AUTHOR_ID']);
         if ($chatAuthorId == $userId) {
             $strSql = "\n\t\t\t\t\tSELECT R.USER_ID\n\t\t\t\t\tFROM b_im_relation R\n\t\t\t\t\tWHERE R.CHAT_ID = " . $chatId . " AND R.USER_ID <> " . $chatAuthorId;
             $strSql = $DB->TopSql($strSql, 1);
             $dbRes = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
             if ($arRes = $dbRes->Fetch()) {
                 $strSql = "UPDATE b_im_chat SET AUTHOR_ID = " . $arRes['USER_ID'] . " WHERE ID = " . $chatId;
                 $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
             }
         }
         $bSelf = true;
         $arUsers = array($userId);
         if (is_object($GLOBALS["USER"]) && $GLOBALS["USER"]->GetId() != $userId) {
             if ($checkPermission && $chatAuthorId != $GLOBALS["USER"]->GetId()) {
                 $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_KICK"), "IM_ERROR_KICK");
                 return false;
             }
             $bSelf = false;
             $arUsers[] = $GLOBALS["USER"]->GetId();
         }
         $arOldRelation = CIMChat::GetRelationById($chatId);
         $arUsers = CIMContactList::GetUserData(array('ID' => array_keys($arOldRelation), 'DEPARTMENT' => 'N', 'USE_CACHE' => 'N'));
         $arUsers = $arUsers['users'];
         if ($bSelf) {
             $message = GetMessage("IM_CHAT_LEAVE_" . $arUsers[$userId]['gender'], array('#USER_NAME#' => htmlspecialcharsback($arUsers[$userId]['name'])));
         } else {
             $message = GetMessage("IM_CHAT_KICK_" . $arUsers[$GLOBALS["USER"]->GetId()]['gender'], array('#USER_1_NAME#' => htmlspecialcharsback($arUsers[$GLOBALS["USER"]->GetId()]['name']), '#USER_2_NAME#' => htmlspecialcharsback($arUsers[$userId]['name'])));
         }
         $CIMChat = new CIMChat($userId);
         $CIMChat->SetReadMessage($chatId);
         CIMContactList::CleanChatCache($userId);
         $publicPullWatch = false;
         if ($chatType == IM_MESSAGE_OPEN && CModule::IncludeModule("pull")) {
             $publicPullWatch = true;
         }
         $relationList = IM\RelationTable::getList(array("select" => array("ID", "USER_ID"), "filter" => array("=CHAT_ID" => $chatId, "=USER_ID" => $userId)));
         while ($relation = $relationList->fetch()) {
             if ($publicPullWatch && !$arUsers[$relation["USER_ID"]]['extranet']) {
                 CPullWatch::Add($relation["USER_ID"], 'IM_PUBLIC_' . $chatId, true);
             }
             Im\RelationTable::delete($relation["ID"]);
             CIMContactList::DeleteRecent($chatId, true, $relation["USER_ID"]);
             if ($extranetFlag !== false) {
                 $isExtranet = false;
                 foreach ($arUsers as $userData) {
                     if ($userData['id'] == $userId) {
                         continue;
                     }
                     if ($userData['extranet']) {
                         $isExtranet = true;
                         break;
                     }
                 }
                 if (!$isExtranet || $extranetFlag === "") {
                     IM\ChatTable::update($chatId, array('EXTRANET' => $isExtranet ? "Y" : "N"));
                 }
                 $extranetFlag = $isExtranet;
             }
         }
         CIMDisk::ChangeFolderMembers($chatId, $userId, false);
         self::AddMessage(array("TO_CHAT_ID" => $chatId, "MESSAGE" => $message, "FROM_USER_ID" => $this->user_id, "SYSTEM" => 'Y'));
         foreach ($arOldRelation as $rel) {
             CPullStack::AddByUser($rel['USER_ID'], array('module_id' => 'im', 'command' => 'chatUserLeave', 'params' => array('chatId' => $chatId, 'chatTitle' => $chatTitle, 'userId' => $userId, 'message' => $bSelf ? '' : htmlspecialcharsbx($message))));
         }
         return true;
     }
     $GLOBALS["APPLICATION"]->ThrowException(GetMessage("IM_ERROR_USER_NOT_FOUND"), "USER_NOT_FOUND");
     return false;
 }
Esempio n. 14
0
             continue;
         }
     } else {
         if (!array_key_exists($arEvents["EVENT_ID"], $arSocNetFeaturesSettings) || !CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arEvents["ENTITY_ID"], $arEvents["EVENT_ID"], $arSocNetFeaturesSettings[$arEvents["EVENT_ID"]]["minoperation"][0], $bCurrentUserIsAdmin)) {
             continue;
         }
     }
     $path2Entity = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arEvents["ENTITY_ID"]));
 }
 $arDateTmp = ParseDateTime($arEvents["LOG_DATE"], CSite::GetDateFormat('FULL'));
 $day = IntVal($arDateTmp["DD"]);
 $month = IntVal($arDateTmp["MM"]);
 $year = IntVal($arDateTmp["YYYY"]);
 $dateFormated = $day . ' ' . ToLower(GetMessage('MONTH_' . $month . '_S')) . ' ' . $year;
 $timeFormated = $arDateTmp["HH"] . ':' . $arDateTmp["MI"] . ':' . $arDateTmp["SS"];
 $arEvents["MESSAGE_FORMAT"] = htmlspecialcharsback($arEvents["MESSAGE"]);
 if (StrLen($arEvents["CALLBACK_FUNC"]) > 0) {
     if (StrLen($arEvents["MODULE_ID"]) > 0) {
         CModule::IncludeModule($arEvents["MODULE_ID"]);
     }
     $arEvents["MESSAGE_FORMAT"] = call_user_func($arEvents["CALLBACK_FUNC"], $arEvents);
 }
 if ($arEvents["EVENT_ID"] == "system" || $arEvents["EVENT_ID"] == "system_friends" || $arEvents["EVENT_ID"] == "system_groups") {
     $arEvents["TITLE_TEMPLATE"] = "";
     $arEvents["URL"] = "";
     switch ($arEvents["TITLE"]) {
         case "join":
             list($titleTmp, $messageTmp) = CSocNetLog::InitUsersTmp($arEvents["MESSAGE"], GetMessage("SONET_ACTIVITY_TITLE_JOIN1"), GetMessage("SONET_ACTIVITY_TITLE_JOIN2"), $arParams);
             $arEvents["TITLE"] = $titleTmp;
             $arEvents["MESSAGE_FORMAT"] = $messageTmp;
             break;
Esempio n. 15
0
     } elseif (is_array($arElement["arr_PREVIEW_PICTURE"])) {
         $arItem["enclosure"] = array("url" => CHTTP::URN2URI($arElement["arr_PREVIEW_PICTURE"]["SRC"], $arResult["SERVER_NAME"]), "length" => $arElement["arr_PREVIEW_PICTURE"]["FILE_SIZE"], "type" => $arElement["arr_PREVIEW_PICTURE"]["CONTENT_TYPE"]);
     } else {
         $arItem["enclosure"] = false;
     }
     if (strlen($arResult["NODES"]["category"]) > 0) {
         $arItem["category"] = str_replace($arNodesSearch, $arNodesReplace, $arResult["NODES"]["category"]);
     } else {
         $arItem["category"] = "";
         $rsNavChain = CIBlockSection::GetNavChain($arResult["ID"], $arElement["IBLOCK_SECTION_ID"]);
         while ($arNavChain = $rsNavChain->Fetch()) {
             $arItem["category"] .= htmlspecialcharsbx($arNavChain["NAME"]) . "/";
         }
     }
     if ($arParams["YANDEX"]) {
         $arItem["full-text"] = htmlspecialcharsbx(htmlspecialcharsback($arElement["DETAIL_TEXT"]));
     }
     if (strlen($arResult["NODES"]["pubDate"]) > 0) {
         $arItem["pubDate"] = str_replace($arNodesSearch, $arNodesReplace, $arResult["NODES"]["pubDate"]);
     } elseif (strlen($arElement["ACTIVE_FROM"]) > 0) {
         $arItem["pubDate"] = date("r", MkDateTime($DB->FormatDate($arElement["ACTIVE_FROM"], Clang::GetDateFormat("FULL"), "DD.MM.YYYY H:I:S"), "d.m.Y H:i:s"));
     } elseif (strlen($arElement["DATE_CREATE"]) > 0) {
         $arItem["pubDate"] = date("r", MkDateTime($DB->FormatDate($arElement["DATE_CREATE"], Clang::GetDateFormat("FULL"), "DD.MM.YYYY H:I:S"), "d.m.Y H:i:s"));
     } else {
         $arItem["pubDate"] = date("r");
     }
     $arItem["ELEMENT"] = $arElement;
     $arItem["PROPERTIES"] = $arProperties;
     $arResult["ITEMS"][] = $arItem;
 }
 $this->IncludeComponentTemplate();
Esempio n. 16
0
     if ($datetimeFilters) {
         $datetimeFilters["LOGIC"] = "OR";
         if ($arItem["IBLOCK_ID"] == $this->SKU_IBLOCK_ID) {
             if (!isset(${$FILTER_NAME}["OFFERS"])) {
                 ${$FILTER_NAME}["OFFERS"] = array();
             }
             ${$FILTER_NAME}["OFFERS"][] = $datetimeFilters;
         } else {
             ${$FILTER_NAME}[] = $datetimeFilters;
         }
     }
 } else {
     foreach ($arItem["VALUES"] as $key => $ar) {
         if ($ar["CHECKED"]) {
             $filterKey = "=PROPERTY_" . $PID;
             $backKey = htmlspecialcharsback($key);
             if ($arItem["IBLOCK_ID"] == $this->SKU_IBLOCK_ID) {
                 if (!isset(${$FILTER_NAME}["OFFERS"])) {
                     ${$FILTER_NAME}["OFFERS"] = array();
                 }
                 if (!isset(${$FILTER_NAME}["OFFERS"][$filterKey])) {
                     ${$FILTER_NAME}["OFFERS"][$filterKey] = array($backKey);
                 } elseif (!is_array(${$FILTER_NAME}["OFFERS"][$filterKey])) {
                     ${$FILTER_NAME}["OFFERS"][$filterKey] = array($filter[$filterKey], $backKey);
                 } elseif (!in_array($backKey, ${$FILTER_NAME}["OFFERS"][$filterKey])) {
                     ${$FILTER_NAME}["OFFERS"][$filterKey][] = $backKey;
                 }
             } else {
                 if (!isset(${$FILTER_NAME}[$filterKey])) {
                     ${$FILTER_NAME}[$filterKey] = array($backKey);
                 } elseif (!is_array(${$FILTER_NAME}[$filterKey])) {
Esempio n. 17
0
Authorization form (for prolog)
Params:
	REGISTER_URL => path to page with authorization script (component?)
	PROFILE_URL => path to page with profile component
*/
$arParamsToDelete = array("login", "logout", "register", "forgot_password", "change_password", "confirm_registration", "confirm_code", "confirm_user_id", "logout_butt", "auth_service_id");
$currentUrl = $APPLICATION->GetCurPageParam("", $arParamsToDelete);
$arResult["BACKURL"] = $currentUrl;
$arResult['ERROR'] = false;
$arResult['SHOW_ERRORS'] = array_key_exists('SHOW_ERRORS', $arParams) && $arParams['SHOW_ERRORS'] == 'Y' ? 'Y' : 'N';
if (!$USER->IsAuthorized()) {
    $arResult["FORM_TYPE"] = "login";
    $arResult["STORE_PASSWORD"] = COption::GetOptionString("main", "store_password", "Y") == "Y" ? "Y" : "N";
    $arResult["NEW_USER_REGISTRATION"] = COption::GetOptionString("main", "new_user_registration", "N") == "Y" ? "Y" : "N";
    if (defined("AUTH_404")) {
        $arResult["AUTH_URL"] = htmlspecialcharsback(POST_FORM_ACTION_URI);
    } else {
        $arResult["AUTH_URL"] = $APPLICATION->GetCurPageParam("login=yes", array_merge($arParamsToDelete, array("logout_butt", "backurl")));
    }
    $arParams["REGISTER_URL"] = $arParams["REGISTER_URL"] != '' ? $arParams["REGISTER_URL"] : $currentUrl;
    $arParams["FORGOT_PASSWORD_URL"] = $arParams["FORGOT_PASSWORD_URL"] != '' ? $arParams["FORGOT_PASSWORD_URL"] : $arParams["REGISTER_URL"];
    $url = urlencode($APPLICATION->GetCurPageParam("", array_merge($arParamsToDelete, array("backurl"))));
    $custom_reg_page = COption::GetOptionString('main', 'custom_register_page');
    $arResult["AUTH_REGISTER_URL"] = $custom_reg_page != '' ? $custom_reg_page : $arParams["REGISTER_URL"] . (strpos($arParams["REGISTER_URL"], "?") !== false ? "&" : "?") . "register=yes&backurl=" . $url;
    $arResult["AUTH_FORGOT_PASSWORD_URL"] = $arParams["FORGOT_PASSWORD_URL"] . (strpos($arParams["FORGOT_PASSWORD_URL"], "?") !== false ? "&" : "?") . "forgot_password=yes&backurl=" . $url;
    $arRes = array();
    foreach ($arResult as $key => $value) {
        $arRes[$key] = htmlspecialcharsbx($value);
        $arRes['~' . $key] = $value;
    }
    $arResult = $arRes;
Esempio n. 18
0
 function __SLEGetLogCommentRecord($arComments, $arParams, &$arAssets)
 {
     // for the same post log_update - time only, if not - date and time
     $timestamp = MakeTimeStamp(array_key_exists("LOG_DATE_FORMAT", $arComments) ? $arComments["LOG_DATE_FORMAT"] : $arComments["LOG_DATE"]);
     $timeFormated = FormatDateFromDB($arComments["LOG_DATE"], stripos($arParams["DATE_TIME_FORMAT"], 'a') || ($arParams["DATE_TIME_FORMAT"] == 'FULL' && IsAmPmMode()) !== false ? strpos(FORMAT_DATETIME, 'TT') !== false ? 'G:MI TT' : 'G:MI T' : 'HH:MI');
     $dateTimeFormated = FormatDate(!empty($arParams['DATE_TIME_FORMAT']) ? $arParams['DATE_TIME_FORMAT'] == 'FULL' ? $GLOBALS['DB']->DateFormatToPHP(str_replace(':SS', '', FORMAT_DATETIME)) : $arParams['DATE_TIME_FORMAT'] : $GLOBALS['DB']->DateFormatToPHP(FORMAT_DATETIME), $timestamp);
     if (strcasecmp(LANGUAGE_ID, 'EN') !== 0 && strcasecmp(LANGUAGE_ID, 'DE') !== 0) {
         $dateTimeFormated = ToLower($dateTimeFormated);
     }
     // strip current year
     if (!empty($arParams['DATE_TIME_FORMAT']) && ($arParams['DATE_TIME_FORMAT'] == 'j F Y G:i' || $arParams['DATE_TIME_FORMAT'] == 'j F Y g:i a')) {
         $dateTimeFormated = ltrim($dateTimeFormated, '0');
         $curYear = date('Y');
         $dateTimeFormated = str_replace(array('-' . $curYear, '/' . $curYear, ' ' . $curYear, '.' . $curYear), '', $dateTimeFormated);
     }
     $path2Entity = $arComments["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arComments["ENTITY_ID"])) : CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComments["ENTITY_ID"]));
     if (intval($arComments["USER_ID"]) > 0) {
         $suffix = is_array($GLOBALS["arExtranetUserID"]) && in_array($arComments["USER_ID"], $GLOBALS["arExtranetUserID"]) ? GetMessage("SONET_LOG_EXTRANET_SUFFIX") : "";
         $arTmpUser = array("NAME" => $arComments["~CREATED_BY_NAME"], "LAST_NAME" => $arComments["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComments["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComments["~CREATED_BY_LOGIN"]);
         $bUseLogin = $arParams["SHOW_LOGIN"] != "N" ? true : false;
         $arCreatedBy = array("FORMATTED" => CUser::FormatName($arParams["NAME_TEMPLATE"], $arTmpUser, $bUseLogin) . $suffix, "URL" => CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arComments["USER_ID"], "id" => $arComments["USER_ID"])));
         $arCreatedBy["TOOLTIP_FIELDS"] = array("ID" => $arComments["USER_ID"], "NAME" => $arComments["~CREATED_BY_NAME"], "LAST_NAME" => $arComments["~CREATED_BY_LAST_NAME"], "SECOND_NAME" => $arComments["~CREATED_BY_SECOND_NAME"], "LOGIN" => $arComments["~CREATED_BY_LOGIN"], "USE_THUMBNAIL_LIST" => "N", "PATH_TO_SONET_MESSAGES_CHAT" => $arParams["PATH_TO_MESSAGES_CHAT"], "PATH_TO_SONET_USER_PROFILE" => $arParams["PATH_TO_USER"], "PATH_TO_VIDEO_CALL" => $arParams["PATH_TO_VIDEO_CALL"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "SHOW_YEAR" => $arParams["SHOW_YEAR"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"] . $suffix, "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "PATH_TO_CONPANY_DEPARTMENT" => $arParams["PATH_TO_CONPANY_DEPARTMENT"], "INLINE" => "Y");
     } else {
         $arCreatedBy = array("FORMATTED" => GetMessage("SONET_C73_CREATED_BY_ANONYMOUS"));
     }
     $arTmpUser = array("NAME" => $arComments["~USER_NAME"], "LAST_NAME" => $arComments["~USER_LAST_NAME"], "SECOND_NAME" => $arComments["~USER_SECOND_NAME"], "LOGIN" => $arComments["~USER_LOGIN"]);
     $arParamsTmp = $arParams;
     $arParamsTmp["AVATAR_SIZE"] = isset($arParams["AVATAR_SIZE_COMMON"]) ? $arParams["AVATAR_SIZE_COMMON"] : $arParams["AVATAR_SIZE"];
     $arTmpCommentEvent = array("EVENT" => $arComments, "LOG_DATE" => $arComments["LOG_DATE"], "LOG_DATE_TS" => MakeTimeStamp($arComments["LOG_DATE"]), "LOG_DATE_DAY" => ConvertTimeStamp(MakeTimeStamp($arComments["LOG_DATE"]), "SHORT"), "LOG_TIME_FORMAT" => $timeFormated, "LOG_DATETIME_FORMAT" => $dateTimeFormated, "TITLE_TEMPLATE" => "", "TITLE" => "", "TITLE_FORMAT" => "", "ENTITY_NAME" => $arComments["ENTITY_TYPE"] == SONET_ENTITY_GROUP ? $arComments["GROUP_NAME"] : CUser::FormatName($arParams['NAME_TEMPLATE'], $arTmpUser, $bUseLogin), "ENTITY_PATH" => $path2Entity, "CREATED_BY" => $arCreatedBy, "AVATAR_SRC" => CSocNetLogTools::FormatEvent_CreateAvatar($arComments, $arParamsTmp));
     $arEvent = CSocNetLogTools::FindLogCommentEventByID($arComments["EVENT_ID"]);
     if ($arEvent && array_key_exists("CLASS_FORMAT", $arEvent) && array_key_exists("METHOD_FORMAT", $arEvent)) {
         $arLog = $arParams["USER_COMMENTS"] == "Y" ? array() : array("TITLE" => $arComments["~LOG_TITLE"], "URL" => $arComments["~LOG_URL"], "PARAMS" => $arComments["~LOG_PARAMS"]);
         $arFIELDS_FORMATTED = call_user_func(array($arEvent["CLASS_FORMAT"], $arEvent["METHOD_FORMAT"]), $arComments, $arParams, false, $arLog);
         if ($arParams["USE_COMMENTS"] != "Y") {
             if (array_key_exists("CREATED_BY", $arFIELDS_FORMATTED) && isset($arFIELDS_FORMATTED["CREATED_BY"]["TOOLTIP_FIELDS"])) {
                 $arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"] = $arFIELDS_FORMATTED["CREATED_BY"]["TOOLTIP_FIELDS"];
             }
         }
     }
     $message = $arFIELDS_FORMATTED && array_key_exists("EVENT_FORMATTED", $arFIELDS_FORMATTED) && array_key_exists("MESSAGE", $arFIELDS_FORMATTED["EVENT_FORMATTED"]) ? $arFIELDS_FORMATTED["EVENT_FORMATTED"]["MESSAGE"] : $arTmpCommentEvent["EVENT"]["MESSAGE"];
     if (strlen($message) > 0) {
         $arFIELDS_FORMATTED["EVENT_FORMATTED"]["FULL_MESSAGE_CUT"] = CSocNetTextParser::closetags(htmlspecialcharsback($message));
     }
     if (is_array($arTmpCommentEvent)) {
         $arFIELDS_FORMATTED["EVENT_FORMATTED"]["DATETIME"] = $arTmpCommentEvent["LOG_DATE_DAY"] == ConvertTimeStamp() ? $timeFormated : $dateTimeFormated;
         $arTmpCommentEvent["EVENT_FORMATTED"] = $arFIELDS_FORMATTED["EVENT_FORMATTED"];
         if (isset($arComments["UF"]["UF_SONET_COM_URL_PRV"]) && !empty($arComments["UF"]["UF_SONET_COM_URL_PRV"]["VALUE"])) {
             $arCss = $GLOBALS["APPLICATION"]->sPath2css;
             $arJs = $GLOBALS["APPLICATION"]->arHeadScripts;
             ob_start();
             $GLOBALS["APPLICATION"]->IncludeComponent("bitrix:system.field.view", $arComments["UF"]["UF_SONET_COM_URL_PRV"]["USER_TYPE_ID"], array("arUserField" => $arComments["UF"]["UF_SONET_COM_URL_PRV"], "arAddField" => array("NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "PATH_TO_USER" => $arParams["~PATH_TO_USER"])), null, array("HIDE_ICONS" => "Y"));
             $urlPreviewText = ob_get_clean();
             $arTmpCommentEvent["EVENT_FORMATTED"]["FULL_MESSAGE_CUT"] .= $urlPreviewText;
             $arAssets["CSS"] = array_merge($arAssets["CSS"], array_diff($GLOBALS["APPLICATION"]->sPath2css, $arCss));
             $arAssets["JS"] = array_merge($arAssets["JS"], array_diff($GLOBALS["APPLICATION"]->arHeadScripts, $arJs));
             unset($arComments["UF"]["UF_SONET_COM_URL_PRV"]);
         }
         $arTmpCommentEvent["UF"] = $arComments["UF"];
         if (isset($arTmpCommentEvent["EVENT_FORMATTED"]) && is_array($arTmpCommentEvent["EVENT_FORMATTED"])) {
             $arFields2Cache = array("DATETIME", "MESSAGE", "FULL_MESSAGE_CUT", "ERROR_MSG");
             foreach ($arTmpCommentEvent["EVENT_FORMATTED"] as $field => $value) {
                 if (!in_array($field, $arFields2Cache)) {
                     unset($arTmpCommentEvent["EVENT_FORMATTED"][$field]);
                 }
             }
         }
         if (isset($arTmpCommentEvent["EVENT"]) && is_array($arTmpCommentEvent["EVENT"])) {
             if (!empty($arTmpCommentEvent["EVENT"]["URL"])) {
                 $arTmpCommentEvent["EVENT"]["URL"] = str_replace("#GROUPS_PATH#", COption::GetOptionString("socialnetwork", "workgroups_page", "/workgroups/", SITE_ID), $arTmpCommentEvent["EVENT"]["URL"]);
             }
             $arFields2Cache = array("ID", "SOURCE_ID", "EVENT_ID", "USER_ID", "LOG_DATE", "RATING_TYPE_ID", "RATING_ENTITY_ID", "URL");
             foreach ($arTmpCommentEvent["EVENT"] as $field => $value) {
                 if (!in_array($field, $arFields2Cache)) {
                     unset($arTmpCommentEvent["EVENT"][$field]);
                 }
             }
         }
         if (isset($arTmpCommentEvent["CREATED_BY"]) && is_array($arTmpCommentEvent["CREATED_BY"])) {
             $arFields2Cache = array("TOOLTIP_FIELDS", "FORMATTED", "URL");
             foreach ($arTmpCommentEvent["CREATED_BY"] as $field => $value) {
                 if (!in_array($field, $arFields2Cache)) {
                     unset($arTmpCommentEvent["CREATED_BY"][$field]);
                 }
             }
             if (isset($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"]) && is_array($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"])) {
                 $arFields2Cache = array("ID", "PATH_TO_SONET_USER_PROFILE", "NAME", "LAST_NAME", "SECOND_NAME", "LOGIN", "EMAIL");
                 foreach ($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"] as $field => $value) {
                     if (!in_array($field, $arFields2Cache)) {
                         unset($arTmpCommentEvent["CREATED_BY"]["TOOLTIP_FIELDS"][$field]);
                     }
                 }
             }
         }
     }
     foreach ($arTmpCommentEvent["EVENT"] as $key => $value) {
         if (strpos($key, "~") === 0) {
             unset($arTmpCommentEvent["EVENT"][$key]);
         }
     }
     return $arTmpCommentEvent;
 }
Esempio n. 19
0
            $text = preg_replace("#\\[img\\](.+?)\\[/img\\]#is", "", $arPost["~DETAIL_TEXT"]);
            $text = preg_replace("#\\[url(.+?)\\](.*?)\\[/url\\]#is", "\\2", $text);
            $text = preg_replace("#\\[video(.+?)\\](.+?)\\[/video\\]#is", "", $text);
            $text = preg_replace("#^(.+?)<cut[\\s]*(/>|>).*?\$#is", "\\1", $text);
            $text = preg_replace("#^(.+?)\\[cut[\\s]*(/\\]|\\]).*?\$#is", "\\1", $text);
            $text = preg_replace("#(\\[|<)(/?)(b|u|i|list|code|quote|url|img|color|font|/*)(.*?)(\\]|>)#is", "", $text);
            $text = TruncateText($text, $arParams["MESSAGE_LENGTH"]);
            $text1 = $text;
            $title = $p->convert($text1, true, false, array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N"));
            $text = $p->convert($text, true, false, array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "Y", "NL2BR" => "N"));
            $text = CBlogTools::DeleteDoubleBR($text);
            $arTmp["TEXT_FORMATED"] = $text;
            $arTmp["DATE_PUBLISH_FORMATED"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arTmp["DATE_PUBLISH"], CSite::GetDateFormat("FULL")));
            if ($arTmp["MICRO"] == "Y") {
                $arTmp["TITLE"] = TruncateText(str_replace(array("<br />", "<br>", "'", "&quot;", "&lt;", "&gt;"), "", $title), 60);
                $arTmp["~TITLE"] = htmlspecialcharsback($arTmp["TITLE"]);
            }
            $itemCnt++;
            $arResult[] = $arTmp;
            $ids[] = $arTmp["ID"];
        }
        $arResult["IDS"] = $ids;
    }
    if ($arParams["CACHE_TIME"] > 0) {
        $cache->EndDataCache(array("templateCachedData" => $this->GetTemplateCachedData(), "arResult" => $arResult));
    }
}
if ($arParams["SHOW_RATING"] == "Y" && !empty($arResult["IDS"])) {
    $arResult[0]['RATING'] = CRatings::GetRatingVoteResult('BLOG_POST', $arResult["IDS"]);
}
unset($arResult["IDS"]);
Esempio n. 20
0
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$this->IncludeComponentLang("action.php");
$photo_list_action = $_REQUEST["photo_list_action"];
if (isset($photo_list_action) && $photo_list_action != "") {
    $APPLICATION->ShowAjaxHead();
    $UCID = preg_replace("/[^a-z0-9\\_]+/is", "", $_REQUEST["UCID"]);
    ?>
<script>
	if (!window.BX && top.BX){BX = top.BX;}
	window.bxph_action_url_<?php 
    echo $UCID;
    ?>
 = '<?php 
    echo CUtil::JSEscape(CHTTP::urlDeleteParams(htmlspecialcharsback(POST_FORM_ACTION_URI), array("view_mode", "sessid", "uploader_redirect", "photo_list_action", "pio", "ELEMENT_ID", "UCID"), true));
    ?>
';
	<?php 
    if (!check_bitrix_sessid()) {
        ?>
window.bxph_error = '<?php 
        echo GetMessage("IBLOCK_WRONG_SESSION");
        ?>
';<?php 
        die('</' . 'script>');
    }
    ?>
	</script>
	<?php 
    if ($photo_list_action == 'load_comments' && $arParams["USE_COMMENTS"] == "Y" && $arParams["PERMISSION"] >= "R") {
Esempio n. 21
0
</span><span class="blog-post-time"><?php 
        echo $CurPost["DATE_PUBLISH_TIME"];
        ?>
</span><span class="blog-post-date-formated"><?php 
        echo $CurPost["DATE_PUBLISH_FORMATED"];
        ?>
</span></div>
						</div>
					</div>
					<?php 
        if (array_key_exists("USE_SHARE", $arParams) && $arParams["USE_SHARE"] == "Y") {
            ?>
						<div class="blog-post-share" style="float: right;">
							<noindex>
							<?php 
            $APPLICATION->IncludeComponent("bitrix:main.share", "", array("HANDLERS" => $arParams["SHARE_HANDLERS"], "PAGE_URL" => htmlspecialcharsback($CurPost["urlToPost"]), "PAGE_TITLE" => htmlspecialcharsback($CurPost["TITLE"]), "SHORTEN_URL_LOGIN" => $arParams["SHARE_SHORTEN_URL_LOGIN"], "SHORTEN_URL_KEY" => $arParams["SHARE_SHORTEN_URL_KEY"], "ALIGN" => "right", "HIDE" => $arParams["SHARE_HIDE"]), $component, array("HIDE_ICONS" => "Y"));
            ?>
							</noindex>
						</div>
						<?php 
        }
        ?>
					<div class="blog-post-meta-util">
						<span class="blog-post-views-link"><a href="<?php 
        echo $CurPost["urlToPost"];
        ?>
"><span class="blog-post-link-caption"><?php 
        echo GetMessage("BLOG_BLOG_BLOG_VIEWS");
        ?>
</span><span class="blog-post-link-counter"><?php 
        echo IntVal($CurPost["VIEWS"]);
Esempio n. 22
0
             \Bitrix\Main\FinderDestTable::merge(array("CONTEXT" => "blog_post", "CODE" => \Bitrix\Main\FinderDestTable::convertRights($arNewRights)));
         }
     }
     die;
 }
 /* end share */
 if (!$arResult["bFromList"]) {
     $strTitle = $arPost["MICRO"] != "Y" ? $arPost["TITLE"] : TruncateText(blogTextParser::killAllTags($arPost["DETAIL_TEXT"]), 100);
     if (IsModuleInstalled("intranet")) {
         $APPLICATION->SetPageProperty("title", $strTitle);
     } else {
         $APPLICATION->SetTitle($strTitle);
     }
 }
 if ($arParams["SET_NAV_CHAIN"] == "Y") {
     $APPLICATION->AddChainItem($arBlog["NAME"], CComponentEngine::MakePathFromTemplate(htmlspecialcharsback($arParams["PATH_TO_BLOG"]), array("blog" => $arBlog["URL"], "user_id" => $arPost["AUTHOR_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"])));
 }
 $cache = new CPHPCache();
 $arCacheID = array();
 $arKeys = array("MOBILE", "USE_CUT", "PATH_TO_SMILE", "ATTACHED_IMAGE_MAX_WIDTH_SMALL", "ATTACHED_IMAGE_MAX_HEIGHT_SMALL", "ATTACHED_IMAGE_MAX_WIDTH_FULL", "ATTACHED_IMAGE_MAX_HEIGHT_FULL", "POST_PROPERTY", "PATH_TO_USER", "PATH_TO_POST", "PATH_TO_GROUP", "PATH_TO_SEARCH_TAG", "IMAGE_MAX_WIDTH", "IMAGE_MAX_HEIGHT", "DATE_TIME_FORMAT", "DATE_TIME_FORMAT_S", "ALLOW_POST_CODE", "AVATAR_SIZE_COMMENT", "NAME_TEMPLATE", "SHOW_LOGIN");
 foreach ($arKeys as $param_key) {
     $arCacheID[$param_key] = array_key_exists($param_key, $arParams) ? $arParams[$param_key] : false;
 }
 $cache_id = "blog_socnet_post_" . md5(serialize($arCacheID)) . "_" . LANGUAGE_ID . "_" . $arParams["DATE_TIME_FORMAT"];
 if ($arResult["TZ_OFFSET"] != 0) {
     $cache_id .= "_" . $arResult["TZ_OFFSET"];
 }
 if (!empty($arParams["MOBILE"]) && $arParams["MOBILE"] == "Y" && CModule::IncludeModule('mobile')) {
     $imageResizeWidth = CMobileHelper::getDeviceResizeWidth();
     if ($imageResizeWidth) {
         $cache_id .= "_" . $imageResizeWidth;
Esempio n. 23
0
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin_js.php";
    die;
}
$aTabs = array();
$tabControl = null;
if (!$bFullForm) {
    $arProperty = array();
    $PROPERTY = $_POST['PROP'];
    $PARAMS = $_POST['PARAMS'];
    if (isset($PARAMS['TITLE']) && '' != $PARAMS['TITLE']) {
        $APPLICATION->SetTitle($PARAMS['TITLE']);
    }
    $arFieldsList = $DB->GetTableFieldsList("b_iblock_property");
    foreach ($arFieldsList as $strFieldName) {
        if (!in_array($strFieldName, $arDisabledPropFields)) {
            $arProperty[$strFieldName] = isset($PROPERTY[$strFieldName]) ? htmlspecialcharsback($PROPERTY[$strFieldName]) : '';
        }
    }
    $arProperty['PROPINFO'] = $PROPERTY['PROPINFO'];
    $arProperty['PROPINFO'] = base64_decode($arProperty['PROPINFO']);
    if (CheckSerializedData($arProperty['PROPINFO'])) {
        $arTempo = unserialize($arProperty['PROPINFO']);
        if (is_array($arTempo)) {
            foreach ($arTempo as $k => $v) {
                $arProperty[$k] = $v;
            }
        }
        unset($arTempo);
        unset($arProperty['PROPINFO']);
    }
    $arProperty['MULTIPLE'] = 'Y' == $arProperty['MULTIPLE'] ? 'Y' : 'N';
Esempio n. 24
0
							if (strlen($arUser["LAST_NAME"]) > 0)
								$arPropValues[$arVariants["ID"]] .= $arUser["LAST_NAME"];
							if (strlen($arUser["NAME"]) > 0)
								$arPropValues[$arVariants["ID"]] .= " ".$arUser["NAME"];
							if (strlen($arUser["SECOND_NAME"]) > 0 AND strlen($arUser["NAME"]) > 0)
								$arPropValues[$arVariants["ID"]] .= " ".$arUser["SECOND_NAME"];
						}
					}
				}
			}

		}

		$scriptExec = '<script type="text/javascript">';
		foreach ($arPropValues as $key => $val):
			$val = CUtil::JSEscape(htmlspecialcharsback($val));
			$scriptExec .= "var el = document.getElementById(\"ORDER_PROP_".$key."CITY_ORDER_PROP_".$key."\");\n";
			$scriptExec .= "if(el)\n{\n";
			$scriptExec .= "BX.ajax.post('/bitrix/admin/sale_order_new.php', '".bitrix_sessid_get()."&ORDER_AJAX=Y&locid=".$key."&propID=".$buyerType."&LID=".CUtil::JSEscape($LID)."&location=".$val."', fLocationResult);\n";
			$scriptExec .= "}";
			$scriptExec .= "var el = document.getElementById(\"ORDER_PROP_".$key."\");\n";
			$scriptExec .= "if(el)\n{\n";
			$scriptExec .= "var elType = el.getAttribute('type');\n";
			$scriptExec .= "if (elType == \"text\" || elType == \"textarea\" || elType == \"select\")\n";
			$scriptExec .= "{";
				$scriptExec .= "el.value = '".$val."';\n";
			$scriptExec .= "}";
			$scriptExec .= "else if (elType == \"radio\")\n";
			$scriptExec .= "{";
				$scriptExec .= "elRadio = el.getElementsByTagName(\"input\");\n";
				$scriptExec .= "for (var i = 0; i < elRadio.length; i++)\n";
Esempio n. 25
0
    function GetLayout()
    {
        $wizard = $this->GetWizard();
        $formName = htmlspecialcharsbx($wizard->GetFormName());
        CUtil::InitJSCore(array("ajax"));
        $adminScript = CAdminPage::ShowScript();
        $charset = LANG_CHARSET;
        $wizardName = htmlspecialcharsEx($wizard->GetWizardName());
        $nextButtonID = htmlspecialcharsbx($wizard->GetNextButtonID());
        $prevButtonID = htmlspecialcharsbx($wizard->GetPrevButtonID());
        $cancelButtonID = htmlspecialcharsbx($wizard->GetCancelButtonID());
        $finishButtonID = htmlspecialcharsbx($wizard->GetFinishButtonID());
        IncludeAJAX();
        $ajaxScripts = $GLOBALS["APPLICATION"]->GetHeadStrings();
        $ajaxScripts .= $GLOBALS["APPLICATION"]->GetHeadScripts();
        $obStep = $wizard->GetCurrentStep();
        $arErrors = $obStep->GetErrors();
        $strError = $strJsError = "";
        if (count($arErrors) > 0) {
            foreach ($arErrors as $arError) {
                $strError .= $arError[0] . "<br />";
                if ($arError[1] !== false) {
                    $strJsError .= ($strJsError != "" ? ", " : "") . "{'name':'" . CUtil::addslashes($wizard->GetRealName($arError[1])) . "', 'title':'" . CUtil::addslashes(htmlspecialcharsback($arError[0])) . "'}";
                }
            }
            if (strlen($strError) > 0) {
                $strError = '<div id="step_error">' . $strError . "</div>";
            }
            $strJsError = '
			<script type="text/javascript">
				ShowWarnings([' . $strJsError . ']);
			</script>';
        }
        $stepTitle = $obStep->GetTitle();
        $stepSubTitle = $obStep->GetSubTitle();
        $autoSubmit = "";
        if ($obStep->IsAutoSubmit()) {
            $autoSubmit = 'setTimeout("AutoSubmit();", 500);';
        }
        $alertText = GetMessageJS("MAIN_WIZARD_WANT_TO_CANCEL");
        $loadingText = GetMessageJS("MAIN_WIZARD_WAIT_WINDOW_TEXT");
        $package = $wizard->GetPackage();
        return <<<HTML
<!DOCTYPE html>
<html id="bx-admin-prefix">
<head>
\t<head>
\t\t<title>{$wizardName}</title>
\t\t<meta http-equiv="X-UA-Compatible" content="IE=edge">
\t\t<meta http-equiv="Content-Type" content="text/html; charset={$charset}">
\t\t{$ajaxScripts}
\t\t<style type="text/css">
\t\t\tbody
\t\t\t{
\t\t\t\tmargin:0;
\t\t\t\tpadding:0;
\t\t\t\tfont-size: 13px;
\t\t\t\tfont-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
\t\t\t}
\t\t\ttable {font-size:100%;}
\t\t\tform {margin:0; padding:0; }

\t\t\ta {
\t\t\t\tcolor: #2675D7;
\t\t\t\ttext-decoration: underline;
\t\t\t}


\t\t\t.step-content {
\t\t\t\tborder: solid 1px #DCE7ED;
\t\t\t\tbackground-color: #F5F9F9;
\t\t\t\theight: 347px;
\t\t\t\toverflow: auto;
\t\t\t}

\t\t\t.step-header {
\t\t\t\tborder-bottom: 1px solid #DCE7ED;
\t\t\t\tfont-size: 12px;
\t\t\t\tpadding: 6px 30px 9px 9px;
\t\t\t\tmargin-bottom: 12px;
\t\t\t}

\t\t\t.step-title { font-size: 16px; }
\t\t\t.step-subtitle { font-size: 13px; }

\t\t\t.step-body {
\t\t\t\tpadding: 0 10px;
\t\t\t}

\t\t\t.step-buttons
\t\t\t{
\t\t\t\tpadding-top: 12px;
\t\t\t\tpadding-left: 2px;
\t\t\t}

\t\t\t.step-buttons input {
\t\t\t\t-webkit-border-radius: 4px;
\t\t\t\tborder-radius: 4px;
\t\t\t\tborder:none;
\t\t\t\tborder-top:1px solid #fff;
\t\t\t\t-webkit-box-shadow: 0 0 1px rgba(0,0,0,.11), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5);
\t\t\t\tbox-shadow: 0 0 1px rgba(0,0,0,.3), 0 1px 1px rgba(0,0,0,.3), inset 0 1px #fff, inset 0 0 1px rgba(255,255,255,.5);
\t\t\t\tbackground-image: -webkit-linear-gradient(bottom, #d7e3e7, #fff)!important;
\t\t\t\tbackground-image: -moz-linear-gradient(bottom, #d7e3e7, #fff)!important;
\t\t\t\tbackground-image: -ms-linear-gradient(bottom, #d7e3e7, #fff)!important;
\t\t\t\tbackground-image: -o-linear-gradient(bottom, #d7e3e7, #fff)!important;
\t\t\t\tbackground-image: linear-gradient(bottom, #d7e3e7, #fff)!important;
\t\t\t\tcolor:#3f4b54;
\t\t\t\tcursor:pointer;
\t\t\t\tdisplay:inline-block;
\t\t\t\tfont-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
\t\t\t\tfont-weight:bold;
\t\t\t\tfont-size:13px;
\t\t\t\theight: 29px;
\t\t\t\ttext-shadow:0 1px rgba(255,255,255,0.7);
\t\t\t\ttext-decoration:none;
\t\t\t\tposition:relative;
\t\t\t\tvertical-align:middle;
\t\t\t\t-webkit-font-smoothing: antialiased;
\t\t\t\tpadding: 0 13px 2px;
\t\t\t\tmargin-right: 3px;
\t\t\t}

\t\t\t.step-buttons input:hover {
\t\t\t\ttext-decoration: none;
\t\t\t\tbackground:#f3f6f7!important;
\t\t\t\tbackground-image: -webkit-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
\t\t\t\tbackground-image: -moz-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
\t\t\t\tbackground-image: -ms-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
\t\t\t\tbackground-image: -o-linear-gradient(top, #f8f8f9, #f2f6f8)!important;
\t\t\t\tbackground-image: linear-gradient(top, #f8f8f9, #f2f6f8)!important;
\t\t\t}

\t\t\t.step-buttons input:active {
\t\t\t\t-webkit-border-radius: 4px;
\t\t\t\tborder-radius: 4px;
\t\t\t\tbackground-color: #b7c4c9!important;
\t\t\t\t-webkit-box-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78);
\t\t\t\tbox-shadow: inset 0 1px 1px 1px rgba(103,109,123,.78);
\t\t\t\tbackground-image: -webkit-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
\t\t\t\tbackground-image: -moz-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
\t\t\t\tbackground-image: -ms-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
\t\t\t\tbackground-image: -o-linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
\t\t\t\tbackground-image: linear-gradient(top, rgba(179,194,200,.96), rgba(202,215,219,.96))!important;
\t\t\t\tborder-top:transparent;
\t\t\t\theight: 29px;
\t\t\t\toutline:none;
\t\t\t\tpadding:2px 13px 1px;
\t\t\t}

\t\t\t.bx-ie8 .step-buttons input,
\t\t\t.bx-ie9 .step-buttons input {
\t\t\t\tborder-radius:4px;
\t\t\t\tbackground:url("/bitrix/panel/main/images/bx-admin-sprite-small-1.png") repeat-x 0 -3554px;
\t\t\t\tbox-shadow:0 0 0 1px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 0 #FFFFFF inset, 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
\t\t\t\tline-height:16px;
\t\t\t\theight:31px!important;
\t\t\t\tpadding-top:6px!important;
\t\t\t\tpadding-bottom:6px!important;
\t\t\t\tmargin-right: 3px !important;
\t\t\t}

\t\t\t.bx-ie8 .step-buttons input {border:1px solid #959c9d !important;}

\t\t\t#step_error
\t\t\t{
\t\t\t\tcolor:red;
\t\t\t\tpadding:0 0 12px 0;
\t\t\t}

\t\t\t#hidden-layer
\t\t\t{
\t\t\t\tbackground:#F8F9FC none repeat scroll 0%;
\t\t\t\theight:100%;
\t\t\t\tleft:0pt;
\t\t\t\topacity:0.01;
\t\t\t\tfilter:alpha(opacity=1);
\t\t\t\t-moz-opacity:0.01;
\t\t\t\tposition:absolute;
\t\t\t\ttop:0pt;
\t\t\t\twidth:100%;
\t\t\t\tz-index:10001;
\t\t\t}

\t\t\t/*Data table*/
\t\t\ttable.wizard-data-table { border:1px solid #B2C4DD; border-collapse:collapse;}
\t\t\ttable.wizard-data-table td { border:1px solid #B2C4DD; background-color:#FFFFFF; padding:3px 5px; }
\t\t\ttable.wizard-data-table thead td, table.wizard-data-table th {
\t\t\t\tbackground-color:#E4EDF5;
\t\t\t\tfont-weight:normal;
\t\t\t\tbackground-image:none;
\t\t\t\tborder:1px solid #B2C4DD;
\t\t\t\tpadding:4px;
\t\t\t}
\t\t\ttable.wizard-data-table tbody td { background-color:#FFF; background-image:none; }
\t\t\ttable.wizard-data-table tfoot td { background-color:#F2F5F9; padding:4px; }

\t\t\t.wizard-note-box { background:#FEFDEA; padding:7px; border:1px solid #D7D6BA; }
\t\t\t.wizard-required { color:red; }

\t\t\t.bx-session-message { display: none !important;}

\t\t</style>

\t\t{$adminScript}

\t\t<script type="text/javascript">

\t\t\ttop.BX.message({"ADMIN_WIZARD_EXIT_ALERT" : "{$alertText}"});

\t\t\tfunction OnLoad()
\t\t\t{
\t\t\t\tvar dialog = top.BX.WindowManager.Get();
\t\t\t\tif (dialog)
\t\t\t\t\tdialog.SetTitle('{$wizardName}');

\t\t\t\tvar form = document.forms["{$formName}"];

\t\t\t\tif (form)
\t\t\t\t\tform.onsubmit = OnFormSubmit;

\t\t\t\tvar cancelButton = document.forms["{$formName}"].elements["{$cancelButtonID}"];
\t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
\t\t\t\tvar prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"];
\t\t\t\tvar finishButton = document.forms["{$formName}"].elements["{$finishButtonID}"];

\t\t\t\tif (cancelButton && !nextButton && !prevButton && !finishButton)
\t\t\t\t{
\t\t\t\t\ttop.WizardWindow.isClosed = true;
\t\t\t\t\tcancelButton.onclick = CloseWindow;
\t\t\t\t}
\t\t\t\telse if(cancelButton)
\t\t\t\t{
\t\t\t\t\tcancelButton.onclick = ConfirmCancel;
\t\t\t\t}

\t\t\t\t{$autoSubmit}
\t\t\t}

\t\t\tfunction OnFormSubmit()
\t\t\t{
\t\t\t\tvar div = document.body.appendChild(document.createElement("DIV"));
\t\t\t\tdiv.id = "hidden-layer";
\t\t\t}

\t\t\tfunction AutoSubmit()
\t\t\t{
\t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
\t\t\t\tif (nextButton)
\t\t\t\t{
\t\t\t\t\tvar wizard = top.WizardWindow;
\t\t\t\t\tif (wizard)
\t\t\t\t\t{
\t\t\t\t\t\twizard.messLoading = "{$loadingText}";
\t\t\t\t\t\twizard.ShowWaitWindow();
\t\t\t\t\t}

\t\t\t\t\tnextButton.click();
\t\t\t\t\tnextButton.disabled=true;
\t\t\t\t}
\t\t\t}

\t\t\tfunction ConfirmCancel()
\t\t\t{
\t\t\t\treturn (confirm("{$alertText}"));
\t\t\t}

\t\t\tfunction ShowWarnings(warnings)
\t\t\t{
\t\t\t\tvar form = document.forms["{$formName}"];
\t\t\t\tif(!form)
\t\t\t\t\treturn;

\t\t\t\tfor(var i in warnings)
\t\t\t\t{
\t\t\t\t\tvar e = form.elements[warnings[i]["name"]];
\t\t\t\t\tif(!e)
\t\t\t\t\t\tcontinue;

\t\t\t\t\tvar type = (e.type? e.type.toLowerCase():"");
\t\t\t\t\tvar bBefore = false;
\t\t\t\t\tif(e.length > 1 && type != "select-one" && type != "select-multiple")
\t\t\t\t\t{
\t\t\t\t\t\te = e[0];
\t\t\t\t\t\tbBefore = true;
\t\t\t\t\t}
\t\t\t\t\tif(type == "textarea" || type == "select-multiple")
\t\t\t\t\t\tbBefore = true;

\t\t\t\t\tvar td = e.parentNode;
\t\t\t\t\tvar img;
\t\t\t\t\tif(bBefore)
\t\t\t\t\t{
\t\t\t\t\t\timg = td.insertBefore(new Image(), e);
\t\t\t\t\t\ttd.insertBefore(document.createElement("BR"), e);
\t\t\t\t\t}
\t\t\t\t\telse
\t\t\t\t\t{
\t\t\t\t\t\timg = td.insertBefore(new Image(), e.nextSibling);
\t\t\t\t\t\timg.hspace = 2;
\t\t\t\t\t\timg.vspace = 2;
\t\t\t\t\t\timg.style.verticalAlign = "bottom";
\t\t\t\t\t}
\t\t\t\t\timg.src = "/bitrix/themes/"+phpVars.ADMIN_THEME_ID+"/images/icon_warn.gif";
\t\t\t\t\timg.title = warnings[i]["title"];
\t\t\t\t}
\t\t\t}

\t\t\tdocument.onkeydown = EnterKeyPress;

\t\t\tfunction EnterKeyPress(event)
\t\t\t{

\t\t\t\tevent = event || window.event;

\t\t\t\tif (!event.ctrlKey)
\t\t\t\t\treturn;

\t\t\t\tvar key = (event.keyCode ? event.keyCode : (event.which ? event.which : null) );

\t\t\t\tif (!key)
\t\t\t\t\treturn;

\t\t\t\tif (key == 13 || key == 39)
\t\t\t\t{
\t\t\t\t\tvar nextButton = document.forms["{$formName}"].elements["{$nextButtonID}"];
\t\t\t\t\tif (nextButton)
\t\t\t\t\t\tnextButton.click();
\t\t\t\t}
\t\t\t\telse if (key == 37)
\t\t\t\t{
\t\t\t\t\tvar prevButton = document.forms["{$formName}"].elements["{$prevButtonID}"];
\t\t\t\t\tif (prevButton)
\t\t\t\t\t\tprevButton.click();
\t\t\t\t}
\t\t\t}

\t\t\tfunction CloseWindow()
\t\t\t{
\t\t\t\tif (self.parent.window.WizardWindow)
\t\t\t\t\tself.parent.window.WizardWindow.Close();
\t\t\t}

\t\t</script>

\t</head>

\t<body onload="OnLoad();">

\t\t{#FORM_START#}
\t\t<div class="step-content">
\t\t\t<div class="step-header">
\t\t\t\t<div class="step-title">{$stepTitle}</div>
\t\t\t\t<div class="step-subtitle">{$stepSubTitle}</div>
\t\t\t</div>
\t\t\t<div class="step-body">
\t\t\t\t{$strError}
\t\t\t\t{#CONTENT#}
\t\t\t</div>

\t\t</div>
\t\t<div class="step-buttons">{#BUTTONS#}</div>
\t\t{#FORM_END#}
\t\t{$strJsError}

\t</body>
</html>
HTML;
    }
Esempio n. 26
0
	<?php 
    if (CSalePaySystemAction::GetParamValue("COMMENT1", false)) {
        ?>
	<?php 
        echo nl2br(HTMLToTxt(preg_replace(array('#</div>\\s*<div[^>]*>#i', '#</?div>#i'), array('<br>', '<br>'), htmlspecialcharsback(CSalePaySystemAction::GetParamValue("COMMENT1", false))), '', array(), 0));
        ?>
	<br>
	<br>
	<?php 
    }
    ?>
	<?php 
    if (CSalePaySystemAction::GetParamValue("COMMENT2", false)) {
        ?>
	<?php 
        echo nl2br(HTMLToTxt(preg_replace(array('#</div>\\s*<div[^>]*>#i', '#</?div>#i'), array('<br>', '<br>'), htmlspecialcharsback(CSalePaySystemAction::GetParamValue("COMMENT2", false))), '', array(), 0));
        ?>
	<br>
	<br>
	<?php 
    }
}
?>

<br>
<br>
<br>

<?php 
$bankAccNo = CSalePaySystemAction::GetParamValue("SELLER_BANK_ACCNO", false);
$bankRouteNo = CSalePaySystemAction::GetParamValue("SELLER_BANK_ROUTENO", false);
Esempio n. 27
0
	function Show()
	{
		if (defined('FX_PUBLIC_MODE') && FX_PUBLIC_MODE == 1 && $this->message["TYPE"] != "PROGRESS")
		{
			ob_end_clean();
			echo '<script>top.BX.WindowManager.Get().ShowError(\''.CUtil::JSEscape(str_replace(array('<br>', '<br />', '<BR>', '<BR />'), "\r\n", htmlspecialcharsback($this->message['DETAILS']? $this->message['DETAILS'] : $this->message['MESSAGE']))).'\');</script>';
			die();
		}

		if($this->message["MESSAGE"])
			$title = '<div class="adm-info-message-title">'.$this->_formatHTML($this->message["MESSAGE"]).'</div>';
		else
			$title = '';

		if($this->message["DETAILS"])
			$details = $this->_formatHTML($this->message["DETAILS"]);
		else
			$details = '';

		if($this->message["TYPE"] == "OK")
		{
			$s = '
<div class="adm-info-message-wrap adm-info-message-green">
	<div class="adm-info-message">
		'.$title.'
		'.$details.'
		<div class="adm-info-message-icon"></div>
	</div>
</div>
';
		}
		elseif($this->message["TYPE"] == "PROGRESS")
		{
			if ($this->message['PROGRESS_ICON'])
				$title = '<div class="adm-info-message-icon-progress"></div>'.$title;

			$details = str_replace("#PROGRESS_BAR#", $this->_getProgressHtml(), $details);
			$s = '
<div class="adm-info-message-wrap adm-info-message-gray">
	<div class="adm-info-message">
		'.$title.'
		'.$details.'
		<div class="adm-info-message-buttons">'.$this->_getButtonsHtml().'</div>
	</div>
</div>
';
		}
		else
		{
			$s = '
<div class="adm-info-message-wrap adm-info-message-red">
	<div class="adm-info-message">
		'.$title.'
		'.$details.'
		<div class="adm-info-message-icon"></div>
	</div>
</div>
';
		}

		return $s;
	}
Esempio n. 28
0
 function FormatComment_Data($arFields, $arParams, $bMail = false, $arLog = array())
 {
     $arResult = array("EVENT_FORMATTED" => array());
     if (!CModule::IncludeModule("socialnetwork")) {
         return $arResult;
     }
     if (in_array($arLog["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER))) {
         $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arLog, $arParams, $bMail);
     }
     if (!$bMail && $arParams["USE_COMMENT"] != "Y") {
         $arLog["ENTITY_ID"] = $arFields["ENTITY_ID"];
         $arLog["ENTITY_TYPE"] = $arFields["ENTITY_TYPE"];
     }
     if (!$bMail && array_key_exists("URL", $arLog) && strlen($arLog["URL"]) > 0) {
         $news_tmp = '<a href="' . $arLog["URL"] . '">' . $arLog["TITLE"] . '</a>';
     } else {
         $news_tmp = $arLog["TITLE"];
     }
     $title_tmp = $bMail ? GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_" . $arLog["ENTITY_TYPE"] . "_TITLE_MAIL") : GetMessage("LFP_SOCNET_LOG_DATA_COMMENT_TITLE");
     $title = str_replace(array("#TITLE#", "#ENTITY#"), array($news_tmp, $bMail ? $arResult["ENTITY"]["FORMATTED"] : $arResult["ENTITY"]["FORMATTED"]["NAME"]), $title_tmp);
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $bMail || $arParams["USE_COMMENT"] != "Y" ? "<a href=\"asdfasdf\">" . $title . "</a>" : "", "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["MESSAGE"]);
     if ($bMail) {
         $url = CSocNetLogTools::FormatEvent_GetURL($arLog, true);
         if (strlen($url) > 0) {
             $arResult["EVENT_FORMATTED"]["URL"] = $url;
         }
     } else {
         $parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N");
         $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N");
         $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
         if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
             $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow), 500);
             $arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
         }
     }
     return $arResult;
 }
Esempio n. 29
0
						<?php 
            } else {
                ?>
							<a href="<?php 
                echo htmlspecialcharsback($arRequest["GROUP_URL"]);
                ?>
" class="invite-user-link"><?php 
                echo $arRequest["GROUP_NAME"];
                ?>
</a>
						<?php 
            }
            ?>
					</td>
					<td class="invite-list-message"><div class="invite-active-block"><?php 
            echo htmlspecialcharsback($arRequest["MESSAGE"]);
            ?>
<br /><i><?php 
            echo $arRequest["DATE_CREATE"];
            ?>
</i></div></td>
				</tr><?php 
            $ind++;
        }
        ?>
</table>

			<div class="invite-list-nav"><?php 
        if (StrLen($arResult["RequestsOut"]["NAV_STRING"]) > 0) {
            echo $arResult["RequestsOut"]["NAV_STRING"];
            ?>
Esempio n. 30
0
 function convert_anchor_tag($url, $text, $pref = "")
 {
     $url = trim(str_replace(array("[nomodify]", "[/nomodify]"), "", $url));
     $text = trim(str_replace(array("[nomodify]", "[/nomodify]"), "", $text));
     $text = strlen($text) <= 0 ? $url : $text;
     $bTextUrl = $text == $url;
     $bShortUrl = $this->allow["SHORT_ANCHOR"] == "Y";
     $text = str_replace("\\\"", "\"", $text);
     $end = "";
     $pattern = "/([\\.,\\?\\!\\;]|&#33;)\$/" . BX_UTF_PCRE_MODIFIER;
     if ($bTextUrl && preg_match($pattern, $url, $match)) {
         $end = $match[1];
         $url = preg_replace($pattern, "", $url);
         $text = preg_replace($pattern, "", $text);
     }
     $url = preg_replace(array("/&amp;/" . BX_UTF_PCRE_MODIFIER, "/javascript:/i" . BX_UTF_PCRE_MODIFIER, "/[" . chr(12) . "\\']/" . BX_UTF_PCRE_MODIFIER, "/&#91;/" . BX_UTF_PCRE_MODIFIER, "/&#93;/" . BX_UTF_PCRE_MODIFIER), array("&", "java script&#58; ", "%27", "[", "]"), $url);
     if (substr($url, 0, 1) != "/" && !preg_match("/^(" . $this->getAnchorSchemes() . ")\\:/i" . BX_UTF_PCRE_MODIFIER, $url)) {
         $url = "http://" . $url;
     }
     $text = preg_replace(array("/&amp;/i" . BX_UTF_PCRE_MODIFIER, "/javascript:/i" . BX_UTF_PCRE_MODIFIER), array("&", "javascript&#58; "), $text);
     if ($bShortUrl && strlen($text) > $this->maxAnchorLength && preg_match("/^(" . $this->getAnchorSchemes() . "):\\/\\/(\\S+)\$/i" . BX_UTF_PCRE_MODIFIER, $text, $matches)) {
         $uri_type = $matches[1];
         $stripped = $matches[2];
         $text = $uri_type . '://' . (strlen($stripped) > $this->maxAnchorLength ? substr($stripped, 0, $this->maxAnchorLength - 10) . '...' . substr($stripped, -10) : $stripped);
     }
     $url = $this->defended_tags(htmlspecialcharsbx(htmlspecialcharsback($url)), 'replace');
     return $pref . ($this->parser_nofollow == "Y" ? '<noindex>' : '') . '<a href="' . $url . '" target="' . $this->link_target . '"' . ($this->parser_nofollow == "Y" ? ' rel="nofollow"' : '') . '>' . $text . '</a>' . ($this->parser_nofollow == "Y" ? '</noindex>' : '') . $end;
 }