Skip to content

Commit

Permalink
added app names to new sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
emrysr committed Feb 15, 2019
1 parent 425a0f2 commit 0ff7f69
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 26 deletions.
11 changes: 0 additions & 11 deletions Views/sidebar.php

This file was deleted.

10 changes: 5 additions & 5 deletions app_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ function app_controller()
}

$result = "<link href='".$path."Modules/app/Views/css/pagenav.css?v=1' rel='stylesheet'>";
$result .= "<div id='wrapper'>";
if ($session['write']) $route->sidebar = view("Modules/app/Views/sidebar.php",array("applist"=>$applist));
$result .= "</div>";
// $result .= "<div id='wrapper'>";

if ($app!=false) {
$result .= view($dir.$id.".php",array("name"=>$app, "appdir"=>$dir, "config"=>$config, "apikey"=>$apikey));
} else {
$result .= view("Modules/app/Views/app_view.php",array("apps"=>$appavail));
}
$result .= "</div>";
// $result .= "</div>";
}
}
else if ($route->action == "list" && $session['read']) {
Expand All @@ -98,10 +98,10 @@ function app_controller()
$applist = $appconfig->get_list($session['userid']);
$route->format = "html";
$result = "<link href='".$path."Modules/app/Views/css/pagenav.css?v=1' rel='stylesheet'>";
$result .= "<div id='wrapper'>";
// $result .= "<div id='wrapper'>";
// $result .= view("Modules/app/Views/app_sidebar.php",array("applist"=>$applist));
$result .= view("Modules/app/Views/app_view.php", array("apps"=>$appavail));
$result .= "</div>";
// $result .= "</div>";
}
else if ($route->action == "remove" && $session['write']) {
$route->format = "json";
Expand Down
50 changes: 40 additions & 10 deletions app_menu.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
<?php

$menu_left[] = array(
'id'=>"app_menu",
'name'=>"Apps",
'path'=>"app/view" ,
'session'=>"write",
'order' => 5,
'icon'=>'icon-leaf icon-white'
);


global $mysqli,$path,$session,$route,$user,$app_settings;

require_once "Modules/app/app_model.php";
$appconfig = new AppConfig($mysqli, $app_settings);

if ($route->action == "view") {
// enable apikey read access
$userid = false;
if (isset($session['write']) && $session['write']) {
$userid = $session['userid'];
$apikey = $user->get_apikey_write($session['userid']);
} else if (isset($_GET['readkey'])) {
$apikey = $_GET['readkey'];
$userid = $user->get_id_from_apikey($apikey);
} else if (isset($_GET['apikey'])) {
$apikey = $_GET['apikey'];
$userid = $user->get_id_from_apikey($apikey);
}

if ($userid)
{
$applist = $appconfig->get_list($userid);

foreach ($applist as $name=>$appitem) {
$menu['app'][] = array(
'title' => $name,
'text' => $name,
'path' => "app/view?name=".$name.$apikey
);
}
}
}

$menu['category'][] = array(
'li_class'=>'btn-li',
'icon'=>'apps',
'title'=> _("Apps"),
'path'=> 'app/view',
'active'=> 'app',
'sort'=> 2
);

0 comments on commit 0ff7f69

Please sign in to comment.