parent
4dc4cbe28a
commit
e57ee00c58
@ -0,0 +1,27 @@ |
||||
{% block topbar %} |
||||
<nav class="navbar navbar-default navbar-fixed-top" role="navigation"> |
||||
<!-- Brand and toggle get grouped for better mobile display --> |
||||
<div class="navbar-header"> |
||||
<button type="button" class="navbar-toggle" |
||||
data-toggle="collapse" data-target=".navbar-ex1-collapse"> |
||||
<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="#">Chamilo</a> |
||||
</div> |
||||
|
||||
<!-- Collect the nav links, forms, and other content for toggling --> |
||||
<div class="collapse navbar-collapse navbar-ex1-collapse"> |
||||
{{ knp_menu_render('ChamiloLMSCoreBundle:Builder:leftMenu', { 'style': 'navbar' }) }} |
||||
<form class="navbar-form navbar-left" role="search"> |
||||
<div class="form-group"> |
||||
<input type="text" class="form-control" placeholder="Search"> |
||||
</div> |
||||
<button type="submit" class="btn btn-default">Submit</button> |
||||
</form> |
||||
{{ knp_menu_render('ChamiloLMSCoreBundle:Builder:rightMenu', { 'style': 'navbar-right' }) }} |
||||
</div><!-- /.navbar-collapse --> |
||||
</nav> |
||||
{% endblock %} |
||||
@ -0,0 +1,12 @@ |
||||
{% include '::Common/topbar.html.twig' %} |
||||
<br /> |
||||
<br /> |
||||
<br /> |
||||
<div class="container-fluid"> |
||||
<div class="row"> |
||||
<div class="col-sm-12"> |
||||
{% block content %} |
||||
{% endblock %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
@ -0,0 +1,387 @@ |
||||
{% block header %} |
||||
<header class="header"> |
||||
{% block logo %} |
||||
<a href="index.html" class="logo"> |
||||
<!-- Add the class icon to your logo image or logo icon to add the margining --> |
||||
AdminLTE |
||||
</a> |
||||
{% endblock %} |
||||
|
||||
{% block nav %} |
||||
<nav class="navbar navbar-static-top" role="navigation"> |
||||
<!-- Sidebar toggle button--> |
||||
<a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button"> |
||||
<span class="sr-only">Toggle navigation</span> |
||||
<span class="icon-bar"></span> |
||||
<span class="icon-bar"></span> |
||||
<span class="icon-bar"></span> |
||||
</a> |
||||
|
||||
<div class="navbar-left"> |
||||
{{ sonata_block_render_event('breadcrumb', { 'context': 'default', 'current_uri': app.request.requestUri }) }} |
||||
</div> |
||||
|
||||
<div class="navbar-right"> |
||||
<ul class="nav navbar-nav"> |
||||
<!-- Messages: style can be found in dropdown.less--> |
||||
<li class="dropdown messages-menu"> |
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
||||
<i class="fa fa-envelope"></i> |
||||
<span class="label label-success">4</span> |
||||
</a> |
||||
<ul class="dropdown-menu"> |
||||
<li class="header">You have 4 messages</li> |
||||
<li> |
||||
<!-- inner menu: contains the actual data --> |
||||
<div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%; height: 200px;"> |
||||
<li><!-- start message --> |
||||
<a href="#"> |
||||
<div class="pull-left"> |
||||
<img src="img/avatar3.png" class="img-circle" alt="User Image"> |
||||
</div> |
||||
<h4> |
||||
Support Team |
||||
<small><i class="fa fa-clock-o"></i> 5 mins</small> |
||||
</h4> |
||||
<p>Why not buy a new awesome theme?</p> |
||||
</a> |
||||
</li><!-- end message --> |
||||
<li> |
||||
<a href="#"> |
||||
<div class="pull-left"> |
||||
<img src="img/avatar2.png" class="img-circle" alt="user image"> |
||||
</div> |
||||
<h4> |
||||
AdminLTE Design Team |
||||
<small><i class="fa fa-clock-o"></i> 2 hours</small> |
||||
</h4> |
||||
<p>Why not buy a new awesome theme?</p> |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<div class="pull-left"> |
||||
<img src="img/avatar.png" class="img-circle" alt="user image"> |
||||
</div> |
||||
<h4> |
||||
Developers |
||||
<small><i class="fa fa-clock-o"></i> Today</small> |
||||
</h4> |
||||
<p>Why not buy a new awesome theme?</p> |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<div class="pull-left"> |
||||
<img src="img/avatar2.png" class="img-circle" alt="user image"> |
||||
</div> |
||||
<h4> |
||||
Sales Department |
||||
<small><i class="fa fa-clock-o"></i> Yesterday</small> |
||||
</h4> |
||||
<p>Why not buy a new awesome theme?</p> |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<div class="pull-left"> |
||||
<img src="img/avatar.png" class="img-circle" alt="user image"> |
||||
</div> |
||||
<h4> |
||||
Reviewers |
||||
<small><i class="fa fa-clock-o"></i> 2 days</small> |
||||
</h4> |
||||
<p>Why not buy a new awesome theme?</p> |
||||
</a> |
||||
</li> |
||||
</ul><div class="slimScrollBar" style="width: 3px; position: absolute; top: 0px; opacity: 0.4; display: block; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; z-index: 99; right: 1px; background: rgb(0, 0, 0);"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div></div> |
||||
</li> |
||||
<li class="footer"><a href="#">See All Messages</a></li> |
||||
</ul> |
||||
</li> |
||||
<!-- Notifications: style can be found in dropdown.less --> |
||||
<li class="dropdown notifications-menu"> |
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
||||
<i class="fa fa-warning"></i> |
||||
<span class="label label-warning">10</span> |
||||
</a> |
||||
<ul class="dropdown-menu"> |
||||
<li class="header">You have 10 notifications</li> |
||||
<li> |
||||
<!-- inner menu: contains the actual data --> |
||||
<div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%; height: 200px;"> |
||||
<li> |
||||
<a href="#"> |
||||
<i class="ion ion-ios7-people info"></i> 5 new members joined today |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<i class="fa fa-warning danger"></i> Very long description here that may not fit into the page and may cause design problems |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<i class="fa fa-users warning"></i> 5 new members joined |
||||
</a> |
||||
</li> |
||||
|
||||
<li> |
||||
<a href="#"> |
||||
<i class="ion ion-ios7-cart success"></i> 25 sales made |
||||
</a> |
||||
</li> |
||||
<li> |
||||
<a href="#"> |
||||
<i class="ion ion-ios7-person danger"></i> You changed your username |
||||
</a> |
||||
</li> |
||||
</ul><div class="slimScrollBar" style="width: 3px; position: absolute; top: 0px; opacity: 0.4; display: block; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; z-index: 99; right: 1px; background: rgb(0, 0, 0);"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div></div> |
||||
</li> |
||||
<li class="footer"><a href="#">View all</a></li> |
||||
</ul> |
||||
</li> |
||||
<!-- Tasks: style can be found in dropdown.less --> |
||||
<li class="dropdown tasks-menu"> |
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
||||
<i class="fa fa-tasks"></i> |
||||
<span class="label label-danger">9</span> |
||||
</a> |
||||
<ul class="dropdown-menu"> |
||||
<li class="header">You have 9 tasks</li> |
||||
<li> |
||||
<!-- inner menu: contains the actual data --> |
||||
<div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%; height: 200px;"> |
||||
<li><!-- Task item --> |
||||
<a href="#"> |
||||
<h3> |
||||
Design some buttons |
||||
<small class="pull-right">20%</small> |
||||
</h3> |
||||
<div class="progress xs"> |
||||
<div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"> |
||||
<span class="sr-only">20% Complete</span> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</li><!-- end task item --> |
||||
<li><!-- Task item --> |
||||
<a href="#"> |
||||
<h3> |
||||
Create a nice theme |
||||
<small class="pull-right">40%</small> |
||||
</h3> |
||||
<div class="progress xs"> |
||||
<div class="progress-bar progress-bar-green" style="width: 40%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"> |
||||
<span class="sr-only">40% Complete</span> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</li><!-- end task item --> |
||||
<li><!-- Task item --> |
||||
<a href="#"> |
||||
<h3> |
||||
Some task I need to do |
||||
<small class="pull-right">60%</small> |
||||
</h3> |
||||
<div class="progress xs"> |
||||
<div class="progress-bar progress-bar-red" style="width: 60%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"> |
||||
<span class="sr-only">60% Complete</span> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</li><!-- end task item --> |
||||
<li><!-- Task item --> |
||||
<a href="#"> |
||||
<h3> |
||||
Make beautiful transitions |
||||
<small class="pull-right">80%</small> |
||||
</h3> |
||||
<div class="progress xs"> |
||||
<div class="progress-bar progress-bar-yellow" style="width: 80%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100"> |
||||
<span class="sr-only">80% Complete</span> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</li><!-- end task item --> |
||||
</ul><div class="slimScrollBar" style="width: 3px; position: absolute; top: 0px; opacity: 0.4; display: block; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; z-index: 99; right: 1px; background: rgb(0, 0, 0);"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div></div> |
||||
</li> |
||||
<li class="footer"> |
||||
<a href="#">View all tasks</a> |
||||
</li> |
||||
</ul> |
||||
</li> |
||||
<!-- User Account: style can be found in dropdown.less --> |
||||
<li class="dropdown user user-menu"> |
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
||||
<i class="glyphicon glyphicon-user"></i> |
||||
<span>Jane Doe <i class="caret"></i></span> |
||||
</a> |
||||
<ul class="dropdown-menu"> |
||||
<!-- User image --> |
||||
<li class="user-header bg-light-blue"> |
||||
<img src="img/avatar3.png" class="img-circle" alt="User Image"> |
||||
<p> |
||||
Jane Doe - Web Developer |
||||
<small>Member since Nov. 2012</small> |
||||
</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> |
||||
</div> |
||||
</li> |
||||
<!-- Menu Footer--> |
||||
<li class="user-footer"> |
||||
<div class="pull-left"> |
||||
<a href="#" class="btn btn-default btn-flat">Profile</a> |
||||
</div> |
||||
<div class="pull-right"> |
||||
<a href="#" class="btn btn-default btn-flat">Sign out</a> |
||||
</div> |
||||
</li> |
||||
</ul> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</nav> |
||||
{% endblock %} |
||||
</header> |
||||
{% endblock %} |
||||
{% block sonata_wrapper %} |
||||
<div class="wrapper row-offcanvas row-offcanvas-left"> |
||||
{% block sonata_left_side %} |
||||
<aside class="left-side sidebar-offcanvas"> |
||||
<section class="sidebar"> |
||||
|
||||
{{ sonata_block_render({'type': 'chamilolms.corebundle.block.main_menu', 'settings': { |
||||
'current_uri': app.request.requestUri, |
||||
'ttl': 60 |
||||
}}) }} |
||||
|
||||
{% block sonata_side_nav %} |
||||
{% block sonata_sidebar_search %} |
||||
{% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %} |
||||
<form action="{{ url('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search"> |
||||
<div class="input-group custom-search-form"> |
||||
<input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}"> |
||||
<span class="input-group-btn"> |
||||
<button class="btn btn-flat" type="submit"> |
||||
<i class="fa fa-search"></i> |
||||
</button> |
||||
</span> |
||||
</div> |
||||
</form> |
||||
{% endif %} |
||||
{% endblock sonata_sidebar_search %} |
||||
|
||||
{% block side_bar_before_nav %} {% endblock %} |
||||
{% block side_bar_nav %} |
||||
{% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %} |
||||
|
||||
{% endif %} |
||||
{% endblock side_bar_nav %} |
||||
{% endblock sonata_side_nav %} |
||||
</section> |
||||
</aside> |
||||
{% endblock sonata_left_side %} |
||||
|
||||
<aside class="right-side"> |
||||
{% block sonata_page_content %} |
||||
<section class="content-header"> |
||||
{% block sonata_page_content_header %} |
||||
{% block sonata_page_content_nav %} |
||||
{% if _tab_menu is not empty or _actions is not empty %} |
||||
<nav class="navbar navbar-default" role="navigation"> |
||||
{% if _navbar_title is not empty %} |
||||
<div class="navbar-header"> |
||||
<span class="navbar-brand">{{ _navbar_title|raw }}</span> |
||||
</div> |
||||
{% endif %} |
||||
<div class="container-fluid"> |
||||
<div class="navbar-left"> |
||||
{% if _tab_menu is not empty %} |
||||
{{ _tab_menu|raw }} |
||||
{% endif %} |
||||
</div> |
||||
|
||||
{% if _actions is not empty %} |
||||
<ul class="nav navbar-nav navbar-right"> |
||||
<li class="dropdown sonata-actions"> |
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Actions <b class="caret"></b></a> |
||||
<ul class="dropdown-menu" role="menu"> |
||||
{{ _actions|raw }} |
||||
</ul> |
||||
</li> |
||||
</ul> |
||||
{% endif %} |
||||
</div> |
||||
</nav> |
||||
{% endif %} |
||||
{% endblock sonata_page_content_nav %} |
||||
|
||||
{% endblock sonata_page_content_header %} |
||||
</section> |
||||
|
||||
<section class="content"> |
||||
|
||||
<div class="row"> |
||||
<div class="col-md-3 col-sm-4"> |
||||
{% block sidebar %} |
||||
|
||||
{#{{ sonata_block_render({ 'type': 'sonata.block.service.menu' }, {#} |
||||
{#'menu_name': 'ChamiloLMSCoreBundle:MainMenuBuilder:profileMenu',#} |
||||
{#}) }}#} |
||||
|
||||
{% include "@template_style/layout/sidebar.tpl" %} |
||||
|
||||
{# course navigation links/shortcuts need to be activated by the admin #} |
||||
{% include "@template_style/layout/course_navigation.tpl" %} |
||||
{% endblock %} |
||||
</div> |
||||
<div class="col-md-9 col-sm-8"> |
||||
{% block main_content %} |
||||
{% if plugin_content_top %} |
||||
<div id="plugin_content_top" class="col-lg-10 col-sm-11"> |
||||
{{ plugin_content_top}} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{% include "@template_style/layout/page_body.tpl" %} |
||||
{% block content %} |
||||
{% autoescape false %} |
||||
{% if content is not null %} |
||||
{{ content }} |
||||
{% endif %} |
||||
{% endautoescape %} |
||||
{% endblock %} |
||||
|
||||
{# Plugin bottom #} |
||||
{% if plugin_content_bottom %} |
||||
<div id="plugin_content_bottom" class="col-md-12"> |
||||
{{ plugin_content_bottom }} |
||||
</div> |
||||
{% endif %} |
||||
</section> |
||||
|
||||
{# Footer #} |
||||
{% include "@template_style/layout/footer.tpl" %} |
||||
{% endblock %} |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
</section> |
||||
{% endblock sonata_page_content %} |
||||
</aside> |
||||
|
||||
</div> |
||||
{% endblock sonata_wrapper %} |
||||
|
||||
@ -0,0 +1,2 @@ |
||||
{% extends '::base.html.twig' %} |
||||
{% block theme 'page' %} |
||||
@ -0,0 +1,313 @@ |
||||
{% set _preview = block('preview') %} |
||||
{% set _form = block('form') %} |
||||
{% set _show = block('show') %} |
||||
{% set _list_table = block('list_table') %} |
||||
{% set _list_filters = block('list_filters') %} |
||||
{% set _tab_menu = block('tab_menu') %} |
||||
{% set _content = block('content') %} |
||||
{% set _title = block('title') %} |
||||
{% set _breadcrumb = block('breadcrumb') %} |
||||
{% set _actions = block('actions') %} |
||||
{% set _navbar_title = block('navbar_title') %} |
||||
<!DOCTYPE html> |
||||
<!--[if lt IE 7]> <html lang="{{ app.request.locale }}" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> |
||||
<!--[if IE 7]> <html lang="{{ app.request.locale }}" class="no-js lt-ie9 lt-ie8"> <![endif]--> |
||||
<!--[if IE 8]> <html lang="{{ app.request.locale }}" class="no-js lt-ie9"> <![endif]--> |
||||
<!--[if gt IE 8]><!--><html lang="{{ app.request.locale }}" class="no-js"> <!--<![endif]--> |
||||
<head> |
||||
{% block head %} |
||||
<noscript>{{ "NoJavascript"|trans }}</noscript> |
||||
<meta charset="UTF-8" /> |
||||
<link href="http://www.chamilo.org/documentation.php" rel="help" /> |
||||
<link href="http://www.chamilo.org/team.php" rel="author" /> |
||||
<link href="http://www.chamilo.org" rel="copyright" /> |
||||
<link rel="shortcut icon" href="{{ asset('favicon.ico') }}" /> |
||||
<link rel="shortcut icon" href="{{ asset('apple-touch-icon.png') }}" /> |
||||
<meta name="apple-mobile-web-app-capable" content="yes" /> |
||||
<meta name="Generator" content="{{ software_name }} {{ version }}" /> |
||||
{# Use the latest engine in ie8/ie9 or use google chrome engine if available #} |
||||
{# Improve usability in portal devices #} |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
<title>{% block title %}{% endblock %}</title> |
||||
|
||||
{% block stylesheets %} |
||||
<link href="{{ asset('assetic/sonata_formatter_css.css') }}" rel="stylesheet" media="screen"> |
||||
<link href="{{ asset('assetic/sonata_admin_css.css') }}" rel="stylesheet" media="screen"> |
||||
<link href="{{ asset('assetic/sonata_jqueryui_css.css') }}" rel="stylesheet" media="screen"> |
||||
|
||||
<link href="{{ asset('ChamiloLMS/css/base.css') }}" rel="stylesheet" media="screen"> |
||||
<link href="{{ asset('ChamiloLMS/css/themes/chamilo/default.css') }}" rel="stylesheet" media="screen"> |
||||
{% endblock %} |
||||
|
||||
{% block javascripts %} |
||||
<script src="{{ asset('assetic/sonata_admin_js.js') }}" type="text/javascript"></script> |
||||
<script src="{{ asset('assetic/sonata_formatter_js.js') }}" type="text/javascript"></script> |
||||
<script src="{{ asset('assetic/sonata_jqueryui_js.js') }}" type="text/javascript"></script> |
||||
{% endblock %} |
||||
|
||||
{% block header_end %}{% endblock header_end %} |
||||
<script> |
||||
function setCheckbox(value, table_id) { |
||||
checkboxes = $("#"+table_id+" input:checkbox"); |
||||
$.each(checkboxes, function(index, checkbox) { |
||||
checkbox.checked = value; |
||||
if (value) { |
||||
$(checkbox).parentsUntil("tr").parent().addClass("row_selected"); |
||||
} else { |
||||
$(checkbox).parentsUntil("tr").parent().removeClass("row_selected"); |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
function action_click(element, table_id) { |
||||
d = $("#"+table_id); |
||||
if (!confirm('{{ "ConfirmYourChoice"|trans }}')) { |
||||
return false; |
||||
} else { |
||||
var action =$(element).attr("data-action"); |
||||
$('#'+table_id+' input[name="action"] ').attr("value", action); |
||||
d.submit(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
/* Global chat variables */ |
||||
{# |
||||
var ajax_url = '{{ _p.web_ajax }}chat.ajax.php'; |
||||
var online_button = '{{ online_button |e('js') }}'; |
||||
var offline_button = '{{ offline_button |e('js') }}'; |
||||
#} |
||||
var connect_lang = '{{ "ChatConnected"|trans |e('js') }}'; |
||||
var disconnect_lang = '{{ "ChatDisconnected"|trans |e('js') }}'; |
||||
|
||||
function get_url_params(q, attribute) { |
||||
var vars; |
||||
var hash; |
||||
if (q != undefined) { |
||||
q = q.split('&'); |
||||
for(var i = 0; i < q.length; i++){ |
||||
hash = q[i].split('='); |
||||
if (hash[0] == attribute) { |
||||
return hash[1]; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
function check_brand() { |
||||
if ($('.subnav').length) { |
||||
if ($(window).width() >= 969) { |
||||
$('.subnav .brand').hide(); |
||||
} else { |
||||
$('.subnav .brand').show(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
$(window).resize(function() { |
||||
//check_brand(); |
||||
}); |
||||
|
||||
$(document).scroll(function() { |
||||
|
||||
// Top bar scroll effect |
||||
if ($('body').width() > 959) { |
||||
if ($('.subnav').length) { |
||||
if (!$('.subnav').attr('data-top')) { |
||||
// If already fixed, then do nothing |
||||
if ($('.subnav').hasClass('subnav-fixed')) return; |
||||
// Remember top position |
||||
var offset = $('.subnav').offset(); |
||||
$('.subnav').attr('data-top', offset.top); |
||||
} |
||||
|
||||
if ($('.subnav').attr('data-top') - $('.subnav').outerHeight() <= $(this).scrollTop()) { |
||||
$('.subnav').addClass('subnav-fixed'); |
||||
} else { |
||||
$('.subnav').removeClass('subnav-fixed'); |
||||
} |
||||
//$('.subnav .brand').show(); |
||||
} |
||||
} else { |
||||
//$('.subnav .brand').hide(); |
||||
} |
||||
|
||||
//Exercise warning fixed at the top |
||||
var fixed = $("#exercise_clock_warning"); |
||||
if (fixed.length) { |
||||
if (!fixed.attr('data-top')) { |
||||
// If already fixed, then do nothing |
||||
if (fixed.hasClass('subnav-fixed')) return; |
||||
// Remember top position |
||||
var offset = fixed.offset(); |
||||
fixed.attr('data-top', offset.top); |
||||
fixed.css('width', '100%'); |
||||
} |
||||
|
||||
if (fixed.attr('data-top') - fixed.outerHeight() <= $(this).scrollTop()) { |
||||
fixed.addClass('subnav-fixed'); |
||||
fixed.css('width', '100%'); |
||||
} else { |
||||
fixed.removeClass('subnav-fixed'); |
||||
fixed.css('width', '200px'); |
||||
} |
||||
} |
||||
|
||||
// Admin -> Settings toolbar. |
||||
if ($('body').width() > 959) {/* |
||||
if ($('.new_actions').length) { |
||||
if (!$('.new_actions').attr('data-top')) { |
||||
// If already fixed, then do nothing |
||||
if ($('.new_actions').hasClass('new_actions-fixed')) return; |
||||
// Remember top position |
||||
var offset = $('.new_actions').offset(); |
||||
|
||||
var more_top = 0; |
||||
if ($('.subnav').hasClass('new_actions-fixed')) { |
||||
more_top = 50; |
||||
} |
||||
$('.new_actions').attr('data-top', offset.top + more_top); |
||||
} |
||||
|
||||
if ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop()) { |
||||
$('.new_actions').addClass('new_actions-fixed'); |
||||
} else { |
||||
$('.new_actions').removeClass('new_actions-fixed'); |
||||
} |
||||
}*/ |
||||
} |
||||
|
||||
// Bottom actions. |
||||
if ($('.bottom_actions').length) { |
||||
if (!$('.bottom_actions').attr('data-top')) { |
||||
// If already fixed, then do nothing |
||||
if ($('.bottom_actions').hasClass('bottom_actions_fixed')) return; |
||||
|
||||
// Remember top position |
||||
var offset = $('.bottom_actions').offset(); |
||||
$('.bottom_actions').attr('data-top', offset.top); |
||||
} |
||||
|
||||
if ($('.bottom_actions').attr('data-top') > $('body').outerHeight()) { |
||||
if ( ($('.bottom_actions').attr('data-top') - $('body').outerHeight() - $('.bottom_actions').outerHeight()) >= $(this).scrollTop()) { |
||||
$('.bottom_actions').addClass('bottom_actions_fixed'); |
||||
$('.bottom_actions').css("width", "100%"); |
||||
} else { |
||||
$('.bottom_actions').css("width", ""); |
||||
$('.bottom_actions').removeClass('bottom_actions_fixed'); |
||||
} |
||||
} else { |
||||
if ( ($('.bottom_actions').attr('data-top') - $('.bottom_actions').outerHeight()) <= $(this).scrollTop()) { |
||||
$('.bottom_actions').addClass('bottom_actions_fixed'); |
||||
$('.bottom_actions').css("width", "100%"); |
||||
} else { |
||||
$('.bottom_actions').removeClass('bottom_actions_fixed'); |
||||
$('.bottom_actions').css("width", ""); |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
|
||||
$(function() { |
||||
check_brand(); |
||||
//Removes the yellow input in Chrome |
||||
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) { |
||||
$(window).load(function(){ |
||||
$('input:-webkit-autofill').each(function(){ |
||||
var text = $(this).val(); |
||||
var name = $(this).attr('name'); |
||||
$(this).after(this.outerHTML).remove(); |
||||
//var has_string = $(name).find(":contains('[')"); |
||||
$('input[name=' + name + ']').val(text); |
||||
}); |
||||
}); |
||||
} |
||||
|
||||
// Fixes buttons to the new btn class. |
||||
if (!$('#button').hasClass('btn')) { |
||||
$("button").addClass('btn'); |
||||
} |
||||
|
||||
// Dropdown effect. |
||||
$('.dropdown-toggle').dropdown(); |
||||
|
||||
// Responsive effect. |
||||
//$(".collapse").collapse(); |
||||
|
||||
/*$(".accordion_jquery").accordion({ |
||||
autoHeight: false, |
||||
active: false, // all items closed by default |
||||
collapsible: true, |
||||
header: ".accordion-heading" |
||||
});*/ |
||||
|
||||
// Global popup |
||||
$('.ajax').on('click', function() { |
||||
var url = this.href; |
||||
var dialog = $("#dialog"); |
||||
if ($("#dialog").length == 0) { |
||||
dialog = $('<div id="dialog" style="display:none"></div>').appendTo('body'); |
||||
} |
||||
|
||||
width_value = 580; |
||||
height_value = 450; |
||||
resizable_value = true; |
||||
|
||||
new_param = get_url_params(url, 'width'); |
||||
if (new_param) { |
||||
width_value = new_param; |
||||
} |
||||
|
||||
new_param = get_url_params(url, 'height') |
||||
if (new_param) { |
||||
height_value = new_param; |
||||
} |
||||
|
||||
new_param = get_url_params(url, 'resizable'); |
||||
if (new_param) { |
||||
resizable_value = new_param; |
||||
} |
||||
|
||||
// load remote content |
||||
dialog.load(url,{}, function(responseText, textStatus, XMLHttpRequest) { |
||||
dialog.dialog({ |
||||
modal : true, |
||||
width : width_value, |
||||
height : height_value, |
||||
resizable : resizable_value |
||||
}); |
||||
}); |
||||
//prevent the browser to follow the link |
||||
return false; |
||||
}); |
||||
|
||||
//old jquery.menu.js |
||||
$('#navigation a').stop().animate({ |
||||
'marginLeft':'50px' |
||||
}, 1000); |
||||
|
||||
$('#navigation > li').hover( |
||||
function () { |
||||
$('a',$(this)).stop().animate({ |
||||
'marginLeft':'1px' |
||||
},200); |
||||
}, |
||||
function () { |
||||
$('a',$(this)).stop().animate({ |
||||
'marginLeft':'50px' |
||||
},200); |
||||
} |
||||
); |
||||
}); |
||||
</script> |
||||
{% block extraHead %} |
||||
{% endblock %} |
||||
{% endblock %} |
||||
</head> |
||||
|
||||
<body class="{% block theme %}default{% endblock %} sonata-bc skin-black fixed"> |
||||
{% block layout %}{% endblock %} |
||||
</body> |
||||
</html> |
||||
@ -0,0 +1 @@ |
||||
123 |
||||
@ -0,0 +1,32 @@ |
||||
<?php |
||||
|
||||
$config = new \Doctrine\ORM\Configuration(); |
||||
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache); |
||||
|
||||
use Doctrine\Common\Annotations\AnnotationReader; |
||||
use Doctrine\Common\Annotations\AnnotationRegistry; |
||||
|
||||
$sysPath = __DIR__."/"; |
||||
|
||||
AnnotationRegistry::registerFile($sysPath."vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"); |
||||
$reader = new AnnotationReader(); |
||||
|
||||
$driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array($sysPath."tests/doctrine_console/mapping")); |
||||
|
||||
$config->setMetadataDriverImpl($driverImpl); |
||||
$config->setProxyDir(__DIR__ . '/Proxies'); |
||||
$config->setProxyNamespace('Proxies'); |
||||
|
||||
$defaultConnection = array( |
||||
'driver' => 'pdo_mysql', |
||||
'dbname' => 'chamilo', |
||||
'user' => 'root', |
||||
'password' => 'root', |
||||
'host' => 'localhost', |
||||
); |
||||
|
||||
|
||||
$em = \Doctrine\ORM\EntityManager::create($defaultConnection, $config); |
||||
|
||||
use Doctrine\ORM\Tools\Console\ConsoleRunner; |
||||
return ConsoleRunner::createHelperSet($em); |
||||
@ -1,183 +0,0 @@ |
||||
<?php |
||||
|
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
$config = new \Doctrine\ORM\Configuration(); |
||||
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache); |
||||
|
||||
use Doctrine\Common\Annotations\AnnotationReader; |
||||
use Doctrine\Common\Annotations\AnnotationRegistry; |
||||
|
||||
$sysPath = __DIR__."/"; |
||||
|
||||
AnnotationRegistry::registerFile($sysPath."vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"); |
||||
$reader = new AnnotationReader(); |
||||
|
||||
$driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array($sysPath."tests/doctrine_console/mapping")); |
||||
|
||||
$config->setMetadataDriverImpl($driverImpl); |
||||
$config->setProxyDir(__DIR__ . '/Proxies'); |
||||
$config->setProxyNamespace('Proxies'); |
||||
|
||||
$courseList = CourseManager::get_real_course_list(); |
||||
|
||||
$app['chamilo.log'] = $app['sys_log_path'].'chamilo-cli.log'; |
||||
|
||||
// Loading db connections |
||||
|
||||
$connectionOptions = array(); |
||||
|
||||
if (!empty($courseList)) { |
||||
|
||||
$dbPrefix = isset($_configuration['db_prefix']) && !empty($_configuration['db_prefix']) ? $_configuration['db_prefix'].Database::get_database_glue() : null; |
||||
foreach ($courseList as $course) { |
||||
$connectionOptions['_chamilo_course_'.$course['db_name']] = array( |
||||
'driver' => 'pdo_mysql', |
||||
'dbname' => $dbPrefix.$course['db_name'], |
||||
'user' => $_configuration['db_user'], |
||||
'password' => $_configuration['db_password'], |
||||
'host' => $_configuration['db_host'], |
||||
); |
||||
} |
||||
} |
||||
|
||||
if (isset($_configuration['main_database'])) { |
||||
$connectionOptions['main_database'] = array( |
||||
'driver' => 'pdo_mysql', |
||||
'dbname' => $_configuration['main_database'], |
||||
'user' => $_configuration['db_user'], |
||||
'password' => $_configuration['db_password'], |
||||
'host' => $_configuration['db_host'], |
||||
); |
||||
} |
||||
|
||||
if (isset($_configuration['statistics_database'])) { |
||||
$connectionOptions['statistics_database'] = array( |
||||
'driver' => 'pdo_mysql', |
||||
'dbname' => $_configuration['statistics_database'], |
||||
'user' => $_configuration['db_user'], |
||||
'password' => $_configuration['db_password'], |
||||
'host' => $_configuration['db_host'], |
||||
); |
||||
} else { |
||||
if (isset($_configuration['main_database'])) { |
||||
$connectionOptions['statistics_database'] = $connectionOptions['main_database']; |
||||
} |
||||
} |
||||
|
||||
if (isset($_configuration['user_personal_database'])) { |
||||
$connectionOptions['user_personal_database'] = array( |
||||
'driver' => 'pdo_mysql', |
||||
'dbname' => $_configuration['user_personal_database'], |
||||
'user' => $_configuration['db_user'], |
||||
'password' => $_configuration['db_password'], |
||||
'host' => $_configuration['db_host'], |
||||
); |
||||
} else { |
||||
if (isset($_configuration['main_database'])) { |
||||
$connectionOptions['user_personal_database'] = $connectionOptions['main_database']; |
||||
} |
||||
} |
||||
|
||||
$defaultConnection = array( |
||||
'driver' => 'pdo_mysql' |
||||
); |
||||
|
||||
if (isset($_configuration['main_database'])) { |
||||
$defaultConnection = array( |
||||
'driver' => 'pdo_mysql', |
||||
'dbname' => $_configuration['main_database'], |
||||
'user' => $_configuration['db_user'], |
||||
'password' => $_configuration['db_password'], |
||||
'host' => $_configuration['db_host'], |
||||
); |
||||
} |
||||
|
||||
$em = \Doctrine\ORM\EntityManager::create($defaultConnection, $config); |
||||
|
||||
//Fixes some errors |
||||
$platform = $em->getConnection()->getDatabasePlatform(); |
||||
$platform->registerDoctrineTypeMapping('enum', 'string'); |
||||
$platform->registerDoctrineTypeMapping('set', 'string'); |
||||
|
||||
$helpers = array( |
||||
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()), |
||||
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em), |
||||
'configuration' => new \Chash\Helpers\ConfigurationHelper() |
||||
); |
||||
|
||||
use Doctrine\DBAL\DriverManager; |
||||
$multipleEM = array(); |
||||
foreach ($connectionOptions as $name => $connection) { |
||||
$em = \Doctrine\ORM\EntityManager::create($connection, $config); |
||||
//$helpers[$name] = new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em); |
||||
$helpers[$name] = new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()); |
||||
} |
||||
|
||||
/* |
||||
To generate doctrine2 entities you must: |
||||
|
||||
cd /var/www/chamilo11/tests/doctrine_console |
||||
|
||||
Delete old mappings/entities |
||||
|
||||
sudo rm -R mapping generated repository |
||||
|
||||
Creating the mapping from the DB |
||||
|
||||
sudo mkdir mapping generated repository |
||||
|
||||
You can add a Namespace if you want to with: --namespace "Entity" |
||||
sudo php5 doctrine.php orm:convert-mapping --force --from-database --namespace "Entity" annotation mapping |
||||
|
||||
|
||||
1. Generate entities |
||||
|
||||
sudo php5 doctrine.php orm:generate-entities --generate-annotations="true" generated |
||||
|
||||
Validate schema |
||||
sudo php5 doctrine.php orm:validate-schema -v |
||||
|
||||
Move generated files in a chamilo folder: |
||||
|
||||
sudo rm -R main/inc/Entity/* |
||||
mkdir main/inc/Entity |
||||
|
||||
cp -R tests/doctrine_console/generated/* main/inc/Entity |
||||
|
||||
fixes \ORM bug see http://redgreenrefactor.blogsite.org/php/code-first-approaching-php-with-doctrine-2-2-1-and-composer/ |
||||
cd main/inc/Entity |
||||
|
||||
sed -i 's/@ORM\\/@/g' *.php |
||||
|
||||
For tests |
||||
php5 tests/doctrine_console/doctrine.php orm:generate-entities --generate-annotations="true" main/inc/Entity |
||||
|
||||
Then autoload classes with composer |
||||
sudo php5 composer.phar update or sudo composer.phar update |
||||
|
||||
2. Migrations |
||||
|
||||
a. Generate empty migration file |
||||
cd /var/www/chamilo11/tests/doctrine_console |
||||
|
||||
php5 doctrine.php migrations:generate |
||||
|
||||
b. Check status |
||||
|
||||
php5 doctrine.php migrations:status |
||||
|
||||
c. Check sql |
||||
php5 doctrine.php migrations:migrate --dry-run |
||||
|
||||
d. execute migration |
||||
php5 doctrine.php migrations:migrate |
||||
|
||||
e. Revert migrations |
||||
php5 doctrine.php migrations:migrate 0 |
||||
|
||||
|
||||
http://docs.doctrine-project.org/projects/doctrine-migrations/en/latest/reference/managing_migrations.html |
||||
|
||||
*/ |
||||
|
||||
@ -1,93 +0,0 @@ |
||||
#!/usr/bin/env php |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
set_time_limit(0); |
||||
|
||||
if (PHP_SAPI != 'cli') { |
||||
die("Cannot be called by any other method than the command line."); |
||||
} |
||||
require_once __DIR__.'/vendor/autoload.php'; |
||||
|
||||
$app = require_once dirname(__FILE__).'/src/ChamiloLMS/app.php'; |
||||
|
||||
use Knp\Provider\ConsoleServiceProvider; |
||||
|
||||
$app->register( |
||||
new ConsoleServiceProvider(), |
||||
array( |
||||
'console.name' => 'Chamilo CLI', |
||||
'console.version' => '1.0.0', |
||||
'console.project_directory' => __DIR__.'/..' |
||||
) |
||||
); |
||||
|
||||
|
||||
// Variable $helperSet is defined inside cli-config.php |
||||
//require __DIR__.'/console-config.php'; |
||||
//$cli = new \Symfony\Component\Console\Application('Chamilo CLI'); |
||||
|
||||
// Adding commands. |
||||
/** @var Knp\Console\Application $cli */ |
||||
$cli = $app['console']; |
||||
|
||||
$cli->setCatchExceptions(true); |
||||
|
||||
$helpers = array( |
||||
'configuration' => new Chash\Helpers\ConfigurationHelper() |
||||
); |
||||
$helperSet = $cli->getHelperSet(); |
||||
foreach ($helpers as $name => $helper) { |
||||
$helperSet->set($helper, $name); |
||||
} |
||||
|
||||
$cli->addCommands( |
||||
array( |
||||
// DBAL Commands. |
||||
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(), |
||||
new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(), |
||||
|
||||
// ORM Commands. |
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(), |
||||
new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(), |
||||
|
||||
// Migrations Commands. |
||||
new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(), |
||||
new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(), |
||||
new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(), |
||||
new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(), |
||||
new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(), |
||||
new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand(), |
||||
|
||||
// Chamilo commands. |
||||
|
||||
new ChamiloLMS\Command\Template\AsseticDumpCommand(), |
||||
new ChamiloLMS\Command\Translation\ExportLanguagesCommand(), |
||||
|
||||
// Chash commands. |
||||
new Chash\Command\Database\RunSQLCommand(), |
||||
//new Chash\Command\Database\DumpCommand(), |
||||
//new Chash\Command\Database\RestoreCommand(), |
||||
new Chash\Command\Database\SQLCountCommand(), |
||||
new Chash\Command\Database\FullBackupCommand(), |
||||
//new Chash\Command\Database\DropDatabaseCommand(), |
||||
|
||||
new Chash\Command\Files\CleanTempFolderCommand(), |
||||
|
||||
new Chash\Command\Translation\ExportLanguageCommand(), |
||||
new Chash\Command\Translation\ImportLanguageCommand() |
||||
) |
||||
); |
||||
$cli->run(); |
||||
@ -1,7 +0,0 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
// Redirect calls to web/index |
||||
// Please make sure you read the installation manual in the documentation/ |
||||
// folder if your installation doesn't work. Hint: you need to allow overrides |
||||
header('Location: web/index'); |
||||
exit; |
||||
@ -1,80 +0,0 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
use \ChamiloSession as Session; |
||||
|
||||
/** |
||||
* HOME PAGE FOR EACH COURSE |
||||
* |
||||
* This page, included in every course's index.php is the home |
||||
* page. To make administration simple, the teacher edits his |
||||
* course from the home page. Only the login detects that the |
||||
* visitor is allowed to activate, deactivate home page links, |
||||
* access to the teachers tools (statistics, edit forums...). |
||||
* |
||||
* @package chamilo.course_home |
||||
*/ |
||||
function return_block($title, $content) |
||||
{ |
||||
$html = '<div class="page-header"> |
||||
<h3>'.$title.'</h3> |
||||
</div> |
||||
'.$content.'</div>'; |
||||
return $html; |
||||
} |
||||
|
||||
$session_id = api_get_session_id(); |
||||
|
||||
$urlGenerator = Session::$urlGenerator; |
||||
|
||||
$content = null; |
||||
|
||||
// Start of tools for CourseAdmins (teachers/tutors) |
||||
$totalList = array(); |
||||
|
||||
if ($session_id == 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) { |
||||
$list = CourseHome::get_tools_category(TOOL_AUTHORING); |
||||
|
||||
$result = CourseHome::show_tools_category($urlGenerator, $list); |
||||
|
||||
$content .= return_block(get_lang('Authoring'), $result['content']); |
||||
|
||||
$totalList = $result['tool_list']; |
||||
|
||||
$list = CourseHome::get_tools_category(TOOL_INTERACTION); |
||||
$list2 = CourseHome::get_tools_category(TOOL_COURSE_PLUGIN); |
||||
$list = array_merge($list, $list2); |
||||
$result = CourseHome::show_tools_category($urlGenerator, $list); |
||||
$totalList = array_merge($totalList, $result['tool_list']); |
||||
|
||||
$content .= return_block(get_lang('Interaction'), $result['content']); |
||||
|
||||
$list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM); |
||||
$totalList = array_merge($totalList, $list); |
||||
$result = CourseHome::show_tools_category($urlGenerator, $list); |
||||
|
||||
$totalList = array_merge($totalList, $result['tool_list']); |
||||
|
||||
$content .= return_block(get_lang('Administration'), $result['content']); |
||||
|
||||
} elseif (api_is_coach()) { |
||||
|
||||
$content .= '<div class="row">'; |
||||
$list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); |
||||
$content .= CourseHome::show_tools_category($urlGenerator, $result['content']); |
||||
$totalList = array_merge($totalList, $result['tool_list']); |
||||
$content .= '</div>'; |
||||
} else { |
||||
$list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); |
||||
if (count($list) > 0) { |
||||
$content .= '<div class="row">'; |
||||
$result = CourseHome::show_tools_category($urlGenerator, $list); |
||||
$content .= $result['content']; |
||||
$totalList = array_merge($totalList, $result['tool_list']); |
||||
$content .= '</div>'; |
||||
} |
||||
} |
||||
|
||||
return array( |
||||
'content' => $content, |
||||
'tool_list' => $totalList |
||||
); |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,22 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CoreBundle\DependencyInjection\Compiler; |
||||
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; |
||||
use Symfony\Component\DependencyInjection\ContainerBuilder; |
||||
|
||||
class DoctrineEntityListenerPass implements CompilerPassInterface |
||||
{ |
||||
public function process(ContainerBuilder $container) |
||||
{ |
||||
$definition = $container->getDefinition('chamilolms.doctrine.entity_listener_resolver'); |
||||
$services = $container->findTaggedServiceIds('doctrine.entity_listener'); |
||||
|
||||
foreach ($services as $service => $attributes) { |
||||
$definition->addMethodCall( |
||||
'addMapping', |
||||
array($container->getDefinition($service)->getClass(), $service) |
||||
); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,40 @@ |
||||
<?php |
||||
|
||||
namespace ChamiloLMS\CoreBundle\Doctrine; |
||||
|
||||
use Doctrine\ORM\Mapping\DefaultEntityListenerResolver; |
||||
use Symfony\Component\DependencyInjection\ContainerInterface; |
||||
|
||||
class EntityListenerResolver extends DefaultEntityListenerResolver |
||||
{ |
||||
private $container; |
||||
private $mapping; |
||||
|
||||
/** |
||||
* @param ContainerInterface $container |
||||
*/ |
||||
public function __construct(ContainerInterface $container) |
||||
{ |
||||
$this->container = $container; |
||||
$this->mapping = array(); |
||||
} |
||||
|
||||
/** |
||||
* @param $className |
||||
* @param $service |
||||
*/ |
||||
public function addMapping($className, $service) |
||||
{ |
||||
$this->mapping[$className] = $service; |
||||
} |
||||
|
||||
public function resolve($className) |
||||
{ |
||||
if (isset($this->mapping[$className]) && $this->container->has($this->mapping[$className])) { |
||||
return $this->container->get($this->mapping[$className]); |
||||
} |
||||
|
||||
return parent::resolve($className); |
||||
|
||||
} |
||||
} |
||||
@ -0,0 +1,60 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace ChamiloLMS\CoreBundle\EventListener; |
||||
|
||||
use Avanzu\AdminThemeBundle\Event\SidebarMenuKnpEvent; |
||||
use Symfony\Component\DependencyInjection\ContainerInterface; |
||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
||||
use Symfony\Component\HttpFoundation\Request; |
||||
|
||||
class MenuListener |
||||
{ |
||||
protected $container; |
||||
|
||||
public function __construct(ContainerInterface $container) |
||||
{ |
||||
$this->container = $container; |
||||
} |
||||
|
||||
public function onSetupMenu(SidebarMenuKnpEvent $event) |
||||
{ |
||||
$request = $event->getRequest(); |
||||
|
||||
foreach ($this->getMenu($request) as $item) { |
||||
$event->addItem($item); |
||||
} |
||||
} |
||||
|
||||
protected function getMenu(Request $request) |
||||
{ |
||||
$menu = $this->container->get('chamilolms.menu.simple_menu'); |
||||
|
||||
/** @var \Knp\Menu\ItemInterface $menuItems */ |
||||
$menuItems = $menu->mainMenu( |
||||
$this->container->get('knp_menu.factory'), |
||||
array() |
||||
); |
||||
|
||||
return $this->activateByRoute($request->get('_route'), $menuItems); |
||||
} |
||||
|
||||
protected function activateByRoute($route, $items) |
||||
{ |
||||
/** @var \Knp\Menu\MenuItem $item */ |
||||
foreach ($items as $item) { |
||||
if ($item->hasChildren()) { |
||||
$this->activateByRoute($route, $item->getChildren()); |
||||
} else { |
||||
if ($item->isCurrent()) { |
||||
$item->setCurrent(true); |
||||
} |
||||
/*if ($item->getRoute() == $route) { |
||||
$item->setIsActive(true); |
||||
}*/ |
||||
} |
||||
} |
||||
|
||||
return $items; |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -1,19 +0,0 @@ |
||||
Copyright (c) 2011-2013 Fabien Potencier |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is furnished |
||||
to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||
THE SOFTWARE. |
||||
@ -1,3 +1,3 @@ |
||||
{{ extension_alias }}_homepage: |
||||
pattern: /hello/{name} |
||||
path: /hello/{name} |
||||
defaults: { _controller: {{ bundle }}:Default:index } |
||||
|
||||
@ -1,40 +1,40 @@ |
||||
{% if 'index' in actions %} |
||||
{{ route_name_prefix }}: |
||||
pattern: / |
||||
path: / |
||||
defaults: { _controller: "{{ bundle }}:{{ entity }}:index" } |
||||
{% endif %} |
||||
|
||||
{% if 'show' in actions %} |
||||
{{ route_name_prefix }}_show: |
||||
pattern: /{id}/show |
||||
path: /{id}/show |
||||
defaults: { _controller: "{{ bundle }}:{{ entity }}:show" } |
||||
{% endif %} |
||||
|
||||
{% if 'new' in actions %} |
||||
{{ route_name_prefix }}_new: |
||||
pattern: /new |
||||
path: /new |
||||
defaults: { _controller: "{{ bundle }}:{{ entity }}:new" } |
||||
|
||||
{{ route_name_prefix }}_create: |
||||
pattern: /create |
||||
path: /create |
||||
defaults: { _controller: "{{ bundle }}:{{ entity }}:create" } |
||||
requirements: { _method: post } |
||||
{% endif %} |
||||
|
||||
{% if 'edit' in actions %} |
||||
{{ route_name_prefix }}_edit: |
||||
pattern: /{id}/edit |
||||
path: /{id}/edit |
||||
defaults: { _controller: "{{ bundle }}:{{ entity }}:edit" } |
||||
|
||||
{{ route_name_prefix }}_update: |
||||
pattern: /{id}/update |
||||
path: /{id}/update |
||||
defaults: { _controller: "{{ bundle }}:{{ entity }}:update" } |
||||
requirements: { _method: post|put } |
||||
{% endif %} |
||||
|
||||
{% if 'delete' in actions %} |
||||
{{ route_name_prefix }}_delete: |
||||
pattern: /{id}/delete |
||||
path: /{id}/delete |
||||
defaults: { _controller: "{{ bundle }}:{{ entity }}:delete" } |
||||
requirements: { _method: post|delete } |
||||
{% endif %} |
||||
|
||||
@ -0,0 +1,16 @@ |
||||
<?php |
||||
|
||||
use Symfony\Component\HttpFoundation\Request; |
||||
use Doctrine\Common\Annotations\AnnotationRegistry; |
||||
use Claroline\WebInstaller\Kernel; |
||||
|
||||
$loader = require_once __DIR__ . '/../vendor/autoload.php'; |
||||
$request = Request::createFromGlobals(); |
||||
|
||||
if (!file_exists($file = __DIR__ . '/../app/config/is_installed.php') || false === require_once $file) { |
||||
AnnotationRegistry::registerLoader(array($loader, 'loadClass')); |
||||
$kernel = new Kernel(__DIR__ . '/../app'); |
||||
$kernel->handle($request)->send(); |
||||
} else { |
||||
header('Location: ' . $request->getBaseUrl() . '/../app.php'); |
||||
} |
||||
Loading…
Reference in new issue