示例#1
0
 public function set($cookie_name, $cookie_value)
 {
     $boj_registry = new cls_registry();
     $settings = $boj_registry->get_plugin('core');
     setcookie($cookie_name, $cookie_value, time() + $settings['cookie_max_time']);
     return true;
 }
示例#2
0
 static function difault_headers()
 {
     if (is_null(self::$settings)) {
         $registry = new cls_registry();
         self::$settings = $registry->get_plugin('core');
         $obj_localize = new cls_localize();
         self::$localize_settings = $obj_localize->get_localize();
         self::$page_tittle = self::$localize_settings['name'];
     }
     if (is_null(self::$header_tags)) {
         self::$header_tags = array();
     }
     $default_headers = array();
     #LOAD HEEFAL GENERATOR META TAG
     array_push($default_headers, '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
     array_push($default_headers, '<meta name="generator" content=" Sarkesh CMS! - Open Source Content Management" />');
     //cache control
     array_push($default_headers, '<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">');
     #load jquery
     if (self::$settings['jquery'] == '1') {
         array_push($default_headers, '<script src="./core/ect/scripts/jquery.js"></script>');
         array_push($default_headers, '<script src="./core/ect/scripts/bootstrap.min.js"></script>');
         array_push($default_headers, '<script src="./core/ect/scripts/bootstrap-dialog.js"></script>');
         array_push($default_headers, '<script src="./core/ect/scripts/pace.min.js"></script>');
         array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./core/ect/styles/bootstrap.min.css" />');
         array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./core/ect/styles/default.css" />');
         #load rtl bootstrap
         if (self::is_rtl()) {
             array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./core/ect/styles/bootstrap-rtl.min.css" />');
         }
         array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./core/ect/styles/bootstrap-dialog.css" />');
         //for more information about normalize project see http://necolas.github.io/normalize.css/
         array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./core/ect/styles/normalize.css" />');
         //get pace(loading in ajax theme
         if (self::$settings['pace_theme'] != '0') {
             array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./core/ect/styles/pace/' . self::$settings['pace_theme'] . '.css" />');
         }
         array_push($default_headers, '<meta name="viewport" content="width=device-width, initial-scale=1.0">');
     }
     #load style sheet pages (css)
     $theme_name = self::$settings['active_theme'];
     array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./themes/' . $theme_name . '/style.css" />');
     #load rtl stylesheets
     if (self::is_rtl()) {
         array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./themes/' . $theme_name . '/rtl-style.css" />');
     }
     #load favicon
     if (file_exists("./themes/" . $theme_name . "/favicon.ico")) {
         array_push($default_headers, '<link rel="shortcut icon" href="./themes/' . $theme_name . '/favicon.ico" type="image/x-icon">');
         array_push($default_headers, '<link rel="icon" href="./themes/' . $theme_name . '/favicon.ico" type="image/x-icon">');
     }
     //load first bootstrap skin
     if (self::$settings['1st_template'] != '0') {
         array_push($default_headers, '<link rel="stylesheet" type="text/css" href="./core/ect/styles/' . self::$settings['1st_template'] . '.min.css" />');
     }
     #load nessasery java script functions
     array_push($default_headers, '<script src="./core/ect/scripts/functions.js"></script>');
     self::$header_tags = $default_headers + self::$header_tags;
 }
示例#3
0
文件: module.php 项目: MrMiM/sarkesh
 protected function module_themes()
 {
     //Get all themes that exists
     $directory = scandir(AppPath . '/themes/');
     $themes = (array) null;
     foreach ($directory as $files) {
         if (is_dir(AppPath . 'themes/' . $files) && $files != '.' && $files != '..') {
             array_push($themes, $files);
         }
     }
     //get current active theme
     $registry = new cls_registry();
     $active_theme = $registry->get('core', 'active_theme');
     //get themes info
     $themes_info = (array) null;
     foreach ($themes as $theme_file) {
         include_once AppPath . '/themes/' . $theme_file . '/info.php';
         array_push($themes_info, $theme);
     }
     //send to view for show themes
     return $this->view_themes($themes, $themes_info, $active_theme);
 }
示例#4
0
文件: load.php 项目: MrMiM/sarkesh
<?php

/*	this file is perpare application of user for start working
	in this file set functions for start and use in themes
*/
ob_start("sys_render");
$registry = new cls_registry();
include_once './themes/' . $registry->get('core', 'active_theme') . '/index.php';
ob_end_flush();
?>