Ejemplo n.º 1
0
        $Settings->setSetting('kBitOptions', $new2bwoptions);
        $success[] = T_("Bandwidth Options Updated");
    }
    // Call validate&change functions for changed items
}
$templateEngine->assign("location", $Settings->getSetting('locationName'));
$templateEngine->assign("mboptions", $Settings->getSetting('mbOptions'));
$templateEngine->assign("timeoptions", $Settings->getSetting('timeOptions'));
$templateEngine->assign("bwoptions", $Settings->getSetting('kBitOptions'));
// Locale stuff
$locale = $Settings->getSetting('locale');
$fmt = new NumberFormatter($locale, NumberFormatter::CURRENCY);
$templateEngine->assign("locale", $locale);
$templateEngine->assign("currency", $fmt->getSymbol(NumberFormatter::CURRENCY_SYMBOL));
$templateEngine->assign("language", locale_get_display_language($locale));
$templateEngine->assign("region", locale_get_display_region($locale));
$templateEngine->assign("support_name", $Settings->getSetting('supportContactName'));
$templateEngine->assign("support_link", $Settings->getSetting('supportContactLink'));
$templateEngine->assign("website_name", $Settings->getSetting('websiteName'));
$templateEngine->assign("website_link", $Settings->getSetting('websiteLink'));
$templateEngine->assign("available_languages", \Grase\Locale::getAvailableLanguages());
if (sizeof($error) > 0) {
    $templateEngine->assign("error", $error);
}
if (sizeof($success) > 0) {
    $templateEngine->assign("success", $success);
}
// Location
function updateLocation($location)
{
    global $error, $templateEngine, $Settings, $success;
Ejemplo n.º 2
0
 public function prepareView(\Nethgui\View\ViewInterface $view)
 {
     parent::prepareView($view);
     $user = $this->getRequest()->getUser();
     $view->setTemplate('Nethgui\\Template\\Login');
     $tmp = array();
     foreach ($this->getLocales() as $l) {
         $lang = substr($l, 0, 2);
         if (\extension_loaded('intl')) {
             $tmp[$l] = sprintf('%s (%s)', ucfirst(\locale_get_display_language($l, $lang)), \locale_get_display_region($l, $lang));
         } else {
             $tmp[$lang][$l] = $l;
         }
     }
     $view['languageDatasource'] = \Nethgui\Renderer\AbstractRenderer::hashToDatasource($tmp, TRUE);
     $this->xhtmlDecoratorParams['disableHeader'] = TRUE;
     $this->xhtmlDecoratorParams['disableMenu'] = TRUE;
     $this->xhtmlDecoratorParams['disableFooter'] = FALSE;
     $isAuthenticatedUserLoggingInAgain = $user->isAuthenticated() && !$this->getRequest()->isMutation();
     $isUnauthUserRequest = !$user->isAuthenticated() && !$this->getRequest()->isMutation() && $this->parameters['path'];
     if ($isAuthenticatedUserLoggingInAgain) {
         $this->httpResponse->setStatus(302)->addHeader('Location: ' . $view->getSiteUrl() . $view->getModuleUrl('/'));
     } elseif ($isUnauthUserRequest) {
         $this->httpResponse->setStatus(403, 'Forbidden');
     }
 }