$arHistoryFirst = $rsHistoryFirst->GetNext();
 $rsHistory = new CDBResult($dbResultList, $sTableID);
 $rsHistory->NavStart($arParams['HISTORY_COUNT'], false);
 $arResult['DB_LIST'] =& $rsHistory;
 $arResult['HISTORY'] = array();
 if ($arResult['SOCNET']) {
     $arResult['AJAX_PAGE'] = $APPLICATION->GetCurPageParam('', array('bxajaxid', 'logout'));
     $arResult['PATH_TO_USER'] = $arParams['PATH_TO_USER'];
     $arResult['SHOW_LOGIN'] = $this->GetParent()->arParams['SHOW_LOGIN'];
     $arResult['NAME_TEMPLATE'] = $this->GetParent()->arParams['NAME_TEMPLATE'];
     $arResult['PATH_TO_CONPANY_DEPARTMENT'] = $this->GetParent()->arParams['PATH_TO_CONPANY_DEPARTMENT'];
     $arResult['PATH_TO_VIDEO_CALL'] = $this->GetParent()->arParams['PATH_TO_VIDEO_CALL'];
     $arResult['PATH_TO_SONET_MESSAGES_CHAT'] = $this->GetParent()->arParams['PATH_TO_MESSAGES_CHAT'];
 }
 $arErrorsTmp = array();
 while ($arHistory = $rsHistory->GetNext()) {
     $arHistory['USER_LINK'] = '';
     $arHistoryResult = CBPDocument::GetDocumentFromHistory($arHistory['ID'], $arErrorsTmp);
     $arHistory["MODIFY_COMMENT"] = $arHistoryResult["DOCUMENT"]["MODIFY_COMMENT"];
     if (!empty($arParams['PATH_TO_USER'])) {
         $arHistory['USER_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_USER'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId, 'user_id' => $arHistory['USER_ID'])), array());
     }
     /*CBPHistoryService::GetHistoryList() returns specialchared values
     		and CWikiUtils::GetUserLogin also do htmlspecialchars*/
     foreach (array('USER_LOGIN', 'USER_NAME', 'USER_LAST_NAME', 'USER_SECOND_NAME') as $key) {
         $arHistory[$key] = CWikiUtils::htmlspecialchars_decode($arHistory[$key]);
     }
     $arHistory['USER_LOGIN'] = CWikiUtils::GetUserLogin($arHistory, $arParams["NAME_TEMPLATE"]);
     $arHistory['DISCUSSION_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DISCUSSION'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'discussion') : array());
     $arHistory['SHOW_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('oldid' => $arHistory['ID']));
     $arHp = array('oldid' => $arHistory['ID'], 'sessid' => bitrix_sessid());
Beispiel #2
0
 function GetNext($bTextHtmlAuto = true, $use_tilda = true)
 {
     static $arSectionPathCache = array();
     $res = parent::GetNext($bTextHtmlAuto, $use_tilda);
     if ($res) {
         //Handle List URL for Element, Section or IBlock
         if ($this->strListUrl) {
             $TEMPLATE = $this->strListUrl;
         } elseif (array_key_exists("~LIST_PAGE_URL", $res)) {
             $TEMPLATE = $res["~LIST_PAGE_URL"];
         } elseif (!$use_tilda && array_key_exists("LIST_PAGE_URL", $res)) {
             $TEMPLATE = $res["LIST_PAGE_URL"];
         } else {
             $TEMPLATE = "";
         }
         if ($TEMPLATE) {
             $res_tmp = $res;
             if (intval($res["IBLOCK_ID"]) <= 0 && intval($res["ID"]) > 0) {
                 $res_tmp["IBLOCK_ID"] = $res["ID"];
                 $res_tmp["IBLOCK_CODE"] = $res["CODE"];
                 $res_tmp["IBLOCK_EXTERNAL_ID"] = $res["EXTERNAL_ID"];
                 if ($use_tilda) {
                     $res_tmp["~IBLOCK_ID"] = $res["~ID"];
                     $res_tmp["~IBLOCK_CODE"] = $res["~CODE"];
                     $res_tmp["~IBLOCK_EXTERNAL_ID"] = $res["~EXTERNAL_ID"];
                 }
             }
             if ($use_tilda) {
                 $res["~LIST_PAGE_URL"] = CIBlock::ReplaceDetailUrl($TEMPLATE, $res_tmp, true, false);
                 $res["LIST_PAGE_URL"] = htmlspecialcharsbx($res["~LIST_PAGE_URL"]);
             } else {
                 $res["LIST_PAGE_URL"] = CIBlock::ReplaceDetailUrl($TEMPLATE, $res_tmp, true, false);
             }
         }
         //If this is Element or Section then process it's detail and section URLs
         if (strlen($res["IBLOCK_ID"])) {
             if (array_key_exists("GLOBAL_ACTIVE", $res)) {
                 $type = "S";
             } else {
                 $type = "E";
             }
             if ($this->strDetailUrl) {
                 $TEMPLATE = $this->strDetailUrl;
             } elseif (array_key_exists("~DETAIL_PAGE_URL", $res)) {
                 $TEMPLATE = $res["~DETAIL_PAGE_URL"];
             } elseif (!$use_tilda && array_key_exists("DETAIL_PAGE_URL", $res)) {
                 $TEMPLATE = $res["DETAIL_PAGE_URL"];
             } else {
                 $TEMPLATE = "";
             }
             if ($TEMPLATE) {
                 if ($this->arSectionContext) {
                     $TEMPLATE = str_replace("#SECTION_ID#", $this->arSectionContext["ID"], $TEMPLATE);
                     $TEMPLATE = str_replace("#SECTION_CODE#", $this->arSectionContext["CODE"], $TEMPLATE);
                     if ($this->arSectionContext["ID"] > 0 && $this->arSectionContext["IBLOCK_ID"] > 0 && strpos($TEMPLATE, "#SECTION_CODE_PATH#") !== false) {
                         if (!array_key_exists($this->arSectionContext["ID"], $arSectionPathCache)) {
                             $rs = CIBlockSection::GetNavChain($this->arSectionContext["IBLOCK_ID"], $this->arSectionContext["ID"], array("ID", "IBLOCK_SECTION_ID", "CODE"));
                             while ($a = $rs->Fetch()) {
                                 $arSectionPathCache[$this->arSectionContext["ID"]] .= urlencode($a["CODE"]) . "/";
                             }
                         }
                         if (isset($arSectionPathCache[$this->arSectionContext["ID"]])) {
                             $SECTION_CODE_PATH = rtrim($arSectionPathCache[$this->arSectionContext["ID"]], "/");
                         } else {
                             $SECTION_CODE_PATH = "";
                         }
                         $TEMPLATE = str_replace("#SECTION_CODE_PATH#", $SECTION_CODE_PATH, $TEMPLATE);
                     }
                 }
                 if ($use_tilda) {
                     $res["~DETAIL_PAGE_URL"] = CIBlock::ReplaceDetailUrl($TEMPLATE, $res, true, $type);
                     $res["DETAIL_PAGE_URL"] = htmlspecialcharsbx($res["~DETAIL_PAGE_URL"]);
                 } else {
                     $res["DETAIL_PAGE_URL"] = CIBlock::ReplaceDetailUrl($TEMPLATE, $res, true, $type);
                 }
             }
             if ($this->strSectionUrl) {
                 $TEMPLATE = $this->strSectionUrl;
             } elseif (array_key_exists("~SECTION_PAGE_URL", $res)) {
                 $TEMPLATE = $res["~SECTION_PAGE_URL"];
             } elseif (!$use_tilda && array_key_exists("SECTION_PAGE_URL", $res)) {
                 $TEMPLATE = $res["SECTION_PAGE_URL"];
             } else {
                 $TEMPLATE = "";
             }
             if ($TEMPLATE) {
                 if ($use_tilda) {
                     $res["~SECTION_PAGE_URL"] = CIBlock::ReplaceSectionUrl($TEMPLATE, $res, true, $type);
                     $res["SECTION_PAGE_URL"] = htmlspecialcharsbx($res["~SECTION_PAGE_URL"]);
                 } else {
                     $res["SECTION_PAGE_URL"] = CIBlock::ReplaceSectionUrl($TEMPLATE, $res, true, $type);
                 }
             }
         }
     }
     return $res;
 }
Beispiel #3
0
 function GetNext()
 {
     global $DB;
     if ($res = parent::GetNext()) {
         $result = $res;
         foreach ($res as $key => $val) {
             if (substr($key, 0, 2) == "~~") {
                 unset($result[$key]);
                 $result[substr($key, 1)] = $val;
             }
         }
     }
     return $result;
 }
     ShowError(GetMessage('WIKI_ACCESS_DENIED'));
     return;
 }
 if (!empty($arHistoryResult)) {
     $history = new CBPHistoryService();
     $arFilter = array('DOCUMENT_ID' => $documentId);
     $dbResultList = $history->GetHistoryList(array('ID' => 'DESC'), $arFilter, false, false, array('ID'));
     $sTableID = 'tbl_bizproc_document_history';
     $rsHistory = new CDBResult($dbResultList, $sTableID);
     $iPrevHistoryId = 0;
     $iNextHistoryId = 0;
     $iCurHistoryId = 0;
     $arPrevHistory = array();
     $arNextHistory = array();
     $bFirst = true;
     while ($arHistory = $rsHistory->GetNext()) {
         if ($bFirst) {
             $bFirst = false;
             $iCurHistoryId = $arHistory['ID'];
         }
         if ($arHistory['ID'] == $historyId) {
             $arPrevHistory = $rsHistory->GetNext();
             break;
         }
         $arNextHistory = $arHistory;
     }
     if (!empty($arPrevHistory)) {
         $iPrevHistoryId = $arPrevHistory['ID'];
     }
     if (!empty($arNextHistory)) {
         $iNextHistoryId = $arNextHistory['ID'];
Beispiel #5
0
 function GetNext()
 {
     $res = parent::GetNext();
     if ($res) {
         if (strlen($res["DESCRIPTION"]) > 0) {
             $res["DESCRIPTION"] = $this->ConvertBBCode($res["DESCRIPTION"]);
         }
     }
     return $res;
 }
Beispiel #6
0
 public static function GetNext($bTextHtmlAuto = true, $use_tilda = true)
 {
     $r = parent::GetNext($bTextHtmlAuto, $use_tilda);
     if ($r) {
         $r["VALUE"] = str_repeat(" . ", $r["DEPTH_LEVEL"]) . $r["NAME"];
     }
     return $r;
 }
Beispiel #7
0
$catParams->bIsRed = 'N';
$catParams->createLinkFromTemplate();
$categories->addItem($catParams);
//Anyone can add custom virtual category to the list
$rsHandlers = GetModuleEvents("wiki", "OnCategoryListCreate");
while ($arHandler = $rsHandlers->Fetch()) {
    ExecuteModuleEventEx($arHandler, array(&$categories, $arParams['PATH_TO_CATEGORY']));
}
$arResult['CATEGORIES'] = $categories->GetItems();
sortByColumn($arResult['CATEGORIES'], "NAME");
//for pagination
$dbCatList = new CDBResult();
$dbCatList->InitFromArray($arResult['CATEGORIES']);
$arResult['CATEGORIES'] = array();
$dbCatList->NavStart($arParams['CATEGORY_COUNT'], false);
while ($arCat = $dbCatList->GetNext()) {
    $arResult['CATEGORIES'][strtolower($arCat["NAME"])] = $arCat;
}
$arResult['DB_LIST'] =& $dbCatList;
$arCatName = $categories->getItemsNames();
$arCatNameExists = array();
if (!empty($arCatName)) {
    // checking the category on the "red link"
    $arFilter = array('IBLOCK_ID' => $arParams['IBLOCK_ID'], 'CHECK_PERMISSIONS' => 'N', 'ACTIVE' => 'Y', 'NAME' => $arCatName);
    if (CWikiSocnet::IsSocNet()) {
        $arFilter['SUBSECTION'] = CWikiSocnet::$iCatId;
    }
    $rsElement = CIBlockElement::GetList(array(), $arFilter, false, false, array());
    while ($arElement = $rsElement->GetNext()) {
        $arCatNameExists[] = substr($arElement['NAME'], strpos($arElement['NAME'], ':') + 1);
    }
Beispiel #8
0
 /**
  * Обработчик результат. Вносим изменения при необходимости
  * @param  CDBResult $rsItems Выборка основного массива элементов
  * @return array              Основной массив элементов
  */
 private function data($rsItems) {
     while ($item = $rsItems->GetNext()) {
         $items[] = $this->composeItem(new Item($item));
     }
     return $items;
 }
                while ($arRequest = $dbRequests->GetNext()) {
                    $gu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arRequest["GROUP_ID"]));
                    $arGroup = CSocNetGroup::GetByID($arRequest["GROUP_ID"]);
                    $arImage = array();
                    if (intval($arParams["THUMBNAIL_LIST_SIZE"]) > 0) {
                        if (intval($arGroup["IMAGE_ID"]) <= 0) {
                            $arGroup["IMAGE_ID"] = COption::GetOptionInt("socialnetwork", "default_group_picture", false, SITE_ID);
                        }
                        $arImage = CFile::ResizeImageGet($arGroup["IMAGE_ID"], array("width" => $arParams["THUMBNAIL_LIST_SIZE"], "height" => $arParams["THUMBNAIL_LIST_SIZE"]), BX_RESIZE_IMAGE_EXACT, false);
                    }
                    $arEventTmp = array("EVENT_TYPE" => "INVITE_GROUP", "ID" => $arRequest["ID"], "USER_ID" => $arRequest["USER_ID"], "GROUP_ID" => $arRequest["GROUP_ID"], "GROUP_URL" => $gu, "GROUP_NAME" => $arGroup["NAME"], "GROUP_IMG" => $arImage, "DATE_CREATE" => $arRequest["DATE_CREATE"], "MESSAGE" => $parser->convert($arRequest["~MESSAGE"], false, array(), array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LIST" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "SMILES" => "Y", "UPLOAD" => "N", "NL2BR" => "N")));
                    $arTmpResult["RequestsOut"][] = $arEventTmp;
                }
            }
            $rsRequestsOut = new CDBResult();
            $rsRequestsOut->InitFromArray($arTmpResult["RequestsOut"]);
            $rsRequestsOut->NavStart();
            while ($arRecord = $rsRequestsOut->GetNext()) {
                $arResult["RequestsOut"]["List"][] = $arRecord;
            }
            $arResult["RequestsOut"]["NAV_STRING"] = $rsRequestsOut->GetPageNavStringEx($navComponentObject, GetMessage("SONET_URE_NAV"), "", false);
        } else {
            $arResult["FatalError"] = GetMessage("SONET_URE_NO_PERMS");
        }
    } else {
        $arResult["FatalError"] = GetMessage("SONET_URE_NO_USER");
    }
    $arResult["InfoMessage"] = $infoMessage;
    $arResult["ErrorMessage"] = $errorMessage;
}
$this->IncludeComponentTemplate();
Beispiel #10
0
 function GetNext($bTextHtmlAuto = true, $use_tilda = true)
 {
     $r = parent::GetNext($bTextHtmlAuto, $use_tilda);
     if ($r) {
         $r["VALUE"] = $r["NAME"];
     }
     return $r;
 }
Beispiel #11
0
	"bShowAll" => $arParams["PAGER_SHOW_ALL"],
);
$arNavigation = CDBResult::GetNavParams($arNavParams);
	
try {
	$obAuthor = new BeonoYandexFotki($arParams["AUTHOR"], $arParams['CACHE_TIME']);
	$arRawResult = $obAuthor->getAlbumPhotos($arParams["ALBUM_ID"], array('sort' => $arParams['PHOTOS_SORT']));
	$arResult = $arRawResult;
	$arResult['ITEMS'] = array();
	
	if (is_array($arRawResult['ITEMS'])) {
		$dbresult = new CDBResult;
		$dbresult->InitFromArray($arRawResult['ITEMS']);
		$dbresult->NavStart($arParams['ITEMS_LIMIT'], false);	
		
		while ($arItem = $dbresult->GetNext()) {
			$arItem['URL'] = str_replace(array('#album_id#', '#photo_id#'), array($arParams["ALBUM_ID"], $arItem["ID"]), $arParams['PHOTO_URL']);
			$arResult['ITEMS'][] = $arItem;
		}			
				
		$arResult['PAGE_NUMBER'] = $dbresult->NavPageNomer;
		$arResult["NAV_STRING"] = $dbresult->GetPageNavStringEx($navComponentObject, false, $arParams["PAGER_TEMPLATE"], $arParams["PAGER_SHOW_ALWAYS"]);
	}
	
	if (!$arRawResult['ID']) {
		throw new Exception(GetMessage('BEONO_YAFOTKI_COMP_ERROR_ALBUM404'));
	}	
	
} catch (Exception $e) {
	ShowError($e->getMessage());
	$this->AbortResultCache();
Beispiel #12
0
unset($rsProduct, $arProductRow);
//$obRes = CCrmProduct::GetList($arResult['SORT'], $arFilter, $arSelect, $arNavParams);
$obRes = new CDBResult();
$obRes->InitFromArray($arResultData);
$obRes->NavStart($arNavParams);
$arResult['PRODUCTS'] = array();
//$arResult['PRODUCT_ID_ARY'] = array();
$arResult['PERMS']['ADD'] = true;
//!$CCrmProduct->cPerms->HavePerm('CONTACT', BX_CRM_PERM_NONE, 'ADD');
$arResult['PERMS']['WRITE'] = true;
//!$CCrmProduct->cPerms->HavePerm('CONTACT', BX_CRM_PERM_NONE, 'WRITE');
$arResult['PERMS']['DELETE'] = true;
//!$CCrmProduct->cPerms->HavePerm('CONTACT', BX_CRM_PERM_NONE, 'DELETE');
$arProductId = array();
$arPropertyValues = array();
while ($arElement = $obRes->GetNext()) {
    if ($arElement['TYPE'] === 'S') {
        $arElement['DELETE'] = $arElement['EDIT'] = true;
        $arResult['SECTIONS'][$arElement['ID']] = $arElement;
    } else {
        if ($arElement['TYPE'] === 'P') {
            //$CCrmProduct->cPerms->CheckEnityAccess('PRODUCT', 'WRITE', $arContactAttr[$arElement['ID']])
            //$CCrmProduct->cPerms->CheckEnityAccess('PRODUCT', 'DELETE', $arContactAttr[$arElement['ID']])
            $arElement['DELETE'] = $arElement['EDIT'] = true;
            $arElement['PATH_TO_PRODUCT_SHOW'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_PRODUCT_SHOW'], array('product_id' => $arElement['ID']));
            $arElement['PATH_TO_PRODUCT_EDIT'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_PRODUCT_EDIT'], array('product_id' => $arElement['ID']));
            $arElement['PATH_TO_PRODUCT_DELETE'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_PRODUCT_LIST'], array('section_id' => $sectionID)), array('action_' . $arResult['GRID_ID'] => 'delete', 'ID' => $arElement['TYPE'] . $arElement['ID'], 'sessid' => bitrix_sessid()));
            foreach ($arPricesSelect as $fieldName) {
                $arElement['~' . $fieldName] = $arElement[$fieldName] = null;
            }
            foreach ($arVatsSelect as $fieldName) {