Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
b9b409cf
Commit
b9b409cf
authored
Mar 01, 2017
by
Damyon Wiese
Browse files
MDL-40759 icons: Peer review fixes (all minor)
parent
1caabd84
Changes
42
Hide whitespace changes
Inline
Side-by-side
admin/tool/lp/templates/comment_area.mustache
View file @
b9b409cf
...
...
@@ -55,7 +55,7 @@
<div
class=
"mdl-left"
>
{{^
notoggle
}}
<a
href=
"#"
class=
"comment-link"
id=
"comment-link-
{{
cid
}}
"
>
{{#
pix
}}{{
collapsediconkey
}}
,
{{
linktext
}}{{/
pix
}}
<span
id=
"comment-link-text-
{{
cid
}}
"
>
{{
linktext
}}
{{#
pix
}}{{
collapsediconkey
}}
,
core,
{{
linktext
}}{{/
pix
}}
<span
id=
"comment-link-text-
{{
cid
}}
"
>
{{
linktext
}}
{{#
displaytotalcount
}}
(
{{
count
}}
)
{{/
displaytotalcount
}}
</span>
...
...
admin/tool/usertours/lib.php
View file @
b9b409cf
...
...
@@ -82,6 +82,6 @@ function tool_usertours_get_fontawesome_icon_map() {
return
[
'tool_usertours:t/export'
=>
'fa-download'
,
'tool_usertours:i/reload'
=>
'fa-refresh'
,
'tool_usertours:filler'
=>
'fa-spacer'
,
'tool_usertours:
t/
filler'
=>
'fa-spacer'
,
];
}
admin/user.php
View file @
b9b409cf
...
...
@@ -187,7 +187,7 @@
}
else
{
$columnicon
=
(
$dir
==
"ASC"
)
?
"sort_asc"
:
"sort_desc"
;
}
$columnicon
=
$OUTPUT
->
pix_icon
(
't/'
.
$columnicon
,
''
,
'core'
,
[
'class'
=>
'iconsort'
]);
$columnicon
=
$OUTPUT
->
pix_icon
(
't/'
.
$columnicon
,
get_string
(
$columndir
)
,
'core'
,
[
'class'
=>
'iconsort'
]);
}
$$column
=
"<a href=
\"
user.php?sort=
$column
&dir=
$columndir
\"
>"
.
$string
[
$column
]
.
"</a>
$columnicon
"
;
...
...
admin/user/user_bulk_cohortadd.php
View file @
b9b409cf
...
...
@@ -114,10 +114,9 @@ foreach ($columns as $column) {
}
else
{
$columndir
=
(
$dir
==
'asc'
)
?
'desc'
:
'asc'
;
$icon
=
't/down'
;
$iconstr
=
'movedown'
;
$iconstr
=
$columndir
;
if
(
$dir
!=
'asc'
)
{
$icon
=
't/up'
;
$iconstr
=
'moveup'
;
}
$columnicon
=
' '
.
$OUTPUT
->
pix_icon
(
$icon
,
get_string
(
$iconstr
));
}
...
...
admin/user/user_bulk_display.php
View file @
b9b409cf
...
...
@@ -58,10 +58,9 @@ foreach ($columns as $column) {
}
else
{
$columndir
=
$dir
==
'asc'
?
'desc'
:
'asc'
;
$icon
=
't/down'
;
$iconstr
=
'movedown'
;
$iconstr
=
$columndir
;
if
(
$dir
!=
'asc'
)
{
$icon
=
't/up'
;
$iconstr
=
'moveup'
;
}
$columnicon
=
' '
.
$OUTPUT
->
pix_icon
(
$icon
,
get_string
(
$iconstr
));
}
...
...
blocks/course_overview/renderer.php
View file @
b9b409cf
...
...
@@ -75,7 +75,8 @@ class block_course_overview_renderer extends plugin_renderer_base {
$moveurl
=
new
moodle_url
(
'/blocks/course_overview/move.php'
,
array
(
'sesskey'
=>
sesskey
(),
'moveto'
=>
0
,
'courseid'
=>
$movingcourseid
));
// Create move icon, so it can be used.
$movetofirsticon
=
$this
->
output
->
pix_icon
(
'movehere'
,
get_string
(
'movetofirst'
,
'block_course_overview'
,
$courses
[
$movingcourseid
]
->
fullname
));
$name
=
$courses
[
$movingcourseid
]
->
fullname
;
$movetofirsticon
=
$this
->
output
->
pix_icon
(
'movehere'
,
get_string
(
'movetofirst'
,
'block_course_overview'
,
$name
));
$moveurl
=
html_writer
::
link
(
$moveurl
,
$movetofirsticon
);
$html
.
=
html_writer
::
tag
(
'div'
,
$moveurl
,
array
(
'class'
=>
'movehere'
));
}
...
...
comment/comment.js
View file @
b9b409cf
...
...
@@ -339,7 +339,6 @@ M.core_comment = {
Templates
.
renderPix
(
'
t/delete
'
,
'
core
'
,
M
.
util
.
get_string
(
'
deletecomment
'
,
'
moodle
'
)).
then
(
function
(
html
)
{
Y
.
all
(
'
div.comment-delete a
'
).
set
(
'
innerHTML
'
,
html
);
}).
catch
(
Notification
.
exception
);
});
},
register_pagination
:
function
()
{
...
...
course/format/renderer.php
View file @
b9b409cf
...
...
@@ -162,7 +162,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
* @return string HTML to output.
*/
protected
function
section_left_content
(
$section
,
$course
,
$onsectionpage
)
{
$o
=
$this
->
output
->
spacer
()
;
$o
=
''
;
if
(
$section
->
section
!=
0
)
{
// Only in the non-general sections.
...
...
enrol/manual/lib.php
View file @
b9b409cf
...
...
@@ -730,4 +730,3 @@ class enrol_manual_plugin extends enrol_plugin {
}
}
files/classes/external/stored_file_exporter.php
View file @
b9b409cf
...
...
@@ -123,9 +123,6 @@ class stored_file_exporter extends \core\external\exporter {
'icon'
=>
array
(
'type'
=>
PARAM_RAW
,
),
'iconurl'
=>
array
(
'type'
=>
PARAM_URL
,
),
'timecreatedformatted'
=>
array
(
'type'
=>
PARAM_RAW
),
...
...
filter/emoticon/tests/filter_test.php
View file @
b9b409cf
...
...
@@ -54,7 +54,7 @@ class filter_emoticon_testcase extends advanced_testcase {
$this
->
assertEquals
(
$expected
,
$filter
->
filter
(
'(grr)'
,
$options
));
// And texts matching target formats are filtered.
$expected
=
'<i class="icon
fa s/angry fa-fw emoticon" aria-hidden="true" title=""></i><span class="sr-only"><
/s
p
an>'
;
$expected
=
'<i
mg
class="icon
emoticon" alt="angry" title="angry" src="http://www.example.com/moodle/theme/image.php/_s/boost/core/1
/s
/
an
gry" /
>'
;
$options
=
array
(
'originalformat'
=>
FORMAT_HTML
);
// Only FORMAT_HTML is filtered, see {@link testable_filter_emoticon}.
$this
->
assertEquals
(
$expected
,
$filter
->
filter
(
'(grr)'
,
$options
));
}
...
...
lib/amd/build/icon_system_fontawesome.min.js
View file @
b9b409cf
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
lib/amd/src/icon_system.js
View file @
b9b409cf
...
...
@@ -57,7 +57,7 @@ define(['jquery'], function($) {
* @return {String}
* @method renderIcon
*/
IconSystem
.
prototype
.
renderIcon
=
function
(
key
,
component
,
title
,
template
)
{
//eslint-disable-line no-unused-vars
IconSystem
.
prototype
.
renderIcon
=
function
(
key
,
component
,
title
,
template
)
{
//
eslint-disable-line no-unused-vars
throw
new
Error
(
'
Abstract function not implemented.
'
);
};
...
...
lib/amd/src/icon_system_fontawesome.js
View file @
b9b409cf
...
...
@@ -39,7 +39,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals
* Prefetch resources so later calls to renderIcon can be resolved synchronously.
*
* @method init
* @return Promise
* @return
{
Promise
}
*/
IconSystemFontawesome
.
prototype
.
init
=
function
()
{
if
(
staticMap
)
{
...
...
@@ -67,7 +67,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals
staticMap
=
{};
$
.
each
(
map
,
function
(
index
,
value
)
{
staticMap
[
value
.
component
+
'
/
'
+
value
.
pix
]
=
value
.
to
;
}
.
bind
(
this
)
);
});
LocalStorage
.
set
(
'
core/iconmap-fontawesome
'
,
JSON
.
stringify
(
staticMap
));
return
this
;
}.
bind
(
this
));
...
...
@@ -83,7 +83,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals
* @return {String}
* @method renderIcon
*/
IconSystemFontawesome
.
prototype
.
renderIcon
=
function
(
key
,
component
,
title
,
template
)
{
//eslint-disable-line no-unused-vars
IconSystemFontawesome
.
prototype
.
renderIcon
=
function
(
key
,
component
,
title
,
template
)
{
//
eslint-disable-line no-unused-vars
var
mappedIcon
=
staticMap
[
component
+
'
/
'
+
key
];
if
(
typeof
mappedIcon
===
"
undefined
"
)
{
mappedIcon
=
component
+
'
/
'
+
key
;
...
...
lib/amd/src/icon_system_standard.js
View file @
b9b409cf
...
...
@@ -42,7 +42,7 @@ define(['core/icon_system', 'core/url', 'core/mustache'],
* @return {String}
* @method renderIcon
*/
IconSystemStandard
.
prototype
.
renderIcon
=
function
(
key
,
component
,
title
,
template
)
{
//eslint-disable-line no-unused-vars
IconSystemStandard
.
prototype
.
renderIcon
=
function
(
key
,
component
,
title
,
template
)
{
//
eslint-disable-line no-unused-vars
var
url
=
CoreUrl
.
imageUrl
(
key
,
component
);
var
templatecontext
=
{
...
...
lib/classes/output/external.php
View file @
b9b409cf
...
...
@@ -107,11 +107,9 @@ class external extends external_api {
/**
* Return a mapping of icon names to icons.
*
* @param string $system
* @return array the mapping
*/
public
static
function
load_fontawesome_icon_map
()
{
$instance
=
icon_system
::
instance
(
icon_system
::
FONTAWESOME
);
$map
=
$instance
->
get_icon_name_map
();
...
...
lib/classes/output/icon_system.php
View file @
b9b409cf
...
...
@@ -28,6 +28,8 @@ namespace core\output;
use
renderer_base
;
use
pix_icon
;
defined
(
'MOODLE_INTERNAL'
)
||
die
();
/**
* Class allowing different systems for mapping and rendering icons.
*
...
...
@@ -42,15 +44,37 @@ use pix_icon;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract
class
icon_system
{
/**
* @const STANDARD Default icon system.
*/
const
STANDARD
=
'\\core\\output\\icon_system_standard'
;
/**
* @const FONTAWESOME Default icon system.
*/
const
FONTAWESOME
=
'\\core\\output\\icon_system_fontawesome'
;
/**
* @var \core\output\icon_system $instance The cached default instance
*/
private
static
$instance
=
null
;
/**
* @var array $map A cached mapping of moodle icons to other icons
*/
private
$map
=
null
;
/**
* Constructor
*/
private
function
__construct
()
{
}
/**
* Factory method
*
* @param $type Either a specific type, or null to get the default type.
* @return \core\output\icon_system
*/
public
final
static
function
instance
(
$type
=
null
)
{
global
$PAGE
;
...
...
lib/classes/output/icon_system_font.php
View file @
b9b409cf
...
...
@@ -25,6 +25,8 @@
namespace
core\output
;
defined
(
'MOODLE_INTERNAL'
)
||
die
();
/**
* Class allowing different systems for mapping and rendering icons.
*
...
...
lib/classes/output/icon_system_fontawesome.php
View file @
b9b409cf
...
...
@@ -28,6 +28,8 @@ namespace core\output;
use
renderer_base
;
use
pix_icon
;
defined
(
'MOODLE_INTERNAL'
)
||
die
();
/**
* Class allowing different systems for mapping and rendering icons.
*
...
...
@@ -43,6 +45,11 @@ use pix_icon;
*/
class
icon_system_fontawesome
extends
icon_system_font
{
/**
* @var array $map Cached map of moodle icon names to font awesome icon names.
*/
private
$map
=
[];
public
function
get_core_icon_map
()
{
return
[
'core:docs'
=>
'fa-info-circle'
,
...
...
@@ -89,7 +96,7 @@ class icon_system_fontawesome extends icon_system_font {
'core:e/delete'
=>
'fa-minus'
,
'core:e/delete_table'
=>
'fa-minus'
,
'core:e/document_properties'
=>
'fa-info'
,
'core:e/emoticons'
=>
'fa-
meh
-o'
,
'core:e/emoticons'
=>
'fa-
smile
-o'
,
'core:e/find_replace'
=>
'fa-search-plus'
,
'core:e/forward'
=>
'fa-arrow-right'
,
'core:e/fullpage'
=>
'fa-arrows-alt'
,
...
...
@@ -241,7 +248,7 @@ class icon_system_fontawesome extends icon_system_font {
'core:i/completion-manual-enabled'
=>
'fa-square-o'
,
'core:i/completion-manual-y'
=>
'fa-check-square'
,
'core:i/completion-manual-n'
=>
'fa-square-o'
,
'core:i/completion
-
self'
=>
'fa-user-o'
,
'core:i/completion
_
self'
=>
'fa-user-o'
,
'core:i/lock'
=>
'fa-lock'
,
'core:i/courseevent'
=>
'fa-calendar'
,
'core:i/course'
=>
'fa-globe'
,
...
...
@@ -252,10 +259,10 @@ class icon_system_fontawesome extends icon_system_font {
'core:i/duration'
=>
'fa-clock-o'
,
'core:i/edit'
=>
'fa-pencil'
,
'core:i/email'
=>
'fa-envelope'
,
'core:i/enrolmentsuspended'
=>
'fa-us
er-circl
e'
,
'core:i/enrolmentsuspended'
=>
'fa-
pa
use'
,
'core:i/enrolusers'
=>
'fa-user-plus'
,
'core:i/expired'
=>
'fa-exclamation text-warning'
,
'core:i/export'
=>
'fa-
level-
down'
,
'core:i/export'
=>
'fa-down
load
'
,
'core:i/files'
=>
'fa-file'
,
'core:i/filter'
=>
'fa-filter'
,
'core:i/flagged'
=>
'fa-flag'
,
...
...
@@ -270,7 +277,7 @@ class icon_system_fontawesome extends icon_system_font {
'core:i/groups'
=>
'fa-user-circle'
,
'core:i/groupv'
=>
'fa-user-circle-o'
,
'core:i/hide'
=>
'fa-eye'
,
'core:i/h
e
irarchylock'
=>
'fa-lock'
,
'core:i/hi
e
rarchylock'
=>
'fa-lock'
,
'core:i/import'
=>
'fa-level-up'
,
'core:i/info'
=>
'fa-info'
,
'core:i/invalid'
=>
'fa-exclamation text-danger'
,
...
...
@@ -289,7 +296,7 @@ class icon_system_fontawesome extends icon_system_font {
'core:i/moodle_host'
=>
'fa-graduation-cap'
,
'core:i/move_2d'
=>
'fa-arrows'
,
'core:i/navigationitem'
=>
'fa-angle-right'
,
'core:i/n
s
_red_mark'
=>
'fa-remove'
,
'core:i/n
e
_red_mark'
=>
'fa-remove'
,
'core:i/new'
=>
'fa-plus'
,
'core:i/news'
=>
'fa-newspaper-o'
,
'core:i/nosubcat'
=>
'fa-plus-square-o'
,
...
...
@@ -324,7 +331,7 @@ class icon_system_fontawesome extends icon_system_font {
'core:i/settings'
=>
'fa-cogs'
,
'core:i/show'
=>
'fa-eye-slash'
,
'core:i/siteevent'
=>
'fa-share-alt'
,
'core:i/starrating'
=>
'fa-star'
,
'core:i/star
-
rating'
=>
'fa-star'
,
'core:i/stats'
=>
'fa-line-chart'
,
'core:i/switch'
=>
'fa-exchange'
,
'core:i/switchrole'
=>
'fa-user-secret'
,
...
...
@@ -418,8 +425,6 @@ class icon_system_fontawesome extends icon_system_font {
];
}
private
$map
=
[];
/**
* Overridable function to get a mapping of all icons.
* Default is to do no mapping.
...
...
lib/classes/output/icon_system_standard.php
View file @
b9b409cf
...
...
@@ -28,6 +28,8 @@ namespace core\output;
use
renderer_base
;
use
pix_icon
;
defined
(
'MOODLE_INTERNAL'
)
||
die
();
/**
* Standard icon rendering. No mapping - img tags used.
*
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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