File: /var/www/vhosts/greenclinic.kz/test.greenclinic.kz/plugins/rainlab/translate/formwidgets/MLText.php
<?php namespace RainLab\Translate\FormWidgets;
use Backend\Classes\FormWidgetBase;
use RainLab\Translate\Models\Locale;
/**
* ML Text
* Renders a multi-lingual text field.
*
* @package rainlab\translate
* @author Alexey Bobkov, Samuel Georges
*/
class MLText extends FormWidgetBase
{
use \RainLab\Translate\Traits\MLControl;
/**
* {@inheritDoc}
*/
protected $defaultAlias = 'mltext';
/**
* {@inheritDoc}
*/
public function init()
{
$this->initLocale();
}
/**
* {@inheritDoc}
*/
public function render()
{
$this->isAvailable = Locale::isAvailable();
$this->prepareLocaleVars();
if ($this->isAvailable) {
return $this->makePartial('mltext');
}
else {
return $this->renderFallbackField();
}
}
/**
* Returns an array of translated values for this field
* @return array
*/
public function getSaveValue($value)
{
return $this->getLocaleSaveValue($value);
}
/**
* {@inheritDoc}
*/
protected function loadAssets()
{
$this->loadLocaleAssets();
}
}