mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-66849 output: Remove custom menu title when not specified
This commit is contained in:
parent
df0e58adb1
commit
8056397b7e
@ -3763,11 +3763,10 @@ class custom_menu extends custom_menu_item {
|
||||
$setting = trim($setting);
|
||||
if (!empty($setting)) {
|
||||
switch ($i) {
|
||||
case 0:
|
||||
case 0: // Menu text.
|
||||
$itemtext = ltrim($setting, '-');
|
||||
$itemtitle = $itemtext;
|
||||
break;
|
||||
case 1:
|
||||
case 1: // URL.
|
||||
try {
|
||||
$itemurl = new moodle_url($setting);
|
||||
} catch (moodle_exception $exception) {
|
||||
@ -3776,10 +3775,10 @@ class custom_menu extends custom_menu_item {
|
||||
$itemurl = null;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 2: // Title attribute.
|
||||
$itemtitle = $setting;
|
||||
break;
|
||||
case 3:
|
||||
case 3: // Language.
|
||||
if (!empty($language)) {
|
||||
$itemlanguages = array_map('trim', explode(',', $setting));
|
||||
$itemvisible &= in_array($language, $itemlanguages);
|
||||
|
@ -33,7 +33,7 @@
|
||||
{{^divider}}
|
||||
{{#haschildren}}
|
||||
<li class="dropdown nav-item">
|
||||
<a class="dropdown-toggle nav-link" id="drop-down-{{uniqid}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#" aria-controls="drop-down-menu-{{uniqid}}">
|
||||
<a class="dropdown-toggle nav-link" id="drop-down-{{uniqid}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#" {{#title}}title="{{{title}}}"{{/title}} aria-controls="drop-down-menu-{{uniqid}}">
|
||||
{{{text}}}
|
||||
</a>
|
||||
<div class="dropdown-menu" role="menu" id="drop-down-menu-{{uniqid}}" aria-labelledby="drop-down-{{uniqid}}">
|
||||
|
@ -321,7 +321,7 @@ EOF;
|
||||
$itemurl = $item->get_url();
|
||||
$this->assertTrue($itemurl instanceof moodle_url);
|
||||
$this->assertEquals('http://moodle.org', $itemurl->out());
|
||||
$this->assertEquals($item->get_text(), $item->get_title()); // Implicit title.
|
||||
$this->assertNull($item->get_title()); // Implicit title.
|
||||
|
||||
/** @var custom_menu_item $item */
|
||||
$item = array_shift($firstlevel);
|
||||
|
Loading…
x
Reference in New Issue
Block a user