本文整理汇总了PHP中Kwc_Abstract_Composite_Component::getTemplateVars方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Abstract_Composite_Component::getTemplateVars方法的具体用法?PHP Kwc_Abstract_Composite_Component::getTemplateVars怎么用?PHP Kwc_Abstract_Composite_Component::getTemplateVars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwc_Abstract_Composite_Component
的用法示例。
在下文中一共展示了Kwc_Abstract_Composite_Component::getTemplateVars方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTemplateVars
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: getTemplateVars
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: getTemplateVars
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: getTemplateVars
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: getTemplateVars
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: getTemplateVars
public function getTemplateVars()
{
$ret = parent::getTemplateVars();
$ret['backgroundColor'] = $this->getRow()->background_color;
$ret['marginBottom'] = $this->getRow()->margin_bottom;
return $ret;
}
示例7: getTemplateVars
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;
}
示例8: getTemplateVars
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer)
{
$ret = parent::getTemplateVars($renderer);
$ret['metaTags'] = $this->_getMetaTags();
$ret['canonicalUrl'] = $this->getData()->getAbsoluteUrl();
return $ret;
}
示例9: getTemplateVars
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;
}
示例10: getTemplateVars
public function getTemplateVars()
{
$ret = parent::getTemplateVars();
$ret['leftWidth'] = $this->_getChildContentWidth($this->getData()->getChildComponent('-leftColumn'));
$ret['rightWidth'] = $this->_getChildContentWidth($this->getData()->getChildComponent('-rightColumn'));
return $ret;
}
示例11: getTemplateVars
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;
}
示例12: getTemplateVars
public function getTemplateVars()
{
$ret = parent::getTemplateVars();
$ret['name'] = $this->getRow()->anchor ? $this->getRow()->anchor : null;
$ret['anchorId'] = $this->getData()->componentId;
return $ret;
}
示例13: getTemplateVars
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;
}
示例14: getTemplateVars
public function getTemplateVars()
{
$ret = parent::getTemplateVars();
$ret['row'] = $this->getData()->row;
$ret['item'] = $this->getData();
$this->getData()->parent->getComponent()->callModifyItemData($ret['item']);
return $ret;
}
示例15: getTemplateVars
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;
}