mirror of
				https://github.com/Mibew/java.git
				synced 2025-10-31 18:41:09 +03:00 
			
		
		
		
	[getcode] select chat-window style
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@195 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
		
							parent
							
								
									39049f8b03
								
							
						
					
					
						commit
						28c33e0714
					
				| @ -19,6 +19,7 @@ require_once('libs/expand.php'); | ||||
| 
 | ||||
| if( !isset($_GET['token']) || !isset($_GET['thread']) ) { | ||||
| 
 | ||||
| 	$chatstyle = verifyparam( "style", "/^\w+$/", ""); | ||||
| 	$thread = NULL; | ||||
| 	if( isset($_SESSION['threadid']) ) { | ||||
| 		$thread = reopen_thread($_SESSION['threadid']); | ||||
| @ -50,7 +51,7 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) { | ||||
| 	$threadid = $thread['threadid']; | ||||
| 	$token = $thread['ltoken']; | ||||
| 	$level = get_remote_level($_SERVER['HTTP_USER_AGENT']); | ||||
| 	header("Location: $webimroot/client.php?thread=$threadid&token=$token&level=$level"); | ||||
| 	header("Location: $webimroot/client.php?thread=$threadid&token=$token&level=$level".($chatstyle ? "&style=$chatstyle" : "")); | ||||
| 	exit; | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -461,6 +461,10 @@ function loadsettings() { | ||||
| 
 | ||||
| function getchatstyle() { | ||||
| 	global $settings; | ||||
| 	$chatstyle = verifyparam( "style", "/^\w+$/", ""); | ||||
| 	if($chatstyle) { | ||||
| 		return $chatstyle; | ||||
| 	} | ||||
| 	loadsettings(); | ||||
| 	return $settings['chatstyle']; | ||||
| } | ||||
|  | ||||
| @ -112,8 +112,8 @@ function get_operator_name($operator) { | ||||
| 		return $operator['vccommonname']; | ||||
| } | ||||
| 
 | ||||
| function generate_button($title,$locale,$inner,$showhost,$forcesecure) { | ||||
| 	$link = get_app_location($showhost,$forcesecure)."/client.php". ($locale?"?locale=".$locale : ""); | ||||
| function generate_button($title,$locale,$style,$inner,$showhost,$forcesecure) { | ||||
| 	$link = get_app_location($showhost,$forcesecure)."/client.php". ($locale?"?locale=$locale" : "").($style ? ($locale?"&":"?")."style=$style" : ""); | ||||
| 	$temp = get_popup($link, $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1" ); | ||||
| 	return "<!-- webim button -->".$temp."<!-- / webim button -->"; | ||||
| } | ||||
|  | ||||
| @ -230,6 +230,7 @@ menu.operator=You are {0} | ||||
| no_such_operator=No such operator | ||||
| page.gen_button.choose_image=Choose image | ||||
| page.gen_button.choose_locale=Target locale | ||||
| page.gen_button.choose_style=Chat window style | ||||
| page.gen_button.include_site_name=Include host name into code | ||||
| page.gen_button.secure_links=Use secure links (https) | ||||
| page.preview.agentchat=Chat window (agent-mode) | ||||
| @ -246,6 +247,7 @@ page.preview.nochat=List of supported browsers window | ||||
| page.preview.redirect=Redirect visitor to another operator window | ||||
| page.preview.redirected=Visitor is redirected window | ||||
| page.preview.showerr=Show errors | ||||
| page.preview.style_default=-from general settings- | ||||
| page.preview.title=Site style | ||||
| page.preview.userchat=Chat window (user-mode) | ||||
| page_agent.create_new=Here you can create new operator | ||||
|  | ||||
| @ -230,6 +230,7 @@ menu.operator= | ||||
| no_such_operator=Çàïðàøèâàåìàÿ ó÷åòíàÿ çàïèñü íå ñóùåñòâóåò | ||||
| page.gen_button.choose_image=Âûáîð êàðòèíêè | ||||
| page.gen_button.choose_locale=Äëÿ êàêîé ëîêàëè ñîçäàâàòü êíîïêó | ||||
| page.gen_button.choose_style=Ñòèëü ÷àò-îêíà | ||||
| page.gen_button.include_site_name=Âêëþ÷àòü èìÿ ñàéòà â êîä | ||||
| page.gen_button.secure_links=Èñïîëüçîâàòü çàùèùåííîå ñîåäèíåíèå (https) | ||||
| page.preview.agentchat=Chat window (agent-mode) | ||||
| @ -246,6 +247,7 @@ page.preview.nochat=List of supported browsers window | ||||
| page.preview.redirect=Redirect visitor to another operator window | ||||
| page.preview.redirected=Visitor is redirected window | ||||
| page.preview.showerr=Îòîáðàçèòü îøèáêè | ||||
| page.preview.style_default=-èç íàñòðîåê ñàéòà- | ||||
| page.preview.title=Ñòèëü ìåññåíäæåðà | ||||
| page.preview.userchat=Chat window (user-mode) | ||||
| page_agent.create_new=Ñîçäàíèå íîâîãî îïåðàòîðà | ||||
|  | ||||
| @ -38,6 +38,22 @@ foreach($available_locales as $curr) { | ||||
| $image = verifyparam("image","/^\w+$/", "webim"); | ||||
| $image_locales = $imageLocales[$image]; | ||||
| 
 | ||||
| $stylelist = array("" => getlocal("page.preview.style_default")); | ||||
| $stylesfolder = "../styles"; | ||||
| if($handle = opendir($stylesfolder)) { | ||||
| 	while (false !== ($file = readdir($handle))) { | ||||
| 		if (preg_match("/^\w+$/", $file) && is_dir("$stylesfolder/$file")) { | ||||
| 			$stylelist[$file] = $file; | ||||
| 		} | ||||
| 	} | ||||
| 	closedir($handle); | ||||
| } | ||||
| 
 | ||||
| $style = verifyparam("style","/^\w*$/", ""); | ||||
| if($style && !in_array($style, $stylelist)) { | ||||
| 	$style = ""; | ||||
| } | ||||
| 
 | ||||
| $showhost = verifyparam("hostname","/^on$/", "") == "on"; | ||||
| $forcesecure = verifyparam("secure","/^on$/", "") == "on"; | ||||
| 
 | ||||
| @ -52,10 +68,12 @@ $message = get_image(get_app_location($showhost,$forcesecure)."/button.php?image | ||||
| 
 | ||||
| $page = array(); | ||||
| $page['operator'] = topage(get_operator_name($operator)); | ||||
| $page['buttonCode'] = generate_button("",$lang,$message,$showhost,$forcesecure); | ||||
| $page['buttonCode'] = generate_button("",$lang,$style,$message,$showhost,$forcesecure); | ||||
| $page['availableImages'] = array_keys($imageLocales); | ||||
| $page['availableLocales'] = $image_locales; | ||||
| $page['availableStyles'] = $stylelist; | ||||
| 
 | ||||
| $page['formstyle'] = $style; | ||||
| $page['formimage'] = $image; | ||||
| $page['formlang'] = $lang; | ||||
| $page['formhostname'] = $showhost; | ||||
|  | ||||
| @ -66,6 +66,16 @@ | ||||
| 		</td> | ||||
| 	</tr> | ||||
| 	<tr><td colspan="3" height="5"></td></tr> | ||||
| 	<tr> | ||||
| 		<td colspan="3" class="formauth"><?php echo getlocal("page.gen_button.choose_style") ?></td>
 | ||||
| 	</tr> | ||||
| 	<tr><td colspan="3" height="2"></td></tr> | ||||
| 	<tr> | ||||
| 		<td colspan="3"> | ||||
| 			<select name="style" onchange="this.form.submit();"><?php foreach($page['availableStyles'] as $k => $v) { echo "<option value=\"".$k."\"".($k == form_value("style") ? " selected=\"selected\"" : "").">".$v."</option>"; } ?></select>
 | ||||
| 		</td> | ||||
| 	</tr> | ||||
| 	<tr><td colspan="3" height="5"></td></tr> | ||||
| 	<tr> | ||||
| 		<td colspan="3" class="formauth"><?php echo getlocal("page.gen_button.include_site_name") ?></td>
 | ||||
| 	</tr> | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user