public static function _init() { if(strpos(self::$class,"\\")!==false) { $cl=explode("\\",self::$class); self::$class=$cl[count($cl)-1]; } self::$c=_a::core(); }
public function __construct($className,$tplSection,$tplFile,$useTemplatesSet) { $this->c=_a::core(); $this->class=$className; $this->name=$useTemplatesSet?$useTemplatesSet:$this->c->config("","template"); if(!$tplSection)$tplSection=$className; $this->section=$tplSection; if(!$className) { $this->error=true; return; } $this->fileName=$tplFile?$tplFile:$className; $dir=FLEX_APP_DIR_TPL."/".$this->name."/".$className; if(@file_exists($dir))$this->fileDir=$dir; else { if(@file_exists(FLEX_APP_DIR."/".$dir))$this->fileDir=$dir; else { if(FLEX_APP_DIR_SRC)//режим разработки { $this->fromSources=true; if(@file_exists(FLEX_APP_DIR_SRC.".core/".FLEX_APP_DIR."/".$dir))$this->fileDir=FLEX_APP_DIR_SRC.".core/".FLEX_APP_DIR."/".$dir; else { if(@file_exists(FLEX_APP_DIR_SRC.".classes/.".$className."/".$dir))$this->fileDir=FLEX_APP_DIR_SRC.".classes/.".$className."/".$dir; } } } } if($this->fileDir==="") { $this->error=true; return; } else { $this->fileData=@file_get_contents($this->fileDir."/".$this->fileName.".tpl"); if($this->fileData===false) { $this->error=true; return; } } $this->_sectionGet($tplSection); }
public static function _init() { if(strpos(self::$class,"\\")!==false) { $cl=explode("\\",self::$class); self::$class=$cl[count($cl)-1]; } self::$c=_a::core(); self::$config=self::$c->config(self::$class); if(!isset(self::$config[MSGR_MAILER_DOMAIN]) || !self::$config[MSGR_MAILER_DOMAIN]) { $d=explode(".",self::$c->domainCurrent()); if(count($d) && ($d[0]=="www"))$d=array_shift($d); self::$config[MSGR_MAILER_DOMAIN]=implode(".",$d); } if(isset($_SESSION[self::$class."-items"]))$setItems=unserialize($_SESSION[self::$class."-items"]); else $setItems=""; if(is_array($setItems) && count($setItems))self::$items=$setItems; }
public static function _init() { if(strpos(self::$class,"\\")!==false) { $cl=explode("\\",self::$class); self::$class=$cl[count($cl)-1]; } self::$c=_a::core(); self::$config=array_merge(self::$config, self::$c->config(self::$class)); if(self::$c->domainType()==CORE_DOMAIN_TYPE_MAIN) { self::$db["host"]=self::$config["con_host"]; self::$db["name"]=self::$config["con_name"]; self::$db["user"]=self::$config["con_user"]; self::$db["pass"]=self::$config["con_pass"]; } elseif(self::$c->domainType()==CORE_DOMAIN_TYPE_DEV) { self::$db["host"]=self::$config["dev_host"]; self::$db["name"]=self::$config["dev_name"]; self::$db["user"]=self::$config["dev_user"]; self::$db["pass"]=self::$config["dev_pass"]; } else { self::$db["host"]=self::$config["loc_host"]; self::$db["name"]=self::$config["loc_name"]; self::$db["user"]=self::$config["loc_user"]; self::$db["pass"]=self::$config["loc_pass"]; } self::$db["link"]=@mysql_connect(self::$db["host"],self::$db["user"],self::$db["pass"]) or die("Could not connect: ".mysql_error()); mysql_query("SET CHARACTER_SET_CLIENT='utf8'"); mysql_query("SET CHARACTER_SET_RESULTS='utf8'"); mysql_query("SET COLLATION_CONNECTION='utf8_general_ci'"); mysql_select_db(self::$db["name"],self::$db["link"]) or die ("Can't use database: ".mysql_error()); }
public static function _init() { if(@strpos(self::$class,"\\")!==false) { $cl=@explode("\\",self::$class); self::$class=$cl[count($cl)-1]; } self::$c=_a::core(); self::_configLoad(); self::_sessionRead(); self::_spotsLoad(); }
public static function _init() { if (strpos(self::$class, "\\") !== false) { $cl = explode("\\", self::$class); self::$class = $cl[count($cl) - 1]; } self::$c = _a::core(); self::$config = self::$c->config(self::$class); self::_sessionRead(); if (!is_array(self::$user) || !count(self::$user) || !array_key_exists("id", self::$user)) { self::_userReset(); } }
public static final function __install($instance) { self::$__c = _a::core(); self::$__silent = self::$__c->silent(); self::$__isadmin = defined("ADMIN_MODE") && auth::admin(); if (!self::_isAdmn()) { msgr::add(_t("Can't install from non-admin environment.")); return false; } if (!self::_iSet($instance)) { return; } if (self::$__ic->__runstage > 0) { return; } self::$__ic->__runstage++; self::$__ic->__instance = $__instance; if (@method_exists(__NAMESPACE__ . "\\" . self::$__ic->__instance, "_on_install")) { $res = @call_user_func(array(__NAMESPACE__ . "\\" . self::$__ic->__instance, "_on_install")); if (!is_bool($res)) { $res = true; } return $res; } return true; }
public static function _init() { if(strpos(self::$class,"\\")!==false) { $cl=explode("\\",self::$class); self::$class=$cl[count($cl)-1]; } self::$c=_a::core(); self::$silent=self::$c->silent(); self::$uid=auth::user("id"); //читаем сессию self::_sessionRead(); if(isset(self::$session["files"])) { self::$files=self::$session["files"]; if(!is_array(self::$files))self::$files=array(); } //проверяем поддерживаемые типы $types=imagetypes(); if($types & IMG_GIF)self::$imgSup[]=MEDIA_IMG_GIF; if($types & IMG_JPG)self::$imgSup[]=MEDIA_IMG_JPG; if($types & IMG_PNG)self::$imgSup[]=MEDIA_IMG_PNG; if($types & IMG_WBMP)self::$imgSup[]=MEDIA_IMG_WBMP; if($types & IMG_XPM)self::$imgSup[]=MEDIA_IMG_XBM; if(!in_array(self::$config["imgTypeDefault"],self::$imgSup)) { if(count(self::$imgSup))self::$config["imgTypeDefault"]=self::$imgSup[0]; else { msgr::add("Критическая ошибка ядра [".self::$class."]: не удалось определить поддерживаемые типы изображений!"); return; } } }