Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 23. október 2026

Rozdiely pre phpPlatonLib/templateSystems/phpTemplate/Attic/phpTemplate.class.php medzi verziami 1.1 a 1.2

verzia 1.1, 2002/03/13 22:54:39 verzia 1.2, 2002/03/18 23:25:53
Riadok 4 
Riadok 4 
   
 class phpTemplate  class phpTemplate
 {  {
   
         var $_cstr = array(          var $_cstr = array(
                         'begin' => '<!--',                          'begin' => '<!--',
                         'end' => '-->',                          'end' => '-->',
Riadok 13  class phpTemplate
Riadok 12  class phpTemplate
                         );                          );
   
         var $_tag = array(          var $_tag = array(
                         'begin' => '<\[',                          'begin' => '<|',
                         //'delim' => ':',                          //'delim' => ':',
                         'command' => 'cmd',                          'command' => 'cmd|',
                         'file' => 'file',                          'file' => 'include|',
                         'start' => 'start',                          'start' => 'start',
                         'stop' => 'stop',                          'stop' => 'stop',
                         'end' => '\]>'                          'end' => '|>'
                         );                          );
   
         var $_cmd = array( /* Both sides must be lowercase. */          var $_cmd = array( /* Both sides must be lowercase. */
Riadok 37  class phpTemplate
Riadok 36  class phpTemplate
   
         function phpTemplate($filename = '')          function phpTemplate($filename = '')
         {          {
                   foreach (array_keys($this->_tag) as $key) {
                           $this->_tag[$key] = preg_quote($this->_tag[$key]);
                           $this->_tag[$key.'_striped'] = stripslashes($this->_tag[$key]);
                   }
   
                 $this->_filename = $filename;                  $this->_filename = $filename;
                 $this->reload();                  $this->reload();
   
Riadok 109  class phpTemplate
Riadok 113  class phpTemplate
                         $this->_vars = array_merge($this->_vars, $matches[1]);                          $this->_vars = array_merge($this->_vars, $matches[1]);
                         //echo "adding: " . $matches[1] . "<br>";                          //echo "adding: " . $matches[1] . "<br>";
   
                         if (! strncasecmp($array[$i], $this->_tag['command'],                          if (! strncasecmp($array[$i], $this->_tag['command_striped'],
                                                 strlen($this->_tag['command']))) {                                                  strlen($this->_tag['command_striped']))) {
                                 $array[$i] = substr($array[$i], strlen($this->_tag['command']));                                  $array[$i] = substr($array[$i], strlen($this->_tag['command_striped']));
                         }                          }
                         elseif (! strncasecmp($array[$i], $this->_tag['file'],                          elseif (! strncasecmp($array[$i], $this->_tag['file_striped'],
                                                 strlen($this->_tag['file']))) {                                                  strlen($this->_tag['file_striped']))) {
                                 $filename = dirname($this->_filename) . '/'                                  $filename = dirname($this->_filename) . '/'
                                         . trim(substr($array[$i], strlen($this->_tag['file'])));                                          . trim(substr($array[$i], strlen($this->_tag['file_striped'])));
                                 if (file_exists($filename)) {                                  if (file_exists($filename)) {
                                         $subarray = $this->_stringTransform(join('', file($filename)));                                          $subarray = $this->_stringTransform(join('', file($filename)));
                                         array_push($subarray, '');                                          array_push($subarray, '');
Riadok 144  class phpTemplate
Riadok 148  class phpTemplate
                                         echo "Cannot find $filename!<br>";                                          echo "Cannot find $filename!<br>";
                                 }                                  }
                         }                          }
                         elseif (! strncasecmp($array[$i], $this->_tag['command'],                          elseif (! strncasecmp($array[$i], $this->_tag['stop'],
                                                 strlen($this->_tag['stop']))) {                                                  strlen($this->_tag['stop']))) {
                                 $array[$i] = substr($array[$i], strlen($this->_tag['stop']));                                  $array[$i] = substr($array[$i], strlen($this->_tag['stop']));
                         }                          }
                         elseif (! strncasecmp($array[$i], $this->_tag['command'],                          elseif (! strncasecmp($array[$i], $this->_tag['start'],
                                                 strlen($this->_tag['start']))) {                                                  strlen($this->_tag['start']))) {
                                 $array[$i] = substr($array[$i], strlen($this->_tag['start']));                                  $array[$i] = substr($array[$i], strlen($this->_tag['start']));
                         }                          }
Riadok 188  class phpTemplate
Riadok 192  class phpTemplate
                 }                  }
                 else {                  else {
                         if (preg_match('/^[a-zA-Z_][\w\d_]*$/', $key)) {                          if (preg_match('/^[a-zA-Z_][\w\d_]*$/', $key)) {
                                 if ($evalcode) {                                  if ($evalcode == 1) {
                                         $this->_set_vars[$key] = array($value);                                          $this->_set_vars[$key] = array($value);
                                         preg_match_all('/\$(\w[\w\d_]*)/', $value, $matches);                                          preg_match_all('/\$(\w[\w\d_]*)/', $value, $matches);
                                         $this->_vars = array_merge($this->_vars, $matches[1]);                                          $this->_vars = array_merge($this->_vars, $matches[1]);
                                         //echo "XXXadding:<br>";var_dump($matches[1]);                                  }
                                   elseif ($evalcode == 2) {
                                           // TODO: lots of work
                                           // $ar = _stringTransform($value);
                                 }                                  }
                                 else {                                  else {
                                         $this->_set_vars[$key] = $value;                                          $this->_set_vars[$key] = $value;
Riadok 217  class phpTemplate
Riadok 224  class phpTemplate
                         if ($i % 2) {                          if ($i % 2) {
                                 //if (preg_match("/^[\b]*echo[\b]*[\(]?[\b]*\$(\w[\w\d_]*)[\b]*[\)]?[\b]*;[\b]*$/",                                  //if (preg_match("/^[\b]*echo[\b]*[\(]?[\b]*\$(\w[\w\d_]*)[\b]*[\)]?[\b]*;[\b]*$/",
   
                                 /*  
                                    if (preg_match('/^echo[(]\s*\$(\w[\w\d_]*)\s*[)];$/',  
                                    $this->_array[$i], $matches)) {  
                                 //var_dump($matches);  
                                 echo "<b>MATCHED: " . $this->_array[$i] . " (" . $matches[1] . ")</b><br>";  
                                 if (is_array($this->_set_vars[$matches[1]])) {  
                                 echo "<b>INSERTING: " . $this->_set_vars[$matches[1]][0] . "</b><br>";  
                                 $ret .= $this->_set_vars[$matches[1]][0];  
                                 }  
                                 else {  
                                 echo "<b>NOTHING INSERTING</b><br>";  
                                 $ret .= $this->_array[$i];  
                                 }  
                                 }  
                                 else*/  
                                 $ret .= $this->_simple_echo_transform($this->_array[$i]);                                  $ret .= $this->_simple_echo_transform($this->_array[$i]);
                         }                          }
                         else {                          else {

Legend:
Odstranené z verzie1.1  
zmenené riadky
  Pridané vo verzii1.2

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok