Skip to content

Commit 06ac811

Browse files
committed
added directory.php
1 parent d35bb8b commit 06ac811

File tree

10 files changed

+87
-35
lines changed

10 files changed

+87
-35
lines changed

ajax.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#--------------------------------
1717
# Load the class
1818
#--------------------------------
19-
require_once "$application/config/constants.php";
19+
require_once "$application/config/directory.php";
20+
require_once "$application/config/const/constants.php";
2021
require_once "library/Loader.php";
2122
require_once "$application/Bootstrap.Loader.php";
2223

application/Bootstrap.Loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function init(){
2020
# init_route set the controller/action/params
2121
# to load the controller
2222
#--------------------------------
23-
$this->auto_load_controller();
23+
echo $this->auto_load_controller();
2424

2525

2626

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php if(!class_exists('raintpl')){exit;}?><div class="content">
2+
<h1><?php echo $title;?></h1>
3+
<div class="text"><?php echo $content;?></div>
4+
</div>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php if(!class_exists('raintpl')){exit;}?><!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title><?php echo $title;?></title>
5+
<link rel="stylesheet" href="http://localhost/github/rainframework/application/views//css/style.css" type="text/css" />
6+
7+
<!-- Style & Script -->
8+
<?php echo $head;?>
9+
10+
<!-- // -->
11+
12+
</head>
13+
<body>
14+
15+
<div id="header" class="doc">
16+
<div id="menu"><div><img src="http://localhost/github/rainframework/application/views//img/logo_mini.gif"><?php $counter1=-1; if( isset($menu) && is_array($menu) && sizeof($menu) ) foreach( $menu as $key1 => $value1 ){ $counter1++; ?><a href="http://localhost/github/rainframework/<?php echo $value1["link"];?>" <?php echo $value1["selected"]?'class="selected"':null;?>><?php echo $value1["name"];?></a><?php } ?></div>
17+
</div>
18+
19+
<div id="section" class="doc">
20+
<div id="section_inside">
21+
<div id="section_inside_inside">
22+
<?php echo $center;?>
23+
24+
</div>
25+
</div>
26+
</div>
27+
28+
<div id="footer">
29+
<div id="inner_footer">
30+
<div class="left"><?php $counter1=-1; if( isset($menu) && is_array($menu) && sizeof($menu) ) foreach( $menu as $key1 => $value1 ){ $counter1++; ?><?php echo $counter1?' | ':'';?><a href="http://localhost/github/rainframework/<?php echo $value1["link"];?>" <?php echo $value1["selected"]?'class="selected"':null;?>><?php echo $value1["name"];?></a><?php } ?></div>
31+
<div class="center">execution time: <?php echo $execution_time;?><br/>
32+
executed query: <?php echo $n_query;?><br/>
33+
</div>
34+
<div class="right">Copyright rain team</div>
35+
</div>
36+
</div>
37+
38+
</body>
39+
</html>
Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,6 @@
66
define( "RAINFRAMEWORK_VERSION", "Rain Framework 2.2" );
77

88

9-
//-------------------------------------------------------------
10-
//
11-
// Directories
12-
//
13-
//-------------------------------------------------------------
14-
15-
define( "BASE_DIR", dirname( $_SERVER['SCRIPT_NAME'] ) . "/" );
16-
17-
define( "APPLICATION_DIR", "$application/" );
18-
define( "LIBRARY_DIR", "library/" );
19-
20-
define( "EXTENSION_DIR", "library/extension/" );
21-
define( "WEB_DIR", "library/web/" );
22-
define( "JAVASCRIPT_DIR", "library/web/js/" );
23-
define( "CSS_DIR", "library/web/css/" );
24-
25-
define( "CONTROLLERS_DIR", "$application/controllers/" );
26-
define( "MODELS_DIR", "$application/models/" );
27-
define( "VIEWS_DIR", "$application/views/" );
28-
29-
define( "CONFIG_DIR", "$application/config/" );
30-
define( "LANGUAGE_DIR", "$application/language/" );
31-
define( "LOG_DIR", "$application/log/" );
32-
define( "MODULES_DIR", "$application/modules/" );
33-
define( "CACHE_DIR", "$application/cache/" ); //temp dir
34-
define( "UPLOADS_DIR", "$application/uploads/" );
35-
define( "APPLICATION_LIBRARY_DIR", "$application/library/" );
36-
37-
389

3910

4011
//-------------------------------------------------------------

application/config/db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$db['default']['dbserver'] = "mysql";
66
$db['default']['hostname'] = "localhost";
77
$db['default']['username'] = "root";
8-
$db['default']['password'] = "";
8+
$db['default']['password'] = "root";
99
$db['default']['database'] = "rainframework2";
1010
$db['default']['path'] = ""; // only for sqlite
1111

application/config/directory.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
4+
5+
//-------------------------------------------------------------
6+
//
7+
// Directories
8+
//
9+
//-------------------------------------------------------------
10+
11+
define( "BASE_DIR", dirname( $_SERVER['SCRIPT_NAME'] ) . "/" );
12+
13+
define( "APPLICATION_DIR", "$application/" );
14+
define( "LIBRARY_DIR", "library/" );
15+
16+
define( "EXTENSION_DIR", "library/extension/" );
17+
define( "WEB_DIR", "library/web/" );
18+
define( "JAVASCRIPT_DIR", "library/web/js/" );
19+
define( "CSS_DIR", "library/web/css/" );
20+
21+
define( "CONTROLLERS_DIR", "$application/controllers/" );
22+
define( "MODELS_DIR", "$application/models/" );
23+
define( "VIEWS_DIR", "$application/views/" );
24+
25+
define( "CONFIG_DIR", "$application/config/" );
26+
define( "CONSTANTS_DIR", "$application/config/const/" );
27+
define( "LANGUAGE_DIR", "$application/language/" );
28+
define( "LOG_DIR", "$application/log/" );
29+
define( "MODULES_DIR", "$application/modules/" );
30+
define( "CACHE_DIR", "$application/cache/" ); //temp dir
31+
define( "UPLOADS_DIR", "$application/uploads/" );
32+
define( "APPLICATION_LIBRARY_DIR", "$application/library/" );
33+
34+
35+
// -- end

application/models/Menu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ class Menu_Model extends Model{
55
function load_menu( $selected = null){
66
$menu = dir_list( CONTROLLERS_DIR );
77
foreach( $menu as $voice ){
8-
$menu_list[] = array('name'=>$voice, 'link'=> 'index.php/' . $voice . '/', 'selected' => $selected==$voice );
8+
$menu_list[] = array('name'=>$voice, 'link'=> basename($_SERVER['SCRIPT_NAME']). '/' . $voice . '/', 'selected' => $selected==$voice );
99
}
1010
return $menu_list;
1111
}
1212

1313
}
14-
14+
1515
?>

index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#--------------------------------
1717
# Load the class
1818
#--------------------------------
19-
require_once "$application/config/constants.php";
19+
require_once "$application/config/directory.php";
20+
require_once "$application/config/const/constants.php";
2021
require_once "library/Loader.php";
2122
require_once "$application/Bootstrap.Loader.php";
2223

library/Loader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010

11+
require_once CONSTANTS_DIR . "constants.php"; // constants
1112
require_once LIBRARY_DIR . "functions.php"; // functions
1213
require_once LIBRARY_DIR . "error.functions.php"; // error manager
1314

0 commit comments

Comments
 (0)