Пример #1
0
 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
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     $this->assignRef('params', $params);
     $this->categories = JoomdleHelperContent::getCourseCategories();
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->_prepareDocument();
     parent::display($tpl);
 }
Пример #3
0
 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;
 }
Пример #4
0
    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">