Minor - format code, fix php docs

pull/2487/head
jmontoyaa 8 years ago
parent 5f48b8f811
commit ffcddf6202
  1. 3
      main/admin/skill_edit.php
  2. 1
      main/admin/skills_profile.php
  3. 4
      main/forum/download.php
  4. 5
      main/forum/editpost.php
  5. 34
      main/group/group_edit.php
  6. 21
      main/group/group_overview.php
  7. 15
      main/group/group_space.php
  8. 18
      main/group/member_settings.php
  9. 14
      main/group/settings.php
  10. 1
      main/inc/lib/formvalidator/Element/DateTimePicker.php
  11. 2
      main/inc/lib/formvalidator/Rule/CompareDateTimeText.php
  12. 2
      main/inc/lib/formvalidator/Rule/DateCompare.php
  13. 2
      main/inc/lib/formvalidator/Rule/Filetype.php
  14. 6
      main/inc/lib/formvalidator/Rule/HTML.php
  15. 1
      main/inc/lib/formvalidator/Rule/MaxFileSize.php
  16. 4
      main/inc/lib/formvalidator/Rule/MobilePhoneNumber.php
  17. 28
      main/inc/lib/formvalidator/Rule/MultipleRequired.php
  18. 1
      main/inc/lib/formvalidator/Rule/UploadFile.php
  19. 1
      main/inc/lib/formvalidator/Rule/Url.php
  20. 3
      main/inc/lib/formvalidator/Rule/UsernameAvailable.php
  21. 2
      main/inc/lib/hook/interfaces/HookResubscribeObserverInterface.php
  22. 4
      main/inc/lib/pear/HTML/QuickForm/Rule.php
  23. 1
      main/session/add_many_session_to_category.php
  24. 19
      main/social/group_view.php
  25. 1
      main/social/group_waiting_list.php
  26. 81
      main/social/groups.php
  27. 10
      main/social/home.php
  28. 1
      main/social/message_for_group_form.inc.php
  29. 1
      main/social/profile.php
  30. 1
      main/social/profile_friends_and_groups.inc.php
  31. 2
      main/ticket/categories.php
  32. 4
      main/ticket/report.php
  33. 2
      main/ticket/status.php
  34. 1
      main/ticket/tutor_report.lib.php
  35. 10
      main/work/download.php
  36. 13
      main/work/download_comment_file.php
  37. 9
      main/work/downloadfolder.inc.php
  38. 12
      main/work/show_file.php
  39. 34
      main/work/work.lib.php
  40. 3
      plugin/hello_world/plugin.php
  41. 2
      plugin/openmeetings/start.php
  42. 5
      plugin/resubscription/src/HookResubscription.php
  43. 2
      plugin/resubscription/src/Resubscription.php
  44. 23
      plugin/search_course/lib/register_course_widget.class.php
  45. 7
      plugin/search_course/lib/search_course_plugin.class.php
  46. 14
      plugin/sepe/src/configuration.php
  47. 1
      plugin/tour/ajax/steps.ajax.php
  48. 11
      src/Chamilo/CoreBundle/Entity/Notification.php
  49. 1
      src/Chamilo/CoreBundle/Entity/Repository/ExtraFieldRelTagRepository.php
  50. 1
      src/Chamilo/CoreBundle/Entity/Repository/SequenceRepository.php
  51. 1
      src/Chamilo/CoreBundle/Entity/Repository/SessionRepository.php
  52. 1
      src/Chamilo/CoreBundle/Entity/Repository/SkillRepository.php
  53. 1
      src/Chamilo/CoreBundle/Entity/Repository/TemplatesRepository.php
  54. 4
      src/Chamilo/CoreBundle/Entity/Repository/TrackECourseAccessRepository.php
  55. 5
      src/Chamilo/CoreBundle/Entity/SettingsCurrent.php
  56. 4
      src/Chamilo/CoreBundle/Entity/SpecificField.php
  57. 5
      src/Chamilo/CourseBundle/DependencyInjection/Configuration.php
  58. 1
      src/Chamilo/SkillBundle/Entity/Profile.php
  59. 6
      src/Chamilo/ThemeBundle/Controller/BreadcrumbController.php
  60. 24
      src/Chamilo/ThemeBundle/Controller/DefaultController.php
  61. 9
      src/Chamilo/ThemeBundle/Controller/ExceptionController.php
  62. 7
      src/Chamilo/ThemeBundle/Controller/NavbarController.php
  63. 13
      src/Chamilo/ThemeBundle/Controller/SecurityController.php
  64. 6
      src/Chamilo/ThemeBundle/Controller/SidebarController.php
  65. 22
      src/Chamilo/ThemeBundle/Controller/WidgetController.php
  66. 262
      src/Chamilo/ThemeBundle/DependencyInjection/ChamiloAdminThemeExtension.php
  67. 4
      src/Chamilo/ThemeBundle/DependencyInjection/Configuration.php
  68. 9
      src/Chamilo/ThemeBundle/Event/MessageListEvent.php
  69. 10
      src/Chamilo/ThemeBundle/Event/NotificationListEvent.php
  70. 6
      src/Chamilo/ThemeBundle/Event/ShowUserEvent.php
  71. 17
      src/Chamilo/ThemeBundle/Event/SidebarMenuEvent.php
  72. 1
      src/Chamilo/ThemeBundle/Event/SidebarMenuKnpEvent.php
  73. 11
      src/Chamilo/ThemeBundle/Event/TaskListEvent.php
  74. 6
      src/Chamilo/ThemeBundle/Event/ThemeEvent.php
  75. 6
      src/Chamilo/ThemeBundle/Event/ThemeEvents.php
  76. 12
      src/Chamilo/ThemeBundle/EventListener/ContextListener.php
  77. 12
      src/Chamilo/ThemeBundle/EventListener/NavbarMessageListDemoListener.php
  78. 12
      src/Chamilo/ThemeBundle/EventListener/NavbarNotificationListDemoListener.php
  79. 11
      src/Chamilo/ThemeBundle/EventListener/NavbarShowUserDemoListener.php
  80. 11
      src/Chamilo/ThemeBundle/EventListener/NavbarTaskListDemoListener.php
  81. 11
      src/Chamilo/ThemeBundle/EventListener/SetupThemeListener.php
  82. 13
      src/Chamilo/ThemeBundle/EventListener/SidebarSetupMenuDemoListener.php
  83. 10
      src/Chamilo/ThemeBundle/Form/FormDemoModelType.php
  84. 15
      src/Chamilo/ThemeBundle/Helper/WidgetHelper.php
  85. 4
      src/Chamilo/ThemeBundle/Model/MenuItemInterface.php
  86. 1
      src/Chamilo/ThemeBundle/Model/MenuItemModel.php
  87. 1
      src/Chamilo/ThemeBundle/Model/MessageInterface.php
  88. 1
      src/Chamilo/ThemeBundle/Model/MessageModel.php
  89. 10
      src/Chamilo/ThemeBundle/Model/NotificationInterface.php
  90. 18
      src/Chamilo/ThemeBundle/Model/NotificationModel.php
  91. 14
      src/Chamilo/ThemeBundle/Model/TaskInterface.php
  92. 8
      src/Chamilo/ThemeBundle/Model/TaskModel.php
  93. 11
      src/Chamilo/ThemeBundle/Model/UserInterface.php
  94. 15
      src/Chamilo/ThemeBundle/Model/UserModel.php
  95. 11
      src/Chamilo/ThemeBundle/Util/DependencyResolverInterface.php

@ -78,7 +78,8 @@ $extraField = new ExtraField('skill');
$returnParams = $extraField->addElements($editForm, $skillId); $returnParams = $extraField->addElements($editForm, $skillId);
$jquery_ready_content = $returnParams['jquery_ready_content']; $jquery_ready_content = $returnParams['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function // the $jquery_ready_content variable collects all functions that will be load
// in the $(document).ready javascript function
if (!empty($jquery_ready_content)) { if (!empty($jquery_ready_content)) {
$htmlHeadXtra[] = '<script> $htmlHeadXtra[] = '<script>
$(document).ready(function(){ $(document).ready(function(){

@ -47,7 +47,6 @@ if ($form->validate()) {
$skills = array_filter($skills); $skills = array_filter($skills);
$skills = array_unique($skills); $skills = array_unique($skills);
Session::write('skills', $skills); Session::write('skills', $skills);
} else { } else {
$skills = Session::read('skills', []); $skills = Session::read('skills', []);
} }

@ -89,8 +89,8 @@ $forum_forum_visibility = api_get_item_visibility(
if ($forum_thread_visibility == 1 && $forum_forum_visibility == 1) { if ($forum_thread_visibility == 1 && $forum_forum_visibility == 1) {
if (Security::check_abs_path( if (Security::check_abs_path(
$full_file_name, $full_file_name,
api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/upload/forum/') api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/upload/forum/'
) { )) {
DocumentManager::file_send_for_download( DocumentManager::file_send_for_download(
$full_file_name, $full_file_name,
true, true,

@ -88,7 +88,10 @@ if ($origin == 'group') {
); );
$interbreadcrumb[] = array('url' => 'javascript: void (0);', 'name' => get_lang('EditPost')); $interbreadcrumb[] = array('url' => 'javascript: void (0);', 'name' => get_lang('EditPost'));
} else { } else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools); $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(),
'name' => $nameTools,
);
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'].'&'.api_get_cidreq(), 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'].'&'.api_get_cidreq(),
'name' => prepare4display($current_forum_category['cat_title']) 'name' => prepare4display($current_forum_category['cat_title'])

@ -2,13 +2,13 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This script displays an area where teachers can edit the group properties and member list. * This script displays an area where teachers can edit the group properties and member list.
* Groups are also often called "teams" in the Dokeos code. * Groups are also often called "teams" in the Dokeos code.
* *
* @author various contributors * @author various contributors
* @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support * @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support
* @package chamilo.group * @package chamilo.group
* @todo course admin functionality to create groups based on who is in which course (or class). * @todo course admin functionality to create groups based on who is in which course (or class).
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
@ -19,7 +19,7 @@ $current_course_tool = TOOL_GROUP;
api_protect_course_script(true); api_protect_course_script(true);
$group_id = api_get_group_id(); $group_id = api_get_group_id();
$current_group = GroupManager :: get_group_properties($group_id); $current_group = GroupManager::get_group_properties($group_id);
$nameTools = get_lang('EditGroup'); $nameTools = get_lang('EditGroup');
$interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); $interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
@ -172,12 +172,12 @@ foreach ($group_member_list as $index => $user) {
// possible : number_groups_left > 0 and is group member // possible : number_groups_left > 0 and is group member
$possible_users = array(); $possible_users = array();
foreach ($complete_user_list as $index => $user) { foreach ($complete_user_list as $index => $user) {
if ($user['number_groups_left'] > 0 || in_array($user['user_id'], $selected_users)) { if ($user['number_groups_left'] > 0 || in_array($user['user_id'], $selected_users)) {
$possible_users[$user['user_id']] = api_get_person_name( $possible_users[$user['user_id']] = api_get_person_name(
$user['firstname'], $user['firstname'],
$user['lastname'] $user['lastname']
).' ('.$user['username'].')'; ).' ('.$user['username'].')';
} }
} }
$group_members_element = $form->addElement( $group_members_element = $form->addElement(
@ -341,15 +341,15 @@ if ($form->validate()) {
); );
// Storing the tutors (we first remove all the tutors and then add only those who were selected) // Storing the tutors (we first remove all the tutors and then add only those who were selected)
GroupManager :: unsubscribe_all_tutors($current_group['iid']); GroupManager::unsubscribe_all_tutors($current_group['iid']);
if (isset($_POST['group_tutors']) && count($_POST['group_tutors']) > 0) { if (isset($_POST['group_tutors']) && count($_POST['group_tutors']) > 0) {
GroupManager :: subscribe_tutors($values['group_tutors'], $current_group); GroupManager::subscribe_tutors($values['group_tutors'], $current_group);
} }
// Storing the users (we first remove all users and then add only those who were selected) // Storing the users (we first remove all users and then add only those who were selected)
GroupManager :: unsubscribe_all_users($current_group); GroupManager::unsubscribe_all_users($current_group);
if (isset($_POST['group_members']) && count($_POST['group_members']) > 0) { if (isset($_POST['group_members']) && count($_POST['group_members']) > 0) {
GroupManager :: subscribe_users($values['group_members'], $current_group); GroupManager::subscribe_users($values['group_members'], $current_group);
} }
// Returning to the group area (note: this is inconsistent with the rest of chamilo) // Returning to the group area (note: this is inconsistent with the rest of chamilo)

@ -2,16 +2,16 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Main page for the group module. * Main page for the group module.
* This script displays the general group settings, * This script displays the general group settings,
* and a list of groups with buttons to view, edit... * and a list of groups with buttons to view, edit...
* *
* @author Thomas Depraetere, Hugues Peeters, Christophe Gesche: initial versions * @author Thomas Depraetere, Hugues Peeters, Christophe Gesche: initial versions
* @author Bert Vanderkimpen, improved self-unsubscribe for cvs * @author Bert Vanderkimpen, improved self-unsubscribe for cvs
* @author Patrick Cool, show group comment under the group name * @author Patrick Cool, show group comment under the group name
* @author Roan Embrechts, initial self-unsubscribe code, code cleaning, virtual course support * @author Roan Embrechts, initial self-unsubscribe code, code cleaning, virtual course support
* @author Bart Mollet, code cleaning, use of Display-library, list of courseAdmin-tools, use of GroupManager * @author Bart Mollet, code cleaning, use of Display-library, list of courseAdmin-tools, use of GroupManager
* @package chamilo.group * @package chamilo.group
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
@ -44,9 +44,7 @@ if (isset($_GET['action'])) {
break; break;
case 'export': case 'export':
$groupId = isset($_GET['id']) ? intval($_GET['id']) : null; $groupId = isset($_GET['id']) ? intval($_GET['id']) : null;
$data = GroupManager::exportCategoriesAndGroupsToArray($groupId, true); $data = GroupManager::exportCategoriesAndGroupsToArray($groupId, true);
switch ($_GET['type']) { switch ($_GET['type']) {
case 'csv': case 'csv':
Export::arrayToCsv($data); Export::arrayToCsv($data);
@ -113,7 +111,6 @@ Display::return_icon('user.png', get_lang('GoTo').' '.get_lang('Users'), '', ICO
// Action links // Action links
echo Display::toolbarAction('actions', [$actions, GroupManager::getSearchForm()]); echo Display::toolbarAction('actions', [$actions, GroupManager::getSearchForm()]);
echo GroupManager::getOverview($courseId, $keyword); echo GroupManager::getOverview($courseId, $keyword);
if ($origin != 'learnpath') { if ($origin != 'learnpath') {

@ -6,7 +6,7 @@
* a list of users in the group, subscribe or unsubscribe option, tutors... * a list of users in the group, subscribe or unsubscribe option, tutors...
* *
* @package chamilo.group * @package chamilo.group
* @todo Display error message if no group ID specified * @todo Display error message if no group ID specified
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
@ -43,14 +43,13 @@ if (!GroupManager::userHasAccessToBrowse($user_id, $current_group, api_get_sessi
} }
/* Actions and Action links */ /* Actions and Action links */
/* /*
* User wants to register in this group * User wants to register in this group
*/ */
if (!empty($_GET['selfReg']) && if (!empty($_GET['selfReg']) &&
GroupManager :: is_self_registration_allowed($user_id, $current_group) GroupManager :: is_self_registration_allowed($user_id, $current_group)
) { ) {
GroupManager :: subscribe_users($user_id, $current_group); GroupManager::subscribe_users($user_id, $current_group);
Display::addFlash(Display::return_message(get_lang('GroupNowMember'), 'normal')); Display::addFlash(Display::return_message(get_lang('GroupNowMember'), 'normal'));
} }
@ -234,14 +233,18 @@ if (api_is_allowed_to_edit(false, true) ||
$actions_array = array(); $actions_array = array();
// Link to the forum of this group // Link to the forum of this group
$forums_of_groups = get_forums_of_group($current_group); $forums_of_groups = get_forums_of_group($current_group);
if (is_array($forums_of_groups)) { if (is_array($forums_of_groups)) {
if ($current_group['forum_state'] == GroupManager::TOOL_PUBLIC) { if ($current_group['forum_state'] == GroupManager::TOOL_PUBLIC) {
foreach ($forums_of_groups as $key => $value) { foreach ($forums_of_groups as $key => $value) {
if ($value['forum_group_public_private'] == 'public') { if ($value['forum_group_public_private'] == 'public') {
$actions_array[] = array( $actions_array[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?cidReq='.api_get_course_id().'&forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&origin=group', 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?cidReq='.api_get_course_id().'&forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&origin=group',
'content' => Display::return_icon('forum.png', get_lang('GroupForum'), array(), ICON_SIZE_MEDIUM) 'content' => Display::return_icon(
'forum.png',
get_lang('GroupForum'),
array(),
ICON_SIZE_MEDIUM
),
); );
} }
} }
@ -520,7 +523,7 @@ function get_group_user_data($from, $number_of_items, $column, $direction)
*/ */
function email_filter($email) function email_filter($email)
{ {
return Display :: encrypted_mailto_link($email, $email); return Display::encrypted_mailto_link($email, $email);
} }
/** /**

@ -2,13 +2,13 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This script displays an area where teachers can edit the group properties and member list. * This script displays an area where teachers can edit the group properties and member list.
* Groups are also often called "teams" in the Dokeos code. * Groups are also often called "teams" in the Dokeos code.
* *
* @author various contributors * @author various contributors
* @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support * @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support
* @package chamilo.group * @package chamilo.group
* @todo course admin functionality to create groups based on who is in which course (or class). * @todo course admin functionality to create groups based on who is in which course (or class).
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
@ -191,10 +191,8 @@ $form->addButtonSave(get_lang('SaveSettings'));
if ($form->validate()) { if ($form->validate()) {
$values = $form->exportValues(); $values = $form->exportValues();
// Storing the users (we first remove all users and then add only those who were selected) // Storing the users (we first remove all users and then add only those who were selected)
GroupManager:: unsubscribe_all_users($current_group); GroupManager:: unsubscribe_all_users($current_group);
if (isset($_POST['group_members']) && count($_POST['group_members']) > 0) { if (isset($_POST['group_members']) && count($_POST['group_members']) > 0) {
GroupManager:: subscribe_users( GroupManager:: subscribe_users(
$values['group_members'], $values['group_members'],
@ -228,7 +226,6 @@ switch ($action) {
} }
$defaults = $current_group; $defaults = $current_group;
$defaults['group_members'] = $selected_users; $defaults['group_members'] = $selected_users;
$action = isset($_GET['action']) ? $_GET['action'] : ''; $action = isset($_GET['action']) ? $_GET['action'] : '';
$defaults['action'] = $action; $defaults['action'] = $action;
@ -242,7 +239,6 @@ Display::display_header($nameTools, 'Group');
$form->setDefaults($defaults); $form->setDefaults($defaults);
echo GroupManager::getSettingBar('member'); echo GroupManager::getSettingBar('member');
$form->display(); $form->display();
Display :: display_footer(); Display::display_footer();

@ -2,14 +2,13 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This script displays an area where teachers can edit the group properties and member list. * This script displays an area where teachers can edit the group properties and member list.
* *
* @author various contributors * @author various contributors
* @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support * @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support
* @package chamilo.group * @package chamilo.group
* @todo course admin functionality to create groups based on who is in which course (or class). * @todo course admin functionality to create groups based on who is in which course (or class).
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP; $current_course_tool = TOOL_GROUP;
@ -170,7 +169,8 @@ $group = array(
$form->addGroup( $form->addGroup(
$group, $group,
'', '',
Display::return_icon('wiki.png', get_lang('GroupWiki')).'<span>'.get_lang('GroupWiki').'</span>', '', Display::return_icon('wiki.png', get_lang('GroupWiki')).'<span>'.get_lang('GroupWiki').'</span>',
'',
false false
); );

@ -202,5 +202,4 @@ class DateTimePicker extends HTML_QuickForm_text
break; break;
} }
} }
} }

@ -11,7 +11,7 @@ class HTML_QuickForm_Rule_CompareDateTimeText extends HTML_QuickForm_Rule_Compar
* @param string $operator The operator to use (default '==') * @param string $operator The operator to use (default '==')
* @return boolean True if the 2 given dates match the operator * @return boolean True if the 2 given dates match the operator
*/ */
function validate($values, $operator = null) public function validate($values, $operator = null)
{ {
$datetime1 = api_strtotime($values[0]); $datetime1 = api_strtotime($values[0]);
$datetime2 = api_strtotime($values[1]); $datetime2 = api_strtotime($values[1]);

@ -14,7 +14,7 @@ class HTML_QuickForm_Rule_DateCompare extends HTML_QuickForm_Rule_Compare
* *
* @return boolean true if the 2 given dates match the operator * @return boolean true if the 2 given dates match the operator
*/ */
function validate($values, $operator = null) public function validate($values, $operator = null)
{ {
return api_strtotime($values[0]) < api_strtotime($values[1]); return api_strtotime($values[0]) < api_strtotime($values[1]);
} }

@ -15,7 +15,7 @@ class HTML_QuickForm_Rule_Filetype extends HTML_QuickForm_Rule
* *
* @return boolean True if filetype is allowed * @return boolean True if filetype is allowed
*/ */
function validate($file, $extensions = array()) public function validate($file, $extensions = array())
{ {
$parts = explode('.', $file['name']); $parts = explode('.', $file['name']);
if (count($parts) < 2) { if (count($parts) < 2) {

@ -14,10 +14,11 @@ class HTML_QuickForm_Rule_HTML extends HTML_QuickForm_Rule
* @param string $html * @param string $html
* @return boolean True if html is valid * @return boolean True if html is valid
*/ */
function validate($html, $mode = NO_HTML) public function validate($html, $mode = NO_HTML)
{ {
$allowed_tags = self::get_allowed_tags($mode, $fullpage); $allowed_tags = self::get_allowed_tags($mode, $fullpage);
$cleaned_html = kses($html, $allowed_tags); $cleaned_html = kses($html, $allowed_tags);
return $html == $cleaned_html; return $html == $cleaned_html;
} }
@ -33,8 +34,7 @@ class HTML_QuickForm_Rule_HTML extends HTML_QuickForm_Rule
// Include the allowed tags. // Include the allowed tags.
//include __DIR__.'/allowed_tags.inc.php'; //include __DIR__.'/allowed_tags.inc.php';
global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page; global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;
switch ($mode) switch ($mode) {
{
case NO_HTML: case NO_HTML:
return array(); return array();
break; break;

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** @author Julio Montoya */ /** @author Julio Montoya */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */
/** /**
* Abstract base class for QuickForm validation rules * Abstract base class for QuickForm validation rules
@ -10,7 +11,6 @@
*/ */
class HTML_QuickForm_Rule_Mobile_Phone_Number extends HTML_QuickForm_Rule class HTML_QuickForm_Rule_Mobile_Phone_Number extends HTML_QuickForm_Rule
{ {
/** /**
* Validates mobile phone number * Validates mobile phone number
* *
@ -18,7 +18,7 @@ class HTML_QuickForm_Rule_Mobile_Phone_Number extends HTML_QuickForm_Rule
* @param string Not using it. Just to respect the declaration * @param string Not using it. Just to respect the declaration
* @return boolean Returns true if valid, false otherwise. * @return boolean Returns true if valid, false otherwise.
*/ */
function validate($mobilePhoneNumber, $options = null) public function validate($mobilePhoneNumber, $options = null)
{ {
$rule = "/^\d{11}$/"; $rule = "/^\d{11}$/";
return preg_match($rule, $mobilePhoneNumber); return preg_match($rule, $mobilePhoneNumber);

@ -12,35 +12,33 @@
// +----------------------------------------------------------------------+ // +----------------------------------------------------------------------+
/** /**
* Required elements validation * Required elements validation
* @version 1.0 * @version 1.0
*/ */
class HTML_QuickForm_Rule_MultipleRequired extends HTML_QuickForm_Rule class HTML_QuickForm_Rule_MultipleRequired extends HTML_QuickForm_Rule
{ {
/** /**
* Checks if all the elements are empty * Checks if all the elements are empty
* *
* @param string $value Value to check (can be an array) * @param string $value Value to check (can be an array)
* @param mixed $options Not used yet * @param mixed $options Not used yet
* @access public * @access public
* @return boolean true if value is not empty * @return boolean true if value is not empty
*/ */
function validate($value, $options = null) public function validate($value, $options = null)
{ {
if (is_array($value)) if (is_array($value)) {
{ $value = implode(null, $value);
$value = implode(null, $value); }
} if ((string)$value == '') {
if ((string) $value == '') {
return false; return false;
} }
return true; return true;
} // end func validate } // end func validate
function getValidationScript($options = null) function getValidationScript($options = null)
{ {
return array('', "{jsVar} == ''"); return array('', "{jsVar} == ''");
} // end func getValidationScript }
}
} // end class HTML_QuickForm_Rule_MultipleRequired

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** @author Julio Montoya */ /** @author Julio Montoya */
/** /**

@ -20,6 +20,5 @@ class HTML_QuickForm_Rule_Url extends HTML_QuickForm_Rule
{ {
return (bool) filter_var($url, FILTER_VALIDATE_URL); return (bool) filter_var($url, FILTER_VALIDATE_URL);
} }
} }

@ -13,7 +13,8 @@ class HTML_QuickForm_Rule_UsernameAvailable extends HTML_QuickForm_Rule
* @param string $current_username * @param string $current_username
* @return boolean True if username is available * @return boolean True if username is available
*/ */
function validate($username, $current_username = null) { public function validate($username, $current_username = null)
{
$user_table = Database::get_main_table(TABLE_MAIN_USER); $user_table = Database::get_main_table(TABLE_MAIN_USER);
$username = Database::escape_string($username); $username = Database::escape_string($username);
$current_username = Database::escape_string($current_username); $current_username = Database::escape_string($current_username);

@ -12,7 +12,7 @@
interface HookResubscribeObserverInterface extends HookObserverInterface interface HookResubscribeObserverInterface extends HookObserverInterface
{ {
/** /**
* @param HookResubscribeObserverInterface $hook * @param HookResubscribeEventInterface $hook
* *
* @return int * @return int
*/ */

@ -49,7 +49,7 @@ class HTML_QuickForm_Rule
* @access public * @access public
* @abstract * @abstract
*/ */
function validate($value, $options) public function validate($value, $options)
{ {
return true; return true;
} }
@ -60,7 +60,7 @@ class HTML_QuickForm_Rule
* @param string rule name * @param string rule name
* @access public * @access public
*/ */
function setName($ruleName) public function setName($ruleName)
{ {
$this->name = $ruleName; $this->name = $ruleName;
} }

@ -127,7 +127,6 @@ Display::display_header($tool_name);
$where = ''; $where = '';
$rows_category_session = array(); $rows_category_session = array();
if ((isset($_POST['CategorySessionId']) && $_POST['formSent'] == 0) || isset($_GET['id_category'])) { if ((isset($_POST['CategorySessionId']) && $_POST['formSent'] == 0) || isset($_GET['id_category'])) {
$where = 'WHERE session_category_id != '.$categoryId.' OR session_category_id IS NULL'; $where = 'WHERE session_category_id != '.$categoryId.' OR session_category_id IS NULL';
$sql = 'SELECT id, name FROM '.$tbl_session.' WHERE session_category_id ='.$categoryId.' ORDER BY name'; $sql = 'SELECT id, name FROM '.$tbl_session.' WHERE session_category_id ='.$categoryId.' ORDER BY name';
$result = Database::query($sql); $result = Database::query($sql);

@ -172,9 +172,10 @@ if (!$is_group_member && $group_info['visibility'] == GROUP_PERMISSION_CLOSED) {
if ($is_group_member || $group_info['visibility'] == GROUP_PERMISSION_OPEN) { if ($is_group_member || $group_info['visibility'] == GROUP_PERMISSION_OPEN) {
if (!$is_group_member) { if (!$is_group_member) {
if (!in_array($role, if (!in_array(
array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER, GROUP_USER_PERMISSION_PENDING_INVITATION)) $role,
) { array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER, GROUP_USER_PERMISSION_PENDING_INVITATION)
)) {
$social_right_content .= '<div class="group-tool">'; $social_right_content .= '<div class="group-tool">';
$social_right_content .= '<div class="pull-right">'; $social_right_content .= '<div class="pull-right">';
$social_right_content .= '<a class="btn btn-default btn-sm" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'. $social_right_content .= '<a class="btn btn-default btn-sm" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.
@ -253,7 +254,7 @@ if ($is_group_member || $group_info['visibility'] == GROUP_PERMISSION_OPEN) {
$member_content .= Display::url( $member_content .= Display::url(
Display::returnFontAwesomeIcon('pencil').' '.get_lang('EditMembersList'), Display::returnFontAwesomeIcon('pencil').' '.get_lang('EditMembersList'),
'group_members.php?id='.$group_id, 'group_members.php?id='.$group_id,
array('class'=>'btn btn-default btn-sm', 'title' => get_lang('EditMembersList')) array('class' => 'btn btn-default btn-sm', 'title' => get_lang('EditMembersList'))
); );
$member_content .= '</div>'; $member_content .= '</div>';
$member_content .= '</div>'; $member_content .= '</div>';
@ -262,9 +263,10 @@ if ($is_group_member || $group_info['visibility'] == GROUP_PERMISSION_OPEN) {
$member_content .= '<div class="row">'; $member_content .= '<div class="row">';
foreach ($members as $member) { foreach ($members as $member) {
// if is a member // if is a member
if (in_array($member['relation_type'], if (in_array(
array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR)) $member['relation_type'],
) { array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR)
)) {
//add icons //add icons
if ($member['relation_type'] == GROUP_USER_PERMISSION_ADMIN) { if ($member['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$icon = Display::return_icon('social_group_admin.png', get_lang('Admin')); $icon = Display::return_icon('social_group_admin.png', get_lang('Admin'));
@ -302,8 +304,7 @@ if ($is_group_member || $group_info['visibility'] == GROUP_PERMISSION_OPEN) {
GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER, GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER,
GROUP_USER_PERMISSION_PENDING_INVITATION, GROUP_USER_PERMISSION_PENDING_INVITATION,
) )
) )) {
) {
$social_right_content .= '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a>'; $social_right_content .= '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a>';
} elseif ($role == GROUP_USER_PERMISSION_PENDING_INVITATION) { } elseif ($role == GROUP_USER_PERMISSION_PENDING_INVITATION) {
$social_right_content .= '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('YouHaveBeenInvitedJoinNow').'</a>'; $social_right_content .= '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('YouHaveBeenInvitedJoinNow').'</a>';

@ -15,7 +15,6 @@ if (api_get_setting('allow_social_tool') != 'true') {
} }
$this_section = SECTION_SOCIAL; $this_section = SECTION_SOCIAL;
$group_id = intval($_GET['id']); $group_id = intval($_GET['id']);
$usergroup = new UserGroup(); $usergroup = new UserGroup();

@ -67,9 +67,17 @@ if (is_array($results) && count($results) > 0) {
$name = cut($result['name'], GROUP_TITLE_LENGTH, true); $name = cut($result['name'], GROUP_TITLE_LENGTH, true);
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) { if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$name .= ' '.Display::return_icon('social_group_admin.png', get_lang('Admin'), array('style'=>'vertical-align:middle')); $name .= ' '.Display::return_icon(
'social_group_admin.png',
get_lang('Admin'),
array('style' => 'vertical-align:middle')
);
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) { } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$name .= ' '.Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style'=>'vertical-align:middle')); $name .= ' '.Display::return_icon(
'social_group_moderator.png',
get_lang('Moderator'),
array('style' => 'vertical-align:middle')
);
} }
$url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>'; $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>';
@ -132,7 +140,15 @@ foreach ($results as $result) {
$id = $result['id']; $id = $result['id'];
$name = cut($result['name'], GROUP_TITLE_LENGTH, true); $name = cut($result['name'], GROUP_TITLE_LENGTH, true);
$count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000)); $count_users_group = count(
$usergroup->get_users_by_group(
$id,
false,
array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR),
0,
1000
)
);
if ($count_users_group == 1) { if ($count_users_group == 1) {
$count_users_group = $count_users_group.' '.get_lang('Member'); $count_users_group = $count_users_group.' '.get_lang('Member');
} else { } else {
@ -265,19 +281,43 @@ if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) {
break; break;
case 'newest': case 'newest':
if (count($grid_newest_groups) > 0) { if (count($grid_newest_groups) > 0) {
$newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false)); $newest_content = Display::return_sortable_grid(
'newest',
array(),
$grid_newest_groups,
array('hide_navigation' => true, 'per_page' => 100),
$query_vars,
false,
array(true, true, true, false)
);
} }
break; break;
default: default:
if (count($grid_pop_groups) > 0) { if (count($grid_pop_groups) > 0) {
$popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true)); $popular_content = Display::return_sortable_grid(
'popular',
array(),
$grid_pop_groups,
array('hide_navigation' => true, 'per_page' => 100),
$query_vars,
false,
array(true, true, true, true, true)
);
} }
break; break;
} }
} else { } else {
$my_group_content = null; $my_group_content = null;
if (count($grid_my_groups) > 0) { if (count($grid_my_groups) > 0) {
$my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false)); $my_group_content = Display::return_sortable_grid(
'mygroups',
array(),
$grid_my_groups,
array('hide_navigation' => true, 'per_page' => 2),
$query_vars,
false,
array(true, true, true, false)
);
} else { } else {
$my_group_content = '<span class="muted">'.get_lang('GroupNone').'</span>'; $my_group_content = '<span class="muted">'.get_lang('GroupNone').'</span>';
} }
@ -286,16 +326,33 @@ if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) {
get_lang('CreateASocialGroup').'</a>'; get_lang('CreateASocialGroup').'</a>';
} else { } else {
if (api_is_allowed_to_edit(null, true)) { if (api_is_allowed_to_edit(null, true)) {
$create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>'; $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.
get_lang('CreateASocialGroup').'</a>';
} }
} }
if (count($grid_newest_groups) > 0) { if (count($grid_newest_groups) > 0) {
$newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false)); $newest_content = Display::return_sortable_grid(
'mygroups',
array(),
$grid_newest_groups,
array('hide_navigation' => true, 'per_page' => 100),
$query_vars,
false,
array(true, true, true, false)
);
} else { } else {
$newest_content = '<div class="muted">'.get_lang('GroupNone').'</div>'; $newest_content = '<div class="muted">'.get_lang('GroupNone').'</div>';
} }
if (count($grid_pop_groups) > 0) { if (count($grid_pop_groups) > 0) {
$popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true)); $popular_content = Display::return_sortable_grid(
'mygroups',
array(),
$grid_pop_groups,
array('hide_navigation' => true, 'per_page' => 100),
$query_vars,
false,
array(true, true, true, true, true)
);
} else { } else {
$popular_content = '<div class="muted">'.get_lang('GroupNone').'</div>'; $popular_content = '<div class="muted">'.get_lang('GroupNone').'</div>';
} }
@ -305,7 +362,11 @@ if (!empty($create_group_item)) {
$social_right_content .= Display::page_subheader($create_group_item); $social_right_content .= Display::page_subheader($create_group_item);
} }
$headers = array(get_lang('Newest'), get_lang('Popular'), get_lang('MyGroups')); $headers = array(get_lang('Newest'), get_lang('Popular'), get_lang('MyGroups'));
$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content), 'tab_browse'); $social_right_content .= Display::tabs(
$headers,
array($newest_content, $popular_content, $my_group_content),
'tab_browse'
);
$tpl = new Template(null); $tpl = new Template(null);

@ -152,9 +152,13 @@ foreach ($results as $result) {
} else { } else {
$result['count'] = $result['count'].' '.get_lang('Members'); $result['count'] = $result['count'].' '.get_lang('Members');
} }
$result['name'] = '<div class="group-name">'.Display::url( $result['name'] = '<div class="group-name">'.
api_ucwords(cut($result['name'], 40, true)), $group_url) Display::url(
.'</div><div class="count-username">'.Display::returnFontAwesomeIcon('user').$result['count'].'</div>'; api_ucwords(cut($result['name'], 40, true)),
$group_url
)
.'</div><div class="count-username">'.
Display::returnFontAwesomeIcon('user').$result['count'].'</div>';
$picture = $userGroup->get_picture_group( $picture = $userGroup->get_picture_group(
$id, $id,

@ -27,7 +27,6 @@ if (isset($_REQUEST['user_friend'])) {
$group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null; $group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null;
$message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null;
$actions = array('add_message_group', 'edit_message_group', 'reply_message_group'); $actions = array('add_message_group', 'edit_message_group', 'reply_message_group');
$allowed_action = isset($_GET['action']) && in_array($_GET['action'], $actions) ? Security::remove_XSS($_GET['action']) : ''; $allowed_action = isset($_GET['action']) && in_array($_GET['action'], $actions) ? Security::remove_XSS($_GET['action']) : '';
$to_group = ''; $to_group = '';

@ -464,7 +464,6 @@ if ($show_full_profile) {
} }
// If there are information to show Block Extra Information // If there are information to show Block Extra Information
if (!empty($extra_information_value)) { if (!empty($extra_information_value)) {
$social_extra_info_block = $extra_information; $social_extra_info_block = $extra_information;
} }

@ -17,7 +17,6 @@ if (api_get_setting('allow_social_tool') != 'true') {
$views = array('friends', 'mygroups'); $views = array('friends', 'mygroups');
$user_id = intval($_GET['user_id']); $user_id = intval($_GET['user_id']);
$userGroup = new UserGroup(); $userGroup = new UserGroup();
if (isset($_GET['view']) && in_array($_GET['view'], $views)) { if (isset($_GET['view']) && in_array($_GET['view'], $views)) {

@ -173,7 +173,7 @@ function modify_filter($id, $params, $row)
); );
} }
return $result; return $result;
} }
$table->set_header(0, '', false); $table->set_header(0, '', false);

@ -171,6 +171,7 @@ function get_number_of_users()
* @param int Number of users to get * @param int Number of users to get
* @param int Column to sort on * @param int Column to sort on
* @param string Order (ASC,DESC) * @param string Order (ASC,DESC)
* @return array
* @see SortableTable#get_table_data($from) * @see SortableTable#get_table_data($from)
*/ */
function get_user_data($from, $number_of_items, $column, $direction) function get_user_data($from, $number_of_items, $column, $direction)
@ -291,8 +292,9 @@ if (isset($_POST['report'])) {
if ($start_date != '' || $end_date != '') { if ($start_date != '' || $end_date != '') {
$sql .= " HAVING "; $sql .= " HAVING ";
if ($start_date != '') if ($start_date != '') {
$sql .= " access_date >= '$start_date' "; $sql .= " access_date >= '$start_date' ";
}
if ($end_date != '') { if ($end_date != '') {
$sql = ($start_date == '') ? $sql : ($sql." AND "); $sql = ($start_date == '') ? $sql : ($sql." AND ");
$sql .= " access_date <= '$end_date' "; $sql .= " access_date <= '$end_date' ";

@ -139,7 +139,7 @@ function modify_filter($id, $params, $row)
); );
} }
return $result; return $result;
} }
$table->set_header(0, '', false); $table->set_header(0, '', false);

@ -30,7 +30,6 @@ function initializeReport($course_code)
$weeksCount = Database::escape_string($weeksCount); $weeksCount = Database::escape_string($weeksCount);
Database::query("REPLACE INTO $table_semanas_curso (course_code , semanas) VALUES ('$course_code','$weeksCount')"); Database::query("REPLACE INTO $table_semanas_curso (course_code , semanas) VALUES ('$course_code','$weeksCount')");
if (intval($obj->cant) != $weeksCount) { if (intval($obj->cant) != $weeksCount) {
if (intval($obj->cant) > $weeksCount) { if (intval($obj->cant) > $weeksCount) {
$sql = "DELETE FROM $table_reporte_semanas $sql = "DELETE FROM $table_reporte_semanas
WHERE week_id > $weeksCount AND course_code = '$course_code'"; WHERE week_id > $weeksCount AND course_code = '$course_code'";

@ -2,12 +2,12 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This file is responsible for passing requested documents to the browser. * This file is responsible for passing requested documents to the browser.
* Html files are parsed to fix a few problems with URLs, * Html files are parsed to fix a few problems with URLs,
* but this code will hopefully be replaced soon by an Apache URL * but this code will hopefully be replaced soon by an Apache URL
* rewrite mechanism. * rewrite mechanism.
* *
* @package chamilo.work * @package chamilo.work
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
require_once 'work.lib.php'; require_once 'work.lib.php';

@ -2,12 +2,12 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This file is responsible for passing requested documents to the browser. * This file is responsible for passing requested documents to the browser.
* Html files are parsed to fix a few problems with URLs, * Html files are parsed to fix a few problems with URLs,
* but this code will hopefully be replaced soon by an Apache URL * but this code will hopefully be replaced soon by an Apache URL
* rewrite mechanism. * rewrite mechanism.
* *
* @package chamilo.work * @package chamilo.work
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
require_once 'work.lib.php'; require_once 'work.lib.php';
@ -23,8 +23,7 @@ $workData = getWorkComment($commentId);
$courseInfo = api_get_course_info(); $courseInfo = api_get_course_info();
if (!empty($workData)) { if (!empty($workData)) {
if ( if (empty($workData['file_path']) ||
empty($workData['file_path']) ||
(isset($workData['file_path']) && !file_exists($workData['file_path'])) (isset($workData['file_path']) && !file_exists($workData['file_path']))
) { ) {
api_not_allowed(true); api_not_allowed(true);

@ -2,9 +2,9 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Functions and main code for the download folder feature * Functions and main code for the download folder feature
* @todo use ids instead of the path like the document tool * @todo use ids instead of the path like the document tool
* @package chamilo.work * @package chamilo.work
*/ */
$work_id = $_GET['id']; $work_id = $_GET['id'];
@ -36,8 +36,7 @@ if (empty($_course) || empty($_course['path'])) {
$sys_course_path = api_get_path(SYS_COURSE_PATH); $sys_course_path = api_get_path(SYS_COURSE_PATH);
// Creating a ZIP file // Creating a ZIP file
$temp_zip_file = api_get_path(SYS_ARCHIVE_PATH).api_get_unique_id().".zip"; $temp_zip_file = api_get_path(SYS_ARCHIVE_PATH).api_get_unique_id().'.zip';
$zip_folder = new PclZip($temp_zip_file); $zip_folder = new PclZip($temp_zip_file);
$tbl_student_publication = Database::get_course_table(TABLE_STUDENT_PUBLICATION); $tbl_student_publication = Database::get_course_table(TABLE_STUDENT_PUBLICATION);

@ -2,12 +2,12 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This file is responsible for passing requested documents to the browser. * This file is responsible for passing requested documents to the browser.
* Html files are parsed to fix a few problems with URLs, * Html files are parsed to fix a few problems with URLs,
* but this code will hopefully be replaced soon by an Apache URL * but this code will hopefully be replaced soon by an Apache URL
* rewrite mechanism. * rewrite mechanism.
* *
* @package chamilo.work * @package chamilo.work
*/ */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
require_once 'work.lib.php'; require_once 'work.lib.php';
@ -17,9 +17,7 @@ $this_section = SECTION_COURSES;
// Course protection // Course protection
api_protect_course_script(true); api_protect_course_script(true);
$id = intval($_GET['id']); $id = intval($_GET['id']);
$course_info = api_get_course_info(); $course_info = api_get_course_info();
if (empty($course_info)) { if (empty($course_info)) {

@ -134,7 +134,7 @@ function settingsForm($defaults)
* *
* @return array * @return array
*/ */
function get_work_data_by_path($path, $courseId = null) function get_work_data_by_path($path, $courseId = 0)
{ {
$path = Database::escape_string($path); $path = Database::escape_string($path);
if (empty($courseId)) { if (empty($courseId)) {
@ -161,7 +161,7 @@ function get_work_data_by_path($path, $courseId = null)
* @param int $sessionId * @param int $sessionId
* @return array * @return array
*/ */
function get_work_data_by_id($id, $courseId = null, $sessionId = null) function get_work_data_by_id($id, $courseId = 0, $sessionId = 0)
{ {
$id = intval($id); $id = intval($id);
@ -1339,9 +1339,7 @@ function get_count_work($work_id, $onlyMeUserId = null, $notMeUserId = null)
} }
$extra_conditions .= " AND parent_id = ".$work_id." "; $extra_conditions .= " AND parent_id = ".$work_id." ";
$where_condition = null; $where_condition = null;
if (!empty($notMeUserId)) { if (!empty($notMeUserId)) {
$where_condition .= " AND u.user_id <> ".intval($notMeUserId); $where_condition .= " AND u.user_id <> ".intval($notMeUserId);
} }
@ -1818,7 +1816,6 @@ function get_work_user_list_from_documents(
$currentUserId = api_get_user_id(); $currentUserId = api_get_user_id();
$work_data = get_work_data_by_id($workId); $work_data = get_work_data_by_id($workId);
$qualificationExists = false; $qualificationExists = false;
if (!empty($work_data['qualification']) && intval($work_data['qualification']) > 0) { if (!empty($work_data['qualification']) && intval($work_data['qualification']) > 0) {
@ -2523,7 +2520,7 @@ function is_work_exist_by_url($url)
* @param int $sessionId * @param int $sessionId
* @return bool * @return bool
*/ */
function user_is_author($itemId, $userId = null, $courseId = null, $sessionId = null) function user_is_author($itemId, $userId = null, $courseId = 0, $sessionId = 0)
{ {
if (empty($itemId)) { if (empty($itemId)) {
return false; return false;
@ -2539,7 +2536,6 @@ function user_is_author($itemId, $userId = null, $courseId = null, $sessionId =
if ($is_allowed_to_edit) { if ($is_allowed_to_edit) {
$isAuthor = true; $isAuthor = true;
} else { } else {
if (empty($courseId)) { if (empty($courseId)) {
$courseId = api_get_course_int_id(); $courseId = api_get_course_int_id();
} }
@ -2573,7 +2569,7 @@ function user_is_author($itemId, $userId = null, $courseId = null, $sessionId =
* @author cvargas * @author cvargas
* @author Julio Montoya <gugli100@gmail.com> Fixing query * @author Julio Montoya <gugli100@gmail.com> Fixing query
*/ */
function get_list_users_without_publication($task_id, $studentId = null) function get_list_users_without_publication($task_id, $studentId = 0)
{ {
$work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION); $work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER); $table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
@ -3506,6 +3502,7 @@ function addWorkComment($courseInfo, $userId, $parentWork, $work, $data)
/** /**
* @param array $work * @param array $work
* @param array $workParent
* *
* @return string * @return string
*/ */
@ -3543,8 +3540,6 @@ function getWorkCommentForm($work, $workParent)
$work['qualification'] $work['qualification']
); );
} }
$form->addFile('file', get_lang('Correction')); $form->addFile('file', get_lang('Correction'));
$form->setDefaults(['qualification' => $work['qualification']]); $form->setDefaults(['qualification' => $work['qualification']]);
} }
@ -3569,7 +3564,7 @@ function getWorkCommentForm($work, $workParent)
/** /**
* @param array $homework result of get_work_assignment_by_id() * @param array $homework result of get_work_assignment_by_id()
* @return string * @return array
*/ */
function getWorkDateValidationStatus($homework) function getWorkDateValidationStatus($homework)
{ {
@ -3871,9 +3866,9 @@ function sendAlertToUsers($workId, $courseInfo, $session_id)
/** /**
* Check if the current uploaded work filename already exists in the current assement * Check if the current uploaded work filename already exists in the current assement
* *
* @param $filename * @param string $filename
* @param $workId * @param int $workId
* @return mixed * @return array
*/ */
function checkExistingWorkFileName($filename, $workId) function checkExistingWorkFileName($filename, $workId)
{ {
@ -4367,9 +4362,7 @@ function updatePublicationAssignment($workId, $params, $courseInfo, $groupId)
$qualification = isset($params['qualification']) && !empty($params['qualification']) ? 1 : 0; $qualification = isset($params['qualification']) && !empty($params['qualification']) ? 1 : 0;
$expiryDate = isset($params['enableExpiryDate']) && (int) $params['enableExpiryDate'] == 1 ? api_get_utc_datetime($params['expires_on']) : ''; $expiryDate = isset($params['enableExpiryDate']) && (int) $params['enableExpiryDate'] == 1 ? api_get_utc_datetime($params['expires_on']) : '';
$endDate = isset($params['enableEndDate']) && (int) $params['enableEndDate'] == 1 ? api_get_utc_datetime($params['ends_on']) : ''; $endDate = isset($params['enableEndDate']) && (int) $params['enableEndDate'] == 1 ? api_get_utc_datetime($params['ends_on']) : '';
$data = get_work_assignment_by_id($workId, $course_id); $data = get_work_assignment_by_id($workId, $course_id);
if (!empty($expiryDate)) { if (!empty($expiryDate)) {
$expiryDateCondition = "expires_on = '".Database::escape_string($expiryDate)."', "; $expiryDateCondition = "expires_on = '".Database::escape_string($expiryDate)."', ";
} else { } else {
@ -4513,7 +4506,8 @@ function deleteWorkItem($item_id, $courseInfo)
) )
) { ) {
// We found the current user is the author // We found the current user is the author
$sql = "SELECT url, contains_file, user_id, session_id, parent_id FROM $work_table $sql = "SELECT url, contains_file, user_id, session_id, parent_id
FROM $work_table
WHERE c_id = $course_id AND id = $item_id"; WHERE c_id = $course_id AND id = $item_id";
$result = Database::query($sql); $result = Database::query($sql);
$row = Database::fetch_array($result); $row = Database::fetch_array($result);
@ -4756,6 +4750,7 @@ function getUploadDocumentType()
* @param array $courseInfo * @param array $courseInfo
* @param bool $showScore * @param bool $showScore
* @param bool $studentDeleteOwnPublication * @param bool $studentDeleteOwnPublication
* @return bool
*/ */
function updateSettings($courseInfo, $showScore, $studentDeleteOwnPublication) function updateSettings($courseInfo, $showScore, $studentDeleteOwnPublication)
{ {
@ -4805,6 +4800,7 @@ function updateSettings($courseInfo, $showScore, $studentDeleteOwnPublication)
]; ];
Database::insert($table_course_setting, $params); Database::insert($table_course_setting, $params);
} }
return true;
} }
/** /**
@ -5237,8 +5233,8 @@ function getFileContents($id, $course_info, $sessionId = 0, $correction = false)
if (Security::check_abs_path( if (Security::check_abs_path(
$full_file_name, $full_file_name,
api_get_path(SYS_COURSE_PATH).api_get_course_path().'/') api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'
) { )) {
Event::event_download($title); Event::event_download($title);
return array( return array(

@ -25,7 +25,8 @@ $plugin_info['author'] = 'Julio Montoya';
/* /*
* This form will be showed in the plugin settings once the plugin was installed * This form will be showed in the plugin settings once the plugin was installed
* in the plugin/hello_world/index.php you can have access to the value: $plugin_info['settings']['hello_world_show_type'] * in the plugin/hello_world/index.php you can have
* access to the value: $plugin_info['settings']['hello_world_show_type']
*/ */
$form = new FormValidator('hello_world_form'); $form = new FormValidator('hello_world_form');

@ -12,9 +12,7 @@ $tpl = new Template($tool_name);
$om = new \Chamilo\Plugin\OpenMeetings\OpenMeetings(); $om = new \Chamilo\Plugin\OpenMeetings\OpenMeetings();
if ($om->isServerRunning()) { if ($om->isServerRunning()) {
if (isset($_GET['launch']) && $_GET['launch'] == 1) { if (isset($_GET['launch']) && $_GET['launch'] == 1) {
$meeting_params = array(); $meeting_params = array();
$meeting_params['meeting_name'] = 'C'.api_get_course_id().'-'.api_get_session_id(); $meeting_params['meeting_name'] = 'C'.api_get_course_id().'-'.api_get_session_id();
$meetings = $om->getCourseMeetings(); $meetings = $om->getCourseMeetings();

@ -9,14 +9,14 @@
*/ */
class HookResubscription extends HookObserver implements HookResubscribeObserverInterface class HookResubscription extends HookObserver implements HookResubscribeObserverInterface
{ {
/** /**
* Class constructor * Class constructor
*/ */
public function __construct() public function __construct()
{ {
parent::__construct( parent::__construct(
'plugin/resubscription/src/Resubscription.php', 'resubscription' 'plugin/resubscription/src/Resubscription.php',
'resubscription'
); );
} }
@ -28,7 +28,6 @@ class HookResubscription extends HookObserver implements HookResubscribeObserver
{ {
$data = $hook->getEventData(); $data = $hook->getEventData();
if ($data['type'] === HOOK_EVENT_TYPE_PRE) { if ($data['type'] === HOOK_EVENT_TYPE_PRE) {
$resubscriptionLimit = Resubscription::create()->get('resubscription_limit'); $resubscriptionLimit = Resubscription::create()->get('resubscription_limit');
// Initialize variables as a calendar year by default // Initialize variables as a calendar year by default

@ -9,7 +9,6 @@
*/ */
class Resubscription extends Plugin implements HookPluginInterface class Resubscription extends Plugin implements HookPluginInterface
{ {
/** /**
* Class constructor * Class constructor
*/ */
@ -74,5 +73,4 @@ class Resubscription extends Plugin implements HookPluginInterface
$hook = HookResubscription::create(); $hook = HookResubscription::create();
HookResubscribe::create()->detach($hook); HookResubscribe::create()->detach($hook);
} }
} }

@ -12,7 +12,6 @@
class RegisterCourseWidget class RegisterCourseWidget
{ {
const ACTION_SUBSCRIBE = 'subscribe'; const ACTION_SUBSCRIBE = 'subscribe';
const PARAM_SUBSCRIBE = 'subscribe'; const PARAM_SUBSCRIBE = 'subscribe';
const PARAM_PASSCODE = 'course_registration_code'; const PARAM_PASSCODE = 'course_registration_code';
@ -62,29 +61,27 @@ class RegisterCourseWidget
function action_subscribe_user() function action_subscribe_user()
{ {
$action = self::get('action'); $action = self::get('action');
if ($action != self::ACTION_SUBSCRIBE) if ($action != self::ACTION_SUBSCRIBE) {
{
return false; return false;
} }
$course_code = self::post(self::PARAM_SUBSCRIBE); $course_code = self::post(self::PARAM_SUBSCRIBE);
if (empty($course_code)) if (empty($course_code)) {
{
return false; return false;
} }
$registration_code = self::post(self::PARAM_PASSCODE); $registration_code = self::post(self::PARAM_PASSCODE);
if ($this->subscribe_user($course_code, $registration_code)) if ($this->subscribe_user($course_code, $registration_code)) {
{
echo Display::return_message(get_lang('EnrollToCourseSuccessful'), 'confirmation'); echo Display::return_message(get_lang('EnrollToCourseSuccessful'), 'confirmation');
return; return;
} }
if (!empty($registration_code)) if (!empty($registration_code)) {
{
echo Display::return_message(get_lang('CourseRegistrationCodeIncorrect'), 'error'); echo Display::return_message(get_lang('CourseRegistrationCodeIncorrect'), 'error');
} }
$this->display_form($course_code); $this->display_form($course_code);
return true; return true;
} }
@ -101,18 +98,16 @@ class RegisterCourseWidget
{ {
$course = api_get_course_info($course_code); $course = api_get_course_info($course_code);
$course_regisration_code = $course['registration_code']; $course_regisration_code = $course['registration_code'];
if (!empty($course_regisration_code) && $registration_code != $course_regisration_code) if (!empty($course_regisration_code) && $registration_code != $course_regisration_code) {
{
return false; return false;
} }
if (empty($user_id)) if (empty($user_id)) {
{
global $_user; global $_user;
$user_id = $_user['user_id']; $user_id = $_user['user_id'];
} }
return (bool) CourseManager::add_user_to_course($user_id, $course_code); return (bool)CourseManager::add_user_to_course($user_id, $course_code);
} }
/** /**

@ -9,17 +9,17 @@
*/ */
class SearchCoursePlugin extends Plugin class SearchCoursePlugin extends Plugin
{ {
/** /**
* *
* @return SearchCoursePlugin * @return SearchCoursePlugin
*/ */
static function create() static function create()
{ {
static $result = null; static $result = null;
return $result ? $result : $result = new self(); return $result ? $result : $result = new self();
} }
function get_name() function get_name()
{ {
return 'search_course'; return 'search_course';
@ -29,5 +29,4 @@ class SearchCoursePlugin extends Plugin
{ {
parent::__construct('1.1', 'Laurent Opprecht'); parent::__construct('1.1', 'Laurent Opprecht');
} }
} }

@ -17,7 +17,9 @@ if (api_is_platform_admin()) {
$tUser = Database::get_main_table(TABLE_MAIN_USER); $tUser = Database::get_main_table(TABLE_MAIN_USER);
$tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY); $tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
$login = 'SEPE'; $login = 'SEPE';
$sql = "SELECT a.api_key AS api FROM $tUser u, $tApi a WHERE u.username='".$login."' and u.user_id = a.user_id AND a.api_service = 'dokeos';"; $sql = "SELECT a.api_key AS api
FROM $tUser u, $tApi a
WHERE u.username='".$login."' and u.user_id = a.user_id AND a.api_service = 'dokeos';";
$result = Database::query($sql); $result = Database::query($sql);
if (Database::num_rows($result) > 0) { if (Database::num_rows($result) > 0) {
$tmp = Database::fetch_assoc($result); $tmp = Database::fetch_assoc($result);
@ -26,15 +28,19 @@ if (api_is_platform_admin()) {
$info = ''; $info = '';
} }
$templateName = $plugin->get_lang('Setting'); $templateName = $plugin->get_lang('Setting');
$interbreadcrumb[] = array("url" => "/plugin/sepe/src/sepe-administration-menu.php", "name" => $plugin->get_lang('MenuSepe')); $interbreadcrumb[] = array(
"url" => "/plugin/sepe/src/sepe-administration-menu.php",
"name" => $plugin->get_lang('MenuSepe'),
);
$tpl = new Template($templateName); $tpl = new Template($templateName);
$tpl->assign('info', $info); $tpl->assign('info', $info);
$listing_tpl = 'sepe/view/configuration.tpl'; $listing_tpl = 'sepe/view/configuration.tpl';
$content = $tpl->fetch($listing_tpl); $content = $tpl->fetch($listing_tpl);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();
} else { } else {
header('Location:'.api_get_path(WEB_PATH)); header('Location:'.api_get_path(WEB_PATH));
exit;
} }

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Get the intro steps for the web page * Get the intro steps for the web page
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>

@ -8,7 +8,16 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* Notification * Notification
* *
* @ORM\Table(name="notification", indexes={@ORM\Index(name="mail_notify_sent_index", columns={"sent_at"}), @ORM\Index(name="mail_notify_freq_index", columns={"sent_at", "send_freq", "created_at"})}) * @ORM\Table(
* name="notification",
* indexes={
* @ORM\Index(name="mail_notify_sent_index", columns={"sent_at"}),
* @ORM\Index(
* name="mail_notify_freq_index",
* columns={"sent_at", "send_freq", "created_at"}
* )
* }
* )
* @ORM\Entity * @ORM\Entity
*/ */
class Notification class Notification

@ -40,5 +40,4 @@ class ExtraFieldRelTagRepository extends EntityRepository
return $queryBuilder->getQuery()->getResult(); return $queryBuilder->getQuery()->getResult();
} }
} }

@ -70,7 +70,6 @@ class SequenceRepository extends EntityRepository
* *
* @param int $resourceId * @param int $resourceId
* @param int $type * @param int $type
* @return boolean
*/ */
public function deleteResource($resourceId, $type) public function deleteResource($resourceId, $type)
{ {

@ -42,5 +42,4 @@ class SessionRepository extends EntityRepository
return $queryBuilder->getQuery()->getResult(); return $queryBuilder->getQuery()->getResult();
} }
} }

@ -58,5 +58,4 @@ class SkillRepository extends EntityRepository
return $qb->getQuery()->getOneOrNullResult(); return $qb->getQuery()->getOneOrNullResult();
} }
} }

@ -3,6 +3,7 @@
namespace Chamilo\CoreBundle\Entity\Repository; namespace Chamilo\CoreBundle\Entity\Repository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;
use Chamilo\UserBundle\Entity\User; use Chamilo\UserBundle\Entity\User;

@ -13,8 +13,8 @@ use Chamilo\UserBundle\Entity\User;
* @package Chamilo\CoreBundle\Entity\Repository * @package Chamilo\CoreBundle\Entity\Repository
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*/ */
class TrackECourseAccessRepository extends EntityRepository { class TrackECourseAccessRepository extends EntityRepository
{
/** /**
* Get the last registered access by an user * Get the last registered access by an user
* @param User $user The user * @param User $user The user

@ -8,7 +8,10 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* SettingsCurrent * SettingsCurrent
* *
* @ORM\Table(name="settings_current", uniqueConstraints={@ORM\UniqueConstraint(name="unique_setting", columns={"variable", "subkey", "access_url"})}, indexes={@ORM\Index(name="access_url", columns={"access_url"})}) * @ORM\Table(
* name="settings_current",
* uniqueConstraints={@ORM\UniqueConstraint(name="unique_setting", columns={"variable", "subkey", "access_url"})},
* indexes={@ORM\Index(name="access_url", columns={"access_url"})})
* @ORM\Entity * @ORM\Entity
*/ */
class SettingsCurrent class SettingsCurrent

@ -8,7 +8,9 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* SpecificField * SpecificField
* *
* @ORM\Table(name="specific_field", uniqueConstraints={@ORM\UniqueConstraint(name="unique_specific_field__code", columns={"code"})}) * @ORM\Table(
* name="specific_field",
* uniqueConstraints={@ORM\UniqueConstraint(name="unique_specific_field__code", columns={"code"})})
* @ORM\Entity * @ORM\Entity
*/ */
class SpecificField class SpecificField

@ -1,14 +1,17 @@
<?php <?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CourseBundle\DependencyInjection; namespace Chamilo\CourseBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\ConfigurationInterface;
/** /**
* This is the class that validates and merges configuration from your app/config files * This is the class that validates and merges configuration from your app/config files
* *
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} * To learn more see
* {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/ */
class Configuration implements ConfigurationInterface class Configuration implements ConfigurationInterface
{ {

@ -125,5 +125,4 @@ class Profile
return $this; return $this;
} }
} }

@ -15,9 +15,8 @@ use Symfony\Component\HttpFoundation\Response;
* Controller to handle breadcrumb display inside the layout * Controller to handle breadcrumb display inside the layout
* *
*/ */
class BreadcrumbController extends Controller { class BreadcrumbController extends Controller
{
/** /**
* Controller Reference action to be called inside the layout. * Controller Reference action to be called inside the layout.
* *
@ -78,5 +77,4 @@ class BreadcrumbController extends Controller {
{ {
return $this->get('event_dispatcher'); return $this->get('event_dispatcher');
} }
} }

@ -27,25 +27,33 @@ class DefaultController extends Controller
/** /**
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function dashboardAction() { public function dashboardAction()
return $this->render('ChamiloThemeBundle:Default:index.html.twig'); {
return $this->render('ChamiloThemeBundle:Default:index.html.twig');
} }
/** /**
* @return \Symfony\Component\HttpFoundation\Response * @return \Symfony\Component\HttpFoundation\Response
*/ */
public function uiGeneralAction() { public function uiGeneralAction()
{
return $this->render('ChamiloThemeBundle:Default:index.html.twig'); return $this->render('ChamiloThemeBundle:Default:index.html.twig');
} }
public function uiIconsAction() { public function uiIconsAction()
{
return $this->render('ChamiloThemeBundle:Default:index.html.twig'); return $this->render('ChamiloThemeBundle:Default:index.html.twig');
} }
public function formAction() { public function formAction()
{
$form = $this->createForm(new FormDemoModelType()); $form = $this->createForm(new FormDemoModelType());
return $this->render('ChamiloThemeBundle:Default:form.html.twig', array(
'form' => $form->createView() return $this->render(
)); 'ChamiloThemeBundle:Default:form.html.twig',
array(
'form' => $form->createView(),
)
);
} }
} }

@ -11,9 +11,8 @@ use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\ExceptionController { class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\ExceptionController
{
/** /**
* @param Request $request * @param Request $request
* @param string $format * @param string $format
@ -24,7 +23,6 @@ class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\Exceptio
*/ */
protected function findTemplate(Request $request, $format, $code, $debug) protected function findTemplate(Request $request, $format, $code, $debug)
{ {
if (strpos($request->getPathInfo(), '/admin') !== 0) { if (strpos($request->getPathInfo(), '/admin') !== 0) {
return parent::findTemplate($request, $format, $code, $debug); return parent::findTemplate($request, $format, $code, $debug);
} }
@ -57,8 +55,5 @@ class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\Exceptio
} }
return parent::findTemplate($request, $format, $code, $debug); return parent::findTemplate($request, $format, $code, $debug);
} }
} }

@ -12,9 +12,12 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/**
* Class NavbarController
* @package Chamilo\ThemeBundle\Controller
*/
class NavbarController extends Controller class NavbarController extends Controller
{ {
/** /**
* @return EventDispatcher * @return EventDispatcher
*/ */
@ -78,7 +81,6 @@ class NavbarController extends Controller
public function userAction() public function userAction()
{ {
if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_NAVBAR_USER)) { if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_NAVBAR_USER)) {
return new Response(); return new Response();
} }
@ -91,5 +93,4 @@ class NavbarController extends Controller
) )
); );
} }
} }

@ -1,20 +1,18 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* SecurityController.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Controller; namespace Chamilo\ThemeBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
/**
* Class SecurityController
* @package Chamilo\ThemeBundle\Controller
*/
class SecurityController extends Controller class SecurityController extends Controller
{ {
/** /**
* @param Request $request * @param Request $request
* *
@ -42,5 +40,4 @@ class SecurityController extends Controller
) )
); );
} }
} }

@ -1,9 +1,5 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* SidebarController.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Controller; namespace Chamilo\ThemeBundle\Controller;

@ -1,38 +1,32 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* WidgetController.php
* avanzu-admin
* Date: 16.03.14
*/
namespace Chamilo\ThemeBundle\Controller; namespace Chamilo\ThemeBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
/**
* Class WidgetController
* @package Chamilo\ThemeBundle\Controller
*/
class WidgetController extends Controller class WidgetController extends Controller
{ {
public function defaultBoxAction() public function defaultBoxAction()
{ {
} }
public function solidBoxAction() public function solidBoxAction()
{ {
} }
public function tiledBoxAction() public function tiledBoxAction()
{ {
} }
public function smallBoxAction() public function smallBoxAction()
{ {
} }
} }

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */
namespace Chamilo\ThemeBundle\DependencyInjection; namespace Chamilo\ThemeBundle\DependencyInjection;
@ -53,144 +54,143 @@ class ChamiloThemeExtension extends Extension implements PrependExtensionInterfa
return; return;
$jsAssets = '@ChamiloThemeBundle/Resources/'; $jsAssets = '@ChamiloThemeBundle/Resources/';
$lteJs = $jsAssets.'public/vendor/adminlte/js/'; $lteJs = $jsAssets.'public/vendor/adminlte/js/';
$cssAssets = 'bundles/avanzuadmintheme/'; $cssAssets = 'bundles/avanzuadmintheme/';
$lteCss = $cssAssets.'vendor/adminlte/css/'; $lteCss = $cssAssets.'vendor/adminlte/css/';
$lteFont = $cssAssets.'vendor/adminlte/fonts/'; $lteFont = $cssAssets.'vendor/adminlte/fonts/';
if (isset($bundles['AsseticBundle']) && 0) { if (isset($bundles['AsseticBundle']) && 0) {
$container->prependExtensionConfig( $container->prependExtensionConfig(
'assetic', 'assetic',
array( array(
'bundles' => array( 'bundles' => array(
'ChamiloThemeBundle' 'ChamiloThemeBundle'
), ),
'assets' => array( 'assets' => array(
'common_js' => array( 'common_js' => array(
'inputs' => array( 'inputs' => array(
$jsAssets.'public/vendor/jquery/dist/jquery.js', $jsAssets.'public/vendor/jquery/dist/jquery.js',
$jsAssets.'public/vendor/jquery-ui/jquery-ui.js', $jsAssets.'public/vendor/jquery-ui/jquery-ui.js',
$jsAssets.'public/vendor/underscore/underscore.js', $jsAssets.'public/vendor/underscore/underscore.js',
$jsAssets.'public/vendor/backbone/backbone.js', $jsAssets.'public/vendor/backbone/backbone.js',
$jsAssets.'public/vendor/marionette/lib/backbone.marionette.js', $jsAssets.'public/vendor/marionette/lib/backbone.marionette.js',
$jsAssets.'public/vendor/bootstrap/dist/js/bootstrap.min.js', $jsAssets.'public/vendor/bootstrap/dist/js/bootstrap.min.js',
$jsAssets.'public/vendor/bootbox/bootbox.js', $jsAssets.'public/vendor/bootbox/bootbox.js',
$jsAssets.'public/js/dialogs.js', $jsAssets.'public/js/dialogs.js',
$jsAssets.'public/js/namespace.js', $jsAssets.'public/js/namespace.js',
), ),
), ),
'tools_js' => array( 'tools_js' => array(
'inputs' => array( 'inputs' => array(
'@common_js', '@common_js',
$jsAssets.'public/vendor/momentjs/moment.js', $jsAssets.'public/vendor/momentjs/moment.js',
$jsAssets.'public/vendor/holderjs/holder.js', $jsAssets.'public/vendor/holderjs/holder.js',
$jsAssets.'public/vendor/spinjs/spin.js', $jsAssets.'public/vendor/spinjs/spin.js',
), ),
), ),
'admin_lte_js' => array( 'admin_lte_js' => array(
'inputs' => array( 'inputs' => array(
$lteJs.'plugins/bootstrap-slider/bootstrap-slider.js', $lteJs.'plugins/bootstrap-slider/bootstrap-slider.js',
$lteJs.'plugins/datatables/jquery.dataTables.js', $lteJs.'plugins/datatables/jquery.dataTables.js',
$lteJs.'plugins/datatables/dataTables.bootstrap.js', $lteJs.'plugins/datatables/dataTables.bootstrap.js',
$lteJs.'plugins/slimScroll/jquery.slimscroll.js', $lteJs.'plugins/slimScroll/jquery.slimscroll.js',
$jsAssets.'public/js/adminLTE.js', $jsAssets.'public/js/adminLTE.js',
) )
), ),
'admin_lte_css' => array( 'admin_lte_css' => array(
'inputs' => array( 'inputs' => array(
// $lteCss . 'jQueryUI/jquery-ui-1.10.3.custom.css', // $lteCss . 'jQueryUI/jquery-ui-1.10.3.custom.css',
$cssAssets.'vendor/bootstrap/dist/css/bootstrap.min.css', $cssAssets.'vendor/bootstrap/dist/css/bootstrap.min.css',
$lteCss.'bootstrap-slider/slider.css', $lteCss.'bootstrap-slider/slider.css',
$lteCss.'datatables/dataTables.bootstrap.css', $lteCss.'datatables/dataTables.bootstrap.css',
$cssAssets.'vendor/fontawesome/css/font-awesome.min.css', $cssAssets.'vendor/fontawesome/css/font-awesome.min.css',
$cssAssets.'vendor/ionicons/css/ionicons.min.css', $cssAssets.'vendor/ionicons/css/ionicons.min.css',
$lteCss.'AdminLTE.css', $lteCss.'AdminLTE.css',
//$lteFont . 'fontawesome-webfont.eot', //$lteFont . 'fontawesome-webfont.eot',
// $lteFont . 'ionicons.eot', // $lteFont . 'ionicons.eot',
) )
), ),
'admin_lte_forms_js' => array( 'admin_lte_forms_js' => array(
'inputs' => array( 'inputs' => array(
$lteJs.'plugins/colorpicker/bootstrap-colorpicker.js', $lteJs.'plugins/colorpicker/bootstrap-colorpicker.js',
$lteJs.'plugins/daterangepicker/daterangepicker.js', $lteJs.'plugins/daterangepicker/daterangepicker.js',
$lteJs.'plugins/timepicker/bootstrap-timepicker.js', $lteJs.'plugins/timepicker/bootstrap-timepicker.js',
$lteJs.'plugins/input-mask/jquery.inputmask.js', $lteJs.'plugins/input-mask/jquery.inputmask.js',
// $lteJs.'plugins/input-mask/*', // $lteJs.'plugins/input-mask/*',
) )
), ),
'admin_lte_forms_css' => array( 'admin_lte_forms_css' => array(
'inputs' => array( 'inputs' => array(
$lteCss.'colorpicker/bootstrap-colorpicker.css', $lteCss.'colorpicker/bootstrap-colorpicker.css',
$lteCss.'daterangepicker/daterangepicker-bs3.css', $lteCss.'daterangepicker/daterangepicker-bs3.css',
$lteCss.'timepicker/bootstrap-timepicker.css', $lteCss.'timepicker/bootstrap-timepicker.css',
) )
), ),
'admin_lte_wysiwyg' => array( 'admin_lte_wysiwyg' => array(
'inputs' => array( 'inputs' => array(
$lteJs.'plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.js', $lteJs.'plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.js',
) )
), ),
'admin_lte_wysiwyg_css' => array( 'admin_lte_wysiwyg_css' => array(
'inputs' => array( 'inputs' => array(
$lteCss.'bootstrap-wysihtml5/bootstrap3-wysihtml5.css', $lteCss.'bootstrap-wysihtml5/bootstrap3-wysihtml5.css',
) )
), ),
'admin_lte_morris' => array( 'admin_lte_morris' => array(
'inputs' => array( 'inputs' => array(
$lteJs.'plugins/morris/morris.js', $lteJs.'plugins/morris/morris.js',
) )
), ),
'admin_lte_morris_css' => array( 'admin_lte_morris_css' => array(
'inputs' => array( 'inputs' => array(
$lteCss.'morris/morris.css', $lteCss.'morris/morris.css',
)
),
'admin_lte_flot' => array(
'inputs' => array(
$lteJs.'plugins/flot/*',
)
),
'admin_lte_calendar' => array(
'inputs' => array(
$jsAssets.'public/vendor/fullcalendar/dist/fullcalendar.min.js',
)
),
'admin_lte_calendar_css' => array(
'inputs' => array(
$lteCss.'fullcalendar/fullcalendar.css',
)
),
'avatar_img' => array(
'inputs' => array(
'@ChamiloThemeBundle/Resources/public/img/avatar.png'
)
),
'admin_lte_all' => array(
'inputs' => array(
'@tools_js',
'@admin_lte_forms_js',
'@admin_lte_wysiwyg',
'@admin_lte_morris',
'@admin_lte_calendar',
'@admin_lte_js',
// '@admin_lte_flot',
)
),
'admin_lte_all_css' => array(
'inputs' => array(
'@admin_lte_calendar_css',
'@admin_lte_morris_css',
'@admin_lte_wysiwyg_css',
'@admin_lte_forms_css',
'@admin_lte_css'
)
),
) )
) ),
'admin_lte_flot' => array(
'inputs' => array(
$lteJs.'plugins/flot/*',
)
),
'admin_lte_calendar' => array(
'inputs' => array(
$jsAssets.'public/vendor/fullcalendar/dist/fullcalendar.min.js',
)
),
'admin_lte_calendar_css' => array(
'inputs' => array(
$lteCss.'fullcalendar/fullcalendar.css',
)
),
'avatar_img' => array(
'inputs' => array(
'@ChamiloThemeBundle/Resources/public/img/avatar.png'
)
),
'admin_lte_all' => array(
'inputs' => array(
'@tools_js',
'@admin_lte_forms_js',
'@admin_lte_wysiwyg',
'@admin_lte_morris',
'@admin_lte_calendar',
'@admin_lte_js',
// '@admin_lte_flot',
)
),
'admin_lte_all_css' => array(
'inputs' => array(
'@admin_lte_calendar_css',
'@admin_lte_morris_css',
'@admin_lte_wysiwyg_css',
'@admin_lte_forms_css',
'@admin_lte_css'
)
),
)
)
); );
} }
} }
} }

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */
namespace Chamilo\ThemeBundle\DependencyInjection; namespace Chamilo\ThemeBundle\DependencyInjection;
@ -8,7 +9,8 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
/** /**
* This is the class that validates and merges configuration from your app/config files * This is the class that validates and merges configuration from your app/config files
* *
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} * To learn more see {
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/ */
class Configuration implements ConfigurationInterface class Configuration implements ConfigurationInterface
{ {

@ -1,13 +1,8 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* MessageListEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event; namespace Chamilo\ThemeBundle\Event;
use Chamilo\ThemeBundle\Model\MessageInterface; use Chamilo\ThemeBundle\Model\MessageInterface;
/** /**
@ -52,7 +47,6 @@ class MessageListEvent extends ThemeEvent
$this->messages[] = $messageInterface; $this->messages[] = $messageInterface;
return $this; return $this;
} }
/** /**
@ -64,5 +58,4 @@ class MessageListEvent extends ThemeEvent
{ {
return $this->totalMessages == 0 ? sizeof($this->messages) : $this->totalMessages; return $this->totalMessages == 0 ? sizeof($this->messages) : $this->totalMessages;
} }
} }

@ -1,13 +1,8 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* NotificationListEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event; namespace Chamilo\ThemeBundle\Event;
use Chamilo\ThemeBundle\Model\NotificationInterface; use Chamilo\ThemeBundle\Model\NotificationInterface;
/** /**
@ -59,7 +54,4 @@ class NotificationListEvent extends ThemeEvent
{ {
return $this->total == 0 ? sizeof($this->notifications) : $this->total; return $this->total == 0 ? sizeof($this->notifications) : $this->total;
} }
} }

@ -1,9 +1,5 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* ShowUserEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event; namespace Chamilo\ThemeBundle\Event;

@ -1,13 +1,8 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* SidebarMenuEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event; namespace Chamilo\ThemeBundle\Event;
use Chamilo\ThemeBundle\Model\MenuItemInterface; use Chamilo\ThemeBundle\Model\MenuItemInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -18,7 +13,6 @@ use Symfony\Component\HttpFoundation\Request;
*/ */
class SidebarMenuEvent extends ThemeEvent class SidebarMenuEvent extends ThemeEvent
{ {
/** /**
* @var array * @var array
*/ */
@ -72,13 +66,16 @@ class SidebarMenuEvent extends ThemeEvent
/** /**
* @return MenuItemInterface|null * @return MenuItemInterface|null
*/ */
public function getActive() { public function getActive()
{
foreach ($this->getItems() as $item) { foreach ($this->getItems() as $item) {
/** @var $item MenuItemInterface */ /** @var $item MenuItemInterface */
if ($item->isActive()) return $item; if ($item->isActive()) {
return $item;
}
} }
return null; return null;
} }
} }

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */
namespace Chamilo\ThemeBundle\Event; namespace Chamilo\ThemeBundle\Event;

@ -1,15 +1,14 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* TaskListEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event; namespace Chamilo\ThemeBundle\Event;
use Chamilo\ThemeBundle\Model\TaskInterface; use Chamilo\ThemeBundle\Model\TaskInterface;
/**
* Class TaskListEvent
* @package Chamilo\ThemeBundle\Event
*/
class TaskListEvent extends ThemeEvent class TaskListEvent extends ThemeEvent
{ {
protected $tasks = array(); protected $tasks = array();

@ -1,9 +1,5 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* ThemeEvent.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event; namespace Chamilo\ThemeBundle\Event;

@ -1,9 +1,5 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* ThemeEvents.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Event; namespace Chamilo\ThemeBundle\Event;

@ -1,21 +1,19 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* ContextListener.php
* publisher
* Date: 23.05.14
*/
namespace Chamilo\ThemeBundle\EventListener; namespace Chamilo\ThemeBundle\EventListener;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent; use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\User\User; use Symfony\Component\Security\Core\User\User;
use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserInterface;
/**
* Class ContextListener
* @package Chamilo\ThemeBundle\EventListener
*/
class ContextListener class ContextListener
{ {
protected $indicator = '^/admin'; protected $indicator = '^/admin';
protected $container = null; protected $container = null;

@ -1,17 +1,16 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* NavbarMessageListDemoListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener; namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\MessageListEvent; use Chamilo\ThemeBundle\Event\MessageListEvent;
use Chamilo\ThemeBundle\Model\MessageModel; use Chamilo\ThemeBundle\Model\MessageModel;
use Chamilo\ThemeBundle\Model\UserModel; use Chamilo\ThemeBundle\Model\UserModel;
/**
* Class NavbarMessageListDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class NavbarMessageListDemoListener class NavbarMessageListDemoListener
{ {
public function onListMessages(MessageListEvent $event) public function onListMessages(MessageListEvent $event)
@ -28,5 +27,4 @@ class NavbarMessageListDemoListener
new MessageModel(new UserModel('Jack Trockendoc'), 'This is some subject', new \DateTime('-10 month')), new MessageModel(new UserModel('Jack Trockendoc'), 'This is some subject', new \DateTime('-10 month')),
); );
} }
} }

@ -1,16 +1,15 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* NavbarNotificationListDemoListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener; namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\NotificationListEvent; use Chamilo\ThemeBundle\Event\NotificationListEvent;
use Chamilo\ThemeBundle\Model\NotificationModel; use Chamilo\ThemeBundle\Model\NotificationModel;
/**
* Class NavbarNotificationListDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class NavbarNotificationListDemoListener class NavbarNotificationListDemoListener
{ {
public function onListNotifications(NotificationListEvent $event) public function onListNotifications(NotificationListEvent $event)
@ -27,5 +26,4 @@ class NavbarNotificationListDemoListener
new NotificationModel('some more notices', 'success'), new NotificationModel('some more notices', 'success'),
); );
} }
} }

@ -1,16 +1,15 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* NavbarShowUserListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener; namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\ShowUserEvent; use Chamilo\ThemeBundle\Event\ShowUserEvent;
use Chamilo\ThemeBundle\Model\UserModel; use Chamilo\ThemeBundle\Model\UserModel;
/**
* Class NavbarShowUserDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class NavbarShowUserDemoListener class NavbarShowUserDemoListener
{ {
public function onShowUser(ShowUserEvent $event) public function onShowUser(ShowUserEvent $event)

@ -1,16 +1,15 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* NavbarTaskListDemoListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener; namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\TaskListEvent; use Chamilo\ThemeBundle\Event\TaskListEvent;
use Chamilo\ThemeBundle\Model\TaskModel; use Chamilo\ThemeBundle\Model\TaskModel;
/**
* Class NavbarTaskListDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class NavbarTaskListDemoListener class NavbarTaskListDemoListener
{ {
public function onListTasks(TaskListEvent $event) public function onListTasks(TaskListEvent $event)

@ -1,16 +1,15 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* SetupThemeListener.php
* publisher
* Date: 01.05.14
*/
namespace Chamilo\ThemeBundle\EventListener; namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Theme\ThemeManager; use Chamilo\ThemeBundle\Theme\ThemeManager;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent; use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
/**
* Class SetupThemeListener
* @package Chamilo\ThemeBundle\EventListener
*/
class SetupThemeListener class SetupThemeListener
{ {
/** /**

@ -1,17 +1,16 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* SidebarSetupMenuDemoListener.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\EventListener; namespace Chamilo\ThemeBundle\EventListener;
use Chamilo\ThemeBundle\Event\SidebarMenuEvent; use Chamilo\ThemeBundle\Event\SidebarMenuEvent;
use Chamilo\ThemeBundle\Model\MenuItemModel; use Chamilo\ThemeBundle\Model\MenuItemModel;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
/**
* Class SidebarSetupMenuDemoListener
* @package Chamilo\ThemeBundle\EventListener
*/
class SidebarSetupMenuDemoListener class SidebarSetupMenuDemoListener
{ {
public function onSetupMenu(SidebarMenuEvent $event) public function onSetupMenu(SidebarMenuEvent $event)
@ -53,6 +52,4 @@ class SidebarSetupMenuDemoListener
return $items; return $items;
} }
} }

@ -1,9 +1,5 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* FormDemoModelType.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Form; namespace Chamilo\ThemeBundle\Form;
@ -11,6 +7,10 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* Class FormDemoModelType
* @package Chamilo\ThemeBundle\Form
*/
class FormDemoModelType extends AbstractType class FormDemoModelType extends AbstractType
{ {
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)

@ -1,15 +1,14 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* WidgetHelper.php
* avanzu-admin
* Date: 16.03.14
*/
namespace Chamilo\ThemeBundle\Helper; namespace Chamilo\ThemeBundle\Helper;
/**
class WidgetHelper extends \Twig_Extension { * Class WidgetHelper
* @package Chamilo\ThemeBundle\Helper
*/
class WidgetHelper extends \Twig_Extension
{
/** /**
* Get widget helper name * Get widget helper name
* @return string * @return string

@ -7,13 +7,13 @@
namespace Chamilo\ThemeBundle\Model; namespace Chamilo\ThemeBundle\Model;
/** /**
* Interface MenuItemInterface * Interface MenuItemInterface
* *
* @package Chamilo\ThemeBundle\Model * @package Chamilo\ThemeBundle\Model
*/ */
interface MenuItemInterface { interface MenuItemInterface
{
/** /**
* @return mixed * @return mixed
*/ */

@ -14,7 +14,6 @@ namespace Chamilo\ThemeBundle\Model;
*/ */
class MenuItemModel implements MenuItemInterface class MenuItemModel implements MenuItemInterface
{ {
/** /**
* @var mixed * @var mixed
*/ */

@ -7,7 +7,6 @@
namespace Chamilo\ThemeBundle\Model; namespace Chamilo\ThemeBundle\Model;
/** /**
* Representation of a displayable message in the theme's messages section * Representation of a displayable message in the theme's messages section
* *

@ -13,7 +13,6 @@ namespace Chamilo\ThemeBundle\Model;
*/ */
class MessageModel implements MessageInterface class MessageModel implements MessageInterface
{ {
/** /**
* Holds the sender * Holds the sender
* *

@ -1,13 +1,11 @@
<?php <?php
/**
* NotificationInterface.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model; namespace Chamilo\ThemeBundle\Model;
/**
* Interface NotificationInterface
* @package Chamilo\ThemeBundle\Model
*/
interface NotificationInterface interface NotificationInterface
{ {
public function getMessage(); public function getMessage();

@ -1,31 +1,24 @@
<?php <?php
/**
* NotificationModel.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model; namespace Chamilo\ThemeBundle\Model;
/**
* Class NotificationModel
* @package Chamilo\ThemeBundle\Model
*/
class NotificationModel implements NotificationInterface class NotificationModel implements NotificationInterface
{ {
protected $type; protected $type;
protected $message; protected $message;
protected $icon; protected $icon;
function __construct($message = null, $type = 'info', $icon = 'fa fa-warning') public function __construct($message = null, $type = 'info', $icon = 'fa fa-warning')
{ {
$this->message = $message; $this->message = $message;
$this->type = $type; $this->type = $type;
$this->icon = $icon; $this->icon = $icon;
} }
/** /**
* @param mixed $message * @param mixed $message
* *
@ -89,5 +82,4 @@ class NotificationModel implements NotificationInterface
{ {
return $this->message; return $this->message;
} }
} }

@ -1,15 +1,13 @@
<?php <?php
/**
* TaskInterface.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model; namespace Chamilo\ThemeBundle\Model;
/**
interface TaskInterface { * Interface TaskInterface
* @package Chamilo\ThemeBundle\Model
*/
interface TaskInterface
{
public function getColor(); public function getColor();
public function getProgress(); public function getProgress();
public function getTitle(); public function getTitle();

@ -1,13 +1,8 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* TaskModel.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model; namespace Chamilo\ThemeBundle\Model;
/** /**
* Class TaskModel * Class TaskModel
* *
@ -15,7 +10,6 @@ namespace Chamilo\ThemeBundle\Model;
*/ */
class TaskModel implements TaskInterface class TaskModel implements TaskInterface
{ {
/** /**
* *
*/ */

@ -1,13 +1,12 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* UserInterface.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model; namespace Chamilo\ThemeBundle\Model;
/**
* Interface UserInterface
* @package Chamilo\ThemeBundle\Model
*/
interface UserInterface interface UserInterface
{ {
public function getAvatar(); public function getAvatar();

@ -1,16 +1,14 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* UserModel.php
* avanzu-admin
* Date: 23.02.14
*/
namespace Chamilo\ThemeBundle\Model; namespace Chamilo\ThemeBundle\Model;
/**
* Class UserModel
* @package Chamilo\ThemeBundle\Model
*/
class UserModel implements UserInterface class UserModel implements UserInterface
{ {
/** /**
* @var string * @var string
*/ */
@ -31,7 +29,7 @@ class UserModel implements UserInterface
*/ */
protected $isOnline = false; protected $isOnline = false;
function __construct($username = '', $avatar = '', $memberSince = null, $isOnline = true) public function __construct($username = '', $avatar = '', $memberSince = null, $isOnline = true)
{ {
$this->avatar = $avatar; $this->avatar = $avatar;
$this->isOnline = $isOnline; $this->isOnline = $isOnline;
@ -39,7 +37,6 @@ class UserModel implements UserInterface
$this->username = $username; $this->username = $username;
} }
/** /**
* @param string $avatar * @param string $avatar
* *

@ -1,13 +1,12 @@
<?php <?php
/** /* For licensing terms, see /license.txt */
* DependencyResolverInterface.php
* publisher
* Date: 18.04.14
*/
namespace Chamilo\ThemeBundle\Util; namespace Chamilo\ThemeBundle\Util;
/**
* Interface DependencyResolverInterface
* @package Chamilo\ThemeBundle\Util
*/
interface DependencyResolverInterface interface DependencyResolverInterface
{ {
/** /**

Loading…
Cancel
Save