Example #1
0
 public static function BuildSearchIndex($site, $page, $root = '../')
 {
     // get content from published fragment
     $content = '';
     $fragment = $root . 'sites/' . $site['FriendlyId'] . '/fragments/publish/' . $page['PageUniqId'] . '.html';
     if (file_exists($fragment)) {
         $content = file_get_contents($fragment);
     }
     // remove existing index
     SearchIndex::Remove($page['PageUniqId']);
     // build the search index for the page in the default language
     $isDefaultLanguage = true;
     Utilities::BuildSearchIndex($site, $page, $site['Language'], $isDefaultLanguage, $content, $root);
     // get a list of other languages
     $rootPrefix = $root . 'sites/' . $site['FriendlyId'] . '/';
     // build index for non-default languages
     $languages = Utilities::GetSupportedLanguages($rootPrefix);
     $isDefaultLanguage = false;
     foreach ($languages as $language) {
         if ($language != $site['Language']) {
             Utilities::BuildSearchIndex($site, $page, $language, $isDefaultLanguage, $content, $root);
         }
     }
 }
Example #2
0
<?php

include 'app.php';
// set language to preferred language (HTTP_ACCEPT_LANGUAGE)
$supported = Utilities::GetSupportedLanguages('');
$language = Utilities::GetPreferredLanguage($supported);
Utilities::SetLanguage($language);
?>
<!DOCTYPE html>
<html lang="<?php 
print str_replace('_', '-', $language);
?>
">

<head>
	
<title><?php 
print _("Login");
?>
&mdash;<?php 
print BRAND;
?>
</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=utf-8">

<!-- include styles -->
<?php 
include 'modules/css.php';
?>
Example #3
0
<?php

// debugging
define('DEBUG', false);
if (DEBUG) {
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
} else {
    error_reporting(E_ERROR | E_PARSE);
}
session_start();
// authenticate secure pages
if ($isSecure == true) {
    $siteAuthUser = new SiteAuthUser($siteFriendlyId, $rootPrefix, $pageUrl);
    // get auth user
    $siteAuthUser->Authenticate($pageTypeUniqId, $rootPrefix, $pageUrl);
}
// get supported language
$supported = Utilities::GetSupportedLanguages($rootPrefix);
// check if multiple languages are supported
if (count($supported) > 1) {
    if (isset($_SESSION[$siteFriendlyId . '.Language'])) {
        $language = $_SESSION[$siteFriendlyId . '.Language'];
    } else {
        // set language as the default language
        $_SESSION[$siteFriendlyId . '.Language'] = $language;
    }
}
Utilities::SetLanguage($language, $rootPrefix . 'locale');