Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/admin/admin_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
*/

include "../../../include/cp_header.php";
include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php";
include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php";
include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/class/art/functions.php";
include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/class/art/functions.admin.php";

if (!iforum_load_art_functions('admin')) {
trigger_error('Unable to initialize the iForum Art admin runtime.', E_USER_WARNING);
return;
}

// include the default language file for the admin interface
if (!@include_once(ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/language/" . $icmsConfig['language'] . "/main.php"))
Expand Down
2 changes: 1 addition & 1 deletion src/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
*/

include_once '../../mainfile.php';
include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php";
include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php";
include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/functions.php";
include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/class/art/functions.php";

$myts = icms_core_Textsanitizer::getInstance();

Expand Down
2 changes: 1 addition & 1 deletion src/icms_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
$modversion['submit_feature'] = "https://www.impresscms.org/modules/iforum/";
$modversion['submit_bug'] = "https://www.impresscms.org/modules/iforum/";

include_once(ICMS_ROOT_PATH."/modules/".$modulename."/class/art/functions.ini.php");
include_once(ICMS_ROOT_PATH."/modules/".$modulename."/include/bootstrap.php");
include_once(ICMS_ROOT_PATH."/modules/".$modulename."/include/functions.php");
// Is performing module install/update?
$isModuleAction = icms_moduleAction($modversion['dirname']);
Expand Down
44 changes: 44 additions & 0 deletions src/include/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,47 @@ function &iforum_get_handler($handlerName)

return $handler;
}

function iforum_load_art_functions_ini()
{
if (defined('FRAMEWORKS_ART_FUNCTIONS_INI')) {
return true;
}

include_once iforum_get_module_path('class/art/functions.ini.php');

return defined('FRAMEWORKS_ART_FUNCTIONS_INI');
}

function iforum_load_art_functions($group = '')
{
if (!iforum_load_art_functions_ini()) {
return false;
}

$constant = 'FRAMEWORKS_ART_FUNCTIONS';
if ($group !== '') {
$constant .= '_' . strtoupper($group);
}

if ($group === '') {
include_once iforum_get_module_path('class/art/functions.php');
} else {
if (!function_exists('load_functions')) {
return false;
}

load_functions($group);
}

return defined($constant);
}

function iforum_load_art_object()
{
if (!iforum_load_art_functions_ini() || !function_exists('load_object')) {
return false;
}

return load_object();
}
13 changes: 8 additions & 5 deletions src/include/functions.ini.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@
{
exit();
}

include_once dirname(__DIR__).'/include/bootstrap.php';

if (defined("IFORUM_FUNCTIONS_INI")) return;
define("IFORUM_FUNCTIONS_INI", 1);

include_once(ICMS_ROOT_PATH."/modules/".basename(dirname(__FILE__, 2))."/class/art/functions.php");

define("IFORUM_FUNCTIONS_INI", 1);

/**
* @deprecated since 2.4.0, use iforum_load_art_object() instead; kept for compatibility and planned for removal in 3.0.0.
*/
function iforum_load_object()
{
return load_object();
return iforum_load_art_object();
}

function iforum_message($message )
Expand Down
4 changes: 4 additions & 0 deletions src/include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
define("IFORUM_FUNCTIONS", true);

include_once dirname(__FILE__)."/functions.ini.php";
if (!iforum_load_art_functions()) {
trigger_error('Unable to initialize the iForum Art runtime.', E_USER_WARNING);
return;
}
if (!defined("_GLOBAL_LEFT"))
{
define('_GLOBAL_LEFT', ((defined('_ADM_USE_RTL') && _ADM_USE_RTL )?"right":"left"));
Expand Down
Loading