Fix redirection faq/ to faq, adding "de" iso, fix installation, fix category UI

ofaj
Julio 9 years ago
parent 9f47400ed8
commit 637f01cd14
  1. 2
      app/config/parameters.yml.dist
  2. 2
      main/admin/index.php
  3. 12
      main/inc/lib/database.lib.php
  4. 32
      src/Chamilo/CoreBundle/Controller/RedirectingController.php
  5. 2
      src/Chamilo/CoreBundle/EventListener/UserLocaleListener.php
  6. 12
      src/Chamilo/CoreBundle/Resources/config/routing.yml
  7. 57
      src/Chamilo/FaqBundle/Resources/views/Faq/index.html.twig

@ -32,4 +32,4 @@ parameters:
# sonata_media.cdn.host: /chamilo_master/web/uploads/media
sonata_page.varnish.command: 'if [ ! -r "/etc/varnish/secret" ]; then echo "VALID ERROR :/"; else varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 {{ COMMAND }} "{{ EXPRESSION }}"; fi;'
locales: [en, fr, es]
locales: [en, fr, es, de]

@ -239,7 +239,7 @@ if (api_is_platform_admin()) {
if (api_get_configuration_value('chamilo_cms')) {
$items[] = array(
'url' => api_get_path(WEB_PATH) . 'web/app_dev.php/login',
'url' => api_get_path(WEB_PATH) . 'web/app_dev.php/administration/dashboard',
'label' => get_lang('CMS')
);
}

@ -647,15 +647,15 @@ class Database
$path = !empty($path) ? $path : api_get_path(SYS_PATH);
$paths = array(
$path.'src/Chamilo/ClassificationBundle/Entity',
$path.'src/Chamilo/MediaBundle/Entity',
$path.'src/Chamilo/PageBundle/Entity',
//$path.'src/Chamilo/ClassificationBundle/Entity',
//$path.'src/Chamilo/MediaBundle/Entity',
//$path.'src/Chamilo/PageBundle/Entity',
$path.'src/Chamilo/CoreBundle/Entity',
$path.'src/Chamilo/UserBundle/Entity',
$path.'src/Chamilo/CourseBundle/Entity',
$path.'vendor/sonata-project/user-bundle/Entity',
$path.'vendor/sonata-project/user-bundle/Model',
$path.'vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Entity',
//$path.'vendor/sonata-project/user-bundle/Entity',
//$path.'vendor/sonata-project/user-bundle/Model',
//$path.'vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Entity',
);
$proxyDir = $path.'app/cache/';

@ -0,0 +1,32 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
/**
* Class RedirectingController
* Redirects /url/ to /url
* @package Chamilo\CoreBundle\Controller
*/
class RedirectingController extends Controller
{
/**
* @param Request $request
* @return \Symfony\Component\HttpFoundation\RedirectResponse|void
*/
public function removeTrailingSlashAction(Request $request)
{
$pathInfo = $request->getPathInfo();
if ($pathInfo == '/_trans/') {
return;
}
$requestUri = $request->getRequestUri();
$url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
return $this->redirect($url, 301);
}
}

@ -44,7 +44,7 @@ class UserLocaleListener
*/
public function onInteractiveLogin(InteractiveLoginEvent $event)
{
$languages = ['english' => 'en', 'spanish' => 'es', 'french' => 'fr'];
$languages = ['german' => 'de', 'english' => 'en', 'spanish' => 'es', 'french' => 'fr'];
/** @var User $user */
$token = $event->getAuthenticationToken();

@ -91,12 +91,12 @@ web.img:
# _controller: chamilo_course.controller.tool:indexAction
# Redirects /url/ to /url
#remove_trailing_slash:
# path: /{url}
# defaults: { _controller: ChamiloCoreBundle:Redirecting:removeTrailingSlash }
# requirements:
# url: .*/$
# _method: GET
remove_trailing_slash:
path: /{url}
defaults: { _controller: ChamiloCoreBundle:Redirecting:removeTrailingSlash }
requirements:
url: .*/$
_method: GET
## Course settings

@ -2,49 +2,30 @@
{% block sonata_page_container %}
<h1>FAQ</h1>
<h2>Categories</h2>
<ul>
{% for category in categories %}
{% if selectedCategory.getSlug is defined and selectedCategory.getSlug == category.getSlug %}
<li class="active">
<strong>{{ category.getHeadline|e }}</strong>
</li>
{% else %}
{% for category in categories %}
<li class="active">
<h2>{{ category.getHeadline|e }}</h2>
</li>
<ul>
{% set list = [false] %}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
{% set list = [false, true] %}
{% endif %}
{% for question in category.questions if question.onlyAuthUsers in list %}
{% if question.isActive %}
<li>
<a href="{{ path('faq', { 'categorySlug': category.getSlug }) }}">
{{ category.getHeadline|e }}
</a>
<h3>
{{ question.getHeadline|e }}
</h3>
<p>{{ question.getBody }}</p>
</li>
{% endif %}
{% endfor %}
</ul>
{% if selectedCategory is not null %}
<h2>Questions</h2>
<ul>
{% set list = [false] %}
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
{% set list = [false, true] %}
{% endif %}
{% for question in questions if question.onlyAuthUsers in list %}
{% if question.isActive %}
{% if selectedQuestion.getSlug is defined and selectedQuestion.getSlug == question.getSlug %}
<li class="active">
<strong>{{ question.getHeadline|e }}</strong>
<div>{{ selectedQuestion.getBody }}</div>
</li>
{% else %}
<li>
<a href="{{ path('faq', { 'categorySlug': selectedCategory.getSlug, 'questionSlug': question.getSlug }) }}">
{{ question.getHeadline|e }}
</a>
</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
{% endblock %}
Loading…
Cancel
Save