/**
  *
  */
 private static function isLegacyBootstrapEnabled()
 {
     // no input group or no bootstrap extension available or not enabled
     if (class_exists('Netzmacht\\Bootstrap\\Bootstrap') && \Netzmacht\Bootstrap\Bootstrap::isEnabled()) {
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 public function parse($buffer, $templateName)
 {
     if (!Bootstrap::isEnabled()) {
         return $buffer;
     }
     foreach ($GLOBALS['BOOTSTRAP']['templates']['parsers'] as $config) {
         if ($config['disabled'] || !$this->isTemplateAffected($templateName, $config['templates'])) {
             continue;
         }
         if ($config['type'] == 'replace') {
             if (is_callable($config['replace'])) {
                 $value = call_user_func($config['replace'], $buffer, $templateName);
             } else {
                 $value = $config['replace'];
             }
             $buffer = str_replace($config['search'], $value, $buffer);
         } elseif ($config['type'] == 'callback') {
             $buffer = call_user_func($config['callback'], $buffer, $templateName);
         }
     }
     return $buffer;
 }
Ejemplo n.º 3
0
 /**
  * @param $template
  */
 protected static function initializeViewport($template)
 {
     $layout = \Netzmacht\Bootstrap\Bootstrap::getLayout();
     if ($layout->viewport) {
         $template->viewport = sprintf('<meta name="viewport" content="%s">', $layout->viewport);
     }
 }
Ejemplo n.º 4
0
 /**
  * @param SelectLayoutEvent $event
  */
 public function selectLayout(SelectLayoutEvent $event)
 {
     if (Bootstrap::isEnabled()) {
         $event->setLayout('bootstrap');
     }
 }