diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-01-24 10:56:31 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-24 10:56:31 -0600 |
commit | e09bba5e366d14223c1326ac4a08cf3e5904612a (patch) | |
tree | 824ddc7166e002b46bea6f1cff916785603c2494 /settings/templates | |
parent | f55260bc83feeb76ae662c7b97d092da83d8b6bb (diff) | |
parent | 38f684aadfb10d491fabfeb0af9a22c109c9cfff (diff) | |
download | nextcloud-server-e09bba5e366d14223c1326ac4a08cf3e5904612a.tar.gz nextcloud-server-e09bba5e366d14223c1326ac4a08cf3e5904612a.zip |
Merge pull request #3151 from nextcloud/navigation-icons
add icons to navigation of personal & admin settings
Diffstat (limited to 'settings/templates')
-rw-r--r-- | settings/templates/admin/frame.php | 20 | ||||
-rw-r--r-- | settings/templates/personal.php | 6 |
2 files changed, 21 insertions, 5 deletions
diff --git a/settings/templates/admin/frame.php b/settings/templates/admin/frame.php index 761d76c4434..2b234f4cd9b 100644 --- a/settings/templates/admin/frame.php +++ b/settings/templates/admin/frame.php @@ -30,14 +30,28 @@ script('files', 'jquery.fileupload'); <div id="app-navigation"> <ul> - <?php foreach($_['forms'] as $form) { + <?php + foreach($_['forms'] as $form) { if (isset($form['anchor'])) { $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]); + $class = 'nav-icon-' . $form['anchor']; $sectionName = $form['section-name']; $active = $form['active'] ? ' class="active"' : ''; - print_unescaped(sprintf("<li%s><a href='%s'>%s</a></li>", $active, \OCP\Util::sanitizeHTML($anchor), \OCP\Util::sanitizeHTML($sectionName))); + ?> + <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?>> + <a href="<?php p($anchor); ?>"> + <?php if (!empty($form['icon'])) { ?> + <img alt="" src="<?php print_unescaped($form['icon']); ?>"> + <span><?php p($form['section-name']); ?></span> + <?php } else { ?> + <span class="no-icon"><?php p($form['section-name']); ?></span> + <?php } ?> + </a> + </li> + <?php } - }?> + } + ?> </ul> </div> diff --git a/settings/templates/personal.php b/settings/templates/personal.php index a14982b9b74..d3a835c4a16 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -9,12 +9,14 @@ ?> <div id="app-navigation"> - <ul> + <ul class="with-icon"> <?php foreach($_['forms'] as $form) { if (isset($form['anchor'])) { $anchor = '#' . $form['anchor']; + $class = 'nav-icon-' . $form['anchor']; $sectionName = $form['section-name']; - print_unescaped(sprintf("<li><a href='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor), \OCP\Util::sanitizeHTML($sectionName))); + print_unescaped(sprintf("<li><a href='%s' class='%s'>%s</a></li>", \OCP\Util::sanitizeHTML($anchor), + \OCP\Util::sanitizeHTML($class), \OCP\Util::sanitizeHTML($sectionName))); } }?> </ul> |