Skip to content

Commit f7ea85a

Browse files
lucaboeschFriederike-cil
authored andcommitted
Coding style adoptions.
1 parent d358e1a commit f7ea85a

22 files changed

+76
-141
lines changed

action.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
* @package mod_pdfannotator
2929
* @copyright 2018 RWTH Aachen (see README.md)
30-
* @author Rabea de Groot, Anna Heynkes, Friederike Schwager
30+
* @author Rabea de Groot, Anna Heynkes, Friederike Schwager
3131
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3232
*/
3333

@@ -388,8 +388,6 @@
388388

389389
$comments = pdfannotator_comment::read($documentid, $annotationid, $context);
390390

391-
// require_once($CFG->dirroot . '/mod/pdfannotator/classes/output/comment.php');
392-
393391
$myrenderer = $PAGE->get_renderer('mod_pdfannotator');
394392
$templatable = new comment($comments, $cm, $context);
395393

@@ -455,7 +453,7 @@
455453

456454
$commentid = required_param('commentId', PARAM_INT);
457455
$content = required_param('content', PARAM_RAW);
458-
456+
459457
$data = pdfannotator_comment::update($commentid, $content, $editanypost);
460458
echo json_encode($data);
461459
}

backup/moodle2/backup_pdfannotator_activity_task.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ protected function define_my_steps() {
7575
* @param string $content some HTML text that eventually contains URLs to the activity instance scripts
7676
* @return string the content with the URLs encoded
7777
*/
78-
static public function encode_content_links($content) {
78+
public static function encode_content_links($content) {
7979

8080
global $CFG, $DB;
8181

backup/moodle2/backup_pdfannotator_stepslib.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,27 @@ protected function define_structure() {
5454

5555
// 2. Define each element separately.
5656
$pdfannotator = new backup_nested_element('pdfannotator', array('id'), array(
57-
'name', 'intro', 'introformat', 'usevotes', 'useprint', 'useprintcomments', 'use_studenttextbox', 'use_studentdrawing', 'useprivatecomments', 'useprotectedcomments', 'timecreated', 'timemodified'));
57+
'name', 'intro', 'introformat', 'usevotes', 'useprint', 'useprintcomments', 'use_studenttextbox', 'use_studentdrawing',
58+
'useprivatecomments', 'useprotectedcomments', 'timecreated', 'timemodified'));
5859

5960
$annotations = new backup_nested_element('annotations');
60-
$annotation = new backup_nested_element('annotation', array('id'), array('page', 'userid', 'annotationtypeid', 'data', 'timecreated', 'timemodified', 'modifiedby'));
61+
$annotation = new backup_nested_element('annotation', array('id'), array('page', 'userid', 'annotationtypeid',
62+
'data', 'timecreated', 'timemodified', 'modifiedby'));
6163

6264
$subscriptions = new backup_nested_element('subscriptions');
6365
$subscription = new backup_nested_element('subscription', array('id'), array('userid'));
6466

6567
$comments = new backup_nested_element('comments');
66-
$c = array('pdfannotatorid', 'userid', 'content', 'timecreated', 'timemodified', 'modifiedby', 'visibility', 'isquestion', 'isdeleted', 'ishidden', 'solved');
68+
$c = array('pdfannotatorid', 'userid', 'content', 'timecreated', 'timemodified', 'modifiedby', 'visibility',
69+
'isquestion', 'isdeleted', 'ishidden', 'solved');
6770
$comment = new backup_nested_element('comment', array('id'), $c);
6871

6972
$votes = new backup_nested_element('votes');
7073
$vote = new backup_nested_element('vote', array('id'), array('userid', 'annotationid'));
7174

7275
$reports = new backup_nested_element('reports');
73-
$report = new backup_nested_element('report', array('id'), array('courseid', 'pdfannotatorid', 'message', 'userid', 'timecreated', 'seen'));
76+
$report = new backup_nested_element('report', array('id'), array('courseid', 'pdfannotatorid', 'message',
77+
'userid', 'timecreated', 'seen'));
7478

7579
// 3. Build the tree (mind the right order!)
7680
$pdfannotator->add_child($annotations);
@@ -97,7 +101,8 @@ protected function define_structure() {
97101
// Add all annotations specific to this annotator instance.
98102
$annotation->set_source_sql('SELECT a.* FROM {pdfannotator_annotations} a '
99103
. 'JOIN {pdfannotator_comments} c ON a.id = c.annotationid '
100-
. "WHERE a.pdfannotatorid = ? AND c.isquestion = 1 AND (c.visibility = 'public' OR c.visibility = 'anonymous') ",
104+
. "WHERE a.pdfannotatorid = ? AND c.isquestion = 1 AND "
105+
. "(c.visibility = 'public' OR c.visibility = 'anonymous') ",
101106
array('pdfannotatorid' => backup::VAR_PARENTID));
102107

103108
// Add any subscriptions to this annotation.

backup/moodle2/restore_pdfannotator_activity_task.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function define_my_steps() {
5757
* Define the contents in the activity that must be
5858
* processed by the link decoder.
5959
*/
60-
static public function define_decode_contents() {
60+
public static function define_decode_contents() {
6161
$contents = array();
6262

6363
$contents[] = new restore_decode_content('pdfannotator', array('intro'), 'pdfannotator');
@@ -69,7 +69,7 @@ static public function define_decode_contents() {
6969
* Define the decoding rules for links belonging
7070
* to the activity to be executed by the link decoder
7171
*/
72-
static public function define_decode_rules() {
72+
public static function define_decode_rules() {
7373
$rules = array();
7474

7575
$rules[] = new restore_decode_rule('PDFANNOTATORVIEWBYID', '/mod/pdfannotator/view.php?id=$1', 'course_module');
@@ -85,7 +85,7 @@ static public function define_decode_rules() {
8585
* pdfannotator logs. It must return one array
8686
* of {@see restore_log_rule} objects
8787
*/
88-
static public function define_restore_log_rules() {
88+
public static function define_restore_log_rules() {
8989
$rules = array();
9090

9191
$rules[] = new restore_log_rule('pdfannotator', 'add', 'view.php?id={course_module}', '{pdfannotator}');
@@ -105,7 +105,7 @@ static public function define_restore_log_rules() {
105105
* by the restore final task, but are defined here at
106106
* activity level. All them are rules not linked to any module instance (cmid = 0)
107107
*/
108-
static public function define_restore_log_rules_for_course() {
108+
public static function define_restore_log_rules_for_course() {
109109
$rules = array();
110110

111111
$rules[] = new restore_log_rule('pdfannotator', 'view all', 'index.php?id={course}', null);

classes/event/report_added.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ public function get_description() {
5454
public function get_url() {
5555
return new \moodle_url('/mod/pdfannotator/view.php', array('id' => $this->other['cmid'], 'action' => 'overview'));
5656
}
57-
}
57+
}

classes/output/comment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
namespace mod_pdfannotator\output;
1818
use moodle_url;
1919

20+
defined('MOODLE_INTERNAL') || die();
21+
2022
/**
2123
* Renderable for comments.
2224
*
@@ -25,8 +27,6 @@
2527
* @author Friederike Schwager
2628
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2729
*/
28-
defined('MOODLE_INTERNAL') || die();
29-
3030
class comment implements \renderable, \templatable {
3131

3232
private $comments = [];

classes/output/printview.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ public function export_for_template(\renderer_base $output) {
5252
return $data;
5353
}
5454

55-
}
55+
}

classes/privacy/provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,4 @@ public static function empty_or_delete_comment($comment) {
440440
}
441441
}
442442

443-
}
443+
}

constants.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* @package mod_pdfannotator
1818
* @copyright 2018 RWTH Aachen (see README.md)
19-
* @author Rabea de Groot, Anna Heynkes, Friederike Schwager
19+
* @author Rabea de Groot, Anna Heynkes, Friederike Schwager
2020
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2121
*/
2222

@@ -36,6 +36,6 @@
3636

3737

3838
/**
39-
* Prefix needed for encode64 imaged
39+
* Prefix needed for encode64 images
4040
*/
41-
define('IMAGE_PREFIX', 'data:image/png;base64,');
41+
define('IMAGE_PREFIX', 'data:image/png;base64,');

controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* @package mod_pdfannotator
1919
* @copyright 2018 RWTH Aachen (see README.md)
20-
* @author Anna Heynkes, Friederike Schwager
20+
* @author Anna Heynkes, Friederike Schwager
2121
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2222
*/
2323

@@ -570,4 +570,4 @@
570570
$mform->display();
571571
}
572572
return;
573-
}
573+
}

0 commit comments

Comments
 (0)