本文整理汇总了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));
}
示例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);
}
示例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);
}