Your browser must have JavaScript enabled in order to view this page.
 >  >
 
Welcome Guest#217 Login/register    Go to Bottom
Go to Top

Source for file dptemplates.php

Documentation is available at dptemplates.php

  1. <?php
  2. /**
  3.  * Common functions for templates available to universe objects and dpclient.php
  4.  *
  5.  * DutchPIPE version 0.4; PHP version 5
  6.  *
  7.  * LICENSE: This source file is subject to version 1.0 of the DutchPIPE license.
  8.  * If you did not receive a copy of the DutchPIPE license, you can obtain one at
  9.  * http://dutchpipe.org/license/1_0.txt or by sending a note to
  10.  * license@dutchpipe.org, in which case you will be mailed a copy immediately.
  11.  *
  12.  * @package    DutchPIPE
  13.  * @subpackage lib
  14.  * @author     Lennert Stock <ls@dutchpipe.org>
  15.  * @copyright  2006, 2007 Lennert Stock
  16.  * @license    http://dutchpipe.org/license/1_0.txt  DutchPIPE License
  17.  * @version    Subversion: $Id: dptemplates.php 277 2007-08-19 18:15:10Z ls $
  18.  * @link       http://dutchpipe.org/manual/package/DutchPIPE
  19.  * @see        dpuniverse.php, dptemplates.php
  20.  */
  21.  
  22. /**
  23.  * Gets subtemplates for the default template or a given template file name
  24.  *
  25.  * Returns full paths for subtemplates. If no template file name is given with
  26.  * $templatePath, the default dpdefault.tpl is used. The array with subtemplates
  27.  * should contain snippets identying subtemplates, such as "input". The function
  28.  * will then return the full path to dpdefault_info.tpl. If a non-default
  29.  * template file is given, for example dpcustom.tpl, and the subtemplate for it
  30.  * exists, the full path to that subtemplate, in the example dpcustom_info.tpl,
  31.  * is returned instead.
  32.  *
  33.  * @access  private
  34.  * @param   array   $subtemplates  array with subtemplates
  35.  * @param   string  $templatePath  template file name
  36.  * @return  array   array with pathnames to subtemplates
  37.  */
  38. function dp_get_subtemplates($subtemplates$templatePath)
  39. {
  40.     $rvals array();
  41.  
  42.     if ($templatePath{
  43.         $pos dp_strrpos($templatePath'.');
  44.         if (FALSE !== $pos{
  45.             $prefix substr($templatePath0$pos);
  46.             $postfix substr($templatePath$pos);
  47.             foreach ($subtemplates as $subtemplate{
  48.                 $rvals[$subtemplate$prefix '_' $subtemplate $postfix;
  49.                 if (!file_exists($rvals[$subtemplate])) {
  50.                     $rvals[$subtemplateFALSE;
  51.                 }
  52.             }
  53.         }
  54.     }
  55.     foreach ($subtemplates as $subtemplate{
  56.         if (empty($rvals[$subtemplate])) {
  57.             $rvals[$subtemplateDPSERVER_TEMPLATE_PATH 'dpdefault_'
  58.                 . $subtemplate '.tpl';
  59.         }
  60.     }
  61.  
  62.     return $rvals;
  63. }
  64. ?>

Documentation generated on Mon, 03 Sep 2007 22:20:41 +0200 by phpDocumentor 1.3.0RC6

Click me!
Guest#217
 
 
 
  Go to Top
 
 
Input Field OptionsClose Input Field Go to Top
 
Legal Notices | Copyright © 2006, 2007 Lennert Stock. All rights reserved. Last update: Mon Sep 03 2007, 21:50 CET.