本文整理汇总了PHP中JoomdleHelperContent::getCourseList方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomdleHelperContent::getCourseList方法的具体用法?PHP JoomdleHelperContent::getCourseList怎么用?PHP JoomdleHelperContent::getCourseList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomdleHelperContent
的用法示例。
在下文中一共展示了JoomdleHelperContent::getCourseList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$this->courses = JoomdleHelperContent::getCourseList();
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
parent::display($tpl);
}
示例2: display
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);
}
示例3: 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);
}
示例4: 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;
}
示例5: 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);
}
示例6: getHikashopCourses
static function getHikashopCourses()
{
$cursos = JoomdleHelperContent::getCourseList(0);
$c = array();
$i = 0;
if (!is_array($cursos)) {
return $c;
}
foreach ($cursos as $curso) {
$c[$i] = new JObject();
$c[$i]->id = $curso['remoteid'];
$c[$i]->fullname = $curso['fullname'];
$c[$i]->published = JoomdleHelperShop::is_course_on_sell_on_hikashop($curso['remoteid']);
$i++;
}
return $c;
}
示例7: add_general_list_members
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;
}
}
示例8: array
$order = 'created DESC';
break;
case 'sortorder':
$order = 'sortorder ASC';
break;
default:
$order = 'fullname ASC';
break;
}
if ($params->get('latest courses only')) {
$cursos = JoomdleHelperContent::getCourseList(0, $order, $guest_courses_only);
$limit = $params->get('latest courses only');
} else {
//$cursos = JoomdleHelperContent::getCourseList ( 0, 'fullname ASC', $guest_courses_only);
//$cursos = JoomdleHelperContent::getCourseList ( 0, 'sortorder ASC', $guest_courses_only);
$cursos = JoomdleHelperContent::getCourseList(0, $order, $guest_courses_only);
$limit = PHP_INT_MAX;
//no limit
}
//print_r ($cursos);
if ($params->get('courses_shown')) {
if (is_array($params->get('courses_shown'))) {
$courses_shown = $params->get('courses_shown');
} else {
$courses_shown = array($params->get('courses_shown'));
}
$cursos = modJoomdleCoursesHelper::filter_by_value($cursos, 'remoteid', $courses_shown);
}
if ($params->get('categories_shown')) {
if (is_array($params->get('categories_shown'))) {
$cats_shown = $params->get('categories_shown');