/**
  * Loa the content.
  *
  * @param mixed          $value         The lang var value.
  * @param \DataContainer $dataContainer The data container driver.
  *
  * @return array|string
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  */
 public function loadContent($value, \DataContainer $dataContainer)
 {
     if (empty($value) && strlen($dataContainer->activeRecord->langvar)) {
         return $this->languageEditor->getLangValue($GLOBALS['TL_LANG'], explode('|', preg_replace('#^[^:]+::#', '', $dataContainer->activeRecord->langvar)), true);
     } else {
         return $value;
     }
 }
 /**
  * Build language variables key files.
  *
  * @return string
  * @SuppressWarnings(PHPMD.Superglobals)
  * @SuppressWarnings(PHPMD.ExitExpression)
  */
 public function buildLanguageVariableKeys()
 {
     $template = new \BackendTemplate('be_translation_search_build_keys');
     if (\Input::post('FORM_SUBMIT') == 'tl_translation_search_build_keys') {
         $this->cleanTranslationFiles();
         $template->translations = $this->getTranslations();
         if (!$template->translations) {
             $_SESSION['TL_INFO'][] = $GLOBALS['TL_LANG']['tl_translation']['nothingtodo'];
             \Controller::reload();
         }
     } elseif (\Input::get('translation')) {
         // get the next translation group
         $translation = \Input::get('translation');
         $file = new File('system/languages/langkeys.' . $translation . '.php');
         $file->write("<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');\n\n/**\n * DO NOT MODIFY THIS FILE, IT IS GENERATED BY THE LANGUAGE EDITOR!\n */\n");
         // load the language
         \Controller::loadLanguageFile($this->languageEditor->getLanguageFileName($translation));
         if (is_array($GLOBALS['TL_LANG'][$translation])) {
             $this->languageVariableKeys = array();
             $this->buildLanguageVariableKeysFrom($translation, $translation, $GLOBALS['TL_LANG'][$translation]);
             ksort($this->languageVariableKeys);
             foreach ($this->languageVariableKeys as $translation => $v) {
                 foreach ($v as $path => $config) {
                     $key = sprintf('$GLOBALS[\'TL_TRANSLATION\'][\'%s\'][\'%s\']', $translation, $path);
                     $value = var_export($config, true);
                     $file->append($key . ' = ' . $value . ";\n");
                 }
             }
         }
         $file->close();
         header('Content-Type: image/png');
         $handle = fopen(TL_ROOT . '/system/modules/language-editor/html/complete.png', 'rb');
         fpassthru($handle);
         fclose($handle);
         exit;
     } else {
         // get translation keys found by the TranslationSearch::buildTranslationKeys method
         $files = new \RegexIterator(new \DirectoryIterator(TL_ROOT . '/system/languages/'), '#^langkeys\\..*\\.php$#');
         foreach ($files as $file) {
             require_once $file->getPathname();
         }
     }
     return $template->parse();
 }