Subversion Repositories qbpwcf-lib(archive)

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
774 liveuser 1
<?php
2
 
3
/*
4
 
5
        QBPWCF, Quick Build PHP website Component base on Fedora Linux.
6
    Copyright (C) 2015~2024 Min-Jhin,Chen
7
 
8
    This file is part of QBPWCF.
9
 
10
    QBPWCF is free software: you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
12
    the Free Software Foundation, either version 3 of the License, or
13
    (at your option) any later version.
14
 
15
    QBPWCF is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with QBPWCF.  If not, see <http://www.gnu.org/licenses/>.
22
 
23
*/
24
 
25
#使用 qbpwcf 命名空間
26
namespace qbpwcf;
27
 
28
#匯入套件
29
require_once("qbpwcf/allInOne.php");
30
 
31
#qbpwcf用的javascript
32
$qbpwcfJavaScript=javaScript::qbpwcfJavaScript();
33
 
34
#如果建立 qbpwcf 用的 js 語法失敗
35
if($qbpwcfJavaScript["status"]==="false"){
36
 
37
	#debug
38
	var_dump($qbpwcfJavaScript);
39
	exit;
40
 
41
	}#if end
42
 
43
#印出js語法
44
echo $qbpwcfJavaScript["content"];
45
 
46
#建議的log位置
47
$logFile=$_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"].".log";
48
 
49
#函式說明:
50
#開新視窗,可以隱藏瀏覽器的元件。
51
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
52
#$result["error"],錯誤訊息.
53
#$result["function"],當前執行的函數名稱.
54
#$result["argu"],所使用的參數.
55
#$result["content"],js語法.
56
#$result["jsFuncName"],使用的js函數名稱.
57
#必填參數:
58
#$conf["url"],字串,要開新視窗的網址.
59
$conf["url"]="https://www.qbpwcf.org";
60
#$conf["function"],字串,js開新視窗函式的名稱.
61
$conf["function"]="openWindowFunc";
62
#可省略參數:
63
#$conf["name"],字串 ,視窗的名稱,指定後可以直接存取其內容.
64
#$conf["name"]="";
65
#$conf["width"],字串,新視窗的寬度.
66
#$conf["width"]="";
67
#$conf["height"],字串,新視窗的高度.
68
#$conf["height"]="";
69
#$conf["toolbar"],字串,是否要工具列,"true"代表要,"false"代表不要,預設為"false".
70
#$conf["toolbar"]="";
71
#$cpnf["menubar"],字串,是否要選單列,"true"代表要,"false"代表不要,預設為"false".
72
#$conf["menubar"]="";
73
#$conf["scrollbars"],字串,是否要滾軸,"true"代表要,"false"代表不要,預設為"true".
74
#$conf["scrollbars"]="";
75
#$conf["resizable"],字串,是否可以改變視窗大小,"true"代表可以,"false"代表不可以,預設為"true".
76
#$conf["resizable"]="";
77
#$conf["location"],字串,是否要顯示地址列,"true"代表要,"false"代表不要,預設為"false".
78
#$conf["location"]="";
79
#$conf["status"],字串,是否要顯示狀態列,"true"代表要,"false"代表不要,預設為"false".
80
#$conf["status"]="";
81
#$conf["titlebar"],字串,是否要顯示視窗標題,"true"代表要,"false"代表不要,預設為"true".
82
#$conf["titlebar"]="";
83
#$conf["returnWindowVarName"],字串,開啟的視窗要儲存到哪個全域變數,請提供window.後面的名稱即可,預設不使用,直接return.
84
$conf["returnWindowVarName"]="abc";
85
#參考資料:
86
#http://www.w3schools.com/jsref/met_win_open.asp
87
#http://www.blueshop.com.tw/board/FUM20041006152641OLG/BRD20080107111600L3T.html
88
#備註:
89
#無.
90
$openWindow=javaScript::openWindow($conf);
91
unset($conf);
92
 
93
#如果執行失敗
94
if($openWindow["status"]==="false"){
95
 
96
	#函式說明:
97
	#撰寫log
98
	#回傳結果:
99
	#$result["status"],狀態,"true"或"false".
100
	#$result["error"],錯誤訊息陣列.
101
	#$result["function"],當前函式的名稱.
102
	#$result["argu"],使用的參數.
103
	#必填參數:
104
	#$conf["path"],字串,log檔案的路徑與名稱.
105
	$conf["path"]=$logFile;
106
	#$conf["content"],any,要寫的內容,若內容不為字串則會用var_dump的格式寫入.
107
	$conf["content"]=$openWindow;
108
	#$conf["fileArgu"],字串,php變數__FILE__的內容,亦即該檔案在檔案系統的絕對路徑
109
	$conf["fileArgu"]=__FILE__;
110
	#可省略參數:
111
	#$conf["rewrite"],預設為"false",接續寫入;反之"true"代表重新寫入.
112
	#$conf["rewrite"]="false";
113
	#參考資料:
114
	#無.
115
	#備註:
116
	#無.
117
	$record=logs::record($conf);
118
	unset($conf);
119
 
120
	#結束執行
121
	exit;
122
 
123
	}#if end
124
 
125
#印出語法
126
echo $openWindow["content"];