preview: show errors checkbox

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@193 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2008-11-08 01:07:46 +00:00
parent 55d67ed905
commit 4dba04534a
4 changed files with 18 additions and 2 deletions

View File

@ -245,6 +245,7 @@ page.preview.mailsent=Mail is sent window
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.title=Site style
page.preview.userchat=Chat window (user-mode)
page_agent.create_new=Here you can create new operator

View File

@ -245,6 +245,7 @@ page.preview.mailsent=Mail is sent window
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.title=Ñòèëü ìåññåíäæåðà
page.preview.userchat=Chat window (user-mode)
page_agent.create_new=Ñîçäàíèå íîâîãî îïåðàòîðà

View File

@ -37,7 +37,7 @@ if(!in_array($preview, $stylelist)) {
}
$show = verifyparam("show", "/^(chat|chatsimple|nochat|mail|mailsent|leavemessage|leavemessagesent|redirect|redirected|agentchat|agentrochat)$/", "");
$showerrors = verifyparam("showerr", "/^true$/", "") == "true";
$showerrors = verifyparam("showerr", "/^on$/", "") == "on";
$errors = array();
if($showerrors) {
$errors[] = "Test error";
@ -96,6 +96,8 @@ $template = verifyparam("template", "/^\w+$/", "chat");
$page['formpreview'] = $preview;
$page['formtemplate'] = $template;
$page['canshowerrors'] = $template == 'leavemessage' || $template == 'mail' || $template == 'all';
$page['formshowerr'] = $showerrors;
$page['availablePreviews'] = $stylelist;
$page['availableTemplates'] = array(
"chat", "chatsimple", "nochat",
@ -106,7 +108,7 @@ $page['availableTemplates'] = array(
"all");
$page['operator'] = topage(get_operator_name($operator));
$page['showlink'] = "$webimroot/operator/preview.php?preview=$preview&".($showerrors?"showerr=true&":"")."show=";
$page['showlink'] = "$webimroot/operator/preview.php?preview=$preview&".($showerrors?"showerr=on&":"")."show=";
$page['previewList'] = array();
foreach($templateList as $tpl) {

View File

@ -65,6 +65,18 @@
<select name="template" onchange="this.form.submit();"><?php foreach($page['availableTemplates'] as $k) { echo "<option value=\"".$k."\"".($k == form_value("template") ? " selected=\"selected\"" : "").">".$k."</option>"; } ?></select>
</td>
</tr>
<?php if( $page['canshowerrors'] ) { ?>
<tr><td colspan="3" height="10"></td></tr>
<tr>
<td colspan="3" class="formauth"><?php echo getlocal("page.preview.showerr") ?></td>
</tr>
<tr><td colspan="3" height="2"></td></tr>
<tr>
<td colspan="3">
<input type="checkbox" name="showerr" value="on"<?php echo form_value_cb('showerr') ? " checked=\"checked\"" : "" ?> onchange="this.form.submit();"/>
</td>
</tr>
<?php } ?>
<?php foreach( $page['previewList'] as $pp ) { ?>
<tr><td colspan="3" height="10"></td></tr>
<tr>