本文整理汇总了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');
}
示例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;
}
示例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)));
示例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);
}
}
示例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>";
}
}