@@ -48,7 +48,7 @@ |
||
| 48 | 48 | * |
| 49 | 49 | * @param UserInterface $from |
| 50 | 50 | * @param string $subject |
| 51 | - * @param null $sentAt |
|
| 51 | + * @param \DateTime $sentAt |
|
| 52 | 52 | * @param UserInterface $to |
| 53 | 53 | */ |
| 54 | 54 | function __construct(UserInterface $from = null, $subject = '', $sentAt = null, UserInterface $to = null) |
@@ -52,6 +52,10 @@ |
||
| 52 | 52 | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | + /** |
|
| 56 | + * @param string $id |
|
| 57 | + * @param string $src |
|
| 58 | + */ |
|
| 55 | 59 | public function registerStyle($id, $src, $deps = array()) |
| 56 | 60 | { |
| 57 | 61 | if (!isset($this->stylesheets[$id])) { |
@@ -27,22 +27,26 @@ |
||
| 27 | 27 | /** |
| 28 | 28 | * @return \Symfony\Component\HttpFoundation\Response |
| 29 | 29 | */ |
| 30 | - public function dashboardAction() { |
|
| 30 | + public function dashboardAction() |
|
| 31 | + { |
|
| 31 | 32 | return $this->render('ChamiloThemeBundle:Default:index.html.twig'); |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | /** |
| 35 | 36 | * @return \Symfony\Component\HttpFoundation\Response |
| 36 | 37 | */ |
| 37 | - public function uiGeneralAction() { |
|
| 38 | + public function uiGeneralAction() |
|
| 39 | + { |
|
| 38 | 40 | return $this->render('ChamiloThemeBundle:Default:index.html.twig'); |
| 39 | 41 | } |
| 40 | 42 | |
| 41 | - public function uiIconsAction() { |
|
| 43 | + public function uiIconsAction() |
|
| 44 | + { |
|
| 42 | 45 | return $this->render('ChamiloThemeBundle:Default:index.html.twig'); |
| 43 | 46 | } |
| 44 | 47 | |
| 45 | - public function formAction() { |
|
| 48 | + public function formAction() |
|
| 49 | + { |
|
| 46 | 50 | $form = $this->createForm(new FormDemoModelType()); |
| 47 | 51 | return $this->render('ChamiloThemeBundle:Default:form.html.twig', array( |
| 48 | 52 | 'form' => $form->createView() |
@@ -72,11 +72,14 @@ |
||
| 72 | 72 | /** |
| 73 | 73 | * @return MenuItemInterface|null |
| 74 | 74 | */ |
| 75 | - public function getActive() { |
|
| 75 | + public function getActive() |
|
| 76 | + { |
|
| 76 | 77 | |
| 77 | 78 | foreach ($this->getItems() as $item) { |
| 78 | 79 | /** @var $item MenuItemInterface */ |
| 79 | - if ($item->isActive()) return $item; |
|
| 80 | + if ($item->isActive()) { |
|
| 81 | + return $item; |
|
| 82 | + } |
|
| 80 | 83 | } |
| 81 | 84 | return null; |
| 82 | 85 | } |
@@ -69,7 +69,8 @@ |
||
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | //$keep_href = ''; |
| 72 | - if ($element->hasAttributes()) { //in some cases we get here with an empty attributes array |
|
| 72 | + if ($element->hasAttributes()) { |
|
| 73 | +//in some cases we get here with an empty attributes array |
|
| 73 | 74 | // TODO: Find when and why we get such a case (empty array). |
| 74 | 75 | $attributes = $element->attributes; |
| 75 | 76 | foreach ($attributes as $attrib) { |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | // load templates |
| 16 | 16 | function reports_loadTemplates() { |
| 17 | - global $reports_enabled_templates, $reports_template; |
|
| 18 | - foreach ($reports_enabled_templates as $t) |
|
| 19 | - require_once 'templates/'.$t.'.reports.php'; |
|
| 17 | + global $reports_enabled_templates, $reports_template; |
|
| 18 | + foreach ($reports_enabled_templates as $t) |
|
| 19 | + require_once 'templates/'.$t.'.reports.php'; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
@@ -149,18 +149,18 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | // return tools ID (parametre is a constant from main_api |
| 151 | 151 | function reports_getToolId($tool) { |
| 152 | - $tools = array_flip(api_get_tools_lists()); |
|
| 153 | - if (array_key_exists($tool, $tools)) |
|
| 154 | - return $tools[$tool]; |
|
| 155 | - else |
|
| 156 | - return null; |
|
| 152 | + $tools = array_flip(api_get_tools_lists()); |
|
| 153 | + if (array_key_exists($tool, $tools)) |
|
| 154 | + return $tools[$tool]; |
|
| 155 | + else |
|
| 156 | + return null; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // return a sql clause returning triplet of (course, $session, $uid) the |
| 160 | 160 | // current user is authorized to reed |
| 161 | 161 | function reports_getVisibilitySQL() { |
| 162 | - return "select cru.user_id from ".Database::get_main_table(TABLE_MAIN_COURSE_USER).' cru'; |
|
| 163 | - // fixme sessions |
|
| 162 | + return "select cru.user_id from ".Database::get_main_table(TABLE_MAIN_COURSE_USER).' cru'; |
|
| 163 | + // fixme sessions |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // this function execute keys_query (SQL statement) |
@@ -13,11 +13,13 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | // load templates |
| 16 | -function reports_loadTemplates() { |
|
| 16 | +function reports_loadTemplates() |
|
| 17 | +{ |
|
| 17 | 18 | global $reports_enabled_templates, $reports_template; |
| 18 | - foreach ($reports_enabled_templates as $t) |
|
| 19 | - require_once 'templates/'.$t.'.reports.php'; |
|
| 20 | -} |
|
| 19 | + foreach ($reports_enabled_templates as $t) { |
|
| 20 | + require_once 'templates/'.$t.'.reports.php'; |
|
| 21 | + } |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | |
| 23 | 25 | // clear all reporting data |
@@ -148,17 +150,20 @@ discard block |
||
| 148 | 150 | } |
| 149 | 151 | */ |
| 150 | 152 | // return tools ID (parametre is a constant from main_api |
| 151 | -function reports_getToolId($tool) { |
|
| 153 | +function reports_getToolId($tool) |
|
| 154 | +{ |
|
| 152 | 155 | $tools = array_flip(api_get_tools_lists()); |
| 153 | - if (array_key_exists($tool, $tools)) |
|
| 154 | - return $tools[$tool]; |
|
| 155 | - else |
|
| 156 | - return null; |
|
| 157 | -} |
|
| 156 | + if (array_key_exists($tool, $tools)) { |
|
| 157 | + return $tools[$tool]; |
|
| 158 | + } else { |
|
| 159 | + return null; |
|
| 160 | + } |
|
| 161 | + } |
|
| 158 | 162 | |
| 159 | 163 | // return a sql clause returning triplet of (course, $session, $uid) the |
| 160 | 164 | // current user is authorized to reed |
| 161 | -function reports_getVisibilitySQL() { |
|
| 165 | +function reports_getVisibilitySQL() |
|
| 166 | +{ |
|
| 162 | 167 | return "select cru.user_id from ".Database::get_main_table(TABLE_MAIN_COURSE_USER).' cru'; |
| 163 | 168 | // fixme sessions |
| 164 | 169 | } |
@@ -26,7 +26,8 @@ discard block |
||
| 26 | 26 | * @param array $specific_fields |
| 27 | 27 | * @return array $sf_terms |
| 28 | 28 | */ |
| 29 | -function get_usual_sf_terms($filter, $specific_fields) { |
|
| 29 | +function get_usual_sf_terms($filter, $specific_fields) |
|
| 30 | +{ |
|
| 30 | 31 | $sf_terms = array(); |
| 31 | 32 | $dkterms = chamilo_query_simple_query('', 0, 1000, $filter); |
| 32 | 33 | |
@@ -52,7 +53,8 @@ discard block |
||
| 52 | 53 | $specific_fields = get_specific_field_list(); |
| 53 | 54 | $sf_terms = array(); |
| 54 | 55 | |
| 55 | -if (($cid = api_get_course_id()) != -1) { // with cid |
|
| 56 | +if (($cid = api_get_course_id()) != -1) { |
|
| 57 | +// with cid |
|
| 56 | 58 | // course filter |
| 57 | 59 | $filter[] = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID.$cid); |
| 58 | 60 | // term filter |
@@ -63,12 +65,14 @@ discard block |
||
| 63 | 65 | } |
| 64 | 66 | |
| 65 | 67 | $sf_terms = get_usual_sf_terms($filter, $specific_fields); |
| 66 | -} else { // without cid |
|
| 68 | +} else { |
|
| 69 | +// without cid |
|
| 67 | 70 | if ($term != '__all__') { |
| 68 | 71 | $filter[] = chamilo_get_boolean_query($prefix.$term); |
| 69 | 72 | |
| 70 | 73 | $sf_terms = get_usual_sf_terms($filter, $specific_fields); |
| 71 | - } else { // no cid and all/any terms |
|
| 74 | + } else { |
|
| 75 | +// no cid and all/any terms |
|
| 72 | 76 | foreach ($specific_fields as $specific_field) { |
| 73 | 77 | foreach (xapian_get_all_terms(1000, $specific_field['code']) as $raw_term) { |
| 74 | 78 | if (count($raw_term['name']) > 1) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | if ($quota_bytes != 0) { |
| 88 | - $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
| 88 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $session[] = array(addslashes(get_lang('Teacher').': '.$user_name).' ('.format_file_size($quota_bytes).')', $quota_percentage); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'), $user_name)), $quota_percentage); |
| 107 | 107 | |
| 108 | - } |
|
| 108 | + } |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $quota_percentage = round(($total_quota_bytes - $used_quota_bytes) / $total_quota_bytes, 2) * 100; |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | }; |
| 86 | 86 | }); |
| 87 | 87 | </script> |
| 88 | -HTML; |
|
| 88 | +html; |
|
| 89 | 89 | |
| 90 | 90 | $interbreadcrumb[] = array("url"=>"./exercise.php", "name"=> get_lang('Exercises')); |
| 91 | 91 | if ($origin == 'learnpath') { |