Put CSS in separated file
Benjamin Renard

Benjamin Renard commited on 2013-08-21 17:39:20
Showing 3 changed files, with 28 additions and 27 deletions.

... ...
@@ -9,6 +9,7 @@
9 9
 class ProjectInfosPlugin extends VGPlugin
10 10
 {
11 11
 	function __construct() {
12
+		$this->register_hook('header');
12 13
 		$this->register_hook('summary');
13 14
 	}
14 15
 
... ...
@@ -23,8 +24,10 @@ class ProjectInfosPlugin extends VGPlugin
23 24
 
24 25
 	function hook($type) {
25 26
 		global $conf;
26
-
27
-		if ($type == 'summary') {
27
+                if ($type == 'header') {
28
+                        echo "\t<link rel='stylesheet' href='plugins/projectinfos/style.css' type='text/css' />\n";
29
+                }
30
+		elseif ($type == 'summary') {
28 31
 			$this -> hook_summary();
29 32
 		}
30 33
 	}
... ...
@@ -0,0 +1,23 @@
1
+dl.projectinfos {
2
+	margin:		0;
3
+	padding:	0;
4
+}
5
+
6
+dl.projectinfos dt {
7
+	position:		relative;
8
+	width:			9em;
9
+	left:			0.2em;
10
+	font-weight:		bold;
11
+}
12
+
13
+dl.projectinfos dd {
14
+	margin-left:		11em;
15
+	margin-top:		-1.3em;
16
+	padding:		0;
17
+}
18
+
19
+dl.projectinfos ul {
20
+	list-style-type:	none;
21
+	margin:			0;
22
+	padding:		0;
23
+}
... ...
@@ -1,31 +1,6 @@
1 1
 <?php
2 2
 global $page;
3 3
 ?>
4
-<style>
5
-dl.projectinfos {
6
-	margin:		0;
7
-	padding:	0;
8
-}
9
-
10
-dl.projectinfos dt {
11
-	position:		relative;
12
-	width:			7em;
13
-	left:			0.2em;
14
-	font-weight:		bold;
15
-}
16
-
17
-dl.projectinfos dd {
18
-	margin-left:		7em;
19
-	margin-top:		-1.3em;
20
-	padding:		0;
21
-}
22
-
23
-dl.projectinfos ul {
24
-	list-style-type:	none;
25
-	margin:			0;
26
-	padding:		0;
27
-}
28
-</style>
29 4
 <h1 class='projectinfos'>Project informations</h1>
30 5
 <dl class='projectinfos'>
31 6
 <dt>Description</dt>
32 7