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


PHP claro_get_current_group_id函数代码示例

本文整理汇总了PHP中claro_get_current_group_id函数的典型用法代码示例。如果您正苦于以下问题:PHP claro_get_current_group_id函数的具体用法?PHP claro_get_current_group_id怎么用?PHP claro_get_current_group_id使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: getResourcesList

 /**
  * Returns all the descriptions of a course.
  * @throws InvalidArgumentException if the $cid in not provided.
  * @webservice{/module/MOBILE/GEN/getResourcesList/cidReq}
  * @ws_arg{method,getResourcesList}
  * @ws_arg{cidReq,SYSCODE of requested cours}
  * @return array of Descriptions object
  */
 function getResourcesList($args)
 {
     $module = isset($args['module']) ? $args['module'] : null;
     $cid = claro_get_current_course_id();
     if ($cid == null || $module == null) {
         throw new InvalidArgumentException('Missing cid argument!');
     }
     $list = array();
     FromKernel::uses('core/linker.lib');
     ResourceLinker::init();
     $locator = new ClarolineResourceLocator($cid, $module, null, claro_get_current_group_id());
     if (ResourceLinker::$Navigator->isNavigable($locator)) {
         $resourceList = ResourceLinker::$Navigator->getResourceList($locator);
         foreach ($resourceList as $lnk) {
             $inLocator = $lnk->getLocator();
             $item['title'] = $lnk->getName();
             $item['visibility'] = $lnk->isVisible();
             $item['url'] = str_replace(get_path('url'), "", get_path('rootWeb')) . ResourceLinker::$Resolver->resolve($inLocator);
             if ($inLocator->hasResourceId()) {
                 $item['resourceId'] = $inLocator->getResourceId();
             } else {
                 $item['resourceId'] = $item['url'];
             }
             if (claro_is_allowed_to_edit() || $item['visibility']) {
                 $list[] = $item;
             }
         }
     }
     return $list;
 }
开发者ID:Okhoshi,项目名称:Claroline.REST-API-Plugin,代码行数:38,代码来源:genericwebservicecontroller.lib.php

示例2: getSingleResource

 /**
  * Returns a single resquested announce.
  * @param array $args must contain 'resID' key with the resource identifier of the requested resource
  * @throws InvalidArgumentException if one of the paramaters is missing
  * @webservice{/module/MOBILE/CLANN/getSingleResource/cidReq/resId}
  * @ws_arg{Method,getSingleResource}
  * @ws_arg{cidReq,SYSCODE of requested cours}
  * @ws_arg{resID,Resource Id of requested resource}
  * @return announce object (can be null if not visible for the current user)
  */
 function getSingleResource($args)
 {
     $resourceId = isset($args['resID']) ? $args['resID'] : null;
     $cid = claro_get_current_course_id();
     if ($cid == null || $resourceId == null) {
         throw new InvalidArgumentException('Missing cid or resourceId argument!');
     }
     $claroNotification = Claroline::getInstance()->notification;
     $date = $claroNotification->getLastActionBeforeLoginDate(claro_get_current_user_id());
     $d = new DateTime($date);
     $d->sub(new DateInterval('PT1M'));
     From::Module('CLANN')->uses('announcement.lib');
     if ($announce = $this->announcement_get_item($resourceId, $cid)) {
         $notified = $claroNotification->isANotifiedRessource($cid, $date, claro_get_current_user_id(), claro_get_current_group_id(), get_tool_id_from_module_label('CLANN'), $announce['id'], false);
         $announce['visibility'] = $announce['visibility'] != 'HIDE';
         $announce['content'] = trim(strip_tags($announce['content']));
         $announce['cours']['sysCode'] = $cid;
         $announce['resourceId'] = $announce['id'];
         $announce['date'] = $announce['time'];
         $announce['notifiedDate'] = $notified ? $date : $announce['time'];
         $announce['seenDate'] = $d->format('Y-m-d H:i');
         unset($announce['id']);
         return claro_is_allowed_to_edit() || $announce['visibility'] ? $announce : null;
     } else {
         throw new RuntimeException('Resource not found', 404);
     }
 }
开发者ID:Okhoshi,项目名称:Claroline.REST-API-Plugin,代码行数:37,代码来源:clannwebservicecontroller.lib.php

示例3: getCurrentContext

 /**
  * Get the current execution context
  * @return array
  */
 public static function getCurrentContext()
 {
     $context = array();
     if (claro_is_in_a_course()) {
         $context[CLARO_CONTEXT_COURSE] = claro_get_current_course_id();
     }
     if (claro_is_in_a_group()) {
         $context[CLARO_CONTEXT_GROUP] = claro_get_current_group_id();
     }
     if (claro_is_in_a_tool()) {
         if (isset($GLOBALS['tlabelReq']) && $GLOBALS['tlabelReq']) {
             $context[CLARO_CONTEXT_TOOLLABEL] = $GLOBALS['tlabelReq'];
         }
         if (claro_get_current_tool_id()) {
             $context[CLARO_CONTEXT_TOOLINSTANCE] = claro_get_current_tool_id();
         }
     }
     if (get_current_module_label()) {
         $context[CLARO_CONTEXT_MODULE] = get_current_module_label();
     }
     return $context;
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:26,代码来源:context.lib.php

示例4: current_user_is_allowed_to_send_message_to_user

/**
 * return the autorisation of the current user to send a message to the user in parameter
 *
 * @param int $userId user id of the recipient
 * @return bool true if the current user is autorised do send a message to the user in parameter
 *                 flase if the current user is not autorised do send a message to the user in parameter
 */
function current_user_is_allowed_to_send_message_to_user($userId)
{
    if (claro_is_platform_admin()) {
        return true;
    }
    if (claro_is_in_a_group()) {
        if (claro_is_group_tutor() || claro_is_course_manager()) {
            $userList = get_group_user_list(claro_get_current_group_id(), claro_get_current_course_id());
            for ($count = 0; $count < count($userList); $count++) {
                if ($userList[$count]['id'] == $userId) {
                    return true;
                }
            }
        }
        return false;
    } elseif (claro_is_in_a_course()) {
        if (claro_is_course_manager()) {
            $userList = claro_get_course_user_list();
            for ($count = 0; $count < count($userList); $count++) {
                if ($userList[$count]['user_id'] == $userId) {
                    return true;
                }
            }
        }
        return false;
    } else {
        // can answerd to a user
        $tableName = get_module_main_tbl(array('im_message', 'im_recipient'));
        $select = "SELECT count(*)\n" . " FROM `" . $tableName['im_message'] . "` as M\n" . " INNER JOIN `" . $tableName['im_recipient'] . "` as R ON R.message_id = M.message_id\n" . " WHERE (R.user_id = " . (int) claro_get_current_user_id() . " OR R.user_id = 0)\n" . " AND M.sender = " . (int) $userId;
        $nbMessage = claro_sql_query_fetch_single_value($select);
        if ($nbMessage > 0) {
            return true;
        } elseif (get_conf('userCanSendMessage')) {
        }
        return true;
        return false;
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:45,代码来源:permission.lib.php

示例5: event

 public function event($type, $args = null)
 {
     if (!is_array($args)) {
         $args = array();
     }
     if (!array_key_exists('cid', $args) && claro_is_in_a_course()) {
         $args['cid'] = claro_get_current_course_id();
     }
     if (!array_key_exists('gid', $args) && claro_is_in_a_group()) {
         $args['gid'] = claro_get_current_group_id();
     }
     if (!array_key_exists('tid', $args) && claro_is_in_a_tool()) {
         $args['tid'] = claro_get_current_tool_id();
         // $args['tlabel'] = get_current_module_label();
     }
     if (!array_key_exists('uid', $args) && claro_is_user_authenticated()) {
         $args['uid'] = claro_get_current_user_id();
     }
     if (!array_key_exists('date', $args)) {
         $args['date'] = claro_date("Y-m-d H:i:00");
     }
     $this->notifyEvent($type, $args);
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:23,代码来源:notify.lib.php

示例6: get_lang

            <td colspan="<?php 
    echo $this->is_allowedToEdit ? 9 : 6;
    ?>
" align="center">
            <?php 
    echo $this->forumSettings['forum_access'] == 2 ? get_lang('There are no topics for this forum. You can post one') : get_lang('There are no topics for this forum.');
    ?>
            </td>
        </tr>
        <?php 
} else {
    foreach ($this->topicList as $thisTopic) {
        ?>
            <tr>
            <?php 
        $itemClass = claro_is_user_authenticated() && $this->claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $this->claro_notifier->get_notification_date(claro_get_current_user_id()), claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $this->forumId . "-" . $thisTopic['topic_id'], FALSE) ? 'item hot' : 'item';
        $itemLink = claro_htmlspecialchars(Url::Contextualize(get_module_url('CLFRM') . '/viewtopic.php?topic=' . $thisTopic['topic_id'] . (is_null($this->forumSettings['idGroup']) ? '' : '&amp;gidReq =' . $this->forumSettings['idGroup'])));
        ?>
                <td>
                    <span class="<?php 
        echo $itemClass;
        ?>
">
                        <img src="<?php 
        echo get_icon_url('topic');
        ?>
" alt="" />&nbsp;
                        <a href="<?php 
        echo $itemLink;
        ?>
"><?php 
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:forum_viewforum.tpl.php

示例7: claro_get_current_user_data

 $userFirstname = claro_get_current_user_data('firstName');
 $poster_ip = $_SERVER['REMOTE_ADDR'];
 $time = date('Y-m-d H:i');
 // prevent to go further if the fields are actually empty
 if (strip_tags($message) == '' || $subject == '') {
     $dialogBox->error(get_lang('You cannot post an empty message'));
     $error = TRUE;
 }
 if (!$error) {
     // record new topic
     $topic_id = create_new_topic($subject, $time, $forum_id, claro_get_current_user_id(), $userFirstname, $userLastname);
     if ($topic_id) {
         create_new_post($topic_id, $forum_id, claro_get_current_user_id(), $time, $poster_ip, $userLastname, $userFirstname, $message);
     }
     // notify eventmanager that a new message has been posted
     $eventNotifier->notifyCourseEvent('forum_new_topic', claro_get_current_course_id(), claro_get_current_tool_id(), $forum_id . "-" . $topic_id, claro_get_current_group_id(), 0);
     // notify by mail that a new topic has been created
     trig_forum_notification($forum_id);
     /*if( get_conf('clfrm_notification_enabled', true) )
                   {
                       $courseSender = claro_get_current_user_data('firstName') . ' ' . claro_get_current_user_data('lastName');
                       $courseOfficialCode = claro_get_current_course_data('officialCode');
                       $title = get_lang('New topic on the forum %forum', array('%forum' => $forum_name));
                       $msgContent = get_lang('A new topic called %topic has been created on the forum %forum', array('%topic' => $subject, '%forum' => $forum_name));
                       
                       // attached resource
                       $body = $msgContent . "\n"
                       .   "\n"
                       ;
       
                       require_once dirname(__FILE__) . '/../messaging/lib/message/messagetosend.lib.php';
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:newtopic.php

示例8: claro_is_course_allowed

$uploadDateIsOk = $assignment->isUploadDateOk();
if ($assignment->getAssignmentType() == 'INDIVIDUAL') {
    // user is authed and allowed
    $userCanPost = (bool) (claro_is_user_authenticated() && claro_is_course_allowed() && claro_is_course_member());
} else {
    $userGroupList = get_user_group_list(claro_get_current_user_id());
    // check if user is member of at least one group
    $userCanPost = (bool) (!empty($userGroupList));
}
$is_allowedToSubmit = (bool) ($assignmentIsVisible && $uploadDateIsOk && $userCanPost) || $is_allowedToEditAll;
/*============================================================================
    Update notification
  ============================================================================*/
if (claro_is_user_authenticated()) {
    // call this function to set the __assignment__ as seen, all the submission as seen
    $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $claro_notifier->get_notification_date(claro_get_current_user_id()), claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $req['assignmentId']);
}
/*============================================================================
    Prepare List
  ============================================================================*/
/* Prepare submission and feedback SQL filters - remove hidden item from count */
$submissionConditionList = array();
$feedbackConditionList = array();
$showOnlyVisibleCondition = '';
if (!$is_allowedToEditAll) {
    if (!get_conf('show_only_author')) {
        $submissionConditionList[] = "`s`.`visibility` = 'VISIBLE'";
    }
    // not in the if statement to allow to show feedback to the students
    $feedbackConditionList[] = "(`s`.`visibility` = 'VISIBLE' AND `fb`.`visibility` = 'VISIBLE')";
    if (!empty($userGroupList)) {
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:work_list.php

示例9: get_lang

 * Output
 */
$cssLoader = CssLoader::getInstance();
$cssLoader->load('clchat', 'screen');
//-- Content
$out = '';
$nameTools = get_lang('Chat');
$out .= claro_html_tool_title($nameTools);
if (claro_is_javascript_enabled() && $_uid) {
    $jsloader = JavascriptLoader::getInstance();
    $jsloader->load('jquery');
    $jsloader->load('clchat');
    // init var with values from get_conf before including tool library
    $htmlHeaders = '<script type="text/javascript">' . "\n" . 'var refreshRate = "' . get_conf('msg_list_refresh_rate', 5) * 1000 . '";' . "\n" . 'var userListRefresh = "' . get_conf('user_list_refresh_rate') * 1000 . '";' . "\n" . 'var cidReq = "' . claro_get_current_course_id() . '";' . "\n";
    if (claro_is_in_a_group()) {
        $htmlHeaders .= 'var gidReq = "' . claro_get_current_group_id() . '";' . "\n";
    }
    $htmlHeaders .= 'var lang = new Array();' . "\n" . 'lang["confirmFlush"] = "' . clean_str_for_javascript(get_lang('Are you sure to delete all logs ?')) . '";' . '</script>';
    $claroline->display->header->addHtmlHeader($htmlHeaders);
    // dialog box
    $out .= '<div id="clchat_user_list"></div>' . "\n" . '<div id="clchat_chatarea">' . "\n" . ' <div id="clchat_log"></div>' . "\n" . ' <div id="clchat_connectTime">' . get_lang('Start of this chat session (%connectTime)', array('%connectTime' => claro_html_localised_date(get_locale('dateTimeFormatLong'), $_SESSION['chat_connectionTime']))) . '</div>' . "\n" . ' <div id="clchat_text"></div>' . "\n" . '</div>' . "\n";
    // display form
    $out .= '<form action="#" id="clchat_form" method="get" >' . "\n" . claro_form_relay_context() . "\n" . '<img src="' . get_module_url('CLCHAT') . '/img/loading.gif" alt="' . get_lang('Loading...') . '" id="clchat_loading" width="16" height="16" />' . "\n" . '<input id="clchat_msg" type="text" name="message" maxlength="200" size="80" />' . "\n" . '<input type="submit" name="Submit" value=" &gt;&gt; " />' . "\n" . '</form>' . "\n" . claro_html_menu_horizontal($cmdMenu) . "\n" . '<p id="clchat_dialogBox"></p>' . "\n";
} else {
    if (!claro_is_javascript_enabled()) {
        $dialogBox = new DialogBox();
        $dialogBox->error(get_lang('Javascript must be enabled in order to use this tool.'));
        $out .= $dialogBox->render();
    } elseif (!$_uid) {
        $dialogBox = new DialogBox();
        $dialogBox->error(get_lang('Anonymous users cannot use this tool.'));
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:index.php

示例10: claro_html_breadcrumb

/**
 * Return the breadcrumb to display in the header
 *
 * @global string  $nameTools
 * @global array   $interbredcrump
 * @global boolean $noPHP_SELF
 * @global boolean $noQUERY_STRING
 *
 * @return string html content
 */
function claro_html_breadcrumb()
{
    // dirty global to keep value (waiting a refactoring)
    global $nameTools, $interbredcrump, $noPHP_SELF, $noQUERY_STRING;
    /******************************************************************************
       BREADCRUMB LINE
       ******************************************************************************/
    $htmlBC = '';
    if (claro_is_in_a_course() || isset($nameTools) || isset($interbredcrump) && is_array($interbredcrump)) {
        $htmlBC .= '<div id="breadcrumbLine">' . "\n\n" . '<hr />' . "\n";
        $breadcrumbUrlList = array();
        $breadcrumbNameList = array();
        $breadcrumbUrlList[] = get_path('url') . '/index.php';
        $breadcrumbNameList[] = get_conf('siteName');
        if (claro_is_in_a_course()) {
            $breadcrumbUrlList[] = get_path('clarolineRepositoryWeb') . 'course/index.php?cid=' . claro_htmlspecialchars(claro_get_current_course_id());
            $breadcrumbNameList[] = claro_get_current_course_data('officialCode');
        }
        if (claro_is_in_a_group()) {
            $breadcrumbUrlList[] = get_module_url('CLGRP') . '/index.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id());
            $breadcrumbNameList[] = get_lang('Groups');
            $breadcrumbUrlList[] = get_module_url('CLGRP') . '/group_space.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()) . '&gidReq=' . (int) claro_get_current_group_id();
            $breadcrumbNameList[] = claro_get_current_group_data('name');
        }
        if (isset($interbredcrump) && is_array($interbredcrump)) {
            while (list(, $bredcrumpStep) = each($interbredcrump)) {
                $breadcrumbUrlList[] = $bredcrumpStep['url'];
                $breadcrumbNameList[] = $bredcrumpStep['name'];
            }
        }
        if (isset($nameTools)) {
            $breadcrumbNameList[] = $nameTools;
            if (isset($noPHP_SELF) && $noPHP_SELF) {
                $breadcrumbUrlList[] = null;
            } elseif (isset($noQUERY_STRING) && $noQUERY_STRING) {
                $breadcrumbUrlList[] = $_SERVER['PHP_SELF'];
            } else {
                // set Query string to empty if not exists
                if (!isset($_SERVER['QUERY_STRING'])) {
                    $_SERVER['QUERY_STRING'] = '';
                }
                $breadcrumbUrlList[] = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
            }
        }
        $htmlBC .= claro_html_breadcrumbtrail($breadcrumbNameList, $breadcrumbUrlList, ' &gt; ', get_icon_url('home'));
        if (!claro_is_user_authenticated()) {
            $htmlBC .= "\n" . '<div id="toolViewOption" style="padding-right:10px">' . '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/login.php' . '?sourceUrl=' . urlencode(base64_encode((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])) . '" target="_top">' . get_lang('Login') . '</a>' . '</div>' . "\n";
        } elseif (claro_is_in_a_course() && !claro_is_course_member() && claro_get_current_course_data('registrationAllowed') && !claro_is_platform_admin()) {
            $htmlBC .= '<div id="toolViewOption">' . '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id() . '">' . '<img src="' . get_icon_url('enroll') . '" alt="" /> ' . '<b>' . get_lang('Enrolment') . '</b>' . '</a>' . '</div>' . "\n";
        } elseif (claro_is_display_mode_available()) {
            $htmlBC .= "\n" . '<div id="toolViewOption">' . "\n";
            if (isset($_REQUEST['View mode'])) {
                $htmlBC .= claro_html_tool_view_option($_REQUEST['View mode']);
            } else {
                $htmlBC .= claro_html_tool_view_option();
            }
            if (claro_is_platform_admin() && !claro_is_course_member()) {
                $htmlBC .= ' | <a href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id() . '">';
                $htmlBC .= '<img src="' . get_icon_url('enroll') . '" alt="" /> ';
                $htmlBC .= '<b>' . get_lang('Enrolment') . '</b>';
                $htmlBC .= '</a>';
            }
            $htmlBC .= "\n" . '</div>' . "\n";
        }
        $htmlBC .= '<div class="spacer"></div>' . "\n" . '<hr />' . "\n" . '</div>' . "\n";
    } else {
        // $htmlBC .= '<div style="height:1em"></div>';
    }
    return $htmlBC;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:80,代码来源:html.lib.php

示例11: postLister

if ($topicSettingList) {
    // get post and use pager
    if (!$viewall) {
        $postLister = new postLister($topicId, $start, get_conf('posts_per_page'));
    } else {
        $postLister = new postLister($topicId, $start, get_total_posts($topicId, 'topic'));
        $incrementViewCount = false;
    }
    // get post and use pager
    $postList = $postLister->get_post_list();
    $totalPosts = $postLister->sqlPager->get_total_item_count();
    $pagerUrl = claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?topic=' . $topicId));
    //increment topic view count if required
    if ($incrementViewCount) {
        increase_topic_view_count($topicId);
        $claro_notifier->is_a_notified_ressource(claro_get_current_course_id(), $claro_notifier->get_notification_date(claro_get_current_user_id()), claro_get_current_user_id(), claro_get_current_group_id(), claro_get_current_tool_id(), $forumId . "-" . $topicId);
        //$claroline->notifier->event( 'forum_read_topic', array( 'data' => array( 'topic_id' => $topicId ) ) );
    }
    if ($is_postAllowed) {
        $cmdList = get_forum_toolbar_array('viewtopic', $forumSettingList['forum_id'], $forumSettingList['cat_id'], $topicId);
        if (count($postList) > 2) {
            $start_last_message = (ceil($totalPosts / get_conf('posts_per_page')) - 1) * get_conf('posts_per_page');
            $lastMsgUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?forum=' . $forumSettingList['forum_id'] . '&amp;topic=' . $topicId . '&amp;start=' . $start_last_message . '#post' . $topicSettingList['topic_last_post_id']);
            $cmdList[] = array('name' => get_lang('Last message'), 'url' => claro_htmlspecialchars(Url::Contextualize($lastMsgUrl)));
            if (!$viewall) {
                $viewallUrl = Url::Contextualize($_SERVER['PHP_SELF'] . '?forum=' . $forumSettingList['forum_id'] . '&amp;topic=' . $topicId . '&amp;viewall=1');
                $cmdList[] = array('name' => get_lang('Full review'), 'url' => claro_htmlspecialchars(Url::Contextualize($viewallUrl)));
            }
        }
    }
    $out .= $postLister->disp_pager_tool_bar($pagerUrl);
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:viewtopic.php

示例12: getSingleResource

 /**
  * Returns a single resquested topic.
  * @param array $args must contain 'resID' key with the resource identifier of the requested resource
  * @throws InvalidArgumentException if one of the paramaters is missing
  * @webservice{/module/MOBILE/CLANN/getSingleResource/cidReq/resId}
  * @ws_arg{Method,getSingleResource}
  * @ws_arg{cidReq,SYSCODE of requested cours}
  * @ws_arg{resID,Resource Id of requested resource}
  * @return announce object (can be null if not visible for the current user)
  */
 function getSingleResource($args)
 {
     $resourceId = isset($args['resID']) ? $args['resID'] : null;
     $cid = claro_get_current_course_id();
     if ($cid == null || $resourceId == null) {
         throw new InvalidArgumentException('Missing cid or resourceId argument!');
     }
     FromKernel::uses('forum.lib');
     $claroNotification = Claroline::getInstance()->notification;
     $date = $claroNotification->getLastActionBeforeLoginDate(claro_get_current_user_id());
     $d = new DateTime($date);
     $d->sub(new DateInterval('PT1M'));
     $item = null;
     foreach (get_forum_list() as $forum) {
         if ($forum['forum_id'] == $resourceID) {
             $item = $forum;
             break;
         }
     }
     if ($item) {
         $item['resourceId'] = $item['forum_id'];
         $item['title'] = $item['forum_name'];
         foreach (get_category_list as $cat) {
             if ($cat['cat_id'] == $item['cat_id']) {
                 $item['cat_title'] = $cat['cat_title'];
                 $item['cat_order'] = $cat['cat_order'];
                 break;
             }
         }
         $item['topics'] = array();
         $topics = new topicLister($item['forum_id'], 0, $item['forum_topics']);
         foreach ($topics->get_topic_list() as $topic) {
             $topic['resourceId'] = $topic['topic_id'];
             $topic['title'] = $topic['topic_title'];
             $topic['poster_firstname'] = $topic['prenom'];
             $topic['poster_lastname'] = $topic['nom'];
             $topic['date'] = $topic['topic_time'];
             $topic['posts'] = array();
             $posts = new postLister($topic['topic_id'], 0, $topic['topic_replies'] + 1);
             foreach ($posts->get_post_list() as $post) {
                 $notified = $claroNotification->isANotifiedRessource($cid, $date, claro_get_current_user_id(), claro_get_current_group_id(), get_tool_id_from_module_label('CLFRM'), $item['forum_id'] . '-' . $topic['topic_id'] . '-' . $post['post_id'], false);
                 $post['notifiedDate'] = $notified ? $date : $post['post_time'];
                 $post['seenDate'] = $d->format('Y-m-d H:i');
                 $post['post_text'] = trim(strip_tags($post['post_text']));
                 $post['resourceId'] = $post['post_id'];
                 $post['date'] = $post['post_time'];
                 unset($post['post_id']);
                 unset($post['topic_id']);
                 unset($post['forum_id']);
                 unset($post['poster_id']);
                 unset($post['post_time']);
                 unset($post['poster_ip']);
                 $topic['posts'][] = $post;
             }
             unset($topic['topic_id']);
             unset($topic['topic_title']);
             unset($topic['topic_poster']);
             unset($topic['topic_time']);
             unset($topic['topic_replies']);
             unset($topic['topic_last_post_id']);
             unset($topic['forum_id']);
             unset($topic['topic_notify']);
             unset($topic['nom']);
             unset($topic['prenom']);
             unset($topic['post_time']);
             $item['topics'][] = $topic;
         }
         unset($item['forum_id']);
         unset($item['forum_name']);
         unset($item['forum_moderator']);
         unset($item['forum_topics']);
         unset($item['forum_posts']);
         unset($item['forum_last_post_id']);
         unset($item['forum_type']);
         unset($item['group_id']);
         unset($item['poster_id']);
         unset($item['post_time']);
         return $item;
     } else {
         throw new RuntimeException('Resource not found', 404);
     }
 }
开发者ID:Okhoshi,项目名称:Claroline.REST-API-Plugin,代码行数:92,代码来源:clfrmwebservicecontroller.lib.php

示例13: claro_die

            // one, something weird is happening, indeed ...
            $allowed = FALSE;
            claro_die(get_lang('Not allowed'));
        }
        if (isset($_REQUEST['submit'])) {
            if (trim(strip_tags($message)) != '') {
                if (get_conf('allow_html') == 0 || isset($html)) {
                    $message = htmlspecialchars($message);
                }
                $lastName = claro_get_current_user_data('lastName');
                $firstName = claro_get_current_user_data('firstName');
                $poster_ip = $_SERVER['REMOTE_ADDR'];
                $time = date('Y-m-d H:i');
                create_new_post($topic_id, $forum_id, claro_get_current_user_id(), $time, $poster_ip, $lastName, $firstName, $message);
                // notify eventmanager that a new message has been posted
                $eventNotifier->notifyCourseEvent("forum_answer_topic", claro_get_current_course_id(), claro_get_current_tool_id(), $forum_id . "-" . $topic_id, claro_get_current_group_id(), "0");
                trig_topic_notification($topic_id);
            } else {
                $error = TRUE;
                $dialogBox->error(get_lang('You cannot post an empty message'));
            }
        }
    }
} else {
    // topic doesn't exist
    $error = 1;
    $dialogBox->error(get_lang('Not allowed'));
}
/*=================================================================
  Display Section
 =================================================================*/
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:reply.php

示例14: __construct

 public function __construct($groupId = null)
 {
     $groupId = empty($groupId) ? claro_get_current_group_id() : $groupId;
     parent::__construct($groupId);
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:5,代码来源:groupteam.lib.php

示例15: claro_get_current_course_id

        $exercise->setTimeLimit($_REQUEST['timeLimitMin'] * 60 + $_REQUEST['timeLimitSec']);
    } else {
        $exercise->setTimeLimit(0);
    }
    $exercise->setAttempts($_REQUEST['attempts']);
    $exercise->setAnonymousAttempts($_REQUEST['anonymousAttempts']);
    $exercise->setQuizEndMessage($_REQUEST['quizEndMessage']);
    if ($exercise->validate()) {
        if ($insertedId = $exercise->save()) {
            if (is_null($exId)) {
                $dialogBox->success(get_lang('Exercise added'));
                $eventNotifier->notifyCourseEvent("exercise_added", claro_get_current_course_id(), claro_get_current_tool_id(), $insertedId, claro_get_current_group_id(), "0");
                $exId = $insertedId;
            } else {
                $dialogBox->success(get_lang('Exercise modified'));
                $eventNotifier->notifyCourseEvent("exercise_updated", claro_get_current_course_id(), claro_get_current_tool_id(), $insertedId, claro_get_current_group_id(), "0");
            }
            $displaySettings = true;
        } else {
            // sql error in save() ?
            $cmd = 'rqEdit';
        }
    } else {
        if (claro_failure::get_last_failure() == 'exercise_no_title') {
            $dialogBox->error(get_lang('Field \'%name\' is required', array('%name' => get_lang('Title'))));
        } elseif (claro_failure::get_last_failure() == 'exercise_incorrect_dates') {
            $dialogBox->error(get_lang('Start date must be before end date ...'));
        }
        $cmd = 'rqEdit';
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:edit_exercise.php


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