changed git call from https to git readonly
[atutor.git] / mods / wiki / fragments / head / meta.php
1 <?php
2 /*
3    This script embeds meta data (from meta edit box) into generated .html
4    pages:
5    - <meta name="keywords" ...
6    - <link rel="prev" ...
7
8    include() this fragment AFTER you have loaded 'ewiki.php' and have
9    run ewiki_page() at least once:
10
11     <&php
12        include("ewiki.php");
13        $CONTENT = ewiki_page();
14     &><html>
15     <head>
16       <title><&php echo $ewiki_title; &></title>
17       <&php include("fragments/head/meta.php"); &>
18       <&php include("fragments/css.php"); &>
19     </head>
20     ...
21 */
22
23 if ($ewiki_data && function_exists("ewiki_script")) {
24    if ($m = &$ewiki_data["meta"]["meta"]) {
25
26       #-- real page <meta> data
27       $real_meta = array("keywords", "description", "author", "robots");
28       foreach ($real_meta as $i) {
29          if ($m[$i]) {
30             echo '<meta name="'.$i.'" content="'.htmlentities($m[$i]).'">'."\n";
31          }
32       }
33
34       #-- site structure meta <link>s
35       $rel_links = array("prev", "next", "contents", "chapter", "section", "start");
36       foreach ($rel_links as $i) {
37          if ($m[$i]) {
38             echo '<link rel="'.$i.'" href="'.ewiki_script("", $m[$i]).'">'."\n";
39          }
40       }
41
42       #-- alternate representations
43       $alt_repr = array("links", "edit");
44       foreach ($alt_repr as $i) {
45          if ($ewiki_action==$i) { $i = ""; }
46          echo '<link rel="alternate" href="'.ewiki_script($i, $ewiki_id).'" title="'.htmlentities($i?$i:$ewiki_id).'">'."\n";
47       }
48    }
49 }
50
51 ?>