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


PHP JoomdleHelperContent::getMyCourses方法代码示例

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


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

示例1: display

	function display($tpl = null) {
	global $mainframe;

	$app        = JFactory::getApplication();
    $params = $app->getParams();
    $this->assignRef('params',              $params);


	$group_by_category = $params->get( 'group_by_category' );

	$user = JFactory::getUser();
	$username = $user->username;
	if ($group_by_category)
		$this->my_courses = JoomdleHelperContent::call_method ('my_courses', $username, 1);
	else
		$this->my_courses = JoomdleHelperContent::getMyCourses();

	$this->jump_url =  JoomdleHelperContent::getJumpURL ();

	$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));

	$this->_prepareDocument();


	if ($group_by_category)
		$tpl =  "cats";

	if ($this->my_courses)
		parent::display($tpl);
	else
		echo $params->get('nocourses_text');
    }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:32,代码来源:view.html.php

示例2: getChildren

 static function getChildren()
 {
     $user = JFactory::getUser();
     $id = $user->get('id');
     $username = $user->get('username');
     $db = JFactory::getDBO();
     $sql = "SELECT * from #__users" . " WHERE params LIKE '%parent_id\":\"{$id}\"%'";
     $db->setQuery($sql);
     $users = $db->loadObjectList();
     if (!$users) {
         return array();
     }
     $j = 0;
     foreach ($users as $child) {
         $c[$j]['id'] = $child->id;
         $c[$j]['name'] = $child->name;
         $courses = JoomdleHelperContent::getMyCourses($child->username);
         $i = 0;
         $user_courses = array();
         if (is_array($courses) && count($courses)) {
             foreach ($courses as $course) {
                 $user_courses[$i] = $course['id'];
                 $i++;
             }
         }
         $c[$j]['courses'] = $user_courses;
         $j++;
     }
     return $c;
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:30,代码来源:parents.php

示例3: foreach

	' FROM #__session' .
	' WHERE userid =';
$query .= "'$id'";
$db->setQuery($query);
$sessions = $db->loadObjectList();

if ($db->getErrorNum()) {
	JError::raiseWarning( 500, $db->stderr() );
}

if (count($sessions))
foreach ($sessions as $session)
	$token = md5 ($session->session_id);

if (!$user->guest) {
	$cursos = JoomdleHelperContent::getMyCourses();


	if (is_array ($cursos))
	{
		foreach ($cursos as $id => $curso) {
			$cursosid[]['id'] = $curso['id'];
		}
	}
	else $cursos = array ();

	$eventos = JoomdleHelperContent::call_method ("my_events", $username, $cursosid);
}
else 
{
	$eventos = JoomdleHelperContent::call_method ("my_events", 'admin', array ( 0 => array ('id' => 1)));
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:31,代码来源:mod_joomdle_calendar.php

示例4: remove_list_member

 static function remove_list_member($username, $course_id, $type)
 {
     $list_id = JoomdleHelperMailinglist::get_course_list_id($course_id, $type);
     $user_id = JUserHelper::getUserId($username);
     // Remove from general list if necessary
     $remove = false;
     $glist_id = JoomdleHelperMailinglist::get_general_list_id($type);
     if ($glist_id) {
         //Only remove if user has no more course enrolments of this type
         switch ($type) {
             case 'course_students':
                 $my_courses = JoomdleHelperContent::getMyCourses($username);
                 if (count($my_courses) == 0) {
                     $remove = true;
                 }
                 break;
             case 'course_teachers':
                 $my_courses = JoomdleHelperContent::call_method('teacher_courses', $username);
                 if (count($my_courses) == 0) {
                     $remove = true;
                 }
                 break;
         }
     }
     JoomdleHelperMailinglist::remove_sub($list_id, $user_id);
     if ($remove) {
         JoomdleHelperMailinglist::remove_sub($glist_id, $user_id);
     }
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:29,代码来源:mailinglist.php

示例5: childrenCheckboxes

 static function childrenCheckboxes($course_id)
 {
     $params = JComponentHelper::getParams('com_joomdle');
     $assign_courses_include_parent = $params->get('assign_courses_include_parent');
     // Add current user if configured
     if ($assign_courses_include_parent) {
         $user = JFactory::getUser();
         $courses = JoomdleHelperContent::getMyCourses($user->username);
         $disabled = false;
         if (is_array($courses) && count($courses)) {
             foreach ($courses as $course) {
                 if ($course['id'] == $course_id) {
                     $disabled = true;
                     break;
                 }
             }
         }
         JoomdleHelperParents::childrenCheckbox($user->id, $course_id, $disabled);
         echo $user->name;
         if ($disabled) {
             echo " " . JText::_('COM_JOOMDLE_ALREADY_ENROLED');
         }
         echo "<br>";
     }
     $children = JoomdleHelperParents::getChildren();
     foreach ($children as $child) {
         if (in_array($course_id, $child['courses'])) {
             $disabled = true;
         } else {
             $disabled = false;
         }
         JoomdleHelperParents::childrenCheckbox($child['id'], $course_id, $disabled);
         echo $child['name'];
         if ($disabled) {
             echo " " . JText::_('COM_JOOMDLE_ALREADY_ENROLED');
         }
         echo "<br>";
     }
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:39,代码来源:parents.php


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