Пример #1
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['leftWidth'] = $this->_getChildContentWidth($this->getData()->getChildComponent('-leftColumn'));
     $ret['rightWidth'] = $this->_getChildContentWidth($this->getData()->getChildComponent('-rightColumn'));
     return $ret;
 }
Пример #2
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['sources'] = null;
     //mp3
     $url = Kwf_Media::getUrl($this->getData()->componentClass, $this->getData()->componentId, 'mp3', 'audio.mp3');
     if ($url) {
         $ret['source'] = array('src' => $url, 'type' => 'audio/mp3', 'title' => 'mp3');
     }
     $ret['config'] = Kwc_Abstract::getSetting($this->getData()->componentClass, 'audio');
     $row = $this->getRow();
     if ($row->audio_width) {
         $ret['config']['audioWidth'] = $row->audio_width;
     }
     if ($row->audio_height) {
         $ret['config']['audioHeight'] = $row->audio_height;
     }
     if ($row->auto_play) {
         $ret['config']['autoPlay'] = true;
     }
     if ($row->loop) {
         $ret['config']['loop'] = true;
     }
     return $ret;
 }
Пример #3
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['settingsRow'] = $this->_getRow();
     $ret['tableStyle'] = $this->_getRow()->table_style;
     $ret['columnCount'] = $this->getColumnCount();
     if (Kwf_Config::getValue('kwc.responsive')) {
         $ret['rootElementClass'] .= ' responsive' . ucfirst($this->_getRow()->responsive_style);
     }
     $dataSelect = new Kwf_Model_Select();
     $dataSelect->whereEquals('visible', 1);
     $dataSelect->order('pos', 'ASC');
     $ret['dataRows'] = array();
     $rows = $this->_getRow()->getChildRows('tableData', $dataSelect);
     foreach ($rows as $row) {
         $rowData = array();
         $rowData['cssStyle'] = $row->css_style;
         $rowData['data'] = array();
         for ($i = 1; $i <= $ret['columnCount']; $i++) {
             $rowData['data']['column' . $i] = array('value' => $row->{'column' . $i}, 'cssClass' => '');
         }
         $ret['dataRows'][] = $rowData;
     }
     $ret['dataRows'] = Kwc_Basic_Table_Component::addDefaultCssClasses($ret['dataRows'], $this->_getSetting('rowStyles'));
     $ret['headerRows'] = array();
     if (isset($ret['dataRows'][0]['htmlTag']) && $ret['dataRows'][0]['htmlTag'] == 'th') {
         $ret['headerRows'] = array(array_shift($ret['dataRows']));
     }
     return $ret;
 }
Пример #4
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['product'] = $this->getData()->row;
     $ret['item'] = $ret['product']->getItem();
     $ret['similarProducts'] = array();
     if ($ret['item']->SimilarProducts) {
         foreach ($ret['item']->SimilarProducts as $p) {
             $p = $ret['product']->getModel()->getRow($p->ASIN);
             foreach ($p->getChildRows('ProductsToNodes') as $n) {
                 $s = new Kwf_Component_Select();
                 $s->whereEquals('node_id', $n->node_id);
                 $s->whereGenerator('detail');
                 if ($this->getData()->parent->parent->countChildComponents($s)) {
                     $ret['similarProducts'][] = $this->getData()->parent->getChildComponent('_' . $p->asin);
                     break;
                 }
             }
         }
     }
     $ret['nodes'] = array();
     $nodes = $ret['product']->getChildRows('ProductsToNodes');
     foreach ($nodes as $node) {
         $s = new Kwf_Component_Select();
         $s->whereEquals('node_id', $node->node_id);
         $s->whereGenerator('detail');
         $node = $this->getData()->parent->parent->getChildComponent($s);
         if ($node) {
             $ret['nodes'][] = $node;
         }
     }
     return $ret;
 }
Пример #5
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $row = $this->getRow();
     $ret['row'] = $row;
     if (!$row->image) {
         $ret['image'] = false;
     } else {
         $ret['rootElementClass'] .= ' ' . $this->_getBemClass('--imageDimension' . ucfirst($ret['image']->getComponent()->getDimensionSetting()));
         $dim = $ret['image']->getComponent()->getImageDimensions();
         $ret['imageWidth'] = false;
         if ($dim && isset($dim['width'])) {
             $ret['imageWidth'] = $dim['width'];
         }
         $ret['position'] = $row->position;
         $ret['rootElementClass'] .= ' ' . $this->_getBemClass('--position' . ucfirst($row->position));
         $ret['rootElementClass'] .= ' ' . $this->_getBemClass('--' . ($row->flow ? 'flow' : 'noFlow'));
         if ($ret['imageWidth'] <= 100) {
             $ret['rootElementClass'] .= ' ' . $this->_getBemClass('--smallImage');
         }
         $ret['mailImageVAlign'] = $this->_getSetting('mailImageVAlign');
     }
     if (!$ret['text']->hasContent()) {
         $ret['rootElementClass'] .= ' ' . $this->_getBemClass('--noText');
     }
     return $ret;
 }
Пример #6
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['name'] = $this->getRow()->anchor ? $this->getRow()->anchor : null;
     $ret['anchorId'] = $this->getData()->componentId;
     return $ret;
 }
Пример #7
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['backgroundColor'] = $this->getRow()->background_color;
     $ret['marginBottom'] = $this->getRow()->margin_bottom;
     return $ret;
 }
Пример #8
0
 public function getTemplateVars()
 {
     $return = parent::getTemplateVars();
     $fileRow = $this->_getFileRow();
     $parentRow = $fileRow->getParentRow('File');
     if ($this->_getSetting('showFilesize') && $parentRow) {
         $return['filesize'] = $parentRow->getFileSize();
     } else {
         $return['filesize'] = null;
     }
     $return['infotext'] = $this->_getRow()->infotext;
     if ($return['infotext'] == '' && $parentRow) {
         $return['infotext'] = $parentRow->filename;
     }
     if ($this->_getSetting('showIcon')) {
         $return['icon'] = $this->getIcon();
     } else {
         $return['icon'] = null;
     }
     if ($parentRow) {
         $return['extension'] = $parentRow->extension;
     } else {
         $return['extension'] = null;
     }
     return $return;
 }
Пример #9
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['backgroundColor'] = $this->_getBemClass('--' . $this->getRow()->background_color);
     $ret['marginBottom'] = $this->getRow()->margin_bottom;
     return $ret;
 }
Пример #10
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $users = Kwf_Registry::get('userModel');
     $showPassword = false;
     //is there a password auth?
     foreach ($users->getAuthMethods() as $auth) {
         if ($auth instanceof Kwf_User_Auth_Interface_Password) {
             $showPassword = true;
         }
     }
     if ($showPassword) {
         //if a redirect auth doesn't allow password hide it
         foreach ($users->getAuthMethods() as $auth) {
             if ($auth instanceof Kwf_User_Auth_Interface_Redirect) {
                 $user = $this->getData()->getChildComponent('-form')->getComponent()->getUserRow();
                 if (!$auth->allowPasswordForUser($user)) {
                     $showPassword = false;
                 }
             }
         }
     }
     $ret['showPassword'] = $showPassword;
     $ret['redirects'] = array();
     foreach ($users->getAuthMethods() as $authKey => $auth) {
         if ($auth instanceof Kwf_User_Auth_Interface_Redirect && $auth->showInFrontend()) {
             $label = $auth->getLoginRedirectLabel();
             $ret['redirects'][] = array('url' => $this->getData()->url, 'code' => $_GET['code'], 'authMethod' => $authKey, 'name' => $this->getData()->trlStaticExecute($label['name']), 'icon' => isset($label['icon']) ? '/assets/' . $label['icon'] : false, 'formOptions' => Kwf_User_Auth_Helper::getRedirectFormOptionsHtml($auth->getLoginRedirectFormOptions()));
         }
     }
     return $ret;
 }
Пример #11
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['metaTags'] = $this->_getMetaTags();
     $ret['canonicalUrl'] = $this->getData()->getAbsoluteUrl();
     return $ret;
 }
Пример #12
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['image'] = $this->getData();
     $imageCaptionSetting = $this->_getSetting('imageCaption');
     if ($imageCaptionSetting) {
         $ret['image_caption'] = $this->_getRow()->image_caption;
         $ret['showImageCaption'] = $imageCaptionSetting;
     }
     $ret['cssClass'] .= ' dimension' . ucfirst($this->getDimensionSetting());
     $ret['altText'] = $this->_getAltText();
     $imageData = $this->getImageDataOrEmptyImageData();
     $ret = array_merge($ret, Kwf_Media_Output_Component::getResponsiveImageVars($this->getImageDimensions(), $imageData['file']));
     $ret['baseUrl'] = $this->getBaseImageUrl();
     $ret['defineWidth'] = $this->_getSetting('defineWidth');
     $ret['lazyLoadOutOfViewport'] = $this->_getSetting('lazyLoadOutOfViewport');
     $ret['style'] = 'max-width:' . $ret['width'] . 'px;';
     if ($this->_getSetting('defineWidth')) {
         $ret['style'] .= 'width:' . $ret['width'] . 'px;';
     }
     $ret['containerClass'] = 'container';
     if ($ret['width'] > 100) {
         $ret['containerClass'] .= ' webResponsiveImgLoading';
     }
     if (!$this->_getSetting('lazyLoadOutOfViewport')) {
         $ret['containerClass'] .= ' loadImmediately';
     }
     return $ret;
 }
Пример #13
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['leftWidth'] = $this->_getChildContentWidth($this->getData()->getChildComponent('-leftColumn'));
     $ret['rightWidth'] = $this->_getChildContentWidth($this->getData()->getChildComponent('-rightColumn'));
     return $ret;
 }
Пример #14
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['sources'] = null;
     //mp3
     $url = Kwf_Media::getUrl($this->getData()->componentClass, $this->getData()->componentId, 'mp3', 'audio.mp3');
     $ev = new Kwf_Component_Event_CreateMediaUrl($this->getData()->componentClass, $this->getData(), $url);
     Kwf_Events_Dispatcher::fireEvent($ev);
     $url = $ev->url;
     if ($url) {
         $ret['source'] = array('src' => $url, 'type' => 'audio/mp3', 'title' => 'mp3');
     }
     $ret['config'] = Kwc_Abstract::getSetting($this->getData()->componentClass, 'audio');
     $row = $this->getRow();
     if ($row->audio_width) {
         $ret['config']['audioWidth'] = $row->audio_width;
     }
     if ($row->audio_height) {
         $ret['config']['audioHeight'] = $row->audio_height;
     }
     if ($row->auto_play) {
         $ret['config']['autoPlay'] = true;
     }
     if ($row->loop) {
         $ret['config']['loop'] = true;
     }
     return $ret;
 }
Пример #15
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['name'] = $this->getRow()->anchor ? $this->getRow()->anchor : null;
     $ret['anchorId'] = $this->getData()->componentId;
     return $ret;
 }
Пример #16
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $row = $this->getRow();
     $ret['row'] = $row;
     if (!$row->image) {
         $ret['image'] = false;
     } else {
         $ret['cssClass'] .= ' imageDimension' . ucfirst($ret['image']->getComponent()->getDimensionSetting());
         $dim = $ret['image']->getComponent()->getImageDimensions();
         $ret['imageWidth'] = false;
         if ($dim && isset($dim['width'])) {
             $ret['imageWidth'] = $dim['width'];
         }
         $ret['contentWidth'] = $this->getContentWidth();
         $pos = $row->position;
         if ($pos == 'center') {
             $ret['center'] = ($ret['contentWidth'] - $ret['imageWidth']) / 2;
         }
         $ret['position'] = $pos;
         $ret['propCssClass'] = 'position' . ucfirst($pos);
         if ($row->flow) {
             $ret['propCssClass'] .= ' flow';
         } else {
             $ret['propCssClass'] .= ' noFlow';
         }
         $ret['mailImageVAlign'] = $this->_getSetting('mailImageVAlign');
     }
     if (!$ret['text']->hasContent()) {
         $ret['cssClass'] .= ' noText';
     }
     return $ret;
 }
Пример #17
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['row'] = $this->getData()->row;
     $ret['item'] = $this->getData();
     $this->getData()->parent->getComponent()->callModifyItemData($ret['item']);
     return $ret;
 }
Пример #18
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $row = $this->_getRow();
     $ret['title'] = $row->title;
     $ret['teaser'] = $row->teaser;
     return $ret;
 }
Пример #19
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['row'] = $this->getData()->row;
     $ret['item'] = $this->getData();
     $this->getData()->parent->getComponent()->callModifyItemData($ret['item']);
     return $ret;
 }
Пример #20
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['readMoreLinktext'] = $this->getRow()->link_text;
     $ret['headlineComponentLinkConfig'] = $this->_getSetting('headlineComponentLinkConfig');
     $ret['readMoreComponentLinkConfig'] = $this->_getSetting('readMoreComponentLinkConfig');
     return $ret;
 }
Пример #21
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['text'] = $this->_getRow()->text;
     if (!$this->hasContent($ret['linkTag'])) {
         $ret['rootElementClass'] .= ' emptyLink';
     }
     return $ret;
 }
Пример #22
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer = null)
 {
     $ret = parent::getTemplateVars();
     if (!$renderer) {
         throw new Kwf_Exception('renderer required');
     }
     $ret['content'] = $this->_getContent($renderer);
     return $ret;
 }
Пример #23
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['text'] = $this->_getRow()->text;
     if (!$this->hasContent($ret['linkTag'])) {
         $ret['rootElementClass'] .= ' emptyLink';
     }
     return $ret;
 }
Пример #24
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['order'] = $this->_getOrder();
     $ret['orderProducts'] = $ret['order']->getChildRows('Products');
     $ret['sumRows'] = $this->_getSumRows($this->_getOrder());
     $ret['paymentTypeText'] = $this->_getSetting('componentName');
     return $ret;
 }
Пример #25
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['links'] = array();
     $userRow = Kwf_Registry::get('userModel')->getAuthedUser();
     if ($userRow && $userRow->id == $this->getData()->parent->row->id) {
         $ret['links'] = $this->_getLinks();
     }
     return $ret;
 }
Пример #26
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $addCmp = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->getData()->row->add_component_id);
     $ret['product'] = $addCmp->parent;
     $ret['row'] = $this->getData()->row;
     $ret['price'] = $addCmp->getComponent()->getPrice($ret['row']);
     $ret['text'] = $addCmp->getComponent()->getProductText($ret['row']);
     return $ret;
 }
Пример #27
0
 public function getTemplateVars()
 {
     $ret = parent::getTemplateVars();
     $ret['ajaxUrl'] = $this->getData()->getChildComponent('_ajax')->url;
     $formData = $this->getSearchFormData();
     $ret['queryParam'] = $formData['queryParam'];
     $ret['submitParam'] = $formData['submitParam'];
     $ret['searchPageUrl'] = $formData['searchPageUrl'];
     $ret['searchSettings'] = array('searchResultBoxAlign' => $this->_getSetting('searchResultBoxAlign'), 'searchResultBoxFade' => $this->_getSetting('searchResultBoxFade'));
     return $ret;
 }
Пример #28
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $addCmp = Kwc_Shop_AddToCartAbstract_OrderProductData::getAddComponentByDbId($this->getData()->row->add_component_id, $this->getData());
     if ($addCmp) {
         $ret['product'] = $addCmp->getComponent()->getProduct();
         $ret['row'] = $this->getData()->row;
         $ret['price'] = $addCmp->getComponent()->getPrice($ret['row']);
         $ret['text'] = $addCmp->getComponent()->getProductText($ret['row']);
     }
     return $ret;
 }
Пример #29
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     $ret['authedUser'] = Kwf_Registry::get('userModel')->getAuthedUser();
     $ret['userProfile'] = false;
     if ($ret['authedUser']) {
         $root = Kwf_Component_Data_Root::getInstance();
         if ($root->getComponentByClass('Kwc_User_Directory_Component', array('subroot' => $this->getData()))) {
             $ret['userProfile'] = $root->getComponentByClass('Kwc_User_Directory_Component', array('subroot' => $this->getData()))->getChildComponent('_' . $ret['authedUser']->id);
         }
     }
     return $ret;
 }
Пример #30
0
 public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
 {
     $ret = parent::getTemplateVars($renderer);
     foreach ($ret['keys'] as $key) {
         if ($ret[$key]->getComponent()->isPosted()) {
             $ret['currentForm'] = $ret[$key];
         }
     }
     if (!isset($ret['currentForm'])) {
         $ret['currentForm'] = $ret[$ret['keys'][0]];
     }
     return $ret;
 }