parent
8324721775
commit
d372bc9891
@ -1,32 +1,38 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* WidgetController.php |
||||
* avanzu-admin |
||||
* Date: 16.03.14 |
||||
*/ |
||||
|
||||
namespace Chamilo\ThemeBundle\Controller; |
||||
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
||||
use Symfony\Component\HttpFoundation\Request; |
||||
use Symfony\Component\HttpFoundation\Response; |
||||
|
||||
/** |
||||
* Class WidgetController |
||||
* @package Chamilo\ThemeBundle\Controller |
||||
*/ |
||||
class WidgetController extends Controller |
||||
{ |
||||
|
||||
public function defaultBoxAction() |
||||
{ |
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
public function solidBoxAction() |
||||
{ |
||||
} |
||||
} |
||||
|
||||
public function tiledBoxAction() |
||||
{ |
||||
} |
||||
} |
||||
|
||||
public function smallBoxAction() |
||||
{ |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
||||
|
@ -0,0 +1,5 @@ |
||||
login: |
||||
path: /login |
||||
defaults: { _controller: ChamiloThemeBundle:Security:login } |
||||
login_check: |
||||
path: /login_check |
@ -0,0 +1,14 @@ |
||||
|
||||
{% for type in sonata_flashmessages_types() %} |
||||
{% set domain = domain is defined ? domain : null %} |
||||
{% for message in sonata_flashmessages_get(type, domain) %} |
||||
{% if type != 'no_layout' %} |
||||
<div class="alert alert-{{ type|sonata_status_class }} alert-dismissable"> |
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
||||
{{ message|raw }} |
||||
</div> |
||||
{% else %} |
||||
{{ message|raw }} |
||||
{% endif %} |
||||
{% endfor %} |
||||
{% endfor %} |
@ -0,0 +1,95 @@ |
||||
{#<footer {% block footer_open_attributes %}{% endblock footer_open_attributes %}>#} |
||||
{% autoescape false %} |
||||
<footer id="footer-section" class="sticky-footer bgfooter"> |
||||
<!-- start of #footer section --> |
||||
<div class="container"> |
||||
<div class="pre-footer"> |
||||
{% if plugin_pre_footer %} |
||||
<div id="plugin_pre_footer"> |
||||
{{ plugin_pre_footer }} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
<div class="sub-footer"> |
||||
<div class="row"> |
||||
<div class="col-md-4"> |
||||
{% if session_teachers is not null %} |
||||
<div class="session-teachers"> |
||||
{{ session_teachers }} |
||||
</div> |
||||
{% endif %} |
||||
{% if teachers is not null %} |
||||
<div class="teachers"> |
||||
{{ teachers }} |
||||
</div> |
||||
{% endif %} |
||||
{% if plugin_footer_left is not null %} |
||||
<div id="plugin_footer_left"> |
||||
{{ plugin_footer_left }} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
<div class="col-md-4"> |
||||
{% if plugin_footer_center is not null %} |
||||
<div id="plugin_footer_center"> |
||||
{{ plugin_footer_center }} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
<div class="col-md-4 text-right"> |
||||
{% if administrator_name is not null %} |
||||
<div class="administrator-name"> |
||||
{{ administrator_name }} |
||||
</div> |
||||
{% endif %} |
||||
<div class="software-name"> |
||||
<a href="{{_p.web}}" target="_blank"> |
||||
{{ "PoweredByX" |get_lang | format(_s.software_name) }} |
||||
</a>© {{ "now"|date("Y") }} |
||||
</div> |
||||
{% if plugin_footer_right is not null %} |
||||
<div id="plugin_footer_right"> |
||||
{{ plugin_footer_right }} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% if footer_extra_content is not null %} |
||||
<div class="extra-footer"> |
||||
{{ footer_extra_content }} |
||||
</div> |
||||
{% endif %} |
||||
</div><!-- end of #container --> |
||||
</footer> |
||||
{% endautoescape %} |
||||
{{ execution_stats }} |
||||
|
||||
<div class="modal fade" id="expand-image-modal" tabindex="-1" role="dialog" aria-labelledby="expand-image-modal-title" aria-hidden="true"> |
||||
<div class="modal-dialog modal-lg"> |
||||
<div class="modal-content"> |
||||
<div class="modal-header"> |
||||
<button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}"><span aria-hidden="true">×</span></button> |
||||
<h4 class="modal-title" id="expand-image-modal-title"> </h4> |
||||
</div> |
||||
<div class="modal-body"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{# Global modal, load content by AJAX call to href attribute on anchor tag with 'ajax' class #} |
||||
<div class="modal fade" id="global-modal" tabindex="-1" role="dialog" aria-labelledby="global-modal-title" aria-hidden="true"> |
||||
<div class="modal-dialog modal-lg"> |
||||
<div class="modal-content"> |
||||
<div class="modal-header"> |
||||
<button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}"> |
||||
<span aria-hidden="true">×</span> |
||||
</button> |
||||
<h4 class="modal-title" id="global-modal-title"> </h4> |
||||
</div> |
||||
<div class="modal-body"> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{{ footer_extra_content }} |
@ -0,0 +1,4 @@ |
||||
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %} |
||||
{% block title %} |
||||
{{- chamilo_settings_get('platform.site_name') -}} - Web theme |
||||
{% endblock %} |
@ -0,0 +1,4 @@ |
||||
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %} |
||||
|
||||
{#{% extends 'SonataPageBundle::base_layout.html.twig' %}#} |
||||
|
@ -0,0 +1,7 @@ |
||||
{# Just echo content #} |
||||
{% autoescape false %} |
||||
{% block content %} |
||||
{{ content }} |
||||
{% endblock %} |
||||
{% endautoescape %} |
||||
|
@ -0,0 +1,138 @@ |
||||
{% extends 'APYDataGridBundle::blocks.html.twig' %} |
||||
|
||||
{% block grid_actions %} |
||||
<div class="mass-actions"> |
||||
<div class="btn-group" role="group"> |
||||
<span class="grid_massactions_helper"> |
||||
<a class="btn btn-default" href="#" |
||||
onclick="return {{ grid.hash }}_markVisible(true);">{{ 'Select visible'|trans }}</a> |
||||
<a class="btn btn-default" href="#" |
||||
onclick="return {{ grid.hash }}_markVisible(false);">{{ 'Deselect visible'|trans }}</a> |
||||
<a class="btn btn-default" href="#" |
||||
onclick="return {{ grid.hash }}_markAll(true);">{{ 'Select all'|trans }}</a> |
||||
<a class="btn btn-default" href="#" |
||||
onclick="return {{ grid.hash }}_markAll(false);">{{ 'Deselect all'|trans }}</a> |
||||
<span class="mass-actions-selected" |
||||
id="{{ grid.hash }}_mass_action_selected"></span> |
||||
</span> |
||||
</div> |
||||
{% spaceless %} |
||||
<div style="float:right;" class="grid_massactions"> |
||||
{{ 'Action'|trans }} |
||||
<input type="hidden" id="{{ grid.hash }}_mass_action_all" |
||||
name="{{ grid.hash }}[{{ constant('APY\\DataGridBundle\\Grid\\Grid::REQUEST_QUERY_MASS_ACTION_ALL_KEYS_SELECTED') }}]" |
||||
value="0"/> |
||||
<select name="{{ grid.hash }}[{{ constant('APY\\DataGridBundle\\Grid\\Grid::REQUEST_QUERY_MASS_ACTION') }}]"> |
||||
<option value="-1"></option> |
||||
{% for key, massAction in grid.massActions %} |
||||
<option value="{{ key }}">{{ massAction.title|trans }}</option> |
||||
{% endfor %} |
||||
</select> |
||||
<input type="submit" value="{{ 'Submit Action'|trans }}"/> |
||||
</div> |
||||
{% endspaceless %} |
||||
</div> |
||||
{% endblock grid_actions %} |
||||
|
||||
{# Bootstrap changes #} |
||||
{% block grid_column_actions_cell %} |
||||
{% set actions = column.getActionsToRender(row) %} |
||||
<div class="btn-group"> |
||||
{% for action in actions %} |
||||
{% if action.attributes.form_delete is defined and action.attributes.form_delete %} |
||||
<div class="btn-group"> |
||||
<form method="post" action="{{ url(action.route, column.routeParameters(row, action), false) }}"> |
||||
<input type="hidden" name="_method" value="DELETE" /> |
||||
<button type="submit" class="btn btn-danger"> |
||||
{{ action.title|trans }} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
{% else %} |
||||
<a class="btn btn-default" href="{{ url(action.route, column.routeParameters(row, action), false) }}" target="{{ action.target }}"{% if action.confirm %} onclick="return confirm('{{ action.confirmMessage }}')"{% endif %}{% for name, value in action.attributes %} {{ name }}="{{ value }}" {% endfor %}> |
||||
{{ action.title|trans }} |
||||
</a> |
||||
{% endif %} |
||||
{% endfor %} |
||||
</div> |
||||
{% endblock grid_column_actions_cell %} |
||||
|
||||
{% block grid %} |
||||
<div class="col-md-10"> |
||||
<div class="box box-primary"> |
||||
<div class="box-body table-responsive no-padding"> |
||||
{% if grid.totalCount > 0 or grid.isFiltered or grid.noDataMessage is sameas(false) %} |
||||
<form id="{{ grid.hash }}" action="{{ grid.routeUrl }}" |
||||
method="post"> |
||||
<div class="grid_header"> |
||||
{% if grid.massActions|length > 0 %} |
||||
{{ grid_actions(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
<div class="grid_body"> |
||||
<table class="table table-bordered table-striped"> |
||||
{% if grid.isTitleSectionVisible %} |
||||
{{ grid_titles(grid) }} |
||||
{% endif %} |
||||
{% if grid.isFilterSectionVisible %} |
||||
{{ grid_filters(grid) }} |
||||
{% endif %} |
||||
{{ grid_rows(grid) }} |
||||
</table> |
||||
</div> |
||||
<div class="grid_footer"> |
||||
{% if grid.isPagerSectionVisible %} |
||||
{{ grid_pager(grid) }} |
||||
{% endif %} |
||||
{% if grid.exports|length > 0 %} |
||||
{{ grid_exports(grid) }} |
||||
{% endif %} |
||||
{% if grid.tweaks|length > 0 %} |
||||
{{ grid_tweaks(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
{% if withjs %} |
||||
{{ grid_scripts(grid) }} |
||||
{% endif %} |
||||
</form> |
||||
{% else %} |
||||
{{ grid_no_data(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock grid %} |
||||
|
||||
{% block grid_search %} |
||||
{% if grid.isFilterSectionVisible %} |
||||
<div class="col-md-2"> |
||||
<div class="box box-primary"> |
||||
<div class="box-header"> |
||||
<h4 class="box-title filter_legend inactive">Filters</h4> |
||||
</div> |
||||
|
||||
<div class="box-body"> |
||||
<form id="{{ grid.hash }}_search" |
||||
action="{{ grid.routeUrl }}" method="post"> |
||||
{% for column in grid.columns %} |
||||
{% if column.isFilterable and column.type not in ['actions', 'massaction'] %} |
||||
{% set columnTitle = grid.prefixTitle ~ column.title %} |
||||
<div class="{{ cycle(['odd', 'even'], loop.index) }}"> |
||||
<label>{{ columnTitle|trans }}</label>{{ grid_filter(column, grid, false)|raw }} |
||||
</div> |
||||
{% endif %} |
||||
{% endfor %} |
||||
<div class="grid-search-action"><input type="submit" |
||||
class="grid-search-submit" |
||||
value="{{ 'Search'|trans }}"/><input |
||||
type="button" class="grid-search-reset" |
||||
value="{{ 'Reset'|trans }}" |
||||
onclick="return {{ grid.hash }}_reset();"/> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
{% endif %} |
||||
{% endblock grid_search %} |
@ -0,0 +1,77 @@ |
||||
{% extends '@ChamiloTheme/Layout/base-layout.html.twig' %} |
||||
|
||||
{% block page_content %} |
||||
{% autoescape false %} |
||||
{% if js is defined %} |
||||
{% for item in js %} |
||||
{{ item }} |
||||
{% endfor %} |
||||
{% endif %} |
||||
|
||||
{% if plugin_main_top %} |
||||
<div id="plugin_main_top" class="col-md-12"> |
||||
{{ plugin_main_top }} |
||||
</div> |
||||
{% endif %} |
||||
{% if plugin_content_top %} |
||||
<div id="plugin_content_top" class="col-md-12"> |
||||
{{ plugin_content_top }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{% if show_course_shortcut is not null %} |
||||
<div class="nav-tools"> |
||||
{{ show_course_shortcut }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<section id="content-section"> |
||||
<div class="container"> |
||||
<div class="row"> |
||||
<div class="col-xs-12 col-md-12"> |
||||
{% autoescape false %} |
||||
|
||||
{# Breadcrumb #} |
||||
{% block chamilo_breadcrumb %} |
||||
{% include '@ChamiloCore/breadcrumb.html.twig' %} |
||||
{% endblock %} |
||||
|
||||
{% if actions != '' %} |
||||
<div class="actions"> |
||||
{{ actions }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{% block chamilo_messages %} |
||||
{% autoescape false %} |
||||
{% include '@ChamiloTheme/FlashMessage/render.html.twig' %} |
||||
{% endautoescape %} |
||||
{% endblock %} |
||||
|
||||
{# Content #} |
||||
{% block content %} |
||||
<section id="main_content"> |
||||
{{ content }} |
||||
</section> |
||||
{% endblock %} |
||||
{% endautoescape %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
|
||||
{% if plugin_content_bottom %} |
||||
<div id="plugin_content_bottom" class="col-md-12"> |
||||
{{ plugin_content_bottom }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{% if plugin_main_bottom %} |
||||
<div id="plugin_main_bottom" class="col-md-12"> |
||||
{{ plugin_main_bottom }} |
||||
</div> |
||||
{% endif %} |
||||
{% endautoescape %} |
||||
{% endblock %} |
||||
|
||||
|
@ -0,0 +1,20 @@ |
||||
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %} |
||||
|
||||
{% block chamilo_wrap %} |
||||
{% if js is defined %} |
||||
{% autoescape false %} |
||||
{% for item in js %} |
||||
{{ item }} |
||||
{% endfor %} |
||||
{% endautoescape %} |
||||
{% endif %} |
||||
{% block content %} |
||||
{% autoescape false %} |
||||
{{ content }} |
||||
{% endautoescape %} |
||||
{% endblock %} |
||||
{% endblock %} |
||||
|
||||
{# Some how twig does not override completely a block that used an "include" call #} |
||||
{% block chamilo_footer %} |
||||
{% endblock %} |
@ -0,0 +1,82 @@ |
||||
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %} |
||||
|
||||
{% set pathInfo = path( |
||||
app.request.attributes.get('_route'), |
||||
app.request.attributes.get('_route_params')) |
||||
%} |
||||
|
||||
{% block page_content %} |
||||
{% autoescape false %} |
||||
{% if plugin_main_top %} |
||||
<div id="plugin_main_top" class="col-md-12"> |
||||
{{ plugin_main_top }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{# Left column #} |
||||
<div class="col-md-3"> |
||||
{% if plugin_menu_top %} |
||||
<div id="plugin_menu_top"> |
||||
{{ plugin_menu_top }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{% block chamilo_left_column %} |
||||
<section class="left_column"> |
||||
{% if is_granted('IS_AUTHENTICATED_FULLY') %} |
||||
{# User avatar #} |
||||
{{ render(controller('ChamiloThemeBundle:Sidebar:userPanel', {'pathInfo': pathInfo })) }} |
||||
{% endif %} |
||||
|
||||
{# Login, Courses, Skills menu #} |
||||
{{ render(controller('ChamiloThemeBundle:Sidebar:leftMenu', {'request' : app.request, pathInfo: pathInfo })) }} |
||||
</section> |
||||
{% endblock %} |
||||
{% if plugin_menu_bottom %} |
||||
<div id="plugin_menu_bottom"> |
||||
{{ plugin_menu_bottom }} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
{# Right column #} |
||||
<div class="col-md-9"> |
||||
{% if plugin_content_top %} |
||||
<div id="plugin_content_top"> |
||||
{{ plugin_content_top }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{% block chamilo_breadcrumb %} |
||||
{% include '@ChamiloCore/breadcrumb.html.twig' %} |
||||
{% endblock %} |
||||
|
||||
{% block chamilo_messages %} |
||||
{# Flash messages #} |
||||
{% autoescape false %} |
||||
{% include '@ChamiloTheme/FlashMessage/render.html.twig' %} |
||||
{% endautoescape %} |
||||
{% endblock %} |
||||
|
||||
{% block chamilo_right_column %} |
||||
{% block content %} |
||||
<section class="right_column"> |
||||
{{ content }} |
||||
</section> |
||||
{% endblock %} |
||||
{% endblock %} |
||||
|
||||
{% if plugin_content_bottom %} |
||||
<div id="plugin_content_bottom"> |
||||
{{plugin_content_bottom}} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
|
||||
{% if plugin_main_bottom %} |
||||
<div id="plugin_main_bottom" class="col-md-12"> |
||||
{{ plugin_main_bottom }} |
||||
</div> |
||||
{% endif %} |
||||
{% endautoescape %} |
||||
{% endblock %} |
@ -0,0 +1,10 @@ |
||||
{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %} |
||||
{# overrides everything inside body no-footer no-header #} |
||||
{% block chamilo_wrap %} |
||||
{% autoescape false %} |
||||
{{ content }} |
||||
{% endautoescape %} |
||||
{% endblock %} |
||||
|
||||
{% block chamilo_footer %} |
||||
{% endblock %} |
@ -0,0 +1,70 @@ |
||||
<!-- Topbar --> |
||||
{% if show_toolbar == 1 %} |
||||
<nav id="toolbar-admin" class="navbar navbar-inverse"> |
||||
<div class="container-fluid"> |
||||
<div class="navbar-header"> |
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#toolbar"> |
||||
<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="{{ _p.web }}"> |
||||
<img src="{{ "icon-chamilo.png"|icon(22) }}" title="{{ "siteName" | get_setting }}"> |
||||
</a> |
||||
</div> |
||||
{% if is_granted('IS_AUTHENTICATED_FULLY') %} |
||||
<div class="collapse navbar-collapse" id="toolbar"> |
||||
<ul class="nav navbar-nav"> |
||||
<li class="active"><a href="{{ _p.web }}user_portal.php"> {{ "MyCourses"|get_lang }}</a></li> |
||||
<li class="dropdown"> |
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Tracking'|get_lang }}<b class="caret"></b></a> |
||||
<ul class="dropdown-menu"> |
||||
<li><a href="{{ _p.web_main }}mySpace/">{{ "CoursesReporting"|get_lang }}</a></li> |
||||
<li><a href="{{ _p.web_main }}mySpace/index.php?view=admin">{{ "AdminReports"|get_lang }}</a></li> |
||||
<li><a href="{{ _p.web_main }}tracking/exams.php">{{ "ExamsReporting"|get_lang }}</a></li> |
||||
<li class="divider"></li> |
||||
<li><a href="{{ _p.web_main }}dashboard/">{{ "Dashboard"|get_lang }}</a></li> |
||||
</ul> |
||||
</li> |
||||
{% if is_granted('ROLE_ADMIN') == 1 %} |
||||
<li class="dropdown"> |
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{'Administration'|get_lang }}<b class="caret"></b></a> |
||||
<ul class="dropdown-menu"> |
||||
<li><a href="{{ _p.web_main }}admin/">{{ "Home"|get_lang }}</a></li> |
||||
<li><a href="{{ _p.web_main }}admin/user_list.php">{{ "UserList"|get_lang }}</a></li> |
||||
<li><a href="{{ _p.web_main }}admin/course_list.php">{{ "CourseList"|get_lang }}</a></li> |
||||
<li><a href="{{ _p.web_main }}session/session_list.php">{{ "SessionList"|get_lang }}</a></li> |
||||
<li class="divider"></li> |
||||
<li><a href="{{ _p.web_main }}admin/settings.php">{{ "Settings"|get_lang }}</a></li> |
||||
<li class="divider"></li> |
||||
<li><a href="{{ _p.web_main }}admin/settings.php?category=Plugins">{{ "Plugins"|get_lang }}</a></li> |
||||
<li><a href="{{ _p.web_main }}admin/settings.php?category=Regions">{{ "Regions"|get_lang }}</a></li> |
||||
</ul> |
||||
</li> |
||||
|
||||
<li class="dropdown"> |
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ 'Add'|get_lang }}<b class="caret"></b></a> |
||||
<ul class="dropdown-menu"> |
||||
<li><a href="{{ _p.web_main }}admin/user_add.php">{{ "User"|get_lang }}</a></li> |
||||
<li><a href="{{ _p.web_main }}admin/course_add.php">{{ "Course"|get_lang }}</a></li> |
||||
<li><a href="{{ _p.web_main }}session/session_add.php">{{ "Session"|get_lang }}</a></li> |
||||
</ul> |
||||
</li> |
||||
{% endif %} |
||||
</ul> |
||||
|
||||
{% if is_granted('ROLE_ADMIN') == 1 %} |
||||
<form class="navbar-form navbar-left" role="search" action="{{ _p.web_main }}admin/user_list.php" method="get"> |
||||
<input type="text" class="form-control" placeholder="{{'SearchUsers'|get_lang }}" name="keyword"> |
||||
</form> |
||||
{% endif %} |
||||
|
||||
<ul class="nav navbar-nav navbar-right"> |
||||
<li><a href="{{ path('logout') }}">{{ "Logout"|get_lang }}</a></li> |
||||
</ul> |
||||
</div> <!-- /nav collapse --> |
||||
{% endif %} |
||||
</div> <!-- /container--> |
||||
</nav><!-- /topbar --> |
||||
{% endif %} |
@ -1,47 +1,34 @@ |
||||
<!-- User Account: style can be found in dropdown.less --> |
||||
{% import "ChamiloThemeBundle:Macros:image.html.twig" as macro_image %} |
||||
<li class="dropdown user user-menu"> |
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
||||
<i class="glyphicon glyphicon-user"></i> |
||||
<span>{{ user.username }} <i class="caret"></i></span> |
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> |
||||
<img class="img-circle" src="{{ asset(user.avatarOrAnonymous(32)) }}" alt="{{ user.completeName }}" /> |
||||
<span class="caret"></span> |
||||
</a> |
||||
<ul class="dropdown-menu"> |
||||
<!-- User image --> |
||||
<li class="user-header bg-light-blue"> |
||||
{{ macro_image.avatar(user.avatar, user.username) }} |
||||
<p> |
||||
{{ user.username }} |
||||
<small> |
||||
{{ 'Member since %date%'|trans({'%date%': user.memberSince|date('m.Y') }, 'ChamiloThemeBundle') }} |
||||
</small> |
||||
|
||||
<ul class="dropdown-menu" role="menu"> |
||||
<li class="user-header"> |
||||
<div class="text-center"> |
||||
<img class="img-circle" src="{{ asset(user.avatarOrAnonymous(64)) }}" alt="{{ user.completeName }}" /> |
||||
<p class="name"> |
||||
<a href="{{ url('main', { 'name' : 'social/home.php' })}}"> |
||||
{{ user.completeName }} |
||||
</a> |
||||
</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> |
||||
<p><i class="fa fa-envelope-o" aria-hidden="true"></i> {{ user.email }}</p> |
||||
</div> |
||||
</li> |
||||
#} |
||||
<!-- 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({}, 'ChamiloThemeBundle')}} |
||||
</a> |
||||
</div> |
||||
<div class="pull-right"> |
||||
<a href="{{ path('logout') }}" class="btn btn-default btn-flat"> |
||||
{{ 'Sign out'|trans({}, 'ChamiloThemeBundle') }} |
||||
</a> |
||||
</div> |
||||
<li role="separator" class="divider"></li> |
||||
<li class="user-body"> |
||||
<a title="{{ "Inbox"|trans }}" href="{{ url('main', { 'name' : 'messages/inbox.php' }) }}"> |
||||
<em class="fa fa-envelope" aria-hidden="true"></em> {{ "Inbox"|get_lang }} |
||||
</a> |
||||
<a title="{{ "MyCertificates"|trans }}" href="{{ url('main', { 'name' : 'gradebook/my_certificates.php' }) }}"> |
||||
<em class="fa fa-graduation-cap" aria-hidden="true"></em> {{ "MyCertificates"|get_lang }} |
||||
</a> |
||||
<a id="logout_button" title="{{ "Logout"|trans }}" href="{{ path('logout') }}" > |
||||
<em class="fa fa-sign-out"></em> {{ "Logout"|trans }} |
||||
</a> |
||||
</li> |
||||
</ul> |
||||
</li> |
||||
|
@ -0,0 +1,47 @@ |
||||
<!-- @todo add permissions for each menu sidebar menu: : style can be found in sidebar.less --> |
||||
{% import "ChamiloThemeBundle:Macros:box.html.twig" as macro %} |
||||
{% autoescape false %} |
||||
|
||||
{% if is_granted('IS_AUTHENTICATED_FULLY') %} |
||||
{{ macro.panel( |
||||
'Profile' | trans, |
||||
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:profileMenu', {'automenu': 'pills', 'stacked':true}) |
||||
) }} |
||||
|
||||
{{ macro.panel( |
||||
'Courses' | trans, |
||||
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:courseMenu', {'automenu': 'pills', 'stacked':true}) |
||||
) }} |
||||
|
||||
{{ macro.panel( |
||||
'Sessions' | trans, |
||||
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:sessionMenu', {'automenu': 'pills', 'stacked':true}) |
||||
) }} |
||||
|
||||
{{ macro.panel( |
||||
'Skills' | trans, |
||||
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:skillsMenu', {'automenu': 'pills', 'stacked':true}) |
||||
) }} |
||||
{% else %} |
||||
{# Plugin login before/after tpls #} |
||||
{% if plugin_login_top is not null %} |
||||
<div id="plugin_login_top"> |
||||
{{ plugin_login_top }} |
||||
</div> |
||||
{% endif %} |
||||
|
||||
{% include '@ChamiloTheme/Sidebar/login.html.twig' %} |
||||
|
||||
{% if plugin_login_bottom is not null %} |
||||
<div id="plugin_login_bottom"> |
||||
{{ plugin_login_bottom }} |
||||
</div> |
||||
{% endif %} |
||||
{% endif %} |
||||
|
||||
{{ macro.panel( |
||||
'Help' | trans, |
||||
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:helpMenu', {'automenu': 'pills', 'stacked':true}) |
||||
) }} |
||||
|
||||
{% endautoescape %} |
@ -0,0 +1,36 @@ |
||||
{{ locale_switcher(null, null, 'ChamiloCoreBundle:Admin:switcher_links.html.twig') }} |
||||
|
||||
<form class="form-horizontal" action="{{ path("sonata_user_admin_security_check") }}" method="post" name="formLogin" id="formLogin"> |
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/> |
||||
<fieldset> |
||||
<div class="input-group"> |
||||
<div class="input-group-addon"> |
||||
<em class="fa fa-user fa-fw"></em> |
||||
</div> |
||||
<input id="login" autofocus="autofocus" placeholder="{{ 'UserName' | trans }}" |
||||
autocapitalize="none" class="form-control" name="_username" |
||||
type="text"> |
||||
</div> |
||||
|
||||
<div class="input-group"> |
||||
<div class="input-group-addon"> |
||||
<em class="fa fa-lock fa-fw"></em> |
||||
</div> |
||||
<input id="password" placeholder="{{ 'Pass' | trans }}" autocapitalize="none" |
||||
class="form-control" name="_password" type="password"> |
||||
</div> |
||||
|
||||
<div class="input-group"> |
||||
<div class="checkbox"> |
||||
<label for="remember_me"> |
||||
<input type="checkbox" id="remember_me" name="_remember_me" value="on"/>{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }} |
||||
</label> |
||||
</div> |
||||
</div> |
||||
<button class="btn-block btn btn-primary " name="submitAuth" type="submit"> |
||||
{{ 'LoginEnter' | trans }} |
||||
</button> |
||||
</fieldset> |
||||
<input name="_qf__formLogin" type="hidden" value=""> |
||||
</form> |
||||
{{ mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:loginMenu', {'automenu': 'pills', 'stacked':true}) }} |
@ -0,0 +1,11 @@ |
||||
{% set pathInfo = path( |
||||
app.request.attributes.get('_route'), |
||||
app.request.attributes.get('_route_params')) |
||||
%} |
||||
|
||||
{# Profile block #} |
||||
{% if is_granted('IS_AUTHENTICATED_FULLY') %} |
||||
{{ render(controller('ChamiloThemeBundle:Sidebar:userPanel', {'pathInfo': pathInfo })) }} |
||||
{#{{ render(controller('ChamiloThemeBundle:Sidebar:searchForm')) }}#} |
||||
{{ render(controller('ChamiloThemeBundle:Sidebar:socialPanel', {'pathInfo': pathInfo })) }} |
||||
{% endif %} |
@ -0,0 +1,9 @@ |
||||
{% import "ChamiloThemeBundle:Macros:box.html.twig" as macro %} |
||||
{% import "ChamiloThemeBundle:Macros:image.html.twig" as macro_image %} |
||||
|
||||
{{ |
||||
macro.panel( |
||||
'SocialNetwork' | trans, |
||||
mopa_bootstrap_menu('ChamiloCoreBundle:LeftMenuBuilder:socialMenu', {'automenu': 'pills', 'stacked':true}) |
||||
) |
||||
}} |
@ -1,24 +1,23 @@ |
||||
{% import "ChamiloThemeBundle:Macros:box.html.twig" as macro %} |
||||
{% import "ChamiloThemeBundle:Macros:image.html.twig" as macro_image %} |
||||
<!-- Sidebar user panel --> |
||||
<div class="user-panel"> |
||||
<div class="pull-left image"> |
||||
<div style="text-align:center;" id="user_image_block" class="panel panel-default"> |
||||
<div class="panel-body"> |
||||
{% if user.avatar %} |
||||
{{ macro_image.avatar_from_media(user.avatar, user.username) }} |
||||
{% else %} |
||||
{{ macro_image.avatar('bundles/chamilocore/img/unknown.jpg', user.username) }} |
||||
{{ macro_image.avatar('img/icons/128/unknown.png', user.username) }} |
||||
{% endif %} |
||||
</div> |
||||
|
||||
<div class="pull-left info"> |
||||
<p>{{ 'Hello, %user%'| trans( {'%user%': user.username }, 'ChamiloThemeBundle') }}</p> |
||||
<a href="#"> |
||||
<i class="fa fa-circle text-success"></i> {{ 'Online' | trans }} |
||||
</a> |
||||
</div> |
||||
<p>{{ 'Hello, %user%'| trans( {'%user%': user.username }, 'ChamiloThemeBundle') }}</p> |
||||
<a href="#"> |
||||
<i class="fa fa-circle text-success"></i> {{ 'Online' | trans }} |
||||
</a> |
||||
|
||||
{% if is_granted('ROLE_PREVIOUS_ADMIN') %} |
||||
<a href="{{ path('home', {'_switch_user': '_exit'}) }}"> |
||||
{{ 'Exit impersonation' | trans }} |
||||
</a> |
||||
<a href="{{ path('home', {'_switch_user': '_exit'}) }}"> |
||||
{{ 'Exit impersonation' | trans }} |
||||
</a> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
|
@ -1,180 +0,0 @@ |
||||
<?php |
||||
/** |
||||
* DependencyResolver.php |
||||
* publisher |
||||
* Date: 18.04.14 |
||||
*/ |
||||
|
||||
namespace Chamilo\ThemeBundle\Util; |
||||
|
||||
|
||||
/** |
||||
* Class DependencyResolver |
||||
* |
||||
* @package Chamilo\ThemeBundle\Util |
||||
*/ |
||||
class DependencyResolver implements DependencyResolverInterface |
||||
{ |
||||
|
||||
/** |
||||
* @var array |
||||
*/ |
||||
protected $queued = array(); |
||||
/** |
||||
* @var array |
||||
*/ |
||||
protected $registered = array(); |
||||
/** |
||||
* @var array |
||||
*/ |
||||
protected $resolved = array(); |
||||
/** |
||||
* @var array |
||||
*/ |
||||
protected $unresolved = array(); |
||||
|
||||
|
||||
/** |
||||
* @param $items |
||||
* |
||||
* @return $this |
||||
*/ |
||||
public function register($items) |
||||
{ |
||||
$this->registered = $items; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* @return array |
||||
*/ |
||||
public function resolveAll() |
||||
{ |
||||
$this->failOnCircularDependencies(); |
||||
$this->resolve(array_keys($this->registered)); |
||||
|
||||
return $this->queued; |
||||
} |
||||
|
||||
/** |
||||
* @param $ids |
||||
*/ |
||||
protected function resolve($ids) |
||||
{ |
||||
foreach ($ids as $id) { |
||||
if (isset($this->resolved[$id])) { |
||||
continue; |
||||
} // already done |
||||
if (!isset($this->registered[$id])) { |
||||
continue; |
||||
} // unregistered |
||||
if (!$this->hasDependencies($id)) { // standalone |
||||
$this->queued[] = $this->registered[$id]; |
||||
$this->resolved[$id] = true; |
||||
|
||||
continue; |
||||
} |
||||
|
||||
$deps = $this->unresolved($this->getDependencies($id)); |
||||
|
||||
$this->resolve($deps); |
||||
|
||||
$deps = $this->unresolved($this->getDependencies($id)); |
||||
|
||||
if (empty($deps)) { |
||||
$this->queued[] = $this->registered[$id]; |
||||
$this->resolved[$id] = true; |
||||
|
||||
continue; |
||||
} |
||||
} |
||||
|
||||
} |
||||
|
||||
/** |
||||
* @param $deps |
||||
* |
||||
* @return array |
||||
*/ |
||||
protected function unresolved($deps) |
||||
{ |
||||
return array_diff($deps, array_keys($this->resolved)); |
||||
} |
||||
|
||||
/** |
||||
* @param $id |
||||
* |
||||
* @return bool |
||||
*/ |
||||
protected function hasDependencies($id) |
||||
{ |
||||
if (!isset($this->registered[$id])) { |
||||
return false; |
||||
} |
||||
|
||||
return (!empty($this->registered[$id]['deps'])); |
||||
} |
||||
|
||||
/** |
||||
* @param $id |
||||
* |
||||
* @return null |
||||
*/ |
||||
protected function getDependencies($id) |
||||
{ |
||||
if (!$this->hasDependencies($id)) { |
||||
return null; |
||||
} |
||||
|
||||
return $this->registered[$id]['deps']; |
||||
} |
||||
|
||||
/** |
||||
* @param $needle |
||||
* @param $haystackId |
||||
* |
||||
* @return bool |
||||
*/ |
||||
protected function contains($needle, $haystackId) |
||||
{ |
||||
$deps = $this->getDependencies($haystackId); |
||||
if (!is_array($deps)) { |
||||
return false; |
||||
} |
||||
|
||||
return in_array($needle, $deps); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* @throws \RuntimeException |
||||
*/ |
||||
protected function failOnCircularDependencies() |
||||
{ |
||||
$ids = array_keys($this->registered); |
||||
|
||||
foreach ($ids as $id) { |
||||
|
||||
if (!$this->hasDependencies($id)) { |
||||
continue; |
||||
} |
||||
|
||||
$dependencies = $this->getDependencies($id); |
||||
|
||||
foreach ($dependencies as $dep) { |
||||
if ($this->contains($id, $dep)) { |
||||
throw new \RuntimeException( |
||||
sprintf( |
||||
'Circular dependency [%s] depends on [%s] which itself depends on [%s]', |
||||
$id, $dep, $id |
||||
) |
||||
); |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue