Revision 795,
983 bytes
checked in by viani, 15 years ago
(diff) |
Ticket #488 - Inclusão do módulo workflow no ramo trunk do repositório Expresso.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * Insere o código javascript necessário para abrir uma nova janela |
---|
4 | * @package Smarty |
---|
5 | * @subpackage wf_plugins |
---|
6 | * @param array $params Array de parametros (vazio) |
---|
7 | * @param object &$smarty Instância do objeto smarty em uso |
---|
8 | * @return string $output código do script |
---|
9 | * @access public |
---|
10 | */ |
---|
11 | function smarty_function_wf_window_open_init($params, &$smarty) |
---|
12 | { |
---|
13 | $output = <<<EOF |
---|
14 | <script language="javascript1.2"> |
---|
15 | function wf_open_window(url, name, width, height, position, features) { |
---|
16 | if (position == 'right') { |
---|
17 | newScreenX = screen.width - width; |
---|
18 | newScreenY = 0; |
---|
19 | } else { |
---|
20 | if (position == 'center') { |
---|
21 | newScreenX = (screen.width / 2) - (width / 2); |
---|
22 | newScreenY = 0; |
---|
23 | } else { |
---|
24 | newScreenX = 1; |
---|
25 | newScreenY = 0; |
---|
26 | } |
---|
27 | } |
---|
28 | |
---|
29 | name = window.open(url, '', 'width='+width+',height='+height+',' + |
---|
30 | 'screenX='+newScreenX+',left='+newScreenX+',screenY='+newScreenY+',' + |
---|
31 | 'top='+newScreenY+','+features); |
---|
32 | } |
---|
33 | </script> |
---|
34 | EOF; |
---|
35 | return $output; |
---|
36 | } |
---|
37 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.