<?php
if (!isset($id) || !$id) {
    $id = "0";
}
$this->headScript()->appendScript("var baseUrl = '" . $baseUrl . "';\n");
$config = Goweb::registry('config'); ?>
<?php echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php $this->headMeta()->appendHttpEquiv('Content-Type',
                                   'text/html; charset=' . CHARSET)
                 ->appendHttpEquiv('Content-Language', 'pt-PT');

$this->headTitle($config->painel->title);
if (isset($titulo)) $this->headTitle(html_entity_decode($titulo));
// separador
$this->headTitle()->setSeparator(' / ');
$this->headMeta($config->painel->meta_copyright, 'copyright');
$this->headMeta($config->painel->meta_keywords, 'keywords');
if (isset($keywords)) $this->headMeta($keywords, 'keywords');
$this->headMeta($config->painel->meta_extra , 'keywords');
$this->headMeta($config->painel->meta_description, 'description');
$this->loadCss('/media/css/random_password.css');
$this->loadJavascript('/media/js/prototype.js');
$this->loadJavascript('/admin/media/js/scriptaculous/scriptaculous.js');
?>
<?php foreach ($this->getCss() as $css): ?>
<?php $this->headLink()->appendStylesheet($baseUrl . $css) ?>
<?php endforeach; ?>
<?php foreach ($this->getRss() as $rss): ?>
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $baseUrl . $rss; ?>" />
<?php endforeach; ?>
<?php $this->headScript()->appendFile($baseUrl . '/media/js/go_admin.js')?>
<?php foreach ($this->getJavascripts() as $javascript): ?>
<?php $this->headScript()->appendFile($baseUrl . $javascript)?>
<?php endforeach; ?>
<?php $this->headScript()->appendFile($baseUrl . '/media/js/AC_RunActiveContent.js')?>
<?php echo $this->headMeta() ?>
<?php echo $this->headTitle() ?>
<?php echo $this->headLink() ?>
<?php echo $this->headScript() ?>
</head>
<body>

<form id="randomPasswordForm" name="randomPasswordForm" id="randomPasswordForm">
<div id="random_password">
    <h5><?php echo translate('Como pretende compor a sua password?')?></h5>
    <div class="checkOption">
        <div class="checkOption_check"><input type="checkbox" name="firstNumber" id="firstNumber" checked></div>
        <div class="checkOption_title"><?php echo translate('Numeros')?></div>
    </div>
    <div class="checkOption">
        <div class="checkOption_check"><input type="checkbox" name="firstLower" id="firstLower" checked></div>
        <div class="checkOption_title"><?php echo translate('Minusculas')?></div>
    </div>
    <div class="checkOption">
        <div class="checkOption_check"><input type="checkbox" name="firstUpper" id="firstUpper" checked></div>
        <div class="checkOption_title"><?php echo translate('Maiusculas')?></div>
    </div>
    <div class="checkOption">
        <div class="checkOption_check"><input type="checkbox" name="firstOther" id="firstOther"></div>
        <div class="checkOption_title"><?php echo translate('Outros')?></div>
    </div>
    <br style="clear:both;"/>
    <br>
    <h5><?php echo translate('Com que tamanho pretende compor a sua password?')?></h5>
    <div class="checkOption">
        <div class="checkOption_title"><?php echo translate('Tamanho da password')?>:</div>
        <div class="checkOption_check"><input type="text" name="passwordLength" id="passwordLength" value="8" size=3></div>
    </div>
    <br style="clear:both;"/>
    <br>
    <div>
    	<div>
        <input type="button" value="<?php echo translate('Gerar password')?>" onClick="
        $('randomPassword').value = getPassword($('passwordLength').value,
        $('firstNumber').checked, $('firstLower').checked,
        $('firstUpper').checked, $('firstOther').checked,
        $('firstNumber').checked, $('firstLower').checked,
        $('firstUpper').checked, $('firstOther').checked); return false;">
        </div>
        <div>
			<?php echo translate('Nova password')?>: 
            <input type="text" name="randomPassword" id="randomPassword" size=20> 
            <input type="button" value="<?php echo translate('Usar password')?>" onClick="updatePassword('<?php echo $name ?>'); updatePassword('<?php echo $name . '_confirm' ?>');Modalbox.hide();">
        </div>
    </div>
</div>
</form>

</body>
</html>