two-row tab menu, two column options in "generate code", jabber notification option, adjust db

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@717 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2010-01-09 20:58:27 +00:00
parent 5b91e98928
commit 958423ef35
18 changed files with 160 additions and 103 deletions

View File

@ -250,6 +250,7 @@ img.left {
.tabs { .tabs {
float: right; float: right;
margin-left: 15px;
display: inline; display: inline;
margin-right: 15px; margin-right: 15px;
} }
@ -324,11 +325,18 @@ div.errinfo {
font-weight: bold; font-weight: bold;
} }
.field .subfield { .field .subfield .fieldinrow {
padding-left: 30px; padding-left: 30px;
background: url(images/subitem.gif) no-repeat 10px 2px; background: url(images/subitem.gif) no-repeat 10px 2px;
} }
.fieldinrow {
min-width: 300px;
display: inline;
float:left;
width: 45%;
}
.fvalue { .fvalue {
float: left; float: left;
} }

View File

@ -76,6 +76,7 @@ $dbtables = array(
"vcavatar" => "varchar(255)", "vcavatar" => "varchar(255)",
"vcjabbername" => "varchar(255)", "vcjabbername" => "varchar(255)",
"iperm" => "int DEFAULT 65535", "iperm" => "int DEFAULT 65535",
"inotify" => "int DEFAULT 0", /* 0 - none, 1 - jabber */
"dtmrestore" => "datetime DEFAULT 0", "dtmrestore" => "datetime DEFAULT 0",
"vcrestoretoken" => "varchar(64)", "vcrestoretoken" => "varchar(64)",
), ),
@ -117,7 +118,7 @@ $memtables = array();
$dbtables_can_update = array( $dbtables_can_update = array(
"chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid"), "chatthread" => array("agentId", "userTyping", "agentTyping", "messageCount", "nextagent", "shownmessageid", "userid", "userAgent", "groupid"),
"chatmessage" => array("agentId"), "chatmessage" => array("agentId"),
"chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus", "vcemail", "dtmrestore", "vcrestoretoken"), "chatoperator" => array("vcavatar", "vcjabbername", "iperm", "istatus", "vcemail", "dtmrestore", "vcrestoretoken", "inotify"),
"chatban" => array(), "chatban" => array(),
"chatgroup" => array("vcemail"), "chatgroup" => array("vcemail"),
"chatgroupoperator" => array(), "chatgroupoperator" => array(),
@ -161,7 +162,7 @@ function create_table($id,$link) {
mysql_query($query,$link) or show_install_err(' Query failed: '.mysql_error()); mysql_query($query,$link) or show_install_err(' Query failed: '.mysql_error());
if( $id == 'chatoperator' ) { if( $id == 'chatoperator' ) {
create_operator_("admin", "", "", "Administrator", "Administrator", "", $link); create_operator_("admin", "", "", "", "Administrator", "Administrator", 0, $link);
} else if( $id == 'chatrevision' ) { } else if( $id == 'chatrevision' ) {
perform_query("INSERT INTO chatrevision VALUES (1)",$link); perform_query("INSERT INTO chatrevision VALUES (1)",$link);
} }

View File

@ -122,6 +122,10 @@ if ($act == "silentcreateall") {
runsql("ALTER TABLE chatoperator ADD istatus int DEFAULT 0", $link); runsql("ALTER TABLE chatoperator ADD istatus int DEFAULT 0", $link);
} }
if( in_array("chatoperator.inotify", $absent) ) {
runsql("ALTER TABLE chatoperator ADD inotify int DEFAULT 0", $link);
}
if( in_array("chatoperator.vcavatar", $absent) ) { if( in_array("chatoperator.vcavatar", $absent) ) {
runsql("ALTER TABLE chatoperator ADD vcavatar varchar(255)", $link); runsql("ALTER TABLE chatoperator ADD vcavatar varchar(255)", $link);
} }

View File

@ -61,18 +61,19 @@ function operator_by_id($id) {
return $operator; return $operator;
} }
function update_operator($operatorid,$login,$email,$password,$localename,$commonname) { function update_operator($operatorid,$login,$email,$jabber,$password,$localename,$commonname,$notify) {
$link = connect(); $link = connect();
$query = sprintf( $query = sprintf(
"update chatoperator set vclogin = '%s',%s vclocalename = '%s', vccommonname = '%s'". "update chatoperator set vclogin = '%s',%s vclocalename = '%s', vccommonname = '%s'".
", vcemail = '%s', vcjabbername= '%s'". ", vcemail = '%s', vcjabbername= '%s', inotify = %s".
" where operatorid = %s", " where operatorid = %s",
mysql_real_escape_string($login), mysql_real_escape_string($login),
($password ? " vcpassword='".md5($password)."'," : ""), ($password ? " vcpassword='".md5($password)."'," : ""),
mysql_real_escape_string($localename), mysql_real_escape_string($localename),
mysql_real_escape_string($commonname), mysql_real_escape_string($commonname),
mysql_real_escape_string($email), mysql_real_escape_string($email),
'', mysql_real_escape_string($jabber),
$notify,
$operatorid ); $operatorid );
perform_query($query,$link); perform_query($query,$link);
@ -89,15 +90,17 @@ function update_operator_avatar($operatorid,$avatar) {
mysql_close($link); mysql_close($link);
} }
function create_operator_($login,$email,$password,$localename,$commonname,$avatar,$link) { function create_operator_($login,$email,$jabber,$password,$localename,$commonname,$notify,$link) {
$query = sprintf( $query = sprintf(
"insert into chatoperator (vclogin,vcpassword,vclocalename,vccommonname,vcavatar,vcemail,vcjabbername) values ('%s','%s','%s','%s','%s','%s','%s')", "insert into chatoperator (vclogin,vcpassword,vclocalename,vccommonname,vcavatar,vcemail,vcjabbername,inotify) values ('%s','%s','%s','%s','%s','%s','%s',%s)",
mysql_real_escape_string($login), mysql_real_escape_string($login),
md5($password), md5($password),
mysql_real_escape_string($localename), mysql_real_escape_string($localename),
mysql_real_escape_string($commonname), mysql_real_escape_string($commonname),
mysql_real_escape_string($avatar), '' /* no avatar */,
mysql_real_escape_string($email), ''); mysql_real_escape_string($email),
mysql_real_escape_string($jabber),
$notify);
perform_query($query,$link); perform_query($query,$link);
$id = mysql_insert_id($link); $id = mysql_insert_id($link);
@ -105,9 +108,9 @@ function create_operator_($login,$email,$password,$localename,$commonname,$avata
return select_one_row("select * from chatoperator where operatorid = $id", $link ); return select_one_row("select * from chatoperator where operatorid = $id", $link );
} }
function create_operator($login,$email,$password,$localename,$commonname,$avatar) { function create_operator($login,$email,$jabber,$password,$localename,$commonname,$notify) {
$link = connect(); $link = connect();
$newop = create_operator_($login,$email,$password,$localename,$commonname,$avatar,$link); $newop = create_operator_($login,$email,$jabber,$password,$localename,$commonname,$notify,$link);
mysql_close($link); mysql_close($link);
return $newop; return $newop;
} }

View File

@ -24,19 +24,21 @@ function setup_operator_settings_tabs($opId, $active) {
loadsettings(); loadsettings();
if($opId) { if($opId) {
$page['tabselected'] = $active;
if($settings['enablegroups'] == '1') { if($settings['enablegroups'] == '1') {
$page['tabs'] = array( $page['tabs'] = array(
getlocal("page_agent.tab.main") => $active != 0 ? "$webimroot/operator/operator.php?op=$opId" : "", array('title'=> getlocal("page_agent.tab.main"), 'link' => "$webimroot/operator/operator.php?op=$opId"),
getlocal("page_agent.tab.avatar") => $active != 1 ? "$webimroot/operator/avatar.php?op=$opId" : "", array('title'=> getlocal("page_agent.tab.avatar"), 'link' => "$webimroot/operator/avatar.php?op=$opId"),
getlocal("page_agent.tab.groups") => $active != 2 ? "$webimroot/operator/opgroups.php?op=$opId" : "", array('title'=> getlocal("page_agent.tab.groups"), 'link' => "$webimroot/operator/opgroups.php?op=$opId"),
getlocal("page_agent.tab.permissions") => $active != 3 ? "$webimroot/operator/permissions.php?op=$opId" : "" array('title'=> getlocal("page_agent.tab.permissions"), 'link' => "$webimroot/operator/permissions.php?op=$opId"),
); );
} else { } else {
$page['tabs'] = array( $page['tabs'] = array(
getlocal("page_agent.tab.main") => $active != 0 ? "$webimroot/operator/operator.php?op=$opId" : "", array('title'=> getlocal("page_agent.tab.main"), 'link' => "$webimroot/operator/operator.php?op=$opId"),
getlocal("page_agent.tab.avatar") => $active != 1 ? "$webimroot/operator/avatar.php?op=$opId" : "", array('title'=> getlocal("page_agent.tab.avatar"), 'link' => "$webimroot/operator/avatar.php?op=$opId"),
getlocal("page_agent.tab.permissions") => $active != 3 ? "$webimroot/operator/permissions.php?op=$opId" : "" array('title'=> getlocal("page_agent.tab.permissions"), 'link' => "$webimroot/operator/permissions.php?op=$opId"),
); );
if($active == 3) $active--;
} }
} else { } else {
$page['tabs'] = array(); $page['tabs'] = array();

View File

@ -35,11 +35,12 @@ function update_settings() {
function setup_settings_tabs($active) { function setup_settings_tabs($active) {
global $page, $webimroot; global $page, $webimroot;
$page['tabselected'] = $active;
$page['tabs'] = array( $page['tabs'] = array(
getlocal("page_settings.tab.main") => $active != 0 ? "$webimroot/operator/settings.php" : "", array('title'=> getlocal("page_settings.tab.main"), 'link' => "$webimroot/operator/settings.php"),
getlocal("page_settings.tab.features") => $active != 1 ? "$webimroot/operator/features.php" : "", array('title'=> getlocal("page_settings.tab.features"), 'link' => "$webimroot/operator/features.php"),
getlocal("page_settings.tab.performance") => $active != 2 ? "$webimroot/operator/performance.php" : "", array('title'=> getlocal("page_settings.tab.performance"), 'link' => "$webimroot/operator/performance.php"),
getlocal("page_settings.tab.themes") => $active != 3 ? "$webimroot/operator/themes.php" : "", array('title'=> getlocal("page_settings.tab.themes"), 'link' => "$webimroot/operator/themes.php"),
); );
} }

View File

@ -146,6 +146,10 @@ form.field.groupdesc.description=Description of the group.
form.field.groupdesc=Description form.field.groupdesc=Description
form.field.groupname.description=Name to identify the group. form.field.groupname.description=Name to identify the group.
form.field.groupname=Name form.field.groupname=Name
form.field.jabber.description=For instant notifications
form.field.jabbernotify.description=deliver via Jabber (instant)
form.field.jabbernotify=Notification of new visitor
form.field.jabber=Jabber ID
form.field.login.description=Login can consist of small Latin letters and underscore. form.field.login.description=Login can consist of small Latin letters and underscore.
form.field.login=Login form.field.login=Login
form.field.mail.description=For notifications and password retrieval. form.field.mail.description=For notifications and password retrieval.

View File

@ -33,10 +33,12 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
$opId = verifyparam( "opid", "/^(\d{1,9})?$/", ""); $opId = verifyparam( "opid", "/^(\d{1,9})?$/", "");
$login = getparam('login'); $login = getparam('login');
$email = getparam('email'); $email = getparam('email');
$jabber = getparam('jabber');
$password = getparam('password'); $password = getparam('password');
$passwordConfirm = getparam('passwordConfirm'); $passwordConfirm = getparam('passwordConfirm');
$localname = getparam('name'); $localname = getparam('name');
$commonname = getparam('commonname'); $commonname = getparam('commonname');
$jabbernotify = verifyparam("jabbernotify","/^on$/", "") == "on";
if( !$localname ) if( !$localname )
$errors[] = no_field("form.field.agent_name"); $errors[] = no_field("form.field.agent_name");
@ -53,6 +55,12 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
if($email != '' && !is_valid_email($email)) if($email != '' && !is_valid_email($email))
$errors[] = wrong_field("form.field.mail"); $errors[] = wrong_field("form.field.mail");
if($jabber != '' && !is_valid_email($jabber))
$errors[] = wrong_field("form.field.jabber");
if($jabbernotify && $jabber == '')
$errors[] = no_field("form.field.jabber");
if( !$opId && !$password ) if( !$opId && !$password )
$errors[] = no_field("form.field.password"); $errors[] = no_field("form.field.password");
@ -72,11 +80,11 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
if( count($errors) == 0 ) { if( count($errors) == 0 ) {
if (!$opId) { if (!$opId) {
$newop = create_operator($login,$email,$password,$localname,$commonname,""); $newop = create_operator($login,$email,$jabber,$password,$localname,$commonname,$jabbernotify ? 1 : 0);
header("Location: $webimroot/operator/avatar.php?op=".$newop['operatorid']); header("Location: $webimroot/operator/avatar.php?op=".$newop['operatorid']);
exit; exit;
} else { } else {
update_operator($opId,$login,$email,$password,$localname,$commonname); update_operator($opId,$login,$email,$jabber,$password,$localname,$commonname,$jabbernotify ? 1 : 0);
header("Location: $webimroot/operator/operator.php?op=$opId&stored"); header("Location: $webimroot/operator/operator.php?op=$opId&stored");
exit; exit;
} }
@ -84,6 +92,8 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
$page['formlogin'] = topage($login); $page['formlogin'] = topage($login);
$page['formname'] = topage($localname); $page['formname'] = topage($localname);
$page['formemail'] = topage($email); $page['formemail'] = topage($email);
$page['formjabber'] = topage($jabber);
$page['formjabbernotify'] = $jabbernotify;
$page['formcommonname'] = topage($commonname); $page['formcommonname'] = topage($commonname);
$page['opid'] = topage($opId); $page['opid'] = topage($opId);
} }
@ -99,6 +109,8 @@ if( isset($_POST['login']) && isset($_POST['password']) ) {
$page['formlogin'] = topage($op['vclogin']); $page['formlogin'] = topage($op['vclogin']);
$page['formname'] = topage($op['vclocalename']); $page['formname'] = topage($op['vclocalename']);
$page['formemail'] = topage($op['vcemail']); $page['formemail'] = topage($op['vcemail']);
$page['formjabber'] = topage($op['vcjabbername']);
$page['formjabbernotify'] = $op['inotify'] != 0;
$page['formcommonname'] = topage($op['vccommonname']); $page['formcommonname'] = topage($op['vccommonname']);
$page['opid'] = topage($op['operatorid']); $page['opid'] = topage($op['operatorid']);
} }

View File

@ -20,6 +20,7 @@
*/ */
require_once("inc_menu.php"); require_once("inc_menu.php");
require_once("inc_tabbar.php");
$page['title'] = getlocal("page_agent.title"); $page['title'] = getlocal("page_agent.title");
$page['menuid'] = $page['opid'] == $page['currentopid'] ? "profile" : "operators"; $page['menuid'] = $page['opid'] == $page['currentopid'] ? "profile" : "operators";
@ -45,15 +46,7 @@ require_once('inc_errors.php');
<form name="agentForm" method="post" action="<?php echo $webimroot ?>/operator/operator.php"> <form name="agentForm" method="post" action="<?php echo $webimroot ?>/operator/operator.php">
<input type="hidden" name="opid" value="<?php echo $page['opid'] ?>"/> <input type="hidden" name="opid" value="<?php echo $page['opid'] ?>"/>
<div> <div>
<?php if($page['tabs']) { ?> <?php print_tabbar(); ?>
<ul class="tabs">
<?php foreach($page['tabs'] as $k => $v) { if($v) { ?>
<li><a href="<?php echo $v ?>"><?php echo $k ?></a></li>
<?php } else { ?>
<li class="active"><a href="#"><?php echo $k ?></a></li><?php }} ?>
</ul>
<?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<div class="fieldForm"> <div class="fieldForm">
@ -111,6 +104,24 @@ require_once('inc_errors.php');
<br clear="all"/> <br clear="all"/>
</div> </div>
<div class="field">
<div class="flabel"><?php echo getlocal('form.field.jabber') ?></div>
<div class="fvalue">
<input type="text" name="jabber" size="40" value="<?php echo form_value('jabber') ?>" class="formauth"<?php echo $page['canmodify'] ? "" : " disabled=\"disabled\"" ?>/>
</div>
<div class="fdescr"> &mdash; <?php echo getlocal('form.field.jabber.description') ?></div>
<br clear="all"/>
</div>
<div class="field" style="padding-top:0.3em;">
<div class="flabel"><?php echo getlocal('form.field.jabbernotify') ?></div>
<div class="fvalue">
<input type="checkbox" name="jabbernotify" value="on"<?php echo form_value_cb('jabbernotify') ? " checked=\"checked\"" : "" ?><?php echo $page['canmodify'] ? "" : " disabled=\"disabled\"" ?>/>
</div>
<div class="fdescr"> &mdash; <?php echo getlocal('form.field.jabbernotify.description') ?></div>
<br clear="all"/>
</div>
<?php if($page['canmodify']) { ?> <?php if($page['canmodify']) { ?>
<div class="fbutton"> <div class="fbutton">
<input type="image" name="save" value="" src='<?php echo $webimroot.getlocal("image.button.save") ?>' alt='<?php echo getlocal("button.save") ?>'/> <input type="image" name="save" value="" src='<?php echo $webimroot.getlocal("image.button.save") ?>' alt='<?php echo getlocal("button.save") ?>'/>

View File

@ -20,6 +20,7 @@
*/ */
require_once("inc_menu.php"); require_once("inc_menu.php");
require_once("inc_tabbar.php");
$page['title'] = getlocal("page_avatar.title"); $page['title'] = getlocal("page_avatar.title");
$page['menuid'] = $page['opid'] == $page['currentopid'] ? "profile" : "operators"; $page['menuid'] = $page['opid'] == $page['currentopid'] ? "profile" : "operators";
@ -36,15 +37,7 @@ require_once('inc_errors.php');
<form name="avatarForm" method="post" action="<?php echo $webimroot ?>/operator/avatar.php" enctype="multipart/form-data"> <form name="avatarForm" method="post" action="<?php echo $webimroot ?>/operator/avatar.php" enctype="multipart/form-data">
<input type="hidden" name="op" value="<?php echo $page['opid'] ?>"/> <input type="hidden" name="op" value="<?php echo $page['opid'] ?>"/>
<div> <div>
<?php if($page['tabs']) { ?> <?php print_tabbar(); ?>
<ul class="tabs">
<?php foreach($page['tabs'] as $k => $v) { if($v) { ?>
<li><a href="<?php echo $v ?>"><?php echo $k ?></a></li>
<?php } else { ?>
<li class="active"><a href="#"><?php echo $k ?></a></li><?php }} ?>
</ul>
<?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<p> <p>

View File

@ -20,6 +20,7 @@
*/ */
require_once("inc_menu.php"); require_once("inc_menu.php");
require_once("inc_tabbar.php");
$page['title'] = getlocal("settings.title"); $page['title'] = getlocal("settings.title");
$page['menuid'] = "settings"; $page['menuid'] = "settings";
@ -73,15 +74,7 @@ require_once('inc_errors.php');
<form name="features" method="post" action="<?php echo $webimroot ?>/operator/features.php"> <form name="features" method="post" action="<?php echo $webimroot ?>/operator/features.php">
<input type="hidden" name="sent" value="true"/> <input type="hidden" name="sent" value="true"/>
<div> <div>
<?php if($page['tabs']) { ?> <?php print_tabbar(); ?>
<ul class="tabs">
<?php foreach($page['tabs'] as $k => $v) { if($v) { ?>
<li><a href="<?php echo $v ?>"><?php echo $k ?></a></li>
<?php } else { ?>
<li class="active"><a href="#"><?php echo $k ?></a></li><?php }} ?>
</ul>
<?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<div class="fieldForm"> <div class="fieldForm">

View File

@ -37,22 +37,24 @@ require_once('inc_errors.php');
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<div class="fieldForm"> <div class="fieldForm">
<div class="field">
<div class="fieldinrow">
<div class="flabel"><?php echo getlocal("page.gen_button.choose_locale") ?></div> <div class="flabel"><?php echo getlocal("page.gen_button.choose_locale") ?></div>
<div class="fvaluenodesc"> <div class="fvaluenodesc">
<select name="lang" onchange="this.form.submit();"><?php foreach($page['availableLocales'] as $k) { echo "<option value=\"".$k."\"".($k == form_value("lang") ? " selected=\"selected\"" : "").">".$k."</option>"; } ?></select> <select name="lang" onchange="this.form.submit();"><?php foreach($page['availableLocales'] as $k) { echo "<option value=\"".$k."\"".($k == form_value("lang") ? " selected=\"selected\"" : "").">".$k."</option>"; } ?></select>
</div> </div>
</div> </div>
<div class="field"> <div class="fieldinrow">
<div class="flabel"><?php echo getlocal("page.gen_button.choose_image") ?></div> <div class="flabel"><?php echo getlocal("page.gen_button.choose_image") ?></div>
<div class="fvaluenodesc"> <div class="fvaluenodesc">
<select name="i" onchange="this.form.submit();"><?php foreach($page['availableImages'] as $k) { echo "<option value=\"".$k."\"".($k == form_value("image") ? " selected=\"selected\"" : "").">".$k."</option>"; } ?></select> <select name="i" onchange="this.form.submit();"><?php foreach($page['availableImages'] as $k) { echo "<option value=\"".$k."\"".($k == form_value("image") ? " selected=\"selected\"" : "").">".$k."</option>"; } ?></select>
</div> </div>
</div> </div>
<br clear="all"/>
<?php if($page['showgroups']) { ?> <?php if($page['showgroups']) { ?>
<div class="field"> <div class="fieldinrow">
<div class="flabel"><?php echo getlocal("page.gen_button.choose_group") ?></div> <div class="flabel"><?php echo getlocal("page.gen_button.choose_group") ?></div>
<div class="fvaluenodesc"> <div class="fvaluenodesc">
<select name="group" onchange="this.form.submit();"><?php foreach($page['groups'] as $k) { echo "<option value=\"".$k['groupid']."\"".($k['groupid'] == form_value("group") ? " selected=\"selected\"" : "").">".$k['vclocalname']."</option>"; } ?></select> <select name="group" onchange="this.form.submit();"><?php foreach($page['groups'] as $k) { echo "<option value=\"".$k['groupid']."\"".($k['groupid'] == form_value("group") ? " selected=\"selected\"" : "").">".$k['vclocalname']."</option>"; } ?></select>
@ -60,14 +62,15 @@ require_once('inc_errors.php');
</div> </div>
<?php } ?> <?php } ?>
<div class="field"> <div class="fieldinrow">
<div class="flabel"><?php echo getlocal("page.gen_button.choose_style") ?></div> <div class="flabel"><?php echo getlocal("page.gen_button.choose_style") ?></div>
<div class="fvaluenodesc"> <div class="fvaluenodesc">
<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> <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>
</div> </div>
</div> </div>
<br clear="all"/>
<div class="field"> <div class="fieldinrow">
<div class="flabel"><?php echo getlocal("page.gen_button.include_site_name") ?></div> <div class="flabel"><?php echo getlocal("page.gen_button.include_site_name") ?></div>
<div class="fvaluenodesc"> <div class="fvaluenodesc">
<input type="checkbox" name="hostname" value="on"<?php echo form_value_cb('hostname') ? " checked=\"checked\"" : "" ?> onchange="this.form.submit();"/> <input type="checkbox" name="hostname" value="on"<?php echo form_value_cb('hostname') ? " checked=\"checked\"" : "" ?> onchange="this.form.submit();"/>
@ -76,13 +79,14 @@ require_once('inc_errors.php');
<?php if( $page['formhostname'] ) { ?> <?php if( $page['formhostname'] ) { ?>
<div class="field"> <div class="fieldinrow">
<div class="flabel"><?php echo getlocal("page.gen_button.secure_links") ?></div> <div class="flabel"><?php echo getlocal("page.gen_button.secure_links") ?></div>
<div class="fvaluenodesc"> <div class="fvaluenodesc">
<input type="checkbox" name="secure" value="on"<?php echo form_value_cb('secure') ? " checked=\"checked\"" : "" ?> onchange="this.form.submit();"/> <input type="checkbox" name="secure" value="on"<?php echo form_value_cb('secure') ? " checked=\"checked\"" : "" ?> onchange="this.form.submit();"/>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
<br clear="all"/>
<div class="field"> <div class="field">
<div class="flabel"><?php echo getlocal("page.gen_button.modsecurity") ?></div> <div class="flabel"><?php echo getlocal("page.gen_button.modsecurity") ?></div>

View File

@ -0,0 +1,56 @@
<?php
/*
* This file is part of Mibew Messenger project.
*
* Copyright (c) 2005-2010 Mibew Messenger Community
* All rights reserved. The contents of this file are subject to the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and
* is available at http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU General Public License Version 2 or later (the "GPL"), in which case
* the provisions of the GPL are applicable instead of those above. If you wish
* to allow use of your version of this file only under the terms of the GPL, and
* not to allow others to use your version of this file under the terms of the
* EPL, indicate your decision by deleting the provisions above and replace them
* with the notice and other provisions required by the GPL.
*
* Contributors:
* Evgeny Gryaznov - initial API and implementation
*/
function print_tabbar($maxwidth = 4) {
global $page;
if($page['tabs']) {
$tabbar = $page['tabs'];
$len = count($tabbar);
$selected = $page['tabselected'];
$tabbar2 = array();
for($i = 0; $i < $len; $i++) {
$tabbar2[] = $i != $selected
? "<li><a href=\"".$tabbar[$i]['link']."\">".$tabbar[$i]['title']."</a></li>\n"
: "<li class=\"active\"><a href=\"#\">".$tabbar[$i]['title']."</a></li>\n";
}
if($len > $maxwidth) { // && $len - $selected > $maxwidth
if($selected < $maxwidth) {
$tabbar = array_splice($tabbar2, 0, $maxwidth);
array_splice($tabbar2, count($tabbar2),0, $tabbar);
} // else 3 rows menu
}
echo "<ul class=\"tabs\">\n";
$i = 0;
foreach($tabbar2 as $v) {
if($i > 0 && (($len-$i)%$maxwidth) == 0) {
echo "</ul><br clear=\"all\"><ul class=\"tabs\">\n";
}
echo $v;
$i++;
}
echo "</ul>";
}
}
?>

View File

@ -20,6 +20,7 @@
*/ */
require_once("inc_menu.php"); require_once("inc_menu.php");
require_once("inc_tabbar.php");
$page['title'] = getlocal("operator.groups.title"); $page['title'] = getlocal("operator.groups.title");
$page['menuid'] = $page['opid'] == $page['currentopid'] ? "profile" : "operators"; $page['menuid'] = $page['opid'] == $page['currentopid'] ? "profile" : "operators";
@ -39,15 +40,7 @@ require_once('inc_errors.php');
<form name="opgroupsForm" method="post" action="<?php echo $webimroot ?>/operator/opgroups.php"> <form name="opgroupsForm" method="post" action="<?php echo $webimroot ?>/operator/opgroups.php">
<input type="hidden" name="op" value="<?php echo $page['opid'] ?>"/> <input type="hidden" name="op" value="<?php echo $page['opid'] ?>"/>
<div> <div>
<?php if($page['tabs']) { ?> <?php print_tabbar(); ?>
<ul class="tabs">
<?php foreach($page['tabs'] as $k => $v) { if($v) { ?>
<li><a href="<?php echo $v ?>"><?php echo $k ?></a></li>
<?php } else { ?>
<li class="active"><a href="#"><?php echo $k ?></a></li><?php }} ?>
</ul>
<?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<p> <p>

View File

@ -20,6 +20,7 @@
*/ */
require_once("inc_menu.php"); require_once("inc_menu.php");
require_once("inc_tabbar.php");
$page['title'] = getlocal("settings.title"); $page['title'] = getlocal("settings.title");
$page['menuid'] = "settings"; $page['menuid'] = "settings";
@ -39,15 +40,7 @@ require_once('inc_errors.php');
<form name="performance" method="post" action="<?php echo $webimroot ?>/operator/performance.php"> <form name="performance" method="post" action="<?php echo $webimroot ?>/operator/performance.php">
<div> <div>
<?php if($page['tabs']) { ?> <?php print_tabbar(); ?>
<ul class="tabs">
<?php foreach($page['tabs'] as $k => $v) { if($v) { ?>
<li><a href="<?php echo $v ?>"><?php echo $k ?></a></li>
<?php } else { ?>
<li class="active"><a href="#"><?php echo $k ?></a></li><?php }} ?>
</ul>
<?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<div class="fieldForm"> <div class="fieldForm">

View File

@ -20,6 +20,7 @@
*/ */
require_once("inc_menu.php"); require_once("inc_menu.php");
require_once("inc_tabbar.php");
$page['title'] = getlocal("permissions.title"); $page['title'] = getlocal("permissions.title");
$page['menuid'] = $page['opid'] == $page['currentopid'] ? "profile" : "operators"; $page['menuid'] = $page['opid'] == $page['currentopid'] ? "profile" : "operators";
@ -39,15 +40,7 @@ require_once('inc_errors.php');
<form name="permissionsForm" method="post" action="<?php echo $webimroot ?>/operator/permissions.php"> <form name="permissionsForm" method="post" action="<?php echo $webimroot ?>/operator/permissions.php">
<input type="hidden" name="op" value="<?php echo $page['opid'] ?>"/> <input type="hidden" name="op" value="<?php echo $page['opid'] ?>"/>
<div> <div>
<?php if($page['tabs']) { ?> <?php print_tabbar(); ?>
<ul class="tabs">
<?php foreach($page['tabs'] as $k => $v) { if($v) { ?>
<li><a href="<?php echo $v ?>"><?php echo $k ?></a></li>
<?php } else { ?>
<li class="active"><a href="#"><?php echo $k ?></a></li><?php }} ?>
</ul>
<?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<p> <p>

View File

@ -20,6 +20,7 @@
*/ */
require_once("inc_menu.php"); require_once("inc_menu.php");
require_once("inc_tabbar.php");
$page['title'] = getlocal("settings.title"); $page['title'] = getlocal("settings.title");
$page['menuid'] = "settings"; $page['menuid'] = "settings";
@ -39,15 +40,7 @@ require_once('inc_errors.php');
<form name="settings" method="post" action="<?php echo $webimroot ?>/operator/settings.php"> <form name="settings" method="post" action="<?php echo $webimroot ?>/operator/settings.php">
<div> <div>
<?php if($page['tabs']) { ?> <?php print_tabbar(); ?>
<ul class="tabs">
<?php foreach($page['tabs'] as $k => $v) { if($v) { ?>
<li><a href="<?php echo $v ?>"><?php echo $k ?></a></li>
<?php } else { ?>
<li class="active"><a href="#"><?php echo $k ?></a></li><?php }} ?>
</ul>
<?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<div class="fieldForm"> <div class="fieldForm">

View File

@ -20,6 +20,7 @@
*/ */
require_once("inc_menu.php"); require_once("inc_menu.php");
require_once("inc_tabbar.php");
$page['title'] = getlocal("page.preview.title"); $page['title'] = getlocal("page.preview.title");
$page['menuid'] = "settings"; $page['menuid'] = "settings";
@ -32,15 +33,7 @@ function tpl_content() { global $page, $webimroot;
<form name="preview" method="get" action="<?php echo $webimroot ?>/operator/themes.php"> <form name="preview" method="get" action="<?php echo $webimroot ?>/operator/themes.php">
<div> <div>
<?php if($page['tabs']) { ?> <?php print_tabbar(); ?>
<ul class="tabs">
<?php foreach($page['tabs'] as $k => $v) { if($v) { ?>
<li><a href="<?php echo $v ?>"><?php echo $k ?></a></li>
<?php } else { ?>
<li class="active"><a href="#"><?php echo $k ?></a></li><?php }} ?>
</ul>
<?php } ?>
<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner"> <div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
<div class="fieldForm"> <div class="fieldForm">