Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
762eb128
Commit
762eb128
authored
Jun 19, 2019
by
Robert Lyon
Committed by
Gerrit Code Review
Jun 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1044878: Editing duplicated content"
parents
f32aad1f
62d8203a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
27 deletions
+42
-27
htdocs/artefact/internal/blocktype/textbox/lib.php
htdocs/artefact/internal/blocktype/textbox/lib.php
+8
-3
htdocs/artefact/lib.php
htdocs/artefact/lib.php
+19
-17
htdocs/lib/view.php
htdocs/lib/view.php
+15
-7
No files found.
htdocs/artefact/internal/blocktype/textbox/lib.php
View file @
762eb128
...
...
@@ -219,8 +219,13 @@ function updateTextContent(a) {
jQuery('#instconf_tagsreadonly_container').removeClass('d-none');
}
jQuery('#instconf_edit_container').removeClass('d-none');
jQuery('#instconf_otherblocksmsg_container').removeClass('d-none');
jQuery('#instconf_edit').trigger('change');
jQuery('#instconf_otherblocksmsg_container').removeClass('d-none');
jQuery('#artefactid_data input.radio').each(function() {
if (jQuery(this).prop('checked')) {
jQuery('#textbox_blockcount').html(jQuery(this).attr('data-count'));
}
});
}
jQuery('#chooseartefactlink').on('click', function(e) {
e.preventDefault();
...
...
@@ -233,7 +238,7 @@ jQuery('#chooseartefactlink').on('click', function(e) {
jQuery('#instconf_artefactid_container').toggleClass('d-none');
jQuery('#instconf_managenotes_container').toggleClass('d-none');
});
jQuery('#instconf #instconf_edit').on('change',function()
{
jQuery('#instconf #instconf_edit').on('change',function(){
if (jQuery(this).prop('checked')) {
jQuery('#instconf_textreadonly_container').addClass('d-none');
jQuery('#instconf_text_container').removeClass('d-none');
...
...
@@ -241,7 +246,7 @@ jQuery('#instconf #instconf_edit').on('change',function() {
else {
jQuery('#instconf_textreadonly_container').removeClass('d-none');
jQuery('#instconf_text_container').addClass('d-none');
tinyMCE.
get('instconf_text').setContent(
jQuery('#instconf_textreadonly_display').html()
)
;
tinyMCE.
activeEditor.getBody().innerHTML =
jQuery('#instconf_textreadonly_display').html();
}
});
jQuery('#instconf a.copytextboxnote').each(function() {
...
...
htdocs/artefact/lib.php
View file @
762eb128
...
...
@@ -2030,24 +2030,26 @@ function artefact_get_owner_info($ids) {
$ids
);
$wwwroot
=
get_config
(
'wwwroot'
);
foreach
(
$data
as
&
$d
)
{
if
(
$d
->
institution
==
'mahara'
)
{
$name
=
get_config
(
'sitename'
);
$url
=
$wwwroot
;
}
else
if
(
$d
->
institution
)
{
$name
=
$d
->
displayname
;;
$url
=
$wwwroot
.
'institution/index.php?institution='
.
$d
->
institution
;
}
else
if
(
$d
->
group
)
{
$name
=
$d
->
groupname
;;
$url
=
group_homepage_url
((
object
)
array
(
'id'
=>
$d
->
group
,
'urlid'
=>
$d
->
groupurlid
));
}
else
{
$name
=
display_name
(
$d
);
$url
=
profile_url
(
$d
);
if
(
$data
)
{
foreach
(
$data
as
&
$d
)
{
if
(
$d
->
institution
==
'mahara'
)
{
$name
=
get_config
(
'sitename'
);
$url
=
$wwwroot
;
}
else
if
(
$d
->
institution
)
{
$name
=
$d
->
displayname
;;
$url
=
$wwwroot
.
'institution/index.php?institution='
.
$d
->
institution
;
}
else
if
(
$d
->
group
)
{
$name
=
$d
->
groupname
;;
$url
=
group_homepage_url
((
object
)
array
(
'id'
=>
$d
->
group
,
'urlid'
=>
$d
->
groupurlid
));
}
else
{
$name
=
display_name
(
$d
);
$url
=
profile_url
(
$d
);
}
$d
=
(
object
)
array
(
'name'
=>
$name
,
'url'
=>
$url
);
}
$d
=
(
object
)
array
(
'name'
=>
$name
,
'url'
=>
$url
);
}
return
$data
;
}
...
...
htdocs/lib/view.php
View file @
762eb128
...
...
@@ -3506,12 +3506,14 @@ class View {
if
(
!
empty
(
$data
[
'ownerinfo'
]))
{
require_once
(
get_config
(
'docroot'
)
.
'artefact/lib.php'
);
$userid
=
(
$group
||
$institution
)
?
null
:
$USER
->
get
(
'id'
);
foreach
(
artefact_get_owner_info
(
array_keys
(
$artefacts
))
as
$k
=>
$v
)
{
if
(
$artefacts
[
$k
]
->
owner
!==
$userid
||
$artefacts
[
$k
]
->
group
!==
$group
||
$artefacts
[
$k
]
->
institution
!==
$institution
)
{
$artefacts
[
$k
]
->
ownername
=
$v
->
name
;
$artefacts
[
$k
]
->
ownerurl
=
$v
->
url
;
if
(
artefact_get_owner_info
(
array_keys
(
$artefacts
)))
{
foreach
(
artefact_get_owner_info
(
array_keys
(
$artefacts
))
as
$k
=>
$v
)
{
if
(
$artefacts
[
$k
]
->
owner
!==
$userid
||
$artefacts
[
$k
]
->
group
!==
$group
||
$artefacts
[
$k
]
->
institution
!==
$institution
)
{
$artefacts
[
$k
]
->
ownername
=
$v
->
name
;
$artefacts
[
$k
]
->
ownerurl
=
$v
->
url
;
}
}
}
}
...
...
@@ -3523,10 +3525,16 @@ class View {
$artefact
=
call_static_method
(
$blocktypeclass
,
'artefactchooser_get_element_data'
,
$artefact
);
}
$artefact
->
blockcount
=
0
;
if
(
$blocks
=
get_column
(
'view_artefact'
,
'block'
,
'artefact'
,
$artefact
->
id
))
{
$blocks
=
array_unique
(
$blocks
);
$artefact
->
blockcount
=
count
(
$blocks
);
}
// Build the radio button or checkbox for the artefact
$formcontrols
=
''
;
if
(
$selectone
)
{
$formcontrols
.
=
'<input type="radio" class="radio" id="'
.
hsc
(
$elementname
.
'_'
.
$artefact
->
id
)
$formcontrols
.
=
'<input type="radio" class="radio"
data-count="'
.
$artefact
->
blockcount
.
'"
id="'
.
hsc
(
$elementname
.
'_'
.
$artefact
->
id
)
.
'" name="'
.
hsc
(
$elementname
)
.
'" value="'
.
hsc
(
$artefact
->
id
)
.
'"'
;
if
(
$value
==
$artefact
->
id
)
{
$formcontrols
.
=
' checked="checked"'
;
...
...
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