Adicionada a lingua pt aos menus
This commit is contained in:
parent
8c32fd31bb
commit
c8deeea07a
|
|
@ -127,6 +127,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
$db->exec(check_sql($sql));
|
$db->exec(check_sql($sql));
|
||||||
unset($sql);
|
unset($sql);
|
||||||
|
|
||||||
|
$sql = "update v_domain_settings set ";
|
||||||
|
$sql .= "domain_setting_value = '$default_setting_value' ";
|
||||||
|
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||||
|
$sql .= "and domain_setting_subcategory = 'menu' ";
|
||||||
|
$db->exec(check_sql($sql));
|
||||||
|
unset($sql);
|
||||||
|
|
||||||
require_once "includes/header.php";
|
require_once "includes/header.php";
|
||||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=default_settings.php\">\n";
|
echo "<meta http-equiv=\"refresh\" content=\"2;url=default_settings.php\">\n";
|
||||||
echo "<div align='center'>\n";
|
echo "<div align='center'>\n";
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||||
}
|
}
|
||||||
echo "<td width='70%' align='right'>\n";
|
echo "<td width='70%' align='right'>\n";
|
||||||
if (permission_exists('menu_restore')) {
|
if (permission_exists('menu_restore')) {
|
||||||
echo " <input type='button' class='btn' value='Restore Default' onclick=\"document.location.href='menu_restore_default.php?menu_uuid=$menu_uuid&menu_uuid=$menu_uuid';\" />";
|
echo " <input type='button' class='btn' value='Restore Default' onclick=\"document.location.href='menu_restore_default.php?menu_uuid=$menu_uuid&menu_language=$menu_language';\" />";
|
||||||
}
|
}
|
||||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='menu.php'\" value='Back'></td>\n";
|
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='menu.php'\" value='Back'></td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,14 @@ else {
|
||||||
|
|
||||||
//get the http value and set as a php variable
|
//get the http value and set as a php variable
|
||||||
$menu_uuid = check_str($_REQUEST["menu_uuid"]);
|
$menu_uuid = check_str($_REQUEST["menu_uuid"]);
|
||||||
|
$menu_language = check_str($_REQUEST["menu_language"]);
|
||||||
|
|
||||||
//menu restore default
|
//menu restore default
|
||||||
require_once "includes/classes/menu.php";
|
require_once "includes/classes/menu.php";
|
||||||
$menu = new menu;
|
$menu = new menu;
|
||||||
$menu->db = $db;
|
$menu->db = $db;
|
||||||
$menu->menu_uuid = $menu_uuid;
|
$menu->menu_uuid = $menu_uuid;
|
||||||
|
$menu->menu_language = $menu_language;
|
||||||
$menu->delete();
|
$menu->delete();
|
||||||
$menu->restore();
|
$menu->restore();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
//define the follow me class
|
//define the follow me class
|
||||||
class menu {
|
class menu {
|
||||||
public $menu_uuid;
|
public $menu_uuid;
|
||||||
|
public $menu_language;
|
||||||
|
|
||||||
//delete items in the menu that are not protected
|
//delete items in the menu that are not protected
|
||||||
function delete() {
|
function delete() {
|
||||||
|
|
@ -58,8 +59,9 @@
|
||||||
foreach ($apps as $row) {
|
foreach ($apps as $row) {
|
||||||
foreach ($row['menu'] as $menu) {
|
foreach ($row['menu'] as $menu) {
|
||||||
//set the variables
|
//set the variables
|
||||||
$menu_item_title = $menu['title']['en'];
|
//$menu_item_title = $menu['title']['en'];
|
||||||
$menu_item_language = 'en';
|
$menu_item_title = $menu['title'][$this->menu_language];
|
||||||
|
//$menu_item_language = 'en';
|
||||||
$menu_item_uuid = $menu['uuid'];
|
$menu_item_uuid = $menu['uuid'];
|
||||||
$menu_item_parent_uuid = $menu['parent_uuid'];
|
$menu_item_parent_uuid = $menu['parent_uuid'];
|
||||||
$menu_item_category = $menu['category'];
|
$menu_item_category = $menu['category'];
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,13 @@
|
||||||
include "root.php";
|
include "root.php";
|
||||||
require_once "includes/require.php";
|
require_once "includes/require.php";
|
||||||
|
|
||||||
|
require_once "includes/Logging.php";
|
||||||
|
// Logging class initialization
|
||||||
|
$log = new Logging();
|
||||||
|
|
||||||
|
// set path and name of log file (optional)
|
||||||
|
$log->lfile('/tmp/mylog.txt');
|
||||||
|
|
||||||
//if reloadxml then run the command
|
//if reloadxml then run the command
|
||||||
if (isset($_SESSION["reload_xml"])) {
|
if (isset($_SESSION["reload_xml"])) {
|
||||||
if (strlen($_SESSION["reload_xml"]) > 0) {
|
if (strlen($_SESSION["reload_xml"]) > 0) {
|
||||||
|
|
@ -72,7 +79,7 @@ require_once "includes/require.php";
|
||||||
else {
|
else {
|
||||||
$content = '';
|
$content = '';
|
||||||
}
|
}
|
||||||
|
$log->lwrite($_SESSION['domain']['menu']['uuid']);
|
||||||
//get the parent id
|
//get the parent id
|
||||||
$sql = "select * from v_menu_items ";
|
$sql = "select * from v_menu_items ";
|
||||||
$sql .= "where menu_uuid = '".$_SESSION['domain']['menu']['uuid']."' ";
|
$sql .= "where menu_uuid = '".$_SESSION['domain']['menu']['uuid']."' ";
|
||||||
|
|
|
||||||
45
install.php
45
install.php
|
|
@ -34,7 +34,7 @@ require_once "includes/lib_functions.php";
|
||||||
|
|
||||||
//add the menu uuid
|
//add the menu uuid
|
||||||
$menu_uuid = 'b4750c3f-2a86-b00d-b7d0-345c14eca286';
|
$menu_uuid = 'b4750c3f-2a86-b00d-b7d0-345c14eca286';
|
||||||
|
$menu_uuid_pt = '1a2b789b-64a0-4a45-84eb-7ebf4f9c576b';
|
||||||
//error reporting
|
//error reporting
|
||||||
ini_set('display_errors', '1');
|
ini_set('display_errors', '1');
|
||||||
//error_reporting (E_ALL); // Report everything
|
//error_reporting (E_ALL); // Report everything
|
||||||
|
|
@ -671,6 +671,12 @@ if ($_POST["install_step"] == "3" && count($_POST)>0 && strlen($_POST["persistfo
|
||||||
$tmp[$x]['subcategory'] = 'menu';
|
$tmp[$x]['subcategory'] = 'menu';
|
||||||
$tmp[$x]['enabled'] = 'true';
|
$tmp[$x]['enabled'] = 'true';
|
||||||
$x++;
|
$x++;
|
||||||
|
/* $tmp[$x]['name'] = 'uuid';
|
||||||
|
$tmp[$x]['value'] = $menu_uuid_pt;
|
||||||
|
$tmp[$x]['category'] = 'domain';
|
||||||
|
$tmp[$x]['subcategory'] = 'menu';
|
||||||
|
$tmp[$x]['enabled'] = 'true';
|
||||||
|
$x++;*/
|
||||||
$tmp[$x]['name'] = 'name';
|
$tmp[$x]['name'] = 'name';
|
||||||
$tmp[$x]['category'] = 'domain';
|
$tmp[$x]['category'] = 'domain';
|
||||||
$tmp[$x]['subcategory'] = 'time_zone';
|
$tmp[$x]['subcategory'] = 'time_zone';
|
||||||
|
|
@ -833,6 +839,12 @@ if ($_POST["install_step"] == "3" && count($_POST)>0 && strlen($_POST["persistfo
|
||||||
$tmp[$x]['subcategory'] = 'menu';
|
$tmp[$x]['subcategory'] = 'menu';
|
||||||
$tmp[$x]['enabled'] = 'true';
|
$tmp[$x]['enabled'] = 'true';
|
||||||
$x++;
|
$x++;
|
||||||
|
/*$tmp[$x]['name'] = 'uuid';
|
||||||
|
$tmp[$x]['value'] = $menu_uuid_pt;
|
||||||
|
$tmp[$x]['category'] = 'domain';
|
||||||
|
$tmp[$x]['subcategory'] = 'menu';
|
||||||
|
$tmp[$x]['enabled'] = 'true';
|
||||||
|
$x++;*/
|
||||||
$tmp[$x]['name'] = 'name';
|
$tmp[$x]['name'] = 'name';
|
||||||
$tmp[$x]['value'] = $install_template_name;
|
$tmp[$x]['value'] = $install_template_name;
|
||||||
$tmp[$x]['category'] = 'domain';
|
$tmp[$x]['category'] = 'domain';
|
||||||
|
|
@ -1133,10 +1145,20 @@ if ($_POST["install_step"] == "3" && count($_POST)>0 && strlen($_POST["persistfo
|
||||||
require "includes/require.php";
|
require "includes/require.php";
|
||||||
|
|
||||||
//set the defaults
|
//set the defaults
|
||||||
$menu_name = 'default';
|
$x = 0;
|
||||||
$menu_language = 'en';
|
$tmp[$x]['menu_name'] = 'default';
|
||||||
$menu_description = '';
|
$tmp[$x]['menu_language'] = 'en';
|
||||||
|
$tmp[$x]['menu_description'] = '';
|
||||||
|
$tmp[$x]['menu_uuid'] = $menu_uuid;
|
||||||
|
$x++;
|
||||||
|
$tmp[$x]['menu_name'] = 'portuguese';
|
||||||
|
$tmp[$x]['menu_language'] = 'pt-pt';
|
||||||
|
$tmp[$x]['menu_description'] = '';
|
||||||
|
$tmp[$x]['menu_uuid'] = $menu_uuid_pt;
|
||||||
|
|
||||||
|
|
||||||
//add the parent menu
|
//add the parent menu
|
||||||
|
foreach($tmp as $row) {
|
||||||
$sql = "insert into v_menus ";
|
$sql = "insert into v_menus ";
|
||||||
$sql .= "(";
|
$sql .= "(";
|
||||||
$sql .= "menu_uuid, ";
|
$sql .= "menu_uuid, ";
|
||||||
|
|
@ -1146,10 +1168,10 @@ if ($_POST["install_step"] == "3" && count($_POST)>0 && strlen($_POST["persistfo
|
||||||
$sql .= ") ";
|
$sql .= ") ";
|
||||||
$sql .= "values ";
|
$sql .= "values ";
|
||||||
$sql .= "(";
|
$sql .= "(";
|
||||||
$sql .= "'".$menu_uuid."', ";
|
$sql .= "'".$row['menu_uuid']."', ";
|
||||||
$sql .= "'$menu_name', ";
|
$sql .= "'".$row['menu_name']."', ";
|
||||||
$sql .= "'$menu_language', ";
|
$sql .= "'".$row['menu_language']."', ";
|
||||||
$sql .= "'$menu_description' ";
|
$sql .= "'".$row['menu_description']."' ";
|
||||||
$sql .= ");";
|
$sql .= ");";
|
||||||
if ($v_debug) {
|
if ($v_debug) {
|
||||||
fwrite($fp, $sql."\n");
|
fwrite($fp, $sql."\n");
|
||||||
|
|
@ -1161,9 +1183,14 @@ if ($_POST["install_step"] == "3" && count($_POST)>0 && strlen($_POST["persistfo
|
||||||
require_once "includes/classes/menu.php";
|
require_once "includes/classes/menu.php";
|
||||||
$menu = new menu;
|
$menu = new menu;
|
||||||
$menu->db = $db;
|
$menu->db = $db;
|
||||||
$menu->menu_uuid = $menu_uuid;
|
$menu->menu_uuid = $row['menu_uuid'];
|
||||||
|
$menu->menu_language = $row['menu_language'];
|
||||||
$menu->restore();
|
$menu->restore();
|
||||||
unset($menu);
|
unset($menu);
|
||||||
|
}
|
||||||
|
unset($tmp);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//setup the switch config directory if it exists
|
//setup the switch config directory if it exists
|
||||||
if ($switch_conf_dir != "/conf") {
|
if ($switch_conf_dir != "/conf") {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue