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


PHP CourseManager::count_courses方法代码示例

本文整理汇总了PHP中CourseManager::count_courses方法的典型用法代码示例。如果您正苦于以下问题:PHP CourseManager::count_courses方法的具体用法?PHP CourseManager::count_courses怎么用?PHP CourseManager::count_courses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CourseManager的用法示例。


在下文中一共展示了CourseManager::count_courses方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 /**
  * @Route("/{type}/{filter}", name="userportal")
  * @Method({"GET"})
  * @Security("has_role('ROLE_USER')")
  *
  * @param string $type courses|sessions|mycoursecategories
  * @param string $filter history|current for the userportal courses page
  * @param int $page
  *
  * @return Response
  */
 public function indexAction($type = 'courses', $filter = 'current', $coursePage = 1, Request $request)
 {
     //$settingsManager = $this->get('chamilo.settings.manager');
     //$setting = $settingsManager->getSetting('platform.institution');
     /*$settingsManagerCourse = $this->get('chamilo_course.settings.manager');
       $course = $this->getDoctrine()->getRepository('ChamiloCoreBundle:Course')->find(1);
       if ($course) {
           $settingsManagerCourse->setCourse($course);
           $agenda = $settingsManagerCourse->getSetting(
               'calendar_event.enabled'
           );
       }*/
     $user = $this->getUser();
     $pageController = new \Chamilo\CoreBundle\Framework\PageController();
     $items = null;
     $page = $coursePage;
     if (!empty($user)) {
         $userId = $user->getId();
         // Main courses and session list
         $type = str_replace('/', '', $type);
         switch ($type) {
             case 'sessions':
                 $items = $pageController->returnSessions($userId, $filter, $page);
                 break;
             case 'sessioncategories':
                 $items = $pageController->returnSessionsCategories($userId, $filter, $page);
                 break;
             case 'courses':
                 $items = $pageController->returnCourses($userId, $filter, $page);
                 break;
             case 'mycoursecategories':
                 $items = $pageController->returnMyCourseCategories($userId, $filter, $page);
                 break;
             case 'specialcourses':
                 $items = $pageController->returnSpecialCourses($userId, $filter, $page);
                 break;
         }
     }
     /** @var \Chamilo\SettingsBundle\Manager\SettingsManager $settingManager */
     $settingManager = $this->get('chamilo.settings.manager');
     /*var_dump($settingManager->getSetting('platform.institution'));
       $settings = $settingManager->loadSettings('platform');
       var_dump($settings->get('institution'));
       var_dump(api_get_setting('platform.institution'));*/
     $pageController->returnSkillsLinks();
     // Deleting the session_id.
     $request->getSession()->remove('session_id');
     $countCourses = \CourseManager::count_courses();
     return $this->render('ChamiloCoreBundle:Index:userportal.html.twig', array('content' => $items, 'count_courses' => $countCourses));
 }
开发者ID:daffef,项目名称:chamilo-lms,代码行数:61,代码来源:UserPortalController.php

示例2: return_welcome_to_course_block

 /**
  * Shows a welcome message when the user doesn't have any content in
  * the course list
  * @param object A Template object used to declare variables usable in the given template
  * @return void
  * @assert () === false
  */
 public function return_welcome_to_course_block($tpl)
 {
     if (empty($tpl)) {
         return false;
     }
     $count_courses = CourseManager::count_courses();
     $course_catalog_url = api_get_path(WEB_CODE_PATH) . 'auth/courses.php';
     $course_list_url = api_get_path(WEB_PATH) . 'user_portal.php';
     $tpl->assign('course_catalog_url', $course_catalog_url);
     $tpl->assign('course_list_url', $course_list_url);
     $tpl->assign('course_catalog_link', Display::url(get_lang('here'), $course_catalog_url));
     $tpl->assign('course_list_link', Display::url(get_lang('here'), $course_list_url));
     $tpl->assign('count_courses', $count_courses);
     $tpl->assign('welcome_to_course_block', 1);
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:22,代码来源:page.lib.php

示例3: return_welcome_to_course_block

    /**
     * Shows a welcome message when the user doesn't have any content in the course list
     */
    public function return_welcome_to_course_block()
    {
        $count_courses = CourseManager::count_courses();
        $tpl = $this->tpl->get_template('layout/welcome_to_course.tpl');

        $course_catalog_url = api_get_path(WEB_CODE_PATH).'auth/courses.php';
        $course_list_url = api_get_path(WEB_PATH).'user_portal.php';

        $this->tpl->assign('course_catalog_url', $course_catalog_url);
        $this->tpl->assign('course_list_url', $course_list_url);
        $this->tpl->assign('course_catalog_link', Display::url(get_lang('here'), $course_catalog_url));
        $this->tpl->assign('course_list_link', Display::url(get_lang('here'), $course_list_url));
        $this->tpl->assign('count_courses', $count_courses);

        return $this->tpl->fetch($tpl);
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:19,代码来源:userportal.lib.php


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