コード例 #1
0
ファイル: lib.php プロジェクト: bogdan-nazar/flex.engine.core
	public static function _init()
	{
		if(strpos(self::$class,"\\")!==false)
		{
			$cl=explode("\\",self::$class);
			self::$class=$cl[count($cl)-1];
		}
		self::$c=_a::core();
	}
コード例 #2
0
ファイル: tpl.php プロジェクト: bogdan-nazar/flex.engine.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);
	}
コード例 #3
0
	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;
	}
コード例 #4
0
ファイル: db.php プロジェクト: bogdan-nazar/flex.engine.core
	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());
	}
コード例 #5
0
	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();
	}
コード例 #6
0
ファイル: example.php プロジェクト: redcap3000/html5_core
// which only contains valid fields/values to the json object..
$json = $page->json_page();
// You can also import json  and display json... this will override page class variables 
$page->load_json_page($json);


// Working with alternate new tag syntax (based on $o parameter)
// Use the tag->o parameter to define the order inside tag construct methods, add an assoc.
// array as final variable to add any other tag parameters

// From class _a {
//	public $o = array('href','inner','title','target');
// }

$test = new _a('http://redcapmedia.com','Red Cap Media',NULL,'_self');
$test2 = new _a('http://redcapmedia.com','Red Cap Media',array('target'=>'_self'));

echo $test->make();

echo $test2->make();
// From class _div{
//	public $o = array('inner','id','class');
// }
$test = new _div('main','my_id');
$test2 = new _div('inner content','main',array('class'=>'myclass'));
// Inner content can also be another tag object.
$test3 = new _div(new _p('Here is a paragraphy'),'my_id');
// the 'old school verbose method' new constructions dont take new tag objects but should be fine for 
// inner defs.... yet..
//$test = new _div('inside of the div',array('class'=>'myclass','id'=>'myid'));
コード例 #7
0
 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();
     }
 }
コード例 #8
0
 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;
 }
コード例 #9
0
	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;
			}
		}
	}