本文整理汇总了PHP中CSite::getNameFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP CSite::getNameFormat方法的具体用法?PHP CSite::getNameFormat怎么用?PHP CSite::getNameFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSite
的用法示例。
在下文中一共展示了CSite::getNameFormat方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareParams
protected function prepareParams()
{
$this->arParams['STORAGE_ID'] = isset($this->arParams['DOCUMENT_ID']) ? intval(str_replace('STORAGE_', '', $this->arParams['DOCUMENT_ID'])) : $this->arParams['STORAGE_ID'];
$this->arParams['SET_TITLE'] = $this->arParams['SET_TITLE'] == 'N' ? 'N' : 'Y';
$this->arParams['NAME_TEMPLATE'] = empty($this->arParams['NAME_TEMPLATE']) ? COption::getOptionString('bizproc', 'name_template', CSite::getNameFormat(false), SITE_ID) : str_replace(array('#NOBR#', '#/NOBR#'), array('', ''), $this->arParams['NAME_TEMPLATE']);
if (!isset($this->arParams['MODULE_ID'])) {
$this->errorCollection->add(array(new Error(Loc::getMessage('BPATT_NO_MODULE_ID'), self::ERROR_COULD_NOT_FIND_MODULE_ID)));
}
if (!isset($this->arParams['STORAGE_ID'])) {
$this->errorCollection->add(array(new Error(Loc::getMessage('BPATT_NO_DOCUMENT_TYPE'), self::ERROR_COULD_NOT_FIND_STORAGE_ID)));
}
if ($this->errorCollection->hasErrors()) {
$error = array_shift($this->getErrors());
throw new ArgumentException($error->getMessage());
}
$this->arParams['DOCUMENT_DATA'] = array('DISK' => array('DOCUMENT_TYPE' => \Bitrix\Disk\BizProcDocument::generateDocumentComplexType($this->arParams['STORAGE_ID'])), 'WEBDAV' => array('DOCUMENT_TYPE' => \Bitrix\Disk\BizProcDocumentCompatible::generateDocumentComplexType($this->arParams['STORAGE_ID'])));
$this->arParams['DOCUMENT_TYPE'] = \Bitrix\Disk\BizProcDocument::generateDocumentType($this->arParams['STORAGE_ID']);
return $this;
}
示例2: unset
}
$arParams['F_SALE_SITE'] = $siteId;
CBaseSaleReportHelper::setDefaultSiteId($siteId);
unset($siteId);
} else {
$siteCookieId = CBaseSaleReportHelper::getSiteCookieId();
if (isset($_COOKIE[$siteCookieId])) {
$siteId = substr($_COOKIE[$siteCookieId], 0, 2);
if (array_key_exists($siteId, $siteList)) {
$arParams['F_SALE_SITE'] = $siteId;
}
CBaseSaleReportHelper::setDefaultSiteId($siteId);
unset($siteId);
}
}
$arParams['USER_NAME_FORMAT'] = CSite::getNameFormat(null, CBaseSaleReportHelper::getDefaultSiteId());
// Product custom "quantity" filter
if (isset($_REQUEST['F_SALE_PRODUCT'])) {
if (in_array($_REQUEST['F_SALE_PRODUCT'], array('all', 'avail', 'not_avail'))) {
$arParams['F_SALE_PRODUCT'] = $_REQUEST['F_SALE_PRODUCT'];
}
}
// Product custom "types of prices" filter
$arSelectedPriceTypes = array();
if (isset($_REQUEST['F_SALE_UCSPT']) && is_array($_REQUEST['F_SALE_UCSPT'])) {
$i = 0;
foreach ($_REQUEST['F_SALE_UCSPT'] as $k => $v) {
if ($i++ === $k && is_numeric($v)) {
$arSelectedPriceTypes[] = intval($v);
}
}
示例3: tasksTaskEditAjaxHandler
function tasksTaskEditAjaxHandler()
{
global $DB;
if (isset($_POST['NAME_TEMPLATE'])) {
$nameTemplate = $_POST['NAME_TEMPLATE'];
} else {
$nameTemplate = CSite::getNameFormat(false);
}
if (!check_bitrix_sessid()) {
die;
}
switch ($_POST['action']) {
case 'tasks_isUserMemberOfGroup':
if (!CModule::IncludeModule('socialnetwork')) {
throw new Exception($_POST['action'] . ': socialnetwork module failed to load.');
}
if (!isset($_POST['groupId']) || !isset($_POST['userId']) || $_POST['groupId'] < 0 || $_POST['userId'] < 0) {
throw new Exception($_POST['action'] . ': invalid userId or groupId');
}
$rc = CSocNetUserToGroup::GetUserRole((int) $_POST['userId'], (int) $_POST['groupId']);
if ($rc === false || $rc == SONET_ROLES_REQUEST) {
echo 'N';
} else {
echo 'Y';
}
break;
case 'getWarnings':
if (isset($_POST['TASK']['RESPONSIBLE_ID'])) {
$responsibleId = (int) $_POST['TASK']['RESPONSIBLE_ID'];
$responsibleName = '#unknown user#';
$rsUser = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => $responsibleId), array('FIELDS' => array('NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN')));
if ($arUser = $rsUser->fetch()) {
$responsibleName = CUser::FormatName($nameTemplate, array("NAME" => $arUser["NAME"], "LAST_NAME" => $arUser["LAST_NAME"], "SECOND_NAME" => $arUser["SECOND_NAME"], "LOGIN" => $arUser["LOGIN"]), true, false);
}
if (isset($_POST['TASK']['GROUP_ID']) && $_POST['TASK']['GROUP_ID']) {
if (CModule::IncludeModule('socialnetwork')) {
$rc = CSocNetUserToGroup::GetUserRole($responsibleId, (int) $_POST['TASK']['GROUP_ID']);
if ($rc === false || $rc == SONET_ROLES_REQUEST) {
$arGroup = CSocNetGroup::GetByID($_POST['TASK']['GROUP_ID']);
echo '<div>' . htmlspecialcharsbx(str_replace(array('#FORMATTED_USER_NAME#', '#GROUP_NAME#'), array($responsibleName, $arGroup["NAME"]), GetMessage('TASKS_WARNING_RESPONSIBLE_NOT_IN_TASK_GROUP'))) . "</div>\n";
}
}
}
if (CModule::IncludeModule('intranet')) {
$dt = ConvertTimeStamp(false, 'SHORT');
$arAbsenceData = CIntranetUtils::GetAbsenceData(array('USERS' => array($responsibleId), 'DATE_START' => $dt, 'DATE_FINISH' => $dt, 'PER_USER' => false), $MODE = BX_INTRANET_ABSENCE_ALL);
$curTs = MakeTimeStamp(ConvertTimeStamp(false, 'FULL'));
if (isset($arAbsenceData[0])) {
if (array_key_exists('DATE_ACTIVE_FROM', $arAbsenceData[0]) && array_key_exists('DATE_ACTIVE_TO', $arAbsenceData[0])) {
$fromTs = MakeTimeStamp($arAbsenceData[0]['DATE_ACTIVE_FROM']);
$toTs = MakeTimeStamp($arAbsenceData[0]['DATE_ACTIVE_TO']);
} else {
$fromTs = MakeTimeStamp($arAbsenceData[0]['DATE_FROM']);
$toTs = MakeTimeStamp($arAbsenceData[0]['DATE_TO']);
}
if ($toTs > $curTs) {
$from = FormatDate($DB->DateFormatToPhp(CSite::GetDateFormat(CIntranetUtils::IsDateTime($fromTs) ? 'FULL' : 'SHORT')), $fromTs);
$to = FormatDate($DB->DateFormatToPhp(CSite::GetDateFormat(CIntranetUtils::IsDateTime($toTs) ? 'FULL' : 'SHORT')), $toTs);
echo '<div>' . htmlspecialcharsbx(str_replace(array('#FORMATTED_USER_NAME#', '#DATE_FROM#', '#DATE_TO#', '#ABSCENCE_REASON#'), array($responsibleName, $from, $to, $arAbsenceData[0]['NAME']), GetMessage('TASKS_WARNING_RESPONSIBLE_IS_ABSENCE'))) . '</div>';
}
}
}
}
break;
default:
throw new Exception('Requested action is unknown!');
break;
}
}
示例4: array
</form>
</div>
<?php
CJSCore::Init(array('admin_interface'));
$arResult['ROWS_COUNT'] = $arResult['NAV_OBJECT']->selectedRowsCount();
$arRows = array();
foreach ($arResult["USERS"] as $user) {
$arCols = array('NAME' => '<table id="user_' . $user['ID'] . '" style="border-collapse: collapse; border: none; ">
<tr>
<td style="border: none !important; padding: 0px !important; ">
<div style="width: 32px; height: 32px; margin-top:4px; border-radius: 50%; overflow: hidden;">
<a href="' . $user['DETAIL_URL'] . '">' . $user['PHOTO_THUMB'] . '</a>
</div>
</td>
<td style="border: none !important; padding: 0px 0px 0px 7px !important; vertical-align: middle; ">
<a href="' . $user['DETAIL_URL'] . '"><b>' . CUser::formatName(CSite::getNameFormat(), $user, true, true) . '</b></a><br>
' . htmlspecialcharsbx($user['WORK_POSITION']) . '
</td>
</tr>
</table>', 'UF_PHONE_INNER' => '<span id="innerphone_' . $user['ID'] . '">' . $user["UF_PHONE_INNER"] . '</span>', 'UF_VI_BACKPHONE' => '<span id="backphone_' . $user['ID'] . '">' . (array_key_exists($user["UF_VI_BACKPHONE"], $numbers) ? $numbers[$user["UF_VI_BACKPHONE"]] : GetMessage('VI_NUMBERS_DEFAULT')) . '</span>' . '<span id="backphone_' . $user['ID'] . '_value" style="display:none;">' . $user["UF_VI_BACKPHONE"] . '</span>');
$arCols['UF_VI_PHONE'] = '<span id="vi_phone_' . $user['ID'] . '"' . ($user["UF_VI_PHONE"] == "Y" ? ' class="bx-vi-phone-enable"' : '') . '>' . ($user["UF_VI_PHONE"] == "Y" ? GetMessage('VI_NUMBERS_PHONE_DEVICE_ENABLE') : GetMessage('VI_NUMBERS_PHONE_DEVICE_DISABLE')) . '</span>' . '<span style="display:none" id="vi_phone_enable_' . $user['ID'] . '">' . ($user["UF_VI_PHONE"] == "Y" ? 'Y' : 'N') . '</span>';
$arCols['EDIT'] = '<span id="create_' . $user['ID'] . '">' . '<a href="#" onclick="BX.Voximplant.Numbers.edit(' . $user['ID'] . '); return false; ">' . GetMessage('VI_NUMBERS_EDIT') . '</a>' . '</span>';
$arRows[$user['ID']] = array('data' => $user, 'columns' => $arCols);
}
$arResult['ROWS'] = $arRows;
$arHeaders = array(array('id' => 'NAME', 'name' => GetMessage('VI_NUMBERS_GRID_NAME'), 'sort' => 'name', 'default' => true, 'editable' => false), array('id' => 'UF_PHONE_INNER', 'name' => GetMessage('VI_NUMBERS_GRID_CODE'), 'default' => true, 'editable' => false), array('id' => 'UF_VI_BACKPHONE', 'name' => GetMessage('VI_NUMBERS_GRID_PHONE'), 'default' => true, 'editable' => false));
$arHeaders[] = array('id' => 'UF_VI_PHONE', 'name' => GetMessage('VI_NUMBERS_GRID_PHONE_DEVICE'), 'default' => true, 'editable' => false);
$arHeaders[] = array('id' => 'EDIT', 'name' => '', 'default' => true, 'editable' => false);
$APPLICATION->IncludeComponent('bitrix:main.interface.grid', '', array('GRID_ID' => $arResult['GRID_ID'], 'HEADERS' => $arHeaders, 'ROWS' => $arResult['ROWS'], 'NAV_OBJECT' => $arResult['NAV_OBJECT']));
?>
<div style="padding-top: 30px;">
示例5: pow
$pval = $pval * $zval + $dx[$i];
}
$pval = pow($pval, -16);
$pval = 0.5 - abs($pval - 0.5);
return $pval;
}
if ($abtest['START_DATE'] || $abtest['STOP_DATE']) {
$math = array('pwr' => false, 'sgn' => false);
if ($abtest['MIN_AMOUNT'] > 0) {
if (min($arGroupABaseRate['DENOMINATOR'], $arGroupBBaseRate['DENOMINATOR']) >= $abtest['MIN_AMOUNT']) {
$pval = pvalue($arGroupABaseRate['RATE'], $arGroupBBaseRate['RATE'], $arGroupABaseRate['DENOMINATOR'], $arGroupBBaseRate['DENOMINATOR']);
$math = array('pwr' => true, 'sgn' => $pval < 0.05);
}
}
}
$user_name = $abtest['USER_ID'] ? CUser::formatName(CSite::getNameFormat(), array('TITLE' => $abtest['USER_TITLE'], 'NAME' => $abtest['USER_NAME'], 'SECOND_NAME' => $abtest['USER_SECOND_NAME'], 'LAST_NAME' => $abtest['USER_LAST_NAME'], 'LOGIN' => $abtest['USER_LOGIN']), true, true) : false;
?>
<tr><td>
<div class="stat-item-block-container abtest-report-container">
<div class="stat-item-container item-test-info">
<?php
if ($user_name) {
?>
<span class="ab-test-info ab-test-info-right"><?php
echo getMessage($abtest['ACTIVE'] == 'Y' ? 'ABTEST_STARTED_BY' : 'ABTEST_STOPPED_BY');
?>
: <a href="/bitrix/admin/user_edit.php?ID=<?php
echo intval($abtest['USER_ID']);
?>
示例6: executeManagePage
//.........这里部分代码省略.........
}
} else {
if ($service['type'] == 'crdomain') {
$crUsers = CControllerClient::ExecuteEvent('OnMailControllerGetMemberUsers', array('DOMAIN' => $service['server']));
if (!empty($crUsers['result']) && is_array($crUsers['result'])) {
$service['users'][$service['server']] = $crUsers['result'];
}
}
}
$dbMailboxes = CMailbox::getList(array('TIMESTAMP_X' => 'ASC'), array('ACTIVE' => 'Y', '!USER_ID' => 0, 'SERVICE_ID' => $service['id']));
while ($mailbox = $dbMailboxes->fetch()) {
list($login, $domain) = explode('@', $mailbox['LOGIN'], 2);
if (!empty($service['users'][$domain]) && ($key = array_search($login, $service['users'][$domain])) !== false) {
array_splice($service['users'][$domain], $key, 1);
}
}
$this->arParams['SERVICES'][] = $service;
}
}
}
$this->arResult['GRID_ID'] = 'manage_domain_grid';
$gridOptions = new CGridOptions($this->arResult['GRID_ID']);
$arSort = $gridOptions->getSorting(array('sort' => array('ID' => 'ASC'), 'vars' => array('by' => 'by', 'order' => 'order')));
$arNav = $gridOptions->getNavParams(array('nPageSize' => 50));
$arSortArg = each($arSort['sort']);
$arFilter = array('ACTIVE' => 'Y', '!UF_DEPARTMENT' => false);
if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'search' && !empty($_REQUEST['FILTER'])) {
$this->arResult['FILTER'] = $_REQUEST['FILTER'];
$userIds = array();
$dbMailboxes = CMailbox::getList(array('TIMESTAMP_X' => 'ASC'), array('LID' => SITE_ID, 'ACTIVE' => 'Y', '!USER_ID' => 0, 'LOGIN' => $_REQUEST['FILTER']));
while ($mailbox = $dbMailboxes->fetch()) {
if (in_array($mailbox['SERVER_TYPE'], array('imap', 'controller', 'domain'))) {
$userIds[] = $mailbox['USER_ID'];
}
}
$arFilter['ID'] = empty($userIds) ? 0 : join('|', $userIds);
}
$dbUsers = CUser::GetList($arSortArg['key'], $arSortArg['value'], $arFilter, array('FIELDS' => array('ID', 'LOGIN', 'NAME', 'SECOND_NAME', 'LAST_NAME', 'PERSONAL_PHOTO', 'WORK_POSITION')));
$dbUsers->navStart($arNav['nPageSize']);
$arRows = array();
while ($user = $dbUsers->fetch()) {
$user['DETAIL_URL'] = COption::getOptionString('intranet', 'search_user_url', '/user/#ID#/');
$user['DETAIL_URL'] = str_replace(array('#ID#', '#USER_ID#'), array($user['ID'], $user['ID']), $user['DETAIL_URL']);
$user['PHOTO_THUMB'] = '<img src="/bitrix/components/bitrix/main.user.link/templates/.default/images/nopic_30x30.gif" border="0" alt="" width="32" height="32">';
if (intval($user['PERSONAL_PHOTO']) > 0) {
$imageFile = CFile::getFileArray($user['PERSONAL_PHOTO']);
if ($imageFile !== false) {
$arFileTmp = CFile::resizeImageGet($imageFile, array('width' => 42, 'height' => 42), BX_RESIZE_IMAGE_EXACT, false);
$user['PHOTO_THUMB'] = CFile::showImage($arFileTmp['src'], 32, 32);
}
}
$anchor_id = RandString(8);
$arCols = array('NAME' => '<table id="user_' . $user['ID'] . '" style="border-collapse: collapse; border: none; ">
<tr>
<td style="border: none !important; padding: 0px !important; ">
<div style="width: 32px; height: 32px; margin:2px; padding: 2px; box-shadow:0 0 2px 1px rgba(0, 0, 0, 0.1);">
<a href="' . $user['DETAIL_URL'] . '">' . $user['PHOTO_THUMB'] . '</a>
</div>
</td>
<td style="border: none !important; padding: 0px 0px 0px 7px !important; vertical-align: top; ">
<a href="' . $user['DETAIL_URL'] . '"><b>' . CUser::formatName(CSite::getNameFormat(), $user, true, true) . '</b></a><br>
' . htmlspecialcharsbx($user['WORK_POSITION']) . '
</td>
</tr>
</table>', 'EMAIL' => '', 'ADD' => '', 'DELETE' => '');
if ($mailbox = CIntranetMailSetupHelper::getUserMailbox($user['ID'])) {
switch ($mailbox['SERVER_TYPE']) {
case 'imap':
$arCols['EMAIL'] = $mailbox['LOGIN'];
if (strpos($mailbox['LOGIN'], '@') === false) {
$arCols['EMAIL'] .= '<br><span style="font-weight: normal; ">imap://' . $mailbox['SERVER'] . ':' . $mailbox['PORT'] . '</span>';
}
$arCols['ADD'] = '<a href="#" onclick="mb.create(' . $user['ID'] . '); return false; ">' . GetMessage('INTR_MAIL_MANAGE_CHANGE') . '</a>';
break;
case 'controller':
case 'domain':
case 'crdomain':
$arCols['EMAIL'] = $mailbox['LOGIN'];
$arCols['ADD'] = '<a href="#" onclick="mb.create(' . $user['ID'] . '); return false; ">' . GetMessage('INTR_MAIL_MANAGE_CHANGE') . '</a><br><a href="#" onclick="mb.changePassword(' . $user['ID'] . '); return false; ">' . GetMessage('INTR_MAIL_MANAGE_PASSWORD') . '</a>';
$arCols['DELETE'] = '<a href="#" onclick="mb.remove(' . $user['ID'] . '); return false; ">' . GetMessage('INTR_MAIL_MANAGE_DELETE') . '</a>';
break;
}
} else {
$arCols['ADD'] = '<a href="#" onclick="mb.create(' . $user['ID'] . '); return false; ">' . GetMessage('INTR_MAIL_MANAGE_CREATE') . '</a>';
}
if (empty($this->arParams['SERVICES'])) {
$arCols['ADD'] = '';
$arCols['DELETE'] = '';
}
$arCols['EMAIL'] = '<span id="email_' . $user['ID'] . '" style="font-weight: bold; white-space: nowrap; ">' . $arCols['EMAIL'] . '</span>';
$arCols['ADD'] = '<span id="create_' . $user['ID'] . '" style="white-space: nowrap; ">' . $arCols['ADD'] . '</span>';
$arCols['DELETE'] = '<span id="delete_' . $user['ID'] . '" style="white-space: nowrap; ">' . $arCols['DELETE'] . '</span>';
$arRows[$user['ID']] = array('data' => $user, 'columns' => $arCols);
}
$this->arResult['ROWS'] = $arRows;
$this->arResult['ROWS_COUNT'] = $dbUsers->selectedRowsCount();
$this->arResult['NAV_OBJECT'] = $dbUsers;
$this->arResult['NAV_OBJECT']->bShowAll = false;
$this->includeComponentTemplate('manage');
}