move generate_button -> getcode.php

This commit is contained in:
Evgeny Gryaznov 2011-02-26 11:56:17 +01:00
parent 52666eb7c7
commit f3d38642c6
2 changed files with 16 additions and 16 deletions

View File

@ -173,22 +173,6 @@ function append_query($link,$pv) {
return "$link$infix$pv";
}
function generate_button($title,$locale,$style,$group,$inner,$showhost,$forcesecure,$modsecurity) {
$link = get_app_location($showhost,$forcesecure)."/client.php";
if($locale)
$link = append_query($link, "locale=$locale");
if($style)
$link = append_query($link, "style=$style");
if($group)
$link = append_query($link, "group=$group");
$modsecfix = $modsecurity ? ".replace('http://','').replace('https://','')" : "";
$jslink = append_query("'".$link,"url='+escape(document.location.href$modsecfix)+'&referrer='+escape(document.referrer$modsecfix)");
$temp = get_popup($link, "$jslink",
$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 -->";
}
function check_login($redirect=true) {
global $webimroot;
if( !isset( $_SESSION['operator'] ) ) {

View File

@ -23,6 +23,22 @@ require_once('../libs/common.php');
require_once('../libs/operator.php');
require_once('../libs/groups.php');
function generate_button($title,$locale,$style,$group,$inner,$showhost,$forcesecure,$modsecurity) {
$link = get_app_location($showhost,$forcesecure)."/client.php";
if($locale)
$link = append_query($link, "locale=$locale");
if($style)
$link = append_query($link, "style=$style");
if($group)
$link = append_query($link, "group=$group");
$modsecfix = $modsecurity ? ".replace('http://','').replace('https://','')" : "";
$jslink = append_query("'".$link,"url='+escape(document.location.href$modsecfix)+'&amp;referrer='+escape(document.referrer$modsecfix)");
$temp = get_popup($link, "$jslink",
$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 -->";
}
$operator = check_login();
loadsettings();