Add the text class to more of the applications.

This commit is contained in:
Mark Crane
2015-01-18 10:06:08 +00:00
parent 147d03169d
commit c5755666cb
176 changed files with 518 additions and 865 deletions
+20 -19
View File
@@ -35,27 +35,28 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
$language = new text;
$text = $language->get();
//get the http values and set as variables
if (count($_GET) > 0) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
}
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
}
//delete the record
if (strlen($id) > 0) {
$sql = "delete from v_contact_addresses ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and contact_address_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
if (strlen($id)>0) {
$sql = "delete from v_contact_addresses ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and contact_address_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
$_SESSION["message"] = $text['message-delete'];
header("Location: contact_edit.php?id=".$contact_uuid);
return;
//redirect the browser
$_SESSION["message"] = $text['message-delete'];
header("Location: contact_edit.php?id=".$contact_uuid);
return;
?>
+2 -4
View File
@@ -36,10 +36,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
+2 -4
View File
@@ -40,10 +40,8 @@ exit;
*/
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
$_SESSION['contact_auth']['source'] = ($_SESSION['contact_auth']['source'] == '') ? $_REQUEST['source'] : $_SESSION['contact_auth']['source'];
+2 -4
View File
@@ -37,10 +37,8 @@ else {
// check if included in another file
if (!$included) {
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
if (count($_GET)>0) {
$contact_uuid = check_str($_GET["id"]);
+2 -4
View File
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//handle removal of contact group
if ($_GET['a'] == 'delete') {
+2 -4
View File
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//built in str_getcsv requires PHP 5.3 or higher, this function can be used to reproduct the functionality but requirs PHP 5.1.0 or higher
if(!function_exists('str_getcsv')) {
+2 -4
View File
@@ -38,10 +38,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//handle import
if ($_POST['a'] == 'import') {
+2 -4
View File
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
+2 -4
View File
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
+20 -19
View File
@@ -35,27 +35,28 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
$language = new text;
$text = $language->get();
//get the http values and set as variables
if (count($_GET) > 0) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
}
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
}
//delete the record
if (strlen($id) > 0) {
$sql = "delete from v_contact_phones ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and contact_phone_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
if (strlen($id)>0) {
$sql = "delete from v_contact_phones ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and contact_phone_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
$_SESSION["message"] = $text['message-delete'];
header("Location: contact_edit.php?id=".$contact_uuid);
return;
//redirect the browser
$_SESSION["message"] = $text['message-delete'];
header("Location: contact_edit.php?id=".$contact_uuid);
return;
?>
+2 -4
View File
@@ -36,10 +36,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
+2 -4
View File
@@ -29,10 +29,8 @@ require_once "resources/require.php";
require_once "resources/check_auth.php";
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//set the variables
if (count($_GET) > 0) {
+3 -7
View File
@@ -27,14 +27,10 @@
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//add multi-lingual support
require_once "app_languages.php";
foreach($text['button-save'] as $key => $value) {
$languages[$key] = '';
}
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
+2 -4
View File
@@ -35,10 +35,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
+2 -4
View File
@@ -36,10 +36,8 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
//action add or update
if (isset($_REQUEST["id"])) {
+6 -8
View File
@@ -35,15 +35,13 @@ else {
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
$language = new text;
$text = $language->get();
require_once "resources/header.php";
$document['title'] = $text['title-contacts'];
require_once "resources/paging.php";
//includes and title
require_once "resources/header.php";
$document['title'] = $text['title-contacts'];
require_once "resources/paging.php";
//get the search criteria
$search_all = strtolower(check_str($_GET["search_all"]));
+2 -6
View File
@@ -37,12 +37,8 @@ else {
if (count($_GET)>0) {
//add multi-lingual support
if ($_GET['type'] == 'download' || $_GET['type'] == 'html') {
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
}
$language = new text;
$text = $language->get();
//create the vcard object
require_once "resources/classes/vcard.php";