- Sync Script für News

- ÖH Kundmachung
This commit is contained in:
Andreas Österreicher
2011-06-08 10:09:36 +00:00
parent 622ae9d1a6
commit 1e57069270
5 changed files with 2378 additions and 3037 deletions
+3 -11
View File
@@ -70,7 +70,7 @@ function drawEntry($item)
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap">
<a href="#'.$item['link'].'" class="MenuItem" onClick="return(js_toggle_container(\'Content'.$item['content_id'].'\'));">
<a href="'.$item['link'].'" target="content" class="MenuItem" onClick="js_toggle_container(\'Content'.$item['content_id'].'\');">
<img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9">&nbsp;'.$item['name'].'
</a>
<table class="tabcontent" id="Content'.$item['content_id'].'" style="display: '.($item['open']?'visible':'none').'">';
@@ -138,14 +138,6 @@ function drawEntry($item)
<td class="tdwrap"></td>
<td><a target="content" href="?oeh" class="MenuItem" onClick="js_toggle_container('oeh');return false;"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9">&nbsp;ÖH</a>
<table class="tabcontent" id="oeh" style="display: visible">
<tr>
<td class="tdwrap"></td>
<td><a href="private/info/oeh/KandidatInnen2011.pdf" target="content" class="Item"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9">&nbsp;&Ouml;H-KandidatInnen 2011</a></td>
</tr>
<tr>
<td class="tdwrap"></td>
<td><a href="private/info/oeh/index2010.php" target="content" class="Item"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9">&nbsp;&Ouml;H-Mandate Fr&uuml;hjahr 2010</a></td>
</tr>
<tr>
<td class="tdwrap"></td>
<td><a href="private/info/oeh/index2011.php" target="content" class="Item"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9">&nbsp;&Ouml;H-Mandate Frühjahr 2011</a></td>
@@ -993,7 +985,7 @@ function drawEntry($item)
<td class="tdwrap"><a class="Item" href="private/info/betriebsrat/betriebsratswahl.php" target="content"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9">&nbsp;Betriebsratswahl</a></td>
</tr>
<?php
//drawSubmenu(24);
//drawSubmenu(25);
?>
</table>
</td>
@@ -1055,4 +1047,4 @@ function drawEntry($item)
</table>
</td>
</tr>
</table>
</table>
+2205 -3018
View File
File diff suppressed because it is too large Load Diff
+90
View File
@@ -0,0 +1,90 @@
<?php
/* Copyright (C) 2011 FH Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
require_once('../../config/system.config.inc.php');
require_once('../../include/basis_db.class.php');
require_once('../../include/content.class.php');
$db = new basis_db();
$qry = 'SELECT * FROM campus.tbl_news';
$gesamt=0;
$fehler=0;
$ok=0;
if($result = $db->db_query($qry))
{
while($row = $db->db_fetch_object($result))
{
$gesamt++;
$xml = '<news>
<verfasser><![CDATA['.$row->verfasser.']]></verfasser>
<betreff><![CDATA['.$row->betreff.']]></betreff>
<text><![CDATA['.$row->text.']]></text>
</news>';
$content = new content();
$content->template_kurzbz = 'news';
$content->oe_kurzbz = 'etw';
$content->updatevon = $row->updatevon;
$content->updateamum = $row->updateamum;
$content->insertamum = $row->insertamum;
$content->insertvon = $row->insertvon;
$content->aktiv = true;
$content->menu_open=false;
$content->content = $xml;
$content->sichtbar = true;
$content->sprache = 'German';
$content->titel = $row->betreff;
$content->version = 1;
if($content->save(true))
{
$qry = "UPDATE campus.tbl_news SET content_id='".$content->content_id."' WHERE news_id='".$row->news_id."';";
if($db->db_query($qry))
{
echo "ID $row->news_id angelegt<br>";
$ok++;
}
else
{
echo "News Update Failed $row->news_id<br>";
$fehler++;
}
}
else
{
echo "Content Update Failed $row->news_id<br>";
$fehler++;
}
}
}
else
{
echo 'Fehler beim Laden der News';
}
echo "
Gesamt: $gesamt<br>
OK: $ok<br>
Fehler: $fehler<br>
";
?>
-1
View File
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="news">
<xs:element name="datum" type="xs:date"/>
<xs:element name="verfasser" type="xs:string"/>
<xs:element name="betreff" type="xs:string"/>
<xs:element name="text" type="wysiwyg"/>
+80 -7
View File
@@ -8,15 +8,26 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<title>News</title>
</head>
<body>
<h1>News</h1>
<div id="news">
<xsl:apply-templates match="news" />
</div>
<table class="tabcontent">
<tr>
<td valign="top">
<h1>News</h1>
<div id="news">
<xsl:apply-templates select="content/news" />
</div>
</td>
<xsl:if test="content/stg_extras" >
<td></td>
<td class="tdvertical" valign="top" width="20%">
<xsl:apply-templates select="content/stg_extras" />
</td>
</xsl:if>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="news">
<div class="news">
<div class="titel">
<table width="100%">
@@ -32,6 +43,68 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</div>
<br />
</xsl:template>
<xsl:template match="stg_extras">
<h2><b>Studiengangsmanagement</b></h2>
<font face='Arial, Helvetica, sans-serif' size='2'>
<br />
Studiengangsleitung:<br />
<xsl:apply-templates select="stg_ltg" />
<br />
<xsl:if test="gf_ltg">
geschäftsf. Leitung:<br />
<xsl:apply-templates select="gf_ltg" />
<br />
</xsl:if>
<xsl:if test="stv_ltg">
Stellvertreter:<br />
<xsl:apply-templates select="stv_ltg" />
<br />
</xsl:if>
<xsl:if test="ass">
Sekretariat:<br />
<xsl:apply-templates select="ass" />
<br />
</xsl:if>
<xsl:value-of select="zusatzinfo" disable-output-escaping="yes"/>
<xsl:if test="stdv">
<br />
Studentenvertreter:<br />
<xsl:apply-templates select="stdv" />
<br />
</xsl:if>
</font>
</xsl:template>
<xsl:template match="stg_ltg">
<b><xsl:value-of select="name" /></b><br />
<xsl:variable name="mail" select="email"></xsl:variable>
<a href="mailto:{mail}"><xsl:value-of select="email" /></a><br />
Tel.:<xsl:value-of select="telefon" />
<br />
</xsl:template>
<xsl:template match="gf_ltg">
<b><xsl:value-of select="name" /></b><br />
<xsl:variable name="mail" select="email"></xsl:variable>
<a href="mailto:{mail}"><xsl:value-of select="email" /></a><br />
Tel.:<xsl:value-of select="telefon" />
<br />
</xsl:template>
<xsl:template match="stv_ltg">
<b><xsl:value-of select="name" /></b><br />
<xsl:variable name="mail" select="email"></xsl:variable>
<a href="mailto:{mail}"><xsl:value-of select="email" /></a><br />
Tel.:<xsl:value-of select="telefon" />
<br />
</xsl:template>
<xsl:template match="ass">
<b><xsl:value-of select="name" /></b><br />
<xsl:variable name="mail" select="email"></xsl:variable>
<a href="mailto:{mail}"><xsl:value-of select="email" /></a><br />
Tel.:<xsl:value-of select="telefon" />
<br />
</xsl:template>
<xsl:template match="stdv">
<xsl:variable name="mail" select="email"></xsl:variable>
<a href="mailto:{mail}"><xsl:value-of select="name" /></a><br />
</xsl:template>
</xsl:stylesheet >