public static function picker()
    {
        global $activeLang;
        //pr($activeLang);
        if (count($activeLang) > 1) {
            $get = Init::returnGet();
            global $init;
            $in = array();
            global $mainClass;
            //            global $pageClass;
            //            global $usePage;
            foreach ($init->params as $ll) {
                if ($ll == $mainClass) {
                    continue;
                }
                //                if($usePage && $ll == $pageClass)
                //                    continue;
                $in[] = $ll;
            }
            $imp = implode("/", $in);
            ?>
<select id="gantibhs" class="form-control" onchange="gantiLang();">
    <?php 
            foreach ($activeLang as $lng) {
                ?>
    <option value="<?php 
                echo $lng;
                ?>
" <?php 
                if (Lang::getLang() == $lng) {
                    echo "selected";
                }
                ?>
><?php 
                echo strtoupper($lng);
                ?>
</option>
    <?php 
            }
            ?>
</select>
<script>
function gantiLang(){
    var slc = $('#gantibhs').val();
    document.location = '<?php 
            echo _SPPATH;
            ?>
'+slc+'/<?php 
            echo $imp . $get;
            ?>
';
}
</script>
<?php 
        }
    }
    //echo $file;echo "<br>";
    require_once $file;
}
// include db setting, web setting, and paths
require_once 'include/access.php';
$init = new Init($mainClass, $DbSetting, $WebSetting, $timezone, $js, $css, $nameSpaceForApps);
//starting the session
session_start();
//pr($WebSetting);
//Init Languange
$lang = new Lang($WebSetting['lang']);
$lang->activateLangSession();
$lang->activateGetSetLang();
//pr($lang);
//pr($_SESSION);
$selected_lang = Lang::getLang();
if (!isset($selected_lang) || $selected_lang == "" || is_object($selected_lang)) {
    $selected_lang = "en";
}
//pr($selected_lang);
//echo "lang/".strtolower($selected_lang).".php";
require_once "lang/" . strtolower($selected_lang) . ".php";
//get globals
$db = $init->getDB();
$params = $init->getParams();
$template = $init->getTemplate();
//theme selection
if (strpos($_GET['url'], 'EfiHome') !== false || $_GET['url'] == "index") {
    $themepath = 'adminlte2';
} else {
    $themepath = ThemeItem::getTheme();
 public function activateGetSetLang()
 {
     if (isset($_GET['setlang'])) {
         $_SESSION['lang'] = $_GET['setlang'];
         //lempar
         global $init;
         if (count($init->activeLang) > 0) {
             if (in_array($init->params[0], $init->activeLang)) {
                 unset($init->params[0]);
                 $init->params = array_values($init->params);
             }
             $selected_lang = Lang::getLang();
             $imp = implode("/", $init->params);
             $get = \Init::returnGet();
             header("Location:" . _SPPATH . $selected_lang . "/" . $imp . $get);
             exit;
         }
     } else {
         global $init;
         if (count($init->activeLang) > 0) {
             if (in_array($init->params[0], $init->activeLang)) {
                 $_SESSION['lang'] = $init->params[0];
             }
         }
     }
 }
Beispiel #4
0
 private function buildConfigFile()
 {
     $this->bootFramework();
     $this->rewriter->toFile($this->configDirectory . '/app.php', array('url' => $this->getBaseUrl(), 'locale' => Lang::getLang(), 'key' => $this->post('encryption_code', 'ChangeMe!123')));
     $activeTheme = $this->post('active_theme');
     if ($activeTheme) {
         $activeTheme = strtolower(str_replace('.', '-', $activeTheme));
     } else {
         $activeTheme = 'demo';
     }
     $this->rewriter->toFile($this->configDirectory . '/cms.php', array('activeTheme' => $activeTheme, 'backendUri' => $this->post('backend_uri', '/backend'), 'defaultMask.file' => $this->post('file_mask', '777'), 'defaultMask.folder' => $this->post('folder_mask', '777')));
     $this->rewriter->toFile($this->configDirectory . '/database.php', $this->getDatabaseConfigValues());
 }
Beispiel #5
0
 public function outputCached($filename, $contentType = "text/html", $encoding = "utf-8")
 {
     while (ob_get_length()) {
         ob_end_clean();
     }
     header("Content-Type: {$contentType};charset={$encoding}");
     $cache = Cache::Priv(sha1(json_encode(array($filename, Lang::getLang(), $this->params))), ".html");
     if ($cache->exists()) {
         echo $cache->getContents();
         Output::finish();
     }
     $content = $this->parse($filename);
     $cache->setContents($content);
     echo $content;
     Output::finish();
 }
 public function setLangPath($WebSetting)
 {
     $selected_lang = "";
     if (count($this->activeLang) > 0) {
         $selected_lang = Lang::getLang() . "/";
     }
     define('_LANGPATH', $WebSetting['folder'] . $selected_lang);
 }
 public function id($args)
 {
     //        pr($args);
     /*
      * begin the calculation
      */
     $url = addslashes($_GET['jurusan']);
     //        echo $url;
     global $activeLang;
     //        pr($activeLang);
     $langtext = "";
     if (count($activeLang) > 0) {
         $sl = Lang::getLang();
         $langtext = "AND post_lang = '{$sl}'";
     }
     //        echo $langtext;
     $pg = new Page();
     $arrPage = $pg->getWhere("post_url = '{$url}' AND post_status = 'publish' {$langtext}");
     $pg = $arrPage[0];
     //pr($arrPage);
     if ($pg->post_url == "") {
         $pg = new Page();
         $arrPage = $pg->getWhere("post_url = '{$url}' AND post_status = 'publish'");
         if (count($arrPage) > 0) {
             $pg = $arrPage[0];
             if ($pg->post_link == "" || $pg->post_link == '0') {
                 ?>
                 <div class="alert alert-warning language_disclaimer" role="alert">
                     <?php 
                 echo Efiwebsetting::getData('Language_Disclaimer');
                 ?>
                 </div>
             <?php 
             }
         } else {
             Redirect::p404();
         }
     }
     //            Redirect::p404();
     //die('die');
     //pr($pg);
     $page = $pg;
     // isi semua meta tag dan title
     $this->isiMeta($pg);
     $json = "";
     if ($pg->post_attachments != "") {
         $json = json_decode(stripslashes($pg->post_attachments));
     }
     //pr($json);
     if ($pg->post_attachment_order == "") {
         $pa = \Efiwebsetting::getData('PageAttachment');
     } else {
         $pa = $pg->post_attachment_order;
     }
     $exp = explode(",", $pa);
     $dimatikan_animasi_header = 1;
     foreach ($exp as $p) {
         if ($p == "Page") {
             if ($pg->post_link != "" && $pg->post_link != '0') {
                 $_SESSION['pageObj'] = $page;
                 //kalau ada link
                 $arrSp = Registor::getFeatureStartPage();
                 list($cname, $fname) = $arrSp[$pg->post_link];
                 $new = new $cname();
                 $new->{$fname}();
             } else {
                 $arr['page'] = $page;
                 $arr['dimatikan_animasi_header'] = $dimatikan_animasi_header;
                 $layout_id = "Page_id";
                 $file = Layout::getFile($layout_id);
                 Mold::theme("Pages/" . $layout_id . "/" . $file, $arr);
             }
         } else {
             if (array_key_exists($p, $json) && $json->{$p} > 0) {
                 $paralax = new $p();
                 $paralax->viewme($json->{$p}, "Page", $page->ID);
                 if (contains($p, array("Parallax", "Carousel"))) {
                     $dimatikan_animasi_header = 0;
                 }
             }
         }
     }
     //
     //        //cek Parallax plg atas
     //        if(array_key_exists("ParallaxModel",$json) && $json->ParallaxModel>0){
     //            $paralax = new ParallaxModel();
     //            $paralax->viewme($json->ParallaxModel);
     //            $dimatikan_animasi_header = 0;
     //        }
     //
     //        //cek carousel
     //        if(array_key_exists("GalleryCarousel__view",$json) && $json->GalleryCarousel__view>0){
     //            $cr = new GalleryCarousel();
     //            $cr->viewme($json->GalleryCarousel__view);
     //            $dimatikan_animasi_header = 0;
     //        }
     //
     //
     //
     //        if(array_key_exists("Gallery__view",$json)&&$json->Gallery__view>0){
     //
     //            $cr = new Gallery();
     //            $cr->viewme($json->Gallery__view);
     //
     //        }
     //        if(array_key_exists("CalendarWeb__view",$json)&&$json->CalendarWeb__view>0){
     //
     //            $cr = new CalendarModel();
     //            $cr->viewme($json->CalendarWeb__view);
     //
     //        }
     //        if(array_key_exists("CalendarWeb__viewtype",$json)&&$json->CalendarWeb__viewtype>0){
     //
     //            $cr = new CalendarTypeModel();
     //            $cr->viewme($json->CalendarWeb__viewtype);
     //
     //        }
     //        if(array_key_exists("PageComment__loadcomment",$json)&&$json->PageComment__loadcomment>0){
     //
     //            $cr = new PageComment();
     //            $cr->viewme($json->PageComment__loadcomment,$pg->ID);
     //
     //        }
 }