예제 #1
0
 /**
  * @return string the language filename prefix, eg 'en_US' for english
  * @throws exception if the language set is not a valid filename
  */
 public function getLanguageToLoad()
 {
     $language = \MongoUI\Core\Common::getRequestVar('lang', self::DEFAULT_LANG, 'string');
     if ($this->isValidLanguage($language)) {
         return $language;
     } else {
         throw new \Exception("The language selected ('{$language}') is not a valid language file ");
     }
 }
예제 #2
0
 public function renderTemplate(\MongoUI\Core\Template $template, $fetch = false)
 {
     $theme = \MongoUI\Core\Common::getCurrentTheme();
     $className = end(explode("\\", \get_called_class()));
     $templatePath = MONGOUI_ROOT . '/themes/' . $theme . '/' . $className;
     $template->setPath('template', $templatePath);
     if ($fetch) {
         return $template->fetch();
     } else {
         $template->display();
     }
 }