public function extraVars() { $linkIsExternal = true; $link = $this->getCfgValue('externalLink', false); if (!$link && $this->getCfgValue('internalLink', false)) { $linkIsExternal = false; $link = Yii::$app->menu->find()->where(['nav_id' => $this->getCfgValue('internalLink')])->one(); if ($link) { $link = $link->link; } else { $link = false; } } return ['image' => BlockHelper::imageUpload($this->getVarValue('imageId')), 'imageAdmin' => BlockHelper::imageUpload($this->getVarValue('imageId', 'medium-thumbnail')), 'text' => $this->getText(), 'link' => $link, 'linkIsExternal' => $linkIsExternal]; }
/** * Return an array containing all extra vars. Those variables you can access in the Twig Templates via {{extras.*}}. */ public function extraVars() { return ['fileList' => BlockHelper::fileArrayUpload($this->getVarValue('files'))]; }
/** * Return an array containg all extra vars. Those variables you can access in the Twig Templates via {{extras.*}}. */ public function extraVars() { return ['link' => $this->getLinkTarget(), 'file' => $this->getFileUrl(), 'imageId' => BlockHelper::imageUpload($this->getVarValue('imageId')), 'text' => $this->getText(), 'thumbnail' => BlockHelper::imageUpload($this->getVarValue('imageId'), 'small-thumbnail')]; }
public function extraVars() { return ['imageSource' => $this->getImageSource(), 'imageAdmin' => BlockHelper::imageUpload($this->getVarValue('imageId'), 'medium-thumbnail'), 'imagePosition' => $this->getVarValue('imagePosition', 'left'), 'imageWidth' => $this->getImageSource() ? @getimagesize($this->getImageSource())[0] : 0, 'margin' => $this->getCfgValue('margin', $this->defaultMargin), 'text' => $this->getText()]; }
public function config() { return ['vars' => [['var' => 'moduleName', 'label' => Module::t('block_module_modulename_label'), 'type' => 'zaa-select', 'options' => $this->getModuleNames()]], 'cfgs' => [['var' => 'moduleController', 'label' => Module::t('block_module_modulecontroller_label'), 'type' => 'zaa-select', 'options' => BlockHelper::selectArrayOption($this->getControllerClasses())], ['var' => 'moduleAction', 'label' => Module::t('block_module_moduleaction_label'), 'type' => 'zaa-text'], ['var' => 'moduleActionArgs', 'label' => Module::t('block_module_moduleactionargs_label'), 'type' => 'zaa-text']]]; }
/** * Get the full array for the specific zaa-file-image-upload type * * ```php * 'imageList' => $this->zaaImageArrayUpload($this->getVarValue('images')), * ``` * * Each array item will have all file query item data and a caption key. * * @deprecated Will be removed in 1.0.0 * @param string|int $value The specific var or cfg fieldvalue. * @param boolean|string $applyFilter To apply a filter insert the identifier of the filter. * @param boolean $returnObject Whether the storage object should be returned or an array. * @return array Returns an array in any case, even an empty array. */ protected function zaaImageArrayUpload($value, $applyFilter = false, $returnObject = false) { trigger_error('Deprecated method ' . __METHOD__ . ' in ' . get_called_class() . ', use \\luya\\cms\\helpers\\BlockHelper::imageArrayUpload() instead.', E_USER_DEPRECATED); return BlockHelper::imageArrayUpload($value, $applyFilter, $returnObject); }