mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Adicionada a lingua pt aos menus
This commit is contained in:
@@ -126,6 +126,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$sql .= "where default_setting_uuid = '$default_setting_uuid'";
|
||||
$db->exec(check_sql($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";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=default_settings.php\">\n";
|
||||
|
||||
@@ -179,7 +179,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
echo "<td width='70%' align='right'>\n";
|
||||
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 "</tr>\n";
|
||||
|
||||
@@ -36,12 +36,14 @@ else {
|
||||
|
||||
//get the http value and set as a php variable
|
||||
$menu_uuid = check_str($_REQUEST["menu_uuid"]);
|
||||
$menu_language = check_str($_REQUEST["menu_language"]);
|
||||
|
||||
//menu restore default
|
||||
require_once "includes/classes/menu.php";
|
||||
$menu = new menu;
|
||||
$menu->db = $db;
|
||||
$menu->menu_uuid = $menu_uuid;
|
||||
$menu->menu_language = $menu_language;
|
||||
$menu->delete();
|
||||
$menu->restore();
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
//define the follow me class
|
||||
class menu {
|
||||
public $menu_uuid;
|
||||
public $menu_language;
|
||||
|
||||
//delete items in the menu that are not protected
|
||||
function delete() {
|
||||
@@ -58,66 +59,67 @@
|
||||
foreach ($apps as $row) {
|
||||
foreach ($row['menu'] as $menu) {
|
||||
//set the variables
|
||||
$menu_item_title = $menu['title']['en'];
|
||||
$menu_item_language = 'en';
|
||||
//$menu_item_title = $menu['title']['en'];
|
||||
$menu_item_title = $menu['title'][$this->menu_language];
|
||||
//$menu_item_language = 'en';
|
||||
$menu_item_uuid = $menu['uuid'];
|
||||
$menu_item_parent_uuid = $menu['parent_uuid'];
|
||||
$menu_item_category = $menu['category'];
|
||||
$menu_item_path = $menu['path'];
|
||||
$menu_item_order = $menu['order'];
|
||||
$menu_item_description = $menu['desc'];
|
||||
|
||||
//if the item uuid is not currently in the db then add it
|
||||
$sql = "select * from v_menu_items ";
|
||||
$sql .= "where menu_uuid = '".$this->menu_uuid."' ";
|
||||
$sql .= "and menu_item_uuid = '$menu_item_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
if (count($result) == 0) {
|
||||
//insert the default menu into the database
|
||||
$sql = "insert into v_menu_items ";
|
||||
$sql .= "(";
|
||||
$sql .= "menu_item_uuid, ";
|
||||
$sql .= "menu_uuid, ";
|
||||
//$sql .= "menu_item_language, ";
|
||||
$sql .= "menu_item_title, ";
|
||||
$sql .= "menu_item_link, ";
|
||||
$sql .= "menu_item_category, ";
|
||||
if (strlen($menu_item_order) > 0) {
|
||||
$sql .= "menu_item_order, ";
|
||||
}
|
||||
if (strlen($menu_item_parent_uuid) > 0) {
|
||||
$sql .= "menu_item_parent_uuid, ";
|
||||
}
|
||||
$sql .= "menu_item_description ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".$menu_item_uuid."', ";
|
||||
$sql .= "'".$this->menu_uuid."', ";
|
||||
//$sql .= "'$menu_item_language', ";
|
||||
$sql .= "'$menu_item_title', ";
|
||||
$sql .= "'$menu_item_path', ";
|
||||
$sql .= "'$menu_item_category', ";
|
||||
if (strlen($menu_item_order) > 0) {
|
||||
$sql .= "'$menu_item_order', ";
|
||||
}
|
||||
if (strlen($menu_item_parent_uuid) > 0) {
|
||||
$sql .= "'$menu_item_parent_uuid', ";
|
||||
}
|
||||
$sql .= "'$menu_item_description' ";
|
||||
$sql .= ")";
|
||||
if ($menu_item_uuid == $menu_item_parent_uuid) {
|
||||
//echo $sql."<br />\n";
|
||||
}
|
||||
else {
|
||||
$db->exec(check_sql($sql));
|
||||
}
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
|
||||
//if the item uuid is not currently in the db then add it
|
||||
$sql = "select * from v_menu_items ";
|
||||
$sql .= "where menu_uuid = '".$this->menu_uuid."' ";
|
||||
$sql .= "and menu_item_uuid = '$menu_item_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
if (count($result) == 0) {
|
||||
//insert the default menu into the database
|
||||
$sql = "insert into v_menu_items ";
|
||||
$sql .= "(";
|
||||
$sql .= "menu_item_uuid, ";
|
||||
$sql .= "menu_uuid, ";
|
||||
//$sql .= "menu_item_language, ";
|
||||
$sql .= "menu_item_title, ";
|
||||
$sql .= "menu_item_link, ";
|
||||
$sql .= "menu_item_category, ";
|
||||
if (strlen($menu_item_order) > 0) {
|
||||
$sql .= "menu_item_order, ";
|
||||
}
|
||||
if (strlen($menu_item_parent_uuid) > 0) {
|
||||
$sql .= "menu_item_parent_uuid, ";
|
||||
}
|
||||
$sql .= "menu_item_description ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".$menu_item_uuid."', ";
|
||||
$sql .= "'".$this->menu_uuid."', ";
|
||||
//$sql .= "'$menu_item_language', ";
|
||||
$sql .= "'$menu_item_title', ";
|
||||
$sql .= "'$menu_item_path', ";
|
||||
$sql .= "'$menu_item_category', ";
|
||||
if (strlen($menu_item_order) > 0) {
|
||||
$sql .= "'$menu_item_order', ";
|
||||
}
|
||||
if (strlen($menu_item_parent_uuid) > 0) {
|
||||
$sql .= "'$menu_item_parent_uuid', ";
|
||||
}
|
||||
$sql .= "'$menu_item_description' ";
|
||||
$sql .= ")";
|
||||
if ($menu_item_uuid == $menu_item_parent_uuid) {
|
||||
//echo $sql."<br />\n";
|
||||
}
|
||||
else {
|
||||
$db->exec(check_sql($sql));
|
||||
}
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
include "root.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 (isset($_SESSION["reload_xml"])) {
|
||||
if (strlen($_SESSION["reload_xml"]) > 0) {
|
||||
@@ -72,7 +79,7 @@ require_once "includes/require.php";
|
||||
else {
|
||||
$content = '';
|
||||
}
|
||||
|
||||
$log->lwrite($_SESSION['domain']['menu']['uuid']);
|
||||
//get the parent id
|
||||
$sql = "select * from v_menu_items ";
|
||||
$sql .= "where menu_uuid = '".$_SESSION['domain']['menu']['uuid']."' ";
|
||||
|
||||
87
install.php
87
install.php
@@ -34,7 +34,7 @@ require_once "includes/lib_functions.php";
|
||||
|
||||
//add the menu uuid
|
||||
$menu_uuid = 'b4750c3f-2a86-b00d-b7d0-345c14eca286';
|
||||
|
||||
$menu_uuid_pt = '1a2b789b-64a0-4a45-84eb-7ebf4f9c576b';
|
||||
//error reporting
|
||||
ini_set('display_errors', '1');
|
||||
//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]['enabled'] = 'true';
|
||||
$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]['category'] = 'domain';
|
||||
$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]['enabled'] = 'true';
|
||||
$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]['value'] = $install_template_name;
|
||||
$tmp[$x]['category'] = 'domain';
|
||||
@@ -1133,37 +1145,52 @@ if ($_POST["install_step"] == "3" && count($_POST)>0 && strlen($_POST["persistfo
|
||||
require "includes/require.php";
|
||||
|
||||
//set the defaults
|
||||
$menu_name = 'default';
|
||||
$menu_language = 'en';
|
||||
$menu_description = '';
|
||||
$x = 0;
|
||||
$tmp[$x]['menu_name'] = 'default';
|
||||
$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
|
||||
$sql = "insert into v_menus ";
|
||||
$sql .= "(";
|
||||
$sql .= "menu_uuid, ";
|
||||
$sql .= "menu_name, ";
|
||||
$sql .= "menu_language, ";
|
||||
$sql .= "menu_description ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".$menu_uuid."', ";
|
||||
$sql .= "'$menu_name', ";
|
||||
$sql .= "'$menu_language', ";
|
||||
$sql .= "'$menu_description' ";
|
||||
$sql .= ");";
|
||||
if ($v_debug) {
|
||||
fwrite($fp, $sql."\n");
|
||||
}
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
foreach($tmp as $row) {
|
||||
$sql = "insert into v_menus ";
|
||||
$sql .= "(";
|
||||
$sql .= "menu_uuid, ";
|
||||
$sql .= "menu_name, ";
|
||||
$sql .= "menu_language, ";
|
||||
$sql .= "menu_description ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".$row['menu_uuid']."', ";
|
||||
$sql .= "'".$row['menu_name']."', ";
|
||||
$sql .= "'".$row['menu_language']."', ";
|
||||
$sql .= "'".$row['menu_description']."' ";
|
||||
$sql .= ");";
|
||||
if ($v_debug) {
|
||||
fwrite($fp, $sql."\n");
|
||||
}
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//add the menu items
|
||||
require_once "includes/classes/menu.php";
|
||||
$menu = new menu;
|
||||
$menu->db = $db;
|
||||
$menu->menu_uuid = $row['menu_uuid'];
|
||||
$menu->menu_language = $row['menu_language'];
|
||||
$menu->restore();
|
||||
unset($menu);
|
||||
}
|
||||
unset($tmp);
|
||||
|
||||
//add the menu items
|
||||
require_once "includes/classes/menu.php";
|
||||
$menu = new menu;
|
||||
$menu->db = $db;
|
||||
$menu->menu_uuid = $menu_uuid;
|
||||
$menu->restore();
|
||||
unset($menu);
|
||||
|
||||
|
||||
//setup the switch config directory if it exists
|
||||
if ($switch_conf_dir != "/conf") {
|
||||
|
||||
Reference in New Issue
Block a user