Jelajahi Sumber

群组初步

visuddhinanda 5 tahun lalu
induk
melakukan
a0c800a35e

+ 128 - 83
app/doc/coop.js

@@ -1,108 +1,153 @@
 function username_search_keyup(e, obj) {
-    var keynum
-    var keychar
-    var numcheck
+	var keynum;
+	var keychar;
+	var numcheck;
 
-    if ($("#wiki_search_input").val() == "") {
-        $("#search_result").html("");
-        return;
-    }
+	if ($("#wiki_search_input").val() == "") {
+		$("#search_result").html("");
+		return;
+	}
 
-    if (window.event) // IE
-    {
-        keynum = e.keyCode
-    }
-    else if (e.which) // Netscape/Firefox/Opera
-    {
-        keynum = e.which
-    }
-    var keychar = String.fromCharCode(keynum)
-    if (keynum == 13) {
-        //dict_search(obj.value);
-    }
-    else {
-        username_search(obj.value);
-    }
+	if (window.event) {
+		// IE
+		keynum = e.keyCode;
+	} else if (e.which) {
+		// Netscape/Firefox/Opera
+		keynum = e.which;
+	}
+	var keychar = String.fromCharCode(keynum);
+	if (keynum == 13) {
+		//dict_search(obj.value);
+	} else {
+		username_search(obj.value);
+	}
 }
 
 function username_search(keyword) {
-    $.get("../ucenter/get.php",
-        {
-            username: keyword
-        },
-        function (data, status) {
-            let result;
-            try {
-                result = JSON.parse(data);
-            } catch (error) {
-                console(error);
-            }
-            let html = "<ul id='user_search_list'>";
-            if (result.length > 0) {
-                for (x in result) {
-                    html += "<li><a onclick=\"coop_add('" + result[x].id + "')\">" + result[x].username + "[" + result[x].email + "]</a></li>";
-                }
-            }
-            html += "</ul>";
-            $("#search_result").html(html);
-        });
+	$.get(
+		"../ucenter/get.php",
+		{
+			username: keyword,
+		},
+		function (data, status) {
+			let result;
+			try {
+				result = JSON.parse(data);
+			} catch (error) {
+				console(error);
+			}
+			let html = "<ul id='user_search_list'>";
+			if (result.length > 0) {
+				for (x in result) {
+					html +=
+						"<li><a onclick=\"coop_add('" +
+						result[x].id +
+						"')\">" +
+						result[x].username +
+						"[" +
+						result[x].email +
+						"]</a></li>";
+				}
+			}
+			html += "</ul>";
+			html += "<ul id='group_search_list'>";
+			html += "</ul>";
+			$("#search_result").html(html);
+
+			$.get(
+				"../group/get_name.php",
+				{
+					name: keyword,
+				},
+				function (data, status) {
+					let result;
+					try {
+						result = JSON.parse(data);
+					} catch (error) {
+						console(error);
+					}
+					let html1 = "";
+					if (result.length > 0) {
+						for (const iterator of result) {
+							html1 +=
+								"<li><a onclick=\"coop_add_group('" +
+								iterator.id +
+								"')\">" +
+								iterator.name +
+								"[" +
+								iterator.username.nickname +
+								"]</a></li>";
+						}
+					}
+					$("#group_search_list").html(html1);
+				}
+			);
+		}
+	);
 }
 
 var coop_show_div_id = "";
 var coop_doc_id = "";
 function coop_init(doc_id, strDivId) {
-    coop_show_div_id = strDivId;
-    coop_doc_id = doc_id
+	coop_show_div_id = strDivId;
+	coop_doc_id = doc_id;
 }
 
 function coop_list() {
-    $.get("../doc/coop.php",
-        {
-            do: "list",
-            doc_id: coop_doc_id
-        },
-        function (data, status) {
-            $("#" + coop_show_div_id).html(data);
-        });
-
+	$.get(
+		"../doc/coop.php",
+		{
+			do: "list",
+			doc_id: coop_doc_id,
+		},
+		function (data, status) {
+			$("#" + coop_show_div_id).html(data);
+		}
+	);
 }
 
 function coop_add(userid) {
-    $.get("../doc/coop.php",
-        {
-            do: "add",
-            doc_id: coop_doc_id,
-            user_id: userid
-        },
-        function (data, status) {
-            $("#" + coop_show_div_id).html(data);
-        });
+	$.get(
+		"../doc/coop.php",
+		{
+			do: "add",
+			doc_id: coop_doc_id,
+			user_id: userid,
+		},
+		function (data, status) {
+			$("#" + coop_show_div_id).html(data);
+		}
+	);
 }
 
 function coop_del(userid) {
-    $.get("../doc/coop.php",
-        {
-            do: "del",
-            doc_id: coop_doc_id,
-            user_id: userid
-        },
-        function (data, status) {
-            $("#" + coop_show_div_id).html(data);
-        });
+	$.get(
+		"../doc/coop.php",
+		{
+			do: "del",
+			doc_id: coop_doc_id,
+			user_id: userid,
+		},
+		function (data, status) {
+			$("#" + coop_show_div_id).html(data);
+		}
+	);
 }
 function coop_set(userid, value) {
-    $.get("../doc/coop.php",
-        {
-            do: "set",
-            doc_id: coop_doc_id,
-            user_id: userid,
-            value: value
-        },
-        function (data, status) {
-            $("#" + coop_show_div_id).html(data);
-        });
+	$.get(
+		"../doc/coop.php",
+		{
+			do: "set",
+			doc_id: coop_doc_id,
+			user_id: userid,
+			value: value,
+		},
+		function (data, status) {
+			$("#" + coop_show_div_id).html(data);
+		}
+	);
 }
 
 function coop_power_change(userid, obj) {
-    coop_set(userid, obj.value)
-}
+	coop_set(userid, obj.value);
+}

+ 2 - 2
app/doc/coop.php

@@ -103,12 +103,12 @@ set (doc_id ,userid ,value)
                 }
                 
                 $query = "SELECT * from power where doc_id = ? ";
-                $Fetch = PDO_FetchAll($query,$_doc_id);
+                $Fetch = PDO_FetchAll($query,array($_doc_id));
 
                 echo "<ul>";
                 foreach($Fetch as $row){
                     echo "<li>";
-                    echo ucenter_getA($row["user"],"");
+                    echo ucenter_getA($row["user"],"username");
                     echo "<select onchange=\"coop_power_change('{$row["user"]}',this)\">";
                     foreach($powerlist as $key=>$value){
                         echo "<option value='{$key}' ";

+ 39 - 0
app/group/get.php

@@ -0,0 +1,39 @@
+<?php
+//查询group 列表
+
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once '../public/function.php';
+require_once '../ucenter/function.php';
+
+$output = array();
+if(isset($_GET["id"])){
+    PDO_Connect("sqlite:"._FILE_DB_GROUP_);
+    $id=$_GET["id"];
+    $query = "SELECT * FROM group_info  WHERE id = ? ";
+	$Fetch = PDO_FetchRow($query,array($id));
+	if($Fetch){
+		$output["info"] = $Fetch;
+		if($Fetch["parent"]==0 ){
+			#列出小组
+			$query = "SELECT * FROM group_info  WHERE parent = ? ";
+			$FetchList = PDO_FetchAll($query,array($id));
+			$output["children"] = $FetchList;
+		}
+		else{
+			$output["children"] = array();
+			$query = "SELECT * FROM group_info  WHERE id = ? ";
+			$parent_group = PDO_FetchRow($query,array($Fetch["parent"]));
+			$output["parent"] = $parent_group;
+		}
+		#列出文件
+		if(isset($_GET["list"]) && $_GET["list"]=="file"){
+			PDO_Connect("sqlite:"._FILE_DB_FILEINDEX_);
+			$query = "SELECT * FROM group_share  WHERE group_id = ? ";
+			$fileList = PDO_FetchAll($query,array($id));
+			$output["file"] = $fileList;
+		}
+	}
+}
+echo json_encode($output, JSON_UNESCAPED_UNICODE);
+?>

+ 22 - 0
app/group/get_name.php

@@ -0,0 +1,22 @@
+<?php
+//查询group 列表
+
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once '../public/function.php';
+require_once '../ucenter/function.php';
+
+$output = array();
+if(isset($_GET["name"])){
+    PDO_Connect("sqlite:"._FILE_DB_GROUP_);
+    $query = "SELECT * FROM group_info  WHERE name like ? and parent=0 limit 0,5";
+	$Fetch = PDO_FetchAll($query,array("%".$_GET["name"]."%"));
+
+	$user_info  = new UserInfo();
+	foreach ($Fetch as $key => $value) {
+		# code...
+		$Fetch[$key]["username"] = $user_info->getName($value["owner"]);
+	}
+	echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
+}
+?>

+ 308 - 0
app/group/group.js

@@ -0,0 +1,308 @@
+var _my_channal = null;
+var get_channel_list_callback = null;
+channal_list();
+
+function group_list_init() {
+	if (typeof gGroupId == "undefined") {
+		my_group_list();
+		group_add_dlg_init("group_add_div");
+	} else {
+		group_list(gGroupId, gList);
+		team_add_dlg_init("group_add_div");
+	}
+}
+function channal_list() {
+	$.post("../channal/get.php", {}, function (data) {
+		try {
+			_my_channal = JSON.parse(data);
+			if (get_channel_list_callback) {
+				get_channel_list_callback();
+			}
+		} catch (e) {
+			console.error(e);
+		}
+	});
+}
+
+function channal_getById(id) {
+	for (const iterator of _my_channal) {
+		if (iterator.id == id) {
+			return iterator;
+		}
+	}
+	return false;
+}
+
+function my_group_list() {
+	$.get("../group/list.php", {}, function (data, status) {
+		if (status == "success") {
+			try {
+				let html = "";
+				let result = JSON.parse(data);
+				let key = 1;
+				if (result.length > 0) {
+					for (const iterator of result) {
+						html += '<div class="file_list_row" style="padding:5px;">';
+						html += "<div style='flex:1;'>" + key++ + "</div>";
+						html += "<div style='flex:2;'>" + iterator.group_name + "</div>";
+						html += "<div style='flex:2;'>";
+						if (iterator.power == 1) {
+							html += "拥有者";
+						}
+						html += "</div>";
+						html +=
+							"<div style='flex:1;'><a href='../group/index.php?id=" +
+							iterator.group_id +
+							"'>进入</a></div>";
+						html += "</div>";
+					}
+				} else {
+					html += "你没有加入任何工作组 现在 创建 你的工作组。";
+				}
+				$("#my_group_list").html(html);
+			} catch (e) {
+				console.error(e);
+			}
+		} else {
+			console.error("ajex error");
+		}
+	});
+}
+
+function group_list(id, list) {
+	$.get(
+		"../group/get.php",
+		{
+			id: id,
+			list: list,
+		},
+		function (data, status) {
+			if (status == "success") {
+				try {
+					let html = "";
+					let result = JSON.parse(data);
+					let key = 1;
+					html += "<div>";
+					html += result.info.description;
+					html += "</div>";
+					if (result.parent) {
+						$("#parent_group").html(
+							" / <a href='../group/index.php?id=" +
+								result.parent.id +
+								"'>" +
+								result.parent.name +
+								"</a> "
+						);
+					}
+					$("#curr_group").html("/ <a>" + result.info.name + "</a>");
+					//子小组列表
+					if (result.children && result.children.length > 0) {
+						html += "<div><a href='../group/index.php?id=" + id + "&list=file'>列出公共文件</a></div>";
+						for (const iterator of result.children) {
+							html += '<div class="file_list_row" style="padding:5px;">';
+							html += '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
+							html += "<div style='flex:1;'>" + key++ + "</div>";
+							html += "<div style='flex:2;'>" + iterator.name + "</div>";
+							html += "<div style='flex:2;'>";
+							if (iterator.power == 1) {
+								html += "拥有者";
+							}
+							html += "</div>";
+							html +=
+								"<div style='flex:1;'><a href='../group/index.php?id=" +
+								iterator.id +
+								"&list=file'>进入</a></div>";
+							html += "</div>";
+						}
+					}
+					//文件列表
+					if (result.file && result.file.length > 0) {
+						for (const iterator of result.file) {
+							html += '<div class="file_list_row" style="padding:5px;">';
+							html += '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
+							html += "<div style='flex:1;'>" + key++ + "</div>";
+							html += "<div style='flex:2;'>" + iterator.title + "</div>";
+							html += "<div style='flex:2;'>";
+							if (iterator.power == 1) {
+								html += "拥有者";
+							}
+							html += "</div>";
+							html +=
+								"<div style='flex:1;'><a href='../studio/project.php?op=open&doc_id=" +
+								iterator.doc_id +
+								"'>打开</a></div>";
+							html += "</div>";
+						}
+					}
+					$("#my_group_list").html(html);
+				} catch (e) {
+					console.error(e);
+				}
+			} else {
+				console.error("ajex error");
+			}
+		}
+	);
+}
+/*
+编辑channel信息
+*/
+function my_channal_edit(id) {
+	$.get(
+		"../channal/my_channal_get.php",
+		{
+			id: id,
+			setting: "",
+		},
+		function (data, status) {
+			if (status == "success") {
+				try {
+					let html = "";
+					let result = JSON.parse(data);
+					$("#article_collect").attr("a_id", result.id);
+					html += '<div class="" style="padding:5px;">';
+					html += '<div style="max-width:2em;flex:1;"></div>';
+					html += "</div>";
+
+					html += "<div style='width: 60%;padding: 1em;min-width: 25em;'>";
+					html += '<div style="display:flex;line-height:32px;">';
+					html += "<input type='hidden' name='id' value='" + result.id + "'/>";
+					html += "</div>";
+
+					html += '<div style="display:flex;line-height:32px;">';
+					html += "<div style='flex:2;'>" + gLocal.gui.title + "</div>";
+					html += "<div style='flex:8;'>";
+					html +=
+						"<input type='input' name='name' value='" +
+						result.name +
+						"' maxlength='32' placeholder='channel title'/>";
+					html += "</div>";
+					html += "</div>";
+
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.introduction + "</div>";
+					html += "<div style='flex:8;'>";
+					html += "<textarea name='summary'>" + result.summary + "</textarea>";
+					html += "</div>";
+					html += "</div>";
+
+					html += '<div style="display:flex;line-height:32px;">';
+					html += '<div style="flex:2;">' + gLocal.gui.language_select + "</div>";
+					html += '<div style="flex:8;">';
+					html +=
+						'<input id="channal_lang_select" type="input"  onchange="channal_lang_change()"' +
+						' placeholder = "try type chinese or en " ' +
+						'  title="type language name/code" code="' +
+						result.lang +
+						'" value="' +
+						result.lang +
+						'" > <input id="channal_lang" type="hidden" name="lang" value="' +
+						result.lang +
+						'">';
+					html += "</div>";
+					html += "</div>";
+
+					html += '<div style="display:flex;line-height:32px;">';
+					html += '<div style="flex:2;">' + gLocal.gui.privacy + "</div>";
+					html += '<div style="flex:8;">';
+					let arrStatus = [
+						{ id: 0, string: gLocal.gui.disable, note: gLocal.gui.disable_note },
+						{ id: 10, string: gLocal.gui.private, note: gLocal.gui.private_note },
+						{ id: 30, string: gLocal.gui.public, note: gLocal.gui.public_note },
+					];
+					html += "<select id = 'status'  name = 'status' onchange='status_change(this)'>";
+					let status_note = "";
+					for (const iterator of arrStatus) {
+						html += "<option ";
+						if (parseInt(result.status) == iterator.id) {
+							html += " selected ";
+							status_note = iterator.note;
+						}
+						html += " value='" + iterator.id + "'>" + iterator.string + "</option>";
+					}
+
+					html += "</select>";
+					html +=
+						"<span id = 'status_help' style='margin: 0 1em;'>" +
+						status_note +
+						"</span><a href='#' target='_blank'>[" +
+						gLocal.gui.infomation +
+						"]</li>";
+					html += "</div>";
+					html += "</div>";
+					html += "</div>";
+
+					html += "<div id='preview_div'>";
+					html += "<div id='preview_inner' ></div>";
+					html += "</div>";
+
+					$("#channal_info").html(html);
+					tran_lang_select_init("channal_lang_select");
+					//$("#aritcle_status").html(render_status(result.status));
+					$("#channal_title").html(result.name);
+					$("#preview_inner").html();
+				} catch (e) {
+					console.error(e);
+				}
+			} else {
+				console.error("ajex error");
+			}
+		}
+	);
+}
+
+function status_change(obj) {
+	let arrStatus = [
+		{ id: 0, string: gLocal.gui.disable, note: gLocal.gui.disable_note },
+		{ id: 10, string: gLocal.gui.private, note: gLocal.gui.private_note },
+		{ id: 30, string: gLocal.gui.public, note: gLocal.gui.public_note },
+	];
+	let newStatus = $(obj).val();
+	for (const iterator of arrStatus) {
+		if (parseInt(newStatus) == iterator.id) {
+			$("#status_help").html(iterator.note);
+		}
+	}
+}
+
+function channal_lang_change() {
+	let lang = $("#channal_lang_select").val();
+	if (lang.split("_").length == 3) {
+		$("#channal_lang").val(lang.split("_")[2]);
+	} else {
+		$("#channal_lang").val(lang);
+	}
+}
+
+function my_channal_save() {
+	$.ajax({
+		type: "POST", //方法类型
+		dataType: "json", //预期服务器返回的数据类型
+		url: "../channal/my_channal_post.php", //url
+		data: $("#channal_edit").serialize(),
+		success: function (result) {
+			console.log(result); //打印服务端返回的数据(调试用)
+
+			if (result.status == 0) {
+				alert("保存成功");
+			} else {
+				alert("error:" + result.message);
+			}
+		},
+		error: function (data, status) {
+			alert("异常!" + status + data.responseText);
+			switch (status) {
+				case "timeout":
+					break;
+				case "error":
+					break;
+				case "notmodified":
+					break;
+				case "parsererror":
+					break;
+				default:
+					break;
+			}
+		},
+	});
+}

+ 0 - 0
app/studio/group.php → app/group/group.php


+ 83 - 0
app/group/group_add_dlg.js

@@ -0,0 +1,83 @@
+var _group_add_dlg_div;
+function group_add_dlg_init(div) {
+	_group_add_dlg_div = div;
+	let html = "";
+	html += "<div id='group_add_dlg'>";
+	html += "<div >";
+	html += "<div >" + gLocal.gui.group + gLocal.gui.name + "</div>";
+	html += "<input type='text' id='group_add_title' maxlength='32' placeholder='" + gLocal.gui.name + "'/>";
+	html += "</div>";
+	html += "<div>";
+	html += "</div>";
+	html += "<div style='display:flex;justify-content: space-between;padding-top: 1em;'>";
+	html += "<div>";
+
+	html += "</div>";
+	html += "<div>";
+	html += "<button onclick='group_add_cancel()'>" + gLocal.gui.cancel + "</button>";
+	html += "<button onclick='group_add_new()'>" + gLocal.gui.new + "</button>";
+	html += "</div>";
+	html += "</div>";
+	html += "</div>";
+	$("#" + div).append(html);
+}
+function team_add_dlg_init(div) {
+	_group_add_dlg_div = div;
+	let html = "";
+	html += "<div id='group_add_dlg'>";
+	html += "<div >";
+	html += "<div >小组" + gLocal.gui.name + "</div>";
+	html += "<input type='text' id='group_add_title' maxlength='32' placeholder='" + gLocal.gui.name + "'/>";
+	html += "</div>";
+	html += "<div>";
+	html += "</div>";
+	html += "<div style='display:flex;justify-content: space-between;padding-top: 1em;'>";
+	html += "<div>";
+
+	html += "</div>";
+	html += "<div>";
+	html += "<button onclick='group_add_cancel()'>" + gLocal.gui.cancel + "</button>";
+	html += "<button onclick='group_add_new()'>" + gLocal.gui.new + "</button>";
+	html += "</div>";
+	html += "</div>";
+	html += "</div>";
+	$("#" + div).append(html);
+}
+function group_add_dlg_show() {
+	$("#" + _group_add_dlg_div).show();
+}
+function group_add_dlg_hide() {
+	$("#" + _group_add_dlg_div).hide();
+}
+function group_add_cancel() {
+	group_add_dlg_hide();
+	$("#group_add_title").val("");
+}
+
+function group_add_new() {
+	if ($("#group_add_title").val() == "") {
+		alert("group name is empty!");
+		return;
+	}
+	let parentid = 0;
+	if (typeof gGroupId != "undefined") {
+		parentid = gGroupId;
+	}
+	$.post(
+		"../group/my_group_put.php",
+		{
+			name: $("#group_add_title").val(),
+			parent: parentid,
+		},
+		function (data) {
+			let error = JSON.parse(data);
+			if (error.status == 0) {
+				alert("ok");
+				group_add_cancel();
+				location.reload();
+			} else {
+				alert(error.message);
+			}
+		}
+	);
+}

+ 82 - 0
app/group/index.php

@@ -0,0 +1,82 @@
+<?php
+require_once '../studio/index_head.php';
+?>
+<body id="file_list_body" onLoad="group_list_init()">
+
+	<script language="javascript" src="../ucenter/name_selector.js"></script>
+	<script language="javascript" src="../group/group_add_dlg.js"></script>
+	<script language="javascript" src="../group/group.js"></script>
+	<script >
+	var gCurrPage="group_index";
+	<?php 
+	if(isset($_GET["id"])){
+		echo "var gGroupId ='".$_GET["id"]."';\n";
+	}
+	if(isset($_GET["list"])){
+		echo "var gList ='".$_GET["list"]."';\n";
+	}
+	else{
+		echo "var gList='none';";
+	}
+	?>
+	
+	</script>
+
+	<style>
+	#group_index {
+		background-color: var(--btn-border-color);
+		
+	}
+	#group_index:hover{
+		background-color: var(--btn-border-color);
+		color: var(--btn-color);
+		cursor:auto;
+	}
+	</style>
+
+	<?php
+	require_once '../studio/index_tool_bar.php';
+	?>
+		
+	<div class="index_inner" style="    margin-left: 18em;margin-top: 5em;">
+		<div id="channal_list"  class="file_list_block">
+
+			<div class="tool_bar">
+				<div>
+					<span><a href="../group/index.php"><?php echo $_local->gui->group; ?></a></span>
+					<span id="parent_group"></span>
+					<span id="curr_group"></span>
+				</div>
+
+				<div>
+					<span class="icon_btn_div">
+						<span class="icon_btn_tip"><?php echo "Add";?></span>
+						<button id="file_add" type="button" class="icon_btn" title=" "  onclick="group_add_dlg_show()">
+							<svg class="icon">
+								<use xlink:href="../studio/svg/icon.svg#ic_add_circle"></use>
+							</svg>
+						</button>
+						<div id='group_add_div' class="float_dlg"></div>
+					</span>
+					
+					<span class="icon_btn_div">				
+						<span class="icon_btn_tip"><?php echo $_local->gui->recycle_bin;?></span>
+						<button id="to_recycle" type="button" class="icon_btn" onclick="file_del()" title=" ">
+							<svg class="icon">
+								<use xlink:href="../studio/svg/icon.svg#ic_delete"></use>
+							</svg>
+						</button>
+					</span>	
+				</div>
+			</div>
+
+			<div id="my_group_list">		</div>
+			
+		</div>
+		
+	</div>
+	
+<?php
+require_once '../studio/index_foot.php';
+?>
+

+ 18 - 0
app/group/list.php

@@ -0,0 +1,18 @@
+<?php
+//查询group 列表
+
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once '../public/function.php';
+require_once '../ucenter/function.php';
+
+
+	//没有id 列出 我的群组
+    PDO_Connect("sqlite:"._FILE_DB_GROUP_);
+    $query = "SELECT group_name,group_id,power FROM group_member  WHERE level = 0 and user_id=?";
+	$Fetch = PDO_FetchAll($query,array($_COOKIE["userid"]));
+	
+    echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
+
+
+?>

+ 33 - 0
app/group/my_group_put.php

@@ -0,0 +1,33 @@
+<?php
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once '../public/function.php';
+
+$respond=array("status"=>0,"message"=>"");
+if(isset($_COOKIE["userid"])){
+	PDO_Connect("sqlite:"._FILE_DB_GROUP_);
+	$query="INSERT INTO group_info ( id,  parent  , name  , description ,  status , owner ,create_time )  
+	                       VALUES  ( ?, ? , ? , ? , ? , ?  ,? ) ";
+	$sth = $PDO->prepare($query);
+	$newid = UUID::v4();
+	$sth->execute(array( $newid,$_POST["parent"], $_POST["name"], "" ,1 ,$_COOKIE["userid"] , mTime() ));
+	$respond=array("status"=>0,"message"=>"");
+	if (!$sth || ($sth && $sth->errorCode() != 0)) {
+		$error = PDO_ErrorInfo();
+		$respond['status']=1;
+		$respond['message']=$error[2];
+	}	
+
+	$query="INSERT INTO group_member (  user_id  , group_id  , power , group_name , level ,  status )  
+		VALUES  (  ? , ? , ? , ? , ?  ,? ) ";
+	$sth = $PDO->prepare($query);
+	$sth->execute(array($_COOKIE["userid"] ,$newid, 1 , $_POST["name"], 0 ,1 ));
+	$respond=array("status"=>0,"message"=>"");
+	if (!$sth || ($sth && $sth->errorCode() != 0)) {
+	$error = PDO_ErrorInfo();
+	$respond['status']=1;
+	$respond['message']=$error[2];
+	}	
+}
+echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+?>

+ 0 - 0
app/group/post.php


+ 0 - 0
app/group/put.php


+ 33 - 0
app/redis/upgred_pali_sent.php

@@ -0,0 +1,33 @@
+<?php
+/*
+get user sentence from db
+*/
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once "../public/function.php";
+
+
+
+$dns = "sqlite:"._FILE_DB_PALI_SENTENCE_;
+$dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
+$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);  
+
+$query="SELECT book,paragraph, begin,end ,text FROM pali_sent WHERE 1 ";
+$stmt = $dbh->prepare($query);
+$stmt->execute();
+$redis = new redis();  
+$r_conn = $redis->connect('127.0.0.1', 6379);  
+if($r_conn){
+	
+	while($sent = $stmt->fetch(PDO::FETCH_ASSOC)){
+		$result = $redis->set('pali_sent_'.$sent["book"]."_".$sent["paragraph"]."_".$sent["begin"]."_".$sent["end"],$sent["text"]);  
+	}
+	echo "完成";
+}
+else{
+	echo "连接redis失败";
+}
+
+
+
+?>

+ 3 - 3
app/studio/index_recent.php

@@ -187,13 +187,13 @@ require_once '../studio/index_head.php';
 			border-radius: 4px;
 		}
 		</style>
-	<div id="rs_doc_coop_shell">
+	<div id="rs_doc_coop_shell" >
 	<div id="rs_doc_coop_win" >
 	<div id="rs_doc_coop_win_inner" >
 
 	</div>
-	<div id="rs_doc_coop_win_foot" >
-		<button onclick="file_coop_win_close()"><?php echo $_local->gui->poweredby;?></button>
+	<div id="rs_doc_coop_win_foot"  >
+		<button onclick="file_coop_win_close()"><?php echo $_local->gui->finish;?></button>
 	</div>
 	</div>
 	</div>

+ 1 - 1
app/studio/index_tool_bar.php

@@ -43,7 +43,7 @@
 					<?php echo $_local->gui->collaborate;?>
 					</span>
 				</li>
-				<li id="group_index" style="display:none;" onclick="goto_url(this,'../studio/group.php?language=<?php echo $currLanguage; ?>')">
+				<li id="group_index" style="display:none;" onclick="goto_url(this,'../group/group.php?language=<?php echo $currLanguage; ?>')">
 					<span  class="navi_icon">
 						<svg class="icon">
 							<use xlink:href="../studio/svg/icon.svg#ic_two_person"></use>