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
mahara
mahara
Commits
6de0f5af
Commit
6de0f5af
authored
Jul 19, 2016
by
Son Nguyen
Committed by
Gerrit Code Review
Jul 19, 2016
Browse files
Merge "Clarify that "no license chosen" means default copyright"
parents
0f4084d3
7943364a
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/internal/blocktype/textbox/lib.php
View file @
6de0f5af
...
...
@@ -398,7 +398,7 @@ EOF;
'type'
=>
'html'
,
'class'
=>
$readonly
?
''
:
'hidden'
,
'title'
=>
get_string
(
'license'
),
'value'
=>
'<div id="instconf_licensereadonly_display">'
.
(
isset
(
$artefact
)
?
render_license
(
$artefact
)
:
get_string
(
'licensenone'
))
.
'</div>'
,
'value'
=>
'<div id="instconf_licensereadonly_display">'
.
(
isset
(
$artefact
)
?
render_license
(
$artefact
)
:
get_string
(
'licensenone
1
'
))
.
'</div>'
,
),
'allowcomments'
=>
array
(
'type'
=>
'switchbox'
,
...
...
htdocs/lang/en.utf8/mahara.php
View file @
6de0f5af
...
...
@@ -194,9 +194,8 @@ $string['license'] = 'License';
$string
[
'licenseother'
]
=
'Other license (enter URL)'
;
$string
[
'licenseotherurl'
]
=
'Enter URL'
;
$string
[
'licensedesc'
]
=
'The license for this content.'
;
$string
[
'licensenone'
]
=
'None selected'
;
$string
[
'licensenonedetailed'
]
=
'%s has not chosen a license for this content.'
;
$string
[
'licensenonedetailedowner'
]
=
'You have not chosen a license for this content.'
;
$string
[
'licensenone1'
]
=
'All rights reserved'
;
$string
[
'licensenonedetailed1'
]
=
'© %s, all rights reserved'
;
$string
[
'licensingadvanced'
]
=
'Advanced licensing'
;
$string
[
'licensor'
]
=
'Licensor'
;
$string
[
'licensordesc'
]
=
'The original licensor for this content.'
;
...
...
htdocs/lib/license.php
View file @
6de0f5af
...
...
@@ -55,7 +55,7 @@ function license_form_el_basic($artefact, $always_allow_none=false) {
$include_noneselected
=
true
;
}
if
(
$include_noneselected
)
{
$options
[
''
]
=
get_string
(
'licensenone'
);
$options
[
''
]
=
get_string
(
'licensenone
1
'
);
}
if
(
empty
(
$artefact
))
{
...
...
@@ -262,15 +262,32 @@ function render_license($artefact) {
$license
=
$artefact
->
get
(
'license'
);
$licensor
=
$artefact
->
get
(
'licensor'
);
$licensorurl
=
$artefact
->
get
(
'licensorurl'
);
// TODO: Should probably rewrite this URL cleanup code
if
(
$licensorurl
)
{
if
(
$licensor
==
''
)
{
$licensor
=
preg_replace
(
'(^https?://)'
,
''
,
$license
);
}
if
(
strpos
(
$licensorurl
,
'://'
)
===
FALSE
)
{
$licensorurl
=
'http://'
.
$licensorurl
;
}
}
if
(
$license
)
{
$details
=
get_record
(
'artefact_license'
,
'name'
,
$license
);
}
else
if
(
$USER
->
get
(
'id'
)
==
$artefact
->
get
(
'owner'
))
{
return
get_string
(
'licensenonedetailedowner'
);
}
else
{
return
get_string
(
'licensenonedetailed'
,
'mahara'
,
$artefact
->
display_owner
());
// No license selected, so it's the default "all rights reserved" to the copyright holder
if
(
$licensor
)
{
$copyrightholder
=
$licensor
;
}
else
{
$copyrightholder
=
$artefact
->
display_owner
();
}
if
(
$licensorurl
)
{
$copyrightholder
=
'<a href="'
.
hsc
(
$licensorurl
)
.
'" class="licensor">'
.
hsc
(
$copyrightholder
)
.
"</a>"
;
}
return
get_string
(
'licensenonedetailed1'
,
'mahara'
,
$copyrightholder
);
}
if
(
strpos
(
$license
,
'://'
)
===
FALSE
)
{
...
...
@@ -294,13 +311,7 @@ function render_license($artefact) {
hsc
(
preg_replace
(
'(^https?://)'
,
''
,
$license
))
.
'</a>'
;
}
if
(
$licensorurl
!=
''
)
{
if
(
$licensor
==
''
)
{
$licensor
=
preg_replace
(
'(^https?://)'
,
''
,
$license
);
}
if
(
strpos
(
$licensorurl
,
'://'
)
===
FALSE
)
{
$licensorurl
=
'http://'
.
$licensorurl
;
}
if
(
$licensorurl
)
{
$html
.
=
'<br>'
.
get_string
(
'licensor'
)
.
': '
.
'<a href="'
.
hsc
(
$licensorurl
)
.
'" class="licensor">'
.
hsc
(
$licensor
)
.
'</a>'
;
...
...
Write
Preview
Supports
Markdown
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