Example #1
0
 /**
  * If we work with multiple collections,
  * it is necessary cleanup old data everywhere before saving
  *
  * @param string $locale
  */
 protected function _cleanup($name, $locale = null)
 {
     $collections = SlConfigure::read(null, 'populated', true);
     foreach ($collections as $collection) {
         SlConfigure::delete($name, true, $locale ? "{$collection}.{$locale}" : $collection);
     }
 }
Example #2
0
 public static function delete($name, $path = null, $domain = null, $secure = null)
 {
     self::ready();
     SlConfigure::delete($name, false, 'cookie');
     if (empty($path)) {
         $path = SlConfigure::read('Sl.cookie.path');
     }
     if ($domain === null) {
         $domain = SlConfigure::read('Sl.cookie.domain');
     }
     if ($secure === null) {
         $secure = SlConfigure::read('Sl.cookie.secure');
     }
     setcookie(self::$_cookieName . "[{$name}]", '', time() - 42000, $path, $domain, $secure);
 }
Example #3
0
 function parse($html = null, $blockName = 'document', $blockParams = null, $noCycle = false)
 {
     $messages = SlConfigure::read2('Message');
     if ($messages) {
         SlSession::delete('Message');
     } else {
         $messages = array();
     }
     $this->vars['bufferedOutput'] = SlConfigure::read('View.bufferedOutput');
     SlConfigure::delete('View.bufferedOutput');
     if ($messages || $this->vars['bufferedOutput']) {
         $this->blocks["loop"]->params[0] = $messages;
         return parent::parse($html, $blockName);
     }
 }