示例#1
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['paragraphs'] = array();
     foreach ($this->getData()->getChildComponents(array('generator' => 'paragraphs')) as $paragraph) {
         $cssClass = 'kwcParagraphItem';
         $row = $paragraph->getRow();
         if ($this->_getSetting('useMobileBreakpoints') && $row->device_visible) {
             $cssClass .= ' ' . $row->device_visible;
         }
         $cssClass .= ' outer' . ucfirst(Kwf_Component_Abstract::formatCssClass($paragraph->componentClass));
         $ret['paragraphs'][] = array('data' => $paragraph, 'class' => $cssClass);
     }
     return $ret;
 }
示例#2
0
 public function _getSettingsIncludingPreComputed($c)
 {
     $settings = self::_loadCacheSettings($c);
     //*** load templates + componentFiles
     //vorladen fuer Kwf_Component_Abstract_Admin::getComponentFile
     $settings['componentFiles'] = Kwf_Component_Abstract::getSetting($c, 'componentFiles');
     //*** parentClasses
     $settings['parentClasses'] = Kwf_Component_Abstract::getSetting($c, 'parentClasses');
     //*** parentFilePaths
     $settings['parentFilePaths'] = Kwf_Component_Abstract::getSetting($c, 'parentFilePaths');
     //*** processedCssClass
     $settings['processedCssClass'] = '';
     if (isset($settings['cssClass'])) {
         $settings['processedCssClass'] .= $settings['cssClass'] . ' ';
     }
     $cssClass = array(Kwf_Component_Abstract::formatCssClass($c));
     $dirs = explode(PATH_SEPARATOR, get_include_path());
     foreach (include VENDOR_PATH . '/composer/autoload_namespaces.php' as $ns => $i) {
         $dirs = array_merge($dirs, $i);
     }
     foreach ($settings['parentClasses'] as $i) {
         if ($i == $c) {
             continue;
         }
         $file = str_replace('_', '/', $i);
         if (substr($file, -10) != '/Component') {
             $file .= '/Component';
         }
         foreach ($dirs as $dir) {
             if (is_file($dir . '/' . $file . '.css') || is_file($dir . '/' . $file . '.scss') || is_file($dir . '/' . $file . '.printcss') || is_file($dir . '/' . $file . '.js') || is_file($dir . '/' . $file . '.defer.js')) {
                 $cssClass[] = Kwf_Component_Abstract::formatCssClass($i);
                 break;
             }
         }
     }
     $settings['processedCssClass'] .= implode(' ', array_reverse($cssClass));
     $settings['processedCssClass'] = trim($settings['processedCssClass']);
     //*** generators
     $settings['generators'] = Kwf_Component_Abstract::getSetting($c, 'generators');
     return $settings;
 }