<?php

$accessControl = array(
	"ProfileRequired" => true
);
require_once "../../AccessControl.php";
include "index.php";

$menu_items = array();
$menu_cat = array();

# define the menu categories
$menu_cat["_UPDATING"] = array("text" => _UPDATING, "icon" => " fa-cog");

# define the menu items
$menu_items["_VIEW_PROGRESS"] = array("text" => _VIEW_PROGRESS, "action" => "update.ViewProgress()", "cat" => "_UPDATING");
$menu_items["_STOP_UPDATE"] = array("text" => _STOP_UPDATE, "action" => "update.Stop()", "cat" => "_UPDATING");


# merge menu items into cat array so js can easily loop thru it to make the menu
foreach($menu_items as $key => $val) {
	$menu_cat[$val['cat']]['data'][$key] = $menu_items[$key];
}

//Return the information
echo json_encode(array(
	'languages' => $lang_labels,
	'profiles' => $plist,
	'pcount' => $pcount,
	'available_langs' => $available_langs,
	'lang' => $lang,
	'getdatafromstore' => $getdatafromstore,
	'session' => $session,
	'hl' => $hl,
	'ss' => $ss,

	'Status' => 'Success',
	'menu_items' => $menu_items,
	'menu_cat' => $menu_cat,
	'profile' => $profile	
));
?>