本文整理汇总了PHP中CCalendar::IsSocNet方法的典型用法代码示例。如果您正苦于以下问题:PHP CCalendar::IsSocNet方法的具体用法?PHP CCalendar::IsSocNet怎么用?PHP CCalendar::IsSocNet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCalendar
的用法示例。
在下文中一共展示了CCalendar::IsSocNet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CanDo
public static function CanDo($operation, $xmlId = 0, $userId = false)
{
global $USER;
if ($USER->CanDoOperation('edit_php')) {
return true;
}
if (($xmlId == 'group' || $xmlId == 'user') && CCalendar::IsSocNet() && CCalendar::IsSocnetAdmin()) {
return true;
}
return in_array($operation, self::GetOperations($xmlId, $userId));
}
示例2: CanDo
public static function CanDo($operation, $sectId = 0, $userId = false)
{
global $USER;
if (!isset($USER) || !$sectId) {
return false;
}
if ($USER->CanDoOperation('edit_php')) {
return true;
}
if ((CCalendar::GetType() == 'group' || CCalendar::GetType() == 'user') && CCalendar::IsSocNet() && CCalendar::IsSocnetAdmin()) {
return true;
}
$res = in_array($operation, self::GetOperations($sectId, $userId));
self::$bClearOperationCache = false;
return $res;
}
示例3: GetList
public static function GetList($Params = array())
{
global $DB, $USER_FIELD_MANAGER;
$getUF = $Params['getUserfields'] !== false;
$checkPermissions = $Params['checkPermissions'] !== false;
$bCache = CCalendar::CacheTime() > 0;
$Params['setDefaultLimit'] = $Params['setDefaultLimit'] === true;
$userId = isset($Params['userId']) ? intVal($Params['userId']) : CCalendar::GetCurUserId();
CTimeZone::Disable();
if ($bCache) {
$cache = new CPHPCache();
$cacheId = 'event_list_' . md5(serialize($Params));
if ($checkPermissions) {
$cacheId .= 'chper' . CCalendar::GetCurUserId() . '|';
}
if (CCalendar::IsSocNet() && CCalendar::IsSocnetAdmin()) {
$cacheId .= 'socnetAdmin|';
}
$cacheId .= CCalendar::GetOffset();
$cachePath = CCalendar::CachePath() . 'event_list';
if ($cache->InitCache(CCalendar::CacheTime(), $cacheId, $cachePath)) {
$res = $cache->GetVars();
$arResult = $res["arResult"];
$arAttendees = $res["arAttendees"];
}
}
if (!$bCache || !isset($arResult)) {
$arFilter = $Params['arFilter'];
if ($getUF) {
$obUserFieldsSql = new CUserTypeSQL();
$obUserFieldsSql->SetEntity("CALENDAR_EVENT", "CE.ID");
$obUserFieldsSql->SetSelect(array("UF_*"));
$obUserFieldsSql->SetFilter($arFilter);
}
$fetchMeetings = $Params['fetchMeetings'];
$Params['fetchAttendees'] = $Params['fetchAttendees'] !== false;
$skipDeclined = $Params['skipDeclined'] === true;
if ($Params['setDefaultLimit'] !== false) {
if (!isset($arFilter["FROM_LIMIT"])) {
// default 3 month back
$arFilter["FROM_LIMIT"] = CCalendar::Date(time() - 31 * 3 * 24 * 3600, false);
}
if (!isset($arFilter["TO_LIMIT"])) {
// default one year into the future
$arFilter["TO_LIMIT"] = CCalendar::Date(time() + 365 * 24 * 3600, false);
}
}
$arOrder = isset($Params['arOrder']) ? $Params['arOrder'] : array('SORT' => 'asc');
$arFields = self::GetFields();
if ($arFilter["DELETED"] === false) {
unset($arFilter["DELETED"]);
} elseif (!isset($arFilter["DELETED"])) {
$arFilter["DELETED"] = "N";
}
$ownerId = isset($arFilter['OWNER_ID']) ? $arFilter['OWNER_ID'] : CCalendar::GetOwnerId();
$arSqlSearch = array();
if (is_array($arFilter)) {
$filter_keys = array_keys($arFilter);
for ($i = 0, $l = count($filter_keys); $i < $l; $i++) {
$n = strtoupper($filter_keys[$i]);
$val = $arFilter[$filter_keys[$i]];
if (is_string($val) && strlen($val) <= 0 || strval($val) == "NOT_REF") {
continue;
}
if ($n == 'FROM_LIMIT') {
$ts = CCalendar::Timestamp($val, false);
if ($ts > 0) {
$arSqlSearch[] = "CE.DATE_TO_TS_UTC>=" . $ts;
}
} elseif ($n == 'TO_LIMIT') {
$ts = CCalendar::Timestamp($val, false);
if ($ts > 0) {
$arSqlSearch[] = "CE.DATE_FROM_TS_UTC<=" . ($ts + 86399);
}
} elseif ($n == 'OWNER_ID' && intVal($val) > 0) {
$arSqlSearch[] = "CE.OWNER_ID=" . intVal($val);
}
if ($n == 'NAME') {
$arSqlSearch[] = "CE.NAME='" . CDatabase::ForSql($val) . "'";
} elseif ($n == 'CREATED_BY') {
if (is_array($val)) {
$val = array_map(intVal, $val);
$arSqlSearch[] = 'CE.CREATED_BY IN (\'' . implode('\',\'', $val) . '\')';
} else {
if (intVal($val) > 0) {
$arSqlSearch[] = "CE.CREATED_BY=" . intVal($val);
}
}
} elseif ($n == 'SECTION') {
if (!is_array($val)) {
$val = array($val);
}
$q = "";
if (is_array($val)) {
$sval = '';
foreach ($val as $sectid) {
if (intVal($sectid) > 0) {
$sval .= intVal($sectid) . ',';
}
}
//.........这里部分代码省略.........