XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
main.php
Go to the documentation of this file.
1 <?php
2 // start hack by Trabis
3 if (!class_exists('ProtectorRegistry')) exit('Registry not found');
4 
6 $mydirname = $registry->getEntry('mydirname');
7 $mydirpath = $registry->getEntry('mydirpath');
8 $language = $registry->getEntry('language');
9 // end hack by Trabis
10 
11 $mytrustdirname = basename( dirname( __FILE__ ) ) ;
12 $mytrustdirpath = dirname( __FILE__ ) ;
13 
14 // check permission of 'module_read' of this module
15 // (already checked by common.php)
16 
17 // language files
18 // $language = empty( $xoopsConfig['language'] ) ? 'english' : $xoopsConfig['language'] ; //hack by Trabis
19 if( file_exists( "$mydirpath/language/$language/main.php" ) ) {
20  // user customized language file (already read by common.php)
21  // include_once "$mydirpath/language/$language/main.php" ;
22 } else if( file_exists( "$mytrustdirpath/language/$language/main.php" ) ) {
23  // default language file
24  include_once "$mytrustdirpath/language/$language/main.php" ;
25 } else {
26  // fallback english
27  include_once "$mytrustdirpath/language/english/main.php" ;
28 }
29 
30 // fork each pages
31 $page = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , @$_GET['page'] ) ;
32 
33 if( file_exists( "$mytrustdirpath/main/$page.php" ) ) {
34  include "$mytrustdirpath/main/$page.php" ;
35 } else {
36  include "$mytrustdirpath/main/index.php" ;
37 }
38 
39 
40 ?>