add external links
This commit is contained in:
parent
8aa08dbc6b
commit
caa9c092ef
|
@ -26,7 +26,6 @@ use OCP\IRequest;
|
|||
|
||||
class CssController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \OCP\IConfig
|
||||
*/
|
||||
|
|
|
@ -31,7 +31,7 @@ use OC\URLGenerator;
|
|||
class NavController extends Controller
|
||||
{
|
||||
/**
|
||||
* @var \OCP\IConfig
|
||||
* @var IConfig
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
|
@ -95,6 +95,7 @@ class NavController extends Controller
|
|||
$apps = $this->appRepository->getVisibleApps();
|
||||
$currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2);
|
||||
$categoriesLabels = $this->categoryFetcher->get();
|
||||
$externalSitesInTopMenu = (bool) $this->config->getAppValue('side_menu', 'external-sites-in-top-menu', 0);
|
||||
$appsCategories = [];
|
||||
$categoriesAppsCount = [];
|
||||
$items = [];
|
||||
|
@ -105,11 +106,17 @@ class NavController extends Controller
|
|||
unset($categoriesLabels[$k]);
|
||||
}
|
||||
|
||||
$categoriesLabels['external_links'] = $this->trans->t('External sites');
|
||||
|
||||
foreach ($apps as $app) {
|
||||
$categories = (array) $app['category'];
|
||||
$appsCategories[$app['id']] = [];
|
||||
|
||||
foreach ($categories as $category) {
|
||||
if ($externalSitesInTopMenu && $category === 'external_links') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($items[$category])) {
|
||||
$items[$category] = [
|
||||
'name' => $categoriesLabels[$category],
|
||||
|
|
|
@ -43,6 +43,20 @@ class AppRepository
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($navigation as $app) {
|
||||
if (substr($app['id'], 0, 14) === 'external_index') {
|
||||
$visibleApps[$app['id']] = [
|
||||
'id' => $app['id'],
|
||||
'name' => $app['name'],
|
||||
'preview' => $app['icon'],
|
||||
'previewAsIcon' => true,
|
||||
'category' => [
|
||||
'external_links',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $visibleApps;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -319,7 +319,7 @@ $choicesSizes = [
|
|||
</label>
|
||||
</div>
|
||||
|
||||
<p><em>This feature is not compatible with the <code>big menu</code> display.</em></p>
|
||||
<p><em>Should be enabled with the <code>big menu</code> display.</em></p>
|
||||
|
||||
<div>
|
||||
<select id="side-menu-external-sites-in-top-menu" name="external-sites-in-top-menu" class="side-menu-setting">
|
||||
|
|
Loading…
Reference in a new issue