diff --git a/app/AppKernel.php b/app/AppKernel.php index 3d13baab21..0420d72cd7 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -146,6 +146,7 @@ class AppKernel extends Kernel new APY\DataGridBundle\APYDataGridBundle(), new JMS\TranslationBundle\JMSTranslationBundle(), + new Liip\ThemeBundle\LiipThemeBundle(), //new FOS\RestBundle\FOSRestBundle(), //new JMS\SerializerBundle\JMSSerializerBundle($this), diff --git a/app/Resources/themes/phone/layout.html.twig b/app/Resources/themes/phone/layout.html.twig new file mode 100644 index 0000000000..723e57630c --- /dev/null +++ b/app/Resources/themes/phone/layout.html.twig @@ -0,0 +1,4 @@ +{% extends "ChamiloCoreBundle::layout.html.twig" %} +{% block title %} + {{- chamilo_settings_get('platform.site_name') -}} - Phone theme +{% endblock %} diff --git a/app/Resources/themes/web/layout.html.twig b/app/Resources/themes/web/layout.html.twig new file mode 100644 index 0000000000..7c043e12b9 --- /dev/null +++ b/app/Resources/themes/web/layout.html.twig @@ -0,0 +1,4 @@ +{% extends "ChamiloCoreBundle::layout.html.twig" %} +{% block title %} + {{- chamilo_settings_get('platform.site_name') -}} - Web theme +{% endblock %} diff --git a/app/Resources/views/Common/topbar.html.twig b/app/Resources/views/Common/topbar.html.twig deleted file mode 100644 index 39c45bbab1..0000000000 --- a/app/Resources/views/Common/topbar.html.twig +++ /dev/null @@ -1,27 +0,0 @@ -{% block topbar %} - -{% endblock %} diff --git a/app/Resources/views/Layouts/12.html.twig b/app/Resources/views/Layouts/12.html.twig deleted file mode 100644 index af3e503361..0000000000 --- a/app/Resources/views/Layouts/12.html.twig +++ /dev/null @@ -1,12 +0,0 @@ -{% include '::Common/topbar.html.twig' %} -
-
-
-
-
-
- {% block content %} - {% endblock %} -
-
-
diff --git a/app/Resources/views/Layouts/3-9.html.twig b/app/Resources/views/Layouts/3-9.html.twig deleted file mode 100644 index 8992d34f43..0000000000 --- a/app/Resources/views/Layouts/3-9.html.twig +++ /dev/null @@ -1,387 +0,0 @@ -{% block header %} -
- {% block logo %} - - {% endblock %} - - {% block nav %} - - {% endblock %} -
-{% endblock %} - {% block sonata_wrapper %} -
- {% block sonata_left_side %} - - {% endblock sonata_left_side %} - -
- - - - - {% endblock sonata_page_content %} - - - - {% endblock sonata_wrapper %} - diff --git a/app/Resources/views/layout.html.twig b/app/Resources/views/layout.html.twig index e6c07457ac..aa0750de60 100644 --- a/app/Resources/views/layout.html.twig +++ b/app/Resources/views/layout.html.twig @@ -1,64 +1 @@ -{% extends "AvanzuAdminThemeBundle:layout:base-layout.html.twig" %} - -{% block title %} - {#{{ parent() }}#} - {#{{ 'site_name' | get_setting -}}#} - {{ chamilo_settings_get('platform.site_name') }} -{% endblock %} - -{% block avanzu_logo %} - {#{{- 'institution' | get_setting -}}#} - {{- chamilo_settings_get('platform.institution') -}} -{% endblock %} - -{% block page_title %} - {% if page is defined %} - {{ page.name }} - {% else %} - {{ parent() }} - {% endif %} -{% endblock %} - -{% block avanzu_sidebar %} - {{- parent() -}} - {% if is_granted('IS_AUTHENTICATED_FULLY') %} - {{ mopa_bootstrap_menu('ChamiloCoreBundle:SimpleMenuBuilder:mainMenu', {'automenu': 'pills', 'stacked':true}) }} - {% endif %} - {% if is_granted('IS_AUTHENTICATED_FULLY') == false %} - -
-
- - - {{ mopa_bootstrap_menu('ChamiloCoreBundle:SimpleMenuBuilder:loginMenu', {'automenu': 'pills', 'stacked':true}) }} - {% endif %} - - {#{{ mopa_bootstrap_menu('ChamiloCoreBundle:SimpleMenuBuilder:helpMenu', {'automenu': 'pills', 'stacked':true}) }}#} - -{% endblock %} - -{% block javascripts_head %} - {% javascripts '@admin_lte_all' %} - - {% endjavascripts %} - - {{ parent() }} - - {% javascripts 'bundles/chamilocore/js/app.js'%} - - {% endjavascripts %} -{% endblock %} - -{% block javascripts %} -{% endblock %} +{% extends "ChamiloCoreBundle::layout.html.twig" %} diff --git a/app/config/config.yml b/app/config/config.yml index 845d5605a8..9fbc0cbb09 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -272,3 +272,7 @@ sp_bower: # Grid default template apy_data_grid: theme: ChamiloCoreBundle::grid.html.twig + +liip_theme: + themes: ['web', 'tablet', 'phone'] + active_theme: 'phone' diff --git a/app/config/sonata/sonata_page.yml b/app/config/sonata/sonata_page.yml index 5361af672f..2e9c5672ca 100644 --- a/app/config/sonata/sonata_page.yml +++ b/app/config/sonata/sonata_page.yml @@ -61,7 +61,7 @@ sonata_page: templates: default: #path: 'ApplicationSonataPageBundle::demo_layout.html.twig' - path: 'ChamiloCoreBundle::main_layout.html.twig' + path: '::layout.html.twig' name: 'default' containers: header: @@ -91,7 +91,7 @@ sonata_page: 2columns: #path: 'ApplicationSonataPageBundle::default_2columns_layout.html.twig' - path: 'ChamiloCoreBundle::main_layout.html.twig' + path: '::layout.html.twig' name: '2 columns layout' containers: header: diff --git a/composer.json b/composer.json index 551b2e06b1..9c12426a9d 100755 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "symfony/monolog-bundle": "~2.3", "sensio/distribution-bundle": "~2.3", - "sensio/framework-extra-bundle": "~2.3", + "sensio/framework-extra-bundle": "~3.0", "sensio/generator-bundle": "~2.3", "jms/security-extra-bundle": "~1.5", @@ -141,7 +141,7 @@ "jbroadway/urlify": "1.0.0-stable", "composer/composer": "1.0.0-alpha8", - "liip/theme-bundle": "1.1.0", + "liip/theme-bundle": "dev-master", "chamilo/chash" : "dev-master", "white-october/pagerfanta-bundle": "dev-master", "sylius/resource-bundle": "dev-master", diff --git a/main/inc/lib/formvalidator/Element/tbl_change.js.php b/main/inc/lib/formvalidator/Element/tbl_change.js.php index 2aa79307ef..7cbdda5330 100755 --- a/main/inc/lib/formvalidator/Element/tbl_change.js.php +++ b/main/inc/lib/formvalidator/Element/tbl_change.js.php @@ -1,7 +1,6 @@ var day; var month; @@ -28,13 +27,13 @@ function openCalendar(form, field) { if (regex.test(forminputs[i].getAttribute('name'))) { datevalues[dateindex++] = forminputs[i].value; } - } + } window.open("formvalidator/Element/calendar_popup.php", "calendar", "width=260,height=230,status=no"); day = datevalues[0]; month = datevalues[1]; year = datevalues[2]; - - + + month--; formName = form; fieldName =field; @@ -165,7 +164,7 @@ function initCalendar() { * @param string date text */ function returnDate(d,m,y) { - + formblock= window.opener.document.getElementById(window.opener.formName); forminputs = formblock.getElementsByTagName('select'); var datevalues = new Array(); @@ -173,25 +172,25 @@ function returnDate(d,m,y) { for (i = 0; i < forminputs.length; i++) { // regex here to check name attribute var regex = new RegExp(window.opener.fieldName, "i"); - if (regex.test(forminputs[i].getAttribute('name'))) { + if (regex.test(forminputs[i].getAttribute('name'))) { datevalues[dateindex] = forminputs[i]; dateindex++; window.close(); } } - datevalues[0].selectedIndex = (d-1) ; + datevalues[0].selectedIndex = (d-1) ; datevalues[1].selectedIndex = m; - + date = new Date(); - + //Selecting the first option of the year - year = datevalues[2].options[0].value; - + year = datevalues[2].options[0].value; + datevalues[2].selectedIndex = y - year; for(i = 0; i<= 3; i++) { attributes = datevalues[i].attributes; for (attr=0; attr - {% endfor %} - {% endblock %} - {% endblock %} - {{ sonata_seo_title() }} - {{ sonata_seo_metadatas() }} +{% block avanzu_logo %} +{{- chamilo_settings_get('platform.institution') -}} +{% endblock %} + +{% block page_title %} + {% if page is defined %} + {{ page.name }} + {% else %} + {{ parent() }} + {% endif %} +{% endblock %} + +{% block avanzu_sidebar %} + {{- parent() -}} + {% if is_granted('IS_AUTHENTICATED_FULLY') %} + {{ mopa_bootstrap_menu('ChamiloCoreBundle:SimpleMenuBuilder:mainMenu', {'automenu': 'pills', 'stacked':true}) }} + {% endif %} + {% if is_granted('IS_AUTHENTICATED_FULLY') == false %} + +
+
+ + + {{ mopa_bootstrap_menu('ChamiloCoreBundle:SimpleMenuBuilder:loginMenu', {'automenu': 'pills', 'stacked':true}) }} + {% endif %} + {#{{ mopa_bootstrap_menu('ChamiloCoreBundle:SimpleMenuBuilder:helpMenu', {'automenu': 'pills', 'stacked':true}) }}#} {% endblock %} {% block stylesheets %} {{ parent() }} + + + + {% block sonata_page_stylesheets %} {% block page_stylesheets %} {# Deprecated block #} {% for stylesheet in sonata_page.assets.stylesheets %} @@ -25,6 +58,39 @@ {% endblock %} {% endblock %} +{% block javascripts %} +{% endblock %} + +{% block javascripts_head %} + + {% javascripts '@admin_lte_all' %} + + {% endjavascripts %} + + {% javascripts 'bundles/avanzuadmintheme/vendor/modernizr/modernizr.js'%} + + {% endjavascripts %} + + + + + + + {% javascripts 'bundles/chamilocore/js/app.js'%} + + {% endjavascripts %} + + {% block sonata_page_javascripts %} + {% block page_javascripts %} {# Deprecated block #} + {% for js in sonata_page.assets.javascripts %} + + {% endfor %} + {% endblock %} + {% endblock %} + {{ sonata_seo_title() }} + {{ sonata_seo_metadatas() }} +{% endblock %} + {% block page_breadcrumb %} {% block sonata_page_breadcrumb %} {% if sonata_seo_context is not defined %} diff --git a/src/Chamilo/CourseBundle/Resources/views/Home/index.html.twig b/src/Chamilo/CourseBundle/Resources/views/Home/index.html.twig index f393865233..9c4ec9bbad 100644 --- a/src/Chamilo/CourseBundle/Resources/views/Home/index.html.twig +++ b/src/Chamilo/CourseBundle/Resources/views/Home/index.html.twig @@ -1,4 +1,4 @@ -{% extends "ChamiloCoreBundle::main_layout.html.twig" %} +{% extends "ChamiloCoreBundle::layout.html.twig" %} {% block page_content %} diff --git a/web/bundles/chamilolmscore/css/themes/tasty_olive/screen.css b/web/bundles/chamilolmscore/css/themes/tasty_olive/screen.css deleted file mode 100644 index e69de29bb2..0000000000