diff --git a/core/dashboard/app_config.php b/core/dashboard/app_config.php index 163c5c4bb0..acdb555eb3 100644 --- a/core/dashboard/app_config.php +++ b/core/dashboard/app_config.php @@ -100,12 +100,17 @@ $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_content'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard top content.'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard content.'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_content_text_align'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the dashboard content text alignment.'; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_content_details'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['search_by'] = ''; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard top content details.'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the dashboard content details.'; $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'dashboard_chart_type'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; @@ -279,4 +284,4 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; -?> +?> \ No newline at end of file diff --git a/core/dashboard/app_languages.php b/core/dashboard/app_languages.php index cafa6d47d1..ac8f489248 100644 --- a/core/dashboard/app_languages.php +++ b/core/dashboard/app_languages.php @@ -208,6 +208,58 @@ $text['description-dashboard_path']['zh-cn'] = "输入仪表板小部件路径 $text['description-dashboard_path']['ja-jp'] = "ダッシュボード ウィジェットのパスを入力します。"; $text['description-dashboard_path']['ko-kr'] = "대시보드 위젯 경로를 입력합니다."; +$text['label-dashboard_content_text_align']['en-us'] = "Text Align"; +$text['label-dashboard_content_text_align']['en-gb'] = "Text Align"; +$text['label-dashboard_content_text_align']['ar-eg'] = ""; +$text['label-dashboard_content_text_align']['de-at'] = ""; +$text['label-dashboard_content_text_align']['de-ch'] = ""; +$text['label-dashboard_content_text_align']['de-de'] = ""; +$text['label-dashboard_content_text_align']['el-gr'] = ""; +$text['label-dashboard_content_text_align']['es-cl'] = ""; +$text['label-dashboard_content_text_align']['es-mx'] = ""; +$text['label-dashboard_content_text_align']['fr-ca'] = ""; +$text['label-dashboard_content_text_align']['fr-fr'] = ""; +$text['label-dashboard_content_text_align']['he-il'] = ""; +$text['label-dashboard_content_text_align']['it-it'] = ""; +$text['label-dashboard_content_text_align']['nl-nl'] = ""; +$text['label-dashboard_content_text_align']['pl-pl'] = ""; +$text['label-dashboard_content_text_align']['pt-br'] = ""; +$text['label-dashboard_content_text_align']['pt-pt'] = ""; +$text['label-dashboard_content_text_align']['ro-ro'] = ""; +$text['label-dashboard_content_text_align']['ru-ru'] = ""; +$text['label-dashboard_content_text_align']['sv-se'] = ""; +$text['label-dashboard_content_text_align']['uk-ua'] = ""; +$text['label-dashboard_content_text_align']['tr-tr'] = ""; +$text['label-dashboard_content_text_align']['zh-cn'] = ""; +$text['label-dashboard_content_text_align']['ja-jp'] = ""; +$text['label-dashboard_content_text_align']['ko-kr'] = ""; + +$text['description-dashboard_content_text_align']['en-us'] = "Align the text in the content."; +$text['description-dashboard_content_text_align']['en-gb'] = "Align the text in the content."; +$text['description-dashboard_content_text_align']['ar-eg'] = ""; +$text['description-dashboard_content_text_align']['de-at'] = ""; +$text['description-dashboard_content_text_align']['de-ch'] = ""; +$text['description-dashboard_content_text_align']['de-de'] = ""; +$text['description-dashboard_content_text_align']['el-gr'] = ""; +$text['description-dashboard_content_text_align']['es-cl'] = ""; +$text['description-dashboard_content_text_align']['es-mx'] = ""; +$text['description-dashboard_content_text_align']['fr-ca'] = ""; +$text['description-dashboard_content_text_align']['fr-fr'] = ""; +$text['description-dashboard_content_text_align']['he-il'] = ""; +$text['description-dashboard_content_text_align']['it-it'] = ""; +$text['description-dashboard_content_text_align']['nl-nl'] = ""; +$text['description-dashboard_content_text_align']['pl-pl'] = ""; +$text['description-dashboard_content_text_align']['pt-br'] = ""; +$text['description-dashboard_content_text_align']['pt-pt'] = ""; +$text['description-dashboard_content_text_align']['ro-ro'] = ""; +$text['description-dashboard_content_text_align']['ru-ru'] = ""; +$text['description-dashboard_content_text_align']['sv-se'] = ""; +$text['description-dashboard_content_text_align']['uk-ua'] = ""; +$text['description-dashboard_content_text_align']['tr-tr'] = ""; +$text['description-dashboard_content_text_align']['zh-cn'] = ""; +$text['description-dashboard_content_text_align']['ja-jp'] = ""; +$text['description-dashboard_content_text_align']['ko-kr'] = ""; + $text['label-dashboard_groups']['en-us'] = "Groups"; $text['label-dashboard_groups']['en-gb'] = "Groups"; $text['label-dashboard_groups']['ar-eg'] = "مجموعات"; @@ -1300,4 +1352,4 @@ $text['login-message_dismiss']['zh-cn'] = "忽略消息"; $text['login-message_dismiss']['ja-jp'] = "メッセージを閉じる"; $text['login-message_dismiss']['ko-kr'] = "메시지 닫기"; -?> +?> \ No newline at end of file diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 081ef7b6ee..ae9c899078 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -35,6 +35,9 @@ exit; } +//initialize the database + $database = new database; + //add multi-lingual support $language = new text; $text = $language->get(); @@ -49,6 +52,7 @@ $dashboard_width = ''; $dashboard_height = ''; $dashboard_content = ''; + $dashboard_content_text_align = ''; $dashboard_content_details = ''; $dashboard_heading_text_color = ''; $dashboard_heading_background_color = ''; @@ -82,6 +86,7 @@ $dashboard_width = $_POST["dashboard_width"] ?? ''; $dashboard_height = $_POST["dashboard_height"] ?? ''; $dashboard_content = $_POST["dashboard_content"] ?? ''; + $dashboard_content_text_align = $_POST["dashboard_content_text_align"] ?? ''; $dashboard_content_details = $_POST["dashboard_content_details"] ?? ''; $dashboard_groups = $_POST["dashboard_groups"] ?? ''; $dashboard_chart_type = $_POST["dashboard_chart_type"] ?? ''; @@ -109,7 +114,6 @@ $dashboard_uuid = $_GET["dashboard_uuid"]; //delete the group from the users $array['dashboard_groups'][0]['dashboard_group_uuid'] = $dashboard_group_uuid; - $database = new database; $database->app_name = 'dashboard'; $database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7'; $database->delete($array); @@ -138,20 +142,17 @@ switch ($_POST['action']) { case 'copy': if (permission_exists('dashboard_add')) { - $obj = new database; - $obj->copy($array); + $database->copy($array); } break; case 'delete': if (permission_exists('dashboard_delete')) { - $obj = new database; - $obj->delete($array); + $database->delete($array); } break; case 'toggle': if (permission_exists('dashboard_update')) { - $obj = new database; - $obj->toggle($array); + $database->toggle($array); } break; } @@ -234,6 +235,7 @@ $array['dashboard'][0]['dashboard_height'] = $dashboard_height; $array['dashboard'][0]['dashboard_target'] = $dashboard_target; $array['dashboard'][0]['dashboard_content'] = $dashboard_content; + $array['dashboard'][0]['dashboard_content_text_align'] = $dashboard_content_text_align; $array['dashboard'][0]['dashboard_content_details'] = $dashboard_content_details; $array['dashboard'][0]['dashboard_chart_type'] = $dashboard_chart_type; $array['dashboard'][0]['dashboard_heading_text_color'] = $dashboard_heading_text_color; @@ -263,13 +265,10 @@ } //save the data - $database = new database; $database->app_name = 'dashboard'; $database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7'; - $database->save($array); - //$result = $database->message; + $result = $database->save($array); //view_array($result); - //exit; //redirect the user if (isset($action)) { @@ -297,6 +296,7 @@ $sql .= " dashboard_height, "; $sql .= " dashboard_target, "; $sql .= " dashboard_content, "; + $sql .= " dashboard_content_text_align, "; $sql .= " dashboard_content_details, "; $sql .= " dashboard_chart_type, "; $sql .= " dashboard_heading_text_color, "; @@ -317,7 +317,6 @@ $sql .= "from v_dashboard "; $sql .= "where dashboard_uuid = :dashboard_uuid "; $parameters['dashboard_uuid'] = $dashboard_uuid; - $database = new database; $row = $database->select($sql, $parameters, 'row'); if (is_array($row) && @sizeof($row) != 0) { $dashboard_name = $row["dashboard_name"]; @@ -328,6 +327,7 @@ $dashboard_height = $row["dashboard_height"]; $dashboard_target = $row["dashboard_target"]; $dashboard_content = $row["dashboard_content"]; + $dashboard_content_text_align = $row["dashboard_content_text_align"]; $dashboard_content_details = $row["dashboard_content_details"]; $dashboard_chart_type = $row["dashboard_chart_type"]; $dashboard_heading_text_color = $row["dashboard_heading_text_color"]; @@ -357,7 +357,6 @@ $sql .= "from v_dashboard_groups "; $sql .= "where dashboard_uuid = :dashboard_uuid "; $parameters['dashboard_uuid'] = $dashboard_uuid; - $database = new database; $dashboard_groups = $database->select($sql, $parameters, 'all'); unset ($sql, $parameters); } @@ -388,7 +387,6 @@ $dashboard_row_span = 2; } - //add an empty row $x = is_array($dashboard_groups) ? count($dashboard_groups) : 0; $dashboard_groups[$x]['dashboard_uuid'] = $dashboard_uuid; @@ -408,7 +406,6 @@ $sql .= "where x.dashboard_uuid = :dashboard_uuid "; $sql .= "and x.group_uuid = g.group_uuid "; $parameters['dashboard_uuid'] = $dashboard_uuid ?? ''; - $database = new database; $dashboard_groups = $database->select($sql, $parameters, 'all'); unset ($sql, $parameters); @@ -417,7 +414,6 @@ $sql .= "WHERE (domain_uuid = :domain_uuid or domain_uuid is null)"; $sql .= "ORDER by group_name asc "; $parameters['domain_uuid'] = $_SESSION['domain_uuid']; - $database = new database; $groups = $database->execute($sql, $parameters, 'all'); unset ($sql, $parameters); @@ -621,6 +617,20 @@ echo $text['description-dashboard_content']."\n"; echo "\n"; echo "\n"; + + echo "