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


PHP JoomdleHelperContent::getCourseTeachers方法代码示例

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


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

示例1: display

 function display($tpl = null)
 {
     global $mainframe;
     $app = JFactory::getApplication();
     $pathway = $app->getPathWay();
     $menus = $app->getMenu();
     $menu = $menus->getActive();
     $params = $app->getParams();
     $this->assignRef('params', $params);
     $id = $params->get('course_id');
     if (!$id) {
         $id = JRequest::getVar('course_id');
     }
     $id = (int) $id;
     if (!$id) {
         echo JText::_('COM_JOOMDLE_NO_COURSE_SELECTED');
         return;
     }
     $this->course_info = JoomdleHelperContent::getCourseInfo($id);
     $this->teachers = JoomdleHelperContent::getCourseTeachers($id);
     /* pathway */
     $cat_slug = $this->course_info['cat_id'] . ":" . $this->course_info['cat_name'];
     $course_slug = $this->course_info['remoteid'] . ":" . $this->course_info['fullname'];
     if (is_object($menu) && $menu->query['view'] != 'teachers') {
         $pathway->addItem($this->course_info['cat_name'], 'index.php?view=coursecategory&cat_id=' . $cat_slug);
         $pathway->addItem($this->course_info['fullname'], 'index.php?view=detail&cat_id=' . $cat_slug . '&course_id=' . $course_slug);
         $pathway->addItem(JText::_('COM_JOOMDLE_COURSE_TEACHERS'), '');
     }
     $document = JFactory::getDocument();
     $document->setTitle($this->course_info['fullname'] . ': ' . JText::_('COM_JOOMDLE_TEACHERS'));
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     parent::display($tpl);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:33,代码来源:view.html.php

示例2: add_forum_k2

 static function add_forum_k2($course_id, $forum_id, $forum_name)
 {
     if (!JoomdleHelperForum::forum_exists($course_id, $forum_id)) {
         $data = new KunenaForumCategory();
         if ($forum_id != -2) {
             // id=-2 indicates main course forum category
             $data->parent_id = JoomdleHelperForum::get_parent_id($course_id);
         } else {
             $data->parent_id = JoomdleHelperForum::get_main_category();
         }
         $data->name = $forum_name;
         $data->alias = '';
         $data->published = 1;
         $group_id = JoomdleHelperJoomlagroups::get_course_group_id($course_id, 'students');
         $data->pub_access = $group_id;
         $group_id = JoomdleHelperJoomlagroups::get_course_group_id($course_id, 'teachers');
         $data->admin_access = $group_id;
         $data->accesstype = 'joomla.group';
         $data->save();
         $db = JFactory::getDBO();
         $kunena_forum_id = $data->id;
         // Add to joomdle xref table
         $jf_row = new JoomdleTableForums($db);
         $forum_data['course_id'] = $course_id;
         $forum_data['moodle_forum_id'] = $forum_id;
         $forum_data['kunena_forum_id'] = $kunena_forum_id;
         $jf_row->save($forum_data);
     }
     // Get all course teachers and set them as moderators
     $teachers = JoomdleHelperContent::getCourseTeachers($course_id);
     foreach ($teachers as $teacher) {
         JoomdleHelperForum::add_moderator($course_id, $forum_id, $teacher['username']);
     }
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:34,代码来源:forum.php

示例3: sync_group_members

 static function sync_group_members($course_id)
 {
     $group_id = JoomdleHelperJoomlagroups::get_course_group_id($course_id, 'students');
     // Fetch students
     $students = JoomdleHelperContent::call_method('get_course_students', (int) $course_id);
     foreach ($students as $student) {
         JoomdleHelperJoomlagroups::add_group_member($course_id, $student['username'], 'students');
     }
     $group_id = JoomdleHelperJoomlagroups::get_course_group_id($course_id, 'teachers');
     // Fetch teachers
     $teachers = JoomdleHelperContent::getCourseTeachers($course_id);
     foreach ($teachers as $teacher) {
         JoomdleHelperJoomlagroups::add_group_member($course_id, $teacher['username'], 'teachers');
     }
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:15,代码来源:joomlagroups.php


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