Update themebundle from experimental branch

pull/2487/head
jmontoyaa 7 years ago
parent 8324721775
commit d372bc9891
  1. 15
      src/ThemeBundle/Controller/BreadcrumbController.php
  2. 24
      src/ThemeBundle/Controller/DefaultController.php
  3. 9
      src/ThemeBundle/Controller/ExceptionController.php
  4. 17
      src/ThemeBundle/Controller/NavbarController.php
  5. 12
      src/ThemeBundle/Controller/SecurityController.php
  6. 72
      src/ThemeBundle/Controller/SidebarController.php
  7. 22
      src/ThemeBundle/Controller/WidgetController.php
  8. 262
      src/ThemeBundle/DependencyInjection/ChamiloAdminThemeExtension.php
  9. 4
      src/ThemeBundle/DependencyInjection/Configuration.php
  10. 9
      src/ThemeBundle/Event/MessageListEvent.php
  11. 10
      src/ThemeBundle/Event/NotificationListEvent.php
  12. 6
      src/ThemeBundle/Event/ShowUserEvent.php
  13. 17
      src/ThemeBundle/Event/SidebarMenuEvent.php
  14. 1
      src/ThemeBundle/Event/SidebarMenuKnpEvent.php
  15. 11
      src/ThemeBundle/Event/TaskListEvent.php
  16. 6
      src/ThemeBundle/Event/ThemeEvent.php
  17. 8
      src/ThemeBundle/Event/ThemeEvents.php
  18. 12
      src/ThemeBundle/EventListener/ContextListener.php
  19. 12
      src/ThemeBundle/EventListener/NavbarMessageListDemoListener.php
  20. 12
      src/ThemeBundle/EventListener/NavbarNotificationListDemoListener.php
  21. 11
      src/ThemeBundle/EventListener/NavbarShowUserDemoListener.php
  22. 11
      src/ThemeBundle/EventListener/NavbarTaskListDemoListener.php
  23. 11
      src/ThemeBundle/EventListener/SetupThemeListener.php
  24. 13
      src/ThemeBundle/EventListener/SidebarSetupMenuDemoListener.php
  25. 10
      src/ThemeBundle/Form/FormDemoModelType.php
  26. 15
      src/ThemeBundle/Helper/WidgetHelper.php
  27. 4
      src/ThemeBundle/Model/MenuItemInterface.php
  28. 5
      src/ThemeBundle/Model/MenuItemModel.php
  29. 1
      src/ThemeBundle/Model/MessageInterface.php
  30. 1
      src/ThemeBundle/Model/MessageModel.php
  31. 10
      src/ThemeBundle/Model/NotificationInterface.php
  32. 18
      src/ThemeBundle/Model/NotificationModel.php
  33. 14
      src/ThemeBundle/Model/TaskInterface.php
  34. 8
      src/ThemeBundle/Model/TaskModel.php
  35. 11
      src/ThemeBundle/Model/UserInterface.php
  36. 15
      src/ThemeBundle/Model/UserModel.php
  37. 5
      src/ThemeBundle/Resources/config/routing.yml
  38. 14
      src/ThemeBundle/Resources/views/FlashMessage/render.html.twig
  39. 350
      src/ThemeBundle/Resources/views/Layout/base-layout.html.twig
  40. 95
      src/ThemeBundle/Resources/views/Layout/footer.html.twig
  41. 37
      src/ThemeBundle/Resources/views/Layout/footer.js.twig
  42. 1
      src/ThemeBundle/Resources/views/Layout/form-theme.html.twig
  43. 120
      src/ThemeBundle/Resources/views/Layout/header.js.twig
  44. 4
      src/ThemeBundle/Resources/views/Layout/layout.html.twig
  45. 4
      src/ThemeBundle/Resources/views/Layout/layout_cms.html.twig
  46. 7
      src/ThemeBundle/Resources/views/Layout/layout_empty.html.twig
  47. 138
      src/ThemeBundle/Resources/views/Layout/layout_grid.html.twig
  48. 77
      src/ThemeBundle/Resources/views/Layout/layout_one_col.html.twig
  49. 20
      src/ThemeBundle/Resources/views/Layout/layout_one_col_no_content.html.twig
  50. 82
      src/ThemeBundle/Resources/views/Layout/layout_two_col.html.twig
  51. 39
      src/ThemeBundle/Resources/views/Layout/login-layout.html.twig
  52. 10
      src/ThemeBundle/Resources/views/Layout/no_layout.html.twig
  53. 70
      src/ThemeBundle/Resources/views/Layout/topbar.html.twig
  54. 61
      src/ThemeBundle/Resources/views/Navbar/user.html.twig
  55. 47
      src/ThemeBundle/Resources/views/Sidebar/left_menu.html.twig
  56. 36
      src/ThemeBundle/Resources/views/Sidebar/login.html.twig
  57. 2
      src/ThemeBundle/Resources/views/Sidebar/search-form.html.twig
  58. 11
      src/ThemeBundle/Resources/views/Sidebar/social-menu.html.twig
  59. 9
      src/ThemeBundle/Resources/views/Sidebar/social-panel.html.twig
  60. 25
      src/ThemeBundle/Resources/views/Sidebar/user-panel.html.twig
  61. 180
      src/ThemeBundle/Util/DependencyResolver.php

@ -63,18 +63,21 @@ class BreadcrumbController extends Controller
}
}
return $this->render('ChamiloThemeBundle:Breadcrumb:breadcrumb.html.twig', array(
'active' => $list,
'title' => $title
));
return $this->render(
'ChamiloThemeBundle:Breadcrumb:breadcrumb.html.twig',
[
'active' => $list,
'title' => $title,
]
);
}
/**
* @return EventDispatcher
* @return object|\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher|\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
*/
protected function getDispatcher()
{
return $this->get('event_dispatcher');
}
}

@ -27,33 +27,25 @@ class DefaultController extends Controller
/**
* @return \Symfony\Component\HttpFoundation\Response
*/
public function dashboardAction()
{
return $this->render('ChamiloThemeBundle:Default:index.html.twig');
public function dashboardAction() {
return $this->render('ChamiloThemeBundle:Default:index.html.twig');
}
/**
* @return \Symfony\Component\HttpFoundation\Response
*/
public function uiGeneralAction()
{
public function uiGeneralAction() {
return $this->render('ChamiloThemeBundle:Default:index.html.twig');
}
public function uiIconsAction()
{
public function uiIconsAction() {
return $this->render('ChamiloThemeBundle:Default:index.html.twig');
}
public function formAction()
{
public function formAction() {
$form = $this->createForm(new FormDemoModelType());
return $this->render(
'ChamiloThemeBundle:Default:form.html.twig',
array(
'form' => $form->createView(),
)
);
return $this->render('ChamiloThemeBundle:Default:form.html.twig', array(
'form' => $form->createView()
));
}
}

@ -11,8 +11,9 @@ use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
use Symfony\Component\HttpFoundation\Request;
class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\ExceptionController
{
class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\ExceptionController {
/**
* @param Request $request
* @param string $format
@ -23,6 +24,7 @@ class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\Exceptio
*/
protected function findTemplate(Request $request, $format, $code, $debug)
{
if (strpos($request->getPathInfo(), '/admin') !== 0) {
return parent::findTemplate($request, $format, $code, $debug);
}
@ -55,5 +57,8 @@ class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\Exceptio
}
return parent::findTemplate($request, $format, $code, $debug);
}
}

@ -26,6 +26,10 @@ class NavbarController extends Controller
return $this->get('event_dispatcher');
}
/**
* @param int $max
* @return Response
*/
public function notificationsAction($max = 5)
{
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_NOTIFICATIONS)) {
@ -44,9 +48,12 @@ class NavbarController extends Controller
}
/**
* @param int $max
* @return Response
*/
public function messagesAction($max = 5)
{
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_MESSAGES)) {
return new Response();
}
@ -62,9 +69,12 @@ class NavbarController extends Controller
);
}
/**
* @param int $max
* @return Response
*/
public function tasksAction($max = 5)
{
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_TASKS)) {
return new Response();
}
@ -79,6 +89,9 @@ class NavbarController extends Controller
);
}
/**
* @return Response
*/
public function userAction()
{
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_NAVBAR_USER)) {

@ -1,16 +1,17 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\ThemeBundle\Controller;
/**
* SecurityController.php
* avanzu-admin
* Date: 23.02.14
*/
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\SecurityContext;
/**
* Class SecurityController
* @package Chamilo\ThemeBundle\Controller
*/
class SecurityController extends Controller
{
/**
@ -40,4 +41,5 @@ class SecurityController extends Controller
)
);
}
}

@ -1,5 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* SidebarController.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Controller;
@ -18,7 +22,7 @@ use Symfony\Component\HttpFoundation\Response;
class SidebarController extends Controller
{
/**
* "Hello user" section
* Avatar user panel
* @return Response
*/
public function userPanelAction()
@ -27,7 +31,10 @@ class SidebarController extends Controller
return new Response();
}
$userEvent = $this->getDispatcher()->dispatch(ThemeEvents::THEME_SIDEBAR_USER, new ShowUserEvent());
$userEvent = $this->getDispatcher()->dispatch(
ThemeEvents::THEME_SIDEBAR_USER,
new ShowUserEvent()
);
return $this->render(
'ChamiloThemeBundle:Sidebar:user-panel.html.twig',
@ -38,63 +45,66 @@ class SidebarController extends Controller
}
/**
* Search bar
* User social network section
* @return Response
*/
public function searchFormAction()
public function socialPanelAction()
{
return $this->render('ChamiloThemeBundle:Sidebar:search-form.html.twig', array());
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_SIDEBAR_USER)) {
return new Response();
}
$userEvent = $this->getDispatcher()->dispatch(
ThemeEvents::THEME_SIDEBAR_USER,
new ShowUserEvent()
);
return $this->render(
'ChamiloThemeBundle:Sidebar:social-panel.html.twig',
array(
'user' => $userEvent->getUser()
)
);
}
/**
* @return EventDispatcher
* Search bar
* @return Response
*/
protected function getDispatcher()
public function searchFormAction()
{
return $this->get('event_dispatcher');
return $this->render('ChamiloThemeBundle:Sidebar:search-form.html.twig', array());
}
/**
* @param Request $request
* @return Response
* @return object|\Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher|\Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
*/
public function menuAction(Request $request)
protected function getDispatcher()
{
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_SIDEBAR_SETUP_MENU)) {
return new Response();
}
$event = $this->getDispatcher()->dispatch(
ThemeEvents::THEME_SIDEBAR_SETUP_MENU,
new SidebarMenuEvent($request)
);
return $this->render(
'ChamiloThemeBundle:Sidebar:menu.html.twig',
array(
'menu' => $event->getItems()
)
);
return $this->get('event_dispatcher');
}
/**
* @param Request $request
* @return Response
*/
public function menuKnpAction(Request $request)
public function leftMenuAction(Request $request)
{
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_SIDEBAR_SETUP_MENU_KNP)) {
if (!$this->getDispatcher()->hasListeners(
ThemeEvents::THEME_SIDEBAR_LEFT_MENU
)
) {
return new Response();
}
/** @var SidebarMenuKnpEvent $event */
$event = $this->getDispatcher()->dispatch(
ThemeEvents::THEME_SIDEBAR_SETUP_MENU_KNP,
ThemeEvents::THEME_SIDEBAR_LEFT_MENU,
new SidebarMenuKnpEvent($request)
);
return $this->render(
'ChamiloThemeBundle:Sidebar:menu_knp.html.twig',
'ChamiloThemeBundle:Sidebar:left_menu.html.twig',
array(
'menu' => $event->getMenu()
)

@ -1,32 +1,38 @@
<?php
/* For licensing terms, see /license.txt */
/**
* WidgetController.php
* avanzu-admin
* Date: 16.03.14
*/
namespace Chamilo\ThemeBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Class WidgetController
* @package Chamilo\ThemeBundle\Controller
*/
class WidgetController extends Controller
{
public function defaultBoxAction()
{
}
public function solidBoxAction()
{
}
}
public function tiledBoxAction()
{
}
}
public function smallBoxAction()
{
}
}
}

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\ThemeBundle\DependencyInjection;
@ -54,143 +53,144 @@ class ChamiloThemeExtension extends Extension implements PrependExtensionInterfa
return;
$jsAssets = '@ChamiloThemeBundle/Resources/';
$lteJs = $jsAssets.'public/vendor/adminlte/js/';
$jsAssets = '@ChamiloThemeBundle/Resources/';
$lteJs = $jsAssets.'public/vendor/adminlte/js/';
$cssAssets = 'bundles/avanzuadmintheme/';
$lteCss = $cssAssets.'vendor/adminlte/css/';
$lteFont = $cssAssets.'vendor/adminlte/fonts/';
$lteCss = $cssAssets.'vendor/adminlte/css/';
$lteFont = $cssAssets.'vendor/adminlte/fonts/';
if (isset($bundles['AsseticBundle']) && 0) {
$container->prependExtensionConfig(
'assetic',
array(
'bundles' => array(
'ChamiloThemeBundle'
),
'assets' => array(
'common_js' => array(
'inputs' => array(
$jsAssets.'public/vendor/jquery/dist/jquery.js',
$jsAssets.'public/vendor/jquery-ui/jquery-ui.js',
$jsAssets.'public/vendor/underscore/underscore.js',
$jsAssets.'public/vendor/backbone/backbone.js',
$jsAssets.'public/vendor/marionette/lib/backbone.marionette.js',
$jsAssets.'public/vendor/bootstrap/dist/js/bootstrap.min.js',
$jsAssets.'public/vendor/bootbox/bootbox.js',
$jsAssets.'public/js/dialogs.js',
$jsAssets.'public/js/namespace.js',
),
),
'tools_js' => array(
'inputs' => array(
'@common_js',
$jsAssets.'public/vendor/momentjs/moment.js',
$jsAssets.'public/vendor/holderjs/holder.js',
$jsAssets.'public/vendor/spinjs/spin.js',
),
),
'admin_lte_js' => array(
'inputs' => array(
$lteJs.'plugins/bootstrap-slider/bootstrap-slider.js',
$lteJs.'plugins/datatables/jquery.dataTables.js',
$lteJs.'plugins/datatables/dataTables.bootstrap.js',
$lteJs.'plugins/slimScroll/jquery.slimscroll.js',
$jsAssets.'public/js/adminLTE.js',
)
),
'admin_lte_css' => array(
'inputs' => array(
'assetic',
array(
'bundles' => array(
'ChamiloThemeBundle'
),
'assets' => array(
'common_js' => array(
'inputs' => array(
$jsAssets.'public/vendor/jquery/dist/jquery.js',
$jsAssets.'public/vendor/jquery-ui/jquery-ui.js',
$jsAssets.'public/vendor/underscore/underscore.js',
$jsAssets.'public/vendor/backbone/backbone.js',
$jsAssets.'public/vendor/marionette/lib/backbone.marionette.js',
$jsAssets.'public/vendor/bootstrap/dist/js/bootstrap.min.js',
$jsAssets.'public/vendor/bootbox/bootbox.js',
$jsAssets.'public/js/dialogs.js',
$jsAssets.'public/js/namespace.js',
),
),
'tools_js' => array(
'inputs' => array(
'@common_js',
$jsAssets.'public/vendor/momentjs/moment.js',
$jsAssets.'public/vendor/holderjs/holder.js',
$jsAssets.'public/vendor/spinjs/spin.js',
),
),
'admin_lte_js' => array(
'inputs' => array(
$lteJs.'plugins/bootstrap-slider/bootstrap-slider.js',
$lteJs.'plugins/datatables/jquery.dataTables.js',
$lteJs.'plugins/datatables/dataTables.bootstrap.js',
$lteJs.'plugins/slimScroll/jquery.slimscroll.js',
$jsAssets.'public/js/adminLTE.js',
)
),
'admin_lte_css' => array(
'inputs' => array(
// $lteCss . 'jQueryUI/jquery-ui-1.10.3.custom.css',
$cssAssets.'vendor/bootstrap/dist/css/bootstrap.min.css',
$lteCss.'bootstrap-slider/slider.css',
$lteCss.'datatables/dataTables.bootstrap.css',
$cssAssets.'vendor/fontawesome/css/font-awesome.min.css',
$cssAssets.'vendor/ionicons/css/ionicons.min.css',
$lteCss.'AdminLTE.css',
//$lteFont . 'fontawesome-webfont.eot',
// $lteFont . 'ionicons.eot',
)
),
'admin_lte_forms_js' => array(
'inputs' => array(
$lteJs.'plugins/colorpicker/bootstrap-colorpicker.js',
$lteJs.'plugins/daterangepicker/daterangepicker.js',
$lteJs.'plugins/timepicker/bootstrap-timepicker.js',
$lteJs.'plugins/input-mask/jquery.inputmask.js',
// $lteJs.'plugins/input-mask/*',
)
),
'admin_lte_forms_css' => array(
'inputs' => array(
$lteCss.'colorpicker/bootstrap-colorpicker.css',
$lteCss.'daterangepicker/daterangepicker-bs3.css',
$lteCss.'timepicker/bootstrap-timepicker.css',
)
),
'admin_lte_wysiwyg' => array(
'inputs' => array(
$lteJs.'plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.js',
)
),
'admin_lte_wysiwyg_css' => array(
'inputs' => array(
$lteCss.'bootstrap-wysihtml5/bootstrap3-wysihtml5.css',
)
),
'admin_lte_morris' => array(
'inputs' => array(
$lteJs.'plugins/morris/morris.js',
)
),
'admin_lte_morris_css' => array(
'inputs' => array(
$lteCss.'morris/morris.css',
// $lteCss . 'jQueryUI/jquery-ui-1.10.3.custom.css',
$cssAssets.'vendor/bootstrap/dist/css/bootstrap.min.css',
$lteCss.'bootstrap-slider/slider.css',
$lteCss.'datatables/dataTables.bootstrap.css',
$cssAssets.'vendor/fontawesome/css/font-awesome.min.css',
$cssAssets.'vendor/ionicons/css/ionicons.min.css',
$lteCss.'AdminLTE.css',
//$lteFont . 'fontawesome-webfont.eot',
// $lteFont . 'ionicons.eot',
)
),
'admin_lte_forms_js' => array(
'inputs' => array(
$lteJs.'plugins/colorpicker/bootstrap-colorpicker.js',
$lteJs.'plugins/daterangepicker/daterangepicker.js',
$lteJs.'plugins/timepicker/bootstrap-timepicker.js',
$lteJs.'plugins/input-mask/jquery.inputmask.js',
// $lteJs.'plugins/input-mask/*',
)
),
'admin_lte_forms_css' => array(
'inputs' => array(
$lteCss.'colorpicker/bootstrap-colorpicker.css',
$lteCss.'daterangepicker/daterangepicker-bs3.css',
$lteCss.'timepicker/bootstrap-timepicker.css',
)
),
'admin_lte_wysiwyg' => array(
'inputs' => array(
$lteJs.'plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.js',
)
),
'admin_lte_wysiwyg_css' => array(
'inputs' => array(
$lteCss.'bootstrap-wysihtml5/bootstrap3-wysihtml5.css',
)
),
'admin_lte_morris' => array(
'inputs' => array(
$lteJs.'plugins/morris/morris.js',
)
),
'admin_lte_morris_css' => array(
'inputs' => array(
$lteCss.'morris/morris.css',
)
),
'admin_lte_flot' => array(
'inputs' => array(
$lteJs.'plugins/flot/*',
)
),
'admin_lte_calendar' => array(
'inputs' => array(
$jsAssets.'public/vendor/fullcalendar/dist/fullcalendar.min.js',
)
),
'admin_lte_calendar_css' => array(
'inputs' => array(
$lteCss.'fullcalendar/fullcalendar.css',
)
),
'avatar_img' => array(
'inputs' => array(
'@ChamiloThemeBundle/Resources/public/img/avatar.png'
)
),
'admin_lte_all' => array(
'inputs' => array(
'@tools_js',
'@admin_lte_forms_js',
'@admin_lte_wysiwyg',
'@admin_lte_morris',
'@admin_lte_calendar',
'@admin_lte_js',
// '@admin_lte_flot',
)
),
'admin_lte_all_css' => array(
'inputs' => array(
'@admin_lte_calendar_css',
'@admin_lte_morris_css',
'@admin_lte_wysiwyg_css',
'@admin_lte_forms_css',
'@admin_lte_css'
)
),
)
),
'admin_lte_flot' => array(
'inputs' => array(
$lteJs.'plugins/flot/*',
)
),
'admin_lte_calendar' => array(
'inputs' => array(
$jsAssets.'public/vendor/fullcalendar/dist/fullcalendar.min.js',
)
),
'admin_lte_calendar_css' => array(
'inputs' => array(
$lteCss.'fullcalendar/fullcalendar.css',
)
),
'avatar_img' => array(
'inputs' => array(
'@ChamiloThemeBundle/Resources/public/img/avatar.png'
)
),
'admin_lte_all' => array(
'inputs' => array(
'@tools_js',
'@admin_lte_forms_js',
'@admin_lte_wysiwyg',
'@admin_lte_morris',
'@admin_lte_calendar',
'@admin_lte_js',
// '@admin_lte_flot',
)
),
'admin_lte_all_css' => array(
'inputs' => array(
'@admin_lte_calendar_css',
'@admin_lte_morris_css',
'@admin_lte_wysiwyg_css',
'@admin_lte_forms_css',
'@admin_lte_css'
)
),
)
)
)
);
}
}
}

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\ThemeBundle\DependencyInjection;
@ -9,8 +8,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{

@ -1,8 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* MessageListEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event;
use Chamilo\ThemeBundle\Model\MessageInterface;
/**
@ -47,6 +52,7 @@ class MessageListEvent extends ThemeEvent
$this->messages[] = $messageInterface;
return $this;
}
/**
@ -58,4 +64,5 @@ class MessageListEvent extends ThemeEvent
{
return $this->totalMessages == 0 ? sizeof($this->messages) : $this->totalMessages;
}
}

@ -1,8 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* NotificationListEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event;
use Chamilo\ThemeBundle\Model\NotificationInterface;
/**
@ -54,4 +59,7 @@ class NotificationListEvent extends ThemeEvent
{
return $this->total == 0 ? sizeof($this->notifications) : $this->total;
}
}

@ -1,5 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* ShowUserEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event;

@ -1,8 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* SidebarMenuEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event;
use Chamilo\ThemeBundle\Model\MenuItemInterface;
use Symfony\Component\HttpFoundation\Request;
@ -13,6 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
*/
class SidebarMenuEvent extends ThemeEvent
{
/**
* @var array
*/
@ -66,16 +72,13 @@ class SidebarMenuEvent extends ThemeEvent
/**
* @return MenuItemInterface|null
*/
public function getActive()
{
public function getActive() {
foreach ($this->getItems() as $item) {
/** @var $item MenuItemInterface */
if ($item->isActive()) {
return $item;
}
if ($item->isActive()) return $item;
}
return null;
}
}

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\ThemeBundle\Event;

@ -1,14 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* TaskListEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event;
use Chamilo\ThemeBundle\Model\TaskInterface;
/**
* Class TaskListEvent
* @package Chamilo\ThemeBundle\Event
*/
class TaskListEvent extends ThemeEvent
{
protected $tasks = array();

@ -1,5 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* ThemeEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event;

@ -1,5 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* ThemeEvents.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event;
@ -45,7 +49,7 @@ class ThemeEvents
/**
* Used to receive the sidebar menu data
*/
const THEME_SIDEBAR_SETUP_MENU_KNP = 'theme.sidebar_setup_menu_knp';
const THEME_SIDEBAR_LEFT_MENU = 'theme.sidebar_left_menu';
/**
*
*/

@ -1,19 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
/**
* ContextListener.php
* publisher
* Date: 23.05.14
*/
namespace Chamilo\ThemeBundle\EventListener;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\User\User;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* Class ContextListener
* @package Chamilo\ThemeBundle\EventListener
*/
class ContextListener
{
protected $indicator = '^/admin';
protected $container = null;

@ -1,16 +1,17 @@
<?php
/* For licensing terms, see /license.txt */
/**
* NavbarMessageListDemoListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\MessageListEvent;
use Chamilo\ThemeBundle\Model\MessageModel;
use Chamilo\ThemeBundle\Model\UserModel;
/**
* Class NavbarMessageListDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class NavbarMessageListDemoListener
{
public function onListMessages(MessageListEvent $event)
@ -27,4 +28,5 @@ class NavbarMessageListDemoListener
new MessageModel(new UserModel('Jack Trockendoc'), 'This is some subject', new \DateTime('-10 month')),
);
}
}

@ -1,15 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* NavbarNotificationListDemoListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\NotificationListEvent;
use Chamilo\ThemeBundle\Model\NotificationModel;
/**
* Class NavbarNotificationListDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class NavbarNotificationListDemoListener
{
public function onListNotifications(NotificationListEvent $event)
@ -26,4 +27,5 @@ class NavbarNotificationListDemoListener
new NotificationModel('some more notices', 'success'),
);
}
}

@ -1,15 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* NavbarShowUserListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\ShowUserEvent;
use Chamilo\ThemeBundle\Model\UserModel;
/**
* Class NavbarShowUserDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class NavbarShowUserDemoListener
{
public function onShowUser(ShowUserEvent $event)

@ -1,15 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* NavbarTaskListDemoListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\TaskListEvent;
use Chamilo\ThemeBundle\Model\TaskModel;
/**
* Class NavbarTaskListDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class NavbarTaskListDemoListener
{
public function onListTasks(TaskListEvent $event)

@ -1,15 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* SetupThemeListener.php
* publisher
* Date: 01.05.14
*/
namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Theme\ThemeManager;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
/**
* Class SetupThemeListener
* @package Chamilo\ThemeBundle\EventListener
*/
class SetupThemeListener
{
/**

@ -1,16 +1,17 @@
<?php
/* For licensing terms, see /license.txt */
/**
* SidebarSetupMenuDemoListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\SidebarMenuEvent;
use Chamilo\ThemeBundle\Model\MenuItemModel;
use Symfony\Component\HttpFoundation\Request;
/**
* Class SidebarSetupMenuDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class SidebarSetupMenuDemoListener
{
public function onSetupMenu(SidebarMenuEvent $event)
@ -52,4 +53,6 @@ class SidebarSetupMenuDemoListener
return $items;
}
}

@ -1,5 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* FormDemoModelType.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Form;
@ -7,10 +11,6 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* Class FormDemoModelType
* @package Chamilo\ThemeBundle\Form
*/
class FormDemoModelType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)

@ -1,14 +1,15 @@
<?php
/* For licensing terms, see /license.txt */
/**
* WidgetHelper.php
* avanzu-admin
* Date: 16.03.14
*/
namespace Chamilo\ThemeBundle\Helper;
/**
* Class WidgetHelper
* @package Chamilo\ThemeBundle\Helper
*/
class WidgetHelper extends \Twig_Extension
{
class WidgetHelper extends \Twig_Extension {
/**
* Get widget helper name
* @return string

@ -7,13 +7,13 @@
namespace Chamilo\ThemeBundle\Model;
/**
* Interface MenuItemInterface
*
* @package Chamilo\ThemeBundle\Model
*/
interface MenuItemInterface
{
interface MenuItemInterface {
/**
* @return mixed
*/

@ -14,6 +14,7 @@ namespace Chamilo\ThemeBundle\Model;
*/
class MenuItemModel implements MenuItemInterface
{
/**
* @var mixed
*/
@ -59,7 +60,7 @@ class MenuItemModel implements MenuItemInterface
*/
protected $parent = null;
public function __construct(
function __construct(
$id,
$label,
$route,
@ -294,7 +295,7 @@ class MenuItemModel implements MenuItemInterface
public function removeChild(MenuItemInterface $child)
{
if (false !== ($key = array_search($child, $this->children))) {
unset($this->children[$key]);
unset ($this->children[$key]);
}
return $this;

@ -7,6 +7,7 @@
namespace Chamilo\ThemeBundle\Model;
/**
* Representation of a displayable message in the theme's messages section
*

@ -13,6 +13,7 @@ namespace Chamilo\ThemeBundle\Model;
*/
class MessageModel implements MessageInterface
{
/**
* Holds the sender
*

@ -1,11 +1,13 @@
<?php
/**
* NotificationInterface.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model;
/**
* Interface NotificationInterface
* @package Chamilo\ThemeBundle\Model
*/
interface NotificationInterface
{
public function getMessage();

@ -1,24 +1,31 @@
<?php
/**
* NotificationModel.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model;
/**
* Class NotificationModel
* @package Chamilo\ThemeBundle\Model
*/
class NotificationModel implements NotificationInterface
{
protected $type;
protected $message;
protected $icon;
public function __construct($message = null, $type = 'info', $icon = 'fa fa-warning')
function __construct($message = null, $type = 'info', $icon = 'fa fa-warning')
{
$this->message = $message;
$this->type = $type;
$this->icon = $icon;
}
/**
* @param mixed $message
*
@ -82,4 +89,5 @@ class NotificationModel implements NotificationInterface
{
return $this->message;
}
}

@ -1,13 +1,15 @@
<?php
/**
* TaskInterface.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model;
/**
* Interface TaskInterface
* @package Chamilo\ThemeBundle\Model
*/
interface TaskInterface
{
interface TaskInterface {
public function getColor();
public function getProgress();
public function getTitle();

@ -1,8 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* TaskModel.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model;
/**
* Class TaskModel
*
@ -10,6 +15,7 @@ namespace Chamilo\ThemeBundle\Model;
*/
class TaskModel implements TaskInterface
{
/**
*
*/

@ -1,12 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
/**
* UserInterface.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model;
/**
* Interface UserInterface
* @package Chamilo\ThemeBundle\Model
*/
interface UserInterface
{
public function getAvatar();

@ -1,14 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
/**
* UserModel.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model;
/**
* Class UserModel
* @package Chamilo\ThemeBundle\Model
*/
class UserModel implements UserInterface
{
/**
* @var string
*/
@ -29,7 +31,7 @@ class UserModel implements UserInterface
*/
protected $isOnline = false;
public function __construct($username = '', $avatar = '', $memberSince = null, $isOnline = true)
function __construct($username = '', $avatar = '', $memberSince = null, $isOnline = true)
{
$this->avatar = $avatar;
$this->isOnline = $isOnline;
@ -37,6 +39,7 @@ class UserModel implements UserInterface
$this->username = $username;
}
/**
* @param string $avatar
*

@ -0,0 +1,5 @@
login:
path: /login
defaults: { _controller: ChamiloThemeBundle:Security:login }
login_check:
path: /login_check

@ -0,0 +1,14 @@
{% for type in sonata_flashmessages_types() %}
{% set domain = domain is defined ? domain : null %}
{% for message in sonata_flashmessages_get(type, domain) %}
{% if type != 'no_layout' %}
<div class="alert alert-{{ type|sonata_status_class }} alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{ message|raw }}
</div>
{% else %}
{{ message|raw }}
{% endif %}
{% endfor %}
{% endfor %}

@ -16,42 +16,33 @@
<html lang="{{ app.request.locale }}" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
{# Check settings in app/config/sonata/sonata_seo.yml #}
{# Check settings to add more metadata in app/config/sonata/sonata_seo.yml #}
{{ sonata_seo_metadatas() }}
<link href="https://chamilo.org/chamilo-lms/" rel="help"/>
<link href="https://chamilo.org/the-association/" rel="author"/>
<link href="https://chamilo.org/the-association/" rel="copyright"/>
<link rel="apple-touch-icon" href="{{ asset('apple-touch-icon.png') }}"/>
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
<title>
{% block title %}
{#{{ chamilo_settings_get('platform.institution') }} - {{ chamilo_settings_get('platform.site_name') }}#}
{% endblock %}
{% block title %}
{{ chamilo_settings_get('platform.institution') }} - {{ chamilo_settings_get('platform.site_name') }}
{% endblock %}
</title>
{# Check chamilo_css key in assetic.yml #}
{#{%- stylesheets '@chamilo_css' -%}#}
{#<link rel="stylesheet" href="{{ asset_url }}"/>#}
{#{% endstylesheets %}#}
{#{% stylesheets#}
{#'@MopaBootstrapBundle/Resources/public/less/mopabootstrapbundle.less'#}
{#'@MopaBootstrapBundle/Resources/public/less/eyecon-datepicker.less'#}
{#%}#}
{#<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />#}
{#{% endstylesheets %}#}
{# Chamilo theme #}
{% set theme = 'chamilo' %}
{% set bug_notification_link = '' %}
{% set help_content = '' %}
{% set header_extra_content = '' %}
{% set template = 'default' %}
{% set notification_menu = '' %}
{% set accessibility = '' %}
@ -62,19 +53,22 @@
{% set profile_link = '' %}
{% set message_link = '' %}
<link rel="stylesheet" href="{{ asset('assets/bootstrap/dist/css/bootstrap.css') }}"/>
<link rel="stylesheet" href="{{ asset('css/base.css') }}"/>
<link rel="stylesheet" href="{{ asset('build/chamilo_style.css') }}"/>
<link rel="stylesheet" href="{{ asset('build/chamilo.css') }}"/>
<link rel="stylesheet" href="{{ asset('css/scorm.css') }}"/>
<link rel="stylesheet" media="print" href="{{ asset('css/print.css') }}"/>
<link rel="stylesheet" href="{{ asset('css/themes/'~ theme ~'/learnpath.css') }}"/>
<link rel="stylesheet" href="{{ asset('css/themes/'~ theme ~'/default.css') }}"/>
<link rel="stylesheet" media="print" href="{{ asset('css/print.css') }}"/>
<link rel="stylesheet" media="print" href="{{ asset('css/themes/'~ theme ~'/print.css') }}"/>
<script src="{{ asset('assets/modernizr/modernizr.js') }}"></script>
{#<link rel="stylesheet" href="{{ asset('assets/jquery-ui/themes/smoothness/theme.css') }}"/>#}
{#<link rel="stylesheet" href="{{ asset('assets/jquery-ui/themes/smoothness/jquery-ui.min.css') }}"/>#}
<link rel="stylesheet" href="{{ asset('assets/bootstrap-daterangepicker/daterangepicker.css') }}"/>
<link rel="stylesheet" href="{{ asset('assets/bootstrap-language/languages.min.css') }}"/>
<script src="{{ asset('build/chamilo.js') }}"></script>
<script src="{{ asset('assets/moment/moment.js') }}"></script>
{#<script src="{{ asset('assets/modernizr/modernizr.js') }}"></script>#}
{# Check chamilo_js key in assetic.yml #}
{% block javascripts %}
@ -82,15 +76,19 @@
{#<script src="{{ asset_url }} "></script>#}
{#{% endjavascripts %}#}
<script src="{{ asset('assets/jquery/jquery.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('assets/bootstrap/dist/js/bootstrap.js') }}" type="text/javascript"></script>
<script src="{{ asset('assets/bootstrap-daterangepicker/daterangepicker.js') }}"></script>
<script src="{{ asset('assets/jquery-timeago/jquery.timeago.js') }}"></script>
<script src="{{ asset('assets/mediaelement/build/mediaelement-and-player.min.js') }}"></script>
<script src="{{ asset('assets/image-map-resizer/js/imageMapResizer.min.js') }}"></script>
<script src="{{ asset('assets/jquery.scrollbar/jquery.scrollbar.min.js') }}"></script>
<script src="{{ asset('assets/readmore-js/readmore.min.js') }}"></script>
<script src="{{ asset('assets/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.js') }}"></script>
<script src="{{ asset('bundles/ivoryckeditor/ckeditor.js') }}" type="text/javascript"></script>
<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>
{% block chamilo_header_js %}
{% include '@ChamiloTheme/Layout/header.js.twig' %}
{% include '@ChamiloTheme/Layout/header.js.twig' %}
{% endblock %}
{#'@MopaBootstrapBundle/Resources/public/js/eyecon-bootstrap-datepicker.js'#}
@ -101,185 +99,179 @@
{#%}#}
{#<script type="text/javascript" src="{{ asset_url | replace({'/app_dev.php': ''}) }}"></script>#}
{#{% endjavascripts %}#}
{% endblock %}
</head>
{#<body class="{{ admin_skin|default('skin-blue')}}">#}
<body>
<noscript>{{ "NoJavascript" | trans }}</noscript>
{#{% if show_header == true %}#}
{% block chamilo_wrap %}
<div id="page-wrap">
<!-- page section -->
{# Bug and help notifications #}
{#{% block help_notifications %}#}
{#<ul id="navigation" class="notification-panel">#}
{#{{ help_content }}#}
{#{{ bug_notification_link }}#}
{#</ul>#}
{#{% endblock %}#}
{# topbar #}
{% block topbar %}
{#{% include "@template_style/layout/topbar.html.twig" %}#}
{#{% if show_toolbar == 1 %}#}
{#<div class="clear-header"></div>#}
{#{% endif %}#}
{% endblock %}
{% block chamilo_wrap %}
{% autoescape false %}
<div id="page-wrap">
<!-- page section -->
{# Bug and help notifications #}
{#{% block help_notifications %}#}
{#<ul id="navigation" class="notification-panel">#}
{#{{ help_content }}#}
{#{{ bug_notification_link }}#}
{#</ul>#}
{#{% endblock %}#}
<header>
<div class="extra-header">
{{ header_extra_content }}
</div>
{# topbar #}
{% block topbar %}
{#{% include "@template_style/layout/topbar.html.twig" %}#}
{#{% if show_toolbar == 1 %}#}
{#<div class="clear-header"></div>#}
{#{% endif %}#}
{% endblock %}
<header>
<div class="extra-header">
{{ header_extra_content }}
</div>
<section id="main" class="container">
{% if plugin_header_main %}
<div class="row">
<div class="col-lg-12">
{{ plugin_header_main }}
</div>
</div>
{% endif %}
<div class="row">
<div class="col-lg-3">
<div class="logo">
{#<a href="{{ url('index') }}">#}
<img src="{{ asset('css/themes/'~ theme ~'/images/header-logo.png') }}"/>
{#</a>#}
</div>
</div>
<div class="col-lg-9">
<div class="col-sm-4">
{% if plugin_header_left is not null %}
<div id="plugin_header_left">
{{ plugin_header_left }}
</div>
{% endif %}
<section id="main" class="container">
{% if plugin_header_main %}
<div class="row">
<div class="col-lg-12">
{{ plugin_header_main }}
</div>
</div>
<div class="col-sm-4">
{% if plugin_header_center is not null %}
<div id="plugin_header_center">
{{ plugin_header_center }}
</div>
{% endif %}
{% endif %}
<div class="row">
<div class="col-lg-3">
<div class="logo">
{#<a href="{{ url('index') }}">#}
<img src="{{ asset('css/themes/'~ theme ~'/images/header-logo.png') }}"/>
{#</a>#}
</div>
</div>
<div class="col-sm-4">
{% if plugin_header_right is not null %}
<div id="plugin_header_right">
{{ plugin_header_right }}
<div class="col-lg-9">
<div class="col-sm-4">
{% if plugin_header_left is not null %}
<div id="plugin_header_left">
{{ plugin_header_left }}
</div>
{% endif %}
</div>
<div class="col-sm-4">
{% if plugin_header_center is not null %}
<div id="plugin_header_center">
{{ plugin_header_center }}
</div>
{% endif %}
</div>
<div class="col-sm-4">
{% if plugin_header_right is not null %}
<div id="plugin_header_right">
{{ plugin_header_right }}
</div>
{% endif %}
<div class="section-notifications">
<ul id="notifications" class="nav nav-pills pull-right">
{{ notification_menu }}
</ul>
</div>
{% endif %}
<div class="section-notifications">
<ul id="notifications" class="nav nav-pills pull-right">
{{ notification_menu }}
</ul>
{{ accessibility }}
</div>
{{ accessibility }}
</div>
</div>
</div>
</section>
<section id="menu-bar">
{# menu #}
{% block menu %}
<nav class="navbar navbar-default">
<div class="container">
<div class="collapse navbar-collapse">
{{ mopa_bootstrap_menu('ChamiloCoreBundle:NavBuilder:leftMenu', {'automenu': 'navbar', 'stacked' : false}) }}
{{ mopa_bootstrap_menu('ChamiloCoreBundle:NavBuilder:rightMenu', {'automenu': 'navbar', 'pull-right' : true} ) }}
</section>
<section id="menu-bar">
{# menu #}
{% block menu %}
<nav class="navbar navbar-default">
<div class="container">
<div class="collapse navbar-collapse">
{{ mopa_bootstrap_menu('ChamiloCoreBundle:NavBuilder:leftMenu', {'automenu': 'navbar', 'stacked' : false}) }}
{% if app.user is not null and is_granted('IS_AUTHENTICATED_FULLY') %}
<div class="navbar-custom-menu">
<ul class="nav navbar-nav navbar-right">
{{ render(controller('ChamiloThemeBundle:Navbar:user')) }}
</ul>
</div>
{% endif %}
</div>
</div>
</div>
</nav>
{#{% include "@template_style/layout/menu.html.twig" %}#}
{% endblock %}
</section>
{#<section id="breadcrumb-bar">#}
{#<div class="container">#}
{#&#123;&#35; breadcrumb &#35;&#125;#}
{#{% block breadcrumb %}#}
{#{{ breadcrumb }}#}
{#{% endblock %}#}
{#</div>#}
{#</section>#}
</header>
</nav>
{#{% include "@template_style/layout/menu.html.twig" %}#}
{% endblock %}
</section>
</header>
<div id="top_main_content" class="container">
{#{{ locale_switcher() }}#}
<div id="top_main_content" class="container">
{#{{ locale_switcher() }}#}
{# course navigation links/shortcuts need to be activated by the admin #}
{#{% include "@template_style/layout/course_navigation.html.twig" %}#}
{#{% endif %}#}
{% block chamilo_header %}
{#<header class="header">#}
{#{% block chamilo_logo %}#}
{#<a href="#" class="logo">#}
{#Chamilo#}
{#&#123;&#35;{{- chamilo_settings_get('platform.institution') -}}&#35;&#125;#}
{#</a>#}
{#{% endblock %}#}
{#{% block chamilo_main_navbar %}#}
{#<!-- Header Navbar: style can be found in header.less -->#}
{#{% endblock %}#}
{#</header>#}
{% endblock %}
{% include 'SonataCoreBundle:FlashMessage:render.html.twig' %}
{% block chamilo_content %}
{#Check sonata_block.yml settings#}
{#{% include 'SonataSeoBundle:Block:_facebook_sdk.html.twig' %}#}
{#{% include 'SonataSeoBundle:Block:_twitter_sdk.html.twig' %}#}
{#{% include 'SonataSeoBundle:Block:_pinterest_sdk.html.twig' %}#}
{% endblock %}
{% block page_content %}
{% endblock %}
{# course navigation links/shortcuts need to be activated by the admin #}
{#{% include "@template_style/layout/course_navigation.html.twig" %}#}
{#{% endif %}#}
{% block chamilo_header %}
{#<header class="header">#}
{#{% block chamilo_logo %}#}
{#<a href="#" class="logo">#}
{#Chamilo#}
{#&#123;&#35;{{- chamilo_settings_get('platform.institution') -}}&#35;&#125;#}
{#</a>#}
{#{% endblock %}#}
{#{% block chamilo_main_navbar %}#}
{#<!-- Header Navbar: style can be found in header.less -->#}
{#{% endblock %}#}
{#</header>#}
{% endblock %}
{% block sonata_page_container %}
{% endblock %}
{% block chamilo_content %}
{#Check sonata_block.yml settings#}
{#{% include 'SonataSeoBundle:Block:_facebook_sdk.html.twig' %}#}
{#{% include 'SonataSeoBundle:Block:_twitter_sdk.html.twig' %}#}
{#{% include 'SonataSeoBundle:Block:_pinterest_sdk.html.twig' %}#}
{% endblock %}
{#<!-- Right side column. Contains the navbar and content of the page -->#}
{#<div class="col-md-9">#}
{#<!-- Content Header (Page header) -->#}
{#{% block content_header %}#}
{#<section class="content-header">#}
{#{% block content_header_title %}#}
{#<h1>#}
{#{% block page_title %}{% endblock %}#}
{#<small>{% block page_subtitle %}{% endblock %}</small>#}
{#</h1>#}
{#{% endblock %}#}
{% block page_content %}
{% endblock %}
{#{% block chamilo_breadcrumb %}#}
{#{{ render(controller('ChamiloThemeBundle:Breadcrumb:breadcrumb', {'request':app.request, 'title' : block('page_title')})) }}#}
{#{% endblock %}#}
{#</section>#}
{#{% endblock %}#}
{% block sonata_page_container %}
{% endblock %}
{#<!-- Main content -->#}
{#<section class="content">#}
{#{% block page_content %}{% endblock %}#}
{#</section>#}
{#<!-- /.content -->#}
{#</div>#}
{#<!-- /.right-side -->#}
{#<!-- Right side column. Contains the navbar and content of the page -->#}
{#<div class="col-md-9">#}
{#<!-- Content Header (Page header) -->#}
{#{% block content_header %}#}
{#<section class="content-header">#}
{#{% block content_header_title %}#}
{#<h1>#}
{#{% block page_title %}{% endblock %}#}
{#<small>{% block page_subtitle %}{% endblock %}</small>#}
{#</h1>#}
{#{% endblock %}#}
{#{% block chamilo_breadcrumb %}#}
{#{{ render(controller('ChamiloThemeBundle:Breadcrumb:breadcrumb', {'request':app.request, 'title' : block('page_title')})) }}#}
{#{% endblock %}#}
{#</section>#}
{#{% endblock %}#}
{#<!-- Main content -->#}
{#<section class="content">#}
{#{% block page_content %}{% endblock %}#}
{#</section>#}
{#<!-- /.content -->#}
{#</div>#}
{#<!-- /.right-side -->#}
{% endblock %}
</div>
</div>
{# End wrapper div #}
</div> {# end top_main_content #}
</div> {# End page-wrap div #}
{% block chamilo_footer %}
{% include "@ChamiloCore/default/layout/footer.html.twig" %}
{% endblock %}
{% block chamilo_footer_js %}
{% include '@ChamiloTheme/Layout/footer.js.twig' %}
{% endblock %}
{% block chamilo_footer %}
{% include '@ChamiloTheme/Layout/footer.html.twig' %}
{% endblock %}
{% block chamilo_footer_js %}
{% include '@ChamiloTheme/Layout/footer.js.twig' %}
{% endblock %}
{% endautoescape %}
{% endblock %} {# End chamilo_wrap block #}
{% endblock %} {# End wrapper block#}
</body>
</html>

@ -0,0 +1,95 @@
{#<footer {% block footer_open_attributes %}{% endblock footer_open_attributes %}>#}
{% autoescape false %}
<footer id="footer-section" class="sticky-footer bgfooter">
<!-- start of #footer section -->
<div class="container">
<div class="pre-footer">
{% if plugin_pre_footer %}
<div id="plugin_pre_footer">
{{ plugin_pre_footer }}
</div>
{% endif %}
</div>
<div class="sub-footer">
<div class="row">
<div class="col-md-4">
{% if session_teachers is not null %}
<div class="session-teachers">
{{ session_teachers }}
</div>
{% endif %}
{% if teachers is not null %}
<div class="teachers">
{{ teachers }}
</div>
{% endif %}
{% if plugin_footer_left is not null %}
<div id="plugin_footer_left">
{{ plugin_footer_left }}
</div>
{% endif %}
</div>
<div class="col-md-4">
{% if plugin_footer_center is not null %}
<div id="plugin_footer_center">
{{ plugin_footer_center }}
</div>
{% endif %}
</div>
<div class="col-md-4 text-right">
{% if administrator_name is not null %}
<div class="administrator-name">
{{ administrator_name }}
</div>
{% endif %}
<div class="software-name">
<a href="{{_p.web}}" target="_blank">
{{ "PoweredByX" |get_lang | format(_s.software_name) }}
</a>&copy; {{ "now"|date("Y") }}
</div>
{% if plugin_footer_right is not null %}
<div id="plugin_footer_right">
{{ plugin_footer_right }}
</div>
{% endif %}
</div>
</div>
</div>
{% if footer_extra_content is not null %}
<div class="extra-footer">
{{ footer_extra_content }}
</div>
{% endif %}
</div><!-- end of #container -->
</footer>
{% endautoescape %}
{{ execution_stats }}
<div class="modal fade" id="expand-image-modal" tabindex="-1" role="dialog" aria-labelledby="expand-image-modal-title" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="expand-image-modal-title">&nbsp;</h4>
</div>
<div class="modal-body">
</div>
</div>
</div>
</div>
{# Global modal, load content by AJAX call to href attribute on anchor tag with 'ajax' class #}
<div class="modal fade" id="global-modal" tabindex="-1" role="dialog" aria-labelledby="global-modal-title" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="global-modal-title">&nbsp;</h4>
</div>
<div class="modal-body">
</div>
</div>
</div>
</div>
{{ footer_extra_content }}

@ -3,17 +3,17 @@
$(document).ready( function() {
// Date time settings.
moment.locale('{{ app.request.locale }}');
//$.datepicker.setDefaults($.datepicker.regional["{{ app.request.locale }}"]);
//$.datepicker.regional["local"] = $.datepicker.regional["{{ app.request.locale }}"];
$.datepicker.setDefaults($.datepicker.regional["{{ app.request.locale }}"]);
$.datepicker.regional["local"] = $.datepicker.regional["{{ app.request.locale }}"];
// Chosen select
{#$(".chzn-select").chosen({#}
{#disable_search_threshold: 10,#}
{#no_results_text: '{{ 'SearchNoResultsFound' | trans }}',#}
{#placeholder_text_multiple: '{{ 'SelectSomeOptions' | trans }}',#}
{#placeholder_text_single: '{{ 'SelectAnOption' | trans }}',#}
{#width: "100%"#}
{#});#}
$(".chzn-select").chosen({
disable_search_threshold: 10,
no_results_text: '{{ 'SearchNoResultsFound' | trans | escape('js') }}',
placeholder_text_multiple: '{{ 'SelectSomeOptions' | trans | escape('js') }}',
placeholder_text_single: '{{ 'SelectAnOption' | trans | escape('js') }}',
width: "100%"
});
// Bootstrap tabs.
$('.tab-wrapper a').click(function (e) {
@ -60,7 +60,7 @@
});
// Adv multi-select search input.
$('.select_class_filter').on('focus', function () {
$('.select_class_filter').each( function () {
var inputId = $(this).attr('id');
inputId = inputId.replace('-filter', '');
$("#" + inputId).filterByText($("#" + inputId + "-filter"));
@ -69,13 +69,14 @@
$(".jp-jplayer audio").addClass('skip');
// Mediaelement
//jQuery('video:not(.skip), audio:not(.skip)').mediaelementplayer(/* Options */);
if ( {{ show_media_element }} == 1) {
jQuery('video:not(.skip), audio:not(.skip)').mediaelementplayer(/* Options */);
}
// Table highlight.
$("form .data_table input:checkbox").click(function () {
if ($(this).is(":checked")) {
$(this).parentsUntil("tr").parent().addClass("row_selected");
} else {
$(this).parentsUntil("tr").parent().removeClass("row_selected");
}
@ -86,13 +87,19 @@
$("input[name=login]").focus();
}
/* For IOS users */
$('.autocapitalize_off').attr('autocapitalize', 'off');
// Tool tip (in exercises)
var tip_options = {
placement: 'right'
};
$('.boot-tooltip').tooltip(tip_options);
var more = '{{ 'SeeMore' | get_lang | escape('js') }}';
var close = '{{ 'Close' | get_lang | escape('js') }}';
$('.list-teachers').readmore({
speed: 75,
moreLink: '<a href="#">' + more + '</a>',
lessLink: '<a href="#">' + close + '</a>',
collapsedHeight: 35,
blockCSS: 'display: block; width: 100%;'
});
});
</script>

@ -1,3 +1,4 @@
{# This file changes/format the symfony2 forms using the Bootstrap UI #}
{% extends 'form_div_layout.html.twig' %}
{% block widget_attributes %}

@ -5,6 +5,7 @@ var plugins = [
'asciisvg',
'audio',
'ckeditor_wiris',
'image2_chamilo',
'dialogui',
'glossary',
'leaflet',
@ -17,11 +18,12 @@ var plugins = [
'video',
'wikilink',
'wordcount',
'youtube'
'youtube',
'inserthtml'
];
plugins.forEach(function (plugin) {
CKEDITOR.plugins.addExternal(plugin, '{{ asset('bundles/chamilocore/ckeditor/plugins/') }}' + plugin + '/');
CKEDITOR.plugins.addExternal(plugin, '{{ asset('js/ckeditor/plugins/') }}' + plugin + '/');
});
// basic plugins
@ -36,18 +38,19 @@ plugins = [
'sharedspace',
//'uicolor',
'widget',
'widgetselection',
'tableresize',
'xml'
];
plugins.forEach(function (plugin) {
CKEDITOR.plugins.addExternal(plugin, '{{ asset('bundles/chamilocore/components/ckeditor/plugins/') }}' + plugin + '/');
CKEDITOR.plugins.addExternal(plugin, '{{ asset('assets/ckeditor/plugins/') }}' + plugin + '/');
});
/* Global chat variables */
var ajax_url = '{{ url('web.ajax') }}chat.ajax.php';
var online_button = '{{ asset('bundles/chamilocore/img/statusonline.png') }}';
var offline_button = '{{ asset('bundles/chamilocore/img/statusoffline.png') }}';
var online_button = '{{ asset('assets/img/statusonline.png') }}';
var offline_button = '{{ asset('assets/img/statusoffline.png') }}';
var connect_lang = '{{ "ChatConnected"|trans }}';
var disconnect_lang = '{{ "ChatDisconnected"|trans }}';
@ -96,23 +99,37 @@ var showTemplates = function (ckeditorName) {
});
};
function doneResizing() {
var widhtWindow = $(window).width();
if ((widhtWindow>=1024) && (widhtWindow>=768)) {
$("#profileCollapse").addClass("in");
$("#courseCollapse").addClass("in");
$("#skillsCollapse").addClass("in");
$("#sn-sidebar-collapse").addClass("in");
$("#user_image_block").removeClass("text-muted");
} else {
$("#profileCollapse").removeClass("in");
$("#courseCollapse").removeClass("in");
$("#skillsCollapse").removeClass("in");
$("#sn-avatar-one").removeClass("in");
$("#user_image_block").addClass("text-muted");
}
};
$(document).ready(function() {
$("#open-view-list").click(function(){
$("#student-list-work").fadeIn(300);
});
$("#closed-view-list").click(function(){
$("#student-list-work").fadeOut(300);
});
check_brand();
//if exists the toolbar admin
if($('#toolbar-admin').length){
var heigthToolBar= $('#toolbar-admin').height();
$('header').css('margin-top', heigthToolBar+'px');
$('#page-back').css('padding-top', heigthToolBar+20+'px');
}
var id;
$(window).resize(function() {
clearTimeout(id);
id = setTimeout(doneResizing, 200);
});
// Removes the yellow input in Chrome
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
@ -126,12 +143,12 @@ $(document).ready(function() {
});
}
{#$(".accordion_jquery").accordion({#}
{#autoHeight: false,#}
{#active: false, // all items closed by default#}
{#collapsible: true,#}
{#header: ".accordion-heading"#}
{#});#}
$(".accordion_jquery").accordion({
autoHeight: false,
active: false, // all items closed by default
collapsible: true,
header: ".accordion-heading"
});
// Global popup
$('body').on('click', 'a.ajax', function(e) {
@ -212,7 +229,7 @@ $(document).ready(function() {
);
/* Make responsive image maps */
// $('map').imageMapResize();
//$('map').imageMapResize();
jQuery.fn.filterByText = function(textbox) {
return this.each(function() {
@ -239,6 +256,11 @@ $(document).ready(function() {
});
});
};
$(".black-shadow").mouseenter(function() {
$(this).addClass('hovered-course');
}).mouseleave(function() {
$(this).removeClass('hovered-course');
});
});
$(window).resize(function() {
@ -246,6 +268,18 @@ $(window).resize(function() {
});
$(document).scroll(function() {
var valor = $('body').outerHeight() - 700;
if ($(this).scrollTop() > 100) {
$('.bottom_actions').addClass('bottom_actions_fixed');
} else {
$('.bottom_actions').removeClass('bottom_actions_fixed');
}
if ($(this).scrollTop() > valor) {
$('.bottom_actions').removeClass('bottom_actions_fixed');
} else {
$('.bottom_actions').addClass('bottom_actions_fixed');
}
//Exercise warning fixed at the top
var fixed = $("#exercise_clock_warning");
@ -264,7 +298,7 @@ $(document).scroll(function() {
fixed.css('width', '100%');
} else {
fixed.removeClass('navbar-fixed-top');
fixed.css('width', '200px');
fixed.css('width', '100%');
}
}
@ -283,8 +317,10 @@ $(document).scroll(function() {
}
$('.new_actions').attr('data-top', offset.top + more_top);
}
if ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop()) {
// Check if the height is enough before fixing the icons menu (or otherwise removing it)
// Added a 30px offset otherwise sometimes the menu plays ping-pong when scrolling to
// the bottom of the page on short pages.
if ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop() + 30) {
$('.new_actions').addClass('new_actions-fixed');
} else {
$('.new_actions').removeClass('new_actions-fixed');
@ -450,4 +486,40 @@ function hideUnhide(inId, inIdTxt, inTxtHide, inTxtUnhide)
$('#'+inIdTxt).attr("value", inTxtHide);
}
}
function expandColumnToogle(buttonSelector, col1Info, col2Info)
{
$(buttonSelector).on('click', function (e) {
e.preventDefault();
col1Info = $.extend({
selector: '',
width: 4
}, col1Info);
col2Info = $.extend({
selector: '',
width: 8
}, col2Info);
if (!col1Info.selector || !col2Info.selector) {
return;
}
var col1 = $(col1Info.selector),
col2 = $(col2Info.selector);
$('#expand').toggleClass('hide');
$('#contract').toggleClass('hide');
if (col2.is('.col-md-' + col2Info.width)) {
col2.removeClass('col-md-' + col2Info.width).addClass('col-md-12');
col1.removeClass('col-md-' + col1Info.width).addClass('hide');
return;
}
col2.removeClass('col-md-12').addClass('col-md-' + col2Info.width);
col1.removeClass('hide').addClass('col-md-' + col1Info.width);
});
}
</script>

@ -0,0 +1,4 @@
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %}
{% block title %}
{{- chamilo_settings_get('platform.site_name') -}} - Web theme
{% endblock %}

@ -0,0 +1,4 @@
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %}
{#{% extends 'SonataPageBundle::base_layout.html.twig' %}#}

@ -0,0 +1,7 @@
{# Just echo content #}
{% autoescape false %}
{% block content %}
{{ content }}
{% endblock %}
{% endautoescape %}

@ -0,0 +1,138 @@
{% extends 'APYDataGridBundle::blocks.html.twig' %}
{% block grid_actions %}
<div class="mass-actions">
<div class="btn-group" role="group">
<span class="grid_massactions_helper">
<a class="btn btn-default" href="#"
onclick="return {{ grid.hash }}_markVisible(true);">{{ 'Select visible'|trans }}</a>
<a class="btn btn-default" href="#"
onclick="return {{ grid.hash }}_markVisible(false);">{{ 'Deselect visible'|trans }}</a>
<a class="btn btn-default" href="#"
onclick="return {{ grid.hash }}_markAll(true);">{{ 'Select all'|trans }}</a>
<a class="btn btn-default" href="#"
onclick="return {{ grid.hash }}_markAll(false);">{{ 'Deselect all'|trans }}</a>
<span class="mass-actions-selected"
id="{{ grid.hash }}_mass_action_selected"></span>
</span>
</div>
{% spaceless %}
<div style="float:right;" class="grid_massactions">
{{ 'Action'|trans }}
<input type="hidden" id="{{ grid.hash }}_mass_action_all"
name="{{ grid.hash }}[{{ constant('APY\\DataGridBundle\\Grid\\Grid::REQUEST_QUERY_MASS_ACTION_ALL_KEYS_SELECTED') }}]"
value="0"/>
<select name="{{ grid.hash }}[{{ constant('APY\\DataGridBundle\\Grid\\Grid::REQUEST_QUERY_MASS_ACTION') }}]">
<option value="-1"></option>
{% for key, massAction in grid.massActions %}
<option value="{{ key }}">{{ massAction.title|trans }}</option>
{% endfor %}
</select>
<input type="submit" value="{{ 'Submit Action'|trans }}"/>
</div>
{% endspaceless %}
</div>
{% endblock grid_actions %}
{# Bootstrap changes #}
{% block grid_column_actions_cell %}
{% set actions = column.getActionsToRender(row) %}
<div class="btn-group">
{% for action in actions %}
{% if action.attributes.form_delete is defined and action.attributes.form_delete %}
<div class="btn-group">
<form method="post" action="{{ url(action.route, column.routeParameters(row, action), false) }}">
<input type="hidden" name="_method" value="DELETE" />
<button type="submit" class="btn btn-danger">
{{ action.title|trans }}
</button>
</form>
</div>
{% else %}
<a class="btn btn-default" href="{{ url(action.route, column.routeParameters(row, action), false) }}" target="{{ action.target }}"{% if action.confirm %} onclick="return confirm('{{ action.confirmMessage }}')"{% endif %}{% for name, value in action.attributes %} {{ name }}="{{ value }}" {% endfor %}>
{{ action.title|trans }}
</a>
{% endif %}
{% endfor %}
</div>
{% endblock grid_column_actions_cell %}
{% block grid %}
<div class="col-md-10">
<div class="box box-primary">
<div class="box-body table-responsive no-padding">
{% if grid.totalCount > 0 or grid.isFiltered or grid.noDataMessage is sameas(false) %}
<form id="{{ grid.hash }}" action="{{ grid.routeUrl }}"
method="post">
<div class="grid_header">
{% if grid.massActions|length > 0 %}
{{ grid_actions(grid) }}
{% endif %}
</div>
<div class="grid_body">
<table class="table table-bordered table-striped">
{% if grid.isTitleSectionVisible %}
{{ grid_titles(grid) }}
{% endif %}
{% if grid.isFilterSectionVisible %}
{{ grid_filters(grid) }}
{% endif %}
{{ grid_rows(grid) }}
</table>
</div>
<div class="grid_footer">
{% if grid.isPagerSectionVisible %}
{{ grid_pager(grid) }}
{% endif %}
{% if grid.exports|length > 0 %}
{{ grid_exports(grid) }}
{% endif %}
{% if grid.tweaks|length > 0 %}
{{ grid_tweaks(grid) }}
{% endif %}
</div>
{% if withjs %}
{{ grid_scripts(grid) }}
{% endif %}
</form>
{% else %}
{{ grid_no_data(grid) }}
{% endif %}
</div>
</div>
</div>
{% endblock grid %}
{% block grid_search %}
{% if grid.isFilterSectionVisible %}
<div class="col-md-2">
<div class="box box-primary">
<div class="box-header">
<h4 class="box-title filter_legend inactive">Filters</h4>
</div>
<div class="box-body">
<form id="{{ grid.hash }}_search"
action="{{ grid.routeUrl }}" method="post">
{% for column in grid.columns %}
{% if column.isFilterable and column.type not in ['actions', 'massaction'] %}
{% set columnTitle = grid.prefixTitle ~ column.title %}
<div class="{{ cycle(['odd', 'even'], loop.index) }}">
<label>{{ columnTitle|trans }}</label>{{ grid_filter(column, grid, false)|raw }}
</div>
{% endif %}
{% endfor %}
<div class="grid-search-action"><input type="submit"
class="grid-search-submit"
value="{{ 'Search'|trans }}"/><input
type="button" class="grid-search-reset"
value="{{ 'Reset'|trans }}"
onclick="return {{ grid.hash }}_reset();"/>
</div>
</form>
</div>
</div>
</div>
{% endif %}
{% endblock grid_search %}

@ -0,0 +1,77 @@
{% extends '@ChamiloTheme/Layout/base-layout.html.twig' %}
{% block page_content %}
{% autoescape false %}
{% if js is defined %}
{% for item in js %}
{{ item }}
{% endfor %}
{% endif %}
{% if plugin_main_top %}
<div id="plugin_main_top" class="col-md-12">
{{ plugin_main_top }}
</div>
{% endif %}
{% if plugin_content_top %}
<div id="plugin_content_top" class="col-md-12">
{{ plugin_content_top }}
</div>
{% endif %}
{% if show_course_shortcut is not null %}
<div class="nav-tools">
{{ show_course_shortcut }}
</div>
{% endif %}
<section id="content-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-12">
{% autoescape false %}
{# Breadcrumb #}
{% block chamilo_breadcrumb %}
{% include '@ChamiloCore/breadcrumb.html.twig' %}
{% endblock %}
{% if actions != '' %}
<div class="actions">
{{ actions }}
</div>
{% endif %}
{% block chamilo_messages %}
{% autoescape false %}
{% include '@ChamiloTheme/FlashMessage/render.html.twig' %}
{% endautoescape %}
{% endblock %}
{# Content #}
{% block content %}
<section id="main_content">
{{ content }}
</section>
{% endblock %}
{% endautoescape %}
</div>
</div>
</div>
</section>
{% if plugin_content_bottom %}
<div id="plugin_content_bottom" class="col-md-12">
{{ plugin_content_bottom }}
</div>
{% endif %}
{% if plugin_main_bottom %}
<div id="plugin_main_bottom" class="col-md-12">
{{ plugin_main_bottom }}
</div>
{% endif %}
{% endautoescape %}
{% endblock %}

@ -0,0 +1,20 @@
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %}
{% block chamilo_wrap %}
{% if js is defined %}
{% autoescape false %}
{% for item in js %}
{{ item }}
{% endfor %}
{% endautoescape %}
{% endif %}
{% block content %}
{% autoescape false %}
{{ content }}
{% endautoescape %}
{% endblock %}
{% endblock %}
{# Some how twig does not override completely a block that used an "include" call #}
{% block chamilo_footer %}
{% endblock %}

@ -0,0 +1,82 @@
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %}
{% set pathInfo = path(
app.request.attributes.get('_route'),
app.request.attributes.get('_route_params'))
%}
{% block page_content %}
{% autoescape false %}
{% if plugin_main_top %}
<div id="plugin_main_top" class="col-md-12">
{{ plugin_main_top }}
</div>
{% endif %}
{# Left column #}
<div class="col-md-3">
{% if plugin_menu_top %}
<div id="plugin_menu_top">
{{ plugin_menu_top }}
</div>
{% endif %}
{% block chamilo_left_column %}
<section class="left_column">
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
{# User avatar #}
{{ render(controller('ChamiloThemeBundle:Sidebar:userPanel', {'pathInfo': pathInfo })) }}
{% endif %}
{# Login, Courses, Skills menu #}
{{ render(controller('ChamiloThemeBundle:Sidebar:leftMenu', {'request' : app.request, pathInfo: pathInfo })) }}
</section>
{% endblock %}
{% if plugin_menu_bottom %}
<div id="plugin_menu_bottom">
{{ plugin_menu_bottom }}
</div>
{% endif %}
</div>
{# Right column #}
<div class="col-md-9">
{% if plugin_content_top %}
<div id="plugin_content_top">
{{ plugin_content_top }}
</div>
{% endif %}
{% block chamilo_breadcrumb %}
{% include '@ChamiloCore/breadcrumb.html.twig' %}
{% endblock %}
{% block chamilo_messages %}
{# Flash messages #}
{% autoescape false %}
{% include '@ChamiloTheme/FlashMessage/render.html.twig' %}
{% endautoescape %}
{% endblock %}
{% block chamilo_right_column %}
{% block content %}
<section class="right_column">
{{ content }}
</section>
{% endblock %}
{% endblock %}
{% if plugin_content_bottom %}
<div id="plugin_content_bottom">
{{plugin_content_bottom}}
</div>
{% endif %}
</div>
{% if plugin_main_bottom %}
<div id="plugin_main_bottom" class="col-md-12">
{{ plugin_main_bottom }}
</div>
{% endif %}
{% endautoescape %}
{% endblock %}

@ -1,33 +1,20 @@
{% import "ChamiloThemeBundle:Macros:box.html.twig" as macro %}
<!doctype html>
<!--[if lt IE 7 ]><html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]><html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]><html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]><html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class="no-js"> <!--<![endif]-->
<!--[if lt IE 7 ]><html lang="{{ app.request.getLocale() }}" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]><html lang="{{ app.request.getLocale() }}" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]><html lang="{{ app.request.getLocale() }}" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]><html lang="{{ app.request.getLocale() }}" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="{{ app.request.getLocale() }}" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="author" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>
{% block title %}
{#{{ chamilo_settings_get('platform.institution') }} - {{ chamilo_settings_get('platform.site_name') }}#}
Chamilo
{% endblock %}
{% block title %}
{{ chamilo_settings_get('platform.institution') }} - {{ chamilo_settings_get('platform.site_name') }}
{% endblock %}
</title>
{# Check chamilo_css key in assetic.yml #}
{#{%- stylesheets '@chamilo_css' -%}#}
{#<link rel="stylesheet" href="{{ asset_url }}" />#}
{#{% endstylesheets %}#}
{#{% block javascripts %}#}
{#{%- javascripts '@chamilo_js' -%}#}
{#<script src="{{ asset_url }}"></script>#}
{#{% endjavascripts %}#}
{#{% endblock %}#}
{% block stylesheets %}
{% for stylesheet in sonata_admin.adminPool.getOption('stylesheets', []) %}
<link rel="stylesheet" href="{{ asset(stylesheet) }}">
@ -36,13 +23,15 @@
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
Chamilo
{{ chamilo_settings_get('platform.institution') }} - {{ chamilo_settings_get('platform.site_name') }}
</div>
{% block page_content %}{% endblock %}
{# To see login layout check #}
{# src/Chamilo/UserBundle/Resources/views/Security/base_login.html.twig #}
{# src/Chamilo/UserBundle/Resources/views/Security/login.html.twig #}
{% block page_content %}
{% endblock %}
</div>
</body>
</html>

@ -0,0 +1,10 @@
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %}
{# overrides everything inside body no-footer no-header #}
{% block chamilo_wrap %}
{% autoescape false %}
{{ content }}
{% endautoescape %}
{% endblock %}
{% block chamilo_footer %}
{% endblock %}

@ -0,0 +1,70 @@
<!-- Topbar -->
{% if show_toolbar == 1 %}
<nav id="toolbar-admin" class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#toolbar">
<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="{{ _p.web }}">
<img src="{{ "icon-chamilo.png"|icon(22) }}" title="{{ "siteName" | get_setting }}">
</a>
</div>
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
<div class="collapse navbar-collapse" id="toolbar">
<ul class="nav navbar-nav">
<li class="active"><a href="{{ _p.web }}user_portal.php"> {{ "MyCourses"|get_lang }}</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Tracking'|get_lang }}<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{{ _p.web_main }}mySpace/">{{ "CoursesReporting"|get_lang }}</a></li>
<li><a href="{{ _p.web_main }}mySpace/index.php?view=admin">{{ "AdminReports"|get_lang }}</a></li>
<li><a href="{{ _p.web_main }}tracking/exams.php">{{ "ExamsReporting"|get_lang }}</a></li>
<li class="divider"></li>
<li><a href="{{ _p.web_main }}dashboard/">{{ "Dashboard"|get_lang }}</a></li>
</ul>
</li>
{% if is_granted('ROLE_ADMIN') == 1 %}
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Administration'|get_lang }}<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{{ _p.web_main }}admin/">{{ "Home"|get_lang }}</a></li>
<li><a href="{{ _p.web_main }}admin/user_list.php">{{ "UserList"|get_lang }}</a></li>
<li><a href="{{ _p.web_main }}admin/course_list.php">{{ "CourseList"|get_lang }}</a></li>
<li><a href="{{ _p.web_main }}session/session_list.php">{{ "SessionList"|get_lang }}</a></li>
<li class="divider"></li>
<li><a href="{{ _p.web_main }}admin/settings.php">{{ "Settings"|get_lang }}</a></li>
<li class="divider"></li>
<li><a href="{{ _p.web_main }}admin/settings.php?category=Plugins">{{ "Plugins"|get_lang }}</a></li>
<li><a href="{{ _p.web_main }}admin/settings.php?category=Regions">{{ "Regions"|get_lang }}</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ 'Add'|get_lang }}<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{{ _p.web_main }}admin/user_add.php">{{ "User"|get_lang }}</a></li>
<li><a href="{{ _p.web_main }}admin/course_add.php">{{ "Course"|get_lang }}</a></li>
<li><a href="{{ _p.web_main }}session/session_add.php">{{ "Session"|get_lang }}</a></li>
</ul>
</li>
{% endif %}
</ul>
{% if is_granted('ROLE_ADMIN') == 1 %}
<form class="navbar-form navbar-left" role="search" action="{{ _p.web_main }}admin/user_list.php" method="get">
<input type="text" class="form-control" placeholder="{{'SearchUsers'|get_lang }}" name="keyword">
</form>
{% endif %}
<ul class="nav navbar-nav navbar-right">
<li><a href="{{ path('logout') }}">{{ "Logout"|get_lang }}</a></li>
</ul>
</div> <!-- /nav collapse -->
{% endif %}
</div> <!-- /container-->
</nav><!-- /topbar -->
{% endif %}

@ -1,47 +1,34 @@
<!-- User Account: style can be found in dropdown.less -->
{% import "ChamiloThemeBundle:Macros:image.html.twig" as macro_image %}
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="glyphicon glyphicon-user"></i>
<span>{{ user.username }} <i class="caret"></i></span>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<img class="img-circle" src="{{ asset(user.avatarOrAnonymous(32)) }}" alt="{{ user.completeName }}" />
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header bg-light-blue">
{{ macro_image.avatar(user.avatar, user.username) }}
<p>
{{ user.username }}
<small>
{{ 'Member since %date%'|trans({'%date%': user.memberSince|date('m.Y') }, 'ChamiloThemeBundle') }}
</small>
<ul class="dropdown-menu" role="menu">
<li class="user-header">
<div class="text-center">
<img class="img-circle" src="{{ asset(user.avatarOrAnonymous(64)) }}" alt="{{ user.completeName }}" />
<p class="name">
<a href="{{ url('main', { 'name' : 'social/home.php' })}}">
{{ user.completeName }}
</a>
</p>
</li>
<!-- Menu Body -->
{#
<li class="user-body">
<div class="col-xs-4 text-center">
<a href="#">Followers</a>
</div>
<div class="col-xs-4 text-center">
<a href="#">Sales</a>
</div>
<div class="col-xs-4 text-center">
<a href="#">Friends</a>
<p><i class="fa fa-envelope-o" aria-hidden="true"></i> {{ user.email }}</p>
</div>
</li>
#}
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="{{ path('chamilo_core_user_user_profile', {'username' : user.identifier}) }}" class="btn btn-default btn-flat">
{{'Profile'|trans({}, 'ChamiloThemeBundle')}}
</a>
</div>
<div class="pull-right">
<a href="{{ path('logout') }}" class="btn btn-default btn-flat">
{{ 'Sign out'|trans({}, 'ChamiloThemeBundle') }}
</a>
</div>
<li role="separator" class="divider"></li>
<li class="user-body">
<a title="{{ "Inbox"|trans }}" href="{{ url('main', { 'name' : 'messages/inbox.php' }) }}">
<em class="fa fa-envelope" aria-hidden="true"></em> {{ "Inbox"|get_lang }}
</a>
<a title="{{ "MyCertificates"|trans }}" href="{{ url('main', { 'name' : 'gradebook/my_certificates.php' }) }}">
<em class="fa fa-graduation-cap" aria-hidden="true"></em> {{ "MyCertificates"|get_lang }}
</a>
<a id="logout_button" title="{{ "Logout"|trans }}" href="{{ path('logout') }}" >
<em class="fa fa-sign-out"></em> {{ "Logout"|trans }}
</a>
</li>
</ul>
</li>

@ -0,0 +1,47 @@
<!-- @todo add permissions for each menu sidebar menu: : style can be found in sidebar.less -->
{% import "ChamiloThemeBundle:Macros:box.html.twig" as macro %}
{% autoescape false %}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
{{ macro.panel(
'Profile' | trans,
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:profileMenu', {'automenu': 'pills', 'stacked':true})
) }}
{{ macro.panel(
'Courses' | trans,
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:courseMenu', {'automenu': 'pills', 'stacked':true})
) }}
{{ macro.panel(
'Sessions' | trans,
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:sessionMenu', {'automenu': 'pills', 'stacked':true})
) }}
{{ macro.panel(
'Skills' | trans,
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:skillsMenu', {'automenu': 'pills', 'stacked':true})
) }}
{% else %}
{# Plugin login before/after tpls #}
{% if plugin_login_top is not null %}
<div id="plugin_login_top">
{{ plugin_login_top }}
</div>
{% endif %}
{% include '@ChamiloTheme/Sidebar/login.html.twig' %}
{% if plugin_login_bottom is not null %}
<div id="plugin_login_bottom">
{{ plugin_login_bottom }}
</div>
{% endif %}
{% endif %}
{{ macro.panel(
'Help' | trans,
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:helpMenu', {'automenu': 'pills', 'stacked':true})
) }}
{% endautoescape %}

@ -0,0 +1,36 @@
{{ locale_switcher(null, null, 'ChamiloCoreBundle:Admin:switcher_links.html.twig') }}
<form class="form-horizontal" action="{{ path("sonata_user_admin_security_check") }}" method="post" name="formLogin" id="formLogin">
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
<fieldset>
<div class="input-group">
<div class="input-group-addon">
<em class="fa fa-user fa-fw"></em>
</div>
<input id="login" autofocus="autofocus" placeholder="{{ 'UserName' | trans }}"
autocapitalize="none" class="form-control" name="_username"
type="text">
</div>
<div class="input-group">
<div class="input-group-addon">
<em class="fa fa-lock fa-fw"></em>
</div>
<input id="password" placeholder="{{ 'Pass' | trans }}" autocapitalize="none"
class="form-control" name="_password" type="password">
</div>
<div class="input-group">
<div class="checkbox">
<label for="remember_me">
<input type="checkbox" id="remember_me" name="_remember_me" value="on"/>{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}
</label>
</div>
</div>
<button class="btn-block btn btn-primary " name="submitAuth" type="submit">
{{ 'LoginEnter' | trans }}
</button>
</fieldset>
<input name="_qf__formLogin" type="hidden" value="">
</form>
{{ mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:loginMenu', {'automenu': 'pills', 'stacked':true}) }}

@ -1,4 +1,4 @@
<!-- search form -->
<!-- @todo search form -->
<form action="#" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search..."/>

@ -0,0 +1,11 @@
{% set pathInfo = path(
app.request.attributes.get('_route'),
app.request.attributes.get('_route_params'))
%}
{# Profile block #}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
{{ render(controller('ChamiloThemeBundle:Sidebar:userPanel', {'pathInfo': pathInfo })) }}
{#{{ render(controller('ChamiloThemeBundle:Sidebar:searchForm')) }}#}
{{ render(controller('ChamiloThemeBundle:Sidebar:socialPanel', {'pathInfo': pathInfo })) }}
{% endif %}

@ -0,0 +1,9 @@
{% import "ChamiloThemeBundle:Macros:box.html.twig" as macro %}
{% import "ChamiloThemeBundle:Macros:image.html.twig" as macro_image %}
{{
macro.panel(
'SocialNetwork' | trans,
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:socialMenu', {'automenu': 'pills', 'stacked':true})
)
}}

@ -1,24 +1,23 @@
{% import "ChamiloThemeBundle:Macros:box.html.twig" as macro %}
{% import "ChamiloThemeBundle:Macros:image.html.twig" as macro_image %}
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<div style="text-align:center;" id="user_image_block" class="panel panel-default">
<div class="panel-body">
{% if user.avatar %}
{{ macro_image.avatar_from_media(user.avatar, user.username) }}
{% else %}
{{ macro_image.avatar('bundles/chamilocore/img/unknown.jpg', user.username) }}
{{ macro_image.avatar('img/icons/128/unknown.png', user.username) }}
{% endif %}
</div>
<div class="pull-left info">
<p>{{ 'Hello, %user%'| trans( {'%user%': user.username }, 'ChamiloThemeBundle') }}</p>
<a href="#">
<i class="fa fa-circle text-success"></i> {{ 'Online' | trans }}
</a>
</div>
<p>{{ 'Hello, %user%'| trans( {'%user%': user.username }, 'ChamiloThemeBundle') }}</p>
<a href="#">
<i class="fa fa-circle text-success"></i> {{ 'Online' | trans }}
</a>
{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
<a href="{{ path('home', {'_switch_user': '_exit'}) }}">
{{ 'Exit impersonation' | trans }}
</a>
<a href="{{ path('home', {'_switch_user': '_exit'}) }}">
{{ 'Exit impersonation' | trans }}
</a>
{% endif %}
</div>
</div>

@ -1,180 +0,0 @@
<?php
/**
* DependencyResolver.php
* publisher
* Date: 18.04.14
*/
namespace Chamilo\ThemeBundle\Util;
/**
* Class DependencyResolver
*
* @package Chamilo\ThemeBundle\Util
*/
class DependencyResolver implements DependencyResolverInterface
{
/**
* @var array
*/
protected $queued = array();
/**
* @var array
*/
protected $registered = array();
/**
* @var array
*/
protected $resolved = array();
/**
* @var array
*/
protected $unresolved = array();
/**
* @param $items
*
* @return $this
*/
public function register($items)
{
$this->registered = $items;
return $this;
}
/**
* @return array
*/
public function resolveAll()
{
$this->failOnCircularDependencies();
$this->resolve(array_keys($this->registered));
return $this->queued;
}
/**
* @param $ids
*/
protected function resolve($ids)
{
foreach ($ids as $id) {
if (isset($this->resolved[$id])) {
continue;
} // already done
if (!isset($this->registered[$id])) {
continue;
} // unregistered
if (!$this->hasDependencies($id)) { // standalone
$this->queued[] = $this->registered[$id];
$this->resolved[$id] = true;
continue;
}
$deps = $this->unresolved($this->getDependencies($id));
$this->resolve($deps);
$deps = $this->unresolved($this->getDependencies($id));
if (empty($deps)) {
$this->queued[] = $this->registered[$id];
$this->resolved[$id] = true;
continue;
}
}
}
/**
* @param $deps
*
* @return array
*/
protected function unresolved($deps)
{
return array_diff($deps, array_keys($this->resolved));
}
/**
* @param $id
*
* @return bool
*/
protected function hasDependencies($id)
{
if (!isset($this->registered[$id])) {
return false;
}
return (!empty($this->registered[$id]['deps']));
}
/**
* @param $id
*
* @return null
*/
protected function getDependencies($id)
{
if (!$this->hasDependencies($id)) {
return null;
}
return $this->registered[$id]['deps'];
}
/**
* @param $needle
* @param $haystackId
*
* @return bool
*/
protected function contains($needle, $haystackId)
{
$deps = $this->getDependencies($haystackId);
if (!is_array($deps)) {
return false;
}
return in_array($needle, $deps);
}
/**
* @throws \RuntimeException
*/
protected function failOnCircularDependencies()
{
$ids = array_keys($this->registered);
foreach ($ids as $id) {
if (!$this->hasDependencies($id)) {
continue;
}
$dependencies = $this->getDependencies($id);
foreach ($dependencies as $dep) {
if ($this->contains($id, $dep)) {
throw new \RuntimeException(
sprintf(
'Circular dependency [%s] depends on [%s] which itself depends on [%s]',
$id, $dep, $id
)
);
}
}
}
}
}
Loading…
Cancel
Save