Gitlab CSE Unil
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
M. Chardon
moodle-assignfeedback_editpdfplus
Commits
7113edc3
Commit
7113edc3
authored
Jul 12, 2017
by
M. Chardon
Browse files
typetool : libellé et configuration enabled
parent
c8931d2c
Changes
8
Show whitespace changes
Inline
Side-by-side
classes/admin_editor.php
View file @
7113edc3
...
@@ -186,11 +186,11 @@ class admin_editor {
...
@@ -186,11 +186,11 @@ class admin_editor {
$tools
=
array
();
$tools
=
array
();
$records
=
$DB
->
get_records
(
'assignfeedback_editpp_tool'
,
array
(
'axis'
=>
$axisid
));
$records
=
$DB
->
get_records
(
'assignfeedback_editpp_tool'
,
array
(
'axis'
=>
$axisid
));
foreach
(
$records
as
$record
)
{
foreach
(
$records
as
$record
)
{
if
(
$record
->
id
==
$tool
->
id
)
{
//
if ($record->id == $tool->id) {
array_push
(
$tools
,
$tool
);
//
array_push($tools, $tool);
}
else
{
//
} else {
array_push
(
$tools
,
new
tool
(
$record
));
array_push
(
$tools
,
new
tool
(
$record
));
}
//
}
}
}
usort
(
$tools
,
function
(
$a
,
$b
)
{
usort
(
$tools
,
function
(
$a
,
$b
)
{
$al
=
$a
->
order_tool
;
$al
=
$a
->
order_tool
;
...
@@ -214,7 +214,7 @@ class admin_editor {
...
@@ -214,7 +214,7 @@ class admin_editor {
global
$DB
;
global
$DB
;
$tools
=
array
();
$tools
=
array
();
$records
=
$DB
->
get_records
(
'assignfeedback_editpp_tool'
,
array
(
'axis'
=>
$
data
->
axisid
));
$records
=
$DB
->
get_records
(
'assignfeedback_editpp_tool'
,
array
(
'axis'
=>
$
toolJson
->
axisid
));
foreach
(
$records
as
$record
)
{
foreach
(
$records
as
$record
)
{
array_push
(
$tools
,
new
tool
(
$record
));
array_push
(
$tools
,
new
tool
(
$record
));
}
}
...
@@ -265,4 +265,19 @@ class admin_editor {
...
@@ -265,4 +265,19 @@ class admin_editor {
return
null
;
return
null
;
}
}
/**
* Get all the type tools.
* @param array $contextidlist
* @return type_tool
*/
public
static
function
get_typetools
()
{
global
$DB
;
$typetools
=
array
();
$records
=
$DB
->
get_records
(
'assignfeedback_editpp_typet'
,
array
(
'configurable'
=>
1
));
foreach
(
$records
as
$record
)
{
array_push
(
$typetools
,
new
type_tool
(
$record
));
}
return
$typetools
;
}
}
}
classes/type_tool.php
View file @
7113edc3
...
@@ -53,6 +53,9 @@ class type_tool {
...
@@ -53,6 +53,9 @@ class type_tool {
/** @var int ending location of cartridge in pixels. Image resolution is 100 pixels per inch */
/** @var int ending location of cartridge in pixels. Image resolution is 100 pixels per inch */
public
$cartridge_y
=
0
;
public
$cartridge_y
=
0
;
/** @var type */
public
$configurable
=
1
;
/**
/**
* Convert a compatible stdClass into an instance of this class.
* Convert a compatible stdClass into an instance of this class.
* @param stdClass $record
* @param stdClass $record
...
...
db/upgrade.php
View file @
7113edc3
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
*/
*/
defined
(
'MOODLE_INTERNAL'
)
||
die
();
defined
(
'MOODLE_INTERNAL'
)
||
die
();
use
assignfeedback_editpdfplus\type_tool
;
/**
/**
* EditPDF upgrade code
* EditPDF upgrade code
* @param int $oldversion
* @param int $oldversion
...
@@ -36,10 +38,8 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
...
@@ -36,10 +38,8 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
// Moodle v2.8.0 release upgrade line.
// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.
// Put any upgrade step following this.
// Moodle v2.9.0 release upgrade line.
// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.
// Put any upgrade step following this.
// Moodle v3.0.0 release upgrade line.
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Put any upgrade step following this.
...
@@ -67,7 +67,6 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
...
@@ -67,7 +67,6 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
// Put any upgrade step following this.
...
@@ -87,5 +86,38 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
...
@@ -87,5 +86,38 @@ function xmldb_assignfeedback_editpdfplus_upgrade($oldversion) {
upgrade_plugin_savepoint
(
true
,
2017022700
,
'assignfeedback'
,
'editpdfplus'
);
upgrade_plugin_savepoint
(
true
,
2017022700
,
'assignfeedback'
,
'editpdfplus'
);
}
}
if
(
$oldversion
<
2017071202
)
{
$table
=
new
xmldb_table
(
'assignfeedback_editpp_typet'
);
$field
=
new
xmldb_field
(
'configurable'
,
XMLDB_TYPE_INTEGER
,
'1'
,
null
,
XMLDB_NOTNULL
,
null
,
1
);
if
(
!
$dbman
->
field_exists
(
$table
,
$field
))
{
$dbman
->
add_field
(
$table
,
$field
);
}
$record1
=
$DB
->
get_record
(
'assignfeedback_editpp_typet'
,
array
(
'label'
=>
'highlight'
),
'*'
,
MUST_EXIST
);
$typeTool1
=
new
type_tool
(
$record1
);
$typeTool1
->
configurable
=
0
;
$DB
->
update_record
(
'assignfeedback_editpp_typet'
,
$typeTool1
);
$record2
=
$DB
->
get_record
(
'assignfeedback_editpp_typet'
,
array
(
'label'
=>
'oval'
),
'*'
,
MUST_EXIST
);
$typeTool2
=
new
type_tool
(
$record2
);
$typeTool2
->
configurable
=
0
;
$DB
->
update_record
(
'assignfeedback_editpp_typet'
,
$typeTool2
);
$record3
=
$DB
->
get_record
(
'assignfeedback_editpp_typet'
,
array
(
'label'
=>
'rectangle'
),
'*'
,
MUST_EXIST
);
$typeTool3
=
new
type_tool
(
$record3
);
$typeTool3
->
configurable
=
0
;
$DB
->
update_record
(
'assignfeedback_editpp_typet'
,
$typeTool3
);
$record4
=
$DB
->
get_record
(
'assignfeedback_editpp_typet'
,
array
(
'label'
=>
'line'
),
'*'
,
MUST_EXIST
);
$typeTool4
=
new
type_tool
(
$record4
);
$typeTool4
->
configurable
=
0
;
$DB
->
update_record
(
'assignfeedback_editpp_typet'
,
$typeTool4
);
$record5
=
$DB
->
get_record
(
'assignfeedback_editpp_typet'
,
array
(
'label'
=>
'pen'
),
'*'
,
MUST_EXIST
);
$typeTool5
=
new
type_tool
(
$record5
);
$typeTool5
->
configurable
=
0
;
$DB
->
update_record
(
'assignfeedback_editpp_typet'
,
$typeTool5
);
// Editpdf savepoint reached.
upgrade_plugin_savepoint
(
true
,
2017071202
,
'assignfeedback'
,
'editpdfplus'
);
}
return
true
;
return
true
;
}
}
lang/en/assignfeedback_editpdfplus.php
View file @
7113edc3
...
@@ -109,3 +109,9 @@ $string['editpdfplus:notify'] = 'Receive notifications';
...
@@ -109,3 +109,9 @@ $string['editpdfplus:notify'] = 'Receive notifications';
$string
[
'admintitle'
]
=
'Feedback configuration'
;
$string
[
'admintitle'
]
=
'Feedback configuration'
;
$string
[
'adminsubtitle'
]
=
'Configuration of tools bar for advanded PDF annotation'
;
$string
[
'adminsubtitle'
]
=
'Configuration of tools bar for advanded PDF annotation'
;
$string
[
'admincurrenttoolbar'
]
=
'Current toolbar'
;
$string
[
'admincurrenttoolbar'
]
=
'Current toolbar'
;
$string
[
'typetool_highlightplus'
]
=
'Highlight with comment'
;
$string
[
'typetool_stampplus'
]
=
'Stamp with custom text'
;
$string
[
'typetool_frame'
]
=
'Framing elements with comment'
;
$string
[
'typetool_verticalline'
]
=
'Vertical line with comment'
;
$string
[
'typetool_stampcomment'
]
=
'Double arrow stamp with comment'
;
$string
[
'typetool_commentplus'
]
=
'Advanced comment frame'
;
lang/fr/assignfeedback_editpdfplus.php
View file @
7113edc3
...
@@ -109,5 +109,11 @@ $string['editpdfplus:notify'] = 'Recevoir les notifications';
...
@@ -109,5 +109,11 @@ $string['editpdfplus:notify'] = 'Recevoir les notifications';
$string
[
'admintitle'
]
=
'Feedback configuration'
;
$string
[
'admintitle'
]
=
'Feedback configuration'
;
$string
[
'adminsubtitle'
]
=
'Configuration de la barre d\'outils de l\'annotation PDF avancée'
;
$string
[
'adminsubtitle'
]
=
'Configuration de la barre d\'outils de l\'annotation PDF avancée'
;
$string
[
'admincurrenttoolbar'
]
=
'Barre d\'outils en cours'
;
$string
[
'admincurrenttoolbar'
]
=
'Barre d\'outils en cours'
;
$string
[
'typetool_highlightplus'
]
=
'Surlignement avec commentaires'
;
$string
[
'typetool_stampplus'
]
=
'Tampon avec contenu personalisé'
;
$string
[
'typetool_frame'
]
=
'Encadrement d\'éléments avec commentaires'
;
$string
[
'typetool_verticalline'
]
=
'Ligne verticale avec commentaires'
;
$string
[
'typetool_stampcomment'
]
=
'Tamon double flèche avec commentaires'
;
$string
[
'typetool_commentplus'
]
=
'Cadre de commentaire avancé'
;
locallib_admin.php
View file @
7113edc3
...
@@ -150,7 +150,10 @@ class assign_feedback_editpdfplus_admin {
...
@@ -150,7 +150,10 @@ class assign_feedback_editpdfplus_admin {
$tool
->
removable
=
true
;
$tool
->
removable
=
true
;
$data
->
tool
=
$tool
;
$data
->
tool
=
$tool
;
}
}
$data
->
tools
=
page_editor
::
get_typetools
(
null
);
$data
->
tools
=
admin_editor
::
get_typetools
();
foreach
(
$data
->
tools
as
$toolRef
)
{
$toolRef
->
libelle
=
get_string
(
'typetool_'
.
$toolRef
->
label
,
'assignfeedback_editpdfplus'
);
}
$renderer
=
$PAGE
->
get_renderer
(
'assignfeedback_editpdfplus'
);
$renderer
=
$PAGE
->
get_renderer
(
'assignfeedback_editpdfplus'
);
//$formTool->courseid = $this->course->id;
//$formTool->courseid = $this->course->id;
$html
.
=
$renderer
->
render_assignfeedback_editpdfplus_widget_admin_toolform
(
$data
);
$html
.
=
$renderer
->
render_assignfeedback_editpdfplus_widget_admin_toolform
(
$data
);
...
...
templates/tool_form.mustache
View file @
7113edc3
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
<select
class=
"form-control"
id=
"typetool"
name=
"typetool"
>
<select
class=
"form-control"
id=
"typetool"
name=
"typetool"
>
{{#
tools
}}
{{#
tools
}}
<option
value=
'
{{
id
}}
'
>
{{
l
a
bel
}}
</option>
<option
value=
'
{{
id
}}
'
>
{{
l
i
bel
le
}}
</option>
{{/
tools
}}
{{/
tools
}}
</select>
</select>
</div>
</div>
...
...
version.php
View file @
7113edc3
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
version
=
2017071
100
;
$plugin
->
version
=
2017071
202
;
$plugin
->
requires
=
2017050500
;
// Requires this Moodle version.
$plugin
->
requires
=
2017050500
;
// Requires this Moodle version.
$plugin
->
dependencies
=
array
(
$plugin
->
dependencies
=
array
(
'assignfeedback_editpdf'
=>
2017050500
'assignfeedback_editpdf'
=>
2017050500
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment