function display($tpl = null) { global $mainframe; $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $user = JFactory::getUser(); $username = $user->username; $this->child = JFactory::getUser($username); $layout = $params->get('layout'); $this->tasks = JoomdleHelperContent::call_method("get_children_grade_user_report", $username); $tpl = "catspdf"; $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->_prepareDocument(); $htmlcontent = parent::loadTemplate($tpl); require_once JPATH_SITE . '/libraries/tcpdf/tcpdf.php'; $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $header = JText::_('COM_JOOMDLE_GRADES'); $pdf->SetHeaderData('', 0, $header); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFontSubsetting(false); $pdf->SetFont('times', '', 8); // add a page $pdf->AddPage("L"); // output the HTML content $pdf->writeHTML($htmlcontent, true, 0, true, 0); $pdf->Output("grades.pdf", 'D'); exit; }
function display($tpl = null) { $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $this->course_id = $params->get('course_id'); if (!$this->course_id) { $this->course_id = JRequest::getVar('course_id'); } $this->course_id = (int) $this->course_id; // Only for logged users $user = JFactory::getUser(); $username = $user->username; if (!$username) { return; } if (!$this->course_id) { echo JText::_('COM_JOOMDLE_NO_COURSE_SELECTED'); return; } $this->course_info = JoomdleHelperContent::getCourseInfo($this->course_id, $username); // user not enroled if (!$this->course_info['enroled']) { return; } $document = JFactory::getDocument(); $document->setTitle($this->course_info['fullname'] . ': ' . JText::_('COM_JOOMDLE_GRADES')); $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); // $this->gcats = JoomdleHelperContent::call_method ("get_course_grades_by_category", $this->course_id, $username); $this->gcats = JoomdleHelperContent::call_method("get_grade_user_report", $this->course_id, $username); $tpl = "cats"; parent::display($tpl); }
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'); }
public function get_correct_answer() { $question_id = JRequest::getVar('question_id', ''); $answer_id = JoomdleHelperContent::call_method('quiz_get_correct_answer', (int) $question_id); echo $answer_id; exit; }
function display($tpl = null) { global $mainframe; $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $user = JFactory::getUser(); $username = JRequest::getVar ('child_username'); $layout = $params->get('layout'); $user = JFactory::getUser (); $username = $user->username; if ($layout == 'basic') { $this->tasks = JoomdleHelperContent::call_method ("get_children_grades", $username); } else { $this->tasks = JoomdleHelperContent::call_method ("get_children_grade_user_report", $username); $tpl = 'cats'; } $this->_prepareDocument(); parent::display($tpl); }
function display($tpl = null) { global $mainframe; $app = JFactory::getApplication(); $pathway = $app->getPathWay(); $app = JFactory::getApplication(); $menus = $app->getMenu(); $menu = $menus->getActive(); $params = $app->getParams(); $this->assignRef('params', $params); $id = JRequest::getVar('id'); $id = (int) $id; if (!$id) { echo JText::_('COM_JOOMDLE_NO_COURSE_SELECTED'); return; } $this->rubrics = JoomdleHelperContent::call_method('get_rubrics', $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'] != 'coursegradecategories') { $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_GRADING_SYSTEM'), ''); } $document = JFactory::getDocument(); $document->setTitle($this->course_info['fullname'] . ': ' . JText::_('COM_JOOMDLE_GRADING_SYSTEM')); */ $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); parent::display($tpl); }
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 = JRequest::getVar('cat_id'); if (!$id) { $id = $params->get('cat_id'); } $id = (int) $id; if (!$id) { echo JText::_('COM_JOOMDLE_NO_CATEGORY_SELECTED'); return; } $this->cat_id = $id; $this->cat_name = JoomdleHelperContent::call_method('get_cat_name', $id); $user = JFactory::getUser(); $username = $user->username; $this->cursos = JoomdleHelperContent::getCourseCategory($id, $username); $this->categories = JoomdleHelperContent::getCourseCategories($id); if (is_object($menu) && $menu->query['view'] != 'coursecategory') { $pathway->addItem($this->cat_name, ''); } $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $document = JFactory::getDocument(); $document->setTitle($this->cat_name); parent::display($tpl); }
function display($tpl = null) { $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $this->course_id = $params->get('course_id'); if (!$this->course_id) { $this->course_id = JRequest::getVar('course_id'); } $this->course_id = (int) $this->course_id; // Only for logged users $user = JFactory::getUser(); $username = $user->username; if (!$username) { return; } if (!$this->course_id) { echo JText::_('COM_JOOMDLE_NO_COURSE_SELECTED'); return; } $this->course_info = JoomdleHelperContent::getCourseInfo($this->course_id, $username); // user not enroled if (!$this->course_info['enroled']) { return; } $document = JFactory::getDocument(); $document->setTitle($this->course_info['fullname'] . ': ' . JText::_('COM_JOOMDLE_GRADES')); $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); // $this->gcats = JoomdleHelperContent::call_method ("get_course_grades_by_category", $this->course_id, $username); $this->gcats = JoomdleHelperContent::call_method("get_grade_user_report", $this->course_id, $username); $tpl = "catspdf"; $this->_prepareDocument(); $htmlcontent = parent::loadTemplate($tpl); require_once JPATH_SITE . '/libraries/tcpdf/tcpdf.php'; $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $header = $this->course_info['fullname']; $header2 = JText::_('COM_JOOMDLEGRADES_TEACHER') . ': ' . $user->name; $header2 .= ' ' . JText::_('COM_JOOMDLEGRADES_DATE') . ': ' . date('d-m-Y'); // $pdf->SetHeaderData('', 0, $header, $header2); $pdf->SetHeaderData('', 0, $header); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFontSubsetting(false); $pdf->SetFont('times', '', 8); // add a page $pdf->AddPage("L"); // output the HTML content $pdf->writeHTML($htmlcontent, true, 0, true, 0); $pdf->Output("grades.pdf", 'D'); exit; //parent::display($tpl); }
/** * Joomdle Course Topics Search method * * The sql must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav */ function plgSearchCoursetopics($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDBO(); $user = JFactory::getUser(); $username = $user->get('username'); $session = JFactory::getSession(); $token = md5($session->getId()); if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->plgSearchCoursetopicsAreas()))) { return array(); } } // load plugin params info $plugin = JPluginHelper::getPlugin('search', 'coursetopics'); $params = JComponentHelper::getParams('com_joomdle'); $moodle_xmlrpc_server_url = $params->get('MOODLE_URL') . '/mnet/xmlrpc/server.php'; //$moodle_url = $params->get( 'MOODLE_URL' ); $moodle_auth_land_url = $params->get('MOODLE_URL') . '/auth/joomdle/land.php'; if ($params->get('linkstarget') == 'wrapper') { $open_in_wrapper = 1; } else { $open_in_wrapper = 0; } $limit = $this->params->def('search_limit', 50); $text = trim($text); if ($text == '') { return array(); } $section = JText::_('COM_JOOMDLE_COURSETOPICS'); $rows = JoomdleHelperContent::call_method("search_topics", $text, $phrase, $ordering, (string) $limit); $i = 0; if (!is_array($rows)) { return array(); } $rows_result = array(); foreach ($rows as $key => $row) { $cat_slug = $row['cat_id'] . "-" . $row['cat_name']; $course_slug = $row['remoteid'] . "-" . $row['fullname']; $rows_result[$i] = new JObject(); $rows_result[$i]->href = 'index.php?option=com_joomdle&view=topics&cat_id=' . $cat_slug . '&course_id=' . $course_slug; $id = $row['remoteid']; $rows_result[$i]->title = substr(strip_tags($row['summary']), 0, 50); $rows_result[$i]->section = JText::_('COM_JOOMDLE_COURSES') . ' / ' . $row['fullname']; $rows_result[$i]->created = ""; $rows_result[$i]->browsernav = '2'; // 1 = new window, 2 = same window $rows_result[$i]->text = $row['summary']; $i++; } return $rows_result; }
function display($tpl = null) { $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $chars = JRequest::getVar('start_chars'); if (!$chars) { $chars = $params->get('start_chars'); } $this->teachers = JoomdleHelperContent::call_method('teachers_abc', $chars); $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->_prepareDocument(); parent::display($tpl); }
function onAfterRender() { $mainframe = JFactory::getApplication(); if ($mainframe->isAdmin()) { return; } $logged_user = JFactory::getUser(); $user_id = $logged_user->id; /* Don't update guest sessions */ if (!$user_id) { return; } $reply = JoomdleHelperContent::call_method("update_session", $logged_user->username); }
function fetchElement($name, $value, &$node, $control_name) { $class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="inputbox"'; $roles = JoomdleHelperContent::call_method('get_roles'); $options = array(); if (is_array($roles)) { foreach ($roles as $role) { $val = $role['id']; $text = $role['name']; $options[] = JHTML::_('select.option', $val, JText::_($text)); } } array_unshift($options, JHTML::_('select.option', '0', '- ' . JText::_('CJ SELECT ROLE') . ' -')); return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . ']', $class, 'value', 'text', $value, $control_name . $name); }
function display($tpl = null) { $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $chars = JRequest::getVar('start_chars'); if (!$chars) { $chars = $params->get('start_chars', 'ABC'); } $user = JFactory::getUser(); $username = $user->username; $this->cursos = JoomdleHelperContent::call_method('courses_abc', $chars, $username); $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->_prepareDocument(); parent::display($tpl); }
function getOptions() { $roles = JoomdleHelperContent::call_method('get_roles'); $options = array(); $option['value'] = 0; $option['text'] = JText::_('COM_JOOMDLE_SELECT_ROLE'); $options[] = $option; if (is_array($roles)) { foreach ($roles as $role) { $option['value'] = $role['id']; $option['text'] = $role['name']; $options[] = $option; } } return $options; }
function getCats($options = array(), $level = 0) { $cats = JoomdleHelperContent::call_method('quiz_get_question_categories'); if (!is_array($cats)) { return $options; } foreach ($cats as $cat) { $val = $cat['id']; $text = $cat['name']; for ($i = 0; $i < $level; $i++) { $text = "-" . $text; } $options[] = JHTML::_('select.option', $val, $text); } return $options; }
function display($tpl = null) { global $mainframe; $course_id = JRequest::getVar('course_id'); if (!$course_id) { $course_id = $params->get('course_id'); } $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $this->course_info = JoomdleHelperContent::getCourseInfo($course_id); $this->users = JoomdleHelperContent::call_method('get_course_students', (int) $course_id); $document = JFactory::getDocument(); $document->setTitle($this->course_info['fullname'] . ': ' . JText::_('COM_JOOMDLE_STUDENTS')); $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); parent::display($tpl); }
/** * Joomdle Courses Search method * * The sql must return the following fields that are used in a common display * routine: href, title, section, created, text, browsernav */ function plgSearchCourses($text, $phrase = '', $ordering = '', $areas = null) { $db = JFactory::getDBO(); $user = JFactory::getUser(); if (is_array($areas)) { if (!array_intersect($areas, array_keys($this->plgSearchCoursesAreas()))) { return array(); } } // load plugin params info $plugin = JPluginHelper::getPlugin('search', 'courses'); // $pluginParams = new JParameter( $plugin->params ); $params = JComponentHelper::getParams('com_joomdle'); $moodle_xmlrpc_server_url = $params->get('MOODLE_URL') . '/mnet/xmlrpc/server.php'; // $limit = $pluginParams->def( 'search_limit', 50 ); $limit = $this->params->def('search_limit', 50); $text = trim($text); if ($text == '') { return array(); } $section = JText::_('COM_JOOMDLE_COURSES'); $rows = JoomdleHelperContent::call_method("search_courses", $text, $phrase, $ordering, (string) $limit); $i = 0; if (!is_array($rows)) { return array(); } $rows_result = array(); foreach ($rows as $key => $row) { $cat_slug = $row['cat_id'] . "-" . $row['cat_name']; $course_slug = $row['remoteid'] . "-" . $row['fullname']; $rows_result[$i] = new JObject(); $rows_result[$i]->href = 'index.php?option=com_joomdle&view=detail&cat_id=' . $cat_slug . '&course_id=' . $course_slug; $rows_result[$i]->title = $row['fullname']; $rows_result[$i]->section = JText::_('COM_JOOMDLE_COURSES') . ' / ' . $row['cat_name']; $rows_result[$i]->created = ""; $rows_result[$i]->browsernav = '2'; // 1 = new window, 2 = same window $rows_result[$i]->text = $row['summary']; $i++; } return $rows_result; }
function display($tpl = null) { global $mainframe; $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $user = JFactory::getUser(); $id = $user->get('id'); $username = $user->get('username'); $layout = $params->get('layout'); if ($layout == 'basic') { $this->tasks = JoomdleHelperContent::call_method("get_my_grades", $username); } else { $this->tasks = JoomdleHelperContent::call_method("get_my_grade_user_report", $username); $tpl = 'cats'; } $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); $this->_prepareDocument(); parent::display($tpl); }
function display($tpl = null) { global $mainframe; $app = JFactory::getApplication(); $pathway = $app->getPathWay(); $app = JFactory::getApplication(); $menus = $app->getMenu(); $menu = $menus->getActive(); $params = $app->getParams(); $this->assignRef('params', $params); $id = JRequest::getVar('course_id'); if (!$id) { $id = $params->get('course_id'); } $id = (int) $id; if (!$id) { echo JText::_('COM_JOOMDLE_NO_COURSE_SELECTED'); return; } $user = JFactory::getUser(); $username = $user->username; $this->course_info = JoomdleHelperContent::getCourseInfo($id, $username); $this->is_enroled = $this->course_info['enroled']; if ($this->is_enroled) { $this->mods = JoomdleHelperContent::call_method('get_course_mods', (int) $id, $username); } else { $this->mods = JoomdleHelperContent::call_method('get_course_mods', (int) $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'] != 'course') { $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_CONTENTS'), ''); } $document = JFactory::getDocument(); $document->setTitle($this->course_info['fullname']); $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); parent::display($tpl); }
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); $course_id = JRequest::getVar('course_id'); if (!$course_id) { echo JText::_('COM_JOOMDLE_NO_COURSE_SELECTED'); return; } $id = JRequest::getVar('id'); $id = (int) $id; if (!$id) { echo JText::_('COM_JOOMDLE_NO_NEWS_ITEM_SELECTED'); return; } $user = JFactory::getUser(); $username = $user->username; $this->course_info = JoomdleHelperContent::getCourseInfo($course_id, $username); // user not enroled and no guest access if (!$this->course_info['enroled'] && !$this->course_info['guest']) { return; } $this->news_item = JoomdleHelperContent::call_method('get_news_item', (int) $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'] != 'newsitem') { $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_CONTENTS'), 'index.php?view=course&cat_id=' . $cat_slug . '&course_id=' . $course_slug); $pathway->addItem($this->news_item[0]['subject'], ''); } $document = JFactory::getDocument(); $document->setTitle($this->course_info['fullname'] . ': ' . $this->news_item[0]['subject']); parent::display($tpl); }
function display($tpl = null) { global $mainframe; $app = JFactory::getApplication(); $params = $app->getParams(); $this->assignRef('params', $params); $username = JRequest::getVar('username'); if (!$username) { $username = $params->get('username'); } if (!$username) { echo JText::_('COM_JOOMDLE_NO_USER_SELECTED'); return; } $this->courses = JoomdleHelperContent::call_method('teacher_courses', $username); $this->username = $username; $this->user_info = JoomdleHelperMappings::get_user_info_for_joomla($this->username); $document = JFactory::getDocument(); $document->setTitle($this->user_info['name']); $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); parent::display($tpl); }
function getOptions() { $options = array(); $val = ''; $text = JText::_('COM_JOOMDLE_DEFAULT'); $options[] = JHtml::_('select.option', $val, $text); // If Joomdle not configured, return $params = JComponentHelper::getParams('com_joomdle'); if ($params->get('MOODLE_URL') == "") { return $options; } // If any fatal error in system check, return if (!JoomdleHelperContent::system_ok()) { return $options; } $themes = JoomdleHelperContent::call_method('get_themes'); $c = array(); foreach ($themes as $theme) { $val = $theme['name']; $text = $theme['name']; $options[] = JHtml::_('select.option', $val, $text); } return $options; }
static function sync_course_forums($course_id) { // Create user groups $course_info = JoomdleHelperContent::getCourseInfo($course_id); JoomdleHelperJoomlagroups::add_course_groups($course_id, $course_info['fullname']); JoomdleHelperJoomlagroups::sync_group_members($course_id); // Create parent category JoomdleHelperForum::add_forum($course_id, -2, $course_info['fullname']); $sections = JoomdleHelperContent::call_method('get_course_mods', (int) $course_id, ''); foreach ($sections as $section) { foreach ($section['mods'] as $mod) { if ($mod['mod'] == 'forum' && $mod['type'] != 'news') { JoomdleHelperForum::add_forum($course_id, $mod['id'], $mod['name']); } } } }
static function enrol_bundle($username, $sku) { $user_id = JUserHelper::getUserId($username); $user = JFactory::getUser($user_id); $email = $user->email; $bundle_id = substr($sku, 7); $bundle = JoomdleHelperShop::get_bundle_info($bundle_id); $courses = explode(',', $bundle['courses']); $comp_params = JComponentHelper::getParams('com_joomdle'); $send_bundle_emails = $comp_params->get('send_bundle_emails'); $c = array(); foreach ($courses as $course_id) { if ($send_bundle_emails) { JoomdleHelperShop::send_confirmation_email($email, $course_id); } $course['id'] = (int) $course_id; $c[] = $course; } JoomdleHelperContent::call_method('multiple_enrol', $username, $c, 5); }
defined('_JEXEC') or die('Restricted access'); require_once(JPATH_SITE.'/components/com_joomdle/helpers/content.php'); // Include the whosonline functions only once require_once (dirname(__FILE__).'/helper.php'); $comp_params = JComponentHelper::getParams( 'com_joomdle' ); $moodle_xmlrpc_server_url = $comp_params->get( 'MOODLE_URL' ).'/mnet/xmlrpc/server.php'; $moodle_auth_land_url = $comp_params->get( 'MOODLE_URL' ).'/auth/joomdle/land.php'; $linkstarget = $comp_params->get( 'linkstarget' ); $show_averages = $params->get( 'show_averages' ); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $itemid = JoomdleHelperContent::getMenuItem(); $user = JFactory::getUser(); $id = $user->get('id'); $username = $user->get('username'); $limit = $params->get('last_grade_limit', 10); if ($username) $tareas = JoomdleHelperContent::call_method ("get_last_user_grades", $username, (int) $limit); else $tareas = array (); require(JModuleHelper::getLayoutPath('mod_joomdle_my_grades'));
* @copyright Copyright (C) 2009 - 2010 Antonio Duran Terres * @license GNU/GPL, see LICENSE.php * Joomla! is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ // no direct access defined('_JEXEC') or die('Restricted access'); require_once (dirname(__FILE__).'/helper.php'); $limit = $params->get( 'limit' ); $tooltips = $params->get('use_tooltips', 1); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $course_id = JRequest::getVar ('course_id', 0, 'int'); if (!$course_id) $course_id = JRequest::getVar ('id', 0, 'int'); // Don't show if no course id selected if (!$course_id) return; $users = JoomdleHelperContent::call_method('get_course_students', (int) $course_id); require(JModuleHelper::getLayoutPath('mod_joomdle_coursemates'));
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))); } require(JModuleHelper::getLayoutPath('mod_joomdle_calendar'));
require_once (dirname(__FILE__).'/helper.php'); require_once(JPATH_SITE.'/components/com_joomdle/helpers/content.php'); $comp_params = JComponentHelper::getParams( 'com_joomdle' ); $moodle_xmlrpc_server_url = $comp_params->get( 'MOODLE_URL' ).'/mnet/xmlrpc/server.php'; $moodle_auth_land_url = $comp_params->get( 'MOODLE_URL' ).'/auth/joomdle/land.php'; $moodle_url = $comp_params->get( 'MOODLE_URL' ); $linkstarget = $comp_params->get( 'linkstarget' ); $default_itemid = $comp_params->get( 'default_itemid' ); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); $user = JFactory::getUser(); $username = $user->get('username'); if (!$username) return; $session = JFactory::getSession(); $token = md5 ($session->getId()); $mentees = JoomdleHelperContent::call_method ( 'get_mentees', $username); if (!count ($mentees)) return; require(JModuleHelper::getLayoutPath('mod_joomdle_mentees'));
static function add_general_list_members($type) { $list_id = JoomdleHelperMailinglist::get_general_list_id($type); switch ($type) { case 'course_students': $courses = JoomdleHelperContent::getCourseList(); foreach ($courses as $course) { $teachers = array(); $course_id = $course['remoteid']; $students = JoomdleHelperContent::call_method('get_course_students', $course_id); foreach ($students as $student) { $user_id = JUserHelper::getUserId($student['username']); //JoomdleHelperAcymailing::add_sub ($list_id, $user_id); JoomdleHelperMailinglist::add_sub($list_id, $user_id); } } break; case 'course_teachers': $courses = JoomdleHelperContent::getCourseList(); foreach ($courses as $course) { $teachers = array(); $course_id = $course['remoteid']; $teachers = JoomdleHelperContent::call_method('get_course_editing_teachers', $course_id); foreach ($teachers as $teacher) { $user_id = JUserHelper::getUserId($teacher['username']); //JoomdleHelperAcymailing::add_sub ($list_id, $user_id); JoomdleHelperMailinglist::add_sub($list_id, $user_id); } } break; case 'course_parents': $parents = JoomdleHelperContent::call_method('get_all_parents'); foreach ($parents as $parent) { $user_id = JUserHelper::getUserId($parent['username']); JoomdleHelperMailinglist::add_sub($list_id, $user_id); } break; default: break; } }
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'); } }