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


PHP JoomdleHelperContent类代码示例

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


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

示例1: display

 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);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:28,代码来源:view.html.php

示例2: getOptions

 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);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:35,代码来源:courselist.php

示例3: get_correct_answer

 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;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:7,代码来源:question.raw.php

示例4: display

	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);
    }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:30,代码来源:view.html.php

示例5: display

 function display($tpl = null)
 {
     $this->courses = JoomdleHelperContent::getCourseList();
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:7,代码来源:view.html.php

示例6: display

 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;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:33,代码来源:view.pdf.php

示例7: display

 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);
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:12,代码来源:view.html.php

示例8: getOptions

 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;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:12,代码来源:courselist.php

示例9: plgSearchCoursetopics

 /**
  * 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;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:57,代码来源:coursetopics.php

示例10: onAfterRender

 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);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:14,代码来源:joomdlesession.php

示例11: fetchElement

 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);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:15,代码来源:role.php

示例12: getCats

 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;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:16,代码来源:questioncategorylist.php

示例13: getInput

 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);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:16,代码来源:course.php


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