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


PHP Calendar::getCalendarsOfAdmin方法代码示例

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


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

示例1: getLastAddedEvents

 public static function getLastAddedEvents($amount = 5, $ajax = false)
 {
     global $obj_db;
     $arr_return = array();
     if (User::isLoggedIn()) {
         $arr_user = User::getUser();
         $arr_cal_ids = array();
         $arr_admin_calendars = Calendar::getCalendarsOfAdmin($arr_user['user_id']);
         foreach ($arr_admin_calendars as $cal) {
             $arr_cal_ids[] = $cal['calendar_id'];
         }
         $str_query = 'SELECT e.*,c.*, concat_ws(" ",e.date_start,e.time_start) as start,concat_ws(" ",e.date_end,e.time_end) as end FROM events e LEFT JOIN calendars c ON(c.calendar_id = e.calendar_id) ';
         $str_query .= ' WHERE 1 ';
         if ((User::isSuperAdmin() || User::isAdmin()) && ADMIN_HAS_FULL_CONTROL) {
         } else {
             // $str_query .= ' AND c.share_type = "public" OR c.creator_id = '. $arr_user['user_id'];
         }
         if (!User::isSuperAdmin()) {
             $str_query .= ' AND c.calendar_id IN(' . implode(',', $arr_cal_ids) . ')';
         }
         $str_query .= ' ORDER BY e.`create_date` DESC LIMIT ' . $amount;
         $res = mysqli_query($obj_db, $str_query);
         if ($res !== false && !empty($res)) {
             while ($arr_line = mysqli_fetch_array($res, MYSQLI_ASSOC)) {
                 $arr_return[] = $arr_line;
             }
             if ($ajax) {
                 echo json_encode(array('current' => $arr_return));
                 exit;
             } else {
                 return $arr_return;
             }
         }
     }
 }
开发者ID:ramant15,项目名称:ektimo,代码行数:35,代码来源:events.class.php

示例2: getDeletedCalendars

function getDeletedCalendars()
{
    global $obj_smarty;
    if (User::isLoggedIn()) {
        $arr_user = User::getUser();
        if (User::isSuperAdmin()) {
            $arr_calendars = Calendar::getCalendars(true, true);
            $obj_smarty->assign('calendars', $arr_calendars);
        } else {
            if (User::isAdmin()) {
                $arr_calendars = Calendar::getCalendarsOfAdmin($arr_user['user_id'], true);
                $obj_smarty->assign('calendars', $arr_calendars);
            }
        }
    }
    $obj_smarty->assign('active', 'calendars');
    $obj_smarty->display(FULLCAL_DIR . '/view/admin_panel.tpl');
    exit;
}
开发者ID:ramant15,项目名称:ektimo,代码行数:19,代码来源:index.php

示例3: switch

    $bln_superadmin = User::isSuperAdmin();
    if ($bln_superadmin) {
        $obj_smarty->assign('active', 'admin');
        $obj_smarty->display(FULLCAL_DIR . '/view/admin_panel.tpl');
        exit;
    } else {
        $obj_smarty->assign('name', $arr_user['firstname'] . ' ' . (!empty($arr_user['infix']) ? $arr_user['infix'] : '') . $arr_user['lastname']);
        $obj_smarty->assign('user', $_SESSION['calendar-uid']['username']);
        $obj_smarty->assign('user_id', $_SESSION['calendar-uid']['uid']);
        $obj_smarty->assign('is_user', $bln_user);
        $obj_smarty->assign('is_admin', $bln_admin);
        $obj_smarty->assign('is_super_admin', $bln_superadmin);
        $language = Settings::getLanguage($arr_user['user_id']);
        $obj_smarty->assign('language', $language);
        if ($bln_admin) {
            $arr_calendars = Calendar::getCalendarsOfAdmin($arr_user['user_id']);
            $obj_smarty->assign('calendars', $arr_calendars);
            $obj_smarty->assign('selected_calendar', 'all');
        }
    }
} else {
    $obj_smarty->display(FULLCAL_DIR . '/login.html');
    exit;
}
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case 'get_list':
            getList();
            break;
        case 'get_list_ajax':
            getListAjax();
开发者ID:ramant15,项目名称:ektimo,代码行数:31,代码来源:index.php


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