當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。