protected function _getChildContentWidth(Kwf_Component_Data $child)
 {
     $ownWidth = parent::_getChildContentWidth($child);
     $contentMargin = $this->_getSetting('contentMargin');
     $breakpoint = $this->_getSetting('breakpoint');
     $columns = (int) $this->_getGalleryColumns();
     $ownWidth -= ($columns - 1) * $contentMargin;
     if (!$columns) {
         $columns = 1;
     }
     if ($columns >= 5 && $columns <= 10) {
         $originColumnWidth = (int) floor($ownWidth / $columns);
         if ($columns == 6) {
             $columns = 3;
         }
         if ($columns % 2 == 0) {
             $columns = 4;
         } else {
             $columns = 3;
         }
         $ret = (int) floor(($breakpoint - $contentMargin - ($columns - 1) * $contentMargin) / $columns);
         if ($ret < $originColumnWidth) {
             $ret = $originColumnWidth;
         }
     } else {
         $ret = (int) floor($ownWidth / $columns);
     }
     return $ret;
 }
 public static function getSettings()
 {
     $ret = parent::getSettings();
     $ret['generators']['child']['component'] = 'Kwc_Composite_LinkImage_Component';
     $ret['componentName'] = trlKwfStatic('Linked Images');
     $ret['componentIcon'] = 'images';
     return $ret;
 }
 public static function getSettings()
 {
     $ret = parent::getSettings();
     $ret['childModel'] = 'Kwc_Composite_Images_TestModel';
     $ret['ownModel'] = 'Kwc_Composite_Images_TestOwnModel';
     $ret['generators']['child']['component'] = 'Kwc_Composite_Images_Image_TestComponent';
     return $ret;
 }
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $showPics = null;
     if ($this->_getSetting('showMoreLink')) {
         $showPics = $this->_getRow()->show_pics;
         $ret['moreButtonText'] = $this->_getPlaceholder('moreButton');
         if ($this->_getRow()->show_more_link_text) {
             $ret['moreButtonText'] = $this->_getRow()->show_more_link_text;
         }
     }
     $ret['rootElementClass'] .= ' col' . $this->_getGalleryColumns();
     $ret['imagesPerLine'] = $this->_getGalleryColumns();
     if (!$ret['imagesPerLine']) {
         $ret['imagesPerLine'] = 1;
     }
     $ret['downloadAll'] = $this->getData()->getChildComponent('-downloadAll');
     if (($this->_getGalleryColumns() <= $showPics || $ret['imagesPerLine'] >= $showPics) && count($ret['children']) <= $showPics) {
         $ret['showPics'] = null;
     } else {
         $ret['showPics'] = $showPics;
     }
     return $ret;
 }