当前位置: 首页>>代码示例>>PHP>>正文


PHP CComponentEngine::MakePathFromTemplate方法代码示例

本文整理汇总了PHP中CComponentEngine::MakePathFromTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP CComponentEngine::MakePathFromTemplate方法的具体用法?PHP CComponentEngine::MakePathFromTemplate怎么用?PHP CComponentEngine::MakePathFromTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComponentEngine的用法示例。


在下文中一共展示了CComponentEngine::MakePathFromTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: reportViewShowTopButtons

/**
 * @param CBitrixComponentTemplate &$component
 * @param mixed &$arParams[]
 * @param mixed &$arResult[]
 */
function reportViewShowTopButtons(&$component, &$arParams, &$arResult)
{
    /** @global CMain $APPLICATION */
    global $APPLICATION;
    $component->SetViewTarget("pagetitle", 100);
    ?>
<div class="reports-title-buttons">
	<a class="reports-title-button" href="<?php 
    echo $APPLICATION->GetCurPageParam("EXCEL=Y&ncc=1");
    ?>
"> <?php 
    //ncc=1 is for preventing composite work on this hit
    ?>
		<i class="reports-title-button-excel-icon"></i><span class="reports-link"><?php 
    echo GetMessage('REPORT_EXCEL_EXPORT');
    ?>
</span>
	</a>
	&nbsp;
<?php 
    if ($arResult['MARK_DEFAULT'] > 0) {
        ?>
	<a class="reports-title-button" href="<?php 
        echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_REPORT_CONSTRUCT"], array("report_id" => $arParams['REPORT_ID'], 'action' => 'copy'));
        ?>
">
		<i class="reports-title-button-edit-icon"></i><span class="reports-link"><?php 
        echo GetMessage('REPORT_COPY');
        ?>
</span>
	</a>
<?php 
    } else {
        ?>
	<a class="reports-title-button" href="<?php 
        echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_REPORT_CONSTRUCT"], array("report_id" => $arParams['REPORT_ID'], 'action' => 'edit'));
        ?>
">
		<i class="reports-title-button-edit-icon"></i><span class="reports-link"><?php 
        echo GetMessage('REPORT_EDIT');
        ?>
</span>
	</a>
<?php 
    }
    ?>
	&nbsp;
	<a class="reports-title-button" href="<?php 
    echo CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_REPORT_LIST"], array());
    ?>
">
		<i class="reports-title-button-back-icon"></i><span class="reports-link"><?php 
    echo GetMessage('REPORT_RETURN_TO_LIST');
    ?>
</span>
	</a>
</div>
<?php 
    $component->EndViewTarget();
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:65,代码来源:template.php

示例2: createLinkFromTemplate

 public function createLinkFromTemplate($sTemplate = "")
 {
     if (!$this->sPathTemplate && !$sTemplate || !$this->sName) {
         return false;
     }
     $this->sLink = CComponentEngine::MakePathFromTemplate($sTemplate != "" ? $sTemplate : $this->sPathTemplate, array('wiki_name' => urlencode('category:' . $this->sName), 'group_id' => CWikiSocnet::$iSocNetId));
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:8,代码来源:wiki_categories.php

示例3: getUrl

 public function getUrl($entityID, $fieldName, $fileID = 0)
 {
     $params = array('owner_id' => $entityID, 'field_name' => $fieldName);
     if ($fileID > 0) {
         $params['file_id'] = $fileID;
     }
     return \CComponentEngine::MakePathFromTemplate(self::$urlTemplates[$this->entityTypeName], $params);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:fileviewer.php

示例4: getBreadcrumbs

 protected function getBreadcrumbs()
 {
     $crumbs = array();
     $parts = explode('/', '/' . trim($this->arParams['RELATIVE_PATH'], '/'));
     foreach ($parts as $i => $part) {
         $crumbs[] = array('NAME' => $part, 'LINK' => rtrim(CComponentEngine::MakePathFromTemplate($this->arParams['PATH_TO_FOLDER_LIST'], array('PATH' => implode('/', array_slice($parts, 0, $i + 1)))), '/') . '/');
     }
     unset($i, $part);
     return $crumbs;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:10,代码来源:class.php

示例5: getRightsLinks

 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;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:54,代码来源:wiki_utils.php

示例6: add

 public function add($data, $parameters = array())
 {
     global $DB, $USER;
     $result = array();
     if (!$USER->IsAuthorized()) {
         throw new Tasks\Exception("Authentication is required.");
     }
     $title = isset($data["title"]) ? trim($data["title"]) : "";
     $responsible = isset($data["responsible"]) ? intval($data["responsible"]) : $USER->GetID();
     $deadline = isset($data["deadline"]) && $DB->FormatDate($data["deadline"], \CSite::GetDateFormat("FULL")) ? $data["deadline"] : "";
     $description = isset($data["description"]) ? trim($data["description"]) : "";
     $project = isset($data["project"]) ? intval($data["project"]) : 0;
     $nameTemplate = isset($data["nameTemplate"]) ? trim($data["nameTemplate"]) : "";
     $ganttMode = isset($data["ganttMode"]) && $data["ganttMode"] === "true";
     if (strlen($nameTemplate) > 0) {
         preg_match_all("/(#NAME#)|(#NOBR#)|(#\\/NOBR#)|(#LAST_NAME#)|(#SECOND_NAME#)|(#NAME_SHORT#)|(#SECOND_NAME_SHORT#)|\\s|\\,/", $nameTemplate, $matches);
         $nameTemplate = implode("", $matches[0]);
     } else {
         $nameTemplate = \CSite::GetNameFormat(false);
     }
     $fields = array("TITLE" => $title, "DESCRIPTION" => $description, "RESPONSIBLE_ID" => $responsible, "DEADLINE" => $deadline, "SITE_ID" => $data["siteId"], "GROUP_ID" => $project, "NAME_TEMPLATE" => $nameTemplate, 'DESCRIPTION_IN_BBCODE' => "Y");
     $taskItem = \CTaskItem::add($fields, $USER->GetId());
     $task = $taskItem->getData();
     $task["GROUP_NAME"] = "";
     if ($task["GROUP_ID"]) {
         $socGroup = \CSocNetGroup::GetByID($task["GROUP_ID"]);
         if ($socGroup) {
             $task["GROUP_NAME"] = $socGroup["~NAME"];
         }
     }
     \Bitrix\Main\FinderDestTable::merge(array("CONTEXT" => "TASK_RESPONSIBLE", "CODE" => array("U" . $task["RESPONSIBLE_ID"], "SG" . $task["GROUP_ID"])));
     $taskId = $taskItem->getId();
     $arPaths = array("PATH_TO_TASKS_TASK" => isset($data["pathToTask"]) ? trim($data["pathToTask"]) : "", "PATH_TO_USER_PROFILE" => isset($data["pathToUser"]) ? trim($data["pathToUser"]) : "", "PATH_TO_USER_TASKS_TASK" => isset($data["pathToUserTasksTask"]) ? trim($data["pathToUserTasksTask"]) : "");
     $columnsOrder = null;
     if (isset($data["columnsOrder"]) && is_array($data["columnsOrder"])) {
         $columnsOrder = array_map("intval", $data["columnsOrder"]);
     }
     $order = isset($data["order"]) && checkSerializedData($data["order"]) ? unserialize($data["order"]) : array();
     $filter = isset($data["filter"]) && checkSerializedData($data["filter"]) ? unserialize($data["filter"]) : array();
     $navigation = isset($data["navigation"]) && checkSerializedData($data["navigation"]) ? unserialize($data["navigation"]) : array();
     $select = isset($data["select"]) && checkSerializedData($data["select"]) ? unserialize($data["select"]) : array();
     $result["taskRaw"] = $task;
     $result["taskId"] = $task["ID"];
     $result["taskPath"] = \CComponentEngine::MakePathFromTemplate($arPaths["PATH_TO_TASKS_TASK"], array("task_id" => $task["ID"], "action" => "view"));
     $result["position"] = $this->getTaskPosition($taskId, $order, $filter, $navigation, $select);
     if ($ganttMode) {
         $result["task"] = $this->getJson($task, $arPaths, $nameTemplate);
     } else {
         $result["html"] = $this->getHtml($task, $arPaths, $nameTemplate, $columnsOrder);
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:52,代码来源:listcontrols.php

示例7: getBreadcrumbs

 protected function getBreadcrumbs()
 {
     $crumbs = array();
     $parts = explode('/', trim($this->arParams['RELATIVE_PATH'], '/'));
     foreach ($this->arParams['RELATIVE_ITEMS'] as $i => $item) {
         if (empty($item)) {
             continue;
         }
         $crumbs[] = array('ID' => $item['ID'], 'NAME' => $item['NAME'], 'LINK' => rtrim(CComponentEngine::MakePathFromTemplate($this->arParams['PATH_TO_FOLDER_LIST'], array('PATH' => implode('/', array_slice($parts, 0, $i + 1)) ?: '')), '/') . '/');
     }
     unset($i, $item);
     return $crumbs;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:13,代码来源:class.php

示例8: SendRemindEventAgent

 function SendRemindEventAgent($iblockId, $taskId, $pathTemplate)
 {
     if (!CModule::IncludeModule("socialnetwork") && !CModule::IncludeModule("iblock")) {
         return;
     }
     $iblockId = IntVal($iblockId);
     $taskId = IntVal($taskId);
     if (!isset($GLOBALS["USER"]) || !is_object($GLOBALS["USER"])) {
         $bTmpUser = True;
         $GLOBALS["USER"] = new CUser();
     }
     $arTasksCustomProps = array();
     $dbTasksCustomProps = CIBlockProperty::GetList(array("sort" => "asc", "name" => "asc"), array("ACTIVE" => "Y", "IBLOCK_ID" => $iblockId, "CHECK_PERMISSIONS" => "N"));
     while ($arTasksCustomProp = $dbTasksCustomProps->Fetch()) {
         $ind = StrLen($arTasksCustomProp["CODE"]) > 0 ? $arTasksCustomProp["CODE"] : $arTasksCustomProp["ID"];
         $arTasksCustomProps[StrToUpper($ind)] = $arTasksCustomProp;
     }
     $dbTasksList = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $iblockId, "ACTIVE" => "Y", "ID" => $taskId, "CHECK_PERMISSIONS" => "N"), false, false, array("ID", "NAME", "IBLOCK_ID", "CREATED_BY", "PROPERTY_" . $arTasksCustomProps["TASKASSIGNEDTO"]["ID"]));
     while ($arTask = $dbTasksList->GetNext()) {
         $ar = array();
         $dbElementSections = CIBlockElement::GetElementGroups($arTask["ID"]);
         while ($arElementSection = $dbElementSections->Fetch()) {
             if ($arElementSection["IBLOCK_ID"] == $iblockId) {
                 $ar[] = $arElementSection["ID"];
             }
         }
         if (Count($ar) <= 0) {
             continue;
         }
         $taskType = "";
         $taskOwnerId = 0;
         $dbSectionsChain = CIBlockSection::GetNavChain($iblockId, $ar[0]);
         if ($arSect = $dbSectionsChain->Fetch()) {
             $taskType = $arSect["XML_ID"] == "users_tasks" ? "user" : "group";
             $taskOwnerId = IntVal($taskType == "user" ? $arTask["PROPERTY_" . $arTasksCustomProps["TASKASSIGNEDTO"]["ID"] . "_VALUE"] : $arSect["XML_ID"]);
         }
         if (!In_Array($taskType, array("user", "group")) || $taskOwnerId <= 0) {
             continue;
         }
         $path2view = ($GLOBALS["APPLICATION"]->IsHTTPS() ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . CComponentEngine::MakePathFromTemplate($pathTemplate, array("owner_id" => $taskOwnerId, "task_id" => $arTask["ID"], "action" => "view"));
         $arMessageFields = array("=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE_TYPE" => SONET_MESSAGE_SYSTEM, "FROM_USER_ID" => $arTask["CREATED_BY"], "TO_USER_ID" => $arTask["PROPERTY_" . $arTasksCustomProps["TASKASSIGNEDTO"]["ID"] . "_VALUE"], "MESSAGE" => str_replace(array("#URL_VIEW#", "#NAME#"), array($path2view, $arTask["NAME"]), GetMessage("INTE_REMIND_TASK_MESSAGE")));
         CSocNetMessages::Add($arMessageFields);
         //CIBlockElement::SetPropertyValueCode($arTask["ID"], $arTasksCustomProps["TASKREMIND"]["ID"], false);
     }
     if ($bTmpUser) {
         unset($GLOBALS["USER"]);
     }
     //return "CIntranetTasks::SendRemindEventAgent($iblockId, $taskId, \"$pathTemplate\");";
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:49,代码来源:tasks.php

示例9: getUrl

 public function getUrl($entityID, $fieldName, $fileID = 0)
 {
     $srcFieldName = '';
     /** @var EntityConversionMap|null $map */
     $map = $this->getMap();
     if ($map !== null) {
         $srcFieldName = $map->resolveSourceID($fieldName);
     }
     if ($srcFieldName !== '') {
         $params = array('owner_id' => $this->srcEntityID, 'field_name' => $srcFieldName);
         if ($fileID > 0) {
             $params['file_id'] = $fileID;
         }
         return \CComponentEngine::MakePathFromTemplate(self::$urlTemplates[$this->srcEntityTypeName], $params);
     }
     return parent::getUrl($entityID, $fieldName, $fileID);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:17,代码来源:entityconversionfileviewer.php

示例10: prepareData

 protected function prepareData()
 {
     if (strlen(trim($this->arParams["NAME_TEMPLATE"])) <= 0) {
         $this->arParams["NAME_TEMPLATE"] = \CSite::GetNameFormat();
     }
     $dbPost = \CBlogPost::GetList(array(), array("ID" => $this->arParams["postId"]), false, false, array("ID", "BLOG_ID", "PUBLISH_STATUS", "TITLE", "AUTHOR", "ENABLE_COMMENTS", "NUM_COMMENTS", "VIEWS", "CODE", "MICRO", "DETAIL_TEXT", "DATE_PUBLISH", "CATEGORY_ID", "HAS_SOCNET_ALL", "HAS_TAGS", "HAS_IMAGES", "HAS_PROPS", "HAS_COMMENT_IMAGES"));
     if ($arPost = $dbPost->Fetch()) {
         if (strlen($arPost['TITLE']) > 30) {
             $arPost['TITLE'] = substr($arPost['TITLE'], 0, 30) . "...";
         }
         $this->arResult['POST'] = $arPost;
         $this->arResult['POST']['PUBLISH_STATUS_DESCRIPTION'] = Loc::getMessage('BLOG_POST_PUBLISH_STATUS_' . $arPost['PUBLISH_STATUS']);
         $this->arResult['POST']['AUTHOR_FORMATTED_NAME'] = \CUser::FormatName($this->arParams['NAME_TEMPLATE'], array('LOGIN' => $this->arResult['POST']['LOGIN'], 'NAME' => $this->arResult['POST']['NAME'], 'LAST_NAME' => $this->arResult['POST']['LAST_NAME']), true, false);
         $this->arResult["POST"]['AUTHOR_PROFILE'] = \CComponentEngine::MakePathFromTemplate($this->arParams["PATH_TO_USER_PROFILE"], array("user_id" => $this->arResult['POST']['AUTHOR']));
         $this->arResult["POST"]['AUTHOR_UNIQID'] = 'u_' . $this->randString();
         if (defined("BX_COMP_MANAGED_CACHE")) {
             $GLOBALS['CACHE_MANAGER']->RegisterTag('blog_post_' . $this->arParams['postId']);
         }
     }
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:20,代码来源:class.php

示例11: Execute

 public function Execute()
 {
     global $DB;
     if (!CModule::IncludeModule("socialnetwork") || !CModule::IncludeModule("blog")) {
         return CBPActivityExecutionStatus::Closed;
     }
     $rootActivity = $this->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $siteId = $this->PostSite ? $this->PostSite : SITE_ID;
     $ownerId = CBPHelper::ExtractUsers($this->OwnerId, $documentId, true);
     $pathToPost = COption::GetOptionString("socialnetwork", "userblogpost_page", false, $siteId);
     $pathToSmile = COption::GetOptionString("socialnetwork", "smile_page", false, $siteId);
     $blogGroupID = COption::GetOptionString("socialnetwork", "userbloggroup_id", false, $siteId);
     $blog = CBlog::GetByOwnerID($ownerId);
     if (!$blog) {
         $blog = $this->createBlog($ownerId, $blogGroupID, $siteId);
     }
     $micro = 'N';
     $title = trim($this->PostTitle);
     if (!$title) {
         $micro = 'Y';
         $title = trim(preg_replace(array("/\n+/is" . BX_UTF_PCRE_MODIFIER, '/\\s+/is' . BX_UTF_PCRE_MODIFIER), " ", blogTextParser::killAllTags($this->PostMessage)));
     }
     try {
         $postFields = array('TITLE' => $title, 'DETAIL_TEXT' => $this->PostMessage, 'DETAIL_TEXT_TYPE' => $this->PostMessageType == 'html' ? 'html' : 'text', '=DATE_PUBLISH' => $DB->CurrentTimeFunction(), 'PUBLISH_STATUS' => BLOG_PUBLISH_STATUS_PUBLISH, 'CATEGORY_ID' => '', 'PATH' => CComponentEngine::MakePathFromTemplate($pathToPost, array("post_id" => "#post_id#", "user_id" => $ownerId)), 'URL' => $blog['URL'], 'PERMS_POST' => array(), 'PERMS_COMMENT' => array(), 'MICRO' => $micro, 'SOCNET_RIGHTS' => $this->getSocnetRights($this->UsersTo), '=DATE_CREATE' => $DB->CurrentTimeFunction(), 'AUTHOR_ID' => $ownerId, 'BLOG_ID' => $blog['ID'], "HAS_IMAGES" => "N", "HAS_TAGS" => "N", "HAS_PROPS" => "N", "HAS_SOCNET_ALL" => "N");
         if (!empty($postFields["SOCNET_RIGHTS"]) && count($postFields["SOCNET_RIGHTS"]) == 1 && in_array("UA", $postFields["SOCNET_RIGHTS"])) {
             $postFields['HAS_SOCNET_ALL'] = 'Y';
         }
         $newId = CBlogPost::add($postFields);
         $postFields["ID"] = $newId;
         $arParamsNotify = array("bSoNet" => true, "UserID" => $ownerId, "allowVideo" => COption::GetOptionString("blog", "allow_video", "Y"), "PATH_TO_SMILE" => $pathToSmile, "PATH_TO_POST" => $pathToPost, "SOCNET_GROUP_ID" => $blogGroupID, "user_id" => $ownerId, "NAME_TEMPLATE" => CSite::GetNameFormat(false));
         CBlogPost::Notify($postFields, $blog, $arParamsNotify);
         BXClearCache(true, "/" . $siteId . "/blog/last_messages_list/");
         $arFieldsIM = array("TYPE" => "POST", "TITLE" => $postFields["TITLE"], "URL" => CComponentEngine::MakePathFromTemplate($pathToPost, array("post_id" => $newId, "user_id" => $ownerId)), "ID" => $newId, "FROM_USER_ID" => $ownerId, "TO_USER_ID" => array(), "TO_SOCNET_RIGHTS" => $postFields["SOCNET_RIGHTS"], "TO_SOCNET_RIGHTS_OLD" => array());
         CBlogPost::NotifyIm($arFieldsIM);
     } catch (Exception $e) {
         $this->WriteToTrackingService($e->getMessage());
     }
     return CBPActivityExecutionStatus::Closed;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:40,代码来源:socnetblogpostactivity.php

示例12: array

         $arTmp["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arPost["AUTHOR_ID"]));
     } else {
         $arOwnerBlog = CBlog::GetByOwnerID($arTmp["AUTHOR_ID"], $arParams["GROUP_ID"]);
         if (!empty($arOwnerBlog)) {
             $arTmp["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arOwnerBlog["URL"], "user_id" => $arOwnerBlog["OWNER_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"]));
         } else {
             $arTmp["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arPost["BLOG_URL"], "user_id" => $arPost["AUTHOR_ID"], "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"]));
         }
     }
 }
 if (IntVal($arPost["BLOG_SOCNET_GROUP_ID"]) > 0) {
     $arTmp["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_BLOG_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "group_id" => $arPost["BLOG_SOCNET_GROUP_ID"]));
 } else {
     $arTmp["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arPost["BLOG_URL"], "post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"]));
 }
 $arTmp["urlToAuthor"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arPost["AUTHOR_ID"]));
 $arTmp["AuthorName"] = CBlogUser::GetUserName($arPost["BLOG_USER_ALIAS"], $arPost["AUTHOR_NAME"], $arPost["AUTHOR_LAST_NAME"], $arPost["AUTHOR_LOGIN"]);
 if ($itemCnt == 0) {
     $arTmp["FIRST"] = "Y";
 }
 $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);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例13: InitGroupTmp

	public static function InitGroupTmp($groupID, $arParams, $bRSS = false)
	{
		$title = "";
		$message = "";

		$arGroup = CSocNetGroup::GetByID($groupID);
		if ($arGroup)
		{
			$pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arGroup["ID"]));

			if (!$bRSS)
				$title .= "<a href=\"".$pu."\">";
			$title .= $arGroup["NAME"];
			if (!$bRSS)
				$title .= "</a>";

			if (intval($arGroup["IMAGE_ID"]) <= 0)
				$arGroup["IMAGE_ID"] = COption::GetOptionInt("socialnetwork", "default_group_picture", false, SITE_ID);

			$arImage = CSocNetTools::InitImage($arGroup["IMAGE_ID"], 100, "/bitrix/images/socialnetwork/nopic_group_100.gif", 100, $pu, true);

			$message = $arImage["IMG"];
		}

		return array($title, $message);
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:26,代码来源:log.php

示例14: LocalRedirect

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
LocalRedirect(CComponentEngine::MakePathFromTemplate($arResult["PATH_TO_USER_BLOG"], array("user_id" => $arResult["VARIABLES"]["user_id"])));
die;
开发者ID:Satariall,项目名称:izurit,代码行数:7,代码来源:user_microblog.php

示例15: GetPost

    function GetPost($params, $arPath)
    {
        global $USER;
        $postId = IntVal(CBlogMetaWeblog::DecodeParams($params[0]["#"]["value"][0]["#"]));
        $user = CBlogMetaWeblog::DecodeParams($params[1]["#"]["value"][0]["#"]);
        $password = CBlogMetaWeblog::DecodeParams($params[2]["#"]["value"][0]["#"]);
        if (CBlogMetaWeblog::Authorize($user, $password)) {
            $result = '';
            $userId = $USER->GetID();
            if (IntVal($postId) > 0) {
                $arSelectedFields = array("ID", "BLOG_ID", "TITLE", "DATE_PUBLISH", "AUTHOR_ID", "DETAIL_TEXT", "DETAIL_TEXT_TYPE", "BLOG_URL", "BLOG_OWNER_ID");
                $dbPost = CBlogPost::GetList(array(), array("AUTHOR_ID" => $userId, "ID" => $postId), false, array("nTopCount" => 1), $arSelectedFields);
                if ($arPost = $dbPost->Fetch()) {
                    $parser = new blogTextParser();
                    $dateISO = date("Y-m-d\\TH:i:s", MakeTimeStamp($arPost["DATE_PUBLISH"]));
                    $title = htmlspecialcharsEx($arPost["TITLE"]);
                    $arImages = array();
                    $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arPost["BLOG_ID"], "IS_COMMENT" => "N"));
                    while ($arImage = $res->Fetch()) {
                        $arImages[$arImage['ID']] = $arImage['FILE_ID'];
                    }
                    if ($arPost["DETAIL_TEXT_TYPE"] == "html") {
                        $arAllow = array("HTML" => "Y", "ANCHOR" => "Y", "IMG" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "N", "QUOTE" => "N", "CODE" => "N");
                        $text = $parser->convert_to_rss($arPost["DETAIL_TEXT"], $arImages, $arAllow, false);
                    } else {
                        $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "N", "CODE" => "N", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "VIDEO" => "N");
                        $text = $parser->convert_to_rss(htmlspecialcharsEx($arPost["DETAIL_TEXT"]), $arImages, $arAllow, false);
                    }
                    $text = "<![CDATA[" . $text . "]]>";
                    $category = "";
                    $dbCategory = CBlogPostCategory::GetList(array(), array("BLOG_ID" => $arPost["BLOG_ID"], "POST_ID" => $arPost["ID"]));
                    while ($arCategory = $dbCategory->Fetch()) {
                        $category .= '<value>' . htmlspecialcharsEx($arCategory["NAME"]) . '</value>';
                    }
                    $path2Post = "";
                    if (strlen($arPath["PATH_TO_POST"]) > 0) {
                        if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
                            $serverName = SITE_SERVER_NAME;
                        } else {
                            $serverName = COption::GetOptionString("main", "server_name", "www.bitrixsoft.com");
                        }
                        $path2Post = "http://" . $serverName . CComponentEngine::MakePathFromTemplate($arPath["PATH_TO_POST"], array("blog" => $arPost["BLOG_URL"], "user_id" => $arPost["BLOG_OWNER_ID"], "post_id" => $arPost["ID"]));
                    }
                    $result .= '
						<value>
							<struct>';
                    if (strlen($category) > 0) {
                        $result .= '<member>
									<name>categories</name>
									<value>
									<array>
									<data>
									' . $category . '
									</data>
									</array>
									</value>
								</member>
							';
                    }
                    $result .= '
								<member>
									<name>dateCreated</name>
									<value>
									<dateTime.iso8601>' . $dateISO . '</dateTime.iso8601>
									</value>
								</member>
								<member>
									<name>description</name>
									<value>' . $text . '</value>
								</member>
								<member>
									<name>link</name>
									<value>' . htmlspecialcharsEx($path2Post) . '</value>
								</member>
								<member>
									<name>postid</name>
									<value>
									<i4>' . $arPost["ID"] . '</i4>
									</value>
								</member>
								<member>
									<name>title</name>
									<value>' . $title . '</value>
								</member>
								<member>
									<name>publish</name>
									<value>
									<boolean>' . ($arPost["PUBLISH_STATUS"] == "D" ? "0" : "1") . '</boolean>
									</value>
								</member>
							</struct>
						</value>
						';
                }
            }
            return '<params>
						<param>
							<value>
								<array>
									<data>' . $result . '</data>
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:blog_metaweblog.php


注:本文中的CComponentEngine::MakePathFromTemplate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。