本文整理汇总了PHP中JoomdleHelperContent::call_method方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomdleHelperContent::call_method方法的具体用法?PHP JoomdleHelperContent::call_method怎么用?PHP JoomdleHelperContent::call_method使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomdleHelperContent
的用法示例。
在下文中一共展示了JoomdleHelperContent::call_method方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: display
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);
}
示例3: 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');
}
示例4: 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;
}
示例5: 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;
}
示例6: 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);
}
示例7: 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);
}
示例8: getOptions
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;
}
示例9: 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;
}
示例10: plgSearchCourses
/**
* 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;
}
示例11: getOptions
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;
}
示例12: sync_course_forums
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']);
}
}
}
}
示例13: enrol_bundle
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);
}
示例14: defined
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'));
示例15: defined
* @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'));