Fixing forms UI .

1.10.x
Julio Montoya 11 years ago
parent 723b2403a1
commit f27a4b8212
  1. 66
      app/config/assetic.yml
  2. 4
      app/config/mopa/mopa_bootstrap.yml
  3. 6
      main/admin/user_add.php
  4. 32
      main/inc/lib/formvalidator/FormValidator.class.php
  5. 1
      main/session/session_add.php
  6. 4
      src/Application/Sonata/NewsBundle/Resources/views/Post/comment_form.html.twig
  7. 16
      src/Chamilo/AdminThemeBundle/DependencyInjection/ChamiloAdminThemeExtension.php
  8. 8
      src/Chamilo/AdminThemeBundle/Resources/views/Navbar/user.html.twig
  9. 10
      src/Chamilo/AdminThemeBundle/Resources/views/Sidebar/search-form.html.twig
  10. 1
      src/Chamilo/AdminThemeBundle/Resources/views/Sidebar/user-panel.html.twig
  11. 21
      src/Chamilo/AdminThemeBundle/Resources/views/layout/base-layout.html.twig
  12. 9
      src/Chamilo/AdminThemeBundle/Resources/views/layout/form-theme.html.twig
  13. 2
      src/Chamilo/AdminThemeBundle/Theme/ThemeManager.php
  14. 14
      src/Chamilo/AdminThemeBundle/Twig/WidgetExtension.php
  15. 1
      src/Chamilo/CoreBundle/EventListener/LegacyListener.php
  16. 11
      src/Chamilo/CoreBundle/EventListener/LoginSuccessHandler.php
  17. 5
      src/Chamilo/CoreBundle/Form/CourseType.php
  18. 16
      src/Chamilo/CoreBundle/Naming/UserImage.php
  19. 23
      src/Chamilo/CoreBundle/Resources/config/services.yml
  20. 8
      src/Chamilo/CoreBundle/Resources/public/js/app.js
  21. 16
      src/Chamilo/CoreBundle/Resources/public/js/jquery.frameready.js
  22. 15
      src/Chamilo/CoreBundle/Resources/views/Legacy/form.html.twig
  23. 500
      src/Chamilo/CoreBundle/Resources/views/default/form/form_custom_template.tpl
  24. 1
      src/Chamilo/CoreBundle/Resources/views/layout.html.twig
  25. 5
      src/Chamilo/CourseBundle/Resources/views/Settings/default.html.twig

@ -33,7 +33,13 @@ assetic:
- @chamilo_bootstrap
- @chamilo_font_awesome
- @chamilo_ionicons
- @ChamiloAdminThemeBundle/Resources/public/components/fullcalendar/dist/fullcalendar.min.css
- @ChamiloAdminThemeBundle/Resources/public/components/chosen-bower/chosen.css
- @ChamiloAdminThemeBundle/Resources/public/components/jquery-ui/themes/cupertino/jquery-ui.min.css
- @ChamiloAdminThemeBundle/Resources/public/components/bootflat/css/bootflat.css
- @ChamiloAdminThemeBundle/Resources/public/components/jqgrid/css/ui.jqgrid.css
- @ChamiloAdminThemeBundle/Resources/public/components/select2/select2.css
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/jvectormap/*
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/morris/*
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.css
@ -41,14 +47,9 @@ assetic:
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/colorpicker/bootstrap-colorpicker.css
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/datatables/dataTables.bootstrap.css
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/daterangepicker/daterangepicker-bs3.css
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/fullcalendar/*
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/iCheck/all.css
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/ionslider/ion.rangeSlider.css
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/jQueryUI/jquery-ui-1.10.3.custom.css
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/timepicker/bootstrap-timepicker.css
- @ChamiloAdminThemeBundle/Resources/public/components/bootflat/css/bootflat.css
- @ChamiloAdminThemeBundle/Resources/public/components/jqgrid/css/ui.jqgrid.css
- @select2_css
- @ChamiloAdminThemeBundle/Resources/public/components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/css/AdminLTE.css
@ -56,21 +57,22 @@ assetic:
inputs:
- @ChamiloAdminThemeBundle/Resources/public/components/jquery/dist/jquery.js
- @bootstrap_js
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/jquery-ui-1.10.3.js
- @ChamiloAdminThemeBundle/Resources/public/components/jquery-ui/jquery-ui.min.js
- @ChamiloAdminThemeBundle/Resources/public/components/chosen-bower/chosen.jquery.js
- @moment_js
- @ChamiloAdminThemeBundle/Resources/public/components/fullcalendar/dist/fullcalendar.min.js
- @ChamiloAdminThemeBundle/Resources/public/components/jqgrid/js/jquery.jqGrid.js
- @ChamiloAdminThemeBundle/Resources/public/components/select2/select2.js
- @ChamiloAdminThemeBundle/Resources/public/components/ckeditor/ckeditor.js
- @ChamiloAdminThemeBundle/Resources/public/components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js
- @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/daterangepicker/daterangepicker.js
- @ChamiloCoreBundle/Resources/public/js/app.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/bootstrap-slider/bootstrap-slider.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/colorpicker/bootstrap-colorpicker.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/datatables/jquery.dataTables.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/datatables/dataTables.bootstrap.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/daterangepicker/daterangepicker.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/fullcalendar/fullcalendar.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/ionslider/ion.rangeSlider.min.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/slimScroll/jquery.slimscroll.js
# - @ChamiloAdminThemeBundle/Resources/public/components/adminlte/js/plugins/sparkline/jquery.sparkline.js
@ -92,32 +94,32 @@ assetic:
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.selectable.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.sortable.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.accordion.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.autocomplete.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.button.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.datepicker.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.dialog.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-blind.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-bounce.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-clip.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-drop.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-explode.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-fade.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-fold.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-highlight.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-pulsate.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-scale.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-shake.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-slide.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-transfer.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.menu.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.accordion.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.autocomplete.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.button.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.datepicker.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.dialog.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-blind.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-bounce.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-clip.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-drop.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-explode.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-fade.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-fold.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-highlight.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-pulsate.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-scale.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-shake.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-slide.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-transfer.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.menu.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.position.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.progressbar.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.slider.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.spinner.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.tabs.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.progressbar.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.slider.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.spinner.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.tabs.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.tooltip.js
# - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/i18n/jquery-ui-i18n.js
- %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/i18n/jquery-ui-i18n.js
filters:
- yui_js

@ -1,6 +1,2 @@
mopa_bootstrap:
form: # Adds twig form theme support
show_legend: false
render_optional_text: false
render_required_asterisk: true
menu: ~ # enables twig helpers for menu

@ -239,7 +239,7 @@ $html_results_enabled[] = $form-> createElement ('style_submit_button', 'submit'
$form->addGroup($html_results_enabled);
// Validate form
if( $form->validate()) {
if ($form->validate()) {
$check = Security::check_token('post');
if ($check) {
$user = $form->exportValues();
@ -368,8 +368,6 @@ if (!empty($message)){
}
$content = $form->return_form();
$app['title'] = $tool_name;
//$tpl = $app['template'];
echo $message;
echo $message;
echo $content;

@ -29,7 +29,7 @@ class FormValidator extends HTML_QuickForm
) {
// Default form class
if (is_array($attributes) && !isset($attributes['class']) || empty($attributes)) {
$attributes['class'] = 'form-horizontal';
$attributes['class'] = '';
}
// Fixing form search
@ -135,10 +135,16 @@ EOT;
*/
private function getFormTemplate()
{
return '<form{attributes}>
<fieldset>{content}</fieldset>
{hidden}
</form>';
return '
<div class="box box-primary">
<form{attributes}>
<div class="box-body">
<fieldset>{content}</fieldset>
{hidden}
</div>
</form>
</div>
';
}
/**
@ -148,12 +154,11 @@ EOT;
{
return '
<div class="form-group {error_class}">
<label class="col-sm-2 control-label">
<label class="control-label">
<!-- BEGIN required --><span class="form_required">*</span><!-- END required -->
{label}
</label>
<div class="col-sm-10">
{element}
<!-- BEGIN label_3 -->
@ -161,15 +166,15 @@ EOT;
<!-- END label_3 -->
<!-- BEGIN label_2 -->
<span class="help-block">
{label_2}
</span>
<span class="help-block">
{label_2}
</span>
<!-- END label_2 -->
<!-- BEGIN error -->
<span class=" col-sm-2 help-block">{error}</span>
<span class=" col-sm-2 help-block">{error}</span>
<!-- END error -->
</div>
</div>';
}
@ -502,6 +507,7 @@ EOT;
$return_value = '';
$js = null;
if ($addDateLibraries) {
/*
$js = api_get_js('jquery-ui/jquery-ui-i18n.min.js');
$js .= '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'datetimepicker/jquery-ui-timepicker-addon.js" type="text/javascript"></script>';
$js .= '<link href="'.api_get_path(WEB_LIBRARY_JS_PATH).'datetimepicker/jquery-ui-timepicker-addon.css" rel="stylesheet" type="text/css" />';
@ -518,7 +524,7 @@ EOT;
moment.lang("'.$isocode.'");
});
</script>';
}
}*/
}
if ($error) {

@ -278,7 +278,6 @@ echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_list.php">'.
'</a>';
echo '</div>';
//$form->display();
$em = Container::getEntityManager();
$request = Container::getRequest();

@ -16,11 +16,11 @@
<h3>{{'title_leave_comment'|trans({}, 'SonataNewsBundle') }}</h3>
</div>
<div class="panel-body">
<form action="{{ url('sonata_news_add_comment', {'id': post_id}) }}" method="POST" class="form-horizontal" role="form">
<form action="{{ url('sonata_news_add_comment', {'id': post_id}) }}" method="POST" role="form">
{{ form_widget(form) }}
<div class="form-actions">
<button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-pencil"></i>&nbsp;{{'btn_add_comment'|trans({}, 'SonataNewsBundle') }}</button>
</div>
</form>
</div>
</div>
</div>

@ -40,15 +40,15 @@ class ChamiloAdminThemeExtension extends Extension implements PrependExtensionIn
if (isset($bundles['TwigBundle'])) {
$container->prependExtensionConfig('twig', array(
'form' => array(
'resources' => array(
'ChamiloAdminThemeBundle:layout:form-theme.html.twig'
)
),
'globals' => array(
'admin_theme' => 'chamilo_admin_theme.theme_manager'
'form' => array(
'resources' => array(
'ChamiloAdminThemeBundle:layout:form-theme.html.twig'
)
));
),
'globals' => array(
'admin_theme' => 'chamilo_admin_theme.theme_manager'
)
));
}
return

@ -33,10 +33,14 @@
<!-- 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({}, 'ChamiloAdminTheme')}}</a>
<a href="{{ path('chamilo_core_user_user_profile', {'username' : user.identifier}) }}" class="btn btn-default btn-flat">
{{'Profile'|trans({}, 'ChamiloAdminTheme')}}
</a>
</div>
<div class="pull-right">
<a href="{{ path('logout') }}" class="btn btn-default btn-flat">{{ 'Sign out'|trans({}, 'ChamiloAdminTheme') }}</a>
<a href="{{ path('logout') }}" class="btn btn-default btn-flat">
{{ 'Sign out'|trans({}, 'ChamiloAdminTheme') }}
</a>
</div>
</li>
</ul>

@ -2,10 +2,10 @@
<form action="#" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search..."/>
<span class="input-group-btn">
<button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i
class="fa fa-search"></i></button>
</span>
<span class="input-group-btn">
<button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i
class="fa fa-search"></i></button>
</span>
</div>
</form>
<!-- /.search form -->
<!-- /.search form -->

@ -13,7 +13,6 @@
</div>
<div class="pull-left info">
<p>{{ 'Hello, %user%'|trans({'%user%': user.username }, 'ChamiloAdminTheme') }}</p>
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>

@ -13,7 +13,6 @@
<title>{% block title %}Chamilo{% endblock %}</title>
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
{%- stylesheets '@chamilo_css' -%}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
@ -32,12 +31,13 @@
<link rel="stylesheet" href="{{ asset('bundles/chamilocore/js/tag/style.css') }}"/>
<script src="{{ asset('bundles/chamiloadmintheme/components/modernizr/modernizr.js') }}"></script>
{% block javascripts %}
{%- javascripts '@chamilo_js' -%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
</head>
<body class="{{ admin_skin|default('skin-blue')}}">
{% block chamilo_admin_header %}
<header class="header">
{% block chamilo_logo %}
<a href="#" class="logo">
@ -132,19 +132,6 @@
</div>
<!-- ./wrapper -->
{# JAVASCRIPTS #}
{% block javascripts %}
{%- javascripts '@chamilo_js' -%}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
{# JAVASCRIPTS_INLINE #}
{% block javascripts_inline %}
{% endblock %}
</body>
</html>

@ -138,7 +138,7 @@
{% endblock %}
{% block form_label %}
{% if help is defined %}
&nbsp; <a href="#" data-toggle="tooltip" data-original-title="{{ help }}"><i class="fa fa-question-circle"></i></a>
{% endif %}
@ -162,10 +162,3 @@
{% endspaceless %}
{% endblock form_errors %}
{# % block form_widget_simple %}
{{ parent() }}
{% if help is defined %}
<p class="help-block">{{ help }}</p>
{% endif %}
{% endblock % #}

@ -39,8 +39,6 @@ class ThemeManager
$this->resolverClass = $resolverClass?: 'Chamilo\AdminThemeBundle\Util\DependencyResolver';
}
public function registerScript($id, $src, $deps = array(), $location = "bottom")
{

@ -17,20 +17,18 @@ class WidgetExtension extends \Twig_Extension {
*/
protected $env;
public function renderWidget() {
}
public function getFunctions()
{
return array(
'widget_box' => new \Twig_SimpleFunction('widget_box',
array($this, 'renderWidget'),
array('is_safe' => array('html'))),
'widget_box' => new \Twig_SimpleFunction(
'widget_box',
array($this, 'renderWidget'),
array('is_safe' => array('html'))
),
);
}
@ -42,6 +40,6 @@ class WidgetExtension extends \Twig_Extension {
public function getName()
{
return 'avanzu_widget';
return 'chamilo_widget';
}
}

@ -62,7 +62,6 @@ class LegacyListener
\CourseManager::setCourseSettingsManager($container->get('chamilo_course.settings.manager'));
Container::$mailer = $container->get('mailer');
// Setting legacy properties.
Container::$urlGenerator = $container->get('router');
Container::$security = $container->get('security.context');

@ -40,15 +40,20 @@ class LoginSuccessHandler implements AuthenticationSuccessHandlerInterface
/** @var User $user */
$user = $token->getUser();
$userId = $user->getId();
$session = $request->getSession();
$userInfo = api_get_user_info($user->getId());
$userInfo['is_anonymous'] = false;
// Backward compatibility.
$ip = $request->getClientIp();
// Setting user info.
$request->getSession()->set('_user', $userInfo);
// Setting admin permissions.
// Setting admin permissions for.
if ($this->security->isGranted('ROLE_ADMIN')) {
$request->getSession()->set('is_platformAdmin', true);
}
@ -80,7 +85,7 @@ class LoginSuccessHandler implements AuthenticationSuccessHandlerInterface
}
}
// Redirecting to a course or a session
// Redirecting to a course or a session.
if (api_get_setting('course.go_to_course_after_login') == 'true') {
// Get the courses list

@ -27,11 +27,6 @@ class CourseType extends AbstractType
->add('disk_quota', 'text')
->add('expiration_date', 'sonata_type_datetime_picker')
/* ->add('general_coach', 'entity', array(
'class' => 'ChamiloUserBundle:User',
'property' => 'username',

@ -0,0 +1,16 @@
<?php
namespace Chamilo\CoreBundle\Naming;
use Vich\UploaderBundle\Naming\DirectoryNamerInterface;
use Vich\UploaderBundle\Mapping\PropertyMapping;
class UserImage implements DirectoryNamerInterface
{
/**
* @inheritdoc
*/
public function directoryName($object, PropertyMapping $mapping)
{
}
}

@ -8,6 +8,9 @@ services:
tags:
- { name: twig.extension }
chamilo_core.directory_namer.user_image:
class: Chamilo\CoreBundle\Naming\UserImage
chamilo_core.manager.course:
class: %chamilo_core.manager.course.class%
arguments: [%chamilo_core.manager.course.entity%, @doctrine]
@ -17,23 +20,29 @@ services:
tags:
- { name: form.type, alias: yes_no }
chamilo_core.html_editor:
class: Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor
arguments: [@translator, @router]
# Listeners
# chamilo.doctrine.entity_listener_resolver:
# class: Chamilo\CoreBundle\Doctrine\EntityListenerResolver
# arguments: [ "@service_container" ]
chamilo_core.entity_listener.course:
chamilo_core.listener.online:
class: Chamilo\CoreBundle\EventListener\OnlineListener
arguments: [@security.context, @doctrine.orm.entity_manager ]
tags:
- { name: kernel.event_listener, event: kernel.controller, method: onCoreController }
chamilo_core.listener.course:
class: Chamilo\CoreBundle\Entity\Listener\CourseListener
arguments: [ @chamilo_course.tool_chain ]
tags:
- { name: doctrine.orm.entity_listener }
# - { name: doctrine.event_listener, event: prePersist }
chamilo_core.html_editor:
class: Chamilo\CoreBundle\Component\Editor\CkEditor\CkEditor
arguments: [@translator, @router]
# Listeners
chamilo_core.listener.legacy:
class: Chamilo\CoreBundle\EventListener\LegacyListener
arguments: [@service_container]

@ -1,3 +1,5 @@
jQuery.fn.filterByText = function(textbox) {
return this.each(function() {
var select = this;
@ -107,7 +109,7 @@ function sizeContent() {
$(window).resize(sizeContent);
$(document).ready( function() {
$(function() {
sizeContent();
@ -186,13 +188,13 @@ $(document).ready( function() {
});
// Tooltip.
$(function() {
/*$(function() {
$('a').tooltip({
placement: 'right',
show: 500,
hide: 500
});
});
});*/
$('.minify').click(function(e) {
$('body').toggleClass("minified");

@ -34,7 +34,7 @@
*
* load: (object or array of objects) jquery is loaded by default. You can pass a single object to
* frameReady, or an array of objects that will be loaded and tested in order. 2 types
* of files can be loaded. Scripts and stylesheets:
* of files can be loaded. Scripts and stylesheets:carousel
*
* scripts: {type:"script", src:"/js/myscript.js", id:"_ms", test:"afunction"}
* stylesheets: {type:"stylesheet", src:"/css/mycss.css", id:"_ss"}
@ -200,19 +200,19 @@ jQuery.isFrameReady = function(fn){
var frs = fr["settings"];
if (fr.done) { return false; };
var fx = eval(fr.target);
$d.log(fn, ": New Pass. Checking target");
// make sure we have a target
if (typeof fx !== "undefined") {
$d.log(fn, ": Found target. Checking DOM");
try {
var fd = fx.document;
} catch (ex) { }
// make sure we have a DOM
if (fd && fd.getElementsByTagName && fd.getElementById && fd.body && fd.body.innerHTML.length) {
@ -239,11 +239,11 @@ jQuery.isFrameReady = function(fn){
var ele=fd.createElement('script');
ele.setAttribute('id', id);
ele.setAttribute('src', s.src);
if (fd.getElementsByTagName("body") && fd.getElementsByTagName("body")[0]) {
fd.getElementsByTagName("body")[0].appendChild(ele);
}
frs.loadInit[i] = true;
break;
case "stylesheet" :

@ -1,9 +1,8 @@
<div class="col-md-12">
<div class="box box-primary">
<form action="{{ url }}" method="POST" {{ form_enctype(form) }} class="form-horizontal" role="form">
<div class="box-body">
{{ form_widget(form) }}
</div>
</form>
</div>
<div class="box box-primary">
<form action="{{ url }}" method="POST" {{ form_enctype(form) }} role="form">
<div class="box-body">
{{ form_widget(form) }}
</div>
</form>
</div>

@ -1,500 +0,0 @@
{# Widgets #}
{% block form_widget %}
{% spaceless %}
{% if compound %}
{{ block('form_widget_compound') }}
{% else %}
{{ block('form_widget_simple') }}
{% endif %}
{% endspaceless %}
{% endblock form_widget %}
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') %}
{% if attr.prepend_input is defined and attr.append_input is defined and attr.prepend_input is not empty and attr.append_input is not empty %}
{{ block('form_widget_prepend_append_input') }}
{% elseif attr.prepend_input is defined and attr.prepend_input is not empty %}
{{ block('form_widget_prepend_input') }}
{% elseif attr.append_input is defined and attr.append_input is not empty %}
{{ block('form_widget_append_input') }}
{% else %}
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}>
{% endif %}
{% if attr.help_block is defined %}
{{ block('help_block') }}
{% endif %}
{% if attr.help is defined %}
{{ block('help_inline') }}
{% endif %}
{% endspaceless %}
{% endblock form_widget_simple %}
{% block form_widget_prepend_append_input %}
{% spaceless %}
<div class="input-prepend input-append">
<span class="add-on">{{ attr.prepend_input|trans({}, translation_domain) }}</span>
{% set append_input = attr.append_input|trans({}, translation_domain) %}
{% set attr = attr|merge({'prepend_input': '', 'append_input': ''}) %}
{{ block('form_widget_simple') }}
<span class="add-on">{{ append_input }}</span>
</div>
{% endspaceless %}
{% endblock form_widget_prepend_append_input %}
{% block form_widget_prepend_input %}
{% spaceless %}
<div class="input-prepend">
<span class="add-on">{{ attr.prepend_input|trans({}, translation_domain) }}</span>
{% set attr = attr|merge({'prepend_input': ''}) %}
{{ block('form_widget_simple') }}
</div>
{% endspaceless %}
{% endblock form_widget_prepend_input %}
{% block form_widget_append_input %}
{% spaceless %}
<div class="input-append">
{% set append_input = attr.append_input|trans({}, translation_domain) %}
{% set attr = attr|merge({'append_input': ''}) %}
{{ block('form_widget_simple') }}
<span class="add-on">{{ append_input }}</span>
</div>
{% endspaceless %}
{% endblock form_widget_append_input %}
{% block form_widget_compound %}
{% spaceless %}
{% if form.parent is empty %}
{{ form_errors(form) }}
{% endif %}
{{ block('form_rows') }}
{{ form_rest(form) }}
{% endspaceless %}
{% endblock form_widget_compound %}
{% block collection_widget %}
{% spaceless %}
{% if prototype is defined %}
{% set attr = attr|merge({'data-prototype': form_row(prototype) }) %}
{% endif %}
{{ block('form_widget') }}
{% endspaceless %}
{% endblock collection_widget %}
{% block textarea_widget %}
{% spaceless %}
<textarea {{ block('widget_attributes') }}>{{ value }}</textarea>
{% endspaceless %}
{% endblock textarea_widget %}
{% block choice_widget %}
{% spaceless %}
{% if expanded %}
{{ block('choice_widget_expanded') }}
{% else %}
{{ block('choice_widget_collapsed') }}
{% endif %}
{% endspaceless %}
{% endblock choice_widget %}
{% block choice_widget_expanded %}
{% spaceless %}
{% set child_vars = {'attr': attr} %}
{% for child in form %}
{{ form_label(child, label, child_vars) }}
{% endfor %}
{% endspaceless %}
{% endblock choice_widget_expanded %}
{% block choice_widget_collapsed %}
{% spaceless %}
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
{% if empty_value is not none %}
<option value="">{{ empty_value|trans({}, translation_domain) }}</option>
{% endif %}
{% if preferred_choices|length > 0 %}
{% set options = preferred_choices %}
{{ block('choice_widget_options') }}
{% if choices|length > 0 and separator is not none %}
<option disabled="disabled">{{ separator }}</option>
{% endif %}
{% endif %}
{% set options = choices %}
{{ block('choice_widget_options') }}
</select>
{% endspaceless %}
{% endblock choice_widget_collapsed %}
{% block choice_widget_options %}
{% spaceless %}
{% for group_label, choice in options %}
{% if choice is iterable %}
<optgroup label="{{ group_label|trans({}, translation_domain) }}">
{% set options = choice %}
{{ block('choice_widget_options') }}
</optgroup>
{% else %}
<option value="{{ choice.value }}"{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice.label|trans({}, translation_domain) }}</option>
{% endif %}
{% endfor %}
{% endspaceless %}
{% endblock choice_widget_options %}
{% block checkbox_widget %}
{% spaceless %}
<input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %}>
{% endspaceless %}
{% endblock checkbox_widget %}
{% block radio_widget %}
{% spaceless %}
<input type="radio" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %}>
{% endspaceless %}
{% endblock radio_widget %}
{% block datetime_widget %}
{% spaceless %}
{% if widget == 'single_text' %}
{{ block('form_widget_simple') }}
{% else %}
<div {{ block('widget_container_attributes') }}>
{{ form_errors(form.date) }}
{{ form_errors(form.time) }}
{{ form_widget(form.date) }}
{{ form_widget(form.time) }}
</div>
{% endif %}
{% endspaceless %}
{% endblock datetime_widget %}
{% block date_widget %}
{% spaceless %}
{% if widget == 'single_text' %}
{{ block('form_widget_simple') }}
{% else %}
<div {{ block('widget_container_attributes') }}>
{{ date_pattern|replace({
'{{ year }}': form_widget(form.year),
'{{ month }}': form_widget(form.month),
'{{ day }}': form_widget(form.day),
})|raw }}
</div>
{% endif %}
{% endspaceless %}
{% endblock date_widget %}
{% block time_widget %}
{% spaceless %}
{% if widget == 'single_text' %}
{{ block('form_widget_simple') }}
{% else %}
<div {{ block('widget_container_attributes') }}>
{{ form_widget(form.hour, { 'attr': { 'size': '1' } }) }}:{{ form_widget(form.minute, { 'attr': { 'size': '1' } }) }}{% if with_seconds %}:{{ form_widget(form.second, { 'attr': { 'size': '1' } }) }}{% endif %}
</div>
{% endif %}
{% endspaceless %}
{% endblock time_widget %}
{% block number_widget %}
{% spaceless %}
{# type="number" doesn't work with floats #}
{% set type = type|default('text') %}
{{ block('form_widget_simple') }}
{% endspaceless %}
{% endblock number_widget %}
{% block integer_widget %}
{% spaceless %}
{% set type = type|default('number') %}
{{ block('form_widget_simple') }}
{% endspaceless %}
{% endblock integer_widget %}
{% block money_widget %}
{% spaceless %}
{{ money_pattern|replace({ '{{ widget }}': block('form_widget_simple') })|raw }}
{% endspaceless %}
{% endblock money_widget %}
{% block url_widget %}
{% spaceless %}
{% set type = type|default('url') %}
{{ block('form_widget_simple') }}
{% endspaceless %}
{% endblock url_widget %}
{% block search_widget %}
{% spaceless %}
{% set attr = attr|merge({'class': (attr.class|default('') ~ ' search-query')|trim}) %}
{% set type = type|default('search') %}
{{ block('form_widget_simple') }}
{% endspaceless %}
{% endblock search_widget %}
{% block percent_widget %}
{% spaceless %}
{% set type = type|default('text') %}
{{ block('form_widget_simple') }} %
{% endspaceless %}
{% endblock percent_widget %}
{% block password_widget %}
{% spaceless %}
{% set type = type|default('password') %}
{{ block('form_widget_simple') }}
{% endspaceless %}
{% endblock password_widget %}
{% block hidden_widget %}
{% spaceless %}
{% set type = type|default('hidden') %}
{{ block('form_widget_simple') }}
{% endspaceless %}
{% endblock hidden_widget %}
{% block email_widget %}
{% spaceless %}
{% set type = type|default('email') %}
{{ block('form_widget_simple') }}
{% endspaceless %}
{% endblock email_widget %}
{# Labels #}
{% block form_label %}
{% spaceless %}
{% if not compound %}
{% set label_attr = label_attr|merge({'for': id}) %}
{% endif %}
{% if required %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
{% endif %}
{% if form_type is defined and form_type == 'horizontal' %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' control-label')|trim}) %}
{% endif %}
{% if label is empty %}
{% set label = name|humanize %}
{% endif %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
{% endspaceless %}
{% endblock form_label %}
{% block checkbox_label %}
{% spaceless %}
{% if not compound %}
{% set label_attr = label_attr|merge({'for': id}) %}
{% endif %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' checkbox')|trim}) %}
{% if attr.inline is defined and attr.inline %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' inline')|trim}) %}
{% endif %}
{% if required %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
{% endif %}
{% if label is empty %}
{% set label = name|humanize %}
{% endif %}
{% endspaceless %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{{ form_widget(form) }} {{ label|trans({}, translation_domain) }}
</label>
{% endblock checkbox_label %}
{% block radio_label %}
{% spaceless %}
{% if not compound %}
{% set label_attr = label_attr|merge({'for': id}) %}
{% endif %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' radio')|trim}) %}
{% if required %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %}
{% endif %}
{% if label is empty %}
{% set label = name|humanize %}
{% endif %}
{% endspaceless %}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{{ form_widget(form) }} {{ label|trans({}, translation_domain) }}
</label>
{% endblock radio_label %}
{# Rows #}
{% block repeated_row %}
{% spaceless %}
{#
No need to render the errors here, as all errors are mapped
to the first child (see RepeatedTypeValidatorExtension).
#}
{{ block('form_rows') }}
{% endspaceless %}
{% endblock repeated_row %}
{% block form_row %}
{% spaceless %}
{% if form_type is defined and form_type == 'inline' %}
{{ block('inline_row') }}
{% elseif form_type is defined and form_type == 'horizontal' %}
{{ block('horizontal_row') }}
{% else %}
{{ form_label(form) }}
{{ form_widget(form) }}
{{ form_errors(form) }}
{% endif %}
{% endspaceless %}
{% endblock form_row %}
{% block inline_row %}
{{ form_widget(form) }}&nbsp;
{% endblock inline_row %}
{% block horizontal_row %}
{% spaceless %}
<div class="control-group{% if errors|length %} error{% endif %}">
{{ form_label(form) }}
<div class="controls">
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
</div>
{% endspaceless %}
{% endblock horizontal_row %}
{% block checkbox_row %}
{% spaceless %}
{#
In order to make the click area bigger, the checkbox is
placed inside the label. See checkbox_label block.
#}
{% if form_type is defined and form_type == 'horizontal' %}
{{ block('horizontal_checkbox_row') }}
{% else %}
{{ form_label(form) }}
{{ form_errors(form) }}
{% endif %}
{% endspaceless %}
{% endblock checkbox_row %}
{% block horizontal_checkbox_row %}
{% spaceless %}
<div class="control-group">
<div class="controls">
{{ form_label(form) }}
{{ form_errors(form) }}
</div>
</div>
{% endspaceless %}
{% endblock horizontal_checkbox_row %}
{% block search_row %}
{% spaceless %}
{{ form_widget(form) }}
{{ form_errors(form) }}
{% endspaceless %}
{% endblock search_row %}
{% block hidden_row %}
{{ form_widget(form) }}
{% endblock hidden_row %}
{# Misc #}
{% block form_enctype %}
{% spaceless %}
{% if multipart %}enctype="multipart/form-data"{% endif %}
{% endspaceless %}
{% endblock form_enctype %}
{% block form_errors %}
{% spaceless %}
{% if errors|length == 1 %}
<span class="help-inline">{{
errors[0].messagePluralization is null
? errors[0].messageTemplate|trans(errors[0].messageParameters, 'validators')
: errors[0].messageTemplate|transchoice(errors[0].messagePluralization, errors[0].messageParameters, 'validators')
}}</span>
{% elseif errors|length > 0 %}
<ul class="help-block">
{% for error in errors %}
<li>{{
error.messagePluralization is null
? error.messageTemplate|trans(error.messageParameters, 'validators')
: error.messageTemplate|transchoice(error.messagePluralization, error.messageParameters, 'validators')
}}</li>
{% endfor %}
</ul>
{% endif %}
{% endspaceless %}
{% endblock form_errors %}
{% block form_rest %}
{% spaceless %}
{% for child in form %}
{% if not child.rendered %}
{{ form_row(child) }}
{% endif %}
{% endfor %}
{% endspaceless %}
{% endblock form_rest %}
{% block help_block %}
{% spaceless %}
{% if attr.help_block is defined %}
<span class="help-block">{{ attr.help_block|trans({}, translation_domain) }}</span>
{% endif %}
{% endspaceless %}
{% endblock help_block %}
{% block help_inline %}
{% spaceless %}
{% if attr.help is defined %}
<span class="help-inline">{{ attr.help|trans({}, translation_domain) }}</span>
{% endif %}
{% endspaceless %}
{% endblock help_inline %}
{# Support #}
{% block form_rows %}
{% spaceless %}
{% set child_vars = {} %}
{% if form_type is defined %}
{% set child_vars = child_vars|merge({'form_type': form_type}) %}
{% else %}
{% set child_vars = child_vars|merge({'form_type': 'horizontal'}) %}
{% endif %}
{% for child in form %}
{{ form_row(child, child_vars) }}
{% endfor %}
{% endspaceless %}
{% endblock form_rows %}
{% block widget_attributes %}
{% spaceless %}
id="{{ id }}" name="{{ full_name }}"{% if read_only %} readonly="readonly"{% endif %}{% if disabled %} disabled="disabled"{% endif %}{% if required %} required="required"{% endif %}{% if max_length %} maxlength="{{ max_length }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif %}
{% for attrname, attrvalue in attr %}{% if attrname in ['placeholder', 'title'] %}{{ attrname }}="{{ attrvalue|trans({}, translation_domain) }}" {% else %}{{ attrname }}="{{ attrvalue }}" {% endif %}{% endfor %}
{% endspaceless %}
{% endblock widget_attributes %}
{% block widget_container_attributes %}
{% spaceless %}
{% if id is not empty %}id="{{ id }}" {% endif %}
{% for attrname, attrvalue in attr %}{{ attrname }}="{{ attrvalue }}" {% endfor %}
{% endspaceless %}
{% endblock widget_container_attributes %}
{# Deprecated in Symfony 2.1, to be removed in 2.3 #}
{% block generic_label %}{{ block('form_label') }}{% endblock %}
{% block widget_choice_options %}{{ block('choice_widget_options') }}{% endblock %}
{% block field_widget %}{{ block('form_widget_simple') }}{% endblock %}
{% block field_label %}{{ block('form_label') }}{% endblock %}
{% block field_row %}{{ block('form_row') }}{% endblock %}
{% block field_enctype %}{{ block('form_enctype') }}{% endblock %}
{% block field_errors %}{{ block('form_errors') }}{% endblock %}
{% block field_rest %}{{ block('form_rest') }}{% endblock %}
{% block field_rows %}{{ block('form_rows') }}{% endblock %}

@ -4,7 +4,6 @@
{{- chamilo_settings_get('platform.site_name') -}}
{% endblock %}
{% block page_title %}
{% if page is defined %}
{{ page.name }}

@ -17,10 +17,7 @@
<div class="box box-primary">
<div class="box-body">
{{ form_errors(form) }}
<form action="{{ path('chamilo_course_settings',
{'course': course, 'namespace': namespace}) }}"
method="post"
novalidate>
<form action="{{ path('chamilo_course_settings', {'course': course, 'namespace': namespace}) }}" method="post" novalidate>
{{ form_rest(form) }}
{{ update() }}
</form>

Loading…
Cancel
Save