Example #1
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->assignRef('params', $params);
     $user = JFactory::getUser();
     $username = $user->username;
     $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, $username);
     // user not enroled and no guest access
     if (!$this->course_info['enroled'] && !$this->course_info['guest']) {
         return;
     }
     $this->events = JoomdleHelperContent::getCourseEvents($id);
     $this->jump_url = JoomdleHelperContent::getJumpURL();
     $document = JFactory::getDocument();
     $document->setTitle($this->course_info['fullname'] . ': ' . JText::_('COM_JOOMDLE_EVENTS'));
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     parent::display($tpl);
 }
Example #2
0
 function display($tpl = null)
 {
     $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->student_no = JoomdleHelperContent::getCourseStudentsNo($id);
     $this->assignments = JoomdleHelperContent::getAssignmentSubmissions($id);
     $this->grades = JoomdleHelperContent::getAssignmentGrades($id);
     $this->daily_stats = JoomdleHelperContent::getCourseDailyStats($id);
     if (is_object($menu) && $menu->query['view'] != 'coursestats') {
         $pathway->addItem($this->course_info['fullname'], '');
     }
     $document = JFactory::getDocument();
     $document->setTitle($this->course_info['fullname'] . ': ' . JText::_('COM_JOOMDLE_STATS'));
     parent::display($tpl);
 }
Example #3
0
 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);
 }
Example #4
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->assignRef('params', $params);
     $enrollable_only = $params->get('enrollable_only');
     $show_buttons = $params->get('show_buttons');
     $sort_by = $params->get('sort_by', 'name');
     switch ($sort_by) {
         case 'date':
             $order = 'created DESC';
             break;
         case 'sortorder':
             $order = 'sortorder ASC';
             break;
         default:
             $order = 'fullname ASC';
             break;
     }
     $user = JFactory::getUser();
     $username = $user->username;
     if ($show_buttons && $username) {
         $this->cursos = JoomdleHelperContent::getCourseList((int) $enrollable_only, $order, 0, $username);
     } else {
         $this->cursos = JoomdleHelperContent::getCourseList((int) $enrollable_only, $order);
     }
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->_prepareDocument();
     parent::display($tpl);
 }
Example #5
0
 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);
 }
Example #6
0
 function getOptions()
 {
     // Base name of the HTML control.
     //    $ctrl  = $control_name .'['. $name .']';
     $courses = JoomdleHelperContent::getCourseList(0);
     // Construct an array of the HTML OPTION statements.
     $options = array();
     $c = array();
     foreach ($courses as $course) {
         $val = $course['remoteid'];
         $text = $course['fullname'];
         $options[] = JHtml::_('select.option', $val, $text);
         //		$op->id = $course['remoteid'];
         //		$op->text = $course['fullname'];
         //		$c[] = $op;
     }
     $options = array_merge(parent::getOptions(), $options);
     return $options;
     // Construct the various argument calls that are supported.
     $attribs = ' ';
     if ($v = $node->attributes('size')) {
         $attribs .= 'size="' . $v . '"';
     }
     if ($v = $node->attributes('class')) {
         $attribs .= 'class="' . $v . '"';
     } else {
         $attribs .= 'class="inputbox"';
     }
     if ($m = $node->attributes('multiple')) {
         $attribs .= ' multiple="multiple"';
         $ctrl .= '[]';
     }
     // Render the HTML SELECT list.
     return JHTML::_('select.genericlist', $options, $ctrl, $attribs, 'value', 'text', $value, $control_name . $name);
 }
Example #7
0
 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;
 }
Example #8
0
	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);
    }
Example #9
0
 function display($tpl = null)
 {
     $this->courses = JoomdleHelperContent::getCourseList();
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
Example #10
0
 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);
 }
Example #11
0
 function display($tpl = null)
 {
     global $mainframe;
     $app = JFactory::getApplication();
     $pathway = $app->getPathWay();
     $menus = $app->getMenu();
     $menu = $menus->getActive();
     // Load the form validation behavior
     JHTML::_('behavior.formvalidation');
     $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;
     }
     $user = JFactory::getUser();
     $username = $user->username;
     $this->course_info = JoomdleHelperContent::getCourseInfo($id, $username);
     /* pathway */
     $cat_slug = $this->course_info['cat_id'] . ":" . JFilterOutput::stringURLSafe($this->course_info['cat_name']);
     if (is_object($menu) && $menu->query['view'] != 'detail') {
         $pathway->addItem($this->course_info['cat_name'], 'index.php?view=coursecategory&cat_id=' . $cat_slug);
         $pathway->addItem($this->course_info['fullname'], '');
     }
     $document = JFactory::getDocument();
     $document->setTitle($this->course_info['fullname']);
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     parent::display($tpl);
 }
Example #12
0
 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;
 }
Example #13
0
	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');
    }
Example #14
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->assignRef('params', $params);
     $this->categories = JoomdleHelperContent::getCourseCategories();
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->_prepareDocument();
     parent::display($tpl);
 }
Example #15
0
 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);
 }
Example #16
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->assignRef('params', $params);
     $this->my_news = JoomdleHelperContent::getMyNews();
     $this->jump_url = JoomdleHelperContent::getJumpURL();
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->_prepareDocument();
     parent::display($tpl);
 }
Example #17
0
 function display($tpl = null)
 {
     $params = JComponentHelper::getParams('com_joomdle');
     if ($params->get('MOODLE_URL') == "") {
         echo "Joomdle is not configured yet. Please fill Moodle URL setting in Configuration";
         return;
     }
     $this->system_info = JoomdleHelperContent::check_joomdle_system();
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
Example #18
0
 function getOptions()
 {
     $courses = JoomdleHelperContent::getCourseList(0);
     $options = array();
     $c = array();
     foreach ($courses as $course) {
         $val = $course['remoteid'];
         $text = $course['fullname'];
         $options[] = JHtml::_('select.option', $val, $text);
     }
     return $options;
 }
Example #19
0
 function display($tpl = null)
 {
     $id = JRequest::getVar('course_id');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $course_info = JoomdleHelperContent::getCourseInfo((int) $id);
     $this->course_name = $course_info['fullname'];
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
Example #20
0
	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);

	if ($params->get('gradingsystem_show_items') == 0)
		$this->gcats = JoomdleHelperContent::getCourseGradeCategories($id);
	else
	{
		$this->gcats = JoomdleHelperContent::call_method('get_course_grade_categories_and_items', $id);
		$tpl = 'full';
	}

	/* 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);
    }
Example #21
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->assignRef('params', $params);
     $this->course_no = JoomdleHelperContent::getCoursesNo();
     //	$this->e_course_no = JoomdleHelperContent::getEnrollableCoursesNo();
     $this->student_no = JoomdleHelperContent::getStudentsNo();
     $this->assignments = JoomdleHelperContent::getAssignmentsNo();
     $this->stats = JoomdleHelperContent::getLastWeekStats();
     $this->cursos = JoomdleHelperContent::getCourseList(0);
     parent::display($tpl);
 }
Example #22
0
 /**
  * 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;
 }
Example #23
0
 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);
 }
Example #24
0
 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);
 }
Example #25
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     $mainframe = JFactory::getApplication();
     $id = JRequest::getVar('course_id');
     $comp_params = JComponentHelper::getParams('com_joomdle');
     $app_id = JRequest::getVar('app_id');
     $this->app_info = JoomdleHelperApplications::get_application_info($app_id);
     $app_user = JFactory::getUser($this->app_info['user_id']);
     $this->app_info['name'] = $app_user->name;
     $course_info = JoomdleHelperContent::getCourseInfo((int) $this->app_info['course_id']);
     $this->app_info['course'] = $course_info['fullname'];
     $this->addToolbar();
     parent::display($tpl);
 }
Example #26
0
 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 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;
 }
Example #28
0
 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);
 }
Example #29
0
 protected function getInput()
 {
     //		$class = ( $node->attributes('class') ? 'class="'.$node->attributes('class').'"' : 'class="inputbox"' );
     $attr = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
     $courses = JoomdleHelperContent::getCourseList(0);
     $options = array();
     if (is_array($courses)) {
         foreach ($courses as $course) {
             $val = $course['remoteid'];
             $text = $course['fullname'];
             $options[] = JHTML::_('select.option', $val, JText::_($text));
         }
     }
     array_unshift($options, JHTML::_('select.option', '0', '- ' . JText::_('COM_JOOMDLE_SELECT_COURSE') . ' -'));
     return JHTML::_('select.genericlist', $options, $this->name, $attr, 'value', 'text', $this->value, $this->id);
 }
Example #30
0
 function display($tpl = null)
 {
     $cursos = JoomdleHelperContent::getCourseList();
     $i = 0;
     $c = array();
     foreach ($cursos as $curso) {
         $c[$i] = new JObject();
         $c[$i]->id = $curso['remoteid'];
         $c[$i]->fullname = $curso['fullname'];
         $i++;
     }
     $this->courses = $c;
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }