Update core class include style and smarty test page

All libs/classes have an loop to find the needed previous class file.
Smarty test page included.
This commit is contained in:
Clemens Schwaighofer
2015-11-11 11:08:41 +09:00
parent aa73634d95
commit 5a1c9f87c2
10 changed files with 84 additions and 7 deletions

View File

@@ -25,7 +25,13 @@
*
*********************************************************************/
require_once(LIBS."Class.DB.IO.inc");
// try to include file from LIBS path, or from normal path
$include_file = 'Class.DB.IO.inc';
foreach (array('', LIBS, __DIR__.'/') as $folder)
{
if (file_exists($folder.$include_file))
require_once($folder.$include_file);
}
class AdminBackend extends db_io
{

View File

@@ -38,7 +38,13 @@
// as it actually has nothing to do with this one here ? (or at least
// put into separete function in this class)
require_once(LIBS."Class.DB.IO.inc");
// try to include file from LIBS path, or from normal path
$include_file = 'Class.DB.IO.inc';
foreach (array('', LIBS, __DIR__.'/') as $folder)
{
if (file_exists($folder.$include_file))
require_once($folder.$include_file);
}
// subclass for one array handling
class db_array_io extends db_io

View File

@@ -240,7 +240,13 @@
* 23.11.2000: erster Test
*********************************************************************/
require_once(LIBS.'Class.Basic.inc');
// try to include file from LIBS path, or from normal path
$include_file = 'Class.Basic.inc';
foreach (array('', LIBS, __DIR__.'/') as $folder)
{
if (file_exists($folder.$include_file))
require_once($folder.$include_file);
}
class db_io extends basic
{

View File

@@ -212,7 +212,13 @@
* save data, loads data, etc
*********************************************************************/
require_once(LIBS."Class.DB.Array.IO.inc");
// try to include file from LIBS path, or from normal path
$include_file = 'Class.DB.Array.IO.inc';
foreach (array('', LIBS, __DIR__.'/') as $folder)
{
if (file_exists($folder.$include_file))
require_once($folder.$include_file);
}
class form extends db_array_io
{

View File

@@ -59,7 +59,13 @@
* 2000-06-01: created basic idea and functions
*********************************************************************/
require_once(LIBS."Class.DB.IO.inc");
// try to include file from LIBS path, or from normal path
$include_file = 'Class.DB.IO.inc';
foreach (array('', LIBS, __DIR__.'/') as $folder)
{
if (file_exists($folder.$include_file))
require_once($folder.$include_file);
}
class login extends db_io
{

View File

@@ -10,7 +10,13 @@
// read in the Smarty class for definition
// use smarty BC for backwards compability
require_once(SMARTY.'SmartyBC.class.php');
// try to include file from LIBS path, or from normal path
$include_file = 'SmartyBC.class.php';
foreach (array('', SMARTY, __DIR__.'/../'.SMARTY) as $folder)
{
if (file_exists($folder.$include_file))
require_once($folder.$include_file);
}
class SmartyML extends SmartyBC
{

View File

@@ -25,7 +25,13 @@
* 2005/10/17 (cs) made an on the fly switch method (reload of lang)
*********************************************************************/
require_once(LIBS."Class.Basic.inc");
// try to include file from LIBS path, or from normal path
$include_file = 'Class.Basic.inc';
foreach (array('', LIBS, __DIR__.'/') as $folder)
{
if (file_exists($folder.$include_file))
require_once($folder.$include_file);
}
class l10n extends basic
{