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


PHP JoomdleHelperContent::getCourseCategories方法代码示例

本文整理汇总了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);
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:32,代码来源:view.html.php

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

示例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">
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:31,代码来源:default.php


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