Файл: system/class/diz.php
Строк: 124
<?
global $db;
if ($aut == true) {
define('STYLE',$ya['style']);
}else{
define('STYLE',$db->settings('ststyle'));
}
define('KEYWORDS',$db->settings('keywords'));
define('TITLE',$db->settings('title'));
define('DESCRIPTION',$db->settings('description'));
define('VERSION',$db->settings('web'));
//////Файл оболочки
final class diz {
public function head($title=TITLE,$descriptions=DESCRIPTION,$keywords=KEYWORDS) {
if($descriptions==null)$descriptions=language($title);
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru"><head>';
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Last-Modified: ".gmdate("D, d M Y H:i:s"). "GMT");
date_default_timezone_set('GMT');
header("Content-Type: text/html; charset=utf-8; Accept-Encoding: gzip, deflate");
?>
<meta name="copyright" content="GlobalCMS" />
<meta name="keywords" content="<?echo $keywords?>"/>
<meta name="description" content="<?echo $descriptions?>"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
<link rel="shortcut icon" href="/styles/<?echo STYLE?>/favicon.ico" />
<title><?echo language($title)?></title>
<link rel="stylesheet" href="/styles/<?echo STYLE?>/style.css" type="text/css" />
<script src="/system/lib/ajax_libary.js"></script>
<script src="/styles/<?echo STYLE;?>/scripts.js"></script>
<script src="/system/lib/upload.js"></script>
<?
echo '</head><body>';
}
//Шапка
public function title($title,$min=true,$media_player=true) {
global $db;
global $fuser;
global $admin;
global $ya;
global $func;
global $detect;
global $diz;
if($min==true)require_once ($_SERVER['DOCUMENT_ROOT'].'/styles/'.STYLE.'/face.php');
if($media_player==true)require_once ($_SERVER['DOCUMENT_ROOT'].'/media/include.php');
}
//Вывод
public function out() {
global $diz;
global $db;
require_once ($_SERVER['DOCUMENT_ROOT'].'/system/end.php');
}
public function import($name='file',$button='Выберите файл',$required=true,$formats=null){
?>
<script src="/system/lib/fileinput.js"></script>
<script>
$(document).ready(function() {
fileInput('<?echo language($button)?>');
});
</script>
<?
if($required==true)$required='required'; else $required=null;
if($formats!=null)$formats='accept="'.$formats.'"'; else $formats=null;
return '<input name="'.$name.'" type="file" '.$formats.' '.$required.'>';
}
//Путь к иконкам
public function icon($img_url,$alt=null,$width=0,$height=0) {
if (is_file($_SERVER['DOCUMENT_ROOT'].'/styles/'.STYLE.'/images/icons/'.$img_url)) {
if(intval(abs($width))>0)$w='width='.$width; else $w=null;
if(intval(abs($height))>0)$h='width='.$height; else $h=null;
$img_url = '<img src="/styles/'.STYLE.'/images/icons/'.$img_url.'" alt="'.language($alt).'" '.$w.' '.$h.'/>';
} else $img_url=null;
return $img_url;
}
//checkbox
public function checkbox($name='name',$text='Checkbox',$checked=false,$disabled=false,$value='on'){
if($checked==true)$checked='checked';else $checked=null;
if($disabled==true)$disabled='disabled';else $disabled=null;
return '<div class="check-box" >
<input type="checkbox" id="'.$name.'" name="'.$name.'" value="'.$value.'" '.$checked.' '.$disabled.'>
<label for="'.$name.'">'.language($text).'</label>
</div>';
}
//Путь к картинкам
public function img($img,$alt=null,$width=0,$height=0) {
if (is_file($_SERVER['DOCUMENT_ROOT'].'/styles/'.STYLE.'/images/'.$img)) {
if(intval(abs($width))>0)$w='width='.$width; else $w=null;
if(intval(abs($height))>0)$h='width='.$height; else $h=null;
$img = '<img src="/styles/'.STYLE.'/images/'.$img.'" alt="'.language($alt).'" '.$w.' '.$h.'/>';
} else $img=null;
return $img;
}
}
?>