mirror of
https://github.com/unraid/webgui.git
synced 2026-01-03 08:00:57 -06:00
New feature: Favorites
This commit is contained in:
@@ -2,18 +2,6 @@ Menu="Tasks:2"
|
||||
Type="xmenu"
|
||||
Code="e970"
|
||||
---
|
||||
<?
|
||||
$uri = ['settings','tools'];
|
||||
foreach($uri as $more) {
|
||||
$text = "$docroot/languages/$locale/$more.txt";
|
||||
if (file_exists($text)) {
|
||||
// additional translations
|
||||
$store = "$docroot/languages/$locale/$more.dot";
|
||||
if (!file_exists($store)) file_put_contents($store,serialize(parse_lang_file($text)));
|
||||
$language = array_merge($language,unserialize(file_get_contents($store)));
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
function delPage(page) {
|
||||
$.post('/webGui/include/MyFavorites.php',{action:'del',page:page},function(){refresh();});
|
||||
|
||||
@@ -70,6 +70,20 @@ $path = substr(strtok(_var($_SERVER,'REQUEST_URI'),'?'),1);
|
||||
// The current "task" is the first element of the path
|
||||
$task = strtok($path,'/');
|
||||
|
||||
// Add translation for favorites page
|
||||
if ($task=='Favorites') {
|
||||
foreach(['settings','tools'] as $more) {
|
||||
$text = "$docroot/languages/$locale/$more.txt";
|
||||
if (file_exists($text)) {
|
||||
// additional translations
|
||||
$store = "$docroot/languages/$locale/$more.dot";
|
||||
if (!file_exists($store)) file_put_contents($store,serialize(parse_lang_file($text)));
|
||||
file_put_contents('/tmp/lang',$store."\n",FILE_APPEND);
|
||||
$language = array_merge($language,unserialize(file_get_contents($store)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Here's the page we're rendering
|
||||
$myPage = $site[basename($path)];
|
||||
$pageroot = $docroot.'/'._var($myPage,'root');
|
||||
|
||||
Reference in New Issue
Block a user