art-web r532 - in branches/art-hub: lib templates



Author: thos
Date: Tue Jun 17 19:49:08 2008
New Revision: 532
URL: http://svn.gnome.org/viewvc/art-web?rev=532&view=rev

Log:
* Support dynamic addition of css links


Modified:
   branches/art-hub/lib/template.php
   branches/art-hub/templates/header.php

Modified: branches/art-hub/lib/template.php
==============================================================================
--- branches/art-hub/lib/template.php	(original)
+++ branches/art-hub/lib/template.php	Tue Jun 17 19:49:08 2008
@@ -3,15 +3,23 @@
 class Template
 {
   var $page;
+  var $css;
 
   function Template ($page)
   {
     $this->page = $page;
+    $css = array ();
+  }
+
+  function add_css ($file)
+  {
+    $this->css[] = $file;
   }
 
   function print_header ()
   {
     $page = $this->page;
+    $css = $this->css;
     include ("templates/header.php");
   }
 

Modified: branches/art-hub/templates/header.php
==============================================================================
--- branches/art-hub/templates/header.php	(original)
+++ branches/art-hub/templates/header.php	Tue Jun 17 19:49:08 2008
@@ -10,6 +10,9 @@
 
   <link href="/css/layout.css" rel="stylesheet" type="text/css" media="screen">
   <link href="/css/style.css" rel="stylesheet" type="text/css" media="all">
+  <?php foreach ($css as $s): ?>
+    <link href="<?php echo $s?>" rel="stylesheet" type="text/css" media="all">
+  <?php endforeach ?>
   <link rel="icon" type="image/png" href="http://www.gnome.org/img/logo/foot-16.png";>
   <link rel="SHORTCUT ICON" type="image/png" href="http://www.gnome.org/img/logo/foot-16.png";>
   <title>GNOME: The Free Software Desktop Project</title>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]