Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
20c62a98
Commit
20c62a98
authored
15 years ago
by
SNA
Browse files
Options
Downloads
Patches
Plain Diff
Evol : modification de la fonction insert_page pour prendre en compte les chemins relatifs
Evol : Ajout de la fonction load_maarch_xml()
parent
3a95a26e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/trunk/core/class/class_core_tools.php
+104
-10
104 additions, 10 deletions
core/trunk/core/class/class_core_tools.php
with
104 additions
and
10 deletions
core/trunk/core/class/class_core_tools.php
+
104
−
10
View file @
20c62a98
...
@@ -965,6 +965,7 @@ class core_tools extends functions
...
@@ -965,6 +965,7 @@ class core_tools extends functions
// Page is defined in a module
// Page is defined in a module
if
(
isset
(
$_GET
[
'module'
])
&&
$_GET
[
'module'
]
<>
"core"
)
if
(
isset
(
$_GET
[
'module'
])
&&
$_GET
[
'module'
]
<>
"core"
)
{
{
/*
$path = $_SESSION['pathtomodules'].$_GET['module'].DIRECTORY_SEPARATOR.$this->f_page.".php";
$path = $_SESSION['pathtomodules'].$_GET['module'].DIRECTORY_SEPARATOR.$this->f_page.".php";
if(file_exists($path))
if(file_exists($path))
{
{
...
@@ -975,10 +976,22 @@ class core_tools extends functions
...
@@ -975,10 +976,22 @@ class core_tools extends functions
//require($_SESSION["config"]["defaultPage"].".php");
//require($_SESSION["config"]["defaultPage"].".php");
$this->loadDefaultPage();
$this->loadDefaultPage();
}
}
*/
if
(
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'modules'
.
$_GET
[
'module'
]
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
)
||
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'clients'
.
$_SESSION
[
'high_layer_id'
]
.
'modules'
.
$_GET
[
'module'
]
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
)
)
{
require
(
'modules'
.
$_GET
[
'module'
]
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
);
}
else
{
$this
->
loadDefaultPage
();
}
}
}
// Page is defined the core
// Page is defined the core
elseif
(
isset
(
$_GET
[
'module'
])
&&
$_GET
[
'module'
]
==
"core"
)
elseif
(
isset
(
$_GET
[
'module'
])
&&
$_GET
[
'module'
]
==
"core"
)
{
{
/*
if(file_exists($_SESSION['pathtocore'].$this->f_page.".php"))
if(file_exists($_SESSION['pathtocore'].$this->f_page.".php"))
{
{
require($_SESSION['pathtocore'].$this->f_page.".php");
require($_SESSION['pathtocore'].$this->f_page.".php");
...
@@ -988,10 +1001,22 @@ class core_tools extends functions
...
@@ -988,10 +1001,22 @@ class core_tools extends functions
//require($_SESSION["config"]["defaultPage"].".php");
//require($_SESSION["config"]["defaultPage"].".php");
$this->loadDefaultPage();
$this->loadDefaultPage();
}
}
*/
if
(
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'core'
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
)
||
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'clients'
.
$_SESSION
[
'high_layer_id'
]
.
'core'
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
)
)
{
require
(
'core'
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
);
}
else
{
$this
->
loadDefaultPage
();
}
}
}
// Page is defined the admin directory of the application
// Page is defined the admin directory of the application
elseif
(
isset
(
$_GET
[
'admin'
])
&&
!
empty
(
$_GET
[
'admin'
]))
elseif
(
isset
(
$_GET
[
'admin'
])
&&
!
empty
(
$_GET
[
'admin'
]))
{
{
/*
$path = $_SESSION['config']['businessapppath']."admin".DIRECTORY_SEPARATOR.trim($_GET['admin']).DIRECTORY_SEPARATOR.$this->f_page.'.php';
$path = $_SESSION['config']['businessapppath']."admin".DIRECTORY_SEPARATOR.trim($_GET['admin']).DIRECTORY_SEPARATOR.$this->f_page.'.php';
if(file_exists($path))
if(file_exists($path))
{
{
...
@@ -1002,9 +1027,21 @@ class core_tools extends functions
...
@@ -1002,9 +1027,21 @@ class core_tools extends functions
//require($_SESSION["config"]["defaultPage"].".php");
//require($_SESSION["config"]["defaultPage"].".php");
$this->loadDefaultPage();
$this->loadDefaultPage();
}
}
*/
if
(
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"admin"
.
DIRECTORY_SEPARATOR
.
trim
(
$_GET
[
'admin'
])
.
$this
->
f_page
.
".php"
)
||
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'clients'
.
$_SESSION
[
'high_layer_id'
]
.
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"admin"
.
DIRECTORY_SEPARATOR
.
trim
(
$_GET
[
'admin'
])
.
$this
->
f_page
.
".php"
)
)
{
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"admin"
.
DIRECTORY_SEPARATOR
.
trim
(
$_GET
[
'admin'
])
.
$this
->
f_page
.
".php"
);
}
else
{
$this
->
loadDefaultPage
();
}
}
}
elseif
(
isset
(
$_GET
[
'dir'
])
&&
!
empty
(
$_GET
[
'dir'
]))
elseif
(
isset
(
$_GET
[
'dir'
])
&&
!
empty
(
$_GET
[
'dir'
]))
{
{
/*
$path = $_SESSION['config']['businessapppath'].DIRECTORY_SEPARATOR.trim($_GET['dir']).DIRECTORY_SEPARATOR.$this->f_page.'.php';
$path = $_SESSION['config']['businessapppath'].DIRECTORY_SEPARATOR.trim($_GET['dir']).DIRECTORY_SEPARATOR.$this->f_page.'.php';
if(file_exists($path))
if(file_exists($path))
{
{
...
@@ -1015,10 +1052,22 @@ class core_tools extends functions
...
@@ -1015,10 +1052,22 @@ class core_tools extends functions
//require($_SESSION["config"]["defaultPage"].".php");
//require($_SESSION["config"]["defaultPage"].".php");
$this->loadDefaultPage();
$this->loadDefaultPage();
}
}
*/
if
(
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
trim
(
$_GET
[
'dir'
])
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
)
||
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'clients'
.
$_SESSION
[
'high_layer_id'
]
.
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
trim
(
$_GET
[
'dir'
])
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
)
)
{
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
trim
(
$_GET
[
'dir'
])
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
);
}
else
{
$this
->
loadDefaultPage
();
}
}
}
// Page is defined in the application
// Page is defined in the application
else
else
{
{
/*
if(file_exists($this->f_page.".php"))
if(file_exists($this->f_page.".php"))
{
{
require($this->f_page.".php");
require($this->f_page.".php");
...
@@ -1038,6 +1087,34 @@ class core_tools extends functions
...
@@ -1038,6 +1087,34 @@ class core_tools extends functions
require($path);
require($path);
}
}
}
}
*/
if
(
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
)
||
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'clients'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'high_layer_id'
]
.
DIRECTORY_SEPARATOR
.
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
)
)
{
echo
"<br/>'"
.
$_SESSION
[
'config'
][
'corepath'
]
.
'clients'
.
$_SESSION
[
'high_layer_id'
]
.
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
.
"'<br/>"
;
if
(
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'clients'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'high_layer_id'
]
.
DIRECTORY_SEPARATOR
.
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
))
{
echo
'FILE EXISTS'
;
}
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
$this
->
f_page
.
".php"
);
}
else
{
require_once
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"class"
.
DIRECTORY_SEPARATOR
.
"class_business_app_tools.php"
);
$app
=
new
business_app_tools
();
$path
=
$app
->
insert_app_page
(
$this
->
f_page
);
if
(
!
$path
||
!
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
'clients'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'high_layer_id'
]
.
DIRECTORY_SEPARATOR
.
$path
)
||
!
file_exists
(
$_SESSION
[
'config'
][
'corepath'
]
.
$path
))
{
//require($_SESSION["config"]["defaultPage"].".php");
$this
->
loadDefaultPage
();
}
else
{
require
(
$path
);
}
}
}
}
}
}
...
@@ -1068,7 +1145,7 @@ class core_tools extends functions
...
@@ -1068,7 +1145,7 @@ class core_tools extends functions
if
(
count
(
$tmpTab
)
==
1
)
if
(
count
(
$tmpTab
)
==
1
)
{
{
$page
=
str_replace
(
"page="
,
""
,
$tmpTab
[
0
]);
$page
=
str_replace
(
"page="
,
""
,
$tmpTab
[
0
]);
require
(
$page
.
".php"
);
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
$page
.
".php"
);
}
}
elseif
(
count
(
$tmpTab
)
==
2
)
elseif
(
count
(
$tmpTab
)
==
2
)
{
{
...
@@ -1078,7 +1155,7 @@ class core_tools extends functions
...
@@ -1078,7 +1155,7 @@ class core_tools extends functions
$tabModuleOrAdmin
=
explode
(
"="
,
$tmpTab
[
1
]);
$tabModuleOrAdmin
=
explode
(
"="
,
$tmpTab
[
1
]);
if
(
$tabModuleOrAdmin
[
0
]
==
"module"
)
if
(
$tabModuleOrAdmin
[
0
]
==
"module"
)
{
{
require
(
$_SESSION
[
'pathtomodules'
]
.
$tabModuleOrAdmin
[
1
]
.
DIRECTORY_SEPARATOR
.
$tabPage
[
1
]
.
".php"
);
require
(
'modules'
.
DIRECTORY_SEPARATOR
.
$tabModuleOrAdmin
[
1
]
.
DIRECTORY_SEPARATOR
.
$tabPage
[
1
]
.
".php"
);
}
}
else
else
{
{
...
@@ -1087,17 +1164,17 @@ class core_tools extends functions
...
@@ -1087,17 +1164,17 @@ class core_tools extends functions
||
$tabPage
[
1
]
==
"status"
||
$tabPage
[
1
]
==
"action"
||
$tabPage
[
1
]
==
"xml_param_services"
||
$tabPage
[
1
]
==
"modify_user"
||
$tabPage
[
1
]
==
"status"
||
$tabPage
[
1
]
==
"action"
||
$tabPage
[
1
]
==
"xml_param_services"
||
$tabPage
[
1
]
==
"modify_user"
)
)
{
{
require
(
$_SESSION
[
'config'
][
'businessapppath'
]
.
"admin"
.
DIRECTORY_SEPARATOR
.
$tabModuleOrAdmin
[
1
]
.
DIRECTORY_SEPARATOR
.
$tabPage
[
1
]
.
".php"
);
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"admin"
.
DIRECTORY_SEPARATOR
.
$tabModuleOrAdmin
[
1
]
.
DIRECTORY_SEPARATOR
.
$tabPage
[
1
]
.
".php"
);
}
}
else
else
{
{
require
(
"welcome.php"
);
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"welcome.php"
);
}
}
}
}
}
}
else
else
{
{
require
(
"welcome.php"
);
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"welcome.php"
);
}
}
}
}
elseif
(
trim
(
$_SESSION
[
"config"
][
"defaultPage"
])
<>
""
)
elseif
(
trim
(
$_SESSION
[
"config"
][
"defaultPage"
])
<>
""
)
...
@@ -1107,7 +1184,7 @@ class core_tools extends functions
...
@@ -1107,7 +1184,7 @@ class core_tools extends functions
if
(
count
(
$tmpTab
)
==
1
)
if
(
count
(
$tmpTab
)
==
1
)
{
{
$page
=
str_replace
(
"page="
,
""
,
$tmpTab
[
0
]);
$page
=
str_replace
(
"page="
,
""
,
$tmpTab
[
0
]);
require
(
$page
.
".php"
);
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
$page
.
".php"
);
}
}
elseif
(
count
(
$tmpTab
)
==
2
)
elseif
(
count
(
$tmpTab
)
==
2
)
{
{
...
@@ -1117,21 +1194,21 @@ class core_tools extends functions
...
@@ -1117,21 +1194,21 @@ class core_tools extends functions
$tabModuleOrAdmin
=
explode
(
"="
,
$tmpTab
[
1
]);
$tabModuleOrAdmin
=
explode
(
"="
,
$tmpTab
[
1
]);
if
(
$tabModuleOrAdmin
[
0
]
==
"module"
)
if
(
$tabModuleOrAdmin
[
0
]
==
"module"
)
{
{
require
(
$_SESSION
[
'pathtomodules'
]
.
$tabModuleOrAdmin
[
1
]
.
DIRECTORY_SEPARATOR
.
$tabPage
[
1
]
.
".php"
);
require
(
'modules'
.
DIRECTORY_SEPARATOR
.
$tabModuleOrAdmin
[
1
]
.
DIRECTORY_SEPARATOR
.
$tabPage
[
1
]
.
".php"
);
}
}
else
else
{
{
require
(
$_SESSION
[
'config'
][
'businessapppath'
]
.
"admin"
.
DIRECTORY_SEPARATOR
.
$tabModuleOrAdmin
[
1
]
.
DIRECTORY_SEPARATOR
.
$tabPage
[
1
]
.
".php"
);
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"admin"
.
DIRECTORY_SEPARATOR
.
$tabModuleOrAdmin
[
1
]
.
DIRECTORY_SEPARATOR
.
$tabPage
[
1
]
.
".php"
);
}
}
}
}
else
else
{
{
require
(
"welcome.php"
);
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'config'
][
'app_id'
]
.
DIRECTORY_SEPARATOR
.
"welcome.php"
);
}
}
}
}
else
else
{
{
require
(
"welcome.php"
);
require
(
'apps'
.
DIRECTORY_SEPARATOR
.
"welcome.php"
);
}
}
}
}
...
@@ -1735,5 +1812,22 @@ class core_tools extends functions
...
@@ -1735,5 +1812,22 @@ class core_tools extends functions
}
}
return
false
;
return
false
;
}
}
public
function
load_maarch_xml
(
$path
)
{
//echo $_SESSION['core_path'].'clients'.DIRECTORY_SEPARATOR.$_SESSION['high_layer_id'].DIRECTORY_SEPARATOR.$path;
if
(
file_exists
(
$_SESSION
[
'core_path'
]
.
'clients'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'high_layer_id'
]
.
DIRECTORY_SEPARATOR
.
$path
))
{
return
simplexml_load_file
(
$_SESSION
[
'core_path'
]
.
'clients'
.
DIRECTORY_SEPARATOR
.
$_SESSION
[
'high_layer_id'
]
.
DIRECTORY_SEPARATOR
.
$path
);
}
else
if
(
file_exists
(
$_SESSION
[
'core_path'
]
.
$path
))
{
return
simplexml_load_file
(
$_SESSION
[
'core_path'
]
.
$path
);
}
else
{
return
false
;
}
}
}
}
?>
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment