*                         multiple forums per group
 * - sticky messages
 * - new view option: nested view
 * - quoting a message
 *
 * @package chamilo.forum
 *
 * @todo several functions have to be moved to the itemmanager library
 * @todo displaying icons => display library
 * @todo complete the missing phpdoc the correct order should be
 */
use ChamiloSession as Session;
use Doctrine\Common\Collections\Criteria;
define('FORUM_NEW_POST', 0);
get_notifications_of_user();
$htmlHeadXtra[] = api_get_jquery_libraries_js(array('jquery-ui', 'jquery-upload'));
$htmlHeadXtra[] = '<script>

function check_unzip() {
    if (document.upload.unzip.checked){
        document.upload.if_exists[0].disabled=true;
        document.upload.if_exists[1].checked=true;
        document.upload.if_exists[2].disabled=true;
    } else {
        document.upload.if_exists[0].checked=true;
        document.upload.if_exists[0].disabled=false;
        document.upload.if_exists[2].disabled=false;
    }
}
function setFocus() {
    $("#title_file").focus();
Exemple #2
0
function api_get_jqgrid_js()
{
    return api_get_jquery_libraries_js(array('jqgrid'));
}
Exemple #3
0
<?php

/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Form\SessionType;
$cidReset = true;
// setting the section (for the tabs)
SessionManager::protect_session_edit();
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Sessions'));
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
$htmlHeadXtra[] = api_get_jquery_libraries_js(array('jquery-ui-i18n'));
$htmlHeadXtra = api_get_datetime_picker_js($htmlHeadXtra);
$id = null;
$urlAction = api_get_self();
if (isset($_GET['id'])) {
    $id = intval($_GET['id']);
    $urlAction = '?id=' . $id;
}
$add_coach = null;
if ($id) {
    $tool_name = get_lang('EditSession');
    SessionManager::protect_session_edit($id);
    $session_info = api_get_session_info($id);
    if (!empty($session_info['id_coach'])) {
        $user_info = api_get_user_info($session_info['id_coach']);
        $add_coach = '$("#coach_id").trigger("addItem", [{"title": "' . $user_info['complete_name'] . '", "value": "' . $session_info['id_coach'] . '"}]);';
    }
    $button = get_lang('Update');
} else {
    $tool_name = get_lang('AddSession');
 /**
  * @param \Silex\Application $app
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function indexAction(Application $app)
 {
     $template = $this->getTemplate();
     /*$user = $this->getManager()->getRepository('Entity\User')->find(1);
       foreach($user->getPortals() as $portal) {
           var_dump($portal->getUrl());
       }*/
     /*
             $token = $app['security']->getToken();
             if (null !== $token) {
                 $user = $token->getUser();
             }*/
     /*\ChamiloSession::write('name', 'clara');
       var_dump(\ChamiloSession::read('name'));
       var_dump($_SESSION['name']);*/
     //var_dump(\ChamiloSession::read('aaa'));
     /*\ChamiloSession::write('name', 'clar');
       echo \ChamiloSession::read('name');
       $app['session']->set('name', 'julio');
       echo $app['session']->get('name');*/
     /*
             $token = $app['security']->getToken();
             if (null !== $token) {
                 $user = $token->getUser();
                 var_dump($user );
             }
             if ($app['security']->isGranted('ROLE_ADMIN')) {
             }*/
     /** @var \Entity\User $user */
     /*$em = $app['orm.ems']['db_write'];
       $user = $em->getRepository('Entity\User')->find(6);
       $role = $em->getRepository('Entity\Role')->findOneByRole('ROLE_STUDENT');
       $user->getRolesObj()->add($role);
       $em->persist($user);
       $em->flush();*/
     //$user->roles->add($status);
     /*$roles = $user->getRolesObj();
       foreach ($roles as $role) {
       }*/
     // $countries = Intl::getRegionBundle()->getCountryNames('es');
     //var_dump($countries);
     /*$formatter = new \IntlDateFormatter(\Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE);
       //http://userguide.icu-project.org/formatparse/datetime for date formats
       $formatter->setPattern("EEEE d MMMM Y");
       echo $formatter->format(time());*/
     //@todo improve this JS includes should be added using twig
     $extra = array(api_get_jquery_libraries_js(array('bxslider')), '<script>
         $(document).ready(function(){
             $("#slider").bxSlider({
                 infiniteLoop	: true,
                 auto			: true,
                 pager			: true,
                 autoHover		: true,
             pause			: 10000
             });
         });
         </script>');
     if (api_get_setting('use_virtual_keyboard') == 'true') {
         $extra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH) . 'javascript/keyboard/keyboard.css');
         $extra[] = api_get_js('keyboard/jquery.keyboard.js');
     }
     $app['extraJS'] = $extra;
     $app['this_section'] = SECTION_CAMPUS;
     $request = $app['request'];
     if (api_get_setting('allow_terms_conditions') == 'true') {
         unset($_SESSION['term_and_condition']);
     }
     // If we are not logged in and custompages activated
     if (!api_get_user_id() && \CustomPages::enabled()) {
         $loggedOut = $request->get('loggedout');
         if ($loggedOut) {
             \CustomPages::display(\CustomPages::LOGGED_OUT);
         } else {
             \CustomPages::display(\CustomPages::INDEX_UNLOGGED);
         }
     }
     /** @var \PageController $pageController */
     $pageController = $app['page_controller'];
     if (api_get_setting('display_categories_on_homepage') == 'true') {
         $template->assign('course_category_block', $pageController->return_courses_in_categories());
     }
     // @todo Custom Facebook connection lib could be replaced with opauth
     // Facebook connection, if activated
     if (api_is_facebook_auth_activated() && !api_get_user_id()) {
         facebook_connect();
     }
     $this->setLoginForm($app);
     if (!api_is_anonymous()) {
         $pageController->setProfileBlock();
         $pageController->setUserImageBlock();
         if (api_is_platform_admin()) {
             $pageController->setCourseBlock();
         } else {
             $pageController->return_teacher_link();
         }
     }
     // Hot courses & announcements
     $hotCourses = null;
     $announcementsBlock = null;
     // When loading a chamilo page do not include the hot courses and news
     if (!isset($_REQUEST['include'])) {
         if (api_get_setting('show_hot_courses') == 'true') {
             $hotCourses = $pageController->returnHotCourses();
         }
         $announcementsBlock = $pageController->return_announcements();
     }
     $template->assign('hot_courses', $hotCourses);
     $template->assign('announcements_block', $announcementsBlock);
     // Homepage
     $template->assign('home_page_block', $pageController->returnHomePage());
     // Navigation links
     $pageController->returnNavigationLinks($template->getNavigationLinks());
     $pageController->returnNotice();
     $pageController->returnHelp();
     if (api_is_platform_admin() || api_is_drh()) {
         $pageController->returnSkillsLinks();
     }
     $response = $template->renderLayout('layout_2_col.tpl');
     return new Response($response, 200, array());
 }
function api_get_datepicker_js()
{
    return api_get_jquery_libraries_js(array('datepicker'));
}
Exemple #6
0
use ChamiloSession as Session;
define('CHAMILO_HOMEPAGE', true);
$language_file = array('courses', 'index', 'userInfo');
/* Flag forcing the 'current course' reset, as we're not inside a course anymore. */
// Maybe we should change this into an api function? an example: CourseManager::unset();
$cidReset = true;
require_once 'main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'userportal.lib.php';
require_once 'main/chat/chat_functions.lib.php';
// The section (for the tabs).
$this_section = SECTION_CAMPUS;
$header_title = null;
if (!api_is_anonymous()) {
    $header_title = " ";
}
$htmlHeadXtra[] = api_get_jquery_libraries_js(array('bxslider'));
$htmlHeadXtra[] = '
<script type="text/javascript">
    $(document).ready(function(){
        $("#slider").bxSlider({
            infiniteLoop : true,
            auto : true,
            pager : true,
            autoHover : true,
            pause : 10000
        });
    });
</script>';
$controller = new IndexManager($header_title);
//Actions
$loginFailed = isset($_GET['loginFailed']) ? true : isset($loginFailed);