Skip to content

Commit

Permalink
Merge pull request #76 from HuubMons/prepare_next_version
Browse files Browse the repository at this point in the history
HuMo-genealogy 6.8
  • Loading branch information
HuubMons authored Dec 20, 2024
2 parents 8d84062 + f6f96c8 commit f25db3b
Show file tree
Hide file tree
Showing 261 changed files with 74,775 additions and 70,865 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/tests/
23 changes: 22 additions & 1 deletion .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,25 @@ RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ index.php [QSA,L]
RewriteRule ^ index.php [QSA,L]

# # Enable these lines when website is slow because of search engine indexation
# BrowserMatchNoCase "claudebot" bad_bot
# BrowserMatchNoCase "facebookexternalhit/1.1" bad_bot
# BrowserMatchNoCase "Python/3.10 aiohttp/3.9.3" bad_bot
# Order Deny,Allow
# Deny from env=bad_bot

# # Blocking Bot traffic except search bots
# RewriteEngine On
# RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
# RewriteCond %{HTTP_USER_AGENT} (bot|crawl|robot|facebook|spider)
# RewriteCond %{HTTP_USER_AGENT} !(Bing|Google|msn|MSR|Twitter|Yandex|Slurp|DuckDuck|Baidu|Exa) [NC]
# RewriteRule ^ - [F]
# # END Blocking Bot traffic except search bots

# Explanation of RewriteCond lines:
# Line 1 stops unidentified bots.
# Line 2 stops bots including text: bot, crawl of robot zit.
# Line 3 enables access to robots including text: Bing, Google, etc.
# Line 4 block all useless bots including an acces denied message.
21 changes: 1 addition & 20 deletions admin/admin.css
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
/* Basic page styles */
/* dec. 2023 test */

/*
html {
height: 100%;
max-height: 100%;
padding: 0;
margin: 0;
border: 0;
}
*/

body.humo {
background-color: white;
background-image: url('style_admin/background.gif');
background-repeat: no-repeat;

font: 15px Verdana, tahoma, arial, sans-serif;

/*
height: 100%;
max-height: 100%;
padding: 0;
margin: 0;
border: 0;
*/
}

#top_website_name {
Expand Down Expand Up @@ -232,7 +213,7 @@ div.rtlsddm #sub_2 ul {
}

/* Order boxes (children) */

/* TODO it's possible to use bootstrap layout */
.sortable {
width: 750px;
user-select: none;
Expand Down
20 changes: 0 additions & 20 deletions admin/admin_print.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
/* TODO: check these items. Probably remove admin_print file */

/*
html {
padding: 0;
margin: 0;
border: 0;
overflow: visible;
}
*/

body {
background-color: white;
background-image: none;
/*
font-family: Trebuchet MS, Arial, sans-serif;
font-size: 14px;
height: auto;
max-height: auto;
overflow: visible;
padding: 0;
margin: 0;
border: 0;
float: none;
*/
}

.button {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<?php
require_once __DIR__ . "/../models/edit_address.php";

include_once(__DIR__ . "/../include/editor_cls.php");
include_once(__DIR__ . "/../include/select_tree.php");

class AddressController
class AdminAddressController
{
private $editor_cls;

public function __construct()
{
$this->editor_cls = new editor_cls;
$this->editor_cls = new Editor_cls;
}

public function detail($dbh, $tree_id, $db_functions)
{
$editAddressModel = new EditAddressModel($dbh);
$editAddressModel = new AdminAddressModel($dbh);
$editAddressModel->set_address_id();
$editAddressModel->update_address($dbh, $tree_id, $db_functions, $this->editor_cls);
$editAddress['address_id'] = $editAddressModel->get_address_id();
Expand Down
25 changes: 25 additions & 0 deletions admin/controller/adminCmsPagesController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
class AdminCmsPagesController
{
public function detail($dbh)
{
$CMS_pagesModel = new AdminCmsPagesModel($dbh);

$edit_cms_pages['menu_tab'] = $CMS_pagesModel->menu_tab();

$CMS_pagesModel->add_change_page($dbh);

$edit_cms_pages['select_page'] = $CMS_pagesModel->get_select_page();

$CMS_pagesModel->update_pages($dbh);

if ($edit_cms_pages['menu_tab'] === 'pages') {
$edit_cms_pages['pages_in_category'] = $CMS_pagesModel->get_pages_in_category($dbh);

$get_page = $CMS_pagesModel->get_page($dbh);
$edit_cms_pages = array_merge($edit_cms_pages, $get_page);
}

return $edit_cms_pages;
}
}
44 changes: 44 additions & 0 deletions admin/controller/adminIndexController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
class AdminIndexController
{
public function detail($database_check, $dbh)
{
$indexModel = new AdminIndexModel();

$index['php_version'] = $indexModel->get_php_version();

$index_array1 = $indexModel->database_settings($database_check);
$index_array2 = $indexModel->get_mysql_version($dbh);
$index = array_merge($index, $index_array1, $index_array2);

// TODO: move to model.
// *** Check if database and tables are ok ***
$index['install_status'] = true;

if (!$index['database_check']) {
$index['install_status'] = true;

$index['db_host'] = 'localhost';
if (isset($_POST['db_host'])) {
$index['db_host'] = $_POST['db_host'];
}

$index['db_username'] = 'root';
if (isset($_POST['db_username'])) {
$index['db_username'] = $_POST['db_username'];
}

$index['db_password'] = '';
if (isset($_POST['db_password'])) {
$index['db_password'] = $_POST['db_password'];
}

$index['db_name'] = 'humo-gen';
if (isset($_POST['db_name'])) {
$index['db_name'] = $_POST['db_name'];
}
}

return $index;
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<?php
require_once __DIR__ . "/../models/edit_repository.php";

include_once(__DIR__ . "/../include/editor_cls.php");
include_once(__DIR__ . "/../include/select_tree.php");

class RepositoryController
class AdminRepositoryController
{
private $editor_cls;

public function __construct()
{
$this->editor_cls = new editor_cls;
$this->editor_cls = new Editor_cls;
}

public function detail($dbh, $tree_id, $db_functions)
{
$editRepositoryModel = new EditorRepositoryModel($dbh);
$editRepositoryModel = new AdminRepositoryModel($dbh);
$editRepositoryModel->set_repo_id();
$editRepositoryModel->update_repository($dbh, $tree_id, $db_functions, $this->editor_cls);
$editRepository['repo_id'] = $editRepositoryModel->get_repo_id();
Expand Down
23 changes: 23 additions & 0 deletions admin/controller/adminSettingsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
class adminSettingsController
{
public function detail($dbh, $db_functions, $humo_option)
{
$settingsModel = new AdminSettingsModel($dbh);
$settings['menu_tab'] = $settingsModel->get_menu_tab();
$settings['time_lang'] = $settingsModel->get_timeline_language($humo_option);
$settingsModel->save_settings($dbh, $db_functions, $humo_option, $settings);

// *** Use a seperate controller for each tab ***
if ($settings['menu_tab'] == 'settings_homepage') {
$settings_homepageModel = new SettingsHomepageModel($dbh);
$settings_homepageModel -> reset_modules($dbh);
$settings_homepageModel -> save_settings_modules($dbh);
$settings_homepageModel -> order_modules($dbh);

$settings_homepageModel -> save_settings_favorites($dbh);
}

return $settings;
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<?php
require_once __DIR__ . "/../models/edit_source.php";

include_once(__DIR__ . "/../include/editor_cls.php");
include_once(__DIR__ . "/../include/select_tree.php");

class SourceController
class AdminSourceController
{
private $editor_cls;

public function __construct()
{
$this->editor_cls = new editor_cls;
$this->editor_cls = new Editor_cls;
}

public function detail($dbh, $tree_id, $db_functions)
{
$editSourceModel = new EditSourceModel($dbh);
$editSourceModel = new AdminSourceModel($dbh);
$editSourceModel->set_source_id($dbh, $tree_id);
$editSourceModel->update_source($dbh, $tree_id, $db_functions, $this->editor_cls);
$editSource['source_id'] = $editSourceModel->get_source_id();
Expand Down
15 changes: 15 additions & 0 deletions admin/controller/adminStatisticsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
class AdminStatisticsController
{
public function detail($dbh)
{
$statisticsModel = new AdminStatisticsModel($dbh);

$statistics['tab'] = $statisticsModel->get_tab();

$data = $statisticsModel->get_data($dbh);
$statistics = array_merge($statistics, $data);

return $statistics;
}
}
14 changes: 14 additions & 0 deletions admin/controller/backupController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
class BackupController
{
public function detail($dbh)
{
$backupModel = new BackupModel($dbh);

$backupModel->process_old_files();

$backup['upload_status'] = $backupModel->upload_backup_file();

return $backup;
}
}
29 changes: 0 additions & 29 deletions admin/controller/edit_cms_pagesController.php

This file was deleted.

21 changes: 1 addition & 20 deletions admin/controller/editorController.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
<?php
require_once __DIR__ . "/../models/editor.php";

include_once(__DIR__ . "/../include/editor_cls.php");

include_once(__DIR__ . "/../include/select_tree.php");

// *** Used for person color selection for descendants and ancestors, etc. ***
include_once(__DIR__ . "/../../include/ancestors_descendants.php");

include_once(__DIR__ . '/../include/editor_event_cls.php');


// TODO check processing of tree_id in db_functions.
// *** Editor icon for admin and editor: select family tree ***
if (isset($tree_id) && $tree_id) {
$db_functions->set_tree_id($tree_id);
}


class EditorController
{
private $editor_cls;

public function __construct()
{
$this->editor_cls = new editor_cls;
$this->editor_cls = new Editor_cls;
}

public function detail($dbh, $tree_id, $tree_prefix, $db_functions, $humo_option)
Expand Down
21 changes: 21 additions & 0 deletions admin/controller/extensionsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
class ExtensionsController
{
public function detail($dbh, $db_functions, $humo_option, $language_file)
{
$extensionsModel = new ExtensionsModel($dbh);
$extensions['theme_folders'] = $extensionsModel->get_theme_folders();

$extensionsModel->save_settings($db_functions, $humo_option, $language_file, $extensions);


// *** Re-read variables after changing them ***
// *** Don't use include_once! Otherwise the old value will be shown ***
include(__DIR__ . "/../../include/settings_global.php"); //variables
$extensions['hide_languages'] = explode(";", $humo_option["hide_languages"]);
$extensions['hide_themes'] = explode(";", $humo_option["hide_themes"]);


return $extensions;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
require_once __DIR__ . "/../models/gedcom_export.php";

class Gedcom_exportController
class GedcomExportController
{
public function detail($dbh, $tree_id, $humo_option, $db_functions)
{
Expand Down
Loading

0 comments on commit f25db3b

Please sign in to comment.