Improving index and userportal blocks

skala
Julio Montoya 13 years ago
parent 915beb503a
commit 68cbd844ab
  1. 17
      composer.json
  2. 614
      composer.lock
  3. 57
      index.php
  4. 76
      main/inc/global.inc.php
  5. 3
      main/inc/lib/main_api.lib.php
  6. 1
      main/inc/lib/message.lib.php
  7. 131
      main/inc/lib/page.lib.php
  8. 2
      main/inc/lib/template.lib.php
  9. 1
      main/template/default/index/course_block.tpl
  10. 1
      main/template/default/index/help_block.tpl
  11. 1
      main/template/default/index/notice_block.tpl
  12. 1
      main/template/default/index/profile_block.tpl
  13. 1
      main/template/default/index/skills_block.tpl
  14. 1
      main/template/default/index/teacher_block.tpl
  15. 7
      main/template/default/index/user_image_block.tpl
  16. 18
      main/template/default/layout/block_menu.tpl
  17. 14
      main/template/default/layout/layout_2_col.tpl
  18. 10
      user_portal.php
  19. 2
      vendor/autoload.php
  20. 1
      vendor/composer/autoload_classmap.php
  21. 17
      vendor/composer/autoload_namespaces.php
  22. 8
      vendor/composer/autoload_real.php
  23. 994
      vendor/composer/installed.json

@ -3,6 +3,7 @@
"psr-0": { "psr-0": {
"Chamilo": "src/", "Chamilo": "src/",
"Entity" : "main/inc/" "Entity" : "main/inc/"
}, },
"classmap": [ "classmap": [
"main/auth", "main/auth",
@ -20,13 +21,21 @@
}, },
"require": { "require": {
"php": ">=5.3.2", "php": ">=5.3.2",
"silex/silex" : "1.0.*", "silex/silex" : "dev-master",
"symfony/config" : "dev-master",
"symfony/yaml" : "2.1.*",
"symfony/console" : "dev-master",
"twig/twig": ">=1.8,<2.0-dev", "twig/twig": ">=1.8,<2.0-dev",
"symfony/twig-bridge": "2.2.*@dev",
"symfony/security": "2.1.*",
"monolog/monolog" : ">=1.0.0", "monolog/monolog" : ">=1.0.0",
"symfony/config" : "2.1.*", "symfony/form": "2.1.*",
"symfony/yaml" : "2.1.*", "symfony/validator": "2.1.*",
"symfony/translation": "2.1.*",
"symfony/dependency-injection": "dev-master",
"dflydev/doctrine-orm-service-provider": "1.0.*@dev", "dflydev/doctrine-orm-service-provider": "1.0.*@dev",
"doctrine/migrations": "dev-master" "doctrine/migrations": "dev-master",
"swiftmailer/swiftmailer": ">=4.1.2,<4.2-dev"
}, },
"minimum-stability": "dev" "minimum-stability": "dev"
} }

614
composer.lock generated

@ -1,5 +1,5 @@
{ {
"hash": "fa6b9b89b9b75ed12795e0878f6e2daa", "hash": "fffb4b8e2734e9dd377b96f88b38b78f",
"packages": [ "packages": [
{ {
"name": "dflydev/doctrine-orm-service-provider", "name": "dflydev/doctrine-orm-service-provider",
@ -262,12 +262,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/doctrine/doctrine2.git", "url": "git://github.com/doctrine/doctrine2.git",
"reference": "df1336dd262faf40d5a343c1d21cbbc4aa8192d9" "reference": "4bbfe0ce8a3616b101e0bdfb0fa1f39cc8792557"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/doctrine/doctrine2/archive/df1336dd262faf40d5a343c1d21cbbc4aa8192d9.zip", "url": "https://github.com/doctrine/doctrine2/archive/4bbfe0ce8a3616b101e0bdfb0fa1f39cc8792557.zip",
"reference": "df1336dd262faf40d5a343c1d21cbbc4aa8192d9", "reference": "4bbfe0ce8a3616b101e0bdfb0fa1f39cc8792557",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -279,7 +279,7 @@
"suggest": { "suggest": {
"symfony/yaml": "If you want to use YAML Metadata Mapping Driver" "symfony/yaml": "If you want to use YAML Metadata Mapping Driver"
}, },
"time": "2012-12-04 12:29:01", "time": "2012-12-16 12:05:57",
"bin": [ "bin": [
"bin/doctrine", "bin/doctrine",
"bin/doctrine.php" "bin/doctrine.php"
@ -511,30 +511,85 @@
"microframework" "microframework"
] ]
}, },
{
"name": "swiftmailer/swiftmailer",
"version": "v4.1.8",
"source": {
"type": "git",
"url": "git://github.com/swiftmailer/swiftmailer.git",
"reference": "v4.1.8"
},
"dist": {
"type": "zip",
"url": "https://github.com/swiftmailer/swiftmailer/zipball/v4.1.8",
"reference": "v4.1.8",
"shasum": ""
},
"require": {
"php": ">=5.2.4"
},
"time": "2012-06-17 13:55:34",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
}
},
"installation-source": "dist",
"autoload": {
"files": [
"lib/swift_required.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Chris Corbyn"
}
],
"description": "Swiftmailer, free feature-rich PHP mailer",
"homepage": "http://swiftmailer.org",
"keywords": [
"mail",
"mailer"
]
},
{ {
"name": "symfony/config", "name": "symfony/config",
"version": "2.1.x-dev", "version": "dev-master",
"target-dir": "Symfony/Component/Config", "target-dir": "Symfony/Component/Config",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Config", "url": "https://github.com/symfony/Config",
"reference": "bd0f27e64df413a34bc3f68f8585fa8dce7fdb88" "reference": "1df5b632feb0034736000060592a742c754ef4ec"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/symfony/Config/archive/bd0f27e64df413a34bc3f68f8585fa8dce7fdb88.zip", "url": "https://github.com/symfony/Config/archive/1df5b632feb0034736000060592a742c754ef4ec.zip",
"reference": "bd0f27e64df413a34bc3f68f8585fa8dce7fdb88", "reference": "1df5b632feb0034736000060592a742c754ef4ec",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"time": "2012-12-11 10:40:22", "time": "2012-12-16 16:56:50",
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"installation-source": "source", "installation-source": "source",
"autoload": { "autoload": {
"psr-0": { "psr-0": {
"Symfony\\Component\\Config": "" "Symfony\\Component\\Config\\": ""
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -603,31 +658,32 @@
"homepage": "http://symfony.com" "homepage": "http://symfony.com"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/dependency-injection",
"version": "dev-master", "version": "dev-master",
"target-dir": "Symfony/Component/EventDispatcher", "target-dir": "Symfony/Component/DependencyInjection",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/EventDispatcher", "url": "https://github.com/symfony/DependencyInjection",
"reference": "eb290a447c0af5bea0d3de5d95d498afd8c82f89" "reference": "877d4065057d55f14c148b3801f77e2cba11bb8b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/symfony/EventDispatcher/archive/eb290a447c0af5bea0d3de5d95d498afd8c82f89.zip", "url": "https://github.com/symfony/DependencyInjection/archive/877d4065057d55f14c148b3801f77e2cba11bb8b.zip",
"reference": "eb290a447c0af5bea0d3de5d95d498afd8c82f89", "reference": "877d4065057d55f14c148b3801f77e2cba11bb8b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"require-dev": { "require-dev": {
"symfony/dependency-injection": "2.2.*" "symfony/yaml": "2.2.*",
"symfony/config": "2.2.*"
}, },
"suggest": { "suggest": {
"symfony/dependency-injection": "2.2.*", "symfony/yaml": "2.2.*",
"symfony/http-kernel": "2.2.*" "symfony/config": "2.2.*"
}, },
"time": "2012-11-13 14:08:04", "time": "2012-12-16 15:11:28",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -637,7 +693,57 @@
"installation-source": "source", "installation-source": "source",
"autoload": { "autoload": {
"psr-0": { "psr-0": {
"Symfony\\Component\\EventDispatcher\\": "" "Symfony\\Component\\DependencyInjection\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/event-dispatcher",
"version": "2.1.x-dev",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher",
"reference": "df9bde91f8f6fa7fb40996edf30e632cfc606b4a"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/EventDispatcher/archive/df9bde91f8f6fa7fb40996edf30e632cfc606b4a.zip",
"reference": "df9bde91f8f6fa7fb40996edf30e632cfc606b4a",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"symfony/dependency-injection": "2.1.*"
},
"suggest": {
"symfony/dependency-injection": "2.1.*",
"symfony/http-kernel": "2.1.*"
},
"time": "2012-12-06 10:00:55",
"type": "library",
"installation-source": "source",
"autoload": {
"psr-0": {
"Symfony\\Component\\EventDispatcher": ""
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -657,39 +763,86 @@
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com" "homepage": "http://symfony.com"
}, },
{
"name": "symfony/form",
"version": "2.1.x-dev",
"target-dir": "Symfony/Component/Form",
"source": {
"type": "git",
"url": "https://github.com/symfony/Form",
"reference": "cb56bed2783774ff5d9bf61f4b456d5be9ce3b81"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Form/archive/cb56bed2783774ff5d9bf61f4b456d5be9ce3b81.zip",
"reference": "cb56bed2783774ff5d9bf61f4b456d5be9ce3b81",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/event-dispatcher": "2.1.*",
"symfony/locale": "2.1.*",
"symfony/options-resolver": "2.1.*"
},
"require-dev": {
"symfony/validator": "2.1.*",
"symfony/http-foundation": "2.1.*"
},
"suggest": {
"symfony/validator": "2.1.*",
"symfony/http-foundation": "2.1.*"
},
"time": "2012-12-15 17:20:34",
"type": "library",
"installation-source": "source",
"autoload": {
"psr-0": {
"Symfony\\Component\\Form": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Form Component",
"homepage": "http://symfony.com"
},
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "dev-master", "version": "2.1.x-dev",
"target-dir": "Symfony/Component/HttpFoundation", "target-dir": "Symfony/Component/HttpFoundation",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/HttpFoundation", "url": "https://github.com/symfony/HttpFoundation",
"reference": "a18fd6c453fd9b3b4d6c78dd37e78268539474a0" "reference": "7572849520522cc1ac4b63357c39b6c2d5e5c2b2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/symfony/HttpFoundation/archive/a18fd6c453fd9b3b4d6c78dd37e78268539474a0.zip", "url": "https://github.com/symfony/HttpFoundation/archive/7572849520522cc1ac4b63357c39b6c2d5e5c2b2.zip",
"reference": "a18fd6c453fd9b3b4d6c78dd37e78268539474a0", "reference": "7572849520522cc1ac4b63357c39b6c2d5e5c2b2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"time": "2012-12-15 16:49:38", "time": "2012-12-14 21:03:29",
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"installation-source": "source", "installation-source": "source",
"autoload": { "autoload": {
"psr-0": { "psr-0": {
"Symfony\\Component\\HttpFoundation\\": "" "Symfony\\Component\\HttpFoundation": "",
}, "SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs"
"classmap": [ }
"Symfony/Component/HttpFoundation/Resources/stubs"
]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
@ -710,54 +863,94 @@
}, },
{ {
"name": "symfony/http-kernel", "name": "symfony/http-kernel",
"version": "dev-master", "version": "2.1.x-dev",
"target-dir": "Symfony/Component/HttpKernel", "target-dir": "Symfony/Component/HttpKernel",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/HttpKernel", "url": "https://github.com/symfony/HttpKernel",
"reference": "db8522c33e1eb01cbf992ad00f3cd0eb2d2e4784" "reference": "0e93b5f2068ba9efe2c943681d1e39ab58207a35"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/symfony/HttpKernel/archive/db8522c33e1eb01cbf992ad00f3cd0eb2d2e4784.zip", "url": "https://github.com/symfony/HttpKernel/archive/0e93b5f2068ba9efe2c943681d1e39ab58207a35.zip",
"reference": "db8522c33e1eb01cbf992ad00f3cd0eb2d2e4784", "reference": "0e93b5f2068ba9efe2c943681d1e39ab58207a35",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"symfony/event-dispatcher": "2.2.*", "symfony/event-dispatcher": "2.1.*",
"symfony/http-foundation": "2.2.*" "symfony/http-foundation": "2.1.*"
}, },
"require-dev": { "require-dev": {
"symfony/browser-kit": "2.2.*", "symfony/browser-kit": "2.1.*",
"symfony/class-loader": "2.2.*", "symfony/class-loader": "2.1.*",
"symfony/config": "2.2.*", "symfony/config": "2.1.*",
"symfony/console": "2.2.*", "symfony/console": "2.1.*",
"symfony/dependency-injection": "2.2.*", "symfony/dependency-injection": "2.1.*",
"symfony/finder": "2.2.*", "symfony/finder": "2.1.*",
"symfony/process": "2.2.*", "symfony/process": "2.1.*",
"symfony/routing": "2.2.*", "symfony/routing": "2.1.*"
"symfony/stopwatch": "2.2.*"
}, },
"suggest": { "suggest": {
"symfony/browser-kit": "2.2.*", "symfony/browser-kit": "2.1.*",
"symfony/class-loader": "2.2.*", "symfony/class-loader": "2.1.*",
"symfony/config": "2.2.*", "symfony/config": "2.1.*",
"symfony/console": "2.2.*", "symfony/console": "2.1.*",
"symfony/dependency-injection": "2.2.*", "symfony/dependency-injection": "2.1.*",
"symfony/finder": "2.2.*" "symfony/finder": "2.1.*"
}, },
"time": "2012-12-15 16:49:38", "time": "2012-12-15 16:44:57",
"type": "library", "type": "library",
"extra": { "installation-source": "source",
"branch-alias": { "autoload": {
"dev-master": "2.2-dev" "psr-0": {
"Symfony\\Component\\HttpKernel": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
} }
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com"
}, },
{
"name": "symfony/locale",
"version": "2.1.x-dev",
"target-dir": "Symfony/Component/Locale",
"source": {
"type": "git",
"url": "https://github.com/symfony/Locale",
"reference": "978d3798f02d2a6a9ed9e38db00680ff5319c6fc"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Locale/archive/978d3798f02d2a6a9ed9e38db00680ff5319c6fc.zip",
"reference": "978d3798f02d2a6a9ed9e38db00680ff5319c6fc",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-intl": ">=5.3.3"
},
"time": "2012-12-15 17:28:15",
"type": "library",
"installation-source": "source", "installation-source": "source",
"autoload": { "autoload": {
"psr-0": { "psr-0": {
"Symfony\\Component\\HttpKernel\\": "" "Symfony\\Component\\Locale": ""
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -774,9 +967,57 @@
"homepage": "http://symfony.com/contributors" "homepage": "http://symfony.com/contributors"
} }
], ],
"description": "Symfony HttpKernel Component", "description": "Symfony Locale Component",
"homepage": "http://symfony.com" "homepage": "http://symfony.com"
}, },
{
"name": "symfony/options-resolver",
"version": "2.1.x-dev",
"target-dir": "Symfony/Component/OptionsResolver",
"source": {
"type": "git",
"url": "https://github.com/symfony/OptionsResolver",
"reference": "d8ef60e27b81b015815478a06a5653ae0654a188"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/OptionsResolver/archive/d8ef60e27b81b015815478a06a5653ae0654a188.zip",
"reference": "d8ef60e27b81b015815478a06a5653ae0654a188",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-12-06 10:00:55",
"type": "library",
"installation-source": "source",
"autoload": {
"psr-0": {
"Symfony\\Component\\OptionsResolver": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony OptionsResolver Component",
"homepage": "http://symfony.com",
"keywords": [
"configuration",
"config",
"options"
]
},
{ {
"name": "symfony/routing", "name": "symfony/routing",
"version": "dev-master", "version": "dev-master",
@ -836,6 +1077,236 @@
"description": "Symfony Routing Component", "description": "Symfony Routing Component",
"homepage": "http://symfony.com" "homepage": "http://symfony.com"
}, },
{
"name": "symfony/security",
"version": "2.1.x-dev",
"target-dir": "Symfony/Component/Security",
"source": {
"type": "git",
"url": "https://github.com/symfony/Security",
"reference": "78e25f39b81ccadc5ead77f2c1e1099492875a9c"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Security/archive/78e25f39b81ccadc5ead77f2c1e1099492875a9c.zip",
"reference": "78e25f39b81ccadc5ead77f2c1e1099492875a9c",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"symfony/event-dispatcher": "2.1.*",
"symfony/http-foundation": "2.1.*",
"symfony/http-kernel": "2.1.*"
},
"require-dev": {
"symfony/form": "2.1.*",
"symfony/routing": "2.1.*",
"symfony/validator": "2.1.*",
"doctrine/common": ">=2.2,<2.4-dev",
"doctrine/dbal": ">=2.2,<2.4-dev"
},
"suggest": {
"doctrine/dbal": "to use the built-in ACL implementation",
"symfony/class-loader": "2.1.*",
"symfony/finder": "2.1.*",
"symfony/form": "2.1.*",
"symfony/validator": "2.1.*",
"symfony/routing": "2.1.*"
},
"time": "2012-12-11 10:40:22",
"type": "library",
"installation-source": "source",
"autoload": {
"psr-0": {
"Symfony\\Component\\Security": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Security Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/translation",
"version": "2.1.x-dev",
"target-dir": "Symfony/Component/Translation",
"source": {
"type": "git",
"url": "https://github.com/symfony/Translation",
"reference": "64ab9706970fdde7d872f9713d023dd47c3136bc"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Translation/archive/64ab9706970fdde7d872f9713d023dd47c3136bc.zip",
"reference": "64ab9706970fdde7d872f9713d023dd47c3136bc",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"symfony/config": "2.1.*",
"symfony/yaml": "2.1.*"
},
"suggest": {
"symfony/config": "2.1.*",
"symfony/yaml": "2.1.*"
},
"time": "2012-12-06 10:00:55",
"type": "library",
"installation-source": "source",
"autoload": {
"psr-0": {
"Symfony\\Component\\Translation": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Translation Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/twig-bridge",
"version": "dev-master",
"target-dir": "Symfony/Bridge/Twig",
"source": {
"type": "git",
"url": "https://github.com/symfony/TwigBridge",
"reference": "83952ceb104f735ffc243f0de1fc2c2101dccdad"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/TwigBridge/archive/83952ceb104f735ffc243f0de1fc2c2101dccdad.zip",
"reference": "83952ceb104f735ffc243f0de1fc2c2101dccdad",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"twig/twig": ">=1.9.1,<2.0-dev"
},
"require-dev": {
"symfony/form": "2.2.*",
"symfony/routing": "2.2.*",
"symfony/templating": "2.2.*",
"symfony/translation": "2.2.*",
"symfony/yaml": "2.2.*",
"symfony/security": "2.2.*"
},
"suggest": {
"symfony/form": "2.2.*",
"symfony/routing": "2.2.*",
"symfony/templating": "2.2.*",
"symfony/translation": "2.2.*",
"symfony/yaml": "2.2.*",
"symfony/security": "2.2.*"
},
"time": "2012-12-16 13:02:47",
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-0": {
"Symfony\\Bridge\\Twig\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Twig Bridge",
"homepage": "http://symfony.com"
},
{
"name": "symfony/validator",
"version": "2.1.x-dev",
"target-dir": "Symfony/Component/Validator",
"source": {
"type": "git",
"url": "https://github.com/symfony/Validator",
"reference": "935d8689a252ba615e211c3c52956423d09f8042"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Validator/archive/935d8689a252ba615e211c3c52956423d09f8042.zip",
"reference": "935d8689a252ba615e211c3c52956423d09f8042",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"symfony/http-foundation": "2.1.*",
"symfony/locale": "2.1.*",
"symfony/yaml": "2.1.*"
},
"suggest": {
"doctrine/common": ">=2.1,<2.4-dev",
"symfony/http-foundation": "2.1.*",
"symfony/yaml": "2.1.*"
},
"time": "2012-12-12 13:03:58",
"type": "library",
"installation-source": "source",
"autoload": {
"psr-0": {
"Symfony\\Component\\Validator": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Validator Component",
"homepage": "http://symfony.com"
},
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "2.1.x-dev", "version": "2.1.x-dev",
@ -885,18 +1356,18 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/fabpot/Twig.git", "url": "git://github.com/fabpot/Twig.git",
"reference": "2757f482c679aa00bb8c7fdfcb337f2bb922fa5a" "reference": "6c01c14fd8f42348a032148ebecb6e034e9e18bd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/fabpot/Twig/archive/2757f482c679aa00bb8c7fdfcb337f2bb922fa5a.zip", "url": "https://github.com/fabpot/Twig/archive/6c01c14fd8f42348a032148ebecb6e034e9e18bd.zip",
"reference": "2757f482c679aa00bb8c7fdfcb337f2bb922fa5a", "reference": "6c01c14fd8f42348a032148ebecb6e034e9e18bd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.2.4" "php": ">=5.2.4"
}, },
"time": "2012-12-11 14:30:16", "time": "2012-12-16 07:55:06",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
@ -936,6 +1407,11 @@
], ],
"minimum-stability": "dev", "minimum-stability": "dev",
"stability-flags": { "stability-flags": {
"silex/silex": 20,
"symfony/config": 20,
"symfony/console": 20,
"symfony/twig-bridge": 20,
"symfony/dependency-injection": 20,
"dflydev/doctrine-orm-service-provider": 20, "dflydev/doctrine-orm-service-provider": 20,
"doctrine/migrations": 20 "doctrine/migrations": 20
} }

@ -41,7 +41,6 @@ $htmlHeadXtra[] ='
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Entity\EntityCourse;
class IndexController class IndexController
{ {
@ -55,6 +54,7 @@ class IndexController
if (!empty($logout)) { if (!empty($logout)) {
$this->logout(); $this->logout();
} }
//$article = $app['orm.em']->getRepository('Entity\EntityCourse'); //$article = $app['orm.em']->getRepository('Entity\EntityCourse');
//$courses_query = $app['orm.em']->createQuery('SELECT a FROM Entity\EntityCourse a'); //$courses_query = $app['orm.em']->createQuery('SELECT a FROM Entity\EntityCourse a');
@ -62,19 +62,15 @@ class IndexController
//require_once '/var/www/chamilo11/main/inc/Entity/EntityCourse.php'; //require_once '/var/www/chamilo11/main/inc/Entity/EntityCourse.php';
//$article = $app['orm.em']->getRepository('EntityCourse'); //$article = $app['orm.em']->getRepository('EntityCourse');
//var_dump($article); //var_dump($article);
//$courses_query = $app['orm.em']->createQuery('SELECT a FROM Entity\EntityCourse a');
/* /*
$courses_query = $app['orm.em']->createQuery('SELECT a FROM Entity\EntityCourse a');
//var_dump($courses_query);
$paginator = new Doctrine\ORM\Tools\Pagination\Paginator($courses_query, $fetchJoinCollection = true); $paginator = new Doctrine\ORM\Tools\Pagination\Paginator($courses_query, $fetchJoinCollection = true);
$c = count($paginator); $c = count($paginator);
var_dump($c);
/*
$c = count($paginator);
foreach ($paginator as $course) { foreach ($paginator as $course) {
echo $course->getCode() . "\n"; echo $course->getCode() . "\n";
}*/ }
exit;*/
//$app['orm.em']->find('EntityCourse', 1); //$app['orm.em']->find('EntityCourse', 1);
//var_dump($app['orm.ems']['mysql']); //var_dump($app['orm.ems']['mysql']);
@ -112,13 +108,14 @@ class IndexController
$this->set_login_form($app); $this->set_login_form($app);
if (!api_is_anonymous()) { if (!api_is_anonymous()) {
$app['template']->assign('profile_block', PageController::return_profile_block()); PageController::return_profile_block();
$app['template']->assign('user_image_block', PageController::return_user_image_block());
PageController::return_user_image_block();
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
$app['template']->assign('course_block', PageController::return_course_block()); PageController::return_course_block();
} else { } else {
$app['template']->assign('teacher_block', PageController::return_teacher_link()); PageController::return_teacher_link();
} }
} }
@ -141,15 +138,16 @@ class IndexController
$app['template']->assign('navigation_course_links', $nav_links); $app['template']->assign('navigation_course_links', $nav_links);
$app['template']->assign('main_navigation_block', $nav_links); $app['template']->assign('main_navigation_block', $nav_links);
$app['template']->assign('notice_block', PageController::return_notice()); PageController::return_notice();
$app['template']->assign('help_block', PageController::return_help()); PageController::return_help();
if (api_is_platform_admin() || api_is_drh()) { if (api_is_platform_admin() || api_is_drh()) {
$app['template']->assign('skills_block', PageController::return_skills_links()); PageController::return_skills_links();
} }
$response = $app['template']->render_layout('layout_2_col.tpl'); $response = $app['template']->render_layout('layout_2_col.tpl');
return new Response($response, 200, array('Cache-Control' => 's-maxage=3600, public'));
//return new Response($response, 200, array()); //return new Response($response, 200, array('Cache-Control' => 's-maxage=3600, public'));
return new Response($response, 200, array());
} }
function check_last_login() { function check_last_login() {
@ -192,14 +190,15 @@ class IndexController
} }
function set_login_form(Application $app) { function set_login_form(Application $app) {
$login_form = '';
$user_id = api_get_user_id(); $user_id = api_get_user_id();
$login_form = null;
if (!($user_id) || api_is_anonymous($user_id)) { if (!$user_id || api_is_anonymous($user_id)) {
// Only display if the user isn't logged in. // Only display if the user isn't logged in.
$app['template']->assign('login_language_form', api_display_language_form(true)); $app['template']->assign('login_language_form', api_display_language_form(true));
$app['template']->assign('login_form', self::display_login_form()); //self::display_login_form($app);
$app['template']->assign('login_form', self::display_login_form($app));
if (api_get_setting('allow_lostpassword') == 'true' || api_get_setting('allow_registration') == 'true') { if (api_get_setting('allow_lostpassword') == 'true' || api_get_setting('allow_registration') == 'true') {
$login_form .= '<ul class="nav nav-list">'; $login_form .= '<ul class="nav nav-list">';
@ -220,7 +219,19 @@ class IndexController
online_logout($user_id, true); online_logout($user_id, true);
} }
function display_login_form() { function display_login_form(Application $app) {
/*{{ form_widget(form) }}
$form = $app['form.factory']->createBuilder('form')
->add('name')
->add('email')
->add('gender', 'choice', array(
'choices' => array(1 => 'male', 2 => 'female'),
'expanded' => true,
))
->getForm();
return $app['template']->assign('form', $form->createView());
*/
$form = new FormValidator('formLogin', 'POST', null, null, array('class'=>'form-vertical')); $form = new FormValidator('formLogin', 'POST', null, null, array('class'=>'form-vertical'));
$form->addElement('text', 'login', get_lang('UserName'), array('class' => 'span2 autocapitalize_off', 'autofocus' => 'autofocus')); $form->addElement('text', 'login', get_lang('UserName'), array('class' => 'span2 autocapitalize_off', 'autofocus' => 'autofocus'));
$form->addElement('password', 'password', get_lang('Pass'), array('class' => 'span2')); $form->addElement('password', 'password', get_lang('Pass'), array('class' => 'span2'));

@ -78,6 +78,7 @@ $userPasswordCrypted = (!empty($_configuration['password_encr
// Include the main Chamilo platform library file. // Include the main Chamilo platform library file.
require_once $includePath.'/lib/main_api.lib.php'; require_once $includePath.'/lib/main_api.lib.php';
// Specification for usernames: // Specification for usernames:
// 1. ASCII-letters, digits, "." (dot), "_" (underscore) are acceptable, 40 characters maximum length. // 1. ASCII-letters, digits, "." (dot), "_" (underscore) are acceptable, 40 characters maximum length.
// 2. Empty username is formally valid, but it is reserved for the anonymous user. // 2. Empty username is formally valid, but it is reserved for the anonymous user.
@ -113,11 +114,10 @@ define("_MPDF_TEMP_PATH", api_get_path(SYS_ARCHIVE_PATH));
define('_MPDF_PATH', api_get_path(LIBRARY_PATH).'mpdf/'); define('_MPDF_PATH', api_get_path(LIBRARY_PATH).'mpdf/');
//Composer autoloader //Composer autoloader
$loader = require_once __DIR__.'../../../vendor/autoload.php'; require_once __DIR__.'../../../vendor/autoload.php';
//Start Silex //Start Silex
use Silex\Application; use Silex\Application;
use Symfony\Component\HttpFoundation\Response;
use Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider; use Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider;
$app = new Application(); $app = new Application();
@ -133,6 +133,37 @@ $app->register(new Silex\Provider\HttpCacheServiceProvider(), array(
)); ));
*/ */
$app->register(new Silex\Provider\ValidatorServiceProvider());
//URL generator provider
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
$app->register(new Silex\Provider\TranslationServiceProvider(),array(
'locale_fallback' => 'en'
));
//Form provider
$app->register(new Silex\Provider\FormServiceProvider());
//Monolog
$app->register(new Silex\Provider\MonologServiceProvider(), array(
'monolog.logfile' => api_get_path(SYS_ARCHIVE_PATH).'chamilo_development.log',
'monolog.name' => 'chamilo',
));
/*
//Monolog examples
$app['monolog']->addDebug('Testing the Monolog logging.');
$app['monolog']->addInfo('Testing the Monolog logging.');
$app['monolog']->addError('Testing the Monolog logging.');
*/
$app['translator.messages'] = array();
//Setting the Twig service provider //Setting the Twig service provider
$app->register(new Silex\Provider\TwigServiceProvider(), array( $app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => array( 'twig.path' => array(
@ -140,7 +171,7 @@ $app->register(new Silex\Provider\TwigServiceProvider(), array(
api_get_path(SYS_PLUGIN_PATH) //plugin folder api_get_path(SYS_PLUGIN_PATH) //plugin folder
), ),
'twig.options' => array( 'twig.options' => array(
//'twig.form.templates' => array('form_div_layout.html.twig', 'common/form_div_layout.html.twig'), 'twig.form.templates' => array('form_div_layout.html.twig'),
'debug' => $app['debug'], 'debug' => $app['debug'],
'charset' => 'utf-8', 'charset' => 'utf-8',
'strict_variables' => false, 'strict_variables' => false,
@ -150,6 +181,9 @@ $app->register(new Silex\Provider\TwigServiceProvider(), array(
) )
)); ));
//$app['twig']->addExtension(new Twig_Extension_Debug());
//Setting Twig options //Setting Twig options
$app['twig'] = $app->share($app->extend('twig', function($twig, $app) { $app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
$twig->addFilter('get_lang', new Twig_Filter_Function('get_lang')); $twig->addFilter('get_lang', new Twig_Filter_Function('get_lang'));
@ -164,7 +198,6 @@ $app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
return $twig; return $twig;
})); }));
//Setting Doctrine service provider //Setting Doctrine service provider
//Gathering default info of the current installation from the $_configuration array //Gathering default info of the current installation from the $_configuration array
@ -178,6 +211,8 @@ $app->register(new Silex\Provider\DoctrineServiceProvider(), array(
) )
)); ));
$app->register(new Silex\Provider\SwiftmailerServiceProvider());
$app->register(new DoctrineOrmServiceProvider, array( $app->register(new DoctrineOrmServiceProvider, array(
"orm.proxies_dir" => $app['db.orm.proxies_dir'], "orm.proxies_dir" => $app['db.orm.proxies_dir'],
"orm.em.options" => array( "orm.em.options" => array(
@ -215,7 +250,6 @@ $app->register(new DoctrineOrmServiceProvider, array(
), ),
)); ));
/* /*
// Register Doctrine ORM // Register Doctrine ORM
$app->register(new Nutwerk\Provider\DoctrineORMServiceProvider(), array( $app->register(new Nutwerk\Provider\DoctrineORMServiceProvider(), array(
@ -231,14 +265,6 @@ $app->register(new Nutwerk\Provider\DoctrineORMServiceProvider(), array(
)), )),
));*/ ));*/
//URL generator provider
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
//Monolog
$app->register(new Silex\Provider\MonologServiceProvider(), array(
'monolog.logfile' => api_get_path(SYS_ARCHIVE_PATH).'chamilo_development.log',
'monolog.name' => 'chamilo',
));
//Creating Chamilo service provider //Creating Chamilo service provider
use Silex\ServiceProviderInterface; use Silex\ServiceProviderInterface;
@ -263,6 +289,7 @@ class ChamiloServiceProvider implements ServiceProviderInterface {
$app->register(new ChamiloServiceProvider(), array()); $app->register(new ChamiloServiceProvider(), array());
//Manage error messages //Manage error messages
/*
$app->error(function (\Exception $e, $code) use ($app) { $app->error(function (\Exception $e, $code) use ($app) {
if ($app['debug']) { if ($app['debug']) {
//return; //return;
@ -285,7 +312,7 @@ $app->error(function (\Exception $e, $code) use ($app) {
$app['template']->assign('error_message', $message); $app['template']->assign('error_message', $message);
$response = $app['template']->render_layout('error.tpl'); $response = $app['template']->render_layout('error.tpl');
return new Response($response); return new Response($response);
}); });*/
//Filters //Filters
$app->before(function() use ($app) { $app->before(function() use ($app) {
@ -302,7 +329,18 @@ $app->before(function() use ($app) {
$app->after(function() { $app->after(function() {
}); });
$app->finish(function() { $app->finish(function() use ($app) {
//@todo will be removed before a stable release
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$message = "Page loaded in:".($mtime-START);
$app['monolog']->addInfo($message);
$message = "memory_get_usage: ".format_file_size(memory_get_usage(true));
$app['monolog']->addInfo($message);
$message = "memory_get_peak_usage: ".format_file_size(memory_get_peak_usage(true));
$app['monolog']->addInfo($message);
}); });
$app['template.show_header'] = true; $app['template.show_header'] = true;
@ -319,17 +357,16 @@ $app['default_layout'] = 'layout_1_col.tpl';
//Database constants //Database constants
require_once $lib_path.'database.constants.inc.php'; require_once $lib_path.'database.constants.inc.php';
//Removing support for this files: //@todo use swift mail
//require_once api_get_path(CONFIGURATION_PATH).'add_course.conf.php';
//require_once api_get_path(CONFIGURATION_PATH).'course_info.conf.php';
require_once $lib_path.'mail.lib.inc.php'; require_once $lib_path.'mail.lib.inc.php';
require_once $lib_path.'fileManage.lib.php'; require_once $lib_path.'fileManage.lib.php';
require_once $lib_path.'text.lib.php'; require_once $lib_path.'text.lib.php';
require_once $lib_path.'array.lib.php'; require_once $lib_path.'array.lib.php';
require_once $lib_path.'events.lib.inc.php'; require_once $lib_path.'events.lib.inc.php';
require_once $lib_path.'online.inc.php'; require_once $lib_path.'online.inc.php';
/* DATABASE CONNECTION */ /* DATABASE CONNECTION */
// @todo: this shouldn't be done here. It should be stored correctly during installation. // @todo: this shouldn't be done here. It should be stored correctly during installation.
@ -383,6 +420,7 @@ if (!Database::select_db($_configuration['main_database'], $database_connection)
// The platform's character set must be retrieved at this early moment. // The platform's character set must be retrieved at this early moment.
$sql = "SELECT selected_value FROM settings_current WHERE variable = 'platform_charset';"; $sql = "SELECT selected_value FROM settings_current WHERE variable = 'platform_charset';";
$result = Database::query($sql); $result = Database::query($sql);
while ($row = @Database::fetch_array($result)) { while ($row = @Database::fetch_array($result)) {
$charset = $row[0]; $charset = $row[0];

@ -3485,7 +3485,7 @@ function api_display_language_form($hide_if_no_choice = false) {
$original_languages = $language_list['name']; $original_languages = $language_list['name'];
$folder = $language_list['folder']; // This line is probably no longer needed. $folder = $language_list['folder']; // This line is probably no longer needed.
$html = ' $html = '
<script type="text/javascript"> <script>
<!-- <!--
function jumpMenu(targ,selObj,restore){ // v3.0 function jumpMenu(targ,selObj,restore){ // v3.0
eval(targ+".location=\'"+selObj.options[selObj.selectedIndex].value+"\'"); eval(targ+".location=\'"+selObj.options[selObj.selectedIndex].value+"\'");
@ -3503,7 +3503,6 @@ function api_display_language_form($hide_if_no_choice = false) {
$option_end = '>'; $option_end = '>';
} }
$html .= '<option value="'.api_get_self().'?language='.$folder[$key].'"'.$option_end; $html .= '<option value="'.api_get_self().'?language='.$folder[$key].'"'.$option_end;
//echo substr($value, 0, 16); // Cut string to keep 800x600 aspect.
$html .= $value.'</option>'; $html .= $value.'</option>';
} }
$html .= '</select>'; $html .= '</select>';

@ -86,7 +86,6 @@ class MessageManager
if (!api_get_user_id()) { if (!api_get_user_id()) {
return false; return false;
} }
$i=0;
$query = "SELECT * FROM $table_message WHERE user_receiver_id = ".api_get_user_id()." AND msg_status = ".MESSAGE_STATUS_UNREAD; $query = "SELECT * FROM $table_message WHERE user_receiver_id = ".api_get_user_id()." AND msg_status = ".MESSAGE_STATUS_UNREAD;
$result = Database::query($query); $result = Database::query($query);
$i = Database::num_rows($result); $i = Database::num_rows($result);

@ -1,14 +1,18 @@
<?php <?php
/** /**
* Controller for pages presentation in general * Controller for pages presentation in general
* @license see /license.txt * @license see /license.txt
* @package chamilo.page.controller * @package chamilo.page.controller
* @author Julio Montoya <gugli100@gmail.com> * @author Julio Montoya <gugli100@gmail.com>
*/ */
/** /**
* Page controller * Page controller
*/ */
class PageController { class PageController
{
/** /**
* Returns an HTML block with the user picture (as a link in a <div>) * Returns an HTML block with the user picture (as a link in a <div>)
* @param int User ID (if not provided, will use the user ID from session) * @param int User ID (if not provided, will use the user ID from session)
@ -40,9 +44,10 @@ class PageController {
$profile_content .='<a style="text-align:center" href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].'></a>'; $profile_content .='<a style="text-align:center" href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].'></a>';
} }
} }
$html = self::show_right_block(null, $profile_content, 'user_image_block', array('style' => 'text-align:center;'));
return $html; self::show_right_block(null, null, 'user_image_block', array('content' => $profile_content));
} }
/** /**
* Return a block with course-related links. The resulting HTML block's * Return a block with course-related links. The resulting HTML block's
* contents are only based on the user defined by the active session. * contents are only based on the user defined by the active session.
@ -50,8 +55,6 @@ class PageController {
* @assert () != '' * @assert () != ''
*/ */
static function return_course_block() { static function return_course_block() {
$html = '';
$show_create_link = false; $show_create_link = false;
$show_course_link = false; $show_course_link = false;
@ -75,39 +78,33 @@ class PageController {
} }
// My account section // My account section
$my_account_content = '<ul class="nav nav-list">'; $my_account_content = array();
if ($show_create_link) { if ($show_create_link) {
$my_account_content .= '<li><a href="main/create_course/add_course.php" class="add course">'.(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'</a></li>'; $my_account_content[] = array('href' => 'main/create_course/add_course.php', 'title' => api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate'));
} }
//Sort courses //Sort courses
$url = api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses'; $url = api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses';
$my_account_content .= '<li>'.Display::url(get_lang('SortMyCourses'), $url, array('class' => 'sort course')).'</li>'; $my_account_content[] = array('href' => $url, 'title' => get_lang('SortMyCourses'));
//Course management //Course management
if ($show_course_link) { if ($show_course_link) {
if (!api_is_drh()) { if (!api_is_drh()) {
$my_account_content .= '<li><a href="main/auth/courses.php" class="list course">'.get_lang('CourseCatalog').'</a></li>'; $my_account_content[] = array('href' => 'main/auth/courses.php', 'title' => get_lang('CourseCatalog'));
if (isset($_GET['history']) && intval($_GET['history']) == 1) { if (isset($_GET['history']) && intval($_GET['history']) == 1) {
$my_account_content .= '<li><a href="user_portal.php">'.get_lang('DisplayTrainingList').'</a></li>'; $my_account_content [] = array('href' => 'user_portal.php', 'title' => get_lang('DisplayTrainingList'));
} else { } else {
$my_account_content .= '<li><a href="user_portal.php?history=1" class="history course">'.get_lang('HistoryTrainingSessions').'</a></li>'; $my_account_content [] = array('href' => 'user_portal.php?history=1', 'title' => get_lang('HistoryTrainingSessions'));
} }
} else { } else {
$my_account_content .= '<li><a href="main/dashboard/index.php">'.get_lang('Dashboard').'</a></li>'; $my_account_content .= array('href' => 'main/dashboard/index.php', 'title' => get_lang('Dashboard'));
} }
} }
self::show_right_block(get_lang('Courses'), $my_account_content, 'course_block');
$my_account_content .= '</ul>';
if (!empty($my_account_content)) {
$html = self::show_right_block(get_lang('Courses'), $my_account_content, 'course_block');
}
return $html;
} }
/** /**
* Returns the profile block, showing links to the messaging and social * Returns the profile block, showing links to the messaging and social
* network tools. The user ID is taken from the active session * network tools. The user ID is taken from the active session
@ -120,8 +117,7 @@ class PageController {
if (empty($user_id)) { if (empty($user_id)) {
return; return;
} }
$profile_content = array();
$profile_content = '<ul class="nav nav-list">';
// @todo Add a platform setting to add the user image. // @todo Add a platform setting to add the user image.
if (api_get_setting('allow_message_tool') == 'true') { if (api_get_setting('allow_message_tool') == 'true') {
@ -142,19 +138,18 @@ class PageController {
if (api_get_setting('allow_social_tool') == 'true') { if (api_get_setting('allow_social_tool') == 'true') {
$link = '?f=social'; $link = '?f=social';
} }
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$link.'">'.get_lang('Inbox').$cant_msg.' </a></li>'; $profile_content[] = array('href' => api_get_path(WEB_PATH).'main/messages/inbox.php'.$link, 'title' => get_lang('Inbox').$cant_msg);
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'">'.get_lang('Compose').' </a></li>'; $profile_content[] = array('href' => api_get_path(WEB_PATH).'main/messages/new_message.php'.$link, 'title' => get_lang('Compose'));
if (api_get_setting('allow_social_tool') == 'true') { if (api_get_setting('allow_social_tool') == 'true') {
$total_invitations = Display::badge($total_invitations); $total_invitations = Display::badge($total_invitations);
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.get_lang('PendingInvitations').$total_invitations.'</a></li>'; $profile_content[] = array('href' => api_get_path(WEB_PATH).'main/social/invitations.php', 'title' => get_lang('PendingInvitations').$total_invitations);
} }
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/auth/profile.php">'.get_lang('EditProfile').'</a></li>'; $profile_content[] = array('href' => api_get_path(WEB_PATH).'main/auth/profile.php', 'title' => get_lang('PendingInvitations').$total_invitations);
} }
$profile_content .= '</ul>'; self::show_right_block(get_lang('Profile'), $profile_content, 'profile_block');
$html = self::show_right_block(get_lang('Profile'), $profile_content, 'profile_block');
return $html;
} }
/** /**
* Returns a list of the most popular courses of the moment (also called * Returns a list of the most popular courses of the moment (also called
* "hot courses"). * "hot courses").
@ -165,6 +160,7 @@ class PageController {
static function return_hot_courses() { static function return_hot_courses() {
return CourseManager::return_hot_courses(); return CourseManager::return_hot_courses();
} }
/** /**
* Returns an online help block read from the home/home_menu_[lang].html * Returns an online help block read from the home/home_menu_[lang].html
* file * file
@ -177,9 +173,6 @@ class PageController {
$sys_path = api_get_path(SYS_PATH); $sys_path = api_get_path(SYS_PATH);
$platformLanguage = api_get_setting('platformLanguage'); $platformLanguage = api_get_setting('platformLanguage');
// Help section.
/* Hide right menu "general" and other parts on anonymous right menu. */
if (!isset($user_selected_language)) { if (!isset($user_selected_language)) {
$user_selected_language = $platformLanguage; $user_selected_language = $platformLanguage;
} }
@ -187,33 +180,28 @@ class PageController {
$html = null; $html = null;
$home_menu = @(string) file_get_contents($sys_path.$home.'home_menu_'.$user_selected_language.'.html'); $home_menu = @(string) file_get_contents($sys_path.$home.'home_menu_'.$user_selected_language.'.html');
if (!empty($home_menu)) { if (!empty($home_menu)) {
$home_menu_content = '<ul class="nav nav-list">'; $home_menu_content = api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
$home_menu_content .= api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu))); self::show_right_block(get_lang('MenuGeneral'), null, 'help_block', array('content' => $home_menu_content));
$home_menu_content .= '</ul>';
$html .= self::show_right_block(get_lang('MenuGeneral'), $home_menu_content, 'help_block');
} }
return $html;
} }
/** /**
* Returns an HTML block with links to the skills tools * Returns an HTML block with links to the skills tools
* @return string HTML <div> block * @return string HTML <div> block
* @assert () != '' * @assert () != ''
*/ */
static function return_skills_links() { static function return_skills_links() {
$html = '';
if (api_get_setting('allow_skills_tool') == 'true') { if (api_get_setting('allow_skills_tool') == 'true') {
$content = '<ul class="nav nav-list">'; $content = array();
$content[]= array('title' => get_lang('MySkills'), 'href' => api_get_path(WEB_CODE_PATH).'social/skills_wheel.php');
$content .= Display::tag('li', Display::url(get_lang('MySkills'), api_get_path(WEB_CODE_PATH).'social/skills_wheel.php'));
if (api_get_setting('allow_hr_skills_management') == 'true' || api_is_platform_admin()) { if (api_get_setting('allow_hr_skills_management') == 'true' || api_is_platform_admin()) {
$content .= Display::tag('li', Display::url(get_lang('ManageSkills'), api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php')); $content[]= array('title' => get_lang('ManageSkills'), 'href' => api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php');
} }
$content .= '</ul>'; self::show_right_block(get_lang("Skills"), $content, 'skill_block');
$html = self::show_right_block(get_lang("Skills"), $content, 'skill_block');
} }
return $html;
} }
/** /**
* Returns an HTML block with the notice, as found in the * Returns an HTML block with the notice, as found in the
* home/home_notice_[lang].html file * home/home_notice_[lang].html file
@ -235,9 +223,8 @@ class PageController {
if (!empty($home_notice)) { if (!empty($home_notice)) {
$home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice))); $home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice)));
$home_notice = Display::div($home_notice, array('class' => 'homepage_notice')); $home_notice = Display::div($home_notice, array('class' => 'homepage_notice'));
$html = self::show_right_block(get_lang('Notice'), $home_notice, 'notice_block'); self::show_right_block(get_lang('Notice'), null, 'notice_block', array('content' => $home_notice));
} }
return $html;
} }
/** /**
@ -251,18 +238,19 @@ class PageController {
* @assert ('a','') != '' * @assert ('a','') != ''
* @todo use the template system * @todo use the template system
*/ */
static function show_right_block($title, $content, $id = null, $params = null) { static function show_right_block($title, $content, $id, $params = null) {
//@todo do not use global
global $app;
if (!empty($id)) { if (!empty($id)) {
$params['id'] = $id; $params['id'] = $id;
} }
$params['class'] = 'well sidebar-nav'; $block_menu = array(
$html = null; 'id' => $params['id'],
if (!empty($title)) { 'title' => $title,
$html.= '<h4>'.$title.'</h4>'; 'elements' => $content,
} 'content' => isset($params['content']) ? $params['content'] : null
$html.= $content; );
$html = Display::div($html, $params); $app['template']->assign($id, $block_menu);
return $html;
} }
/** /**
@ -286,6 +274,7 @@ class PageController {
} }
return $html; return $html;
} }
/** /**
* Returns a content search form in an HTML <div>, pointing at the * Returns a content search form in an HTML <div>, pointing at the
* main/search/ directory. If search_enabled is not set, then it returns * main/search/ directory. If search_enabled is not set, then it returns
@ -307,6 +296,7 @@ class PageController {
} }
return $html; return $html;
} }
/** /**
* Returns a list of announcements * Returns a list of announcements
* @param int User ID * @param int User ID
@ -335,6 +325,7 @@ class PageController {
} }
return $announcements; return $announcements;
} }
/** /**
* Return the homepage, including announcements * Return the homepage, including announcements
* @return string The portal's homepage as an HTML string * @return string The portal's homepage as an HTML string
@ -384,6 +375,7 @@ class PageController {
} }
return $html; return $html;
} }
/** /**
* Returns the reservation block (if the reservation tool is enabled) * Returns the reservation block (if the reservation tool is enabled)
* @return string HTML block, or empty string if reservation tool is disabled * @return string HTML block, or empty string if reservation tool is disabled
@ -399,6 +391,7 @@ class PageController {
} }
return $html; return $html;
} }
/** /**
* Returns an HTML block with classes (if show_groups_to_users is true) * Returns an HTML block with classes (if show_groups_to_users is true)
* @return string A list of links to users classes tools, or an empty string if show_groups_to_users is disabled * @return string A list of links to users classes tools, or an empty string if show_groups_to_users is disabled
@ -428,6 +421,7 @@ class PageController {
} }
return $html; return $html;
} }
/** /**
* Prepares a block with all the pending exercises in all courses * Prepares a block with all the pending exercises in all courses
* @param array Array of courses (arrays) of the user * @param array Array of courses (arrays) of the user
@ -461,6 +455,7 @@ class PageController {
} }
} }
} }
/** /**
* Returns links to teachers tools (create course, etc) based on the user * Returns links to teachers tools (create course, etc) based on the user
* in the active session * in the active session
@ -496,27 +491,21 @@ class PageController {
} }
// My Account section // My Account section
$elements = array();
if ($show_menu) { if ($show_menu) {
$html .= '<ul class="nav nav-list">';
if ($show_create_link) { if ($show_create_link) {
$html .= '<li><a href="main/create_course/add_course.php" class="add course">'.(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'</a></li>'; $elements[] = array('href' => 'main/create_course/add_course.php', 'title' => (api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')));
} }
if ($show_course_link) { if ($show_course_link) {
if (!api_is_drh() && !api_is_session_admin()) { if (!api_is_drh() && !api_is_session_admin()) {
$html .= '<li><a href="main/auth/courses.php" class="list course">'.get_lang('CourseCatalog').'</a></li>'; $elements[] = array('href' => 'main/auth/courses.php', 'title' => get_lang('CourseCatalog'));
} else { } else {
$html .= '<li><a href="main/dashboard/index.php">'.get_lang('Dashboard').'</a></li>'; $elements[] = array('href' => 'main/dashboard/index.php', 'title' => get_lang('Dashboard'));
}
} }
$html .= '</ul>';
} }
if (!empty($html)) {
$html = self::show_right_block(get_lang('Courses'), $html, 'teacher_block');
} }
return $html; self::show_right_block(get_lang('Courses'), $elements, 'teacher_block');
} }
/** /**
@ -631,8 +620,7 @@ class PageController {
$htmlListCat .= "</li>"; $htmlListCat .= "</li>";
$thereIsSubCat = true; $thereIsSubCat = true;
} }
/* End changed code to eliminate the (0 courses) after empty categories. */ /* End changed code to eliminate the (0 courses) after empty categories. */ elseif (api_get_setting('show_empty_course_categories') == 'true') {
elseif (api_get_setting('show_empty_course_categories') == 'true') {
$htmlListCat .= '<li>'; $htmlListCat .= '<li>';
$htmlListCat .= $catLine['name']; $htmlListCat .= $catLine['name'];
$htmlListCat .= "</li>"; $htmlListCat .= "</li>";
@ -883,7 +871,6 @@ class PageController {
} }
} }
} }
} else { } else {
// All sessions included in // All sessions included in
$count_courses_session = 0; $count_courses_session = 0;
@ -978,7 +965,9 @@ class PageController {
* @assert () === false * @assert () === false
*/ */
static function return_welcome_to_course_block($tpl) { static function return_welcome_to_course_block($tpl) {
if (empty($tpl)) { return false; } if (empty($tpl)) {
return false;
}
$count_courses = CourseManager::count_courses(); $count_courses = CourseManager::count_courses();
$course_catalog_url = api_get_path(WEB_CODE_PATH).'auth/courses.php'; $course_catalog_url = api_get_path(WEB_CODE_PATH).'auth/courses.php';

@ -285,6 +285,7 @@ class Template {
} }
$user_info['messages_count'] = MessageManager::get_new_messages(); $user_info['messages_count'] = MessageManager::get_new_messages();
$this->user_is_logged_in = true; $this->user_is_logged_in = true;
} }
//Setting the $_u array that could be use in any template //Setting the $_u array that could be use in any template
@ -844,7 +845,6 @@ class Template {
return $this->app['twig']->render($this->app['template_style'].'/'.$template); return $this->app['twig']->render($this->app['template_style'].'/'.$template);
} }
/** /**
* Determines the possible tabs (=sections) that are available. * Determines the possible tabs (=sections) that are available.
* This function is used when creating the tabs in the third header line and * This function is used when creating the tabs in the third header line and

@ -0,0 +1 @@
{% include 'default/layout/block_menu.tpl' with {'block_menu': course_block} %}

@ -0,0 +1 @@
{% include 'default/layout/block_menu.tpl' with {'block_menu': help_block} %}

@ -0,0 +1 @@
{% include 'default/layout/block_menu.tpl' with {'block_menu': notice_block} %}

@ -0,0 +1 @@
{% include 'default/layout/block_menu.tpl' with {'block_menu': profile_block} %}

@ -0,0 +1 @@
{% include 'default/layout/block_menu.tpl' with {'block_menu': skills_block} %}

@ -0,0 +1 @@
{% include 'default/layout/block_menu.tpl' with {'block_menu': teacher_block} %}

@ -0,0 +1,7 @@
{% set block_menu = user_image_block %}
{% extends "default/layout/block_menu.tpl" %}
{% block block_menu_item %}
<div style="text-align:center;">
{{ user_image_block.content }}
</div>
{% endblock %}

@ -0,0 +1,18 @@
{% if block_menu is not empty %}
<div id="{{ block_menu.id }}" class="well sidebar-nav">
{% block block_menu_item %}
{% if block_menu.title is not empty %}
<h4>{{ block_menu.title }}</h4>
{% endif %}
{% if block_menu.elements is not empty %}
<ul class="nav nav-list">
{% for item in block_menu.elements %}
<li><a href="{{ item.href }}"> {{ item.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
{{ block_menu.content }}
{% endblock %}
</div>
{% endif %}

@ -17,22 +17,22 @@
{% endif %} {% endif %}
{# User picture #} {# User picture #}
{{ user_image_block }} {% include "default/index/user_image_block.tpl" %}
{# User Profile links #} {# User Profile links #}
{{ profile_block }} {% include "default/index/profile_block.tpl" %}
{# Course block - admin #} {# Course block - admin #}
{{ course_block }} {% include "default/index/course_block.tpl" %}
{# Course block - teacher #} {# Course block - teacher #}
{{ teacher_block }} {% include "default/index/teacher_block.tpl" %}
{# Notice #} {# Notice #}
{{ notice_block }} {% include "default/index/notice_block.tpl" %}
{# Help #} {# Help #}
{{ help_block }} {% include "default/index/help_block.tpl" %}
{# Links that are not added in the tabs #} {# Links that are not added in the tabs #}
{{ navigation_course_links }} {{ navigation_course_links }}
@ -47,7 +47,7 @@
{{ classes_block }} {{ classes_block }}
{# Skills #} {# Skills #}
{{ skills_block }} {% include "default/index/skills_block.tpl" %}
{# Plugin courses sidebar #} {# Plugin courses sidebar #}
{# Plugins for footer section #} {# Plugins for footer section #}

@ -181,14 +181,14 @@ class UserPortalController
} }
}*/ }*/
$app['template']->assign('profile_block', PageController::return_profile_block()); PageController::return_profile_block();
$app['template']->assign('user_image_block', PageController::return_user_image_block()); PageController::return_user_image_block();
$app['template']->assign('course_block', PageController::return_course_block()); PageController::return_course_block();
$app['template']->assign('navigation_course_links', $app['template']->return_navigation_links()); $app['template']->assign('navigation_course_links', $app['template']->return_navigation_links());
$app['template']->assign('reservation_block', PageController::return_reservation_block()); PageController::return_reservation_block();
$app['template']->assign('search_block', PageController::return_search_block()); $app['template']->assign('search_block', PageController::return_search_block());
$app['template']->assign('classes_block', PageController::return_classes_block()); $app['template']->assign('classes_block', PageController::return_classes_block());
$app['template']->assign('skills_block', PageController::return_skills_links()); PageController::return_skills_links();
// Deleting the session_id. // Deleting the session_id.
Session::erase('session_id'); Session::erase('session_id');

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php'; require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit066d9569e8f1198f8dd24dc1f3f94397::getLoader(); return ComposerAutoloaderInit5a316567ec2c31bac16293a95977788b::getLoader();

@ -751,7 +751,6 @@ return array(
'SessionFieldOption' => $baseDir . '/main/inc/lib/session_field_option.lib.php', 'SessionFieldOption' => $baseDir . '/main/inc/lib/session_field_option.lib.php',
'SessionFieldValue' => $baseDir . '/main/inc/lib/session_field_value.lib.php', 'SessionFieldValue' => $baseDir . '/main/inc/lib/session_field_value.lib.php',
'SessionHandler' => $baseDir . '/main/inc/lib/session_handler.class.php', 'SessionHandler' => $baseDir . '/main/inc/lib/session_handler.class.php',
'SessionHandlerInterface' => $baseDir . '/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs/SessionHandlerInterface.php',
'SessionManager' => $baseDir . '/main/inc/lib/sessionmanager.lib.php', 'SessionManager' => $baseDir . '/main/inc/lib/sessionmanager.lib.php',
'SessionModel' => $baseDir . '/main/inc/lib/session_model.lib.php', 'SessionModel' => $baseDir . '/main/inc/lib/session_model.lib.php',
'Shibboleth\\Admin' => $baseDir . '/main/auth/shibboleth/app/model/admin.class.php', 'Shibboleth\\Admin' => $baseDir . '/main/auth/shibboleth/app/model/admin.class.php',

@ -8,13 +8,22 @@ $baseDir = dirname($vendorDir);
return array( return array(
'Twig_' => $vendorDir . '/twig/twig/lib/', 'Twig_' => $vendorDir . '/twig/twig/lib/',
'Symfony\\Component\\Yaml' => $vendorDir . '/symfony/yaml/', 'Symfony\\Component\\Yaml' => $vendorDir . '/symfony/yaml/',
'Symfony\\Component\\Validator' => $vendorDir . '/symfony/validator/',
'Symfony\\Component\\Translation' => $vendorDir . '/symfony/translation/',
'Symfony\\Component\\Security' => $vendorDir . '/symfony/security/',
'Symfony\\Component\\Routing\\' => $vendorDir . '/symfony/routing/', 'Symfony\\Component\\Routing\\' => $vendorDir . '/symfony/routing/',
'Symfony\\Component\\HttpKernel\\' => $vendorDir . '/symfony/http-kernel/', 'Symfony\\Component\\OptionsResolver' => $vendorDir . '/symfony/options-resolver/',
'Symfony\\Component\\HttpFoundation\\' => $vendorDir . '/symfony/http-foundation/', 'Symfony\\Component\\Locale' => $vendorDir . '/symfony/locale/',
'Symfony\\Component\\EventDispatcher\\' => $vendorDir . '/symfony/event-dispatcher/', 'Symfony\\Component\\HttpKernel' => $vendorDir . '/symfony/http-kernel/',
'Symfony\\Component\\HttpFoundation' => $vendorDir . '/symfony/http-foundation/',
'Symfony\\Component\\Form' => $vendorDir . '/symfony/form/',
'Symfony\\Component\\EventDispatcher' => $vendorDir . '/symfony/event-dispatcher/',
'Symfony\\Component\\DependencyInjection\\' => $vendorDir . '/symfony/dependency-injection/',
'Symfony\\Component\\Console\\' => $vendorDir . '/symfony/console/', 'Symfony\\Component\\Console\\' => $vendorDir . '/symfony/console/',
'Symfony\\Component\\Config' => $vendorDir . '/symfony/config/', 'Symfony\\Component\\Config\\' => $vendorDir . '/symfony/config/',
'Symfony\\Bridge\\Twig\\' => $vendorDir . '/symfony/twig-bridge/',
'Silex' => $vendorDir . '/silex/silex/src/', 'Silex' => $vendorDir . '/silex/silex/src/',
'SessionHandlerInterface' => $vendorDir . '/symfony/http-foundation/Symfony/Component/HttpFoundation/Resources/stubs',
'Pimple' => $vendorDir . '/pimple/pimple/lib/', 'Pimple' => $vendorDir . '/pimple/pimple/lib/',
'Monolog' => $vendorDir . '/monolog/monolog/src/', 'Monolog' => $vendorDir . '/monolog/monolog/src/',
'Entity' => $baseDir . '/main/inc/', 'Entity' => $baseDir . '/main/inc/',

@ -2,7 +2,7 @@
// autoload_real.php generated by Composer // autoload_real.php generated by Composer
class ComposerAutoloaderInit066d9569e8f1198f8dd24dc1f3f94397 class ComposerAutoloaderInit5a316567ec2c31bac16293a95977788b
{ {
private static $loader; private static $loader;
@ -19,9 +19,9 @@ class ComposerAutoloaderInit066d9569e8f1198f8dd24dc1f3f94397
return static::$loader; return static::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit066d9569e8f1198f8dd24dc1f3f94397', 'loadClassLoader')); spl_autoload_register(array('ComposerAutoloaderInit5a316567ec2c31bac16293a95977788b', 'loadClassLoader'));
static::$loader = $loader = new \Composer\Autoload\ClassLoader(); static::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit066d9569e8f1198f8dd24dc1f3f94397', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit5a316567ec2c31bac16293a95977788b', 'loadClassLoader'));
$vendorDir = dirname(__DIR__); $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
@ -38,6 +38,8 @@ class ComposerAutoloaderInit066d9569e8f1198f8dd24dc1f3f94397
$loader->register(); $loader->register();
require $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php';
return $loader; return $loader;
} }
} }

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save