X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/ab77106d0d0e5ffcef48bc563360a6332cab1d9d..dd7ac619a4a7047b313e52402c33daf434fba223:/sistema/local_lib/HTML_Noticia.php diff --git a/sistema/local_lib/HTML_Noticia.php b/sistema/local_lib/HTML_Noticia.php index ac74f83..4e535d2 100644 --- a/sistema/local_lib/HTML_Noticia.php +++ b/sistema/local_lib/HTML_Noticia.php @@ -20,17 +20,18 @@ // | along with Hooks; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | // +--------------------------------------------------------------------+ -// | Creado: Thu Jul 3 14:43:38 2003 | -// | Autor: Gonzalo Merayo | +// | Creado: Thu Jul 3 14:43:38 2003 | +// | Autor: Gonzalo Merayo | // +--------------------------------------------------------------------+ // -// $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $ +// $Id$ // // +X2C includes -require_once 'HTML_Table.php'; +require_once 'HTML/Table.php'; +require_once 'MECON/HTML/Link.php'; // ~X2C // +X2C Class 162 :HTML_Noticia @@ -44,6 +45,18 @@ class HTML_Noticia extends HTML_Table { */ var $noticia; + /** + * @var bool $completa + * @access public + */ + var $completa; + + /** + * @var int $nuevo + * @access public + */ + var $nuevo; + // ~X2C // +X2C Operation 166 @@ -53,7 +66,63 @@ class HTML_Noticia extends HTML_Table { */ function toHTML() // ~X2C { - trigger_error('Not implemented!', E_USER_WARNING); + if($this->completa) + { + $this->addRow(array($this->noticia->getSeccion()), array('class' => 'noticias_titulo_uno')); + $this->addRow(array(new MECON_HTML_Image('images/noticia_linea_azul.gif')), + array('class' => 'ver_mas')); + $this->addRow(array($this->noticia->getTitulo()), array('class' => 'noticias_textoazul')); + $this->addRow(array($this->noticia->getTitulo2()), array('class' => 'noticias_titulo_vinculos')); + $this->addRow(array($this->noticia->getTexto()), array('class' => 'noticias_titulo_noticia')); + foreach($this->noticia->getLinks() as $l) + $this->addRow(array(new MECON_HTML_Link('una_noticia',$l['texto'],$l))); + foreach($this->noticia->getArchivos() as $a) + { + //Cuando se cambie la herramienta hay que usar este otro script + //para obtener los archivos + //$this->addRow(array(new MECON_HTML_Link('attach',$a['texto'],$a))); + $this->addRow(array(new MECON_HTML_Link('http://intranet.mecon.ar/get_file.epl', + $a['texto'], + array('NEWS.FilesForArticle.file_for_article_id' =>$a['numero'])))); + } + $tmp = $this->noticia->getFecha(); + $this->addRow(array($tmp->format('Fecha de publicación: %d/%m/%Y')), + array('class' => 'noticias_ver_mas')); + $this->addRow(array(new MECON_HTML_Image('images/blanco.gif','', + array('height'=>'15', 'width'=>'1', 'border'=>'0'))), + array('class' => 'noticias_ver_mas')); + $tmp = new MECON_HTML_Image('images/noticia_anterior.gif'); + $this->addRow(array("".$tmp->toHTML(). + 'volver'), + array('class' => 'noticias_ver_mas')); + return parent::toHTML(); + } + else + { + $seccion = $this->noticia->getSeccion(); + if(!is_null($seccion)) + $this->addRow(array($seccion), + array('class' => 'noticias_subtitulo')); + $img_str = null; + if($this->nuevo) + { + $nuevo = new MECON_HTML_Image('images/noticia_nuevo.gif'); + $img_str = ' '.$nuevo->toHTML(); + } + $this->addRow(array("".$this->noticia->getTitulo().$img_str.''), array('class' => 'noticias_titulo_noticia')); + $tmp = $this->noticia->getFecha(); + $this->addRow(array($tmp->format('(%d/%m/%Y)')), + array('class' => 'noticias_fecha_noticia')); + $mas = new MECON_HTML_Image('images/noticia_mas.gif'); + if(isset($this->vermas)) + { + $this->addRow(array("".$mas->toHTML().' ver más'), + array('class' => 'noticias_ver_mas')); + } + $this->addRow(array(new MECON_HTML_Image('images/noticia_linea_puntos.gif')), + array('class' => 'noticias_ver_mas')); + return @ $this->toHTML_no_tabla(); + } } // -X2C @@ -66,7 +135,11 @@ class HTML_Noticia extends HTML_Table { */ function HTML_Noticia($noticia) // ~X2C { - trigger_error('Not implemented!', E_USER_WARNING); + $this->noticia = $noticia; + $params = array('width' => '280', + 'border' =>'0', + 'cellPadding'=>'0'); + parent::HTML_Table($params); } // -X2C @@ -80,7 +153,7 @@ class HTML_Noticia extends HTML_Table { */ function setCompleta($completa) // ~X2C { - trigger_error('Not implemented!', E_USER_WARNING); + $this->completa = $completa; } // -X2C @@ -93,9 +166,98 @@ class HTML_Noticia extends HTML_Table { */ function setNuevo($nuevo) // ~X2C { - trigger_error('Not implemented!', E_USER_WARNING); + $this->nuevo = $nuevo; + } + // -X2C + + // +X2C Operation 192 + /** + * @param string $link + * + * @return void + * @access public + */ + function setLink($link) // ~X2C + { + $this->link = $link; + } + // -X2C + + // +X2C Operation 193 + /** + * @param string $link + * + * @return void + * @access public + */ + function setVerMas($link) // ~X2C + { + $this->vermas = $link; + } + // -X2C + + // +X2C Operation 194 + /** + * @param string $link + * + * @return void + * @access public + */ + function setVolver($link) // ~X2C + { + $this->volver = $link; + } + // -X2C + + // +X2C Operation 195 + /** + * @return void + * @access public + */ + function getCSS() // ~X2C + { + return "css/noticias.css"; + } + // -X2C + + // +X2C Operation 198 + /** + * @return void + * @access public + */ + function toHTML_no_tabla() // ~X2C + { + for ($i = 0 ; $i < $this->_rows ; $i++) { + $strHtml .= $tabs ."\t\n"; + for ($j = 0 ; $j < $this->_cols ; $j++) { + if ($this->_structure[$i][$j] == "SPANNED") { + $strHtml .= $tabs ."\t\t\n"; + continue; + } + $type = ($this->_structure[$i][$j]["type"] == "TH" ? "TH" : "TD"); + $attr = $this->_structure[$i][$j]["attr"]; + $contents = $this->_structure[$i][$j]["contents"]; + $strHtml .= $tabs . "\t\t<$type" . $this->_getAttrString($attr) . ">"; if (is_object($contents)) { + if (is_subclass_of($contents, "html_common")) { + $contents->setTabOffset($this->_tabOffset + 3); + $contents->_nestLevel = $this->_nestLevel + 1; + } + if (method_exists($contents, "toHtml")) { + $contents = $contents->toHtml(); + } elseif (method_exists($contents, "toString")) { + $contents = $contents->toString(); + } + } + if (is_array($contents)) $contents = implode(", ",$contents); + if (isset($this->_autoFill) && $contents == "") $contents = $this->_autoFill; + $strHtml .= $contents; + $strHtml .= "\n"; + } + $strHtml .= $tabs ."\t\n"; + } + return $strHtml; } // -X2C } // -X2C Class :HTML_Noticia -?> \ No newline at end of file +?>