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


PHP LocationTable::getPathToNodeByCode方法代码示例

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


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

示例1: GetMessage

if ($saleModulePermissions >= 'W') {
    ?>
	<tr>
		<td><strong><?php 
    echo GetMessage("COMPANY_LOCATION_ID");
    ?>
</strong></td>
		<td>
			<?php 
    $APPLICATION->IncludeComponent("bitrix:sale.location.selector." . \Bitrix\Sale\Location\Admin\LocationHelper::getWidgetAppearance(), "", array("ID" => "", "CODE" => $fields['LOCATION_ID'], "INPUT_NAME" => "LOCATION_ID", "PROVIDE_LINK_BY" => "code", "SHOW_ADMIN_CONTROLS" => 'Y', "SELECT_WHEN_SINGLE" => 'N', "FILTER_BY_SITE" => 'Y', "FILTER_SITE_ID" => Application::getInstance()->getContext()->getSite(), "SHOW_DEFAULT_LOCATIONS" => 'N', "SEARCH_BY_PRIMARY" => 'Y'), false);
    ?>
		</td>
	</tr>
<?php 
} else {
    $res = \Bitrix\Sale\Location\LocationTable::getPathToNodeByCode($fields['LOCATION_ID'], array('select' => array('CHAIN' => 'NAME.NAME'), 'filter' => array('NAME.LANGUAGE_ID' => $lang)));
    $path = array();
    while ($item = $res->fetch()) {
        $path[] = $item['CHAIN'];
    }
    $path = implode(', ', array_reverse($path));
    ?>
	<tr>
		<td><?php 
    echo GetMessage("COMPANY_LOCATION");
    ?>
</td>
		<td><?php 
    echo $path;
    ?>
</td>
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:company_edit.php

示例2: getLocationPathDisplay

	public static function getLocationPathDisplay($code)
	{
		if(!strlen($code))
			return '';

		$parameters = array(
			'select' => array('LNAME' => 'NAME.NAME'),
			'filter' => array('NAME.LANGUAGE_ID' => LANGUAGE_ID)
		);

		try
		{
			$res = Location\LocationTable::getPathToNodeByCode($code, $parameters);
		}
		catch(\Exception $e)
		{
			return $code;
		}

		$path = array();
		while($item = $res->fetch())
			$path[] = $item['LNAME'];

		return implode(', ', array_reverse($path));
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:25,代码来源:locationhelper.php

示例3: getViewHtmlSingle

 protected static function getViewHtmlSingle(array $input, $value)
 {
     if ((string) $value == '') {
         return '';
     }
     try {
         $result = \Bitrix\Sale\Location\LocationTable::getPathToNodeByCode($value, array('select' => array('CHAIN' => 'NAME.NAME'), 'filter' => array('NAME.LANGUAGE_ID' => LANGUAGE_ID)));
         $path = array();
         while ($row = $result->fetch()) {
             $path[] = $row['CHAIN'];
         }
         return htmlspecialcharsbx(implode(', ', $path));
     } catch (\Bitrix\Main\SystemException $e) {
         return '';
     }
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:16,代码来源:input.php

示例4: foreach

foreach ($fields as $field) {
    $select[] = $field['FIELD_NAME'];
}
$params = array('select' => $select, 'filter' => $filter, 'order' => array($by => $order));
$company = CompanyTable::getList($params);
$dbResultList = new CAdminResult($company, $sTableID);
$dbResultList->NavStart();
$lAdmin->NavText($dbResultList->GetNavPrint(Loc::getMessage("SALE_COMPANY")));
$headers = array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "ACTIVE", "content" => Loc::getMessage("SALE_COMPANY_ACTIVE"), "sort" => "ACTIVE", "default" => true), array("id" => "NAME", "content" => Loc::getMessage("SALE_COMPANY_NAME"), "sort" => "NAME", "default" => true), array("id" => "LOCATION_ID", "content" => Loc::getMessage("SALE_COMPANY_LOCATION_ID"), "sort" => "LOCATION_ID", "default" => true), array("id" => "CODE", "content" => Loc::getMessage("SALE_COMPANY_CODE"), "sort" => "CODE", "default" => true));
$USER_FIELD_MANAGER->AdminListAddHeaders(CompanyTable::getUfId(), $headers);
$lAdmin->AddHeaders($headers);
$allSelectedFields = array("ID" => false, "ACTIVE" => false, "NAME" => false, "LOCATION_ID" => false, "CODE" => false);
$selectedFields = $lAdmin->GetVisibleHeaderColumns();
$allSelectedFields = array_merge($allSelectedFields, array_fill_keys($selectedFields, true));
while ($company = $dbResultList->NavNext(true, "f_")) {
    $res = \Bitrix\Sale\Location\LocationTable::getPathToNodeByCode($company['LOCATION_ID'], array('select' => array('CHAIN' => 'NAME.NAME'), 'filter' => array('NAME.LANGUAGE_ID' => Application::getInstance()->getContext()->getLanguage())));
    $path = array();
    while ($item = $res->fetch()) {
        $path[] = $item['CHAIN'];
    }
    $company['LOCATION_ID'] = implode(', ', array_reverse($path));
    $row =& $lAdmin->AddRow($f_ID, $company, "sale_company_edit.php?ID=" . $f_ID . "&lang=" . $lang, Loc::getMessage("SALE_COMPANY_EDIT_DESCR"));
    $row->AddField("ID", "<a href=\"sale_company_edit.php?ID=" . $f_ID . "&lang=" . $lang . GetFilterParams("filter_") . "\">" . $f_ID . "</a>");
    $row->AddCheckField("ACTIVE");
    $row->AddInputField("NAME");
    $row->AddField("LOCATION_ID", $company['LOCATION_ID']);
    $row->AddInputField("CODE");
    $USER_FIELD_MANAGER->AddUserFields(CompanyTable::getUfId(), $company, $row);
    $arActions = array(array("ICON" => "edit", "TEXT" => Loc::getMessage("SALE_COMPANY_EDIT"), "TITLE" => Loc::getMessage("SALE_COMPANY_EDIT_DESCR"), "ACTION" => $lAdmin->ActionRedirect("sale_company_edit.php?ID=" . $f_ID . "&lang=" . $lang), "DEFAULT" => true));
    if ($saleModulePermissions >= "W") {
        $arActions[] = array("SEPARATOR" => true);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:company.php

示例5: obtainDataLocation

	protected function obtainDataLocation()
	{
		$parameters = $this->getLocationListParameters();

		$this->dbResult['PATH'] = array();
		$this->dbResult['LOCATION'] = array();

		$toBeFound = false;
		$res = false;
		try
		{
			if($this->arParams['ID'])
			{
				$toBeFound = true;
				$res = Location\LocationTable::getPathToNode($this->arParams['ID'], $parameters);
			}
			elseif(strlen($this->arParams['CODE']))
			{
				$toBeFound = true;
				$res = Location\LocationTable::getPathToNodeByCode($this->arParams['CODE'], $parameters);
			}

			if($res)
			{
				$res->addReplacedAliases(array('LNAME' => 'NAME'));

				while($item = $res->Fetch())
					$this->dbResult['PATH'][intval($item['ID'])] = $this->forceToType($item);

				end($this->dbResult['PATH']);
				$this->dbResult['LOCATION'] = current($this->dbResult['PATH']);
			}
		}
		catch(Main\SystemException $e)
		{
		}

		if(empty($this->dbResult['PATH']) && $toBeFound)
			$this->errors['NONFATAL'][] = Loc::getMessage('SALE_SLS_SELECTED_NODE_NOT_FOUND');
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:40,代码来源:class.php


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