isAvailable() public static method

Returns true if there are at least 2 locales available.
public static isAvailable ( ) : boolean
return boolean
Example #1
0
 /**
  * Initialize control
  * @return void
  */
 public function initLocale()
 {
     $this->columnName = $this->formField->fieldName;
     $this->defaultLocale = Locale::getDefault();
     $this->parentViewPath = $this->guessViewPathFrom(__TRAIT__, '/partials');
     $this->isAvailable = Locale::isAvailable();
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function render()
 {
     $this->isAvailable = Locale::isAvailable();
     $this->prepareLocaleVars();
     if ($this->isAvailable) {
         return $this->makePartial('mltext');
     } else {
         return $this->renderFallbackField();
     }
 }
 /**
  * {@inheritDoc}
  */
 protected function loadAssets()
 {
     $this->actAsParent();
     parent::loadAssets();
     $this->actAsParent(false);
     if (Locale::isAvailable()) {
         $this->loadLocaleAssets();
         $this->addJs('js/mlricheditor.js');
     }
 }
Example #4
0
 /**
  * {@inheritDoc}
  */
 public function loadAssets()
 {
     $this->actAsParent();
     parent::loadAssets();
     $this->actAsParent(false);
     if (Locale::isAvailable()) {
         $this->loadLocaleAssets();
         $this->addJs('js/mlswitcher.js');
     }
 }