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 // +--------------------------------------------------------------------+
33 require_once 'HTML/Table.php';
34 require_once 'MECON/HTML/Link.php';
37 // +X2C Class 162 :HTML_Noticia
41 class HTML_Noticia extends HTML_Table {
43 * @var noticia $noticia
67 function toHTML() // ~X2C
71 $this->addRow(array($this->noticia->getSeccion()), array('class' => 'noticias_titulo_uno'));
72 $this->addRow(array(new MECON_HTML_Image('images/noticia_linea_azul.gif')),
73 array('class' => 'ver_mas'));
74 $this->addRow(array($this->noticia->getTitulo()), array('class' => 'noticias_textoazul'));
75 $this->addRow(array($this->noticia->getTitulo2()), array('class' => 'noticias_titulo_vinculos'));
76 $this->addRow(array($this->noticia->getTexto()), array('class' => 'noticias_titulo_noticia'));
77 foreach($this->noticia->getLinks() as $l)
78 $this->addRow(array(new MECON_HTML_Link('una_noticia',$l['texto'],$l)));
79 foreach($this->noticia->getArchivos() as $a)
81 //Cuando se cambie la herramienta hay que usar este otro script
82 //para obtener los archivos
83 //$this->addRow(array(new MECON_HTML_Link('attach',$a['texto'],$a)));
84 $this->addRow(array(new MECON_HTML_Link('http://intranet.mecon.ar/get_file.epl',
86 array('NEWS.FilesForArticle.file_for_article_id' =>$a['numero']))));
88 $tmp = $this->noticia->getFecha();
89 $this->addRow(array($tmp->format('Fecha de publicación: %d/%m/%Y')),
90 array('class' => 'noticias_ver_mas'));
91 $this->addRow(array(new MECON_HTML_Image('images/blanco.gif','',
92 array('height'=>'15', 'width'=>'1', 'border'=>'0'))),
93 array('class' => 'noticias_ver_mas'));
94 $tmp = new MECON_HTML_Image('images/noticia_anterior.gif');
95 $this->addRow(array("<a href='$this->volver' class='noticias_ver_mas'>".$tmp->toHTML().
97 array('class' => 'noticias_ver_mas'));
98 return parent::toHTML();
102 $seccion = $this->noticia->getSeccion();
103 if(!is_null($seccion))
104 $this->addRow(array($seccion),
105 array('class' => 'noticias_subtitulo'));
109 $nuevo = new MECON_HTML_Image('images/noticia_nuevo.gif');
110 $img_str = ' '.$nuevo->toHTML();
112 $this->addRow(array("<a href='$this->link' class='noticias_titulo_noticia'>".$this->noticia->getTitulo().$img_str.'<a>'), array('class' => 'noticias_titulo_noticia'));
113 $tmp = $this->noticia->getFecha();
114 $this->addRow(array($tmp->format('(%d/%m/%Y)')),
115 array('class' => 'noticias_fecha_noticia'));
116 $mas = new MECON_HTML_Image('images/noticia_mas.gif');
117 if(isset($this->vermas))
119 $this->addRow(array("<a href='$this->vermas' class='noticias_ver_mas'>".$mas->toHTML().' ver más</a>'),
120 array('class' => 'noticias_ver_mas'));
122 $this->addRow(array(new MECON_HTML_Image('images/noticia_linea_puntos.gif')),
123 array('class' => 'noticias_ver_mas'));
124 return @ $this->toHTML_no_tabla();
129 // +X2C Operation 167
131 * @param noticia $noticia
136 function HTML_Noticia($noticia) // ~X2C
138 $this->noticia = $noticia;
139 $params = array('width' => '280',
142 parent::HTML_Table($params);
147 // +X2C Operation 175
149 * @param bool $completa
154 function setCompleta($completa) // ~X2C
156 $this->completa = $completa;
160 // +X2C Operation 176
167 function setNuevo($nuevo) // ~X2C
169 $this->nuevo = $nuevo;
173 // +X2C Operation 192
175 * @param string $link
180 function setLink($link) // ~X2C
186 // +X2C Operation 193
188 * @param string $link
193 function setVerMas($link) // ~X2C
195 $this->vermas = $link;
199 // +X2C Operation 194
201 * @param string $link
206 function setVolver($link) // ~X2C
208 $this->volver = $link;
212 // +X2C Operation 195
217 function getCSS() // ~X2C
219 return "css/noticias.css";
223 // +X2C Operation 198
228 function toHTML_no_tabla() // ~X2C
230 for ($i = 0 ; $i < $this->_rows ; $i++) {
231 $strHtml .= $tabs ."\t<TR>\n";
232 for ($j = 0 ; $j < $this->_cols ; $j++) {
233 if ($this->_structure[$i][$j] == "SPANNED") {
234 $strHtml .= $tabs ."\t\t<!-- span -->\n";
237 $type = ($this->_structure[$i][$j]["type"] == "TH" ? "TH" : "TD");
238 $attr = $this->_structure[$i][$j]["attr"];
239 $contents = $this->_structure[$i][$j]["contents"];
240 $strHtml .= $tabs . "\t\t<$type" . $this->_getAttrString($attr) . ">"; if (is_object($contents)) {
241 if (is_subclass_of($contents, "html_common")) {
242 $contents->setTabOffset($this->_tabOffset + 3);
243 $contents->_nestLevel = $this->_nestLevel + 1;
245 if (method_exists($contents, "toHtml")) {
246 $contents = $contents->toHtml();
247 } elseif (method_exists($contents, "toString")) {
248 $contents = $contents->toString();
251 if (is_array($contents)) $contents = implode(", ",$contents);
252 if (isset($this->_autoFill) && $contents == "") $contents = $this->_autoFill;
253 $strHtml .= $contents;
254 $strHtml .= "</$type>\n";
256 $strHtml .= $tabs ."\t</TR>\n";
262 } // -X2C Class :HTML_Noticia