本文整理汇总了PHP中JoomdleHelperContent::getCourseInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomdleHelperContent::getCourseInfo方法的具体用法?PHP JoomdleHelperContent::getCourseInfo怎么用?PHP JoomdleHelperContent::getCourseInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomdleHelperContent
的用法示例。
在下文中一共展示了JoomdleHelperContent::getCourseInfo方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
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);
}
示例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 = "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);
}
示例3: display
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);
}
示例4: display
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);
}
示例5: getUnassignedCourses
static function getUnassignedCourses()
{
$user = JFactory::getUser();
$id = $user->get('id');
$username = $user->get('username');
$db = JFactory::getDBO();
$sql = "SELECT * from #__joomdle_purchased_courses" . " WHERE user_id = '{$id}' and num > 0";
$db->setQuery($sql);
$courses = $db->loadObjectList();
$i = 0;
if (!$courses) {
return array();
}
foreach ($courses as $course) {
$course_info = JoomdleHelperContent::getCourseInfo((int) $course->course_id);
$c[$i]['id'] = $course->course_id;
$c[$i]['num'] = $course->num;
$c[$i]['name'] = $course_info['fullname'];
$i++;
}
return $c;
}
示例6: 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']);
}
}
}
}
示例7: send_confirmation_email
static function send_confirmation_email($email, $course_id)
{
$app = JFactory::getApplication();
$comp_params = JComponentHelper::getParams('com_joomdle');
$linkstarget = $comp_params->get('linkstarget');
$moodle_url = $comp_params->get('MOODLE_URL');
$email_subject = $comp_params->get('enrol_email_subject');
$email_text = $comp_params->get('enrol_email_text');
if ($linkstarget == 'wrapper') {
/* XXX After and hour tryng and searching I could not find the GOOD way
to do this, so I do this kludge and it seems to work ;)
*/
$url = JURI::base();
$pos = strpos($url, '/administrator/');
if ($pos) {
$url = substr($url, 0, $pos);
}
$url = trim($url, '/');
$url = $url . '/index.php?option=com_joomdle&view=wrapper&moodle_page_type=course&id=' . $course_id;
// $default_itemid = $comp_params->get( 'default_itemid' );
// $url .= "&Itemid=".$default_itemid;
} else {
$url = $moodle_url . '/course/view.php?id=' . $course_id;
}
$course_info = JoomdleHelperContent::getCourseInfo((int) $course_id);
$name = $course_info['fullname'];
$email_text = str_replace('COURSE_NAME', $name, $email_text);
$email_text = str_replace('COURSE_URL', $url, $email_text);
$email_subject = str_replace('COURSE_NAME', $name, $email_subject);
$email_subject = str_replace('COURSE_URL', $url, $email_subject);
// Set the e-mail parameters
$from = $app->getCfg('mailfrom');
$fromname = $app->getCfg('fromname');
// Send the e-mail
if (!JFactory::getMailer()->sendMail($from, $fromname, $email, $email_subject, $email_text)) {
return false;
}
return true;
}
示例8: send_confirmation_email
static function send_confirmation_email($username, $email, $course_id, $state)
{
$app = JFactory::getApplication();
$comp_params = JComponentHelper::getParams('com_joomdle');
$linkstarget = $comp_params->get('linkstarget');
$moodle_url = $comp_params->get('MOODLE_URL');
$user_id = JUserHelper::getUserId($username);
$user = JFactory::getUser($user_id);
if ($linkstarget == 'wrapper') {
/* XXX After and hour tryng and searching I could not find the GOOD way
to do this, so I do this kludge and it seems to work ;)
*/
$url = JURI::base();
$pos = strpos($url, '/administrator/');
if ($pos) {
$url = substr($url, 0, $pos);
}
$url = $url . '/index.php?option=com_joomdle&view=wrapper&moodle_page_type=course&id=' . $course_id;
} else {
$url = $moodle_url . '/course/view.php?id=' . $course_id;
}
$course_info = JoomdleHelperContent::getCourseInfo((int) $course_id);
$name = $course_info['fullname'];
/* Set language for email to the one chosen by user */
$user_lang = $user->getParam('language', '');
$default_language = JComponentHelper::getParams('com_languages')->get('administrator');
if ($user_lang) {
$lang = new JLanguage($user_lang);
$lang->load('com_joomdle', JPATH_ADMINISTRATOR, $user_lang, true);
} else {
$lang = JLanguage::getInstance($default_language);
}
// Set the e-mail parameters
$from = $app->getCfg('mailfrom');
$fromname = $app->getCfg('fromname');
switch ($state) {
case JOOMDLE_APPLICATION_STATE_APPROVED:
$subject = JText::sprintf('COM_JOOMDLE_APPLICATION_ACCEPTED_MESSAGE_SUBJECT', $name);
$body = JText::sprintf($lang->_('COM_JOOMDLE_APPLICATION_ACCEPTED_MESSAGE_BODY'), $user->name, $name);
break;
case JOOMDLE_APPLICATION_STATE_REJECTED:
$subject = JText::sprintf('COM_JOOMDLE_APPLICATION_REJECTED_MESSAGE_SUBJECT', $name);
$body = JText::sprintf($lang->_('COM_JOOMDLE_APPLICATION_REJECTED_MESSAGE_BODY'), $user->name, $name);
break;
}
// Send the e-mail
if (!JFactory::getMailer()->sendMail($from, $fromname, $email, $subject, $body)) {
$this->setError('ERROR_SENDING_CONFIRMATION_EMAIL');
return false;
}
return true;
}
示例9: save_course_mailing_list
static function save_course_mailing_list($course_id, $type = 'course_students')
{
$db = JFactory::getDBO();
//XXX checkar q no existe ya
$comp_params = JComponentHelper::getParams('com_joomdle');
$ml = $comp_params->get('mailing_list_integration');
$type_str = JoomdleHelperMailinglist::get_type_str($type);
// Add to mailing list component
$course_info = JoomdleHelperContent::getCourseInfo($course_id);
switch ($ml) {
case 'acymailing':
$list_id = JoomdleHelperAcymailing::save_list($course_info['fullname'] . $type_str, $course_info['summary']);
break;
default:
// No component selected, do nothing
return;
}
// Add to joomdle table
$mlist = new JObject();
$mlist->course_id = $course_id;
$mlist->list_id = $list_id;
$mlist->type = $type;
$status = $db->insertObject('#__joomdle_mailinglists', $mlist);
// Add all course members to list
JoomdleHelperMailinglist::add_list_members($course_id, $type);
}