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


PHP CCalendar::IsSocnetAdmin方法代码示例

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


在下文中一共展示了CCalendar::IsSocnetAdmin方法的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));
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:11,代码来源:calendar_type.php

示例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;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:16,代码来源:calendar_sect.php

示例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) . ',';
                             }
                         }
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:calendar_event.php


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