fillFromConfig([ 'mode', 'prompt' ]); } /** * {@inheritDoc} */ public function render() { $this->prepareVars(); return $this->makePartial('mediafinder'); } /** * Prepares the list data */ public function prepareVars() { $value = $this->getLoadValue(); $this->vars['value'] = $value; $this->vars['imageUrl'] = $value ? MediaLibrary::url($value) : ''; $this->vars['field'] = $this->formField; $this->vars['prompt'] = str_replace('%s', '', $this->prompt); $this->vars['mode'] = $this->mode; } /** * {@inheritDoc} */ public function loadAssets() { $this->addJs('js/mediafinder.js', 'core'); $this->addCss('css/mediafinder.css', 'core'); } }