Adding files needed to boot the app.

1.10.x
Julio Montoya 11 years ago
parent a869edf5c8
commit 6af9760bfa
  1. 14
      .gitignore
  2. 121
      app/AppKernel.php
  3. 206
      app/bootstrap.php.cache
  4. 95
      composer.json
  5. 38
      src/ChamiloLMS/CoreBundle/Admin/BranchAdmin.php
  6. 48
      src/ChamiloLMS/CoreBundle/Admin/CourseAdmin.php
  7. 64
      src/ChamiloLMS/CoreBundle/Admin/SessionAdmin.php
  8. 2
      src/ChamiloLMS/CoreBundle/Component/DataFilesystem/DataFilesystem.php
  9. 2
      src/ChamiloLMS/CoreBundle/Component/Editor/Connector.php
  10. 2
      src/ChamiloLMS/CoreBundle/Component/Editor/Driver/DropBoxDriver.php
  11. 8
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/JuryController.php
  12. 2
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/QuestionScoreController.php
  13. 2
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/QuestionScoreNameController.php
  14. 47
      src/ChamiloLMS/CoreBundle/Controller/Admin/Administrator/RoleController.php
  15. 4
      src/ChamiloLMS/CoreBundle/Controller/Admin/Director/BranchDirectorController.php
  16. 2
      src/ChamiloLMS/CoreBundle/Controller/Admin/JuryMember/JuryMemberController.php
  17. 2
      src/ChamiloLMS/CoreBundle/Controller/Admin/JuryPresident/JuryPresidentController.php
  18. 2
      src/ChamiloLMS/CoreBundle/Controller/App/SessionPath/SessionPathController.php
  19. 4
      src/ChamiloLMS/CoreBundle/Controller/BranchAdminController.php
  20. 13
      src/ChamiloLMS/CoreBundle/Controller/CourseAdminController.php
  21. 41
      src/ChamiloLMS/CoreBundle/Controller/FrontController.php
  22. 2
      src/ChamiloLMS/CoreBundle/Controller/IndexController.php
  23. 13
      src/ChamiloLMS/CoreBundle/Controller/SessionAdminController.php
  24. 2
      src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumCategoryController.php
  25. 2
      src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumItemController.php
  26. 4
      src/ChamiloLMS/CoreBundle/Controller/Tool/Curriculum/CurriculumUserController.php
  27. 2
      src/ChamiloLMS/CoreBundle/Controller/Tool/Introduction/IntroductionController.php
  28. 1249
      src/ChamiloLMS/CoreBundle/DataFixtures/ORM/LoadPageData.php
  29. 120
      src/ChamiloLMS/CoreBundle/DataFixtures/ORM/LoadUserData.php
  30. 6
      src/ChamiloLMS/CoreBundle/DependencyInjection/ChamiloLMSCoreExtension.php
  31. 22
      src/ChamiloLMS/CoreBundle/Resources/config/admin.yml
  32. 5
      src/ChamiloLMS/CoreBundle/Resources/config/routing.yml
  33. 67
      src/ChamiloLMS/CoreBundle/Resources/config/services.yml
  34. 247
      src/ChamiloLMS/CoreBundle/Resources/public/css/demo.css
  35. 8
      src/ChamiloLMS/CoreBundle/Resources/views/12.html.twig
  36. 83
      src/ChamiloLMS/CoreBundle/Resources/views/3-9.html.twig
  37. 4
      src/ChamiloLMS/CoreBundle/Resources/views/Admin/index.html.twig
  38. 13
      src/ChamiloLMS/CoreBundle/Resources/views/Index/index.html.twig
  39. 17
      src/ChamiloLMS/CoreBundle/Resources/views/Index/userportal.html.twig
  40. 4
      src/ChamiloLMS/CoreBundle/Resources/views/Legacy/index.html.twig
  41. 10
      src/ChamiloLMS/CoreBundle/Resources/views/Security/login.html.twig
  42. 36
      src/ChamiloLMS/CoreBundle/Resources/views/Security/only_login.html.twig
  43. 4
      src/ChamiloLMS/CoreBundle/Resources/views/Tool/CourseHome/index.html.twig
  44. 316
      src/ChamiloLMS/CoreBundle/Resources/views/base.html.twig
  45. 4
      src/ChamiloLMS/CoreBundle/Resources/views/default/layout/footer.tpl
  46. 14
      src/ChamiloLMS/CoreBundle/Resources/views/default/layout/sidebar.tpl
  47. 102
      src/ChamiloLMS/CoreBundle/Resources/views/main_layout.html.twig
  48. 2
      src/ChamiloLMS/CoreBundle/Resources/views/page.html.twig
  49. 12
      src/ChamiloLMS/CourseBundle/Entity/CourseManager.php
  50. 6
      user_portal.php
  51. 17
      web/app.php
  52. 16
      web/app_dev.php
  53. 0
      web/apple-touch-icon.png
  54. 0
      web/favicon.ico
  55. 3
      web/legacy.php
  56. 0
      web/robots.txt
  57. 185
      whoisonline.php
  58. 118
      whoisonlinesession.php

14
.gitignore vendored

@ -43,3 +43,17 @@ tests/doctrine_console/Proxies
# OS stuff
.DS_Store
# Symfony
behat.yml
app/cache/*
app/logs/*
app/*.cache
web/bundles
web/uploads
web/sitemap*.xml
app/config/parameters*.yml
vendor
build
composer.lock

@ -5,34 +5,137 @@ use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
/**
* {@inheritdoc}
*/
public function registerBundles()
{
$bundles = array(
// Symfony standard edition
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
// Doctrine
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new ChamiloLMS\CoreBundle\ChamiloLMSCoreBundle(),
// KNP bundles
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new Braincrafted\Bundle\BootstrapBundle\BraincraftedBootstrapBundle(),
// User
new FOS\UserBundle\FOSUserBundle(),
new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
// Vendor specifics bundles
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
// Page
new Sonata\PageBundle\SonataPageBundle(),
new Application\Sonata\PageBundle\ApplicationSonataPageBundle(),
// NEWS
new Sonata\NewsBundle\SonataNewsBundle(),
new Application\Sonata\NewsBundle\ApplicationSonataNewsBundle(),
// MEDIA
new Sonata\MediaBundle\SonataMediaBundle(),
new Application\Sonata\MediaBundle\ApplicationSonataMediaBundle(),
// new Liip\ImagineBundle\LiipImagineBundle(),
//new Presta\CMSMediaBundle\PrestaCMSMediaBundle(),
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
// Disable this if you don't want the audit on entities
new SimpleThings\EntityAudit\SimpleThingsEntityAuditBundle(),
// API
new FOS\RestBundle\FOSRestBundle(),
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
// E-COMMERCE
/*new Sonata\BasketBundle\SonataBasketBundle(),
new Application\Sonata\BasketBundle\ApplicationSonataBasketBundle(),
new Sonata\CustomerBundle\SonataCustomerBundle(),
new Application\Sonata\CustomerBundle\ApplicationSonataCustomerBundle(),
new Sonata\DeliveryBundle\SonataDeliveryBundle(),
new Application\Sonata\DeliveryBundle\ApplicationSonataDeliveryBundle(),
new Sonata\InvoiceBundle\SonataInvoiceBundle(),
new Application\Sonata\InvoiceBundle\ApplicationSonataInvoiceBundle(),
new Sonata\OrderBundle\SonataOrderBundle(),
new Application\Sonata\OrderBundle\ApplicationSonataOrderBundle(),
new Sonata\PaymentBundle\SonataPaymentBundle(),
new Application\Sonata\PaymentBundle\ApplicationSonataPaymentBundle(),
new Sonata\ProductBundle\SonataProductBundle(),
new Application\Sonata\ProductBundle\ApplicationSonataProductBundle(),
new Sonata\PriceBundle\SonataPriceBundle(),
*/
new JMS\SerializerBundle\JMSSerializerBundle($this),
new FOS\CommentBundle\FOSCommentBundle(),
new Sonata\CommentBundle\SonataCommentBundle(),
new Application\Sonata\CommentBundle\ApplicationSonataCommentBundle(),
// SONATA CORE & HELPER BUNDLES
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\IntlBundle\SonataIntlBundle(),
new Sonata\FormatterBundle\SonataFormatterBundle(),
new Sonata\CacheBundle\SonataCacheBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\SeoBundle\SonataSeoBundle(),
new Sonata\ClassificationBundle\SonataClassificationBundle(),
new Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle(),
new Sonata\NotificationBundle\SonataNotificationBundle(),
new Application\Sonata\NotificationBundle\ApplicationSonataNotificationBundle(),
new Application\Sonata\SeoBundle\ApplicationSonataSeoBundle(),
new Sonata\DatagridBundle\SonataDatagridBundle(),
// Search Integration
//new FOS\ElasticaBundle\FOSElasticaBundle(),
// CMF Integration
new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
// DEMO and QA - Can be deleted
//new Sonata\Bundle\DemoBundle\SonataDemoBundle(),
//new Sonata\Bundle\QABundle\SonataQABundle(),
// Disable this if you don't want the timeline in the admin
new Spy\TimelineBundle\SpyTimelineBundle(),
new Sonata\TimelineBundle\SonataTimelineBundle(),
new Application\Sonata\TimelineBundle\ApplicationSonataTimelineBundle(), // easy extends integration
new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
new Application\Sonata\AdminBundle\ApplicationSonataAdminBundle(),
new FOS\AdvancedEncoderBundle\FOSAdvancedEncoderBundle(),
//new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(),
new FOS\MessageBundle\FOSMessageBundle(),
// Chamilo
new ChamiloLMS\CoreBundle\ChamiloLMSCoreBundle(),
new ChamiloLMS\CourseBundle\ChamiloLMSCourseBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle()
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Bazinga\Bundle\FakerBundle\BazingaFakerBundle();
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
$bundles[] = new Elao\WebProfilerExtraBundle\WebProfilerExtraBundle();
}
return $bundles;
@ -43,7 +146,7 @@ class AppKernel extends Kernel
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
public function getLogDir()
/*public function getLogDir()
{
return $this->rootDir.'/../logs/'.$this->environment.'/logs/';
}
@ -51,7 +154,7 @@ class AppKernel extends Kernel
public function getCacheDir()
{
return $this->rootDir.'/../data/temp/'.$this->environment.'/cache/';
}
}*/
// Custom paths

@ -120,10 +120,12 @@ namespace Symfony\Component\HttpFoundation
{
class HeaderBag implements \IteratorAggregate, \Countable
{
protected $headers = array();
protected $cacheControl = array();
protected $headers;
protected $cacheControl;
public function __construct(array $headers = array())
{
$this->cacheControl = array();
$this->headers = array();
foreach ($headers as $key => $values) {
$this->set($key, $values);
}
@ -416,7 +418,6 @@ public $headers;
protected $content;
protected $languages;
protected $charsets;
protected $encodings;
protected $acceptableContentTypes;
protected $pathInfo;
protected $requestUri;
@ -428,7 +429,6 @@ protected $session;
protected $locale;
protected $defaultLocale ='en';
protected static $formats;
protected static $requestFactory;
public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
{
$this->initialize($query, $request, $attributes, $cookies, $files, $server, $content);
@ -445,7 +445,6 @@ $this->headers = new HeaderBag($this->server->getHeaders());
$this->content = $content;
$this->languages = null;
$this->charsets = null;
$this->encodings = null;
$this->acceptableContentTypes = null;
$this->pathInfo = null;
$this->requestUri = null;
@ -456,7 +455,7 @@ $this->format = null;
}
public static function createFromGlobals()
{
$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
$request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
if (0 === strpos($request->headers->get('CONTENT_TYPE'),'application/x-www-form-urlencoded')
&& in_array(strtoupper($request->server->get('REQUEST_METHOD','GET')), array('PUT','DELETE','PATCH'))
) {
@ -529,11 +528,7 @@ $queryString = http_build_query($query,'','&');
}
$server['REQUEST_URI'] = $components['path'].(''!== $queryString ?'?'.$queryString :'');
$server['QUERY_STRING'] = $queryString;
return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content);
}
public static function setFactory($callable)
{
self::$requestFactory = $callable;
return new static($query, $request, array(), $cookies, $files, $server, $content);
}
public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null)
{
@ -559,7 +554,6 @@ $dup->headers = new HeaderBag($dup->server->getHeaders());
}
$dup->languages = null;
$dup->charsets = null;
$dup->encodings = null;
$dup->acceptableContentTypes = null;
$dup->pathInfo = null;
$dup->requestUri = null;
@ -838,7 +832,7 @@ $host = $this->server->get('SERVER_ADDR','');
}
$host = strtolower(preg_replace('/:\d+$/','', trim($host)));
if ($host && !preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host)) {
throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host));
throw new \UnexpectedValueException('Invalid Host "'.$host.'"');
}
if (count(self::$trustedHostPatterns) > 0) {
if (in_array($host, self::$trustedHosts)) {
@ -850,7 +844,7 @@ self::$trustedHosts[] = $host;
return $host;
}
}
throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host));
throw new \UnexpectedValueException('Untrusted Host "'.$host.'"');
}
return $host;
}
@ -1022,13 +1016,6 @@ return $this->charsets;
}
return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all());
}
public function getEncodings()
{
if (null !== $this->encodings) {
return $this->encodings;
}
return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
}
public function getAcceptableContentTypes()
{
if (null !== $this->acceptableContentTypes) {
@ -1173,65 +1160,12 @@ return $match[0];
}
return false;
}
private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
{
if (self::$requestFactory) {
$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content);
if (!$request instanceof Request) {
throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.');
}
return $request;
}
return new static($query, $request, $attributes, $cookies, $files, $server, $content);
}
}
}
namespace Symfony\Component\HttpFoundation
{
class Response
{
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
const HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
const HTTP_NO_CONTENT = 204;
const HTTP_RESET_CONTENT = 205;
const HTTP_PARTIAL_CONTENT = 206;
const HTTP_MULTI_STATUS = 207; const HTTP_ALREADY_REPORTED = 208; const HTTP_IM_USED = 226; const HTTP_MULTIPLE_CHOICES = 300;
const HTTP_MOVED_PERMANENTLY = 301;
const HTTP_FOUND = 302;
const HTTP_SEE_OTHER = 303;
const HTTP_NOT_MODIFIED = 304;
const HTTP_USE_PROXY = 305;
const HTTP_RESERVED = 306;
const HTTP_TEMPORARY_REDIRECT = 307;
const HTTP_PERMANENTLY_REDIRECT = 308; const HTTP_BAD_REQUEST = 400;
const HTTP_UNAUTHORIZED = 401;
const HTTP_PAYMENT_REQUIRED = 402;
const HTTP_FORBIDDEN = 403;
const HTTP_NOT_FOUND = 404;
const HTTP_METHOD_NOT_ALLOWED = 405;
const HTTP_NOT_ACCEPTABLE = 406;
const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
const HTTP_REQUEST_TIMEOUT = 408;
const HTTP_CONFLICT = 409;
const HTTP_GONE = 410;
const HTTP_LENGTH_REQUIRED = 411;
const HTTP_PRECONDITION_FAILED = 412;
const HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
const HTTP_REQUEST_URI_TOO_LONG = 414;
const HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
const HTTP_EXPECTATION_FAILED = 417;
const HTTP_I_AM_A_TEAPOT = 418; const HTTP_UNPROCESSABLE_ENTITY = 422; const HTTP_LOCKED = 423; const HTTP_FAILED_DEPENDENCY = 424; const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; const HTTP_UPGRADE_REQUIRED = 426; const HTTP_PRECONDITION_REQUIRED = 428; const HTTP_TOO_MANY_REQUESTS = 429; const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; const HTTP_INTERNAL_SERVER_ERROR = 500;
const HTTP_NOT_IMPLEMENTED = 501;
const HTTP_BAD_GATEWAY = 502;
const HTTP_SERVICE_UNAVAILABLE = 503;
const HTTP_GATEWAY_TIMEOUT = 504;
const HTTP_VERSION_NOT_SUPPORTED = 505;
const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; const HTTP_INSUFFICIENT_STORAGE = 507; const HTTP_LOOP_DETECTED = 508; const HTTP_NOT_EXTENDED = 510; const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511;
public $headers;
protected $content;
protected $version;
@ -1349,10 +1283,10 @@ public function sendHeaders()
if (headers_sent()) {
return $this;
}
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText));
foreach ($this->headers->allPreserveCase() as $name => $values) {
foreach ($values as $value) {
header($name.': '.$value, false, $this->statusCode);
header($name.': '.$value, false);
}
}
foreach ($this->headers->getCookies() as $cookie) {
@ -1924,17 +1858,23 @@ use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
class Container implements IntrospectableContainerInterface
{
protected $parameterBag;
protected $services = array();
protected $methodMap = array();
protected $aliases = array();
protected $scopes = array();
protected $scopeChildren = array();
protected $scopedServices = array();
protected $scopeStacks = array();
protected $services;
protected $methodMap;
protected $aliases;
protected $scopes;
protected $scopeChildren;
protected $scopedServices;
protected $scopeStacks;
protected $loading = array();
public function __construct(ParameterBagInterface $parameterBag = null)
{
$this->parameterBag = $parameterBag ?: new ParameterBag();
$this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag;
$this->services = array();
$this->aliases = array();
$this->scopes = array();
$this->scopeChildren = array();
$this->scopedServices = array();
$this->scopeStacks = array();
$this->set('service_container', $this);
}
public function compile()
@ -2219,30 +2159,33 @@ use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\ConfigCache;
use Symfony\Component\ClassLoader\ClassCollectionLoader;
use Symfony\Component\Filesystem\Filesystem;
abstract class Kernel implements KernelInterface, TerminableInterface
{
protected $bundles = array();
protected $bundles;
protected $bundleMap;
protected $container;
protected $rootDir;
protected $environment;
protected $debug;
protected $booted = false;
protected $booted;
protected $name;
protected $startTime;
protected $loadClassCache;
const VERSION ='2.4.4';
const VERSION_ID ='20404';
const VERSION ='2.3.15';
const VERSION_ID ='20315';
const MAJOR_VERSION ='2';
const MINOR_VERSION ='4';
const RELEASE_VERSION ='4';
const MINOR_VERSION ='3';
const RELEASE_VERSION ='15';
const EXTRA_VERSION ='';
public function __construct($environment, $debug)
{
$this->environment = $environment;
$this->debug = (bool) $debug;
$this->booted = false;
$this->rootDir = $this->getRootDir();
$this->name = $this->getName();
$this->bundles = array();
if ($this->debug) {
$this->startTime = microtime(true);
}
@ -2577,8 +2520,33 @@ $content = $dumper->dump(array('class'=> $class,'base_class'=> $baseClass));
if (!$this->debug) {
$content = static::stripComments($content);
}
$content = $this->removeAbsolutePathsFromContainer($content);
$cache->write($content, $container->getResources());
}
private function removeAbsolutePathsFromContainer($content)
{
if (!class_exists('Symfony\Component\Filesystem\Filesystem')) {
return $content;
}
$rootDir = $this->getRootDir();
$previous = $rootDir;
while (!file_exists($rootDir.'/composer.json')) {
if ($previous === $rootDir = realpath($rootDir.'/..')) {
return $content;
}
$previous = $rootDir;
}
$rootDir = rtrim($rootDir,'/');
$cacheDir = $this->getCacheDir();
$filesystem = new Filesystem();
return preg_replace_callback("{'([^']*)(".preg_quote($rootDir)."[^']*)'}", function ($match) use ($filesystem, $cacheDir) {
$prefix = isset($match[1]) && $match[1] ? "'$match[1]'.__DIR__" :"__DIR__";
if ('.'=== $relativePath = rtrim($filesystem->makePathRelative($match[2], $cacheDir),'/')) {
return $prefix;
}
return $prefix.".'/".$relativePath."'";
}, $content);
}
protected function getContainerLoader(ContainerInterface $container)
{
$locator = new FileLocator($this);
@ -2723,8 +2691,8 @@ use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
abstract class Bundle extends ContainerAware implements BundleInterface
{
protected $name;
protected $reflected;
protected $extension;
protected $path;
public function boot()
{
}
@ -2758,16 +2726,17 @@ return $this->extension;
}
public function getNamespace()
{
$class = get_class($this);
return substr($class, 0, strrpos($class,'\\'));
if (null === $this->reflected) {
$this->reflected = new \ReflectionObject($this);
}
return $this->reflected->getNamespaceName();
}
public function getPath()
{
if (null === $this->path) {
$reflected = new \ReflectionObject($this);
$this->path = dirname($reflected->getFileName());
if (null === $this->reflected) {
$this->reflected = new \ReflectionObject($this);
}
return $this->path;
return dirname($this->reflected->getFileName());
}
public function getParent()
{
@ -2794,14 +2763,7 @@ $ns = $prefix;
if ($relativePath = $file->getRelativePath()) {
$ns .='\\'.strtr($relativePath,'/','\\');
}
$class = $ns.'\\'.$file->getBasename('.php');
if ($this->container) {
$alias ='console.command.'.strtolower(str_replace('\\','_', $class));
if ($this->container->has($alias)) {
continue;
}
}
$r = new \ReflectionClass($class);
$r = new \ReflectionClass($ns.'\\'.$file->getBasename('.php'));
if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
$application->add($r->newInstance());
}
@ -2812,6 +2774,7 @@ $application->add($r->newInstance());
namespace Symfony\Component\Config
{
use Symfony\Component\Config\Resource\ResourceInterface;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
class ConfigCache
{
@ -2849,13 +2812,20 @@ return true;
}
public function write($content, array $metadata = null)
{
$mode = 0666 & ~umask();
$mode = 0666;
$umask = umask();
$filesystem = new Filesystem();
$filesystem->dumpFile($this->file, $content, null);
@chmod($this->file, $mode);
try {
$filesystem->chmod($this->file, $mode, $umask);
} catch (IOException $e) {
}
if (null !== $metadata && true === $this->debug) {
$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null);
@chmod($this->getMetaFile(), $mode);
try {
$filesystem->chmod($this->getMetaFile(), $mode, $umask);
} catch (IOException $e) {
}
}
}
private function getMetaFile()
@ -2871,25 +2841,21 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class HttpKernel implements HttpKernelInterface, TerminableInterface
{
protected $dispatcher;
protected $resolver;
protected $requestStack;
public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null)
public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver)
{
$this->dispatcher = $dispatcher;
$this->resolver = $resolver;
$this->requestStack = $requestStack ?: new RequestStack();
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
@ -2897,7 +2863,6 @@ try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if (false === $catch) {
$this->finishRequest($request, $type);
throw $e;
}
return $this->handleException($e, $request, $type);
@ -2909,7 +2874,6 @@ $this->dispatcher->dispatch(KernelEvents::TERMINATE, new PostResponseEvent($this
}
private function handleRaw(Request $request, $type = self::MASTER_REQUEST)
{
$this->requestStack->push($request);
$event = new GetResponseEvent($this, $request, $type);
$this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
if ($event->hasResponse()) {
@ -2943,21 +2907,14 @@ private function filterResponse(Response $response, Request $request, $type)
{
$event = new FilterResponseEvent($this, $request, $type, $response);
$this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
$this->finishRequest($request, $type);
return $event->getResponse();
}
private function finishRequest(Request $request, $type)
{
$this->dispatcher->dispatch(KernelEvents::FINISH_REQUEST, new FinishRequestEvent($this, $request, $type));
$this->requestStack->pop();
}
private function handleException(\Exception $e, $request, $type)
{
$event = new GetResponseForExceptionEvent($this, $request, $type, $e);
$this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event);
$e = $event->getException();
if (!$event->hasResponse()) {
$this->finishRequest($request, $type);
throw $e;
}
$response = $event->getResponse();
@ -3009,7 +2966,6 @@ return (string) $var;
namespace Symfony\Component\HttpKernel\DependencyInjection
{
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
@ -3019,9 +2975,9 @@ use Symfony\Component\DependencyInjection\Scope;
class ContainerAwareHttpKernel extends HttpKernel
{
protected $container;
public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null)
public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver)
{
parent::__construct($dispatcher, $controllerResolver, $requestStack);
parent::__construct($dispatcher, $controllerResolver);
$this->container = $container;
if (!$container->hasScope('request')) {
$container->addScope(new Scope('request'));

@ -7,6 +7,7 @@
"forum": "http://www.chamilo.org/forum",
"irc": "irc://irc.freenode.org/chamilo"
},
"autoload": {
"psr-0": {
"": "src/"
@ -25,6 +26,8 @@
"main/survey"
]
},
"minimum-stability": "stable",
"repositories": [
{
"type": "package",
@ -38,38 +41,101 @@
}
}
],
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/twig": "~1.12",
"twig/extensions": "~1.0",
"symfony/symfony": "~2.3.7",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"symfony/monolog-bundle": "~2.3",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
"sensio/framework-extra-bundle": "~2.3",
"sensio/generator-bundle": "~2.3",
"jms/security-extra-bundle": "~1.5",
"jms/di-extra-bundle": "~1.4",
"jms/serializer-bundle": "~0.11",
"doctrine/orm": "~2.4",
"doctrine/doctrine-bundle": "~1.2",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-fixtures-bundle": "~2.2",
"doctrine/data-fixtures": "1.0.*@dev",
"symfony-cmf/routing-bundle": "~1.1",
"knplabs/gaufrette": "0.1.4",
"knplabs/knp-menu-bundle": "1.1.x-dev",
"sonata-project/easy-extends-bundle": "~2.1@dev",
"sonata-project/seo-bundle": "~1@dev",
"sonata-project/doctrine-extensions": "~1@dev",
"sonata-project/intl-bundle": "~2.2@dev",
"sonata-project/admin-bundle": "~2.3@dev",
"sonata-project/doctrine-orm-admin-bundle": "~2.3@dev",
"sonata-project/notification-bundle": "~2.2@dev",
"sonata-project/block-bundle": "~2.2@dev",
"sonata-project/media-bundle": "~2.3@dev",
"sonata-project/user-bundle": "~2.2@dev",
"sonata-project/cache-bundle": "~2.1@dev",
"sonata-project/cache": "~1.0@dev",
"sonata-project/page-bundle": "dev-master",
"sonata-project/core-bundle": "~2.2@dev",
"sonata-project/formatter-bundle": "~2.3@dev",
"sonata-project/news-bundle": "~2.3@dev",
"sonata-project/datagrid-bundle": "~2.2@dev",
"sonata-project/exporter": "~1.3@dev",
"sonata-project/timeline-bundle": "~2.2@dev",
"sonata-project/classification-bundle": "~2.2@dev",
"sonata-project/ecommerce": "dev-develop",
"sonata-project/comment-bundle": "~2.2@dev",
"friendsofsymfony/comment-bundle": "dev-master",
"dflydev/markdown": "~1.0",
"simplethings/entity-audit-bundle": "~0.5",
"willdurand/faker-bundle": "~1.0",
"mopa/bootstrap-bundle": "v3.0.0-beta3",
"twbs/bootstrap": "v3.0.0",
"stof/doctrine-extensions-bundle": "~1.1",
"stephpy/TimelineBundle": "~2.0@dev",
"stephpy/timeline": "~1.0@dev",
"incenteev/composer-parameter-handler": "~2.0",
"braincrafted/bootstrap-bundle": "~2.0",
"gedmo/doctrine-extensions": "~2.3",
"twbs/bootstrap": "3.0.*",
"jquery/jquery": "1.10.*",
"oyejorge/less.php": "~1.5",
"sonata-project/block-bundle": "~2.2",
"knplabs/knp-menu-bundle": "~1.1",
"white-october/pagerfanta-bundle": "dev-master",
"jbroadway/urlify": "1.0.0-stable",
"chamilo/chash": "dev-master",
"doctrine/migrations": "dev-master",
"composer/composer": "1.0.*@dev",
"sonata-project/media-bundle": "~2.2"
"friendsofsymfony/advanced-encoder-bundle": "~1.0",
"hwi/oauth-bundle": "0.4.*@dev",
"friendsofsymfony/message-bundle": "~1.2",
"stof/doctrine-extensions-bundle": "~1.1@dev",
"avanzu/admin-theme-bundle": "dev-master"
},
"require-dev": {
"elao/web-profiler-extra-bundle" : "~2.3@dev",
"lexik/maintenance-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
@ -77,18 +143,21 @@
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "config/configuration.php"
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.4-dev"

@ -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')
;
}
}

@ -10,7 +10,7 @@ use Symfony\Component\Console;
use Sunra\PhpSimple\HtmlDomParser;
use ChamiloLMS\CoreBundle\Component\Editor\Connector;
use ChamiloLMS\CoreBundle\Component\Editor\Driver\CourseDriver;
use ChamiloLMS\CoreBundle\Entity\User;
use Application\Sonata\UserBundle\Entity\User;
use MediaAlchemyst\Alchemyst;
use Unoconv\Unoconv;
use Symfony\Component\Console\Output\OutputInterface;

@ -4,7 +4,7 @@
namespace ChamiloLMS\CoreBundle\Component\Editor;
use Doctrine\ORM\EntityManager;
use ChamiloLMS\CoreBundle\Entity\User;
use Application\Sonata\UserBundle\Entity\User;
use ChamiloLMS\CoreBundle\Entity\Course;
use Symfony\Component\Translation\Translator;

@ -70,7 +70,7 @@ class DropBoxDriver extends \elFinderVolumeMySQL implements InterfaceDriver
if ($this->connector->security->isGranted('IS_AUTHENTICATED_FULLY')) {
/** @var \ChamiloLMS\CoreBundle\Entity\Repository\UserRepository $repository */
/*$repository = $this->connector->entityManager->getRepository('ChamiloLMS\CoreBundle\Entity\User');
/*$repository = $this->connector->entityManager->getRepository('ChamiloLMS\UserBundle\Entity\User');
$courses = $repository->getCourses($this->connector->user);*/
//if (!empty($courses)) {

@ -22,7 +22,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @package ChamiloLMS\CoreBundle\Controller\Admin\Administrator
* @author Julio Montoya <gugli100@gmail.com>
*/
class JuryController extends CrudController
class JuryController
{
public function getClass()
{
@ -96,7 +96,7 @@ class JuryController extends CrudController
$role = $request->get('role');
/** @var \ChamiloLMS\CoreBundle\Entity\Repository\UserRepository $repo */
$repo = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\User');
$repo = $this->getManager()->getRepository('Application\Sonata\UserBundle\Entity\User');
if (empty($role)) {
$entities = $repo->searchUserByKeyword($keyword);
@ -106,7 +106,7 @@ class JuryController extends CrudController
$data = array();
if ($entities) {
/** @var \ChamiloLMS\CoreBundle\Entity\User $entity */
/** @var \ChamiloLMS\UserBundle\Entity\User $entity */
foreach ($entities as $entity) {
$data[] = array(
'key' => (string) $entity->getUserId(),
@ -136,7 +136,7 @@ class JuryController extends CrudController
$userIdList = $item->getUserId();
$userId = ($userIdList[0]);
$user = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\User')->find($userId);
$user = $this->getManager()->getRepository('ChamiloLMS\UserBundle\Entity\User')->find($userId);
if (!$user) {
throw new \Exception('Unable to found User');
}

@ -15,7 +15,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @author Julio Montoya <gugli100@gmail.com>
* @Route("/question_score")
*/
class QuestionScoreController extends CrudController
class QuestionScoreController
{
/**
*

@ -14,7 +14,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @author Julio Montoya <gugli100@gmail.com>
*/
class QuestionScoreNameController extends CrudController
class QuestionScoreNameController
{
public function getClass()
{

@ -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/';
}*/
}

@ -9,8 +9,8 @@ use ChamiloLMS\CoreBundle\Form\JuryType;
use ChamiloLMS\CoreBundle\Entity;
use ChamiloLMS\CoreBundle\Entity\BranchSync;
use ChamiloLMS\CoreBundle\Entity\Jury;
use ChamiloLMS\CoreBundle\Entity\User;
use ChamiloLMS\CoreBundle\Entity\JuryMembers;
use ChamiloLMS\UserBundle\Entity\User;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@ -21,7 +21,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @package ChamiloLMS\CoreBundle\Controller
* @author Julio Montoya <gugli100@gmail.com>
*/
class BranchDirectorController extends CrudController
class BranchDirectorController
{
public function getClass()
{

@ -20,7 +20,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @package ChamiloLMS\CoreBundle\Controller
* @author Julio Montoya <gugli100@gmail.com>
*/
class JuryMemberController extends CrudController
class JuryMemberController
{
public $maxCountOfMemberToVoteToConsiderEvaluated = 3;

@ -26,7 +26,7 @@ use Whoops\Example\Exception;
* @package ChamiloLMS\CoreBundle\Controller
* @author Julio Montoya <gugli100@gmail.com>
*/
class JuryPresidentController extends CrudController
class JuryPresidentController
{
public $maxCountOfMemberToVoteToConsiderEvaluated = 3;

@ -17,7 +17,7 @@ use ChamiloLMS\CoreBundle\Form\SessionPathType;
* @package ChamiloLMS.Controller
* @author Julio Montoya <gugli100@gmail.com>
*/
class SessionPathController extends CrudController
class SessionPathController
{
public function getClass()
{

@ -21,7 +21,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @package ChamiloLMS\CoreBundle\Controller\Admin\Administrator
* @author Julio Montoya <gugli100@gmail.com>
*/
class BranchController extends CrudController
class BranchAdminController extends Controller
{
public function getClass()
{
@ -108,7 +108,7 @@ class BranchController extends CrudController
$userIdList = $item->getUserId();
$userId = ($userIdList[0]);
$user = $this->getManager()->getRepository('ChamiloLMS\CoreBundle\Entity\User')->find($userId);
$user = $this->getManager()->getRepository('Application\Sonata\UserBundle\Entity\User')->find($userId);
if (!$user) {
throw new \Exception('Unable to found User');
}

@ -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
{
}

@ -24,48 +24,11 @@ class FrontController extends Controller
*/
public function showLoginAction()
{
$csrfToken = $this->container->get('form.csrf_provider')->generateCsrfToken('authenticate');
return $this->render(
'ChamiloLMSCoreBundle:Security:only_login.html.twig',
array('error' => null)
array('error' => null, 'csrf_token' => $csrfToken)
);
}
public function showCourseSessionBlockAction()
{
return new Response('showCourseSessionBlock');
}
public function showCourseBlockAction()
{
return new Response('showCourseSessionBlock');
}
public function showTeacherBlockAction()
{
return new Response('showCourseSessionBlock');
}
public function showSessionBlockAction()
{
return new Response('showCourseSessionBlock');
}
public function showNoticeBlockAction()
{
return new Response('showCourseSessionBlock');
}
public function showHelpBlockAction()
{
return new Response('showCourseSessionBlock');
}
public function showNavigationBlockAction()
{
return new Response('showCourseSessionBlock');
}
public function showSkillsBlockAction()
{
return new Response('showCourseSessionBlock');
}
}

@ -414,7 +414,7 @@ class IndexController extends BaseController
*/
public function userPortalAction($type = 'courses', $filter = 'current', $page = 1)
{
api_block_anonymous_users();
//api_block_anonymous_users();
// Abort request because the user is not allowed here - @todo use filters
/*if ($this->app['allowed'] == false) {

@ -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
{
}

@ -17,7 +17,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @package ChamiloLMS\CoreBundle\Controller
* @author Julio Montoya <gugli100@gmail.com>
*/
class CurriculumCategoryController extends CrudController
class CurriculumCategoryController
{
public function getClass()
{

@ -18,7 +18,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @package ChamiloLMS\CoreBundle\Controller
* @author Julio Montoya <gugli100@gmail.com>
*/
class CurriculumItemController extends CrudController
class CurriculumItemController
{
public function getControllerAlias()
{

@ -21,7 +21,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @package ChamiloLMS\CoreBundle\Controller
* @author Julio Montoya <gugli100@gmail.com>
*/
class CurriculumUserController extends CrudController
class CurriculumUserController
{
public function getControllerAlias()
{
@ -208,7 +208,7 @@ class CurriculumUserController extends CrudController
}
// @todo check this
$user = $this->get('orm.em')->getRepository('ChamiloLMS\CoreBundle\Entity\User')->find($user->getUserId());
$user = $this->get('orm.em')->getRepository('Application\Sonata\UserBundle\Entity\User')->find($user->getUserId());
$counter = 1;
$parsed = array();

@ -15,7 +15,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
* @author Julio Montoya <gugli100@gmail.com>
* @Route("/introduction")
*/
class IntroductionController extends CrudController
class IntroductionController
{
public function getClass()
{

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');
}
}

@ -3,17 +3,17 @@
namespace ChamiloLMS\CoreBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Loader;
class ChamiloLMSCoreExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
$loader->load('admin.yml');
}
public function getAlias()

@ -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]]

@ -15,11 +15,11 @@ main:
requirements:
name: .+
courses:
courses_code:
path: /courses/{code}
defaults: { _controller: ChamiloLMSCoreBundle:Tool/CourseHome/CourseHome:index }
courses:
courses_code_index:
path: /courses/{code}/index.php
defaults: { _controller: ChamiloLMSCoreBundle:Tool/CourseHome/CourseHome:index }
@ -55,4 +55,3 @@ remove_trailing_slash:
requirements:
url: .*/$
_method: GET

@ -5,7 +5,7 @@ services:
- { name: twig.extension }
listener.request_response:
class: ChamiloLMS\CoreBundle\Listener\LegacyListener
class: ChamiloLMS\CoreBundle\EventListener\LegacyListener
arguments: [@service_container]
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
@ -13,21 +13,76 @@ services:
- { name: kernel.event_listener, event: kernel.controller, method: onKernelController }
listener.locale:
class: ChamiloLMS\CoreBundle\Listener\LocaleListener
class: ChamiloLMS\CoreBundle\EventListener\LocaleListener
arguments: ["%kernel.default_locale%"]
tags:
- { name: kernel.event_subscriber }
listener.navbar_user_listener:
class: ChamiloLMS\CoreBundle\EventListener\ShowUserListener
arguments: [@service_container]
tags:
- { name: kernel.event_listener, event: theme.navbar_user, method: onShowUser }
- { name: kernel.event_listener, event: theme.sidebar_user, method: onShowUser }
listener.message_listener:
class: ChamiloLMS\CoreBundle\EventListener\MessageListener
arguments: [@service_container]
tags:
- { name: kernel.event_listener, event: theme.messages, method: onListMessages }
listener.login_success_handler:
class: ChamiloLMS\CoreBundle\Listener\LoginSuccessHandler
class: ChamiloLMS\CoreBundle\EventListener\LoginSuccessHandler
arguments: [@database_connection, @router, @security.context]
listener.logout_success_handler:
class: ChamiloLMS\CoreBundle\Listener\LogoutSuccessHandler
class: ChamiloLMS\CoreBundle\EventListener\LogoutSuccessHandler
arguments: [@database_connection, @router, @security.context]
sonata.block.service.course:
# ORMs
chamilolms.coursebundle.course:
class: ChamiloLMS\CourseBundle\Entity\CourseManager
arguments: [@doctrine]
# Course block
chamilolms.corebundle.block.course:
class: ChamiloLMS\CoreBundle\Block\CourseBlockService
arguments: ["course_block", @templating ]
tags:
- { name: sonata.block }
# Course block
chamilolms.corebundle.block.header:
class: ChamiloLMS\CoreBundle\Block\CourseBlockService
arguments: ["sonata.block.service.course", @templating ]
arguments: ["header", @templating ]
tags:
- { name: sonata.block }
# Menus
chamilolms.corebundle.menu.main_menu_builder:
class: ChamiloLMS\CoreBundle\Menu\MainMenuBuilder
arguments: [@knp_menu.factory, @router]
chamilolms.corebundle.menu.course_builder:
class: ChamiloLMS\CoreBundle\Menu\CourseMenuBuilder
arguments: [@knp_menu.factory, @chamilolms.coursebundle.course, @router]
# Blocks
chamilolms.corebundle.block.main_menu:
class: ChamiloLMS\CoreBundle\Block\MainMenuBlockService
arguments: ["chamilolms.corebundle.block.main_menu", @templating, @knp_menu.menu_provider, @chamilolms.corebundle.menu.main_menu_builder ]
tags:
- { name: sonata.block }
# Breadcrumb
chamilolms.corebundle.block.breadcrumb:
class: ChamiloLMS\CoreBundle\Block\DefaultBreadcrumbBlockService
arguments: ["default", "chamilolms.corebundle.block.breadcrumb", @templating, @knp_menu.menu_provider, @knp_menu.factory]
tags:
- { name: sonata.block }
- { name: sonata.breadcrumb }
chamilolms.userbundle.encoder:
class: Application\Sonata\UserBundle\Security\Encoder

@ -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,7 +1,7 @@
{% extends 'ChamiloLMSCoreBundle::page.html.twig' %}
{% extends '::Themes/page.html.twig' %}
{% block layout %}
{% embed 'ChamiloLMSCoreBundle::3-9.html.twig' %}
{% embed '::Layouts/3-9.html.twig' %}
{% block content %}
{% autoescape false %}

@ -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,7 +1,7 @@
{% extends 'ChamiloLMSCoreBundle::page.html.twig' %}
{% extends '::Themes/page.html.twig' %}
{% block layout %}
{% embed 'ChamiloLMSCoreBundle::3-9.html.twig' %}
{% embed '::Layouts/3-9.html.twig' %}
{% block content %}
{{ parent() }}
{% 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,7 +1,7 @@
{% extends 'ChamiloLMSCoreBundle::page.html.twig' %}
{% extends '::Themes/page.html.twig' %}
{% block layout %}
{% embed 'ChamiloLMSCoreBundle::3-9.html.twig' %}
{% embed '::Layouts/3-9.html.twig' %}
{% block content %}
{% autoescape false %}

@ -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>

@ -269,9 +269,9 @@ $(document).ready( function() {
/** Makes row highlighting possible */
// Chosen select.
$(".chzn-select").chosen({
/*$(".chzn-select").chosen({
disable_search_threshold: 10
});
});*/
// Adv multi-select text inputs.
$('.select_class_filter').each(function(){

@ -111,10 +111,10 @@
{% endif %}
{# if user is not login show the login form #}
{% render controller("ChamiloLMSCoreBundle:Front:showLogin") %}
{# render (controller('FOSUserBundle:Security:login')) #}
{# course_session_block #}
{% render controller("ChamiloLMSCoreBundle:Front:showCourseSessionBlock") %}
{# render controller("ChamiloLMSCoreBundle:Front:showCourseSessionBlock") %}
{# User picture #}
{# include "@template_style/index/user_image_block.tpl" #}
@ -126,17 +126,17 @@
{# include "@template_style/index/profile_social_block.tpl" #}
{# Course block - admin #}
{% render controller("ChamiloLMSCoreBundle:Front:showCourseBlock") %}
{# render controller("ChamiloLMSCoreBundle:Front:showCourseBlock") %}
{# Course block - teacher #}
{% render controller("ChamiloLMSCoreBundle:Front:showTeacherBlock") %}
{# render controller("ChamiloLMSCoreBundle:Front:showTeacherBlock") %}
{# Session block #}
{% render controller("ChamiloLMSCoreBundle:Front:showSessionBlock") %}
{# render controller("ChamiloLMSCoreBundle:Front:showSessionBlock") %}
{% render controller("ChamiloLMSCoreBundle:Front:showNoticeBlock") %}
{# render controller("ChamiloLMSCoreBundle:Front:showNoticeBlock") %}
{% render controller("ChamiloLMSCoreBundle:Front:showHelpBlock") %}
{# render controller("ChamiloLMSCoreBundle:Front:showHelpBlock") %}
{% render controller("ChamiloLMSCoreBundle:Front:showNavigationBlock") %}

@ -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;

@ -1,7 +1,7 @@
<?php
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
//use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
@ -16,17 +16,22 @@ $apcLoader->register(true);
require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';
// Chamilo legacy code.
require_once __DIR__.'/legacy.php';
$kernel = new AppKernel('prod', true);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);
// if you want to use the SonataPageBundle with multisite
// using different relative paths, you must change the request
// object to use the SiteRequest
use Sonata\PageBundle\Request\SiteRequest as Request;
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

@ -1,11 +1,10 @@
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
//use Symfony\Component\HttpFoundation\Request;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
umask(0000);
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
@ -17,16 +16,19 @@ if (isset($_SERVER['HTTP_CLIENT_IP'])
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
Debug::enable();
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
require_once __DIR__.'/legacy.php';
// if you want to use the SonataPageBundle with multisite
// using different relative paths, you must change the request
// object to use the SiteRequest
use Sonata\PageBundle\Request\SiteRequest as Request;
$request = Request::createFromGlobals();
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

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

@ -2,8 +2,7 @@
define('USERNAME_MAX_LENGTH', 40);
require_once __DIR__.'/../main/inc/lib/api.lib.php';
require_once __DIR__.'/../main/inc/lib/database.constants.inc.php';
require_once __DIR__.'/../main/inc/lib/internationalization.lib.php';
require_once __DIR__.'/../main/inc/lib/events.lib.inc.php';
//require_once __DIR__.'/../main/inc/lib/events.lib.inc.php';

@ -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…
Cancel
Save