<patTemplate:tmpl name="addimage">
<html style="width: 400;">
<head>
<title>Inserir imagem</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="editors/htmlarea/popups/popup.js"></script>
<script type="text/javascript" src="util.js"></script>
<script type="text/javascript" src="tip.js"></script>
<script type="text/javascript">
window.resizeTo(400, 100);
function Init() {
__dlg_init();
document.getElementById("url").focus();
document.ImageAdded = ImageAdded;
document._WndToClose = new Array;
}
function Destructor()
{
if (document._WndToClose)
for (var i in document._WndToClose)
document._WndToClose[i].close();
}
/**
* Abre pop para upload de imagem
*/
function AddImage()
{
window.open("?m=noticia&action=uploadimage", "addimage", "width=315, height=170, resizable=yes, status=false, menubar=false")
}
/**
* Callback para upload de imagem
* @param nome Nome da imagem
* @param url URL da imagem
* @param select Seleciona a imagem depois de adiciona-la a combobox
* @param width Largura da imagem
* @param height Altura da imagem
*/
function ImageAdded(nome, url, select, width, height)
{
oObj = document.getElementById("url");
var i = oObj.options.length;
oObj.options[i] = new Option(nome);
oObj.options[i].value = url+"|"+width+"|"+height;
oObj.options[i].selected = select;
// Adiciona a imagem a lista de imagens na capa
window.opener.document.ImageAdded(nome, url, false);
}
function onOK() {
var required = {
"url": "Você precisa escolher uma imagem."
};
// Verifica os campos obrigatórios
for (var i in required)
{
var el = document.getElementById(i);
if (!el.value) {
window.alert(required[i]);
el.focus();
return false;
}
}
// Prepara os parametros que serão repassados para a janela pai
var param = new Object();
param["legenda"] = document.getElementById("legenda").value;
param["alinhamento"] = document.getElementById("alinhamento").value;
param["borda"] = document.getElementById("borda").value;
param["hspace"] = document.getElementById("hspace").value;
param["vspace"] = document.getElementById("vspace").value;
var aTemp = document.getElementById("url").value.split("|");
param["url"] = aTemp[0];
param["width"] = aTemp[1];
param["height"] = aTemp[2];
// Fecha as janelas que abriu
for (var i in document._WndToClose)
document._WndToClose[i].close();
__dlg_close(param);
return false;
}
function onCancel() {
// Fecha as janelas que abriu
for (var i in document._WndToClose)
document._WndToClose[i].close();
__dlg_close(null);
return false;
}
</script>
</head>
<body onload="Init()" onunload="Destructor();" class="content" style="margin: 0px;">
<div style="background-color: white;">
<div class="b1_title" style="padding: 10px;">Inserir imagem</div>
</div>
<div class="horizontalline"><img src="img/px.gif" width="1" height="1" alt="" border="0"></div>
<div style="padding: 10px;">
Para adicionar uma imagem a notícia você precisa apenas selecionar uma das imagens abaixo, escolher as opções de alinhamento, borda e espaçamento e apertar o botão OK.<br /><br />
Caso não exista nenhuma imagem na lista, você precisa antes envia-lá para o sistema, na parte inferior da janela há informações de como fazer isso, após enviada ao sistema a imagem aparecerá na lista para que você possa adiciona-la à notícia.
<patTemplate:tmpl name="error" visibility="hidden">
<p class="error">{ERROR}</p>
</patTemplate:tmpl>
<form action="" method="get">
<table class="formtable" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Imagem:</td>
<td>
<select name="url" id="url">
<option value="" selected>selecionar</option>
<patTemplate:tmpl name="imagens">
<option value="{URL}" {SELECTED}>{NOME}</option>
</patTemplate:tmpl>
</select>
<input type="button" class="button" value="Adicionar Imagem" onclick="AddImage();" />
<img src="img/ic_help.gif" width="11" height="11" border="0" alt="" onMouseOver="DisplayTip('Imagem que você deseja inserir na notícia.');" onMouseOut="HideTip();">
<img src="img/ic_required.gif" width="11" height="11" border="0" alt="">
</td>
</tr>
<tr>
<td>Legenda:</td>
<td><input type="text" name="legenda" id="legenda">
<img src="img/ic_help.gif" width="11" height="11" border="0" alt="" onMouseOver="DisplayTip('Legenda para a imagem');" onMouseOut="HideTip();">
</td>
</tr>
</table>
<p></p>
<table border="0" cellspacing="0" cellpadding="0" width="370">
<tr>
<td width="49%">
<fieldset>
<legend>Layout</legend>
<div style="margin: 5px;">
<div>Alinhamento:</div>
<select size="1" name="alinhamento" id="alinhamento">
<option value="" >Not set</option>
<option value="left" >Left</option>
<option value="right" >Right</option>
<option value="texttop" >Texttop</option>
<option value="absmiddle" >Absmiddle</option>
<option value="baseline" selected="1" >Baseline</option>
<option value="absbottom" >Absbottom</option>
<option value="bottom" >Bottom</option>
<option value="middle" >Middle</option>
<option value="top" >Top</option>
</select>
<img src="img/ic_help.gif" width="11" height="11" border="0" alt="" onMouseOver="DisplayTip('Alinhamento da imagem.');" onMouseOut="HideTip();">
<p></p>
<div>Largura da borda:</div>
<input type="text" name="borda" id="borda" size="5">
<img src="img/ic_help.gif" width="11" height="11" border="0" alt="" onMouseOver="DisplayTip('Largura da borda da imagem.');" onMouseOut="HideTip();">
</div>
</fieldset>
</td>
<td width="2%"></td>
<td width="49%">
<fieldset>
<legend>Espaçamento</legend>
<div style="margin: 5px;">
<div>Horizontal:</div>
<input type="text" name="hspace" id="hspace" size="5" />
<img src="img/ic_help.gif" width="11" height="11" border="0" alt="" onMouseOver="DisplayTip('Espaçamento entre as laterais da imagem e o texto.');" onMouseOut="HideTip();" />
<p></p>
<div class="fr">Vertical:</div>
<input type="text" name="vspace" id="vspace" size="5" />
<img src="img/ic_help.gif" width="11" height="11" border="0" alt="" onMouseOver="DisplayTip('Espaçamento entre a parte superior e inferior da imagem e o texto.');" onMouseOut="HideTip();">
</div>
</fieldset>
</td>
</tr>
</table>
<div style="padding-top: 5px; padding-bottom: 5px;">
<input type="button" class="button" onclick="return onOK();" value="Ok">
<input type="button" value="Cancelar" class="button" onclick="return onCancel();">
</div>
<div id="tiplayer">
<table width="150" border="0" cellpadding="0" cellspacing="0" class="tip">
<tr class="tip">
<td><img src="img/tip_ctl.gif" width="10" height="22" alt="" border="0"></td>
<td style="background: url(img/tip_bg_t.gif);" valign="top" width="100%" class="lighttitle">Dica:</td>
<td><img src="img/tip_ctr.gif" width="11" height="22" alt="" border="0"></td>
</tr>
<td background="img/tip_bg_l.gif"><img src="img/px.gif" width="10" height="1" alt="" border="0"></td>
<td id="tipmessage" style="background-color: #FFFFFF;" class="tip">TIP</td>
<td background="img/tip_bg_r.gif"><img src="img/px.gif" width="11" height="1" alt="" border="0"></td>
<tr>
<td><img src="img/tip_cbl.gif" width="10" height="13" alt="" border="0"></td>
<td background="img/tip_bg_b.gif"><img src="img/px.gif" width="1" height="13" alt="" border="0"></td>
<td><img src="img/tip_cbr.gif" width="11" height="13" alt="" border="0"></td>
</tr>
</table>
</div>
<script type="text/javascript">
var layer = document.getElementById("tiplayer");
layer._width = 150;
</script>
</body>
</html>
</patTemplate:tmpl>