mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 23:42:11 +02:00
Merge branch 'MDL-56919-master' of git://github.com/junpataleta/moodle
This commit is contained in:
commit
805659e1fa
@ -15,14 +15,48 @@
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
Action link.
|
||||
@template core/action_link
|
||||
|
||||
Action link template.
|
||||
|
||||
Context variables required for this template:
|
||||
* disabled - Flag that indicates whether the action link to be rendered is disabled or not.
|
||||
* url - The action link URL.
|
||||
* id - The ID.
|
||||
* classes - CSS classes for the action link.
|
||||
* attributes - Array of attributes.
|
||||
* name - Attribute name.
|
||||
* value - Attribute value.
|
||||
* icon - The icon context data for this action link.
|
||||
* text - The text for this action link.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"disabled": false,
|
||||
"url": "#",
|
||||
"id": "test-id",
|
||||
"classes": "btn btn-link",
|
||||
"attributes": [
|
||||
{
|
||||
"name": "title",
|
||||
"value": "Action link's title"
|
||||
}
|
||||
],
|
||||
"icon": {
|
||||
"attributes": [
|
||||
{"name": "src", "value": "https://raw.githubusercontent.com/moodle/moodle/master/pix/t/check.png"},
|
||||
{"name": "alt", "value": "Action link's icon"}
|
||||
]
|
||||
},
|
||||
"text": "This is an action link"
|
||||
}
|
||||
}}
|
||||
{{^disabled}}
|
||||
<a href="{{{url}}}" id="{{id}}" class="{{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}}{{/attributes}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}}</a>
|
||||
<a href="{{{url}}}" id="{{id}}" class="{{classes}}" {{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}}</a>
|
||||
{{#hasactions}}
|
||||
{{> core/actions }}
|
||||
{{/hasactions}}
|
||||
{{/disabled}}
|
||||
{{#disabled}}
|
||||
<span class="currentlink">{{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}}</span>
|
||||
<span class="currentlink {{classes}}" {{#attributes}} {{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}>{{#icon}}{{>core/pix_icon}}{{/icon}}{{{text}}}</span>
|
||||
{{/disabled}}
|
||||
|
@ -7146,6 +7146,7 @@ function forum_extend_settings_navigation(settings_navigation $settingsnav, navi
|
||||
|
||||
if ($canmanage) {
|
||||
$mode = $forumnode->add(get_string('subscriptionmode', 'forum'), null, navigation_node::TYPE_CONTAINER);
|
||||
$mode->add_class('subscriptionmode');
|
||||
|
||||
$allowchoice = $mode->add(get_string('subscriptionoptional', 'forum'), new moodle_url('/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'mode'=>FORUM_CHOOSESUBSCRIBE, 'sesskey'=>sesskey())), navigation_node::TYPE_SETTING);
|
||||
$forceforever = $mode->add(get_string("subscriptionforced", "forum"), new moodle_url('/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'mode'=>FORUM_FORCESUBSCRIBE, 'sesskey'=>sesskey())), navigation_node::TYPE_SETTING);
|
||||
@ -7156,18 +7157,22 @@ function forum_extend_settings_navigation(settings_navigation $settingsnav, navi
|
||||
case FORUM_CHOOSESUBSCRIBE : // 0
|
||||
$allowchoice->action = null;
|
||||
$allowchoice->add_class('activesetting');
|
||||
$allowchoice->icon = new pix_icon('t/selected', '', 'mod_forum');
|
||||
break;
|
||||
case FORUM_FORCESUBSCRIBE : // 1
|
||||
$forceforever->action = null;
|
||||
$forceforever->add_class('activesetting');
|
||||
$forceforever->icon = new pix_icon('t/selected', '', 'mod_forum');
|
||||
break;
|
||||
case FORUM_INITIALSUBSCRIBE : // 2
|
||||
$forceinitially->action = null;
|
||||
$forceinitially->add_class('activesetting');
|
||||
$forceinitially->icon = new pix_icon('t/selected', '', 'mod_forum');
|
||||
break;
|
||||
case FORUM_DISALLOWSUBSCRIBE : // 3
|
||||
$disallowchoice->action = null;
|
||||
$disallowchoice->add_class('activesetting');
|
||||
$disallowchoice->icon = new pix_icon('t/selected', '', 'mod_forum');
|
||||
break;
|
||||
}
|
||||
|
||||
|
BIN
mod/forum/pix/t/selected.png
Normal file
BIN
mod/forum/pix/t/selected.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 205 B |
3
mod/forum/pix/t/selected.svg
Normal file
3
mod/forum/pix/t/selected.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
|
||||
]><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" preserveAspectRatio="xMinYMid meet" overflow="visible"><path d="M11.4.6l-.9-.5c-.4-.2-1-.1-1.3.4L4.7 8.2 2 6.6C1.5 6.3.9 6.5.6 7l-.5.8c-.2.5-.1 1.1.4 1.4L5 11.8c.1.1.3.1.4.1.4.1.8-.1 1-.5L11.8 2c.3-.5.1-1.1-.4-1.4z" fill="#999"/></svg>
|
After Width: | Height: | Size: 473 B |
@ -719,22 +719,25 @@ class core_renderer extends \core_renderer {
|
||||
continue;
|
||||
}
|
||||
if ($menuitem->action) {
|
||||
$text = $menuitem->text;
|
||||
if ($menuitem->action instanceof action_link) {
|
||||
$link = $menuitem->action;
|
||||
} else {
|
||||
$link = new action_link($menuitem->action, $menuitem->text, null, null, $menuitem->icon);
|
||||
}
|
||||
if ($indent) {
|
||||
$link->add_class('m-l-1');
|
||||
}
|
||||
} else {
|
||||
if ($onlytopleafnodes) {
|
||||
$skipped = true;
|
||||
continue;
|
||||
}
|
||||
$link = $menuitem->text;
|
||||
$link = new action_link(new moodle_url('#'), $menuitem->text, null, ['disabled' => true], $menuitem->icon);
|
||||
}
|
||||
if ($indent) {
|
||||
$link->add_class('m-l-1');
|
||||
}
|
||||
if (!empty($menuitem->classes)) {
|
||||
$link->add_class(implode(" ", $menuitem->classes));
|
||||
}
|
||||
|
||||
$menu->add_secondary_action($link);
|
||||
$skipped = $skipped || $this->build_action_menu_from_navigation($menu, $menuitem, true);
|
||||
}
|
||||
|
@ -10,7 +10,8 @@
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
a:first-of-type > .icon {
|
||||
a:first-of-type > .icon,
|
||||
span:first-of-type > .icon {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
|
||||
|
@ -91,6 +91,17 @@ select {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Style for the forum subscription mode node.
|
||||
.subscriptionmode {
|
||||
color: $body-color;
|
||||
}
|
||||
|
||||
// Style for the currently selected subscription mode.
|
||||
.activesetting {
|
||||
color: $body-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.forumpost {
|
||||
|
Loading…
x
Reference in New Issue
Block a user