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


PHP CCalendar::GetAccessNames方法代码示例

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


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

示例1: Request


//.........这里部分代码省略.........
                             return CCalendar::ThrowError('[se01]' . GetMessage('EC_ACCESS_DENIED'));
                         }
                     } else {
                         if (self::$type == 'user') {
                             if (!self::IsPersonal()) {
                                 // If it's not owner of the group.
                                 return CCalendar::ThrowError('[se02]' . GetMessage('EC_ACCESS_DENIED'));
                             }
                         } else {
                             if (!CCalendarType::CanDo('calendar_type_edit_section')) {
                                 return CCalendar::ThrowError('[se03]' . GetMessage('EC_ACCESS_DENIED'));
                             }
                         }
                     }
                 } elseif (!self::IsPersonal() && !$bNew && !CCalendarSect::CanDo('calendar_edit_section', $id, self::$userId)) {
                     return CCalendar::ThrowError(GetMessage('[se02]EC_ACCESS_DENIED'));
                 }
                 $arFields = array('CAL_TYPE' => self::$type, 'ID' => $id, 'NAME' => trim($_POST['name']), 'DESCRIPTION' => trim($_POST['desc']), 'COLOR' => $_POST['color'], 'TEXT_COLOR' => $_POST['text_color'], 'OWNER_ID' => self::$bOwner ? self::GetOwnerId() : '', 'EXPORT' => array('ALLOW' => isset($_POST['export']) && $_POST['export'] == 'Y', 'SET' => $_POST['exp_set']), 'ACCESS' => is_array($_POST['access']) ? $_POST['access'] : array());
                 if ($bNew) {
                     $arFields['IS_EXCHANGE'] = $_POST['is_exchange'] == 'Y';
                 }
                 $id = intVal(self::SaveSection(array('arFields' => $arFields)));
                 if ($id > 0) {
                     CCalendarSect::SetClearOperationCache(true);
                     $oSect = CCalendarSect::GetById($id, true, true);
                     if (!$oSect) {
                         return CCalendar::ThrowError(GetMessage('EC_CALENDAR_SAVE_ERROR'));
                     }
                     if (self::$type == 'user' && isset($_POST['is_def_meet_calendar']) && $_POST['is_def_meet_calendar'] == 'Y') {
                         $set = CCalendar::GetUserSettings(self::$ownerId);
                         $set['meetSection'] = $id;
                         CCalendar::SetUserSettings($set, self::$ownerId);
                     }
                     CCalendar::OutputJSRes($reqId, array('calendar' => $oSect, 'accessNames' => CCalendar::GetAccessNames()));
                 }
                 if ($id <= 0) {
                     return CCalendar::ThrowError(GetMessage('EC_CALENDAR_SAVE_ERROR'));
                 }
                 break;
                 // * * * * * Delete calendar * * * * *
             // * * * * * Delete calendar * * * * *
             case 'section_delete':
                 $sectId = intVal($_REQUEST['id']);
                 if (!self::IsPersonal() && !CCalendarSect::CanDo('calendar_edit_section', $sectId, self::$userId)) {
                     return CCalendar::ThrowError(GetMessage('EC_ACCESS_DENIED'));
                 }
                 $res = self::DeleteSection($sectId);
                 // if ($res !== true)
                 // return CCalendar::ThrowError(strlen($res) > 0 ? $res : GetMessage('EC_CALENDAR_DEL_ERROR'));
                 CCalendar::OutputJSRes($reqId, array('result' => true));
                 break;
                 // * * * * * Save superposed sections * * * * *
             // * * * * * Save superposed sections * * * * *
             case 'set_superposed':
                 $trackedUser = intVal($_REQUEST['trackedUser']);
                 if ($trackedUser > 0) {
                     $arUserIds = self::TrackingUsers(self::$userId);
                     if (!in_array($trackedUser, $arUserIds)) {
                         $arUserIds[] = $trackedUser;
                         self::TrackingUsers(self::$userId, $arUserIds);
                     }
                 }
                 if (CCalendar::SetDisplayedSuperposed(self::$userId, $_REQUEST['sect'])) {
                     CCalendar::OutputJSRes($reqId, array('result' => true));
                 } else {
                     CCalendar::ThrowError('Error! Cant save displayed superposed calendars');
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:67,代码来源:calendar.php

示例2: OutputTypeHtml

function OutputTypeHtml($type)
{
    $XML_ID = preg_replace("/[^a-zA-Z0-9_]/i", "", $type['XML_ID']);
    CCalendarSceleton::GetAccessHTML('calendar_type', 'bxec-calendar-type-' . $XML_ID);
    ?>
	<div class="bxcopt-type-cont" id="type-cont-<?php 
    echo $XML_ID;
    ?>
"">
		<div class="bxcopt-type-cont-title">
			<span class="bxcopt-type-title-label"><?php 
    echo htmlspecialcharsbx($type['NAME']);
    ?>
 [<?php 
    echo $XML_ID;
    ?>
]</span>
			<a href="javascript:void(0);" onclick="delType('<?php 
    echo $XML_ID;
    ?>
'); return false;"><?php 
    echo GetMessage('CAL_DELETE');
    ?>
</a>
			<a href="javascript:void(0);" onclick="addType(<?php 
    echo CUtil::PhpToJsObject($type);
    ?>
); return false;"><?php 
    echo GetMessage('CAL_CHANGE');
    ?>
</a>
		</div>
		<?php 
    if (strlen($type['DESCRIPTION']) > 0) {
        ?>
			<span class="bxcopt-type-desc"><?php 
        echo htmlspecialcharsbx($type['DESCRIPTION']);
        ?>
</span>
		<?php 
    }
    ?>
		<div class="bxcopt-type-access-cont">
			<span class="bxcopt-type-access-cont-title"><?php 
    echo GetMessage('CAL_TYPE_PERMISSION_ACCESS');
    ?>
:</span>
			<div class="bxcopt-type-access-values-cont" id="type-access-values-cont<?php 
    echo $XML_ID;
    ?>
"></div>
			<a class="bxcopt-add-access-link" href="javascript:void(0);" id="type-access-link<?php 
    echo $XML_ID;
    ?>
"><?php 
    echo GetMessage('CAL_ADD_ACCESS');
    ?>
</a>
		</div>
<script>
BX = top.BX;
BX.ready(function()
{
	setTimeout(function(){
		top.accessNames = {};
		var code, arNames = <?php 
    echo CUtil::PhpToJsObject(CCalendar::GetAccessNames());
    ?>
;
		for (code in arNames)
			top.accessNames[code] = arNames[code];

		top.BXCalAccess<?php 
    echo $XML_ID;
    ?>
 = new top.ECCalendarAccess({
			bind: 'calendar-type-<?php 
    echo $XML_ID;
    ?>
',
			GetAccessName: function(code){return top.accessNames[code] || code;},
			inputName: 'cal_type_perm[<?php 
    echo $XML_ID;
    ?>
]',
			pCont: BX('type-access-values-cont<?php 
    echo $XML_ID;
    ?>
'),
			pLink: BX('type-access-link<?php 
    echo $XML_ID;
    ?>
'),
			delTitle: '<?php 
    echo GetMessage("CAL_DELETE");
    ?>
',
			noAccessRights: '<?php 
    echo GetMessage("CAL_NOT_SET");
    ?>
//.........这里部分代码省略.........
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:options.php


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