コード例 #1
0
    ?>
  <?php 
    end_slot();
    ?>

<?php 
}
?>

<?php 
$sf_user->setCulture($culture);
?>

<?php 
if ($isUserAdmin && sfConfig::get('sf_cache') == true) {
    sfPlop::set('sf_plop_cache', true);
    sfConfig::set('sf_cache', false);
}
?>

<?php 
include_partial('sfPlopCMS/slots', array('slots' => $slots, 'subSlots' => $subSlots, 'culture' => $culture, 'isUserAdmin' => $isUserAdmin, 'page' => $page, 'pageTemplate' => $pageTemplate));
echo clear();
?>

<?php 
if ($isUserAdmin && sfPlop::get('sf_plop_cache') == true) {
    sfConfig::set('sf_cache', true);
}
?>
コード例 #2
0
 /**
  * Check if the config needs to be updated given to his value.
  * @param String $name
  * @param String $value
  * @param PropelPDO $con
  */
 public static function addOrUpdate($name, $value, $con = null)
 {
     $config = sfPlopConfigPeer::retrieveByName($name, $con);
     $config_static = self::dump(sfPlop::get($name, true));
     $value_dump = self::dump($value);
     if ($config && !self::isIdentical($config->getValue(), $value_dump)) {
         if (is_string($value_dump) && trim($value_dump) == '' || self::isIdentical($value_dump, $config_static)) {
             $config->delete();
         } elseif (!self::isIdentical($value_dump, $config_static)) {
             $config->setValue($value_dump);
             $config->save();
         }
     } elseif (!$config && trim($value_dump) != '' && !self::isIdentical($value_dump, $config_static)) {
         $config = new sfPlopConfig();
         $config->setName($name);
         $config->setValue($value_dump);
         $config->save();
     }
     sfPlop::set($name, $value);
 }