本文整理汇总了PHP中JoomdleHelperContent::getCourseCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP JoomdleHelperContent::getCourseCategories方法的具体用法?PHP JoomdleHelperContent::getCourseCategories怎么用?PHP JoomdleHelperContent::getCourseCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JoomdleHelperContent
的用法示例。
在下文中一共展示了JoomdleHelperContent::getCourseCategories方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 = 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);
}
示例2: getCats
function getCats($cat_id, $options = array(), $level = 0)
{
$cats = JoomdleHelperContent::getCourseCategories($cat_id);
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);
$options = $this->getCats($cat['id'], $options, $level + 1);
}
return $options;
}
示例3: foreach
echo $this->escape($this->params->get('page_heading'));
?>
</h1>
<?php
}
?>
<?php
$itemid = JoomdleHelperContent::getMenuItem();
$user = JFactory::getUser();
$username = $user->username;
if (is_array($this->categories)) {
foreach ($this->categories as $cat) {
$cursos = JoomdleHelperContent::getCourseCategory($cat['id'], '');
$cat_id = $cat['id'];
$categories = JoomdleHelperContent::getCourseCategories($cat_id);
if ((!is_array($cursos) || !count($cursos)) && (!is_array($categories) || !count($categories))) {
continue;
}
?>
<h4>
<?php
echo $cat['name'];
?>
</h4>
<?php
foreach ($cursos as $curso) {
?>
<div class="joomdle_course_list_item">
<div class="joomdle_item_title joomdle_course_list_item_title">