Adding faq chamilo look and feel

ofaj
jmontoyaa 10 years ago
parent 136793be5c
commit 2d2785100b
  1. 20
      app/SymfonyRequirements.php
  2. 7
      app/bootstrap.php.cache
  3. 4
      app/config/routing.yml
  4. 16
      app/console
  5. 198
      src/Chamilo/CoreBundle/Menu/NavBuilder.php
  6. 64
      src/Chamilo/CoreBundle/Resources/views/default/layout/footer.html.twig
  7. 4
      src/Chamilo/CoreBundle/Resources/views/layout_cms.html.twig
  8. 5
      src/Chamilo/FaqBundle/Resources/views/Faq/index.html.twig
  9. 65
      src/Chamilo/PageBundle/Resources/views/demo_layout.html.twig
  10. 40
      src/Chamilo/ThemeBundle/Resources/views/Layout/base-layout.html.twig

@ -425,11 +425,13 @@ class SymfonyRequirements extends RequirementCollection
'Change the permissions of either "<strong>app/logs/</strong>" or "<strong>var/logs/</strong>" directory so that the web server can write into it.'
);
$this->addPhpIniRequirement(
'date.timezone', true, false,
'date.timezone setting must be set',
'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
);
if (version_compare($installedPhpVersion, '7.0.0', '<')) {
$this->addPhpIniRequirement(
'date.timezone', true, false,
'date.timezone setting must be set',
'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
);
}
if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) {
$timezones = array();
@ -677,6 +679,14 @@ class SymfonyRequirements extends RequirementCollection
'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
);
if (class_exists('Symfony\Component\Intl\Intl')) {
$this->addRecommendation(
\Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(),
sprintf('intl ICU version installed on your system (%s) should match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
'In most cases you should be fine, but please verify there is no inconsistencies between data provided by Symfony and the intl extension. See https://github.com/symfony/symfony/issues/15007 for an example of inconsistencies you might run into.'
);
}
$this->addPhpIniRecommendation(
'intl.error_level',
create_function('$cfgValue', 'return (int) $cfgValue === 0;'),

@ -1,10 +1,5 @@
<?php
namespace {
error_reporting(error_reporting() & ~E_USER_DEPRECATED);
$loader = require_once __DIR__.'/./autoload.php';
}
namespace Symfony\Component\HttpFoundation
{
@ -3332,5 +3327,3 @@ return $response;
}
}
}
namespace { return $loader; }

@ -1,6 +1,6 @@
#home:
# path: /
home:
path: /
#index:
# path: /

@ -1,22 +1,26 @@
#!/usr/bin/env php
<?php
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
set_time_limit(0);
require_once __DIR__.'/bootstrap.php.cache';
/**
* @var Composer\Autoload\ClassLoader $loader
*/
$loader = require __DIR__.'/autoload.php';
require_once __DIR__.'/AppKernel.php';
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
$input = new ArgvInput();
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
if ($debug) {
Debug::enable();

@ -0,0 +1,198 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Menu;
use Chamilo\UserBundle\Entity\User;
use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\Routing\RouterInterface;
/**
* Class NavBuilder
* @package Chamilo\CoreBundle\Menu
*/
class NavBuilder extends ContainerAware
{
/**
* @param array $itemOptions The options given to the created menuItem
* @param string $currentUri The current URI
*
* @return \Knp\Menu\ItemInterface
*/
public function createCategoryMenu(array $itemOptions = array(), $currentUri = null)
{
$factory = $this->container->get('knp_menu.factory');
$menu = $factory->createItem('categories', $itemOptions);
$this->buildCategoryMenu($menu, $itemOptions, $currentUri);
return $menu;
}
/**
* @param \Knp\Menu\ItemInterface $menu The item to fill with $routes
* @param array $options The item options
* @param string $currentUri The current URI
*/
public function buildCategoryMenu(ItemInterface $menu, array $options = array(), $currentUri = null)
{
//$categories = $this->categoryManager->getCategoryTree();
//$this->fillMenu($menu, $categories, $options, $currentUri);
$menu->addChild('home', array('route' => 'home'));
}
/**
* Top menu left
* @param FactoryInterface $factory
* @param array $options
* @return \Knp\Menu\ItemInterface
*/
public function leftMenu(FactoryInterface $factory, array $options)
{
$checker = $this->container->get('security.authorization_checker');
$translator = $this->container->get('translator');
$menu = $factory->createItem('root');
$menu->setChildrenAttribute('class', 'nav navbar-nav');
$menu->addChild(
$translator->trans('Home'),
array('route' => 'home')
);
if ($checker->isGranted('IS_AUTHENTICATED_FULLY')) {
$menu->addChild(
$translator->trans('MyCourses'),
array('route' => 'userportal')
);
$menu->addChild(
$translator->trans('Calendar'),
array(
'route' => 'main',
'routeParameters' => array(
'name' => 'calendar/agenda_js.php',
),
)
);
$menu->addChild(
$translator->trans('Reporting'),
array(
'route' => 'main',
'routeParameters' => array(
'name' => 'mySpace/index.php',
),
)
);
$menu->addChild(
$translator->trans('Social'),
array(
'route' => 'main',
'routeParameters' => array(
'name' => 'social/home.php',
),
)
);
$menu->addChild(
$translator->trans('Dashboard'),
array(
'route' => 'main',
'routeParameters' => array(
'name' => 'dashboard/index.php',
),
)
);
if ($checker->isGranted('ROLE_ADMIN')) {
$menu->addChild(
$translator->trans('Administration'),
array(
'route' => 'administration',
)
);
}
}
return $menu;
}
/**
* Top menu right
* @param FactoryInterface $factory
* @param array $options
* @return \Knp\Menu\ItemInterface
*/
public function rightMenu(FactoryInterface $factory, array $options)
{
$checker = $this->container->get('security.authorization_checker');
$translator = $this->container->get('translator');
$menu = $factory->createItem('root');
// <nav class="navbar navbar-default">
if ($checker->isGranted('IS_AUTHENTICATED_FULLY')) {
$token = $this->container->get('security.token_storage');
/** @var User $user */
$user = $token->getToken()->getUser();
$menu->setChildrenAttribute('class', 'nav navbar-nav navbar-right');
$dropdown = $menu->addChild(
$user->getUsername()
)->setAttribute('dropdown', true);
$dropdown->addChild(
$translator->trans('Profile'),
array('route' => 'fos_user_profile_show')
)->setAttribute('divider_append', true);
$dropdown->addChild(
$translator->trans('Inbox'),
array(
'route' => 'main',
'routeParameters' => array(
'name' => 'messages/inbox.php',
),
)
)->setAttribute('divider_append', true);
$logoutLink = $menu->addChild('Logout', array('route' => 'logout'));
$logoutLink
->setLinkAttributes(array(
'id' => 'logout_button',
'class' => 'fa fa-power-off'
))
->setAttributes(array(
/*'id' => 'signin',
'class' => 'dropdown'*/
))
;
}
return $menu;
}
/*public function profileMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$security = $this->container->get('security.context');
if ($security->isGranted('IS_AUTHENTICATED_FULLY')) {
$menu->setChildrenAttribute('class', 'nav nav-pills nav-stacked');
$menu->addChild('Inbox', array('route' => 'logout'));
$menu->addChild('Compose', array('route' => 'logout'));
$menu->addChild('Edit', array('route' => 'logout'));
}
return $menu;
}*/
}

@ -0,0 +1,64 @@
{#<footer {% block footer_open_attributes %}{% endblock footer_open_attributes %}>#}
<footer>
<!-- start of #footer section -->
<div class="container">
<div class="row">
<div id="footer_left" class="col-md-4">
{% if session_teachers is not null %}
<div id="session_teachers">
{{ session_teachers }}
</div>
{% endif %}
{% if teachers is not null %}
<div id="teachers">
{{ teachers }}
</div>
{% endif %}
{# Plugins for footer section #}
{% if plugin_footer_left is not null %}
<div id="plugin_footer_left">
{{ plugin_footer_left }}
</div>
{% endif %}
&nbsp;
</div>
<div id="footer_center" class="col-md-4">
{# Plugins for footer section #}
{% if plugin_footer_center is not null %}
<div id="plugin_footer_center">
{{ plugin_footer_center }}
</div>
{% endif %}
&nbsp;
</div>
<div id="footer_right" class="col-md-4">
<div id="admin_name">
{{ 'Manager' | trans }}
</div>
<div id="software_name">
{{ "Platform"|trans }}
<a href="" target="_blank">
{{ software_name }}
</a>
&copy; {{ "now"|date("Y") }}
</div>
{# Plugins for footer section #}
{% if plugin_footer_right is not null %}
<div id="plugin_footer_right">
{{ plugin_footer_right }}
</div>
{% endif %}
&nbsp;
</div><!-- end of #footer_right -->
</div><!-- end of #row -->
</div><!-- end of #container -->
</footer>
{{ footer_extra_content }}

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

@ -1,3 +1,6 @@
{% extends 'SonataPageBundle::layout.html.twig' %}
{% block page_content %}
<h1>FAQ</h1>
<h2>Categories</h2>
@ -32,3 +35,5 @@
{% endfor %}
</ul>
{% endif %}
{% endblock %}

@ -1,12 +1,11 @@
{% extends 'SonataPageBundle::layout.html.twig' %}
{#{% extends '@ChamiloCore/layout_one_col.html.twig' %}#}
{% extends '@ChamiloCore/layout_cms.html.twig' %}
{% block sonata_page_body_tag %}
{{ parent() }}
{% include "SonataSeoBundle:Block:_facebook_sdk.html.twig" %}
{% include "SonataSeoBundle:Block:_twitter_sdk.html.twig" %}
{% include "SonataSeoBundle:Block:_pinterest_sdk.html.twig" %}
{#{% include "SonataSeoBundle:Block:_facebook_sdk.html.twig" %}#}
{#{% include "SonataSeoBundle:Block:_twitter_sdk.html.twig" %}#}
{#{% include "SonataSeoBundle:Block:_pinterest_sdk.html.twig" %}#}
{% endblock %}
@ -20,8 +19,58 @@
{% endblock %}
{% block sonata_page_container %}
{{ parent() }}
{% endblock %}
<div class="container">
<div class="content">
<div class="row page-header">
{{ sonata_page_render_container('header', 'global') }}
</div>
{% block sonata_page_breadcrumb %}
<div class="row">
{% if sonata_seo_context is not defined %}
{% set sonata_seo_context = 'homepage' %}
{% endif %}
{{ sonata_block_render_event('breadcrumb', { 'context': sonata_seo_context, 'current_uri': app.request.requestUri }) }}
</div>
{% endblock %}
{% if page is defined %}
<div class="row">
{% if page.name != 'global'%}
{{ sonata_page_render_container('content_top', 'global') }}
{% endif %}
{{ sonata_page_render_container('content_top', page) }}
</div>
{% endif %}
<div class="row">
{% block page_content %}
{% if content is defined %}
{{ content|raw }}
{% else %}
{% set content = block('content') %}
{% if content|length > 0 %}
{{ content|raw }}
{% elseif page is defined %}
{{ sonata_page_render_container('content', page) }}
{% endif %}
{% endif %}
{% endblock %}
</div>
{% if page is defined %}
<div class="row">
{{ sonata_page_render_container('content_bottom', page) }}
{% if page.name != 'global'%}
{{ sonata_page_render_container('content_bottom', 'global') }}
{% endif %}
</div>
{% endif %}
</div>
{% block sonata_page_breadcrumb %}
{#<footer class="row">#}
{#{{ sonata_page_render_container('footer', 'global') }}#}
{#</footer>#}
</div>
{% endblock %}

@ -62,15 +62,17 @@
{% set profile_link = '' %}
{% set message_link = '' %}
<link rel="stylesheet" href="{{ asset('bundles/chamilocore/css/base.css') }}"/>
<link rel="stylesheet" href="{{ asset('bundles/chamilocore/css/scorm.css') }}"/>
<link rel="stylesheet" href="{{ asset('bundles/chamilocore/css/themes/'~ theme ~'/learnpath.css') }}"/>
<link rel="stylesheet" href="{{ asset('bundles/chamilocore/css/themes/'~ theme ~'/default.css') }}"/>
<link rel="stylesheet" href="{{ asset('assets/bootstrap/dist/css/bootstrap.css') }}"/>
<link rel="stylesheet" media="print" href="{{ asset('bundles/chamilocore/css/print.css') }}"/>
<link rel="stylesheet" media="print" href="{{ asset('bundles/chamilocore/css/themes/'~ theme ~'/print.css') }}"/>
<link rel="stylesheet" href="{{ asset('css/base.css') }}"/>
<link rel="stylesheet" href="{{ asset('css/scorm.css') }}"/>
<link rel="stylesheet" href="{{ asset('css/themes/'~ theme ~'/learnpath.css') }}"/>
<link rel="stylesheet" href="{{ asset('css/themes/'~ theme ~'/default.css') }}"/>
<script src="{{ asset('bundles/chamilocore/components/modernizr/modernizr.js') }}"></script>
<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>
{# Check chamilo_js key in assetic.yml #}
{% block javascripts %}
@ -78,6 +80,9 @@
{#<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('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>
@ -86,10 +91,11 @@
{% include '@ChamiloTheme/Layout/header.js.twig' %}
{% endblock %}
{#'@MopaBootstrapBundle/Resources/public/js/eyecon-bootstrap-datepicker.js'#}
{% javascripts
'@MopaBootstrapBundle/Resources/public/js/mopabootstrap-collection.js'
'@MopaBootstrapBundle/Resources/public/js/mopabootstrap-subnav.js'
'@MopaBootstrapBundle/Resources/public/js/eyecon-bootstrap-datepicker.js'
'bundles/mopabootstrap/js/mopabootstrap-collection.js'
'bundles/mopabootstrap/js/mopabootstrap-subnav.js'
%}
<script type="text/javascript" src="{{ asset_url | replace({'/app_dev.php': ''}) }}"></script>
{% endjavascripts %}
@ -135,7 +141,7 @@
<div class="col-lg-3">
<div class="logo">
{#<a href="{{ url('index') }}">#}
<img src="{{ asset('bundles/chamilocore/css/themes/'~ theme ~'/images/header-logo.png') }}"/>
<img src="{{ asset('css/themes/'~ theme ~'/images/header-logo.png') }}"/>
{#</a>#}
</div>
</div>
@ -178,7 +184,7 @@
<div class="container">
{{ mopa_bootstrap_menu('ChamiloCoreBundle:NavBuilder:leftMenu', {'automenu': 'navbar', 'stacked':true}) }}
<div style="float:right">
{{ mopa_bootstrap_menu('ChamiloCoreBundle:NavBuilder:rightMenu', {'automenu': 'navbar'} ) }}
{#{{ mopa_bootstrap_menu('ChamiloCoreBundle:NavBuilder:rightMenu', {'automenu': 'navbar'} ) }}#}
</div>
</div>
@ -199,7 +205,7 @@
<div id="top_main_content" class="container">
{# course navigation links/shortcuts need to be activated by the admin #}
{% include "@template_style/layout/course_navigation.html.twig" %}
{#{% include "@template_style/layout/course_navigation.html.twig" %}#}
{#{% endif %}#}
{% block chamilo_header %}
@ -221,8 +227,10 @@
{#{% include 'SonataSeoBundle:Block:_facebook_sdk.html.twig' %}#}
{#{% include 'SonataSeoBundle:Block:_twitter_sdk.html.twig' %}#}
{#{% include 'SonataSeoBundle:Block:_pinterest_sdk.html.twig' %}#}
{% block page_content %}
{% endblock %}
{% endblock %}
{% block sonata_page_container %}
{% endblock %}
{#<!-- Right side column. Contains the navbar and content of the page -->#}
@ -257,7 +265,7 @@
{# End wrapper div #}
{% block chamilo_footer %}
{% include "@template_style/layout/footer.html.twig" %}
{% include "@ChamiloCore/default/layout/footer.html.twig" %}
{% endblock %}
{% block chamilo_footer_js %}

Loading…
Cancel
Save