mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Merge branch 'MDL-63253-master-adminsearchresults' of git://github.com/mudrd8mz/moodle
This commit is contained in:
commit
de7c685e52
@ -22,7 +22,7 @@
|
||||
Context variables required for this template:
|
||||
* actionurl - Url to post to
|
||||
* hasresults - True if there are results
|
||||
* results - List of results containing url, title, settings (array of raw html)
|
||||
* results - List of results containing url, title, path (array of strings), settings (array of raw html)
|
||||
* showsave - Show save buttons
|
||||
|
||||
Example context (json):
|
||||
@ -30,7 +30,7 @@
|
||||
"actionurl": "/",
|
||||
"hasresults": true,
|
||||
"results": [
|
||||
{ "url": "/", "title": "Match!", "settings": [ "blah blah blah" ] }
|
||||
{ "url": "/", "title": "Match!", "path": ["Administration", "Match!"], "settings": [ "blah blah blah" ] }
|
||||
]
|
||||
}
|
||||
}}
|
||||
@ -41,9 +41,15 @@
|
||||
</div>
|
||||
<fieldset>
|
||||
<div class="clearer"></div>
|
||||
<h2 class="main">{{#str}}searchresults, admin{{/str}}</h2>
|
||||
{{#hasresults}}
|
||||
{{#results}}
|
||||
<h2 class="main">{{#str}}searchresults, admin{{/str}} - <a href="{{url}}">{{{title}}}</a></h2>
|
||||
<h3 class="adminpagetitle"><a href="{{url}}">{{{title}}}</a></h3>
|
||||
<ul class="adminpagepath" aria-label="{{#str}} pagepath, core {{/str}}">
|
||||
{{#path}}
|
||||
<li>{{.}}</li>
|
||||
{{/path}}
|
||||
</ul>
|
||||
<fieldset class="adminsettings">
|
||||
{{#settings}}
|
||||
<div class="clearer"></div>
|
||||
|
@ -8179,6 +8179,15 @@ function admin_search_settings_html($query) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Locate the page in the admin root and populate its visiblepath attribute.
|
||||
$path = array();
|
||||
$located = $adminroot->locate($page->name, true);
|
||||
if ($located) {
|
||||
foreach ($located->visiblepath as $pathitem) {
|
||||
array_unshift($path, (string) $pathitem);
|
||||
}
|
||||
}
|
||||
|
||||
$sectionsettings = [];
|
||||
if (!empty($settings)) {
|
||||
foreach ($settings as $setting) {
|
||||
@ -8198,6 +8207,7 @@ function admin_search_settings_html($query) {
|
||||
|
||||
$tpldata->results[] = (object) [
|
||||
'title' => $heading,
|
||||
'path' => $path,
|
||||
'url' => $headingurl->out(false),
|
||||
'settings' => $sectionsettings
|
||||
];
|
||||
|
@ -804,3 +804,26 @@
|
||||
#overriderolestable .overriddenpermission {
|
||||
@extend .table-warning;
|
||||
}
|
||||
|
||||
#page-admin-search {
|
||||
.adminpagetitle {
|
||||
margin-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
.adminpagepath {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 0 1.5rem 0;
|
||||
li {
|
||||
@extend .text-muted;
|
||||
@extend .small;
|
||||
+ li:before {
|
||||
padding-right: 0.5rem;
|
||||
padding-left: 0.5rem;
|
||||
content: "#{$breadcrumb-divider}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2691,7 +2691,8 @@ hr {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.1); }
|
||||
|
||||
small,
|
||||
.small {
|
||||
.small,
|
||||
#page-admin-search .adminpagepath li {
|
||||
font-size: 80%;
|
||||
font-weight: 400; }
|
||||
|
||||
@ -8448,7 +8449,7 @@ a.dimmed_text:visited,
|
||||
.usersuspended a:visited,
|
||||
.dimmed_category,
|
||||
.dimmed_category a, .tag_feed .media .muted a, #page-admin-qtypes .disabled,
|
||||
#page-admin-qbehaviours .disabled, #page-admin-plugins #plugins-control-panel .pluginname .componentname, #page-admin-plugins #plugins-control-panel .version .versionnumber, #page-admin-plugins #plugins-control-panel .notes .requiredby, #plugins-check-page .page-description, #plugins-check-page #plugins-check .requires-ok, #plugins-check-page #plugins-check .displayname .plugindir, #plugins-check-page #plugins-check-available-dependencies .displayname .component, .block .minicalendar td.weekend, .section .activity .stealth, .course-content .section-summary .section-summary-activities .activity-count, .course-content ul li.section.hidden .sectionname > span,
|
||||
#page-admin-qbehaviours .disabled, #page-admin-plugins #plugins-control-panel .pluginname .componentname, #page-admin-plugins #plugins-control-panel .version .versionnumber, #page-admin-plugins #plugins-control-panel .notes .requiredby, #plugins-check-page .page-description, #plugins-check-page #plugins-check .requires-ok, #plugins-check-page #plugins-check .displayname .plugindir, #plugins-check-page #plugins-check-available-dependencies .displayname .component, #page-admin-search .adminpagepath li, .block .minicalendar td.weekend, .section .activity .stealth, .course-content .section-summary .section-summary-activities .activity-count, .course-content ul li.section.hidden .sectionname > span,
|
||||
.course-content ul li.section.hidden .content > div.summary,
|
||||
.course-content ul li.section.hidden .activity .activityinstance, #course-category-listings .listitem[data-visible="0"], #course-category-listings .listitem[data-visible="0"] > div > a, #course-category-listings .listing-pagination-totals.dimmed, .fitem.disabled .fp-btn-choose, .form-defaultinfo,
|
||||
.form-label .form-shortname, .formsettingheading .form-horizontal, .no-felement.fstatic, .path-backup .backup_progress .backup_stage {
|
||||
@ -10974,6 +10975,21 @@ div.editor_atto_toolbar button .icon {
|
||||
.modal.modal-in-page {
|
||||
z-index: 0; }
|
||||
|
||||
#page-admin-search .adminpagetitle {
|
||||
margin-bottom: 0;
|
||||
border-bottom: none; }
|
||||
|
||||
#page-admin-search .adminpagepath {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 0 1.5rem 0; }
|
||||
#page-admin-search .adminpagepath li + li:before {
|
||||
padding-right: 0.5rem;
|
||||
padding-left: 0.5rem;
|
||||
content: "/"; }
|
||||
|
||||
.blockmovetarget .accesshide {
|
||||
position: relative;
|
||||
left: initial; }
|
||||
|
@ -15,7 +15,24 @@
|
||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
Settings.
|
||||
@template core_admin/settings_search_results
|
||||
|
||||
Admin setting search results template.
|
||||
|
||||
Context variables required for this template:
|
||||
* actionurl - Url to post to
|
||||
* hasresults - True if there are results
|
||||
* results - List of results containing url, title, path (array of strings), settings (array of raw html)
|
||||
* showsave - Show save buttons
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"actionurl": "/",
|
||||
"hasresults": true,
|
||||
"results": [
|
||||
{ "url": "/", "title": "Match!", "path": ["Administration", "Match!"], "settings": [ "blah blah blah" ] }
|
||||
]
|
||||
}
|
||||
}}
|
||||
<form action="{{actionurl}}" method="post" id="adminsettings">
|
||||
<div>
|
||||
@ -24,9 +41,15 @@
|
||||
</div>
|
||||
<fieldset>
|
||||
<div class="clearer"></div>
|
||||
<h2 class="main">{{#str}}searchresults, admin{{/str}}</h2>
|
||||
{{#hasresults}}
|
||||
{{#results}}
|
||||
<h2 class="main">{{#str}}searchresults, admin{{/str}} - <a href="{{url}}">{{{title}}}</a></h2>
|
||||
<h3 class="adminpagetitle"><a href="{{url}}">{{{title}}}</a></h3>
|
||||
<ul class="adminpagepath" aria-label="{{#str}} pagepath, core {{/str}}">
|
||||
{{#path}}
|
||||
<li>{{.}}</li>
|
||||
{{/path}}
|
||||
</ul>
|
||||
<fieldset class="adminsettings">
|
||||
{{#settings}}
|
||||
<div class="clearer"></div>
|
||||
|
@ -858,3 +858,26 @@ img.iconsmall {
|
||||
#page-admin-registration-index form .mark {
|
||||
background-color: @warningBackground;
|
||||
}
|
||||
|
||||
#page-admin-search {
|
||||
.adminpagetitle {
|
||||
margin-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
.adminpagepath {
|
||||
list-style: none;
|
||||
margin: 0 0 10px 0;
|
||||
li {
|
||||
.muted;
|
||||
display: inline;
|
||||
font-size: @fontSizeSmall;
|
||||
+ li:before {
|
||||
content: "◀\00a0";
|
||||
/*rtl:remove*/
|
||||
content: "▶\00a0"; /* stylelint-disable-line declaration-block-no-duplicate-properties */
|
||||
color: #ccc;
|
||||
font-size: @fontSizeSmall;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5575,6 +5575,27 @@ img.iconsmall {
|
||||
#page-admin-registration-index form .mark {
|
||||
background-color: #fcf8e3;
|
||||
}
|
||||
#page-admin-search .adminpagetitle {
|
||||
margin-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
#page-admin-search .adminpagepath {
|
||||
list-style: none;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
#page-admin-search .adminpagepath li {
|
||||
color: #999;
|
||||
display: inline;
|
||||
font-size: 11.9px;
|
||||
}
|
||||
#page-admin-search .adminpagepath li + li:before {
|
||||
content: "◀\00a0";
|
||||
/*rtl:remove*/
|
||||
content: "▶\00a0";
|
||||
/* stylelint-disable-line declaration-block-no-duplicate-properties */
|
||||
color: #ccc;
|
||||
font-size: 11.9px;
|
||||
}
|
||||
/* calendar.less */
|
||||
.calendar_event_category {
|
||||
background-color: #d8bfd8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user