public function __construct($arParams) { $this->SITE_ID = $arParams["SITE_ID"]; $this->REWRITE = $arParams["REWRITE"]; $this->ModuleBlogGroup = '[' . $this->SITE_ID . '] ' . GetMessage("IDEA_BLOG_GROUP_NAME"); $this->ModuleBlogUrl .= "_" . $this->SITE_ID; //NULL CACHE BXClearCache(True, '/' . $this->SITE_ID . '/idea/'); BXClearCache(True, '/' . SITE_ID . '/idea/'); global $CACHE_MANAGER; if (CACHED_b_user_field_enum !== false) { $CACHE_MANAGER->CleanDir("b_user_field_enum"); } //Statuses List (for demo) $this->arResult["SETTINGS"]["STATUS"] = CIdeaManagment::getInstance()->Idea()->GetStatusList(); foreach ($this->arResult["SETTINGS"]["STATUS"] as $arStatus) { $this->arResult["SETTINGS"]["STATUS_ID"][$arStatus["XML_ID"]] = $arStatus["ID"]; } //Lang List $l = CLanguage::GetList($by = "sort", $order = "asc"); while ($r = $l->Fetch()) { $this->arResult["SETTINGS"]["LANG"][] = $r; } //Sites List $oSites = CSite::GetList($b = "", $o = "", array("ACTIVE" => "Y")); while ($site = $oSites->Fetch()) { $this->arResult["SETTINGS"]["SITE"][$site["LID"]] = array("LANGUAGE_ID" => $site["LANGUAGE_ID"], "ABS_DOC_ROOT" => $site["ABS_DOC_ROOT"], "DIR" => $site["DIR"], "SITE_ID" => $site["LID"], "SERVER_NAME" => $site["SERVER_NAME"], "NAME" => $site["NAME"]); } if (array_key_exists($this->SITE_ID, $this->arResult["SETTINGS"]["SITE"])) { $this->PublicDir = str_replace(array("#SITE_DIR#"), array($this->arResult["SETTINGS"]["SITE"][$this->SITE_ID]["DIR"]), $this->PublicDir); } $site = CFileMan::__CheckSite($this->SITE_ID); $this->DOCUMENT_ROOT = CSite::GetSiteDocRoot($site); $this->IO = CBXVirtualIo::GetInstance(); //SetDefault $this->arResult["INSTALLATION"]["IBLOCK_TYPE_INSTALL"] = true; $this->arResult["INSTALLATION"]["IBLOCK_INSTALL"] = true; $this->arResult["INSTALLATION"]["BLOG_GROUP_INSTALL"] = true; $this->arResult["INSTALLATION"]["BLOG_INSTALL"] = true; $this->CheckParams(); }
if (!CBlogPost::Delete($postId)) { $arResultNFCache["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_DEL_ERROR"); } else { CIdeaManagment::getInstance()->Notification(array("TYPE" => "IDEA", "ID" => $postId))->getSonetNotify()->Remove(); } } } else { if ($arResult["PostPerm"] < BLOG_PERMS_MODERATE) { $arResultNFCache["ERROR_MESSAGE"][] = $_GET["hide_id"] > 0 ? GetMessage("BLOG_BLOG_BLOG_MES_HIDE_NO_RIGHTS") : GetMessage("IDEA_BLOG_BLOG_MES_SHOW_NO_RIGHTS"); } elseif (!CBlogPost::Update($postId, array("PUBLISH_STATUS" => $_GET["hide_id"] > 0 ? BLOG_PUBLISH_STATUS_READY : BLOG_PUBLISH_STATUS_PUBLISH))) { $arResultNFCache["ERROR_MESSAGE"][] = $_GET["hide_id"] > 0 ? GetMessage("BLOG_BLOG_BLOG_MES_HIDE_ERROR") : GetMessage("BLOG_BLOG_BLOG_MES_SHOW_ERROR"); } } if (empty($arResultNFCache["ERROR_MESSAGE"])) { if (intval($_GET["hide_id"]) > 0 || intval($_GET["show_id"]) > 0) { $Notify = CIdeaManagment::getInstance()->Notification(array("ID" => $postId)); if (intval($_GET["hide_id"]) > 0) { $Notify->getSonetNotify()->HideMessage(); } else { $Notify->getSonetNotify()->ShowMessage(); } } BXClearCache(True, "/" . SITE_ID . "/idea/" . $arResult["BLOG"]["ID"] . "/first_page/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arResult["BLOG"]["ID"] . "/pages/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arResult["BLOG"]["ID"] . "/post/" . $postId . "/"); BXClearCache(True, '/' . SITE_ID . '/idea/statistic_list/'); BXClearCache(True, '/' . SITE_ID . '/idea/tags/'); //RSS BXClearCache(True, "/" . SITE_ID . "/idea/" . $arResult["BLOG"]["ID"] . "/rss_list"); LocalRedirect($APPLICATION->GetCurPageParam("success=Y", array("sessid", "success"))); }
public function getAscendedCategories($category = null, $userId = null) { $return = false; $userId = $userId === null ? $this->userID : $userId; if ($this->IblockID > 0 && $userId > 0) { $cache = $this->checkCache($userId, array("CATEGORY" => $category)); if (!!$cache) { $return = $cache; } else { if (empty($category)) { $return = array(); $db_res = NotifyEmailTable::getList(array("filter" => array("USER_ID" => $userId, "=ENTITY_TYPE" => NotifyEmailTable::ENTITY_TYPE_CATEGORY, "=ENTITY_CODE" => NULL))); while ($res = $db_res->fetch()) { array_push($return, $res); } } else { if (is_string($category) && ($categories = \CIdeaManagment::getInstance()->idea()->getCategoryList()) && !empty($categories)) { $category = ToUpper($category); if (array_key_exists($category, $categories)) { $return = array(); $category = $categories[$category]; $db_res = NotifyEmailTable::getList(array("filter" => array("=USER_ID" => $userId, "=ENTITY_TYPE" => NotifyEmailTable::ENTITY_TYPE_CATEGORY, "=ASCENDED_CATEGORIES.IBLOCK_ID" => \CIdeaManagment::getInstance()->idea()->getCategoryListID(), "<=ASCENDED_CATEGORIES.DEPTH_LEVEL" => $category["DEPTH_LEVEL"], "<=ASCENDED_CATEGORIES.LEFT_MARGIN" => $category["LEFT_MARGIN"], ">=ASCENDED_CATEGORIES.RIGHT_MARGIN" => $category["RIGHT_MARGIN"]))); while ($res = $db_res->fetch()) { array_push($return, $res); } } } } } $this->setCache($userId, array("CATEGORY" => $category), $return); } return $return; }
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } /** * @var array $arResult * @var array $arParams * @var CMain $APPLICATION * @var CBitrixComponent $component */ ?> <div id="idea-editor-container"> <?php $APPLICATION->IncludeComponent("bitrix:idea.edit", "light", array("BLOG_URL" => $arParams["BLOG_URL"], "PATH_TO_POST" => $arParams["PATH_IDEA_POST"], "SET_TITLE" => "N", "SET_NAV_CHAIN" => "N", "POST_PROPERTY" => CIdeaManagment::getInstance()->GetUserFieldsArray(), "SMILES_COLS" => $arParams["SMILES_COLS"], "SMILES_COUNT" => 1, "EDITOR_RESIZABLE" => "N", "EDITOR_DEFAULT_HEIGHT" => "200", "POST_BIND_STATUS_DEFAULT" => $arParams["POST_BIND_STATUS_DEFAULT"], "AUTH_TEMPLATE" => $arParams["AUTH_TEMPLATE"], "SHOW_RATING" => $arParams["SHOW_RATING"], "FORGOT_PASSWORD_URL" => $arParams["FORGOT_PASSWORD_URL"], "REGISTER_URL" => $arParams["REGISTER_URL"]), $component); ?> </div>
ShowError(GetMessage("IDEA_MODULE_NOT_INSTALL")); return; } $arBlog = CBlog::GetByUrl($arParams["IDEA_URL"]); $cache = new CPHPCache(); $cache_id = "idea_rss_out_" . serialize($arParams); $cache_path = "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/rss_list/"; $arParams["RSS_CNT"] = intval($arParams["RSS_CNT"]); if ($arParams["RSS_CNT"] == 0) { $arParams["RSS_CNT"] = 10; } if (!is_array($arParams["FILTER"])) { $arParams["FILTER"] = array(); } $arParams["CACHE_TIME"] = intval($arParams["CACHE_TIME"]); $arTemplateParams = array("CUSTOM_TITLE" => $arParams["~CUSTOM_TITLE"], "PATH_TO_POST" => $arParams["PATH_TO_POST"], "IMAGE_MAX_WIDTH" => $arParams["IMAGE_MAX_WIDTH"], "IMAGE_MAX_HEIGHT" => $arParams["IMAGE_MAX_HEIGHT"], "USER" => $arParams["USER"], "INDEX" => $arParams["INDEX"]); $APPLICATION->RestartBuffer(); header("Content-Type: text/xml"); header("Pragma: no-cache"); if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) { $cache->Output(); } else { if ($arParams["CACHE_TIME"] > 0) { $cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path); } echo CIdeaManagment::getInstance()->GetRSS($arParams["IDEA_URL"], $arParams["RSS_TYPE"], $arParams["RSS_CNT"], SITE_ID, $arTemplateParams, $arParams["FILTER"]); if ($arParams["CACHE_TIME"] > 0) { $cache->EndDataCache(array()); } } die;
} if (strlen($arParams["PATH_TO_" . ToUpper($url)]) <= 0) { $arResult["PATH_TO_" . ToUpper($url)] = htmlspecialcharsbx($APPLICATION->GetCurPage()) . "?" . htmlspecialcharsbx($arVariableAliases["page"]) . "=" . $url . $subURL; } } $arResult["PATH_TO_BLOG_CATEGORY"] = htmlspecialcharsbx($APPLICATION->GetCurPage()) . '?tag=#category_id#'; } $arResult["~PATH_TO_POST_ADD"] = CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_POST_EDIT"], array("post_id" => "new")); $arResult["~PATH_TO_USER_IDEAS"] = CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_IDEAS"], array("user_id" => $USER->GetID())); $arResult["~PATH_TO_USER_SUBSCRIBE"] = CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_SUBSCRIBE"], array("user_id" => $USER->GetID())); $arResult = array_merge(array("SEF_MODE" => $arParams["SEF_MODE"], "SEF_FOLDER" => $arParams["SEF_FOLDER"], "VARIABLES" => $arVariables, "ALIASES" => $arParams["SEF_MODE"] == "Y" ? array() : $arVariableAliases, "SET_TITLE" => $arParams["SET_TITLE"], "PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"], "CACHE_TYPE" => $arParams["CACHE_TYPE"], "CACHE_TIME" => $arParams["CACHE_TIME"], "CACHE_TIME_LONG" => $arParams["CACHE_TIME_LONG"], "SET_NAV_CHAIN" => $arParams["SET_NAV_CHAIN"], "MESSAGE_COUNT" => $arParams["MESSAGE_COUNT"], "BLOG_COUNT" => $arParams["BLOG_COUNT"], "COMMENTS_COUNT" => $arParams["COMMENTS_COUNT"], "BLOG_COUNT_MAIN" => $arParams["BLOG_COUNT_MAIN"], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "PERIOD_DAYS" => $arParams["PERIOD_DAYS"], "NAV_TEMPLATE" => $arParams["NAV_TEMPLATE"], "ACTIONS" => array(), "IS_CORPORTAL" => IsModuleInstalled('intranet') ? "Y" : "N", "IS_AJAX" => $_REQUEST["AJAX"] == 'IDEA' ? 'Y' : "N", "LIFE_SEARCH_QUERY" => CUtil::decodeURIComponent($_REQUEST["LIFE_SEARCH_QUERY"]) || true ? $_REQUEST["LIFE_SEARCH_QUERY"] : ""), $arResult); if ($arParams["DISABLE_SONET_LOG"] == "Y" || !IsModuleInstalled('socialnetwork')) { CIdeaManagment::getInstance()->Notification()->GetSonetNotify()->Disable(); } if ($arParams["DISABLE_EMAIL"] == "Y") { CIdeaManagment::getInstance()->Notification()->GetEmailNotify()->Disable(); } //Permissions $arResult["IDEA_MODERATOR"] = false; if (!empty($arParams["POST_BIND_USER"]) && array_intersect($USER->GetUserGroupArray(), $arParams["POST_BIND_USER"]) || $USER->IsAdmin()) { $arResult["IDEA_MODERATOR"] = true; } //Deprecated $arResult["PATH_TO_POST_ADD"] = $arResult["~PATH_TO_POST_ADD"]; $arParams["COMMENT_EDITOR_CODE_DEFAULT"] = $arParams[array_key_exists("COMMENT_EDITOR_CODE_DEFAULT", $arParams) ? "COMMENT_EDITOR_CODE_DEFAULT" : "EDITOR_CODE_DEFAULT"]; $arParams["COMMENT_EDITOR_RESIZABLE"] = $arParams[array_key_exists("COMMENT_EDITOR_RESIZABLE", $arParams) ? "COMMENT_EDITOR_RESIZABLE" : "EDITOR_RESIZABLE"]; $arParams["SMILES_COUNT"] = $arParams["SMILES_COUNT"] > 0 ? $arParams["SMILES_COUNT"] : 1; if (!array_key_exists("IBLOCK_CATEGORIES", $arParams) && array_key_exists("IBLOCK_CATOGORIES", $arParams)) { $arParams["IBLOCK_CATEGORIES"] = $arParams["IBLOCK_CATOGORIES"]; } if ($arResult["IS_AJAX"] == "Y") {
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } if ($arParams["SET_NAV_CHAIN_IDEA"] == "Y") { $Category = $arResult["POST_PROPERTIES"]["DATA"]["UF_CATEGORY_CODE"]["VALUE"]; $bParentCat = false; $arCategoryList = CIdeaManagment::getInstance()->Idea()->GetCategoryList(); if (isset($arCategoryList[$Category])) { if ($arCategoryList[$Category]["DEPTH_LEVEL"] > 1) { foreach ($arCategoryList as $Cat) { if ($arCategoryList[$Category]["IBLOCK_SECTION_ID"] == $Cat["ID"]) { $APPLICATION->AddChainItem($Cat["NAME"], str_replace("#category_1#", ToLower($Cat["CODE"]), $arParams["EXT"][0]["PATH_TO_CATEGORY_1"])); $bParentCat = true; break; } } } if ($bParentCat) { $APPLICATION->AddChainItem($arCategoryList[$Category]["NAME"], str_replace(array("#category_1#", "#category_2#"), array(ToLower($Cat["CODE"]), ToLower($Category)), $arParams["EXT"][0]["PATH_TO_CATEGORY_2"])); } else { $APPLICATION->AddChainItem($arCategoryList[$Category]["NAME"], str_replace(array("#category_1#"), array(ToLower($Category)), $arParams["EXT"][0]["PATH_TO_CATEGORY_1"])); } if (isset($arResult["Post"]["TITLE"])) { $APPLICATION->AddChainItem($arResult["Post"]["TITLE"]); } } }
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) { die; } $arCategoryList = CIdeaManagment::getInstance()->Idea()->GetCategoryList(); $arCategoryFilter = CIdeaManagment::getInstance()->Idea()->GetSubCategoryList(ToUpper($arResult["VARIABLES"]["category"])); $arCategoryFilter = $arCategoryFilter["CODE"]; $APPLICATION->IncludeComponent("bitrix:idea.rss", "", array("RSS_TYPE" => $arResult["VARIABLES"]["type"], "IDEA_URL" => $arParams["BLOG_URL"], "CACHE_TIME" => $arParams["CACHE_TIME"], "FILTER" => array(CIdeaManagment::UFCategroryCodeField => $arCategoryFilter), "PATH_TO_POST" => $arResult["PATH_TO_POST"], "IMAGE_MAX_WIDTH" => $arParams["IMAGE_MAX_WIDTH"], "IMAGE_MAX_HEIGHT" => $arParams["IMAGE_MAX_HEIGHT"], "USER" => $arResult["PATH_TO_USER"], "INDEX" => $arResult["PATH_TO_INDEX"], "RSS_CNT" => 10, "CUSTOM_TITLE" => GetMessage("RSS_TITLE", array("#IDEA_CATEGORY#" => $arCategoryList[ToUpper($arResult["VARIABLES"]["category"])]["NAME"]))), $component);
public static function GetCategorySequenceByCode($CODE, $arCategoryList = false) { return CIdeaManagment::getInstance()->Idea()->GetCategorySequence($CODE); }
case "GET_LIFE_SEARCH": unset($_GET["ACTION"], $_GET["AJAX"]); //clear page navigation parameters $this->IncludeComponentTemplate($componentPage); $arAjaxResult = array("CONTENT" => $APPLICATION->GetViewContent("idea_body"), "SUCCESS" => "Y"); break; case "SUBSCRIBE": $IdeaId = intval($_REQUEST["IDEA_ID"]); $arAjaxResult = array("CONTENT" => "", "SUCCESS" => "N"); if (check_bitrix_sessid() && $USER->IsAuthorized() && $IdeaId > 0 && CIdeaManagment::getInstance()->Notification()->getEmailNotify()->add($IdeaId)) { $arAjaxResult["SUCCESS"] = "Y"; $arAjaxResult["CONTENT"] = GetMessage("IDEA_POST_UNSUBSCRIBE"); } break; case "UNSUBSCRIBE": $IdeaId = intval($_REQUEST["IDEA_ID"]); $arAjaxResult = array("CONTENT" => "", "SUCCESS" => "N"); if (check_bitrix_sessid() && $USER->IsAuthorized() && $IdeaId > 0) { $bNotify = CIdeaManagment::getInstance()->Notification()->getEmailNotify()->delete($IdeaId); if ($bNotify) { $arAjaxResult["SUCCESS"] = "Y"; $arAjaxResult["CONTENT"] = GetMessage("IDEA_POST_SUBSCRIBE"); } } break; } } //Return JSON $APPLICATION->RestartBuffer(); echo CUtil::PhpToJSObject($arAjaxResult); die;
LocalRedirect($url); } else { $arResult["ERROR_MESSAGE"] .= GetMessage("BLOG_BLOG_BLOG_MES_HIDE_ERROR") . '<br />'; } } else { $arResult["ERROR_MESSAGE"] .= GetMessage("BLOG_BLOG_BLOG_MES_HIDE_NO_RIGHTS") . '<br />'; } } } if ($_GET["show"] == "Y" && $arResult["IDEA_MODERATOR"]) { if ($_GET["success"] == "Y") { } elseif (check_bitrix_sessid()) { if ($arResult["PostPerm"] >= BLOG_PERMS_MODERATE) { if (CBlogPost::Update($arParams["ID"], array("PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH))) { //Socialnetwork notification $Notify = CIdeaManagment::getInstance()->Notification(array("ID" => $arParams["ID"])); $Notify->getSonetNotify()->ShowMessage(); BXClearCache(True, '/' . SITE_ID . '/idea/statistic_list/'); BXClearCache(True, '/' . SITE_ID . '/idea/tags/'); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/pages/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/first_page/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/post/" . $arParams["ID"] . "/"); //RSS BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/rss_list"); //if ($bSoNet) // CBlogPost::DeleteLog($arParams["ID"]); $url = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("post_id" => $arParams["ID"], "blog" => $arBlog["URL"], "user_id" => $arBlog["OWNER_ID"], "group_id" => $arBlog["SOCNET_GROUP_ID"])); if (strpos("?", $url) === false) { $url .= "?"; } else { $url .= "&";
$arResult["IDEA"][$r["ID"]] = $r + array("TITLE" => GetMessage("IDEA_SUBSCRIBE_NOT_FOUND")); $arBlogPostId[] = $r["ENTITY_CODE"]; } } } } } //Grid Nav $arResult["GRID"]["NAVIGATION"] = $oIdeaSubscribe; if (!empty($arBlogPostId)) { $arSortArgument = each($arResult["GRID"]["SORT"]); $oIdeaPost = CBlogPost::GetList(array($arSortArgument["key"] => $arSortArgument["value"]), array("ID" => $arBlogPostId), false, false, array("ID", "TITLE", "PATH", "DATE_PUBLISH", CIdeaManagment::UFStatusField, "AUTHOR_LOGIN", "AUTHOR_NAME", "AUTHOR_LAST_NAME", "AUTHOR_SECOND_NAME")); while ($r = $oIdeaPost->Fetch()) { $arResult["IDEA"][CIdeaManagmentEmailNotify::SUBSCRIBE_IDEA_COMMENT . $r["ID"]] = $r; } $arResult["IDEA_STATUS"] = CIdeaManagment::getInstance()->Idea()->GetStatusList(); } //Make Grid $arResult["GRID"]["ID"] = "idea_subscribe_" . $arResult["USER_ID"]; foreach ($arResult["IDEA"] as $res) { $arColumns = array(); if ($res["ENTITY_TYPE"] == \Bitrix\Idea\NotifyEmailTable::ENTITY_TYPE_CATEGORY) { $data = array("NAME" => $res["TITLE"], "STATUS" => $res["SUBSCRIBE_TYPE"] == \Bitrix\Idea\NotifyEmailTable::SUBSCRIBE_TYPE_NEW_IDEAS ? GetMessage("IDEA_SUBSCRIBE_NEW_IDEAS") : ""); } else { if (array_key_exists("PATH", $res)) { $arColumns = array("NAME" => "<a href='" . CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($res["PATH"]), array("post_id" => $res["ID"])) . "'>" . $res["TITLE"] . "</a>"); } $AuthorName = CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $res["AUTHOR_NAME"], "LAST_NAME" => $res["AUTHOR_LAST_NAME"], "SECOND_NAME" => $res["AUTHOR_SECOND_NAME"], "LOGIN" => $res["AUTHOR_LOGIN"]), true); $data = array("NAME" => $res["TITLE"], "STATUS" => $arResult["IDEA_STATUS"][$res[CIdeaManagment::UFStatusField]]["VALUE"], "PUBLISHED" => $res["DATE_PUBLISH"], "AUTHOR" => $AuthorName); } $arResult["GRID"]["DATA"][] = array("data" => $data, "actions" => array(array("ICONCLASS" => "delete", "TEXT" => GetMessage("IDEA_POST_UNSUBSCRIBE"), "ONCLICK" => "window.location.href='" . CUtil::JSEscape($APPLICATION->GetCurPageParam("ACTION=DELETE&ENTITY_TYPE=" . $res["ENTITY_TYPE"] . "&ENTITY_CODE=" . $res["ENTITY_CODE"] . "&" . bitrix_sessid_get(), array("ACTION", "ID", "ENTITY_TYPE", "ENTITY_CODE", "sessid"))) . "';")), "columns" => $arColumns, "editable" => false);
<div class="blog-post-field blog-post-field-user-prop blog-edit-field"> <?php foreach ($arResult["POST_PROPERTIES"]["DATA"] as $FIELD_NAME => $arPostField) { if ($arResult["POST_PROPERTIES"]["DATA"][$FIELD_NAME]["UF_SHOW"] === false) { continue; } ?> <div class="field-title-idea-<?php echo $FIELD_NAME; ?> "><?php echo $arPostField["EDIT_FORM_LABEL"]; ?> </div> <?php $APPLICATION->IncludeComponent("bitrix:system.field.edit", $arPostField["UF_TEMPLATE"], array("arUserField" => $arPostField, "POST_BIND_USER" => $arParams["POST_BIND_USER"], "IBLOCK_CATOGORIES" => CIdeaManagment::getInstance()->Idea()->GetCategoryListID()), $component->__parent, array("HIDE_ICONS" => "Y")); ?> <?php } ?> <br clear="both"/> </div> <div class="blog-clear-float"></div> </div> <?php } ?> <?php //endif; ?> <input type="hidden" name="save" value="Y">
$DB->Query("UPDATE b_blog_image SET POST_ID=" . $newID . " WHERE BLOG_ID=" . $arBlog["ID"] . " AND POST_ID=0", true); } if (IntVal($newID) > 0 && strlen($arResult["ERROR_MESSAGE"]) <= 0) { if ($arFields["ACTION"] == "ADD") { $arResult["SUCCESS_MESSAGE"] = GetMessage("IDEA_NEW_MESSAGE_SUCCESS"); } //Get Author Name $arResult["BlogUser"] = CBlogUser::GetByID($arFields["AUTHOR_ID"], BLOG_BY_USER_ID); $arResult["BlogUser"] = CBlogTools::htmlspecialcharsExArray($arResult["BlogUser"]); $arResult["arUser"] = CUser::GetByID($arFields["AUTHOR_ID"])->GetNext(); $AuthorName = CBlogUser::GetUserName($arResult["BlogUser"]["~ALIAS"], $arResult["arUser"]["~NAME"], $arResult["arUser"]["~LAST_NAME"], $arResult["arUser"]["~LOGIN"]); $IdeaParser = new blogTextParser(false, $arParams["PATH_TO_SMILE"]); $arCategoryList = CIdeaManagment::getInstance()->Idea()->GetCategoryList(); $arNotifyFields = array_merge($arFields, array("AUTHOR" => $AuthorName, "IDEA_TEXT" => $IdeaParser->convert4mail($arFields["DETAIL_TEXT"]), "SHOW_RATING" => $arParams["SHOW_RATING"], "RATING_TYPE_ID" => 'BLOG_POST', "RATING_ENTITY_ID" => $newID, "ID" => $newID, "TYPE" => "IDEA", "CATEGORY" => $arCategoryList[$arFields[CIdeaManagment::UFCategroryCodeField]]["NAME"], "FULL_PATH" => "http://" . $serverName . CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arFields["PATH"]), array("post_id" => $newID)), "PATH" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arFields["PATH"]), array("post_id" => $newID)))); //Notifications $Notify = CIdeaManagment::getInstance()->Notification($arNotifyFields); //Socialnetwork notification $Notify->getSonetNotify()->Send(); //Email notification $Notify->getEmailNotify()->Send(); //Clear Caching and redirect BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/first_page/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/pages/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/post/" . $newID . "/"); BXClearCache(True, '/' . SITE_ID . '/idea/statistic_list/'); //Redirect if not AJAX if ($_REQUEST["AJAX"] != "Y") { LocalRedirect($arNotifyFields["PATH"]); } } else { if ($ex = $APPLICATION->GetException()) {
</div> <div id="idea-category-list-box"> <?php $i = 0; foreach ($arRootCategory as $arCategory) { ?> <div class="idea-category-list" id="idea-category-list-<?php echo ToLower($arCategory["CODE"]); ?> -content" <?php if ($i++ > 0) { ?> style="display:none;"<?php } ?> > <?php $arFilter = array(); if ($arCategory["IS_CATEGOTY"] != "N") { $arFilter = array("IDEA_PARENT_CATEGORY_CODE" => ToUpper($arCategory["CODE"])); } ?> <?php $APPLICATION->IncludeComponent("bitrix:idea.list", "light", array("RATING_TEMPLATE" => $arParams['RATING_TEMPLATE'], "SORT_BY1" => "RATING_TOTAL_VALUE", "IBLOCK_CATOGORIES" => $arParams["IBLOCK_CATOGORIES"], "EXT_FILTER" => $arFilter, "MESSAGE_COUNT" => $arParams["LIST_MESSAGE_COUNT"], "PATH_TO_POST" => $arParams["PATH_IDEA_POST"], "BLOG_URL" => $arParams["BLOG_URL"], "CACHE_TYPE" => "Y", "CACHE_TIME" => 3600, "SET_NAV_CHAIN" => "N", "POST_PROPERTY_LIST" => CIdeaManagment::getInstance()->GetUserFieldsArray(), "DATE_TIME_FORMAT" => "d.m.Y", "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"], "SHOW_RATING" => $arParams["SHOW_RATING"]), $component); ?> </div> <?php } ?> </div> </div>
$arResult["ERROR_MESSAGE"] = array(); $arResultNFCache["OK_MESSAGE"] = array(); $arResultNFCache["ERROR_MESSAGE"] = array(); if (strlen($arParams["BLOG_URL"]) > 0) { $user_id = IntVal($USER->GetID()); //Message delete if (IntVal($_GET["del_id"]) > 0 && $arResult["IDEA_MODERATOR"]) { if ($arResult["BLOG"] = CBlog::GetByUrl($arParams["BLOG_URL"], $arParams["GROUP_ID"])) { if ($_GET["success"] == "Y") { $arResultNFCache["OK_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_DELED"); } else { if (check_bitrix_sessid() && CBlogPost::CanUserDeletePost(IntVal($_GET["del_id"]), $user_id)) { $DEL_ID = IntVal($_GET["del_id"]); if (CBlogPost::GetByID($DEL_ID)) { //Remove Sonet $Notify = CIdeaManagment::getInstance()->Notification(array("TYPE" => "IDEA", "ID" => $DEL_ID))->getSonetNotify()->Remove(); if (CBlogPost::Delete($DEL_ID)) { BXClearCache(True, "/" . SITE_ID . "/idea/" . $arResult["BLOG"]["ID"] . "/first_page/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arResult["BLOG"]["ID"] . "/pages/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arResult["BLOG"]["ID"] . "/post/" . $DEL_ID . "/"); BXClearCache(True, '/' . SITE_ID . '/idea/statistic_list/'); //RSS BXClearCache(True, "/" . SITE_ID . "/idea/" . $arResult["BLOG"]["ID"] . "/rss_list"); LocalRedirect($APPLICATION->GetCurPageParam("del_id=" . $DEL_ID . "&success=Y", array("del_id", "sessid", "success"))); } else { $arResultNFCache["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_DEL_ERROR"); } } } else { $arResultNFCache["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_DEL_NO_RIGHTS"); }
} else { if ($commentID = CBlogComment::Update($commentID, $arFields)) { //Notifications $Notify = CIdeaManagment::getInstance()->Notification(array_merge($arFields, array("TYPE" => 'IDEA_COMMENT', "ACTION" => 'UPDATE', "AUTHOR_ID" => $user_id, "ID" => $commentID, "POST_ID" => $arPost["ID"]))); //Socialnetwork notification $Notify->getSonetNotify()->Send(); //Email notification //$Notify->getEmailNotify()->Send(); //END -> Notifications //start custom, use UF binding ::@Idea if ($arResult["IDEA_MODERATOR"] && $_REQUEST["BIND_OFFICIAL_ANSWER"] == "Y") { // Bind offical answer CIdeaManagment::getInstance()->IdeaComment($commentID)->Bind(); } if ($arResult["IDEA_MODERATOR"] && $_REQUEST["BIND_IDEA_STATUS"] != "") { CIdeaManagment::getInstance()->Idea($arPost["ID"])->SetStatus($_REQUEST["BIND_IDEA_STATUS"]); BXClearCache(True, '/' . SITE_ID . '/idea/statistic_list/'); } /*end*/ BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/comment/" . $arOldComment["POST_ID"] . "/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/post/" . $arOldComment["POST_ID"] . "/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/first_page/"); BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/pages/"); $commentUrl = CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("blog" => $arBlog["URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arBlog["OWNER_ID"], "group_id" => $arParams["SOCNET_GROUP_ID"])); if (strpos($commentUrl, "?") !== false) { $commentUrl .= "&"; } else { $commentUrl .= "?"; } if ($_REQUEST["redirect_type"] == 'list') { //bx redirect for idea list
$arBlogPostFields = array(); $arBlogPostFields[] = array("TITLE" => GetMessage("IDEA_BLOG_DEMO_MESSAGE_TITLE_1"), "DETAIL_TEXT" => GetMessage("IDEA_BLOG_DEMO_MESSAGE_BODY_1"), "DETAIL_TEXT_TYPE" => "text", "BLOG_ID" => $blogID, "AUTHOR_ID" => 1, "=DATE_CREATE" => $DB->GetNowFunction(), "=DATE_PUBLISH" => $DB->GetNowFunction(), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "ENABLE_TRACKBACK" => 'N', "ENABLE_COMMENTS" => 'Y', "CATEGORY_ID" => implode(",", $categoryID[0]), "UF_CATEGORY_CODE" => ToUpper(GetMessage("IDEA_UF_CATEGORY_CODE_1")), "UF_STATUS" => $arUFIdByName["NEW"], "PERMS_POST" => array(1 => BLOG_PERMS_READ, 2 => BLOG_PERMS_READ), "PERMS_COMMENT" => array(1 => BLOG_PERMS_WRITE, 2 => BLOG_PERMS_WRITE), "PATH" => WIZARD_SITE_DIR . '/about/idea/#post_id#/', "CODE" => "mahogany_furniture"); $arBlogPostFields[] = array("TITLE" => GetMessage("IDEA_BLOG_DEMO_MESSAGE_TITLE_2"), "DETAIL_TEXT" => GetMessage("IDEA_BLOG_DEMO_MESSAGE_BODY_2"), "DETAIL_TEXT_TYPE" => "text", "BLOG_ID" => $blogID, "AUTHOR_ID" => 1, "=DATE_CREATE" => $DB->GetNowFunction(), "=DATE_PUBLISH" => $DB->GetNowFunction(), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "ENABLE_TRACKBACK" => 'N', "ENABLE_COMMENTS" => 'Y', "CATEGORY_ID" => implode(",", $categoryID[1]), "UF_CATEGORY_CODE" => ToUpper(GetMessage("IDEA_UF_CATEGORY_CODE_2")), "UF_STATUS" => $arUFIdByName["PROCESSING"], "PERMS_POST" => array(1 => BLOG_PERMS_READ, 2 => BLOG_PERMS_READ), "PERMS_COMMENT" => array(1 => BLOG_PERMS_WRITE, 2 => BLOG_PERMS_WRITE), "PATH" => WIZARD_SITE_DIR . '/about/idea/#post_id#/', "CODE" => "courier_delivery"); $arBlogPostFields[] = array("TITLE" => GetMessage("IDEA_BLOG_DEMO_MESSAGE_TITLE_3"), "DETAIL_TEXT" => GetMessage("IDEA_BLOG_DEMO_MESSAGE_BODY_3"), "DETAIL_TEXT_TYPE" => "text", "BLOG_ID" => $blogID, "AUTHOR_ID" => 1, "=DATE_CREATE" => $DB->GetNowFunction(), "=DATE_PUBLISH" => $DB->GetNowFunction(), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "ENABLE_TRACKBACK" => 'N', "ENABLE_COMMENTS" => 'Y', "CATEGORY_ID" => implode(",", $categoryID[2]), "UF_CATEGORY_CODE" => ToUpper(GetMessage("IDEA_UF_CATEGORY_CODE_3")), "UF_STATUS" => $arUFIdByName["COMPLETED"], "PERMS_POST" => array(1 => BLOG_PERMS_READ, 2 => BLOG_PERMS_READ), "PERMS_COMMENT" => array(1 => BLOG_PERMS_WRITE, 2 => BLOG_PERMS_WRITE), "PATH" => WIZARD_SITE_DIR . '/about/idea/#post_id#/', "CODE" => "thanks"); $arBlogPostFields[] = array("TITLE" => GetMessage("IDEA_BLOG_DEMO_MESSAGE_TITLE_4"), "DETAIL_TEXT" => GetMessage("IDEA_BLOG_DEMO_MESSAGE_BODY_4"), "DETAIL_TEXT_TYPE" => "text", "BLOG_ID" => $blogID, "AUTHOR_ID" => 1, "=DATE_CREATE" => $DB->GetNowFunction(), "=DATE_PUBLISH" => $DB->GetNowFunction(), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "ENABLE_TRACKBACK" => 'N', "ENABLE_COMMENTS" => 'Y', "CATEGORY_ID" => implode(",", $categoryID[3]), "UF_CATEGORY_CODE" => ToUpper(GetMessage("IDEA_UF_CATEGORY_CODE_4")), "UF_STATUS" => $arUFIdByName["NEW"], "PERMS_POST" => array(1 => BLOG_PERMS_READ, 2 => BLOG_PERMS_READ), "PERMS_COMMENT" => array(1 => BLOG_PERMS_WRITE, 2 => BLOG_PERMS_WRITE), "PATH" => WIZARD_SITE_DIR . 'about/idea/#post_id#/', "CODE" => "redesign"); $arBlogPostId = array(); foreach ($arBlogPostFields as $BlogPostFields) { $arBlogPostId[] = CBlogPost::Add($BlogPostFields); } foreach ($arBlogPostId as $key => $BlogPostId) { if (!is_array($categoryID[$key])) { continue; } foreach ($categoryID[$key] as $v) { CBlogPostCategory::Add(array("BLOG_ID" => $blogID, "POST_ID" => $BlogPostId, "CATEGORY_ID" => $v)); } } //Post Comments $arBlogCommentFields = array(); $arBlogCommentFields[] = array("TITLE" => '', "POST_TEXT" => GetMessage("IDEA_BLOG_DEMO_COMMENT_BODY_1"), "BLOG_ID" => $blogID, "POST_ID" => $arBlogPostId[2], "PARENT_ID" => 0, "AUTHOR_ID" => 1, "DATE_CREATE" => ConvertTimeStamp(false, "FULL"), "AUTHOR_IP" => "192.168.0.108", "PATH" => WIZARD_SITE_DIR . "about/idea/#post_id#/?commentId=#comment_id###comment_id#"); $arBlogCommentFields[] = array("TITLE" => '', "POST_TEXT" => GetMessage("IDEA_BLOG_DEMO_COMMENT_BODY_3"), "BLOG_ID" => $blogID, "POST_ID" => $arBlogPostId[2], "PARENT_ID" => 0, "AUTHOR_ID" => 1, "DATE_CREATE" => ConvertTimeStamp(false, "FULL"), "AUTHOR_IP" => "192.168.0.108", "PATH" => WIZARD_SITE_DIR . "about/idea/#post_id#/?commentId=#comment_id###comment_id#"); $arBlogCommentFields[] = array("TITLE" => '', "POST_TEXT" => GetMessage("IDEA_BLOG_DEMO_COMMENT_BODY_2"), "BLOG_ID" => $blogID, "POST_ID" => $arBlogPostId[1], "PARENT_ID" => 0, "AUTHOR_ID" => 1, "DATE_CREATE" => ConvertTimeStamp(false, "FULL"), "AUTHOR_IP" => "192.168.0.108", "PATH" => WIZARD_SITE_DIR . "about/idea/#post_id#/?commentId=#comment_id###comment_id#"); $arCommentId = array(); foreach ($arBlogCommentFields as $BlogCommentFields) { $arCommentId[] = CBlogComment::Add($BlogCommentFields); } CIdeaManagment::getInstance()->IdeaComment($arCommentId[0])->Bind(); CIdeaManagment::getInstance()->IdeaComment($arCommentId[2])->Bind(); //Replace in file CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/about/idea/index.php", array("IDEA_BLOG_CODE" => $IdeaBlogUrl, "IDEA_BIND_STATUS_DEFAULT" => $arUFIdByName["NEW"], "SITE_DIR" => WIZARD_SITE_DIR)); CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/include/feedback.php", array("IDEA_BLOG_CODE" => $IdeaBlogUrl, "IDEA_BIND_STATUS_DEFAULT" => $arUFIdByName["NEW"], "SITE_DIR" => WIZARD_SITE_DIR));
} $arResult["ITEMS"] = array(); $previousDepthLevel = 1; $index = 0; $arParams["IBLOCK_CATEGORIES"] = array_key_exists("IBLOCK_CATEGORIES", $arParams) ? $arParams["IBLOCK_CATEGORIES"] : $arParams["IBLOCK_CATOGORIES"]; $arResult["CATEGORY"] = CIdeaManagment::getInstance()->Idea()->GetCategoryList($arParams["IBLOCK_CATEGORIES"]); foreach ($arResult["CATEGORY"] as $arCategory) { if ($index > 0) { $arResult["ITEMS"][$index - 1]["IS_PARENT"] = $arCategory["DEPTH_LEVEL"] > $previousDepthLevel; } $previousDepthLevel = $arCategory["DEPTH_LEVEL"]; //Make only 2d level %TODO% //if($arCategory["DEPTH_LEVEL"]>2) // $arCategory["DEPTH_LEVEL"] = 2; $ItemLink = $arCategory["DEPTH_LEVEL"] == 1 ? $arParams["PATH_TO_CATEGORY_1"] : $arParams["PATH_TO_CATEGORY_2"]; $arSequence = CIdeaManagment::getInstance()->Idea()->GetCategorySequence($arCategory["CODE"]); if (!$arSequence) { $arSequence = ""; } $ItemLink = str_replace(array("#category_1#", "#category_2#"), $arSequence, $ItemLink); $ItemLink = str_replace("//", "/", $ItemLink); $arButtons = CIBlock::GetPanelButtons($arCategory["IBLOCK_ID"], 0, $arCategory["ID"], array("SESSID" => false)); $arResult["ITEMS"][$index] = array("ID" => $arCategory["ID"], "DEPTH_LEVEL" => $arCategory["DEPTH_LEVEL"], "IS_PARENT" => false, "TEXT" => trim($arCategory["NAME"]), "LINK" => $ItemLink, "SELECTED" => "", "EDIT_LINK" => $arButtons["edit"]["edit_section"], "DELETE_LINK" => $arButtons["edit"]["delete_section"]); $index++; } if (array_key_exists("SELECTED_CATEGORY", $arParams) && strlen($arParams["SELECTED_CATEGORY"]) > 0) { $arSelected = $arResult["CATEGORY"][$arParams["SELECTED_CATEGORY"]]; if ($arSelected) { foreach ($arResult["ITEMS"] as $key => $Item) { if ($arSelected["ID"] == $Item["ID"]) { $arResult["ITEMS"][$key]["SELECTED"] = true;
public function Send() { if (!$this->IsAvailable()) { return false; } $arNotification = $this->Notify->getNotification(); //No need to send about updates; if ($arNotification["ACTION"] == "UPDATE") { return 0; } $category = ToUpper($arNotification["CATEGORY"]); $arEmailSubscribe = array(); if (!array_key_exists("CATEGORIES", $arNotification)) { $arNotification["CATEGORIES"] = \CIdeaManagment::getInstance()->Idea()->GetCategoryList(); } if (array_key_exists($category, $arNotification["CATEGORIES"]) && \CIdeaManagment::getInstance()->Idea()->GetCategoryListID() > 0) { $category = $arNotification["CATEGORIES"][$category]; } else { $category = null; } if ($arNotification["TYPE"] == "IDEA") { $filter = array("LOGIC" => "OR", array("=ENTITY_TYPE" => \Bitrix\Idea\NotifyEmailTable::ENTITY_TYPE_CATEGORY, "=ENTITY_CODE" => '')); if (!is_null($category)) { $filter[] = array("=ENTITY_TYPE" => \Bitrix\Idea\NotifyEmailTable::ENTITY_TYPE_CATEGORY, "=ASCENDED_CATEGORIES.IBLOCK_ID" => \CIdeaManagment::getInstance()->Idea()->GetCategoryListID(), "<=ASCENDED_CATEGORIES.DEPTH_LEVEL" => $category["DEPTH_LEVEL"], "<=ASCENDED_CATEGORIES.LEFT_MARGIN" => $category["LEFT_MARGIN"], ">=ASCENDED_CATEGORIES.RIGHT_MARGIN" => $category["RIGHT_MARGIN"]); } } else { $filter = array("LOGIC" => "OR", array("=ENTITY_TYPE" => \Bitrix\Idea\NotifyEmailTable::ENTITY_TYPE_IDEA, "=ENTITY_CODE" => $arNotification["POST_ID"]), array("=SUBSCRIBE_TYPE" => \Bitrix\Idea\NotifyEmailTable::SUBSCRIBE_TYPE_ALL, "=ENTITY_TYPE" => \Bitrix\Idea\NotifyEmailTable::ENTITY_TYPE_CATEGORY, "=ENTITY_CODE" => '')); if (!is_null($category)) { $filter[] = array("=SUBSCRIBE_TYPE" => \Bitrix\Idea\NotifyEmailTable::SUBSCRIBE_TYPE_ALL, "=ENTITY_TYPE" => \Bitrix\Idea\NotifyEmailTable::ENTITY_TYPE_CATEGORY, "=ASCENDED_CATEGORIES.IBLOCK_ID" => \CIdeaManagment::getInstance()->Idea()->GetCategoryListID(), "<=ASCENDED_CATEGORIES.DEPTH_LEVEL" => $category["DEPTH_LEVEL"], "<=ASCENDED_CATEGORIES.LEFT_MARGIN" => $category["LEFT_MARGIN"], ">=ASCENDED_CATEGORIES.RIGHT_MARGIN" => $category["RIGHT_MARGIN"]); } } $db_res = \Bitrix\Idea\NotifyEmailTable::getList(array('filter' => $filter, 'select' => array("USER_ID", "USER_EMAIL" => "USER.EMAIL"))); if (!is_null($category)) { $arNotification["CATEGORY"] = $category["NAME"]; } unset($arNotification["CATEGORIES"]); if (!array_key_exists("IDEA_TITLE", $arNotification)) { $arNotification["IDEA_TITLE"] = $arNotification["TITLE"]; } while ($r = $db_res->Fetch()) { if ($r["USER_ID"] != $arNotification["AUTHOR_ID"] && !array_key_exists($r["USER_ID"], $arEmailSubscribe) && check_email($r["USER_EMAIL"])) { $arEmailSubscribe[$r["USER_ID"]] = $r["USER_EMAIL"]; $arNotification["EMIAL_TO"] = $r["USER_EMAIL"]; //This is for backward compatibility $arNotification["EMAIL_TO"] = $r["USER_EMAIL"]; //ADD_IDEA_COMMENT, ADD_IDEA CEvent::Send($arNotification["ACTION"] . '_' . $arNotification["TYPE"], SITE_ID, $arNotification); } } return count($arEmailSubscribe) > 0; }
foreach ($arResult["ERROR_MESSAGE"] as $v) { ?> <li><?php echo $v; ?> </li> <?php } ?> </ul> </div> </div> <?php } if (count($arResult["POST"]) > 0) { $arStatusList = CIdeaManagment::getInstance()->Idea()->GetStatusList(); ?> <?php foreach ($arResult["POST"] as $CurPost) { ?> <?php if ($arParams["SHOW_RATING"] == "Y") { ?> <div class="idea-rating-block"> <span class="idea-rating-block-left"><span class="idea-rating-block-right"><span class="idea-rating-block-content idea-rating-block-content-ext-<?php echo $arParams['RATING_TEMPLATE']; ?> "><span class="idea-rating-block-content-description"><?php echo GetMessage("IDEA_RATING_TITLE"); ?> :</span>
if ($arParams["SET_NAV_CHAIN"] == "Y" || $arParams["SET_TITLE"] == "Y") { if (strpos($pageMode, "user") !== false) { $title = ""; if ($arResult["VARIABLES"]["user_id"] == $USER->GetID()) { $title = GetMessage("IDEA_USER_IDEA_LIST_MINE"); } elseif ($arUser = $USER->GetByID($arFilter["AUTHOR_ID"])->Fetch()) { $title = GetMessage("IDEA_USER_IDEA_LIST_USER", array("#USER_NAME#" => CUser::FormatName($arParams["NAME_TEMPLATE"], $arUser, true))); } if ($arParams["SET_NAV_CHAIN"] == "Y") { $APPLICATION->AddChainItem($title, CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_IDEAS"], array("user_id" => $arResult["VARIABLES"]["user_id"]))); } if ($arParams["SET_TITLE"] == "Y") { $APPLICATION->SetTitle($title); } } else { $arCategoryList = $arParams["SET_NAV_CHAIN"] == "Y" || $arParams["SET_TITLE"] == "Y" ? CIdeaManagment::getInstance()->Idea()->GetCategoryList() : array(); //Set ChainItem if ($arParams["SET_NAV_CHAIN"] == "Y") { foreach ($categoryCode as $key => $val) { if (array_key_exists($val, $arCategoryList)) { $APPLICATION->AddChainItem($arCategoryList[$val]["NAME"], CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_" . $key . (strpos($pageMode, "status") !== false ? "_STATUS" : "")], array("category_1" => $categoryCode["~CATEGORY_1"], "category_2" => $categoryCode["~CATEGORY_2"], "status" => $arResult["VARIABLES"]["status_code"]))); } } } //Set Title if ($arParams["SET_TITLE"] == "Y") { $val = $arFilter["IDEA_PARENT_CATEGORY_CODE"]; if (!!$val && array_key_exists($val, $arCategoryList)) { $APPLICATION->SetTitle(GetMessage("IDEA_CATEGORY_PAGE_TITLE", array("#CATEGORY_NAME#" => $arCategoryList[$val]["NAME"]))); } else { $APPLICATION->SetTitle(GetMessage("IDEA_INDEX_PAGE_TITLE"));