2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // +--------------------------------------------------------------------+
4 // | Ministerio de Economía |
6 // +--------------------------------------------------------------------+
7 // | This file is part of Intranet. |
9 // | Intranet is free software; you can redistribute it and/or modify |
10 // | it under the terms of the GNU General Public License as published |
11 // | by the Free Software Foundation; either version 2 of the License, |
12 // | or (at your option) any later version. |
14 // | Intranet is distributed in the hope that it will be useful, but |
15 // | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 // | General Public License for more details. |
19 // | You should have received a copy of the GNU General Public License |
20 // | along with Hooks; if not, write to the Free Software Foundation, |
21 // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 // +--------------------------------------------------------------------+
23 // | Creado: Thu Jul 3 14:43:38 2003 |
24 // | Autor: Gonzalo Merayo <gmeray@mecon.gov.ar> |
25 // +--------------------------------------------------------------------+
27 // $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $
33 require_once 'HTML/Table.php';
36 // +X2C Class 162 :HTML_Noticia
40 class HTML_Noticia extends HTML_Table {
42 * @var noticia $noticia
66 function toHTML() // ~X2C
70 $this->addRow(array($this->noticia->getSeccion()), array('class' => 'noticias_titulo_uno'));
71 $this->addRow(array(new MECON_HTML_Image('images/noticia_linea_azul.gif')),
72 array('class' => 'ver_mas'));
73 $this->addRow(array($this->noticia->getTitulo()), array('class' => 'noticias_textoazul'));
74 $this->addRow(array($this->noticia->getTitulo2()), array('class' => 'noticias_titulo_vinculos'));
75 $this->addRow(array($this->noticia->getTexto()), array('class' => 'noticias_titulo_noticia'));
76 $tmp = $this->noticia->getFecha();
77 $this->addRow(array($tmp->format('Fecha de publicación: %d/%m/%Y')),
78 array('class' => 'noticias_ver_mas'));
79 $this->addRow(array(new MECON_HTML_Image('images/blanco.gif','',
80 array('height'=>'15', 'width'=>'1', 'border'=>'0'))),
81 array('class' => 'noticias_ver_mas'));
82 $tmp = new MECON_HTML_Image('images/noticia_anterior.gif');
83 $this->addRow(array("<a href='$this->volver' class='noticias_ver_mas'>".$tmp->toHTML().
85 array('class' => 'noticias_ver_mas'));
86 return parent::toHTML();
90 $seccion = $this->noticia->getSeccion();
91 if(!is_null($seccion))
92 $this->addRow(array($seccion),
93 array('class' => 'noticias_subtitulo'));
97 $nuevo = new MECON_HTML_Image('images/noticia_nuevo.gif');
98 $img_str = ' '.$nuevo->toHTML();
100 $this->addRow(array("<a href='$this->link' class='noticias_titulo_noticia'>".$this->noticia->getTitulo().$img_str.'<a>'), array('class' => 'noticias_titulo_noticia'));
101 $tmp = $this->noticia->getFecha();
102 $this->addRow(array($tmp->format('(%d/%m/%Y)')),
103 array('class' => 'noticias_fecha_noticia'));
104 $mas = new MECON_HTML_Image('images/noticia_mas.gif');
105 if(isset($this->vermas))
107 $this->addRow(array("<a href='$this->vermas' class='noticias_ver_mas'>".$mas->toHTML().' ver más</a>'),
108 array('class' => 'noticias_ver_mas'));
110 $this->addRow(array(new MECON_HTML_Image('images/noticia_linea_puntos.gif')),
111 array('class' => 'noticias_ver_mas'));
112 return @ $this->toHTML_no_tabla();
116 function toHTML_no_tabla()
118 for ($i = 0 ; $i < $this->_rows ; $i++) {
119 $strHtml .= $tabs ."\t<TR>\n";
120 for ($j = 0 ; $j < $this->_cols ; $j++) {
121 if ($this->_structure[$i][$j] == "SPANNED") {
122 $strHtml .= $tabs ."\t\t<!-- span -->\n";
125 $type = ($this->_structure[$i][$j]["type"] == "TH" ? "TH" : "TD");
126 $attr = $this->_structure[$i][$j]["attr"];
127 $contents = $this->_structure[$i][$j]["contents"];
128 $strHtml .= $tabs . "\t\t<$type" . $this->_getAttrString($attr) . ">"; if (is_object($contents)) {
129 if (is_subclass_of($contents, "html_common")) {
130 $contents->setTabOffset($this->_tabOffset + 3);
131 $contents->_nestLevel = $this->_nestLevel + 1;
133 if (method_exists($contents, "toHtml")) {
134 $contents = $contents->toHtml();
135 } elseif (method_exists($contents, "toString")) {
136 $contents = $contents->toString();
139 if (is_array($contents)) $contents = implode(", ",$contents);
140 if (isset($this->_autoFill) && $contents == "") $contents = $this->_autoFill;
141 $strHtml .= $contents;
142 $strHtml .= "</$type>\n";
144 $strHtml .= $tabs ."\t</TR>\n";
150 // +X2C Operation 167
152 * @param noticia $noticia
157 function HTML_Noticia($noticia) // ~X2C
159 $this->noticia = $noticia;
160 $params = array('width' => '280',
163 parent::HTML_Table($params);
168 // +X2C Operation 175
170 * @param bool $completa
175 function setCompleta($completa) // ~X2C
177 $this->completa = $completa;
181 // +X2C Operation 176
188 function setNuevo($nuevo) // ~X2C
190 $this->nuevo = $nuevo;
194 // +X2C Operation 192
196 * @param string $link
201 function setLink($link) // ~X2C
207 // +X2C Operation 193
209 * @param string $link
214 function setVerMas($link) // ~X2C
216 $this->vermas = $link;
220 // +X2C Operation 194
222 * @param string $link
227 function setVolver($link) // ~X2C
229 $this->volver = $link;
233 // +X2C Operation 195
238 function getCSS() // ~X2C
240 return "css/noticias.css";
244 } // -X2C Class :HTML_Noticia