/**
  * Constructor - creates cache here!
  *
  */
 function __construct($templates = NULL)
 {
     if (is_array($templates)) {
         foreach ($templates as $id => $template) {
             $this->_readCacheFor($template);
         }
     }
     $this->_langID = rad_lang::getCurrentLangID();
 }
Example #2
0
 /**
  * Gets the current langID
  *
  * @return integer
  */
 public function getCurrentLangID()
 {
     return rad_lang::getCurrentLangID();
 }
 function __get($name)
 {
     if (isset($this->_values[$name]) and isset($this->_values[$name]['value'])) {
         if ($this->_isMultilang($name) and is_array($this->_values[$name]['value'])) {
             if (isset($this->_values[$name]['value'][rad_lang::getCurrentLangID()])) {
                 if (is_array($this->_values[$name]['value'][rad_lang::getCurrentLangID()])) {
                     return $this->_values[$name]['value'][rad_lang::getCurrentLangID()];
                 } else {
                     return stripslashes($this->_values[$name]['value'][rad_lang::getCurrentLangID()]);
                 }
             } else {
                 if (is_array($this->_values[$name]['value'])) {
                     foreach ($this->_values[$name]['value'] as $key => $value) {
                         $this->_values[$name]['value'][stripslashes($key)] = stripslashes($value);
                     }
                     return $this->_values[$name]['value'];
                 } else {
                     return stripslashes($this->_values[$name]['value']);
                 }
             }
         } else {
             if (is_array($this->_values[$name]['value'])) {
                 return $this->_values[$name]['value'];
             } else {
                 return stripslashes($this->_values[$name]['value']);
             }
         }
     }
 }