[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/wiki/template/ -> common.php (source)

   1  <?php
   2  // $Id: common.php 20988 2006-04-06 11:09:19Z ralfbecker $
   3  
   4  // This function generates the common prologue and header
   5  // for the various templates.
   6  //
   7  // Its parameters are passed as an associative array with the following
   8  // members:
   9  //
  10  //   'norobots' => An integer; if nonzero, robots will be forbidden to
  11  //                 index the page or follow links from the page.
  12  //   'title'    => A string containing the page title.  This function
  13  //                 will append ' - WikiName' to the title.
  14  //   'heading'  => A string containing the page's heading.
  15  //   'headlink' => A string.  If not empty, it will be appended to the
  16  //                 page's heading as a link to find the contents of the
  17  //                 string in the database.
  18  //   'headsufx' => A string containing the heading suffix.  If not
  19  //                 empty, it will be printed after the heading link.
  20  //   'toolbar'  => An integer; if nonzero, the toolbar will be displayed.
  21  
  22  function template_common_prologue($args)
  23  {
  24      global $WikiName, $HomePage, $WikiLogo, $MetaKeywords, $MetaDescription;
  25      global $StyleScript, $SeparateTitleWords, $SeparateHeaderWords, $SearchURL, $FindScript;
  26  
  27      //echo "<p>template_common_prologue(".print_r($args,True).")</p>";
  28      $keywords = ' ' . html_split_name($args['headlink']);
  29      $keywords = str_replace('"', '&quot;', $keywords);
  30  
  31  //ob_start();                           // Start buffering output.
  32  /*
  33      if($SeparateTitleWords)
  34          { $args['title'] = html_split_name($args['title']); }
  35  ?>
  36  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  37  <html xmlns="http://www.w3.org/1999/xhtml">
  38  <head>
  39  <meta name="KEYWORDS" content="<?php print $MetaKeywords . $keywords; ?>" />
  40  <meta name="DESCRIPTION" content="<?php print $MetaDescription; ?>" />
  41  <?php
  42      if($args['norobots'])
  43      {
  44  ?>
  45  <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
  46  <?php
  47      }
  48  ?>
  49  <link rel="STYLESHEET" href="<?php print $StyleScript; ?>" type="text/css" />
  50  <title><?php print $args['title'] . ' - ' . $WikiName; ?></title>
  51  </head>
  52  <body>
  53  <?php
  54  */
  55  
  56  /* <link rel="stylesheet" href="<?php echo $GLOBALS['egw_info']['server']['webserver_url'].'/wiki/template/wiki.css'; ?>" type="text/css" /> */
  57  ?>
  58  <div align="left">
  59  <div id="header">
  60      <?php /* removed logo for now: TODO show it on extern site
  61      <div class="logo">
  62       <a href="<?php print viewURL($HomePage); ?>"><img
  63          src="<?php print $WikiLogo; ?>" alt="[Home]" /></a>
  64      </div> */ ?>
  65      <h1 style="margin:0px;">
  66  <?php
  67          print $args['heading'];
  68          if($args['headlink'] != '')
  69          {
  70  ?>
  71          <a class="title" href="<?php print findURL($args['headlink']); ?>">
  72  <?php
  73      $title = get_title($args['headlink']);
  74          if($SeparateHeaderWords)
  75              { print html_split_name($title); }
  76          else
  77              { print $title; }
  78  ?></a>
  79  <?php
  80          }
  81          print $args['headsufx'];
  82  ?>
  83      </h1>
  84  <?php
  85      if($args['toolbar'])
  86      { 
  87          if(!$args['nosearch']) 
  88          { 
  89              echo '<form method="POST" action="'.$FindScript.'" name="thesearch">
  90                  <div class="form">'."\n";
  91          }   
  92          print html_toolbar_top();
  93          
  94          if(!$args['nosearch']) 
  95          {
  96              echo ' | <input type="text" name="search" size="20" /> <input type="submit" value="'.htmlspecialchars(lang('Search')).'" />';
  97          }
  98          echo "\n<hr align=left width=99% />\n";
  99          
 100          if(!$args['nosearch']) { 
 101              echo "</div>\n</form>\n";
 102          } 
 103      }
 104      ?>
 105  </div>
 106  <?php
 107  }
 108  
 109  // This function generates the common prologue and header
 110  // for the various templates.
 111  //
 112  // Its parameters are passed as an associative array with the following
 113  // members:
 114  //
 115  //   'twin'      => A string containing the page's name; if not empty,
 116  //                  twin pages will be sought and printed.
 117  //   'edit'      => A string containing the page's name; if not empty,
 118  //                  an edit link will be printed.
 119  //   'editver'   => An integer containing the page's version; if not
 120  //                  zero, the edit link will be directed at the given
 121  //                  version.  If it is -1, the page cannot be edited,
 122  //                  and a message to that effect will be printed.
 123  //   'history'   => A string containing the page's name; if not empty,
 124  //                  a history link will be printed.
 125  //   'timestamp' => Timestamp for the page.  If not empty, a 'document
 126  //                  last modified' note will be printed.
 127  //   'nosearch'  => An integer; if nonzero, the search form will not appear.
 128  
 129  function template_common_epilogue($args)
 130  {
 131      global $FindScript, $pagestore, $PrefsScript, $AdminScript;
 132      //echo "<p>template_common_epilogue(".print_r($args,True).")</p>";
 133  
 134  ?>
 135  <div id="footer">
 136  <hr align=left width=99% />
 137  <?php
 138      if(!$args['nosearch']) { ?>    
 139          <form method="POST" action="<?php print $FindScript; ?>" name="thesearch">
 140              <div class="form">
 141                  <input type="hidden" name="action" value="find" />
 142  <?php
 143      }
 144      if($args['edit'])
 145      {
 146          if($args['editver'] == 0)
 147          {
 148               echo '<a href="'.editURL($args['edit']).'">'.lang('Edit this document').'</a>';
 149          }
 150          else if($args['editver'] == -1)
 151          {
 152               echo lang('This page can not be edited.');
 153          }
 154          else
 155          {
 156               echo '<a href="'.editURL($args['edit'], $args['editver']).'">'.
 157               lang('Edit this <em>ARCHIVE VERSION</em> of this document').'</a>';
 158          }
 159  
 160          if($args['history'])
 161              { print ' | '; }
 162      }
 163      if($args['history'])
 164      {
 165          echo '<a href="'.historyURL($args['history']).'">'.lang('View document history').'</a>';
 166      
 167          if(!$args['nosearch']) {
 168              echo ' | '.lang('Search').': <input type="text" name="find" size="20" />';
 169          }
 170      }
 171      if($args['timestamp'])
 172      {
 173          echo ' | '.lang('Document last modified').' '.html_time($args['timestamp']);
 174      } ?>
 175              </div>
 176          </form>
 177  <?php
 178      if($args['twin'] != '')
 179      {
 180          if(count($twin = $pagestore->twinpages($args['twin'])))
 181          {
 182              echo '<br />'.lang('Twin pages').': ';
 183              for($i = 0; $i < count($twin); $i++)
 184                  { print html_twin($twin[$i][0], $twin[$i][1]) . ' '; } ?>
 185  <br /><?php
 186          }
 187      }
 188      if(!$args['nosearch'] && $args['history'])
 189      {
 190          echo "\n<hr align=left width=99% />\n";
 191      }
 192  ?>
 193  </div>
 194  <?php
 195  //</body>
 196  //</html>
 197  /*
 198      $size = ob_get_length();
 199      ##header("Content-Length: $size");
 200      ob_end_flush();
 201  */
 202  }
 203  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7