| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | * WiND - Wireless Nodes Database |
|---|
| 4 | * |
|---|
| 5 | * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr> |
|---|
| 6 | * |
|---|
| 7 | * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | * it under the terms of the GNU General Public License as published by |
|---|
| 9 | * the Free Software Foundation; version 2 dated June, 1991. |
|---|
| 10 | * |
|---|
| 11 | * This program is distributed in the hope that it will be useful, |
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | * GNU General Public License for more details. |
|---|
| 15 | * |
|---|
| 16 | * You should have received a copy of the GNU General Public License |
|---|
| 17 | * along with this program; if not, write to the Free Software |
|---|
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 19 | * |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | class head { |
|---|
| 23 | |
|---|
| 24 | var $tpl; |
|---|
| 25 | |
|---|
| 26 | function add_extra($extra) { |
|---|
| 27 | if (!isset($this->tpl['extra'])) $this->tpl['extra'] = ""; |
|---|
| 28 | $this->tpl['extra'] .= $extra; |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | function add_title($title) { |
|---|
| 32 | $this->tpl['title'] = $title; |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | function add_base($href, $target="") { |
|---|
| 36 | if (!isset($this->tpl['base'])) $this->tpl['base'] = array(); |
|---|
| 37 | array_push($this->tpl['base'], array('href' => $href, 'target' => $target)); |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | function add_link($rel, $type, $href) { |
|---|
| 41 | if (!isset($this->tpl['link'])) $this->tpl['link'] = array(); |
|---|
| 42 | array_push($this->tpl['link'], array('rel' => $rel, 'type' => $type, 'href' => $href)); |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | function add_meta($content, $name="", $http_equiv="", $scheme="") { |
|---|
| 46 | if (!isset($this->tpl['meta'])) $this->tpl['meta'] = array(); |
|---|
| 47 | array_push($this->tpl['meta'], array('http-equiv' => $http_equiv, 'content' => $content, 'name' => $name, 'scheme' => $scheme)); |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | function add_script($type,$src) { |
|---|
| 51 | if (!isset($this->tpl['script'])) $this->tpl['script'] = array(); |
|---|
| 52 | array_push($this->tpl['script'], array('type' => $type, 'src' => $src)); |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | function output() { |
|---|
| 56 | return template($this->tpl, __FILE__); |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | ?> |
|---|