parent
a869edf5c8
commit
6af9760bfa
@ -0,0 +1,38 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CoreBundle\Admin; |
||||
|
||||
use Sonata\AdminBundle\Admin\Admin; |
||||
use Sonata\AdminBundle\Form\FormMapper; |
||||
use Sonata\AdminBundle\Datagrid\DatagridMapper; |
||||
use Sonata\AdminBundle\Datagrid\ListMapper; |
||||
use Sonata\AdminBundle\Show\ShowMapper; |
||||
|
||||
use Knp\Menu\ItemInterface as MenuItemInterface; |
||||
|
||||
class BranchAdmin extends Admin |
||||
{ |
||||
// Fields to be shown on create/edit forms |
||||
protected function configureFormFields(FormMapper $formMapper) |
||||
{ |
||||
$formMapper |
||||
->add('id') |
||||
; |
||||
} |
||||
|
||||
// Fields to be shown on filter forms |
||||
protected function configureDatagridFilters(DatagridMapper $datagridMapper) |
||||
{ |
||||
$datagridMapper |
||||
->add('id') |
||||
; |
||||
} |
||||
|
||||
// Fields to be shown on lists |
||||
protected function configureListFields(ListMapper $listMapper) |
||||
{ |
||||
$listMapper |
||||
->addIdentifier('id') |
||||
; |
||||
} |
||||
} |
@ -0,0 +1,48 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CoreBundle\Admin; |
||||
|
||||
use Sonata\AdminBundle\Admin\Admin; |
||||
use Sonata\AdminBundle\Form\FormMapper; |
||||
use Sonata\AdminBundle\Datagrid\DatagridMapper; |
||||
use Sonata\AdminBundle\Datagrid\ListMapper; |
||||
use Sonata\AdminBundle\Show\ShowMapper; |
||||
|
||||
use Knp\Menu\ItemInterface as MenuItemInterface; |
||||
|
||||
/** |
||||
* Class CourseAdmin |
||||
* @package ChamiloLMS\CoreBundle\Admin |
||||
*/ |
||||
class CourseAdmin extends Admin |
||||
{ |
||||
// Fields to be shown on create/edit forms |
||||
protected function configureFormFields(FormMapper $formMapper) |
||||
{ |
||||
$formMapper |
||||
->add('id', 'text', array('label' => 'Course')) |
||||
//->add('author', 'entity', array('class' => 'Acme\DemoBundle\Entity\User')) |
||||
->add('code') //if no type is specified, SonataAdminBundle tries to guess it |
||||
->add('title') |
||||
; |
||||
} |
||||
|
||||
// Fields to be shown on filter forms |
||||
protected function configureDatagridFilters(DatagridMapper $datagridMapper) |
||||
{ |
||||
$datagridMapper |
||||
->add('id') |
||||
->add('code') |
||||
; |
||||
} |
||||
|
||||
// Fields to be shown on lists |
||||
protected function configureListFields(ListMapper $listMapper) |
||||
{ |
||||
$listMapper |
||||
->addIdentifier('id') |
||||
->add('code') |
||||
->add('title') |
||||
; |
||||
} |
||||
} |
@ -0,0 +1,64 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CoreBundle\Admin; |
||||
|
||||
use Sonata\AdminBundle\Admin\Admin; |
||||
use Sonata\AdminBundle\Form\FormMapper; |
||||
use Sonata\AdminBundle\Datagrid\DatagridMapper; |
||||
use Sonata\AdminBundle\Datagrid\ListMapper; |
||||
use Sonata\AdminBundle\Show\ShowMapper; |
||||
|
||||
use Knp\Menu\ItemInterface as MenuItemInterface; |
||||
|
||||
/** |
||||
* Class SessionAdmin |
||||
* @package ChamiloLMS\CoreBundle\Admin |
||||
*/ |
||||
class SessionAdmin extends Admin |
||||
{ |
||||
// Fields to be shown on create/edit forms |
||||
protected function configureFormFields(FormMapper $formMapper) |
||||
{ |
||||
$formMapper |
||||
->add('id', 'text', array('label' => 'Session')) |
||||
->add('name') //if no type is specified, SonataAdminBundle tries to guess it |
||||
->add('display_start_date', 'sonata_type_date_picker') |
||||
->add('generalCoach') |
||||
; |
||||
|
||||
/*->add('student', 'sonata_type_model', array(), |
||||
array( |
||||
'admin_code' => 'application.subscriber.admin.student' |
||||
))*/ |
||||
} |
||||
|
||||
protected function configureShowField(ShowMapper $showMapper) |
||||
{ |
||||
$showMapper |
||||
->add('id', 'text', array('label' => 'Session')) |
||||
->add('name') //if no type is specified, SonataAdminBundle tries to guess it |
||||
->add('display_start_date', 'sonata_type_date_picker') |
||||
; |
||||
} |
||||
|
||||
|
||||
// Fields to be shown on filter forms |
||||
protected function configureDatagridFilters(DatagridMapper $datagridMapper) |
||||
{ |
||||
$datagridMapper |
||||
->add('id') |
||||
->add('name') |
||||
//->add('display_start_date', 'sonata_type_date_picker') |
||||
; |
||||
} |
||||
|
||||
// Fields to be shown on lists |
||||
protected function configureListFields(ListMapper $listMapper) |
||||
{ |
||||
$listMapper |
||||
->addIdentifier('id') |
||||
->add('name') |
||||
//->add('display_start_date', 'sonata_type_date_picker') |
||||
; |
||||
} |
||||
} |
@ -1,47 +0,0 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace ChamiloLMS\CoreBundle\Controller\Admin\Administrator; |
||||
|
||||
use ChamiloLMS\CoreBundle\Controller\CrudController; |
||||
use ChamiloLMS\CoreBundle\Entity; |
||||
|
||||
/** |
||||
* Class RoleController |
||||
* @package ChamiloLMS\CoreBundle\Controller\Admin\Administrator |
||||
* @author Julio Montoya <gugli100@gmail.com> |
||||
*/ |
||||
class RoleController extends CrudController |
||||
{ |
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function getClass() |
||||
{ |
||||
return 'ChamiloLMS\CoreBundle\Entity\Role'; |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function getType() |
||||
{ |
||||
return 'ChamiloLMS\CoreBundle\Form\RoleType'; |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
/*public function getControllerAlias() |
||||
{ |
||||
return 'role.controller'; |
||||
}*/ |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
/*public function getTemplatePath() |
||||
{ |
||||
return 'admin/administrator/role/'; |
||||
}*/ |
||||
} |
@ -0,0 +1,13 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CoreBundle\Controller; |
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
||||
use Symfony\Component\HttpFoundation\Response; |
||||
use Sonata\AdminBundle\Controller\CRUDController as Controller; |
||||
|
||||
class CourseAdminController extends Controller |
||||
{ |
||||
|
||||
} |
@ -0,0 +1,13 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CoreBundle\Controller; |
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
||||
use Symfony\Component\HttpFoundation\Response; |
||||
use Sonata\AdminBundle\Controller\CRUDController as Controller; |
||||
|
||||
class SessionAdminController extends Controller |
||||
{ |
||||
|
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,120 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CoreBundle\DataFixtures\ORM; |
||||
|
||||
use Doctrine\Common\DataFixtures\FixtureInterface; |
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface; |
||||
use Doctrine\Common\DataFixtures\AbstractFixture; |
||||
use Doctrine\Common\Persistence\ObjectManager; |
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
||||
use Symfony\Component\DependencyInjection\ContainerInterface; |
||||
|
||||
class LoadUserData extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface |
||||
{ |
||||
private $container; |
||||
|
||||
function getOrder() |
||||
{ |
||||
return 1; |
||||
} |
||||
|
||||
public function setContainer(ContainerInterface $container = null) |
||||
{ |
||||
$this->container = $container; |
||||
} |
||||
|
||||
/** |
||||
* @param ObjectManager $manager |
||||
*/ |
||||
public function load(ObjectManager $manager) |
||||
{ |
||||
$manager = $this->getUserManager(); |
||||
$groupManager = $this->getGroupManager(); |
||||
$faker = $this->getFaker(); |
||||
|
||||
// Creating groups |
||||
$studentGroup = $groupManager->createGroup('students'); |
||||
$studentGroup->addRole('ROLE_STUDENT'); |
||||
|
||||
$groupManager->updateGroup($studentGroup); |
||||
|
||||
$teacherGroup = $groupManager->createGroup('teachers'); |
||||
$teacherGroup->addRole('ROLE_TEACHER'); |
||||
$groupManager->updateGroup($teacherGroup); |
||||
|
||||
// Creating admin user. |
||||
$user = $manager->createUser(); |
||||
|
||||
$user->setUsername('admin'); |
||||
$user->setUserId(1); |
||||
$user->setFirstname('Jane'); |
||||
$user->setLastname('Doe'); |
||||
$user->setEmail($faker->safeEmail); |
||||
$user->setPlainPassword('admin'); |
||||
$user->setEnabled(true); |
||||
$user->setSuperAdmin(true); |
||||
$user->setLocked(false); |
||||
|
||||
$manager->updateUser($user); |
||||
|
||||
// Creating student user. |
||||
|
||||
$user = $manager->createUser(); |
||||
$user->setUserId(2); |
||||
$user->setFirstname('student'); |
||||
$user->setLastname('student'); |
||||
//$user->setPhone($faker->phoneNumber); |
||||
$user->setUsername('student'); |
||||
$user->setEmail($faker->safeEmail); |
||||
$user->setPlainPassword('student'); |
||||
$user->setEnabled(true); |
||||
$user->setLocked(false); |
||||
|
||||
$user->addGroup($studentGroup); |
||||
|
||||
$manager->updateUser($user); |
||||
|
||||
// Creating random student users. |
||||
foreach (range(2, 100) as $id) { |
||||
$user = $manager->createUser(); |
||||
$user->setUserId($id); |
||||
$user->setFirstname($faker->firstName); |
||||
$user->setLastname($faker->lastName); |
||||
//$user->setPhone($faker->phoneNumber); |
||||
$user->setUsername($faker->userName); |
||||
$user->setEmail($faker->safeEmail); |
||||
$user->setPlainPassword($faker->randomNumber()); |
||||
$user->setEnabled(true); |
||||
$user->setLocked(false); |
||||
|
||||
$user->addGroup($studentGroup); |
||||
|
||||
$manager->updateUser($user); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* @return \FOS\UserBundle\Model\UserManagerInterface |
||||
*/ |
||||
public function getUserManager() |
||||
{ |
||||
return $this->container->get('fos_user.user_manager'); |
||||
} |
||||
|
||||
/** |
||||
* @return \FOS\UserBundle\Entity\GroupManager |
||||
*/ |
||||
public function getGroupManager() |
||||
{ |
||||
return $this->container->get('fos_user.group_manager'); |
||||
} |
||||
|
||||
/** |
||||
* @return \Faker\Generator |
||||
*/ |
||||
public function getFaker() |
||||
{ |
||||
return $this->container->get('faker.generator'); |
||||
} |
||||
} |
@ -0,0 +1,22 @@ |
||||
services: |
||||
sonata.admin.course: |
||||
class: ChamiloLMS\CoreBundle\Admin\CourseAdmin |
||||
tags: |
||||
- { name: sonata.admin, manager_type: orm, group: "LMS", label: "Course" } |
||||
arguments: |
||||
- ~ |
||||
- ChamiloLMS\CoreBundle\Entity\Course |
||||
- ~ |
||||
calls: |
||||
- [ setTranslationDomain, [ChamiloLMSCoreBundle]] |
||||
|
||||
sonata.admin.session: |
||||
class: ChamiloLMS\CoreBundle\Admin\SessionAdmin |
||||
tags: |
||||
- { name: sonata.admin, manager_type: orm, group: "LMS", label: "Session" } |
||||
arguments: |
||||
- ~ |
||||
- ChamiloLMS\CoreBundle\Entity\Session |
||||
- ~ |
||||
calls: |
||||
- [ setTranslationDomain, [ChamiloLMSCoreBundle]] |
@ -0,0 +1,247 @@ |
||||
/* |
||||
* Helpers |
||||
*/ |
||||
.number { |
||||
text-align: right !important; |
||||
} |
||||
.truncate { |
||||
white-space: nowrap; |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
} |
||||
|
||||
/* |
||||
* Sonata Demo |
||||
*/ |
||||
|
||||
@media screen and (min-width: 1200px) { |
||||
.sonata-bc .container { |
||||
max-width: 970px; |
||||
} |
||||
} |
||||
|
||||
.sonata-bc .page-header .nav { |
||||
clear: both; |
||||
} |
||||
|
||||
.sonata-bc .block-newsletter { |
||||
text-align: center; |
||||
margin-top: 10px; |
||||
} |
||||
|
||||
.sonata-bc .block-newsletter > div.col-sm-6 { |
||||
min-height: 155px; |
||||
} |
||||
|
||||
.sonata-bc .block-newsletter input[type="email"] { |
||||
margin-bottom: 0px; |
||||
} |
||||
|
||||
.sonata-bc .block-newsletter p { |
||||
font-size: 14px; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.sonata-bc #newsletter-confirmation { |
||||
margin-top: 20px; |
||||
} |
||||
|
||||
.sonata-bc .page-footer { |
||||
background-color: #dedede; |
||||
margin: 0px; |
||||
} |
||||
|
||||
.sonata-bc .page-footer ul li { |
||||
list-style: none; |
||||
text-align: left; |
||||
line-height: 25px; |
||||
} |
||||
|
||||
.sonata-bc .page-footer p.handcraft { |
||||
margin-top: 80px; |
||||
} |
||||
|
||||
.sonata-bc .page-header .col-sm-4, .sonata-bc .welcome { |
||||
padding-left: 0px; |
||||
} |
||||
|
||||
.sonata-bc .nivoGallery ul img { |
||||
max-height: none; |
||||
} |
||||
|
||||
.sonata_breadcrumb .breadcrumb>li+li:before { |
||||
content: "\00BB"; |
||||
} |
||||
|
||||
form div.alert ~ .form-actions { |
||||
min-height: 54px; |
||||
} |
||||
|
||||
form .form-actions { |
||||
min-height: 48px; |
||||
} |
||||
|
||||
/* |
||||
* Basket |
||||
*/ |
||||
table.basket thead tr { |
||||
background-color: #428bca; |
||||
color: #ffffff; |
||||
} |
||||
|
||||
table.basket thead tr th { |
||||
text-align: center; |
||||
} |
||||
|
||||
table.basket .unavailable .help-inline { |
||||
color: #b94a48; |
||||
font-weight: bold; |
||||
vertical-align: inherit; |
||||
} |
||||
|
||||
.checkbox input[type="checkbox"] { |
||||
float: none; |
||||
} |
||||
|
||||
.sonata-bc .demonstration-bar { |
||||
position: static; |
||||
width: 100%; |
||||
z-index: 999; |
||||
background-color: #000000; |
||||
color: #ffffff; |
||||
opacity: 0.8; |
||||
min-height: 30px; |
||||
padding-top: 5px; |
||||
text-align: center; |
||||
font-size: 1em; |
||||
} |
||||
|
||||
.sonata-bc #add_basket_modal { |
||||
top: 15%; |
||||
} |
||||
|
||||
/* |
||||
* Product catalog |
||||
*/ |
||||
.sonata-product-navigation-bar { |
||||
margin-bottom: 30px; |
||||
} |
||||
.sonata-product-navigation-bar .pagination { |
||||
margin: 0 !important; |
||||
} |
||||
.no-products-available { |
||||
padding: 100px; |
||||
font-weight: bold; |
||||
text-align: center; |
||||
} |
||||
|
||||
/* |
||||
* Product catalog menu |
||||
*/ |
||||
div.col-sm-3 div.list-group a.lead.list-group-item:first-child { |
||||
margin-top: 0px; |
||||
} |
||||
|
||||
div.col-sm-3 div.list-group a.lead.list-group-item { |
||||
margin-top: 20px; |
||||
} |
||||
|
||||
div.col-sm-3 div.list-group a:not(.lead).list-group-item, |
||||
div.col-sm-3 div.list-group div.menu_level_1, |
||||
div.col-sm-3 div.list-group div.menu_level_2, |
||||
div.col-sm-3 div.list-group div.menu_level_3, |
||||
div.col-sm-3 div.list-group div.menu_level_4 { |
||||
width: 96%; |
||||
margin-left: 4%; |
||||
} |
||||
|
||||
/* |
||||
* Product grid |
||||
*/ |
||||
.product-grid { |
||||
padding: 10px 0px 10px 0px; |
||||
} |
||||
.product-grid .thumbnail { |
||||
margin-bottom: 20px; |
||||
} |
||||
.product-grid .product-thumbnail { |
||||
min-height: 100px; |
||||
max-height: 100px; |
||||
text-align: center; |
||||
} |
||||
.product-grid .col-sm-3 { |
||||
min-height: 175px; |
||||
padding-right: 15px; |
||||
padding-left: 15px; |
||||
} |
||||
.product-grid .col-sm-3 .panel .panel-body, |
||||
.product-grid .col-sm-4 .panel .panel-body { |
||||
padding: 0px; |
||||
} |
||||
.product-grid .col-sm-3 .panel .panel-body img.img-responsive, |
||||
.product-grid .col-sm-4 .panel .panel-body img.img-responsive { |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
} |
||||
|
||||
/* Small resolution */ |
||||
@media(max-width:767px) { |
||||
.product-grid .col-sm-3 { |
||||
margin-top: 30px; |
||||
min-width: 250px; |
||||
} |
||||
.product-grid li:not(:last-child) { |
||||
margin-top: 0px; |
||||
} |
||||
} |
||||
|
||||
/* Extra-small resolution */ |
||||
@media(max-width:475px) { |
||||
.product-grid li:not(:last-child) { |
||||
margin-top: 25px; |
||||
} |
||||
|
||||
.product-grid li:first-child { |
||||
margin-top: 0px; |
||||
} |
||||
} |
||||
|
||||
.product-grid .col-sm-3:first-line { |
||||
margin-top: 10px; |
||||
} |
||||
|
||||
/* |
||||
* Product slider thumbnails |
||||
*/ |
||||
|
||||
div#slider-thumbs ul.list-inline { |
||||
width: 620px; |
||||
} |
||||
|
||||
div#slider-thumbs ul li { |
||||
padding-left: 0px; |
||||
margin-bottom: 10px; |
||||
} |
||||
|
||||
/* |
||||
* News |
||||
*/ |
||||
h2.sonata-blog-post-title { |
||||
font-size: 22px; |
||||
} |
||||
|
||||
.sonata-blog-post-abtract { |
||||
margin-top: 10px; |
||||
} |
||||
|
||||
.sonata-blog-post-list hr { |
||||
margin: 20px 0px 5px 0px; |
||||
} |
||||
|
||||
/* |
||||
* Comments |
||||
*/ |
||||
|
||||
.fos_comment_comment_show { |
||||
border-top: 1px solid #ccc; |
||||
} |
@ -1,8 +0,0 @@ |
||||
<div class="container-fluid"> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
{% block main_content %} |
||||
{% endblock %} |
||||
</div> |
||||
</div> |
||||
</div> |
@ -1,83 +0,0 @@ |
||||
{% block topbar %} |
||||
<nav class="navbar navbar-default navbar-fixed-top" role="navigation"> |
||||
<!-- Brand and toggle get grouped for better mobile display --> |
||||
<div class="navbar-header"> |
||||
<button type="button" class="navbar-toggle" |
||||
data-toggle="collapse" data-target=".navbar-ex1-collapse"> |
||||
<span class="sr-only">Toggle navigation</span> |
||||
<span class="icon-bar"></span> |
||||
<span class="icon-bar"></span> |
||||
<span class="icon-bar"></span> |
||||
</button> |
||||
<a class="navbar-brand" href="#">Chamilo</a> |
||||
</div> |
||||
|
||||
<!-- Collect the nav links, forms, and other content for toggling --> |
||||
<div class="collapse navbar-collapse navbar-ex1-collapse"> |
||||
{{ knp_menu_render('ChamiloLMSCoreBundle:Builder:leftMenu', { 'style': 'navbar' }) }} |
||||
<form class="navbar-form navbar-left" role="search"> |
||||
<div class="form-group"> |
||||
<input type="text" class="form-control" placeholder="Search"> |
||||
</div> |
||||
<button type="submit" class="btn btn-default">Submit</button> |
||||
</form> |
||||
{{ knp_menu_render('ChamiloLMSCoreBundle:Builder:rightMenu', { 'style': 'navbar-right' }) }} |
||||
</div><!-- /.navbar-collapse --> |
||||
</nav> |
||||
|
||||
{% endblock %} |
||||
<div class="container-fluid"> |
||||
<div class="row"> |
||||
<div class="col-sm-3 col-md-2 sidebar"> |
||||
{% block sidebar %} |
||||
{{ sonata_block_render({ 'type': 'sonata.block.service.course'}) }} |
||||
|
||||
{{ sonata_block_render({ 'type': 'sonata.block.service.text' }, { |
||||
'content': 'Empty block 2' |
||||
}) }} |
||||
|
||||
{{ sonata_block_render({ 'type': 'sonata.block.service.menu' }, { |
||||
'menu_name': 'ChamiloLMSCoreBundle:Builder:profileMenu', |
||||
}) }} |
||||
|
||||
{{ sonata_block_render({ 'type': 'sonata.block.service.menu' }, { |
||||
'menu_name': 'ChamiloLMSCoreBundle:Builder:courseMenu', |
||||
}) }} |
||||
|
||||
{% include "@template_style/layout/sidebar.tpl" %} |
||||
|
||||
{# course navigation links/shortcuts need to be activated by the admin #} |
||||
{% include "@template_style/layout/course_navigation.tpl" %} |
||||
{% endblock %} |
||||
</div> |
||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> |
||||
{% block main_content %} |
||||
{% if plugin_content_top %} |
||||
<div id="plugin_content_top" class="col-lg-10 col-sm-11"> |
||||
{{ plugin_content_top}} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{% include "@template_style/layout/page_body.tpl" %} |
||||
{% block content %} |
||||
{% autoescape false %} |
||||
{% if content is not null %} |
||||
{{ content }} |
||||
{% endif %} |
||||
{% endautoescape %} |
||||
{% endblock %} |
||||
|
||||
{# Plugin bottom #} |
||||
{% if plugin_content_bottom %} |
||||
<div id="plugin_content_bottom" class="col-md-12"> |
||||
{{ plugin_content_bottom }} |
||||
</div> |
||||
{% endif %} |
||||
</section> |
||||
|
||||
{# Footer #} |
||||
{% include "@template_style/layout/footer.tpl" %} |
||||
{% endblock %} |
||||
</div> |
||||
</div> |
||||
</div> |
@ -1,12 +1,5 @@ |
||||
{% extends 'ChamiloLMSCoreBundle::page.html.twig' %} |
||||
|
||||
{% block layout %} |
||||
{% embed 'ChamiloLMSCoreBundle::3-9.html.twig' %} |
||||
{% block content %} |
||||
{{ parent() }} |
||||
{% endblock %} |
||||
{% block sidebar %} |
||||
{{ parent() }} |
||||
{% endblock %} |
||||
{% endembed %} |
||||
{% block page_content %} |
||||
{{ content }} |
||||
{% endblock %} |
||||
|
||||
|
@ -1,12 +1,7 @@ |
||||
{% extends 'ChamiloLMSCoreBundle::page.html.twig' %} |
||||
|
||||
{% block layout %} |
||||
{% embed 'ChamiloLMSCoreBundle::3-9.html.twig' %} |
||||
{% block content %} |
||||
{{ parent() }} |
||||
{% endblock %} |
||||
{% block sidebar %} |
||||
{{ parent() }} |
||||
{% endblock %} |
||||
{% endembed %} |
||||
{#{% extends "ChamiloLMSCoreBundle::main_layout.html.twig" %}#} |
||||
{% block page_content %} |
||||
{{ content }} |
||||
{% endblock %} |
||||
|
||||
|
||||
|
||||
|
@ -1,10 +0,0 @@ |
||||
{% extends 'ChamiloLMSCoreBundle:Security:only_login.twig' %} |
||||
|
||||
{% block form %} |
||||
<form class="form-signin" action="{{ url('login_check') }}" method="post"> |
||||
<h2 class="form-signin-heading">{{ 'SignIn' | trans }}</h2> |
||||
<input class="form-control virtualkey" type="text" name="_username" placeholder="{{ 'Username' | trans }}"/> |
||||
<input class="form-control virtualkey" type="password" name="_password" placeholder="{{ 'Password' | trans }}" /> |
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">{{ 'LoginEnter' | trans }}</button> |
||||
</form> |
||||
{% endblock %} |
@ -1,36 +0,0 @@ |
||||
{% if is_granted('IS_AUTHENTICATED_FULLY') == false %} |
||||
{% if ("use_virtual_keyboard" | get_setting) == 'true' %} |
||||
<link href="{{ asset('ChamiloLMS/js/keyboard/keyboard.css') }}" rel="stylesheet" media="screen"> |
||||
<script src="{{ asset('ChamiloLMS/js/keyboard/jquery.keyboard.js') }}"></script> |
||||
|
||||
<script> |
||||
$(function(){ |
||||
$('.virtualkey').keyboard({ |
||||
layout:'custom', |
||||
customLayout: { |
||||
'default': [ |
||||
'1 2 3 4 5 6 7 8 9 0 {bksp}', |
||||
'q w e r t y u i o p', |
||||
'a s d f g h j k l', |
||||
'z x c v b n m', |
||||
'{cancel} {accept}' |
||||
] |
||||
} |
||||
}); |
||||
}); |
||||
</script> |
||||
{% endif %} |
||||
|
||||
{% if error %} |
||||
<div>{{ error.message }}</div> |
||||
{% endif %} |
||||
|
||||
{% block form %} |
||||
<form class="form" action="{{ url('login_check') }}" method="post"> |
||||
<input class=" virtualkey" type="text" name="_username" placeholder="{{ 'Username' | trans }}"/> |
||||
<input class=" virtualkey" type="password" name="_password" placeholder="{{ 'Password' | trans }}" /> |
||||
<button class="btn btn-primary" type="submit">{{ 'LoginEnter' | trans }}</button> |
||||
</form> |
||||
{% endblock %} |
||||
|
||||
{% endif %} |
@ -1,316 +0,0 @@ |
||||
<!DOCTYPE html> |
||||
<!--[if lt IE 7]> <html lang="{{ app.request.locale }}" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> |
||||
<!--[if IE 7]> <html lang="{{ app.request.locale }}" class="no-js lt-ie9 lt-ie8"> <![endif]--> |
||||
<!--[if IE 8]> <html lang="{{ app.request.locale }}" class="no-js lt-ie9"> <![endif]--> |
||||
<!--[if gt IE 8]><!--><html lang="{{ app.request.locale }}" class="no-js"> <!--<![endif]--> |
||||
<head> |
||||
{% block head %} |
||||
<noscript>{{ "NoJavascript"|trans }}</noscript> |
||||
<meta charset="UTF-8" /> |
||||
<link href="http://www.chamilo.org/documentation.php" rel="help" /> |
||||
<link href="http://www.chamilo.org/team.php" rel="author" /> |
||||
<link href="http://www.chamilo.org" rel="copyright" /> |
||||
<link rel="shortcut icon" href="{{ asset('favicon.ico') }}" /> |
||||
<link rel="shortcut icon" href="{{ asset('apple-touch-icon.png') }}" /> |
||||
<meta name="apple-mobile-web-app-capable" content="yes" /> |
||||
<meta name="Generator" content="{{ software_name }} {{ version }}" /> |
||||
{# Use the latest engine in ie8/ie9 or use google chrome engine if available #} |
||||
{# Improve usability in portal devices #} |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
<title>{% block title %}{% endblock %}</title> |
||||
{% block stylesheets %}{% endblock %} |
||||
|
||||
<link href="{{ asset('css/bootstrap.css') }}" rel="stylesheet" media="screen"> |
||||
|
||||
<link href="{{ asset('ChamiloLMS/css/base.css') }}" rel="stylesheet" media="screen"> |
||||
<link href="{{ asset('ChamiloLMS/css/themes/chamilo/default.css') }}" rel="stylesheet" media="screen"> |
||||
|
||||
<link href="{{ asset('ChamiloLMS/js/chosen/chosen.css') }}" rel="stylesheet" media="screen"> |
||||
<script src="{{ asset('js/jquery.js') }}"></script> |
||||
<script src="{{ asset('js/bootstrap.js') }}"></script> |
||||
<script src="{{ asset('ChamiloLMS/js/jquery-ui/js/jquery-ui.custom.min.js') }}"></script> |
||||
<script src="{{ asset('ChamiloLMS/js/chosen/chosen.jquery.min.js') }}"></script> |
||||
{% block header_end %}{% endblock header_end %} |
||||
<script> |
||||
function setCheckbox(value, table_id) { |
||||
checkboxes = $("#"+table_id+" input:checkbox"); |
||||
$.each(checkboxes, function(index, checkbox) { |
||||
checkbox.checked = value; |
||||
if (value) { |
||||
$(checkbox).parentsUntil("tr").parent().addClass("row_selected"); |
||||
} else { |
||||
$(checkbox).parentsUntil("tr").parent().removeClass("row_selected"); |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
function action_click(element, table_id) { |
||||
d = $("#"+table_id); |
||||
if (!confirm('{{ "ConfirmYourChoice"|trans }}')) { |
||||
return false; |
||||
} else { |
||||
var action =$(element).attr("data-action"); |
||||
$('#'+table_id+' input[name="action"] ').attr("value", action); |
||||
d.submit(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/* Global chat variables */ |
||||
{# |
||||
var ajax_url = '{{ _p.web_ajax }}chat.ajax.php'; |
||||
var online_button = '{{ online_button |e('js') }}'; |
||||
var offline_button = '{{ offline_button |e('js') }}'; |
||||
#} |
||||
var connect_lang = '{{ "ChatConnected"|trans |e('js') }}'; |
||||
var disconnect_lang = '{{ "ChatDisconnected"|trans |e('js') }}'; |
||||
|
||||
function get_url_params(q, attribute) { |
||||
var vars; |
||||
var hash; |
||||
if (q != undefined) { |
||||
q = q.split('&'); |
||||
for(var i = 0; i < q.length; i++){ |
||||
hash = q[i].split('='); |
||||
if (hash[0] == attribute) { |
||||
return hash[1]; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
function check_brand() { |
||||
if ($('.subnav').length) { |
||||
if ($(window).width() >= 969) { |
||||
$('.subnav .brand').hide(); |
||||
} else { |
||||
$('.subnav .brand').show(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
$(window).resize(function() { |
||||
//check_brand(); |
||||
}); |
||||
|
||||
$(document).scroll(function() { |
||||
|
||||
// Top bar scroll effect |
||||
if ($('body').width() > 959) { |
||||
if ($('.subnav').length) { |
||||
if (!$('.subnav').attr('data-top')) { |
||||
// If already fixed, then do nothing |
||||
if ($('.subnav').hasClass('subnav-fixed')) return; |
||||
// Remember top position |
||||
var offset = $('.subnav').offset(); |
||||
$('.subnav').attr('data-top', offset.top); |
||||
} |
||||
|
||||
if ($('.subnav').attr('data-top') - $('.subnav').outerHeight() <= $(this).scrollTop()) { |
||||
$('.subnav').addClass('subnav-fixed'); |
||||
} else { |
||||
$('.subnav').removeClass('subnav-fixed'); |
||||
} |
||||
//$('.subnav .brand').show(); |
||||
} |
||||
} else { |
||||
//$('.subnav .brand').hide(); |
||||
} |
||||
|
||||
//Exercise warning fixed at the top |
||||
var fixed = $("#exercise_clock_warning"); |
||||
if (fixed.length) { |
||||
if (!fixed.attr('data-top')) { |
||||
// If already fixed, then do nothing |
||||
if (fixed.hasClass('subnav-fixed')) return; |
||||
// Remember top position |
||||
var offset = fixed.offset(); |
||||
fixed.attr('data-top', offset.top); |
||||
fixed.css('width', '100%'); |
||||
} |
||||
|
||||
if (fixed.attr('data-top') - fixed.outerHeight() <= $(this).scrollTop()) { |
||||
fixed.addClass('subnav-fixed'); |
||||
fixed.css('width', '100%'); |
||||
} else { |
||||
fixed.removeClass('subnav-fixed'); |
||||
fixed.css('width', '200px'); |
||||
} |
||||
} |
||||
|
||||
// Admin -> Settings toolbar. |
||||
if ($('body').width() > 959) {/* |
||||
if ($('.new_actions').length) { |
||||
if (!$('.new_actions').attr('data-top')) { |
||||
// If already fixed, then do nothing |
||||
if ($('.new_actions').hasClass('new_actions-fixed')) return; |
||||
// Remember top position |
||||
var offset = $('.new_actions').offset(); |
||||
|
||||
var more_top = 0; |
||||
if ($('.subnav').hasClass('new_actions-fixed')) { |
||||
more_top = 50; |
||||
} |
||||
$('.new_actions').attr('data-top', offset.top + more_top); |
||||
} |
||||
|
||||
if ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop()) { |
||||
$('.new_actions').addClass('new_actions-fixed'); |
||||
} else { |
||||
$('.new_actions').removeClass('new_actions-fixed'); |
||||
} |
||||
}*/ |
||||
} |
||||
|
||||
// Bottom actions. |
||||
if ($('.bottom_actions').length) { |
||||
if (!$('.bottom_actions').attr('data-top')) { |
||||
// If already fixed, then do nothing |
||||
if ($('.bottom_actions').hasClass('bottom_actions_fixed')) return; |
||||
|
||||
// Remember top position |
||||
var offset = $('.bottom_actions').offset(); |
||||
$('.bottom_actions').attr('data-top', offset.top); |
||||
} |
||||
|
||||
if ($('.bottom_actions').attr('data-top') > $('body').outerHeight()) { |
||||
if ( ($('.bottom_actions').attr('data-top') - $('body').outerHeight() - $('.bottom_actions').outerHeight()) >= $(this).scrollTop()) { |
||||
$('.bottom_actions').addClass('bottom_actions_fixed'); |
||||
$('.bottom_actions').css("width", "100%"); |
||||
} else { |
||||
$('.bottom_actions').css("width", ""); |
||||
$('.bottom_actions').removeClass('bottom_actions_fixed'); |
||||
} |
||||
} else { |
||||
if ( ($('.bottom_actions').attr('data-top') - $('.bottom_actions').outerHeight()) <= $(this).scrollTop()) { |
||||
$('.bottom_actions').addClass('bottom_actions_fixed'); |
||||
$('.bottom_actions').css("width", "100%"); |
||||
} else { |
||||
$('.bottom_actions').removeClass('bottom_actions_fixed'); |
||||
$('.bottom_actions').css("width", ""); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
|
||||
$(function() { |
||||
check_brand(); |
||||
//Removes the yellow input in Chrome |
||||
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) { |
||||
$(window).load(function(){ |
||||
$('input:-webkit-autofill').each(function(){ |
||||
var text = $(this).val(); |
||||
var name = $(this).attr('name'); |
||||
$(this).after(this.outerHTML).remove(); |
||||
//var has_string = $(name).find(":contains('[')"); |
||||
$('input[name=' + name + ']').val(text); |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
// Fixes buttons to the new btn class. |
||||
if (!$('#button').hasClass('btn')) { |
||||
$("button").addClass('btn'); |
||||
} |
||||
|
||||
// Dropdown effect. |
||||
$('.dropdown-toggle').dropdown(); |
||||
|
||||
// Responsive effect. |
||||
//$(".collapse").collapse(); |
||||
|
||||
$(".accordion_jquery").accordion({ |
||||
autoHeight: false, |
||||
active: false, // all items closed by default |
||||
collapsible: true, |
||||
header: ".accordion-heading" |
||||
}); |
||||
|
||||
// Global popup |
||||
$('.ajax').on('click', function() { |
||||
var url = this.href; |
||||
var dialog = $("#dialog"); |
||||
if ($("#dialog").length == 0) { |
||||
dialog = $('<div id="dialog" style="display:none"></div>').appendTo('body'); |
||||
} |
||||
|
||||
width_value = 580; |
||||
height_value = 450; |
||||
resizable_value = true; |
||||
|
||||
new_param = get_url_params(url, 'width'); |
||||
if (new_param) { |
||||
width_value = new_param; |
||||
} |
||||
|
||||
new_param = get_url_params(url, 'height') |
||||
if (new_param) { |
||||
height_value = new_param; |
||||
} |
||||
|
||||
new_param = get_url_params(url, 'resizable'); |
||||
if (new_param) { |
||||
resizable_value = new_param; |
||||
} |
||||
|
||||
// load remote content |
||||
dialog.load(url,{}, function(responseText, textStatus, XMLHttpRequest) { |
||||
dialog.dialog({ |
||||
modal : true, |
||||
width : width_value, |
||||
height : height_value, |
||||
resizable : resizable_value |
||||
}); |
||||
}); |
||||
//prevent the browser to follow the link |
||||
return false; |
||||
}); |
||||
|
||||
//old jquery.menu.js |
||||
$('#navigation a').stop().animate({ |
||||
'marginLeft':'50px' |
||||
}, 1000); |
||||
|
||||
$('#navigation > li').hover( |
||||
function () { |
||||
$('a',$(this)).stop().animate({ |
||||
'marginLeft':'1px' |
||||
},200); |
||||
}, |
||||
function () { |
||||
$('a',$(this)).stop().animate({ |
||||
'marginLeft':'50px' |
||||
},200); |
||||
} |
||||
); |
||||
|
||||
// Tiny mce |
||||
/*tinymce.init({ |
||||
plugins: "media,image,elfinder", |
||||
selector: "textarea" |
||||
});*/ |
||||
|
||||
|
||||
/* |
||||
$(".td_actions").hide(); |
||||
|
||||
$(".td_actions").parent('tr').mouseover(function() { |
||||
$(".td_actions").show(); |
||||
}); |
||||
|
||||
$(".td_actions").parent('tr').mouseout(function() { |
||||
$(".td_actions").hide(); |
||||
});*/ |
||||
}); |
||||
</script> |
||||
{% block extraHead %} |
||||
{% endblock %} |
||||
{% endblock %} |
||||
</head> |
||||
|
||||
<body class="{% block theme %}default{% endblock %}"> |
||||
{% block layout %}{% endblock %} |
||||
</body> |
||||
</html> |
@ -0,0 +1,102 @@ |
||||
{% embed "AvanzuAdminThemeBundle:layout:base-layout.html.twig" %} |
||||
|
||||
{% block javascripts_head %} |
||||
{{ parent() }} |
||||
|
||||
{% block sonata_page_javascripts %} |
||||
{% block page_javascripts %} {# Deprecated block #} |
||||
<!-- Le HTML5 shim, for IE6-8 support of HTML elements --> |
||||
<!--[if lt IE 9]> |
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> |
||||
<![endif]--> |
||||
|
||||
{% for js in sonata_page.assets.javascripts %} |
||||
<script src="{{ asset(js) }}" type="text/javascript"></script> |
||||
{% endfor %} |
||||
{% endblock %} |
||||
{% endblock %} |
||||
{{ sonata_seo_title() }} |
||||
{{ sonata_seo_metadatas() }} |
||||
{% endblock %} |
||||
|
||||
{% block stylesheets %} |
||||
{{ parent() }} |
||||
{% block sonata_page_stylesheets %} |
||||
{% block page_stylesheets %} {# Deprecated block #} |
||||
{% for stylesheet in sonata_page.assets.stylesheets %} |
||||
<link rel="stylesheet" href="{{ asset(stylesheet) }}" type="text/css" media="all" /> |
||||
{% endfor %} |
||||
{% endblock %} |
||||
{% endblock %} |
||||
{% endblock %} |
||||
|
||||
{% block page_breadcrumb %} |
||||
{% block sonata_page_breadcrumb %} |
||||
{% if sonata_seo_context is not defined %} |
||||
{% set sonata_seo_context = 'homepage' %} |
||||
{% endif %} |
||||
{{ sonata_block_render_event('breadcrumb', { 'context': sonata_seo_context, 'current_uri': app.request.requestUri }) }} |
||||
{% endblock %} |
||||
{% endblock %} |
||||
|
||||
{% block page_title %} |
||||
{% if page is defined %} |
||||
{{ page.name }} |
||||
{% else %} |
||||
{{ parent() }} |
||||
{% endif %} |
||||
{% endblock %} |
||||
|
||||
{% block page_content %} |
||||
{% if page is defined %} |
||||
{% block sonata_page_container %} |
||||
<div class="row"> |
||||
<div class="col-xs-12"> |
||||
{#{{ sonata_page_render_container('header', page) }}#} |
||||
{{ sonata_page_render_container('header', page) }} |
||||
</div> |
||||
|
||||
{% if page is defined %} |
||||
<div class="col-xs-12"> |
||||
{% if page.name != 'global' %} |
||||
{{ sonata_page_render_container('content_top', 'global') }} |
||||
{% endif %} |
||||
{{ sonata_page_render_container('content_top', page) }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="col-xs-12"> |
||||
{% if content is defined %} |
||||
{{ content|raw }} |
||||
{% else %} |
||||
{% set content = block('content') %} |
||||
{% if content|length > 0 %} |
||||
{{ content|raw }} |
||||
{% elseif page is defined %} |
||||
{{ sonata_page_render_container('content', page) }} |
||||
{% endif %} |
||||
{% endif %} |
||||
</div> |
||||
|
||||
{% if page is defined %} |
||||
<div class="col-xs-12"> |
||||
{{ sonata_page_render_container('content_bottom', page) }} |
||||
|
||||
{% if page.name != 'global'%} |
||||
{{ sonata_page_render_container('content_bottom', 'global') }} |
||||
{% endif %} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="col-xs-12"> |
||||
{{ sonata_page_render_container('footer', page) }} |
||||
{#{{ sonata_page_render_container('footer', 'global') }}#} |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
{% endif %} |
||||
|
||||
{% endblock %} |
||||
|
||||
|
||||
{% endembed %} |
@ -1,2 +0,0 @@ |
||||
{% extends 'ChamiloLMSCoreBundle::base.html.twig' %} |
||||
{% block theme 'page' %} |
@ -0,0 +1,12 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CourseBundle\Entity; |
||||
|
||||
use Sonata\Component\Product\PackageManagerInterface; |
||||
use Sonata\CoreBundle\Model\BaseEntityManager; |
||||
use Sonata\CoreBundle\Model\ManagerInterface; |
||||
|
||||
class CourseManager extends BaseEntityManager implements ManagerInterface |
||||
{ |
||||
|
||||
} |
@ -1,6 +0,0 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
// Redirect calls to the new web/index.php |
||||
header('Location: web/userportal'); |
||||
exit; |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@ -1,185 +0,0 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Who is online list |
||||
* @todo move this inside web/users/online |
||||
*/ |
||||
|
||||
// language files that should be included |
||||
$language_file = array('index', 'registration', 'messages', 'userInfo'); |
||||
|
||||
if (!isset($_GET['cidReq'])) { |
||||
$cidReset = true; |
||||
} |
||||
|
||||
// including necessary files |
||||
require_once './main/inc/global.inc.php'; |
||||
|
||||
if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) { |
||||
api_protect_course_script(true); |
||||
} |
||||
|
||||
$_SESSION['who_is_online_counter'] = 2; |
||||
|
||||
$htmlHeadXtra[] = api_get_js('jquery.endless-scroll.js'); |
||||
//social tab |
||||
$this_section = SECTION_SOCIAL; |
||||
// table definitions |
||||
$track_user_table = Database::get_main_table(TABLE_MAIN_USER); |
||||
$htmlHeadXtra[] = '<script> |
||||
|
||||
function show_image(image,width,height) { |
||||
width = parseInt(width) + 20; |
||||
height = parseInt(height) + 20; |
||||
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\'); |
||||
} |
||||
|
||||
$(document).ready(function (){ |
||||
$("input#id_btn_send_invitation").bind("click", function(){ |
||||
if (confirm("'.get_lang('SendMessageInvitation', '').'")) { |
||||
$("#form_register_friend").submit(); |
||||
} |
||||
}); |
||||
}); |
||||
|
||||
function display_hide () { |
||||
setTimeout("hide_display_message()",3000); |
||||
} |
||||
function hide_display_message () { |
||||
$("div#display_response_id").html(""); |
||||
try { |
||||
$("#txt_subject_id").val(""); |
||||
$("#txt_area_invite").val(""); |
||||
}catch(e) { |
||||
$("#txt_area_invite").val(""); |
||||
} |
||||
} |
||||
|
||||
function show_icon_edit(element_html) { |
||||
ident="#edit_image"; |
||||
$(ident).show(); |
||||
} |
||||
|
||||
function hide_icon_edit(element_html) { |
||||
ident="#edit_image"; |
||||
$(ident).hide(); |
||||
} |
||||
|
||||
$(document).ready(function() { |
||||
|
||||
$("#link_load_more_items").live("click", function() { |
||||
page = $("#link_load_more_items").attr("data_link"); |
||||
$.ajax({ |
||||
beforeSend: function(objeto) { |
||||
$("#display_response_id").html("'.addslashes(get_lang('Loading')).'"); |
||||
}, |
||||
type: "GET", |
||||
url: "main/inc/ajax/online.ajax.php?a=load_online_user", |
||||
data: "online_page_nr="+page, |
||||
success: function(data) { |
||||
$("#display_response_id").html(""); |
||||
if (data != "end") { |
||||
$("#link_load_more_items").remove(); |
||||
var last = $("#online_grid_container li:last"); |
||||
last.after(data); |
||||
} else { |
||||
$("#link_load_more_items").remove(); |
||||
} |
||||
} |
||||
}); |
||||
}); |
||||
}); |
||||
</script>'; |
||||
|
||||
|
||||
if (isset($_GET['chatid']) && !empty($_GET['chatid'])) { |
||||
//send out call request |
||||
$time = time(); |
||||
$time = date("Y-m-d H:i:s", $time); |
||||
$chatid = intval($_GET['chatid']); |
||||
if ($_GET['chatid'] == strval(intval($_GET['chatid']))) { |
||||
$sql = "UPDATE $track_user_table SET chatcall_user_id = '".Database::escape_string( |
||||
$_user['user_id'] |
||||
)."', chatcall_date = '".Database::escape_string( |
||||
$time |
||||
)."', chatcall_text = '' where (user_id = ".(int)Database::escape_string($chatid).")"; |
||||
$result = Database::query($sql); |
||||
//redirect caller to chat |
||||
header( |
||||
"Location: ".api_get_path(WEB_CODE_PATH)."chat/chat.php?".api_get_cidreq( |
||||
)."&origin=whoisonline&target=".Security::remove_XSS($chatid) |
||||
); |
||||
exit; |
||||
} |
||||
} |
||||
|
||||
$social_right_content = null; |
||||
|
||||
// This if statement prevents users accessing the who's online feature when it has been disabled. |
||||
if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) || ((api_get_setting( |
||||
'showonline', |
||||
'users' |
||||
) == 'true' || api_get_setting('showonline', 'course') == 'true') && $_user['user_id']) |
||||
) { |
||||
|
||||
if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) { |
||||
$user_list = Online::who_is_online_in_this_course( |
||||
0, |
||||
9, |
||||
api_get_user_id(), |
||||
api_get_setting('time_limit_whosonline'), |
||||
$_GET['cidReq'] |
||||
); |
||||
} else { |
||||
$user_list = Online::who_is_online(0, 9); |
||||
} |
||||
|
||||
if (!isset($_GET['id'])) { |
||||
if (api_get_setting('allow_social_tool') == 'true') { |
||||
if (!api_is_anonymous()) { |
||||
//this include the social menu div |
||||
$social_left_content = SocialManager::show_social_menu('whoisonline'); |
||||
} |
||||
} |
||||
} |
||||
|
||||
if ($user_list) { |
||||
if (!isset($_GET['id'])) { |
||||
if (api_get_setting('allow_social_tool') == 'true') { |
||||
if (!api_is_anonymous()) { |
||||
$query = isset($_GET['q']) ? $_GET['q'] : null; |
||||
$social_right_content .= '<div class="span9">'.UserManager::get_search_form($query).'</div>'; |
||||
} |
||||
} |
||||
$social_right_content .= SocialManager::display_user_list($user_list); |
||||
} |
||||
} |
||||
|
||||
if (isset($_GET['id'])) { |
||||
if (api_get_setting('allow_social_tool') == 'true') { |
||||
header("Location: ".api_get_path(WEB_CODE_PATH)."social/profile.php?u=".intval($_GET['id'])); |
||||
exit; |
||||
} else { |
||||
SocialManager::display_individual_user($_GET['id']); |
||||
} |
||||
} |
||||
} else { |
||||
api_not_allowed(); |
||||
exit; |
||||
} |
||||
|
||||
$app['title'] = get_lang('UsersOnLineList'); |
||||
$tpl = $app['template']; |
||||
|
||||
if (api_get_setting('allow_social_tool') == 'true' && !api_is_anonymous()) { |
||||
$tpl->setHelp('Groups'); |
||||
$tpl->assign('social_left_content', $social_left_content); |
||||
$tpl->assign('social_right_content', $social_right_content); |
||||
$social_layout = $tpl->get_template('layout/social_layout.tpl'); |
||||
$tpl->display($social_layout); |
||||
} else { |
||||
$tpl->assign('header', get_lang('UsersOnLineList')); |
||||
$tpl->assign('content', $social_right_content); |
||||
$tpl->display_one_col_template(); |
||||
} |
@ -1,118 +0,0 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* Shows who is online in a specific session |
||||
* @todo move this inside web/users/online-in-course |
||||
* @package chamilo.main |
||||
*/ |
||||
/** |
||||
* Initialization |
||||
*/ |
||||
// name of the language file that needs to be included |
||||
$language_file = array ('index', 'chat', 'tracking'); |
||||
|
||||
require_once './main/inc/global.inc.php'; |
||||
|
||||
api_block_anonymous_users(); |
||||
|
||||
if (isset($_REQUEST['session_id'])) { |
||||
$session_id = intval($_REQUEST['session_id']); |
||||
} else { |
||||
$session_id = api_get_session_id(); |
||||
} |
||||
if (empty($session_id)) { |
||||
api_not_allowed(true); |
||||
} |
||||
|
||||
Display::display_header(get_lang('UserOnlineListSession')); |
||||
|
||||
echo Display::page_header(get_lang('UserOnlineListSession')); |
||||
|
||||
?> |
||||
<br /><br /> |
||||
<table class="data_table"> |
||||
<tr> |
||||
<th> |
||||
<?php echo get_lang('Name'); ?> |
||||
</th> |
||||
<th> |
||||
<?php echo get_lang('InCourse'); ?> |
||||
</th> |
||||
<th> |
||||
<?php echo get_lang('Email'); ?> |
||||
</th> |
||||
<th> |
||||
<?php echo get_lang('Chat'); ?> |
||||
</th> |
||||
</tr> |
||||
<?php |
||||
$session_is_coach = array(); |
||||
if (isset($_user['user_id']) && $_user['user_id'] != '') { |
||||
$session_is_coach = SessionManager::get_sessions_coached_by_user(api_get_user_id()); |
||||
$students_online = array(); |
||||
$now = api_get_utc_datetime(); |
||||
|
||||
$time_limit = api_get_setting('time_limit_whosonline'); |
||||
$online_time = time() - $time_limit*60; |
||||
$current_date = api_get_utc_datetime($online_time); |
||||
|
||||
foreach ($session_is_coach as $session) { |
||||
$sql = "SELECT DISTINCT last_access.access_user_id, |
||||
last_access.access_date, |
||||
last_access.c_id, |
||||
last_access.access_session_id, |
||||
course.code, |
||||
".(api_is_western_name_order() ? "CONCAT(user.firstname,' ',user.lastname)" : "CONCAT(user.lastname,' ',user.firstname)")." as name, |
||||
user.email |
||||
FROM ".Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS)." AS last_access |
||||
INNER JOIN ".Database::get_main_table(TABLE_MAIN_USER)." AS user |
||||
ON user.user_id = last_access.access_user_id |
||||
INNER JOIN ".Database::get_main_table(TABLE_MAIN_COURSE)." AS course |
||||
ON course.id = last_access.c_id |
||||
WHERE access_session_id='".$session['id']."' AND access_date >= '$current_date' |
||||
GROUP BY access_user_id"; |
||||
|
||||
$result = Database::query($sql); |
||||
|
||||
while($user_list = Database::fetch_array($result)) { |
||||
$students_online[$user_list['access_user_id']] = $user_list; |
||||
} |
||||
} |
||||
|
||||
if (count($students_online) > 0) { |
||||
foreach ($students_online as $student_online) { |
||||
echo "<tr><td>"; |
||||
echo $student_online['name']; |
||||
echo "</td><td align='center'>"; |
||||
echo $student_online['code']; |
||||
echo "</td><td align='center'>"; |
||||
if (api_get_setting('show_email_addresses') == 'true') { |
||||
if (!empty($student_online['email'])) { |
||||
echo $student_online['email']; |
||||
} else { |
||||
echo get_lang('NoEmail'); |
||||
} |
||||
} |
||||
echo " </td> |
||||
<td align='center'> |
||||
"; |
||||
echo '<a target="_blank" class="btn" href="main/chat/chat.php?cidReq='.$student_online['code'].'&id_session='.$student_online['access_session_id'].'"> |
||||
'.get_lang('Chat').' |
||||
</a>'; |
||||
echo " </td> |
||||
</tr> |
||||
"; |
||||
} |
||||
} else { |
||||
echo ' <tr> |
||||
<td colspan="4"> |
||||
'.get_lang('NoOnlineStudents').' |
||||
</td> |
||||
</tr> |
||||
'; |
||||
} |
||||
} |
||||
?> |
||||
</table> |
||||
<?php |
||||
Display::display_footer(); |
Loading…
Reference in new issue