コード例 #1
0
ファイル: tpl.inc.php プロジェクト: falkbizz/ispconfig3
 /**
  * vlibTemplate constructor.
  * if $tmplfile has been passed to it, it will send to $this->newTemplate()
  * @param string $tmplfile full path to template file
  * @param array $options see above
  * @return boolean true/false
  * @access private
  */
 public function __construct($tmplfile = null, $options = null)
 {
     if (is_array($tmplfile) && $options == null) {
         $options = $tmplfile;
         unset($tmplfile);
     }
     $this->VLIBTEMPLATE_ROOT = dirname(realpath(__FILE__));
     if (is_array(vlibIni::vlibTemplate())) {
         foreach (vlibIni::vlibTemplate() as $name => $val) {
             $this->OPTIONS[$name] = $val;
         }
     }
     if (is_array($options)) {
         foreach ($options as $key => $val) {
             $key = strtoupper($key);
             if ($key == 'PATH') {
                 $this->setPath($val);
             } else {
                 $this->_setOption($key, strtolower($val));
             }
         }
     }
     if ($tmplfile) {
         $this->newTemplate($tmplfile);
     }
     if ($this->OPTIONS['GLOBAL_CONTEXT_VARS']) {
         $this->setContextVars();
     }
     return true;
 }