Artikel-Übersicht Template ändern???

Gesperrt
Snuppel007
Beiträge: 86
Registriert: Mi 20. Apr 2005, 16:16
Kontaktdaten:

Artikel-Übersicht Template ändern???

Beitrag von Snuppel007 » Do 17. Apr 2008, 14:41

Hallo Jungs, ich bins wieder :D

laut dem Motto "Pimb My Contenido" hab ich mich gestern ran gemacht und das Backend der 4.8 Version etwas angepasst. Dabei hab ich leider festgestellt das man in der neuen Version die Anordnung (Auflistung) der Artikel nicht mehr im Template vornehmen kann. Ich muß nämlich die "Aktionen" der Artikel in der Artikel-Übersicht vorne angezeigt bekommen. Zwischen Artikel und Titel! Standard ist aber das diese immer hinten stehen, da ich aber sehr sehr lange Artikel-Namen habe ist das immer schlecht gleich zu erkennen welche Artikel Zeitgesteuert sind, welche schon offline sind usw.

Meine Frage also, wo kann ich diese Reihen folge ändern ..., im Template ist das jetzt leider nicht mehr möglich???

Lieben Gruß, der Snuppel

htw
Beiträge: 490
Registriert: Sa 5. Okt 2002, 03:09
Wohnort: Hessen
Kontaktdaten:

Beitrag von htw » Fr 18. Apr 2008, 11:10

Hallo,

kannst Du mal Screenies posten was Du ändern möchtest? Bzw. diese auch per PN senden, wenn Du magst. Danke

Grüße
htw

OliverL
Beiträge: 870
Registriert: Do 28. Jun 2007, 09:28
Kontaktdaten:

Beitrag von OliverL » Fr 18. Apr 2008, 17:56

Ich hab die Lösung für dein Problem!!!!!
Nen mich GOTT! :)

normalerweise in der Datei "includes/include.con_art_overview.php" Zeile 57-64 einfach die Werte des Array neu Sortieren.

ABER <-------- !
Da ein Plugin installiert wurde ist es das nicht.
d.h. guck mal in der Datei "plugins/workflow/includes/config.plugin.php"
in Zeile 273-280



1. LÖSUNG (einfach):
In der Plugin-Config-Datei einfach das Array neu sortieren.


2. LÖSUNG (besser):
In der Plugin-Config-Datei in Zeile ca. 270-285 die If-Abfrage "if ($defaultidworkflow != 0)" ersetzen durch:

Code: Alles auswählen

	if ($defaultidworkflow != 0)
	{
		$narray = array();
		foreach( $array as $key => $value ) {
			if( !in_array($key, array('changeddate','publisheddate','sortorder'))) {
				$narray[$key] = $array[$key];
			}
			if($key == "title") {
				$narray["wfstep"] = i18n("Workflow Step", "workflow");
				$narray["wfaction"] = i18n("Workflow Action", "workflow");
				$narray["wfeditor"] = i18n("Workflow Editor", "workflow");
				$narray["wflaststatus"] = i18n("Last status", "workflow");
			}
		}
		
	} else {
		$narray = $array;	
	}
und die Grund Sortierung in "include/include.con_art_overview.php" machen.

[ UPDATE : 20:00 UHR ]
1. Die Workflow-Elemente werden jetzt direkt nach dem "title" ergänzt.
2. per !in_array() werden 'changeddate','publisheddate' & 'sortorder' entfernt (ansonsten wird die Tabelle zu lang)
3. durch das !in_array() können weitere Plugins/CRCs die Tabelle ergänzen.

[ BUG ? ]
Sollten eine weitere CRC dazu kommen müste diese nach der Workflow-CRC (func. piworkflowProcessArticleColumns() ) geladen werden. ansonsten killt diese Function die neuen Werten im Array.
-> Mit der oben angegebenen verbesserung werden lediglich 3 spalten ausgelassen und die neuen ergänzt.

PS.: Beantrage hiermit direkten zugriff/schreibrechte auf den Bereich Bugs.
Weil wegen: bin der Bugs-Meister :) :) :) :) 8)

Snuppel007
Beiträge: 86
Registriert: Mi 20. Apr 2005, 16:16
Kontaktdaten:

Beitrag von Snuppel007 » Sa 19. Apr 2008, 18:24

Hey OliverL,

Mensch ist ja Super das Du den Durchblick hast ..., da sehe ich doch Licht am Ende des Tunnels :D wenn das hinhaut bau ich Dir ein Schrein und nenn Dich "Con Gott" :P hehe. Aber irgendwie hauts bei mir nicht hin, hab alles so gemacht wie Con Gott es mir gesagt hat, aber sobald ich die Sortierung in der "include.con_art_overview.php" ändere bekomme ich ein Fehlermeldung in der Artikel-Übersicht, kuckst Du ..., :

Code: Alles auswählen

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /.../.../live/contenido/includes/include.con_art_overview.php on line 60
... was meint er mit doppelt ..., hab nix verdoppelt!!!

Anbei die beiden Screens, eins wie es zur Zeit ist (..habs aber erstmal mit dem Pimp my Nido erstmal nach hinten gestellt) und eins wie es mit der angepassten änderung der Actions sein soll.

So schauts zur Zeit aus: http://www.live.slukwin-creative.de/contenido_ist.png
Und so soll es mit der änderung in der Artikel-Übersicht aussehen: http://www.live.slukwin-creative.de/contenido_soll.png

Hier die "include.con_art_overview.php"

Code: Alles auswählen

<?php

/******************************************
 * File      :   includes.con_art_overview.php
 * Project   :   Contenido
 * Descr     :   Displays all articles
 *               of a category
 *
 * Author    :   Jan Lengowski
 * Created   :   26.01.2003
 * Modified  :   23.06.2003
 * Modified  :   23.06.2005 by Andreas Lindner
 *
 * © four for business AG
 *****************************************/

cInclude("includes","functions.tpl.php");
cInclude("includes","functions.str.php");
cInclude("classes", "class.todo.php");
cInclude("includes", "functions.pathresolver.php");
$firstMark = false;
$db2 = new DB_Contenido;

$idcat	= ( isset($_GET['idcat']) && is_numeric($_GET['idcat'])) ? $_GET['idcat'] : -1;
$next	= ( isset($_GET['next']) && is_numeric($_GET['next']) && $_GET['next'] > 0) ? $_GET['next'] : 0;

$dateformat = getEffectiveSetting("backend", "timeformat_date", "Y-m-d");
$debug = false;
$templateDescription = '';

if (!isset($syncfrom))
{
	$syncfrom = -1;
}

$syncoptions = $syncfrom;

if ($action == "con_duplicate")
{
	$newidartlang = conCopyArticle($duplicate, $idcat);
}

if ($action == "con_syncarticle")
{
	/* Verify that the category is available in this language */
	$sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='$idcat' AND idlang='$lang'";
	$db->query($sql);
	if ($db->next_record())
	{
		conSyncArticle($syncarticle, $sourcelanguage, $lang);
	} else {
		strSyncCategory($idcat, $sourcelanguage, $lang);
		conSyncArticle($syncarticle, $sourcelanguage, $lang);
	}
}

/* Which columns to display? */
$listColumns = array(	"start" => i18n("Article"),
						"title" => i18n("Title"),
						"changeddate" => i18n("Changed"),
						"publisheddate" => i18n("Published"),
						"sortorder" => i18n("Sort order"),
						"template" => i18n("Template"),
						"actions" => i18n("Actions"));

/* Which actions to display? 
$actionList = array(	"online",
						"tplconf",
						"duplicate",
						"locked",
						"todo",
						"artconf",
						"delete",
						"usetime");
*/

/* Which actions to display? */
$actionList = array(	"online",
						"duplicate",
						"locked",
						"todo",
						"delete",
						"usetime");


/* Call chains to process the columns and the action list */
$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.Columns");

if ($_cecIterator->count() > 0)
{
	while ($chainEntry = $_cecIterator->next())
	{
		$newColumnList = $chainEntry->execute($listColumns);
	  
		if (is_array($newColumnList))
		{
			$listColumns = $newColumnList;
		}
	}
}

$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.Actions");

if ($_cecIterator->count() > 0)
{
	while ($chainEntry = $_cecIterator->next())
	{
		$newActionList = $chainEntry->execute($actionList);
	  
		if (is_array($newActionList))
		{
			$actionList = $newActionList;
		}
	}
}

$cat_idtpl = 0;

if ( is_numeric($idcat) && ($idcat >= 0)) {
	// Saving sort and elements per page user settings (if specified)
	// Should be changed to User->setProperty... someday
	if (isset($sort))
	{
		$currentuser->setUserProperty("system","sortorder-idlang-$lang-idcat-$idcat",$sort);
	}

	if (isset($elemperpage) && is_numeric($elemperpage))
	{
		$currentuser->setUserProperty("system","elemperpage-idlang-$lang-idcat-$idcat", $elemperpage);

		/* Currently save all settings, as "all" is "old" behaviour and just in case there is some bug
		 * with article browsing...
		 if ($elemperpage > 0)
		 {
			// Don't save "all" (= 0) as you may not get back to a save harbor
			...
			} */
	} else {
		$elemperpage = $currentuser->getUserProperty("system","elemperpage-idlang-$lang-idcat-$idcat");

		if (!is_numeric($elemperpage))
		{
			$elemperpage = 25;
		}
	}

	$col = new InUseCollection;

	if (((  $idcat == 0 ||
	$perm->have_perm_area_action("con")) && $perm->have_perm_item("str", $idcat))   ||
	$perm->have_perm_area_action("con", "con_makestart")                    ||
	$perm->have_perm_area_action("con", "con_makeonline")                   ||
	$perm->have_perm_area_action("con", "con_deleteart")                    ||
	$perm->have_perm_area_action("con", "con_tplcfg_edit")                  ||
	$perm->have_perm_area_action("con", "con_lock") 	                    ||
	$perm->have_perm_area_action("con", "con_makecatonline")                ||
	$perm->have_perm_area_action("con", "con_changetemplate")               ||
	$perm->have_perm_area_action("con_editcontent", "con_editart")          ||
	$perm->have_perm_area_action("con_editart", "con_edit")                 ||
	$perm->have_perm_area_action("con_editart", "con_newart")               ||
	$perm->have_perm_area_action("con_editart", "con_saveart")				||
	$perm->have_perm_area_action("con_tplcfg", "con_tplcfg_edit")           ||
	$perm->have_perm_area_action_item("con", "con_makestart", $idcat)       ||
	$perm->have_perm_area_action_item("con", "con_makeonline", $idcat)      ||
	$perm->have_perm_area_action_item("con", "con_deleteart", $idcat)       ||
	$perm->have_perm_area_action_item("con", "con_tplcfg_edit", $idcat)     ||
	$perm->have_perm_area_action_item("con", "con_lock", $idcat)            ||
	$perm->have_perm_area_action_item("con", "con_makecatonline", $idcat)   ||
	$perm->have_perm_area_action_item("con", "con_changetemplate", $idcat)  ||
	$perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat)       ||
	$perm->have_perm_area_action_item("con_editart", "con_edit", $idcat)    ||
	$perm->have_perm_area_action_item("con_editart", "con_newart", $idcat)  ||
	$perm->have_perm_area_action_item("con_tplcfg", "con_tplcfg_edit",$idcat) ||
	$perm->have_perm_area_action_item("con_editart", "con_saveart", $idcat)) {

		$sort = $currentuser->getUserProperty("system","sortorder-idlang-$lang-idcat-$idcat");

		$sql  = "SELECT
					a.idart AS idart,
					a.idlang AS idlang,
					a.idartlang AS idartlang,
					a.title AS title,
					c.idcat AS idcat,
					{ISSTART}
					c.idcatart AS idcatart,
					a.idtplcfg AS idtplcfg,
					a.published AS published,
					a.online AS online,
					a.created AS created,
					a.lastmodified AS lastmodified,
					a.timemgmt AS timemgmt,
					a.datestart AS datestart,
					a.dateend AS dateend,
					a.artsort AS artsort,
					a.redirect AS redirect,
					a.locked AS locked
				 FROM
					".$cfg["tab"]["art_lang"]." AS a,
					".$cfg["tab"]["art"]." AS b,
					".$cfg["tab"]["cat_art"]." AS c
				 WHERE
					(a.idlang   = '".$lang."' {SYNCOPTIONS}) AND
					a.idart     = b.idart AND
					b.idclient  = '".$client."' AND
					b.idart     = c.idart AND
					c.idcat     = '".$idcat."'";
			
		// Simple SQL statement to get the number of articles
		$sql_count =
				"SELECT 
					COUNT(*) AS article_count
				 FROM
					".$cfg["tab"]["art_lang"]." AS a,
					".$cfg["tab"]["art"]." AS b,
					".$cfg["tab"]["cat_art"]." AS c
				 WHERE
					(a.idlang   = '".$lang."' {SYNCOPTIONS}) AND
					a.idart     = b.idart AND
					b.idclient  = '".$client."' AND
					b.idart     = c.idart AND
					c.idcat     = '".$idcat."'";

		if ($cfg["is_start_compatible"] == true)
		{
			$sql = str_replace("{ISSTART}", "c.is_start AS is_start,", $sql);
		} else {
			$sql = str_replace("{ISSTART}", "", $sql);
		}

		if ($syncoptions == -1)
		{
			$sql 		= str_replace("{SYNCOPTIONS}", "", $sql);
			$sql_count	= str_replace("{SYNCOPTIONS}", "", $sql_count);
		} else {
			$sql 		= str_replace("{SYNCOPTIONS}", "OR a.idlang = '".$syncoptions."'", $sql);
			$sql_count	= str_replace("{SYNCOPTIONS}", "OR a.idlang = '".$syncoptions."'", $sql_count);
		}

		# Article sort
		switch ($sort)
		{
			case 2:
				$sql .= " ORDER BY a.lastmodified DESC";
				break;
			case 3:
        		$sql .= " ORDER BY a.published DESC, a.lastmodified DESC";
				break;
			case 4:
				$sql .= " ORDER BY a.artsort ASC";
				break;
			default:
				// Default sort order
				$sql .= " ORDER BY a.title ASC";
				$sort = 1;
		}


		# Getting article count, if necessary
		if ($elemperpage > 0)
		{
			$db->query($sql_count);
			$db->next_record();
			$iArticleCount = $db->f("article_count");
			 
			# If not beyond scope, limit
			if ($iArticleCount == 0)
			{
				$next = 0;
			} else if ($next >= $iArticleCount) {
				$next = (ceil($iArticleCount / $elemperpage) - 1) * $elemperpage;
			}
			$sql .= " LIMIT $next, $elemperpage";
		} else {
			$iArticleCount = 0; // Will be used to "hide" the browsing area
		}

		# Debug info
		if ( $debug ) {
			echo "<pre>";
			echo $sql;
			echo "</pre>";
		}

		# Getting data
		$db->query($sql);

		# Reset Template
		$tpl->reset();

		# No article
		$no_article = true;

        $aArticles = Array();

        while ($db->next_record() ) {
        	$sItem = "k" . $db->f("idart");
        	
			if ($db->f("idlang") == $lang || !array_key_exists($sItem, $aArticles)) {
				$aArticles[$sItem]["idart"]	= $db->f("idart");
				$aArticles[$sItem]["idlang"]	= $db->f("idlang");
				$aArticles[$sItem]["idartlang"]	= $db->f("idartlang");
				$aArticles[$sItem]["title"]	= $db->f("title");
				if ($cfg["is_start_compatible"]	== true)
				{
					$aArticles[$sItem]["is_start"] = $db->f("is_start");
				} else {
					$aArticles[$sItem]["is_start"] = isStartArticle($db->f("idartlang"), $idcat, $lang);
				}
	
				$aArticles[$sItem]["idcatart"]	= $db->f("idcatart");
				$aArticles[$sItem]["idtplcfg"]	= $db->f("idtplcfg");
				$aArticles[$sItem]["published"]	= $db->f("published");
				$aArticles[$sItem]["online"]	= $db->f("online");
				$aArticles[$sItem]["created"]	= $db->f("created");
				$aArticles[$sItem]["idcat"]		= $db->f("idcat");
				$aArticles[$sItem]["lastmodified"] = $db->f("lastmodified");
				$aArticles[$sItem]["timemgmt"]	= $db->f("timemgmt");
				$aArticles[$sItem]["datestart"]	= $db->f("datestart");
				$aArticles[$sItem]["dateend"]	= $db->f("dateend");
				$aArticles[$sItem]["artsort"]	= $db->f("artsort");
				$aArticles[$sItem]["locked"]	= $db->f("locked");
				$aArticles[$sItem]["redirect"]	= $db->f("redirect");
			}
        }

        $artlist = array();
        	
		foreach ($aArticles as $sart) {
			$dyn_cnt++;
			$idart      = $sart["idart"];
			$idlang		= $sart["idlang"];
			 
			$idtplcfg   = $sart["idtplcfg"];
			$idartlang  = $sart["idartlang"];
			$lidcat      = $sart["idcat"];
			$idcatlang  = 0;
			$idart      = $sart["idart"];
			$published    = $sart["published"];
			$online     = $sart["online"];

			$is_start   = $sart["is_start"];
			 
			$idcatart   = $sart["idcatart"];
			$created    = $sart["created"];
			$modified   = $sart["lastmodified"];
			$title      = htmlspecialchars($sart["title"]);
			$timemgmt   = $sart["timemgmt"];
			$datestart  = $sart["datestart"];
			$dateend    = $sart["dateend"];
			$sortkey    = $sart["artsort"];
			$locked     = $sart["locked"];
                $redirect   = $sart["redirect"];

			$published = ($published != '0000-00-00 00:00:00') ? date($dateformat,strtotime($published)) : i18n("not yet published");
			$created = date($dateformat,strtotime($created));
			$modified = date($dateformat,strtotime($modified));
			$alttitle = "idart".': '.$idart.' '."idcatart".': '.$idcatart.' '."idartlang".': '.$idartlang;

			if (($obj = $col->checkMark("article", $idartlang)) === false)
			{
				$inUse = false;
			} else {
				$vuser = new User;
				$vuser->loadUserByUserID($obj->get("userid"));
				$inUseUser = $vuser->getField("username");
				$inUseUserRealName = $vuser->getField("realname");
					
				$inUse = true;
				$title = $title . " (" . i18n("Article is in use").")";
				$alttitle = sprintf(i18n("Article in use by %s (%s)"), $inUseUser, $inUseUserRealName). " ". $alttitle;
			}

			$bgcolor = $cfg["color"]["table_light"];
			if ($idlang != $lang)
			{
				$bgcolor = ( is_int($dyn_cnt / 2) ) ? $cfg["color"]["table_light_sync"] : $cfg["color"]["table_dark_sync"];
            } else {
            }

			// Zeitsteuerung
			/*
			else 
				{
				if ($online == 1) 
					{
					$bgcolor = ( is_int($dyn_cnt / 2) ) ? $cfg["color"]["table_light"] : $cfg["color"]["table_dark"];
					} 
				else 
					{
					$bgcolor = ( is_int($dyn_cnt / 2) ) ? $cfg["color"]["table_light_offline"] : $cfg["color"]["table_dark_offline"];
					}
				}
			*/



			/* Id of the row,
			 stores informations about
			 the article and category */
			$tmp_rowid  = $idart."-".$idartlang."-".$lidcat."-".$idcatlang."-".$idcatart."-".$idlang;
			$tpl->set('d', 'ROWID', $tmp_rowid);

			$colitem[$tmp_rowid] = $bgcolor;
			# Backgroundcolor of the table row
			$tpl->set('d', 'BGCOLOR', $bgcolor);

			# Article Title
			if ($perm->have_perm_area_action( "con_editcontent", "con_editart" ) ||
			$perm->have_perm_area_action_item( "con_editcontent", "con_editart" ,$idcat) )
			{
				if ($idlang != $lang)
				{
					$tmp_alink = $sess->url("main.php?area=con_editcontent&action=con_editart&changeview=prev&idartlang=$idartlang&idart=$idart&idcat=$idcat&frame=$frame&tmpchangelang=$idlang");
					$titlelink = '<a href="'.$tmp_alink.'" title="'.$alttitle.'">'.$title.'</a>';
				} else {
					$tmp_alink = $sess->url("main.php?area=con_editcontent&action=con_editart&changeview=edit&idartlang=$idartlang&idart=$idart&idcat=$idcat&frame=$frame");
					$titlelink = '<a href="'.$tmp_alink.'" title="'.$alttitle.'">'.$title.'</a>';
				}
			} else {
				$tmp_alink = "";
				$titlelink = $title;
			}

			if ($timemgmt == "1")
			{
				$sql = "SELECT NOW() AS TIME";
				 
				$db3 = new DB_Contenido;
				 
				$db3->query($sql);
				$db3->next_record();

				$starttimestamp = strtotime($datestart);
				$endtimestamp = strtotime($dateend);
				$nowtimestamp = strtotime($db3->f("TIME"));
				 
				if (($nowtimestamp < $endtimestamp) && ($nowtimestamp > $starttimestamp))
				{
					$usetime = '<img src="images/but_time_2.gif" alt="Artikel mit Zeitsteuerung online" title="Artikel mit Zeitsteuerung online" style="margin-left:3px;">';
				} else {
					$usetime = '<img src="images/but_time_1.gif" alt="Artikel mit Zeitsteuerung offline" title="Artikel mit Zeitsteuerung offline" style="margin-left:3px;">';
				}
			} else {
				$usetime = "";
			}


			# Article Title
			if (($perm->have_perm_area_action( "con", "con_lock" ) ||
			$perm->have_perm_area_action_item( "con", "con_lock" ,$idcat)) && $inUse == false )
			{
				if ($locked == 1)
				{
					$lockimg = 'images/article_locked.gif';
					$lockalt = i18n("Unfreeze article");
				} else {
					$lockimg = 'images/article_unlocked.gif';
					$lockalt = i18n("Freeze article");
				}
				$tmp_lock = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_lock&frame=4&idart=$idart&next=$next").'" title="'.$lockalt.'"><img src="'.$lockimg.'" title="'.$lockalt.'" alt="'.$lockalt.'" border="0"></a>';
			} else {
				if ($locked == 1)
				{
					$lockimg = 'images/article_locked.gif';
					$lockalt = i18n("Article is frozen");
				} else {
					$lockimg = 'images/article_unlocked.gif';
					$lockalt = i18n("Article is not frozen");
				}
				$tmp_lock = '<img src="'.$lockimg.'" title="'.$lockalt.'" alt="'.$lockalt.'" border="0">';
			}

			if ($idlang != $lang)
			{
				$lockedlink = "";
			} else {
				$lockedlink = $tmp_lock;
			}

			if ($sortkey == "")
			{
				$sortkey = "&nbsp;";
			}

			$tmp_articletitle = $titlelink;

            # Article conf button
            if ($perm->have_perm_area_action("con_editart","con_edit") ||
                $perm->have_perm_area_action_item("con_editart","con_edit",$idcat))
            {
                $tmp_artconf = '<a href="'.$sess->url("main.php?area=con_editart&action=con_edit&frame=4&idart=$idart&idcat=$idcat").'" title="'.i18n("Article properties").'"><img src="'.$cfg["path"]["images"].'but_art_conf2.gif" alt="'.i18n("Article properties").'" title="'.i18n("Article properties").'" border="0"></a>';
            } else {
                $tmp_artconf="";
            }

            $tmp_sync = '';
            if ($idlang != $lang)
            {   
                
                $sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='$idcat' AND idlang='$lang'";
                
                $db->query($sql);
                if ($db->next_record())
                {
                    $tmp_sync = '<a href="'.$sess->url("main.php?area=con&action=con_syncarticle&syncarticle=$idart&sourcelanguage=$idlang&frame=4&idcat=$idcat&next=$next").'" title="'.i18n("Copy article to the current language").'"><img src="'.$cfg["path"]["images"].'but_sync_art.gif" alt="'.i18n("Copy article to the current language").'" title="'.i18n("Copy article to the current language").'" border="0" style="margin-left:3px;"></a>';
                    
                } else {
                    $tmp_sync = "";	
                }             
            }
            
			# Article Template
			if ( !is_object($db2) )
			{
				$db2 = new DB_Contenido;
			}

			$sql2 = 
				"SELECT
	      	b.name AS tplname,
					b.idtpl AS idtpl,
					b.description AS description
        FROM
	        ".$cfg["tab"]["tpl_conf"]." AS a,
	        ".$cfg["tab"]["tpl"]." AS b
        WHERE
	        a.idtplcfg = '".$idtplcfg."' AND
	        a.idtpl = b.idtpl";

			$db2->query($sql2);
			$db2->next_record();

			$a_tplname = $db2->f("tplname");
			$a_idtpl = $db2->f("idtpl");
			
			$templateDescription = $db2->f("description");
			
			
			# Uses Category Template
			if ( 0 == $idtplcfg )
			{
				$a_tplname = "--- ".i18n("None")." ---";
			}

			# Make Startarticle button
			$imgsrc = "isstart";
				 
			if ($is_start == false) {
				$imgsrc.='0';
				} else {
				$imgsrc.='1';
				}
				 
			if (isArtInMultipleUse($idart)) {
				$imgsrc.='m';
			}

			if ((int)$redirect == 1) {
				$imgsrc.='r';
			}
			
			$imgsrc.='.gif';

			if ( ($perm->have_perm_area_action("con","con_makestart") || $perm->have_perm_area_action_item("con","con_makestart",$idcat)) && $idcat != 0) {
				if ( $is_start == false) {
					$tmp_link = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_makestart&idcatart=$idcatart&frame=4&is_start=1&next=$next").'" title="'.i18n("Flag as start article").'"><img src="images/'.$imgsrc.'" border="0" title="'.i18n("Flag as start article").'" alt="'.i18n("Flag as start article").'" style="margin-left:3px;"></a>';
				} else {
					$tmp_link = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_makestart&idcatart=$idcatart&frame=4&is_start=0&next=$next").'" title="'.i18n("Flag as normal article").'"><img src="images/'.$imgsrc.'" border="0" title="'.i18n("Flag as normal article").'" alt="'.i18n("Flag as normal article").'" style="margin-left:3px;"></a>';
				}
			} else {
				if ($is_start == true) {
					$sTitle = i18n("Start article"); 
			} else {
					$sTitle = i18n("Normal article");
				}
				
				$tmp_img = '<img src="images/'.$imgsrc.'" border="0" title="'.$sTitle.'" alt="'.$sTitle.'" style="margin-left:3px;">'; 
				
				$tmp_link = $tmp_img;
			}

			$tmp_start = $tmp_link;

			# Make copy button
			if ( ($perm->have_perm_area_action("con","con_duplicate") || $perm->have_perm_area_action_item("con","con_duplicate",$idcat)) && $idcat != 0) {
				 
				$imgsrc = "but_copy.gif";
				$tmp_link = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_duplicate&duplicate=$idart&frame=4&next=$next").'" title="'.i18n("Duplicate article").'"><img src="images/'.$imgsrc.'" border="0" title="'.i18n("Duplicate article").'" alt="'.i18n("Duplicate article").'" style="margin-left:3px;"></a>';
			} else {
				$tmp_link = "";
			}

			if ($idlang != $lang)
			{
				$duplicatelink = "";
			} else {
				$duplicatelink = $tmp_link;
			}
			 
			$subject = urlencode(sprintf(i18n("Reminder for Article '%s'"),$title));
			$mycatname = "";
			conCreateLocationString($idcat, "&nbsp;/&nbsp;", $mycatname);
			$message = urlencode(sprintf(i18n("Reminder for Article '%s'\nCategory: %s"),$title,$mycatname));

			$todolink = new TODOLink("idart", $idart, $subject, $message);

			# Make On-/Offline button
			if ( $online ) {
				if (($perm->have_perm_area_action("con","con_makeonline") ||
				$perm->have_perm_area_action_item("con","con_makeonline",$idcat)) && ($idcat != 0))
				{
					$tmp_online = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_makeonline&frame=4&idart=$idart&next=$next").'" title="'.i18n("Make offline").'"><img src="images/online.gif" title="'.i18n("Make offline").'" alt="'.i18n("Make offline").'" border="0" style="margin-left:3px;"></a>';
				} else {
					$tmp_online = '<img src="images/online.gif" title="'.i18n("Article is online").'" alt="'.i18n("Article is online").'" border="0" style="margin-left:3px;">';
				}
			} else {
				if (($perm->have_perm_area_action("con","con_makeonline") ||
				$perm->have_perm_area_action_item("con","con_makeonline",$idcat)) && ($idcat != 0))
				{
					$tmp_online = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_makeonline&frame=4&idart=$idart&next=$next").'" title="'.i18n("Make online").'"><img src="images/offline.gif" title="'.i18n("Make online").'" alt="'.i18n("Make online").'" border="0" style="margin-left:3px;"></a>';
				} else {
					$tmp_online = '<img src="images/offline.gif" title="'.i18n("Article is offline").'" alt="'.i18n("Article is offline").'" border="0" style="margin-left:3px;">';
				}
			}

			if ($idlang != $lang)
			{
				$onlinelink = "";
			} else {
				$onlinelink = $tmp_online;
			}

			# Delete button
			if (($perm->have_perm_area_action("con","con_deleteart") ||
			$perm->have_perm_area_action_item("con","con_deleteart",$idcat)) && $inUse == false)
			{
				$tmp_title = $title;

				if (strlen($tmp_title) > 30)
				{
					$tmp_title = substr($tmp_title, 0, 27) . "...";
				}
				 
				$confirmString = sprintf(i18n("Are you sure to delete the following article:<br><br><b>%s</b>"),htmlspecialchars($tmp_title));
				$tmp_del = '<a href="javascript://" onclick="box.confirm("'.i18n("Delete article").'", "'.addslashes($confirmString).'", "deleteArticle('.$idart.','.$idcat.','.$next.')")" title="'.i18n("Delete article").'"><img src="images/delete.gif" title="'.i18n("Delete article").'" alt="'.i18n("Delete article").'" border="0" style="margin-left:3px;"></a>';
				 
			} else {
				$tmp_del = "";
			}

			if ($idlang != $lang)
			{
				$deletelink = "";
			} else {
				$deletelink = $tmp_del;
			}

			// DIRECTION
			cInclude('includes', 'functions.lang.php');
			$tpl->set('d', 'DIRECTION', 'dir="' . langGetTextDirection($lang) . '"');

			# Next iteration

			# Articles found
			$no_article = false;
			foreach ($listColumns as $listColumn => $ctitle)
			{
				switch ($listColumn)
				{
					case "start":
						$value = $tmp_start;
						break;
					case "title":
						$value = $tmp_articletitle;
						break;
					case "changeddate":
						$value = $modified;
						break;
					case "publisheddate":
						$value = $published;
						break;
					case "sortorder":
						$value = $sortkey;
						break;
					case "template":
						$value = $a_tplname;
						break;
					case "actions":
						$actions = array();
						foreach ($actionList as $actionItem)
						{
							switch ($actionItem)
							{
								case "todo":
									$actionValue = $todolink->render();
									break;
                                case "artconf":
                                    $actionValue = $tmp_artconf;
                                    break; 
								case "online":
									$actionValue = $onlinelink;
									break;
								case "locked":
									$actionValue = $lockedlink;
									break;
								case "duplicate":
									$actionValue = $duplicatelink;
									break;
								case "delete":
									$actionValue = $deletelink;
									break;
								case "usetime":
									$actionValue = $usetime;
									break;
								default:
									/* Ask chain about the entry */
									$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.RenderAction");
                                    $contents = array();
									if ($_cecIterator->count() > 0)
									{
										while ($chainEntry = $_cecIterator->next())
										{
											$contents[]  = $chainEntry->execute($idcat, $idart, $idartlang, $actionItem);
										}
									}
									$actionValue = implode("", $contents);
									break;
							}

							$actions[] = $actionValue;
						}
                        
                        if ($tmp_sync != '') {
                            $actions[] = $tmp_sync;
                        }
						
						$value = implode("\n", $actions);
						break;
					default:
						$contents = array();
						/* Call chain to retrieve value */
						$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.RenderColumn");
										
						if ($_cecIterator->count() > 0)
						{
							$contents = array();
							while ($chainEntry = $_cecIterator->next())
							{
								$contents[]  = $chainEntry->execute($idcat, $idart, $idartlang, $listColumn);
							}
						}
						$value = implode("", $contents);
				}
				$artlist[$tmp_rowid][$listColumn] = $value;
				$artlist[$tmp_rowid]['templateDescription'] = $templateDescription;
			}
		}


		$headers = array();

		foreach ($listColumns as $key => $listColumn)
		{
			/* Dirty hack to force column widths */
			if ($key == "title" || $listColumn == i18n("Title"))
			{
				$headers[] = '<td width="100%" class="headerbordercell" nowrap="nowrap">'.$listColumn.'</td>';
			} else {
				$headers[] = '<td width="1%" class="headerbordercell" nowrap="nowrap">'.$listColumn.'</td>';
			}
		}

		$tpl->set('s', 'HEADERS', implode("\n", $headers));

		if ($elemperpage > 0 && $iArticleCount > 0)
		{
			for ($i = 1; $i <= ceil($iArticleCount / $elemperpage); $i++)
			{
				$iNext = ($i - 1) * $elemperpage;
				if ($sBrowseLinks !== "") {
					$sBrowseLinks .= "&nbsp;";
				}
				if ($next == $iNext)
				{
					$sBrowseLinks .= $i."\n"; // I'm on the current page, no link
				} else {
					$tmp_alink = $sess->url("main.php?area=con&frame=$frame&idcat=$idcat&next=$iNext");
					$sBrowseLinks .= '<a href="'.$tmp_alink.'">'.$i.'</a>'."\n";
				}
			}
			$tpl->set('s', 'NEXT', $next);
			$tpl->set('s', 'BROWSE', sprintf(i18n("Go to page: %s"), $sBrowseLinks));
		} else {
			$tpl->set('s', 'NEXT', "0");
			$tpl->set('s', 'BROWSE', sprintf(i18n("Go to page: %s"), "1"));
		}
        $tpl->set('s', 'CLICK_ROW_NOTIFICATION', i18n("with click select line for further treatment"));
        

		if (count($artlist) > 0)
		{
			foreach ($artlist as $key2 => $artitem)
			{
				if ($firstMark == false) {
					$script = 'function initTheOne() {
                                   var theOne = document.getElementById("'.$key2.'");
                                   artRow.reset();
		                           artRow.over( theOne );
		                           artRow.click( theOne )
                               }
                               initTheOne()';
					$firstMark = true;
					$tpl->set('s', 'ROWMARKSCRIPT', $script);
				}

				$cells = array();

				foreach ($listColumns as $key => $listColumn)
				{
					// Description for hover effect
					if($key == 'template')
					{
						$templateDescription = $artitem['templateDescription'];
						$descString = '<b>'.$artitem[$key].'</b>';
						
						if( sizeof($templateDescription)>0 )
						{
							$descString .= '<br>'.$templateDescription;
						}
                        $sTemplatename = capiStrTrimHard($artitem[$key], 20);
                        if (strlen($artitem[$key]) > 20) {
                            $cells[] = '<td nowrap="nowrap" class="bordercell" onmouseover="Tip(\''.$descString.'\', BALLOON, true, ABOVE, true);">'.$sTemplatename.'</td>';
                        } else {
                            $cells[] = '<td nowrap="nowrap" class="bordercell">'.$artitem[$key].'</td>';
                        }
                    }
					else
					{
						$cells[] = '<td nowrap="nowrap" class="bordercell">'.$artitem[$key].'</td>';
					}
				}
				$tpl->set('d', 'CELLS', implode("\n", $cells));
				$tpl->set('d', 'BGCOLOR', $colitem[$key2]);
                
                if ($colitem[$key2] == $cfg["color"]["table_dark_sync"] || $colitem[$key2] == $cfg["color"]["table_light_sync"]) {
                    $tpl->set('d', 'CSS_CLASS', 'class="con_sync"');
                } else {
                    $tpl->set('d', 'CSS_CLASS', '');
                }
                
				$tpl->set('d', 'ROWID', $key2);
				$tpl->next();
			}
		}else
		{
			$emptyCell = '<td nowrap="nowrap" class="bordercell" colspan="'.count($listColumns).'">'.i18n("No articles found").'</td>';
			$tpl->set('d', 'CELLS', $emptyCell);
			$tpl->set('s', 'ROWMARKSCRIPT', '');
		}

		# Sortierungs select
		$s_types = array(1 => i18n("Alphabetical"),
		2 => i18n("Last change"),
		3 => i18n("Published date"),
		4 => i18n("Sort key"));

		$tpl2 = new Template;
		$tpl2->set('s', 'NAME', 'sort');
		$tpl2->set('s', 'CLASS', 'text_medium');
		$tpl2->set('s', 'OPTIONS', 'onchange="artSort(this)"');

		foreach ($s_types as $key => $value) {

			$selected = ( $sort == $key ) ? 'selected="selected"' : '';

			$tpl2->set('d', 'VALUE',    $key);
			$tpl2->set('d', 'CAPTION',  $value);
			$tpl2->set('d', 'SELECTED', $selected);
			$tpl2->next();

		}

		$select     = ( !$no_article ) ? $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true) : '&nbsp;';
		$caption    = ( !$no_article ) ? i18n("Sort articles:") : '&nbsp;';

		$tpl->set('s', 'ARTSORTCAPTION', $caption);
		$tpl->set('s', 'ARTSORT', $select);

		# Elements per Page select
		$aElemPerPage =   array(0 	=> i18n("All"),
		25 	=> "25",
		50 	=> "50",
		75 	=> "75",
		100	=> "100");

		$tpl2 = new Template;
		$tpl2->set('s', 'NAME', 'sort');
		$tpl2->set('s', 'CLASS', 'text_medium');
		$tpl2->set('s', 'OPTIONS', 'onchange="changeElemPerPage(this)"');

		foreach ($aElemPerPage as $key => $value) {
			$selected = ( $elemperpage == $key ) ? 'selected="selected"' : '';

			$tpl2->set('d', 'VALUE',    $key);
			$tpl2->set('d', 'CAPTION',  $value);
			$tpl2->set('d', 'SELECTED', $selected);
			$tpl2->next();
		}

		$select     = ( !$no_article ) ? $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true) : '&nbsp;';
		$caption    = ( !$no_article ) ? i18n("Items per page:") : '&nbsp;';

		$tpl->set('s', 'ELEMPERPAGECAPTION', $caption);
		$tpl->set('s', 'ELEMPERPAGE', $select);

		
		# Extract Category and Catcfg
		$sql = "SELECT
                    b.name AS name,
                    d.idtpl AS idtpl
                FROM
                    (".$cfg["tab"]["cat"]." AS a,
                    ".$cfg["tab"]["cat_lang"]." AS b,
                    ".$cfg["tab"]["tpl_conf"]." AS c)
                LEFT JOIN
                    ".$cfg["tab"]["tpl"]." AS d
                ON
                    d.idtpl = c.idtpl
                WHERE
                    a.idclient = '".$client."' AND
                    a.idcat    = '".$idcat."' AND
                    b.idlang   = '".$lang."' AND
                    b.idcat    = a.idcat AND
                    c.idtplcfg = b.idtplcfg";

		$db->query($sql);

		if ($db->next_record())
		{
			//$foreignlang = false;
			//conCreateLocationString($idcat, "&nbsp;/&nbsp;", $cat_name);
		} 
		/*else {
			if ($syncoptions != "")
			{
				$foreignlang = true;
				conCreateLocationString($idcat, "&nbsp;/&nbsp;", $cat_name, false, "", 0, $syncoptions);
			} 
			else {
				$foreignlang = false;
				conCreateLocationString($idcat, "&nbsp;/&nbsp;", $cat_name);
			}
		}*/
		
		
		// Show path of selected category to user
		prCreateURLNameLocationString($idcat, '/', $cat_name_tmp);
		
		if ($cat_name_tmp != '') {
			$cat_name = '<div class="categorypath">';
			$cat_name .= $cat_name_tmp.'/'.htmlspecialchars($sFistArticleName);
			$cat_name .= "</div>";
		} else {
			$cat_name = '';
		}
		
		$cat_idtpl = $db->f("idtpl");

		# Hinweis wenn kein Artikel gefunden wurde
		if ( $no_article ) {

			$tpl->set("d", "START",         "&nbsp;");
			$tpl->set("d", "ARTICLE",       i18n("No articles found"));
			$tpl->set("d", "PUBLISHED",     "&nbsp;");
			$tpl->set("d", "LASTMODIFIED",  "&nbsp;");
			$tpl->set("d", "ARTCONF",       "&nbsp;");
			$tpl->set("d", "TPLNAME",       "&nbsp;");
			$tpl->set("d", "LOCKED",       "&nbsp;");
			$tpl->set("d", "DUPLICATE",     "&nbsp;");
			$tpl->set("d", "TPLCONF",       "&nbsp;");
			$tpl->set("d", "ONLINE",        "&nbsp;");
			$tpl->set("d", "DELETE",        "&nbsp;");
			$tpl->set("d", "USETIME",       "&nbsp;");
			$tpl->set("d", "TODO",       "&nbsp;");
			$tpl->set("d", "SORTKEY",       "&nbsp;");

			$tpl->next();
		}

		# Kategorie anzeigen und Konfigurieren button
		/* JL 23.06.03 Check right from "Content" instead of "Category"
		if ($perm->have_perm_area_action("str_tplcfg","str_tplcfg") ||
		$perm->have_perm_area_action_item("str_tplcfg","str_tplcfg",$lidcat)) */

		if (($perm->have_perm_area_action_item( "con", "con_tplcfg_edit", $idcat ) ||
		$perm->have_perm_area_action( "con", "con_tplcfg_edit" )) && $foreignlang == false) {

			if ( 0 != $idcat ) {
								//$tmp_link = '<a href="'.$sess->url("main.php?area=con_tplcfg&action=tplcfg_edit&idcat=$idcat&frame=4&mode=art").'">'.i18n("Configure Category").'</a>';
								//$tmp_img  = '<a href="'.$sess->url("main.php?area=con_tplcfg&action=tplcfg_edit&idcat=$idcat&frame=4&mode=art").'"><img src="'.$cfg["path"]["images"].'but_cat_conf2.gif" border="0" title="'.i18n("Configure Category").'" alt="'.i18n("Configure Category").'"></a>';

				$tpl->set('s', 'CATEGORY', $cat_name);
				$tpl->set('s', 'CATEGORY_CONF', $tmp_img);
				$tpl->set('s', 'CATEGORY_LINK', $tmp_link);
			} else {
				$tpl->set('s', 'CATEGORY', $cat_name);
				$tpl->set('s', 'CATEGORY_CONF', '&nbsp;');
				$tpl->set('s', 'CATEGORY_LINK', '&nbsp;');
			}
		} else {
			$tpl->set('s', 'CATEGORY', $cat_name);
			$tpl->set('s', 'CATEGORY_CONF', '&nbsp;');
			$tpl->set('s', 'CATEGORY_LINK', '&nbsp;');
		}

		# SELF_URL (Variable für das javascript);
		$tpl->set('s', 'SELF_URL', $sess->url("main.php?area=con&frame=4&idcat=$idcat"));

		# New Article link
		if (($perm->have_perm_area_action("con_editart", "con_newart") ||
		$perm->have_perm_area_action_item("con_editart", "con_newart", $idcat)) && $foreignlang == false)
		{
			if ( $idcat != 0 && $cat_idtpl != 0)
			{
				$tpl->set('s', 'NEWARTICLE_TEXT', '<a href="'.$sess->url("main.php?area=con_editart&frame=$frame&action=con_newart&idcat=$idcat").'">'.i18n("Create new article").'</a>');
				$tpl->set('s', 'NEWARTICLE_IMG', '<a href="'.$sess->url("main.php?area=con_editart&frame=$frame&action=con_newart&idcat=$idcat").'" title="'.i18n("Create new article").'"><img src="images/but_art_new.gif" border="0" alt="'.i18n("Create new article").'"></a>');
			}
			else
			{
				$tpl->set('s', 'NEWARTICLE_TEXT', '&nbsp;');
				$tpl->set('s', 'NEWARTICLE_IMG', '&nbsp;');
			}
		}
		else
		{
			$tpl->set('s', 'NEWARTICLE_TEXT', '&nbsp;');
			$tpl->set('s', 'NEWARTICLE_IMG', '&nbsp;');
		}

		$str = "";

		/* Session ID */
		$tpl->set('s', 'SID', $sess->id);

		 
		$tpl->set('s', 'NOTIFICATION', $str);

		# Generate template
		$tpl->generate($cfg['path']['templates'] . $cfg['templates']['con_art_overview']);
	} else {
		$notification->displayNotification("error", i18n("Permission denied"));
	}
} else {
	$tpl->reset();
	$tpl->set('s', 'CONTENTS', '');
	$tpl->generate($cfg['path']['templates'] . $cfg['templates']['blank']);
}

?>
Lieben Gruß, der Snuppel

OliverL
Beiträge: 870
Registriert: Do 28. Jun 2007, 09:28
Kontaktdaten:

Beitrag von OliverL » Mo 21. Apr 2008, 08:02

Erst mal schickes ding!

Die Datei die du gepostet hast ist aber in keiner form geändert worden oder?

BASIS ist bei mir (noch) 4.6.1

dann meine neue "includes/include.con_art_overview.php":

Code: Alles auswählen

<?php

/******************************************
 * File      :   includes.con_art_overview.php
 * Project   :   Contenido
 * Descr     :   Displays all articles
 *               of a category
 *
 * Author    :   Jan Lengowski
 * Created   :   26.01.2003
 * Modified  :   23.06.2003
 * Modified  :   23.06.2005 by Andreas Lindner
 *
 * © four for business AG
 *****************************************/

cInclude("includes","functions.tpl.php");
cInclude("includes","functions.str.php");
cInclude("classes", "class.todo.php");
cInclude("includes", "functions.pathresolver.php");
$firstMark = false;
$db2 = new DB_Contenido;

$idcat	= ( isset($_GET['idcat']) && is_numeric($_GET['idcat'])) ? $_GET['idcat'] : -1;
$next	= ( isset($_GET['next']) && is_numeric($_GET['next']) && $_GET['next'] > 0) ? $_GET['next'] : 0;

$dateformat = getEffectiveSetting("backend", "timeformat_date", "Y-m-d");
$debug = false;
$templateDescription = '';

if (!isset($syncfrom))
{
	$syncfrom = -1;
}

$syncoptions = $syncfrom;

if ($action == "con_duplicate")
{
	$newidartlang = conCopyArticle($duplicate, $idcat);
}

if ($action == "con_syncarticle")
{
	/* Verify that the category is available in this language */
	$sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='$idcat' AND idlang='$lang'";
	$db->query($sql);
	if ($db->next_record())
	{
		conSyncArticle($syncarticle, $sourcelanguage, $lang);
	} else {
		strSyncCategory($idcat, $sourcelanguage, $lang);
		conSyncArticle($syncarticle, $sourcelanguage, $lang);
	}
}

/* Which columns to display? */
$listColumns = array(	"start" => i18n("Article"),
						"actions" => i18n("Actions"),
						"title" => i18n("Title"),
						"changeddate" => i18n("Changed"),
						"publisheddate" => i18n("Published"),
						"sortorder" => i18n("Sort order"),
						"template" => i18n("Template"));

/* Which actions to display? 
$actionList = array(	"online",
						"tplconf",
						"duplicate",
						"locked",
						"todo",
						"artconf",
						"delete",
						"usetime");
*/

/* Which actions to display? */
$actionList = array(	"online",
						"duplicate",
						"locked",
						"todo",
						"delete",
						"usetime");


/* Call chains to process the columns and the action list */
$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.Columns");

if ($_cecIterator->count() > 0)
{
	while ($chainEntry = $_cecIterator->next())
	{
		$newColumnList = $chainEntry->execute($listColumns);
	  
		if (is_array($newColumnList))
		{
			$listColumns = $newColumnList;
		}
	}
}

$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.Actions");

if ($_cecIterator->count() > 0)
{
	while ($chainEntry = $_cecIterator->next())
	{
		$newActionList = $chainEntry->execute($actionList);
	  
		if (is_array($newActionList))
		{
			$actionList = $newActionList;
		}
	}
}

$cat_idtpl = 0;

if ( is_numeric($idcat) && ($idcat >= 0)) {
	// Saving sort and elements per page user settings (if specified)
	// Should be changed to User->setProperty... someday
	if (isset($sort))
	{
		$currentuser->setUserProperty("system","sortorder-idlang-$lang-idcat-$idcat",$sort);
	}

	if (isset($elemperpage) && is_numeric($elemperpage))
	{
		$currentuser->setUserProperty("system","elemperpage-idlang-$lang-idcat-$idcat", $elemperpage);

		/* Currently save all settings, as "all" is "old" behaviour and just in case there is some bug
		 * with article browsing...
		 if ($elemperpage > 0)
		 {
			// Don't save "all" (= 0) as you may not get back to a save harbor
			...
			} */
	} else {
		$elemperpage = $currentuser->getUserProperty("system","elemperpage-idlang-$lang-idcat-$idcat");

		if (!is_numeric($elemperpage))
		{
			$elemperpage = 25;
		}
	}

	$col = new InUseCollection;

	if (((  $idcat == 0 ||
	$perm->have_perm_area_action("con")) && $perm->have_perm_item("str", $idcat))   ||
	$perm->have_perm_area_action("con", "con_makestart")                    ||
	$perm->have_perm_area_action("con", "con_makeonline")                   ||
	$perm->have_perm_area_action("con", "con_deleteart")                    ||
	$perm->have_perm_area_action("con", "con_tplcfg_edit")                  ||
	$perm->have_perm_area_action("con", "con_lock") 	                    ||
	$perm->have_perm_area_action("con", "con_makecatonline")                ||
	$perm->have_perm_area_action("con", "con_changetemplate")               ||
	$perm->have_perm_area_action("con_editcontent", "con_editart")          ||
	$perm->have_perm_area_action("con_editart", "con_edit")                 ||
	$perm->have_perm_area_action("con_editart", "con_newart")               ||
	$perm->have_perm_area_action("con_editart", "con_saveart")				||
	$perm->have_perm_area_action("con_tplcfg", "con_tplcfg_edit")           ||
	$perm->have_perm_area_action_item("con", "con_makestart", $idcat)       ||
	$perm->have_perm_area_action_item("con", "con_makeonline", $idcat)      ||
	$perm->have_perm_area_action_item("con", "con_deleteart", $idcat)       ||
	$perm->have_perm_area_action_item("con", "con_tplcfg_edit", $idcat)     ||
	$perm->have_perm_area_action_item("con", "con_lock", $idcat)            ||
	$perm->have_perm_area_action_item("con", "con_makecatonline", $idcat)   ||
	$perm->have_perm_area_action_item("con", "con_changetemplate", $idcat)  ||
	$perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat)       ||
	$perm->have_perm_area_action_item("con_editart", "con_edit", $idcat)    ||
	$perm->have_perm_area_action_item("con_editart", "con_newart", $idcat)  ||
	$perm->have_perm_area_action_item("con_tplcfg", "con_tplcfg_edit",$idcat) ||
	$perm->have_perm_area_action_item("con_editart", "con_saveart", $idcat)) {

		$sort = $currentuser->getUserProperty("system","sortorder-idlang-$lang-idcat-$idcat");

		$sql  = "SELECT
					a.idart AS idart,
					a.idlang AS idlang,
					a.idartlang AS idartlang,
					a.title AS title,
					c.idcat AS idcat,
					{ISSTART}
					c.idcatart AS idcatart,
					a.idtplcfg AS idtplcfg,
					a.published AS published,
					a.online AS online,
					a.created AS created,
					a.lastmodified AS lastmodified,
					a.timemgmt AS timemgmt,
					a.datestart AS datestart,
					a.dateend AS dateend,
					a.artsort AS artsort,
					a.redirect AS redirect,
					a.locked AS locked
				 FROM
					".$cfg["tab"]["art_lang"]." AS a,
					".$cfg["tab"]["art"]." AS b,
					".$cfg["tab"]["cat_art"]." AS c
				 WHERE
					(a.idlang   = '".$lang."' {SYNCOPTIONS}) AND
					a.idart     = b.idart AND
					b.idclient  = '".$client."' AND
					b.idart     = c.idart AND
					c.idcat     = '".$idcat."'";
			
		// Simple SQL statement to get the number of articles
		$sql_count =
				"SELECT 
					COUNT(*) AS article_count
				 FROM
					".$cfg["tab"]["art_lang"]." AS a,
					".$cfg["tab"]["art"]." AS b,
					".$cfg["tab"]["cat_art"]." AS c
				 WHERE
					(a.idlang   = '".$lang."' {SYNCOPTIONS}) AND
					a.idart     = b.idart AND
					b.idclient  = '".$client."' AND
					b.idart     = c.idart AND
					c.idcat     = '".$idcat."'";

		if ($cfg["is_start_compatible"] == true)
		{
			$sql = str_replace("{ISSTART}", "c.is_start AS is_start,", $sql);
		} else {
			$sql = str_replace("{ISSTART}", "", $sql);
		}

		if ($syncoptions == -1)
		{
			$sql 		= str_replace("{SYNCOPTIONS}", "", $sql);
			$sql_count	= str_replace("{SYNCOPTIONS}", "", $sql_count);
		} else {
			$sql 		= str_replace("{SYNCOPTIONS}", "OR a.idlang = '".$syncoptions."'", $sql);
			$sql_count	= str_replace("{SYNCOPTIONS}", "OR a.idlang = '".$syncoptions."'", $sql_count);
		}

		# Article sort
		switch ($sort)
		{
			case 2:
				$sql .= " ORDER BY a.lastmodified DESC";
				break;
			case 3:
        		$sql .= " ORDER BY a.published DESC, a.lastmodified DESC";
				break;
			case 4:
				$sql .= " ORDER BY a.artsort ASC";
				break;
			default:
				// Default sort order
				$sql .= " ORDER BY a.title ASC";
				$sort = 1;
		}


		# Getting article count, if necessary
		if ($elemperpage > 0)
		{
			$db->query($sql_count);
			$db->next_record();
			$iArticleCount = $db->f("article_count");
			 
			# If not beyond scope, limit
			if ($iArticleCount == 0)
			{
				$next = 0;
			} else if ($next >= $iArticleCount) {
				$next = (ceil($iArticleCount / $elemperpage) - 1) * $elemperpage;
			}
			$sql .= " LIMIT $next, $elemperpage";
		} else {
			$iArticleCount = 0; // Will be used to "hide" the browsing area
		}

		# Debug info
		if ( $debug ) {
			echo "<pre>";
			echo $sql;
			echo "</pre>";
		}

		# Getting data
		$db->query($sql);

		# Reset Template
		$tpl->reset();

		# No article
		$no_article = true;

        $aArticles = Array();

        while ($db->next_record() ) {
        	$sItem = "k" . $db->f("idart");
        	
			if ($db->f("idlang") == $lang || !array_key_exists($sItem, $aArticles)) {
				$aArticles[$sItem]["idart"]	= $db->f("idart");
				$aArticles[$sItem]["idlang"]	= $db->f("idlang");
				$aArticles[$sItem]["idartlang"]	= $db->f("idartlang");
				$aArticles[$sItem]["title"]	= $db->f("title");
				if ($cfg["is_start_compatible"]	== true)
				{
					$aArticles[$sItem]["is_start"] = $db->f("is_start");
				} else {
					$aArticles[$sItem]["is_start"] = isStartArticle($db->f("idartlang"), $idcat, $lang);
				}
	
				$aArticles[$sItem]["idcatart"]	= $db->f("idcatart");
				$aArticles[$sItem]["idtplcfg"]	= $db->f("idtplcfg");
				$aArticles[$sItem]["published"]	= $db->f("published");
				$aArticles[$sItem]["online"]	= $db->f("online");
				$aArticles[$sItem]["created"]	= $db->f("created");
				$aArticles[$sItem]["idcat"]		= $db->f("idcat");
				$aArticles[$sItem]["lastmodified"] = $db->f("lastmodified");
				$aArticles[$sItem]["timemgmt"]	= $db->f("timemgmt");
				$aArticles[$sItem]["datestart"]	= $db->f("datestart");
				$aArticles[$sItem]["dateend"]	= $db->f("dateend");
				$aArticles[$sItem]["artsort"]	= $db->f("artsort");
				$aArticles[$sItem]["locked"]	= $db->f("locked");
				$aArticles[$sItem]["redirect"]	= $db->f("redirect");
			}
        }

        $artlist = array();
        	
		foreach ($aArticles as $sart) {
			$dyn_cnt++;
			$idart      = $sart["idart"];
			$idlang		= $sart["idlang"];
			 
			$idtplcfg   = $sart["idtplcfg"];
			$idartlang  = $sart["idartlang"];
			$lidcat      = $sart["idcat"];
			$idcatlang  = 0;
			$idart      = $sart["idart"];
			$published    = $sart["published"];
			$online     = $sart["online"];

			$is_start   = $sart["is_start"];
			 
			$idcatart   = $sart["idcatart"];
			$created    = $sart["created"];
			$modified   = $sart["lastmodified"];
			$title      = htmlspecialchars($sart["title"]);
			$timemgmt   = $sart["timemgmt"];
			$datestart  = $sart["datestart"];
			$dateend    = $sart["dateend"];
			$sortkey    = $sart["artsort"];
			$locked     = $sart["locked"];
                $redirect   = $sart["redirect"];

			$published = ($published != '0000-00-00 00:00:00') ? date($dateformat,strtotime($published)) : i18n("not yet published");
			$created = date($dateformat,strtotime($created));
			$modified = date($dateformat,strtotime($modified));
			$alttitle = "idart".': '.$idart.' '."idcatart".': '.$idcatart.' '."idartlang".': '.$idartlang;

			if (($obj = $col->checkMark("article", $idartlang)) === false)
			{
				$inUse = false;
			} else {
				$vuser = new User;
				$vuser->loadUserByUserID($obj->get("userid"));
				$inUseUser = $vuser->getField("username");
				$inUseUserRealName = $vuser->getField("realname");
					
				$inUse = true;
				$title = $title . " (" . i18n("Article is in use").")";
				$alttitle = sprintf(i18n("Article in use by %s (%s)"), $inUseUser, $inUseUserRealName). " ". $alttitle;
			}

			$bgcolor = $cfg["color"]["table_light"];
			if ($idlang != $lang)
			{
				$bgcolor = ( is_int($dyn_cnt / 2) ) ? $cfg["color"]["table_light_sync"] : $cfg["color"]["table_dark_sync"];
            } else {
            }

			// Zeitsteuerung
			/*
			else 
				{
				if ($online == 1) 
					{
					$bgcolor = ( is_int($dyn_cnt / 2) ) ? $cfg["color"]["table_light"] : $cfg["color"]["table_dark"];
					} 
				else 
					{
					$bgcolor = ( is_int($dyn_cnt / 2) ) ? $cfg["color"]["table_light_offline"] : $cfg["color"]["table_dark_offline"];
					}
				}
			*/



			/* Id of the row,
			 stores informations about
			 the article and category */
			$tmp_rowid  = $idart."-".$idartlang."-".$lidcat."-".$idcatlang."-".$idcatart."-".$idlang;
			$tpl->set('d', 'ROWID', $tmp_rowid);

			$colitem[$tmp_rowid] = $bgcolor;
			# Backgroundcolor of the table row
			$tpl->set('d', 'BGCOLOR', $bgcolor);

			# Article Title
			if ($perm->have_perm_area_action( "con_editcontent", "con_editart" ) ||
			$perm->have_perm_area_action_item( "con_editcontent", "con_editart" ,$idcat) )
			{
				if ($idlang != $lang)
				{
					$tmp_alink = $sess->url("main.php?area=con_editcontent&action=con_editart&changeview=prev&idartlang=$idartlang&idart=$idart&idcat=$idcat&frame=$frame&tmpchangelang=$idlang");
					$titlelink = '<a href="'.$tmp_alink.'" title="'.$alttitle.'">'.$title.'</a>';
				} else {
					$tmp_alink = $sess->url("main.php?area=con_editcontent&action=con_editart&changeview=edit&idartlang=$idartlang&idart=$idart&idcat=$idcat&frame=$frame");
					$titlelink = '<a href="'.$tmp_alink.'" title="'.$alttitle.'">'.$title.'</a>';
				}
			} else {
				$tmp_alink = "";
				$titlelink = $title;
			}

			if ($timemgmt == "1")
			{
				$sql = "SELECT NOW() AS TIME";
				 
				$db3 = new DB_Contenido;
				 
				$db3->query($sql);
				$db3->next_record();

				$starttimestamp = strtotime($datestart);
				$endtimestamp = strtotime($dateend);
				$nowtimestamp = strtotime($db3->f("TIME"));
				 
				if (($nowtimestamp < $endtimestamp) && ($nowtimestamp > $starttimestamp))
				{
					$usetime = '<img src="images/but_time_2.gif" alt="Artikel mit Zeitsteuerung online" title="Artikel mit Zeitsteuerung online" style="margin-left:3px;">';
				} else {
					$usetime = '<img src="images/but_time_1.gif" alt="Artikel mit Zeitsteuerung offline" title="Artikel mit Zeitsteuerung offline" style="margin-left:3px;">';
				}
			} else {
				$usetime = "";
			}


			# Article Title
			if (($perm->have_perm_area_action( "con", "con_lock" ) ||
			$perm->have_perm_area_action_item( "con", "con_lock" ,$idcat)) && $inUse == false )
			{
				if ($locked == 1)
				{
					$lockimg = 'images/article_locked.gif';
					$lockalt = i18n("Unfreeze article");
				} else {
					$lockimg = 'images/article_unlocked.gif';
					$lockalt = i18n("Freeze article");
				}
				$tmp_lock = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_lock&frame=4&idart=$idart&next=$next").'" title="'.$lockalt.'"><img src="'.$lockimg.'" title="'.$lockalt.'" alt="'.$lockalt.'" border="0"></a>';
			} else {
				if ($locked == 1)
				{
					$lockimg = 'images/article_locked.gif';
					$lockalt = i18n("Article is frozen");
				} else {
					$lockimg = 'images/article_unlocked.gif';
					$lockalt = i18n("Article is not frozen");
				}
				$tmp_lock = '<img src="'.$lockimg.'" title="'.$lockalt.'" alt="'.$lockalt.'" border="0">';
			}

			if ($idlang != $lang)
			{
				$lockedlink = "";
			} else {
				$lockedlink = $tmp_lock;
			}

			if ($sortkey == "")
			{
				$sortkey = "&nbsp;";
			}

			$tmp_articletitle = $titlelink;

            # Article conf button
            if ($perm->have_perm_area_action("con_editart","con_edit") ||
                $perm->have_perm_area_action_item("con_editart","con_edit",$idcat))
            {
                $tmp_artconf = '<a href="'.$sess->url("main.php?area=con_editart&action=con_edit&frame=4&idart=$idart&idcat=$idcat").'" title="'.i18n("Article properties").'"><img src="'.$cfg["path"]["images"].'but_art_conf2.gif" alt="'.i18n("Article properties").'" title="'.i18n("Article properties").'" border="0"></a>';
            } else {
                $tmp_artconf="";
            }

            $tmp_sync = '';
            if ($idlang != $lang)
            {   
                
                $sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='$idcat' AND idlang='$lang'";
                
                $db->query($sql);
                if ($db->next_record())
                {
                    $tmp_sync = '<a href="'.$sess->url("main.php?area=con&action=con_syncarticle&syncarticle=$idart&sourcelanguage=$idlang&frame=4&idcat=$idcat&next=$next").'" title="'.i18n("Copy article to the current language").'"><img src="'.$cfg["path"]["images"].'but_sync_art.gif" alt="'.i18n("Copy article to the current language").'" title="'.i18n("Copy article to the current language").'" border="0" style="margin-left:3px;"></a>';
                    
                } else {
                    $tmp_sync = "";	
                }             
            }
            
			# Article Template
			if ( !is_object($db2) )
			{
				$db2 = new DB_Contenido;
			}

			$sql2 = 
				"SELECT
	      	b.name AS tplname,
					b.idtpl AS idtpl,
					b.description AS description
        FROM
	        ".$cfg["tab"]["tpl_conf"]." AS a,
	        ".$cfg["tab"]["tpl"]." AS b
        WHERE
	        a.idtplcfg = '".$idtplcfg."' AND
	        a.idtpl = b.idtpl";

			$db2->query($sql2);
			$db2->next_record();

			$a_tplname = $db2->f("tplname");
			$a_idtpl = $db2->f("idtpl");
			
			$templateDescription = $db2->f("description");
			
			
			# Uses Category Template
			if ( 0 == $idtplcfg )
			{
				$a_tplname = "--- ".i18n("None")." ---";
			}

			# Make Startarticle button
			$imgsrc = "isstart";
				 
			if ($is_start == false) {
				$imgsrc.='0';
				} else {
				$imgsrc.='1';
				}
				 
			if (isArtInMultipleUse($idart)) {
				$imgsrc.='m';
			}

			if ((int)$redirect == 1) {
				$imgsrc.='r';
			}
			
			$imgsrc.='.gif';

			if ( ($perm->have_perm_area_action("con","con_makestart") || $perm->have_perm_area_action_item("con","con_makestart",$idcat)) && $idcat != 0) {
				if ( $is_start == false) {
					$tmp_link = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_makestart&idcatart=$idcatart&frame=4&is_start=1&next=$next").'" title="'.i18n("Flag as start article").'"><img src="images/'.$imgsrc.'" border="0" title="'.i18n("Flag as start article").'" alt="'.i18n("Flag as start article").'" style="margin-left:3px;"></a>';
				} else {
					$tmp_link = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_makestart&idcatart=$idcatart&frame=4&is_start=0&next=$next").'" title="'.i18n("Flag as normal article").'"><img src="images/'.$imgsrc.'" border="0" title="'.i18n("Flag as normal article").'" alt="'.i18n("Flag as normal article").'" style="margin-left:3px;"></a>';
				}
			} else {
				if ($is_start == true) {
					$sTitle = i18n("Start article"); 
			} else {
					$sTitle = i18n("Normal article");
				}
				
				$tmp_img = '<img src="images/'.$imgsrc.'" border="0" title="'.$sTitle.'" alt="'.$sTitle.'" style="margin-left:3px;">'; 
				
				$tmp_link = $tmp_img;
			}

			$tmp_start = $tmp_link;

			# Make copy button
			if ( ($perm->have_perm_area_action("con","con_duplicate") || $perm->have_perm_area_action_item("con","con_duplicate",$idcat)) && $idcat != 0) {
				 
				$imgsrc = "but_copy.gif";
				$tmp_link = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_duplicate&duplicate=$idart&frame=4&next=$next").'" title="'.i18n("Duplicate article").'"><img src="images/'.$imgsrc.'" border="0" title="'.i18n("Duplicate article").'" alt="'.i18n("Duplicate article").'" style="margin-left:3px;"></a>';
			} else {
				$tmp_link = "";
			}

			if ($idlang != $lang)
			{
				$duplicatelink = "";
			} else {
				$duplicatelink = $tmp_link;
			}
			 
			$subject = urlencode(sprintf(i18n("Reminder for Article '%s'"),$title));
			$mycatname = "";
			conCreateLocationString($idcat, "&nbsp;/&nbsp;", $mycatname);
			$message = urlencode(sprintf(i18n("Reminder for Article '%s'\nCategory: %s"),$title,$mycatname));

			$todolink = new TODOLink("idart", $idart, $subject, $message);

			# Make On-/Offline button
			if ( $online ) {
				if (($perm->have_perm_area_action("con","con_makeonline") ||
				$perm->have_perm_area_action_item("con","con_makeonline",$idcat)) && ($idcat != 0))
				{
					$tmp_online = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_makeonline&frame=4&idart=$idart&next=$next").'" title="'.i18n("Make offline").'"><img src="images/online.gif" title="'.i18n("Make offline").'" alt="'.i18n("Make offline").'" border="0" style="margin-left:3px;"></a>';
				} else {
					$tmp_online = '<img src="images/online.gif" title="'.i18n("Article is online").'" alt="'.i18n("Article is online").'" border="0" style="margin-left:3px;">';
				}
			} else {
				if (($perm->have_perm_area_action("con","con_makeonline") ||
				$perm->have_perm_area_action_item("con","con_makeonline",$idcat)) && ($idcat != 0))
				{
					$tmp_online = '<a href="'.$sess->url("main.php?area=con&idcat=$idcat&action=con_makeonline&frame=4&idart=$idart&next=$next").'" title="'.i18n("Make online").'"><img src="images/offline.gif" title="'.i18n("Make online").'" alt="'.i18n("Make online").'" border="0" style="margin-left:3px;"></a>';
				} else {
					$tmp_online = '<img src="images/offline.gif" title="'.i18n("Article is offline").'" alt="'.i18n("Article is offline").'" border="0" style="margin-left:3px;">';
				}
			}

			if ($idlang != $lang)
			{
				$onlinelink = "";
			} else {
				$onlinelink = $tmp_online;
			}

			# Delete button
			if (($perm->have_perm_area_action("con","con_deleteart") ||
			$perm->have_perm_area_action_item("con","con_deleteart",$idcat)) && $inUse == false)
			{
				$tmp_title = $title;

				if (strlen($tmp_title) > 30)
				{
					$tmp_title = substr($tmp_title, 0, 27) . "...";
				}
				 
				$confirmString = sprintf(i18n("Are you sure to delete the following article:<br><br><b>%s</b>"),htmlspecialchars($tmp_title));
				$tmp_del = '<a href="javascript://" onclick="box.confirm("'.i18n("Delete article").'", "'.addslashes($confirmString).'", "deleteArticle('.$idart.','.$idcat.','.$next.')")" title="'.i18n("Delete article").'"><img src="images/delete.gif" title="'.i18n("Delete article").'" alt="'.i18n("Delete article").'" border="0" style="margin-left:3px;"></a>';
				 
			} else {
				$tmp_del = "";
			}

			if ($idlang != $lang)
			{
				$deletelink = "";
			} else {
				$deletelink = $tmp_del;
			}

			// DIRECTION
			cInclude('includes', 'functions.lang.php');
			$tpl->set('d', 'DIRECTION', 'dir="' . langGetTextDirection($lang) . '"');

			# Next iteration

			# Articles found
			$no_article = false;
			foreach ($listColumns as $listColumn => $ctitle)
			{
				switch ($listColumn)
				{
					case "start":
						$value = $tmp_start;
						break;
					case "title":
						$value = $tmp_articletitle;
						break;
					case "changeddate":
						$value = $modified;
						break;
					case "publisheddate":
						$value = $published;
						break;
					case "sortorder":
						$value = $sortkey;
						break;
					case "template":
						$value = $a_tplname;
						break;
					case "actions":
						$actions = array();
						foreach ($actionList as $actionItem)
						{
							switch ($actionItem)
							{
								case "todo":
									$actionValue = $todolink->render();
									break;
                                case "artconf":
                                    $actionValue = $tmp_artconf;
                                    break; 
								case "online":
									$actionValue = $onlinelink;
									break;
								case "locked":
									$actionValue = $lockedlink;
									break;
								case "duplicate":
									$actionValue = $duplicatelink;
									break;
								case "delete":
									$actionValue = $deletelink;
									break;
								case "usetime":
									$actionValue = $usetime;
									break;
								default:
									/* Ask chain about the entry */
									$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.RenderAction");
                                    $contents = array();
									if ($_cecIterator->count() > 0)
									{
										while ($chainEntry = $_cecIterator->next())
										{
											$contents[]  = $chainEntry->execute($idcat, $idart, $idartlang, $actionItem);
										}
									}
									$actionValue = implode("", $contents);
									break;
							}

							$actions[] = $actionValue;
						}
                        
                        if ($tmp_sync != '') {
                            $actions[] = $tmp_sync;
                        }
						
						$value = implode("\n", $actions);
						break;
					default:
						$contents = array();
						/* Call chain to retrieve value */
						$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.RenderColumn");
										
						if ($_cecIterator->count() > 0)
						{
							$contents = array();
							while ($chainEntry = $_cecIterator->next())
							{
								$contents[]  = $chainEntry->execute($idcat, $idart, $idartlang, $listColumn);
							}
						}
						$value = implode("", $contents);
				}
				$artlist[$tmp_rowid][$listColumn] = $value;
				$artlist[$tmp_rowid]['templateDescription'] = $templateDescription;
			}
		}


		$headers = array();

		foreach ($listColumns as $key => $listColumn)
		{
			/* Dirty hack to force column widths */
			if ($key == "title" || $listColumn == i18n("Title"))
			{
				$headers[] = '<td width="100%" class="headerbordercell" nowrap="nowrap">'.$listColumn.'</td>';
			} else {
				$headers[] = '<td width="1%" class="headerbordercell" nowrap="nowrap">'.$listColumn.'</td>';
			}
		}

		$tpl->set('s', 'HEADERS', implode("\n", $headers));

		if ($elemperpage > 0 && $iArticleCount > 0)
		{
			for ($i = 1; $i <= ceil($iArticleCount / $elemperpage); $i++)
			{
				$iNext = ($i - 1) * $elemperpage;
				if ($sBrowseLinks !== "") {
					$sBrowseLinks .= "&nbsp;";
				}
				if ($next == $iNext)
				{
					$sBrowseLinks .= $i."\n"; // I'm on the current page, no link
				} else {
					$tmp_alink = $sess->url("main.php?area=con&frame=$frame&idcat=$idcat&next=$iNext");
					$sBrowseLinks .= '<a href="'.$tmp_alink.'">'.$i.'</a>'."\n";
				}
			}
			$tpl->set('s', 'NEXT', $next);
			$tpl->set('s', 'BROWSE', sprintf(i18n("Go to page: %s"), $sBrowseLinks));
		} else {
			$tpl->set('s', 'NEXT', "0");
			$tpl->set('s', 'BROWSE', sprintf(i18n("Go to page: %s"), "1"));
		}
        $tpl->set('s', 'CLICK_ROW_NOTIFICATION', i18n("with click select line for further treatment"));
        

		if (count($artlist) > 0)
		{
			foreach ($artlist as $key2 => $artitem)
			{
				if ($firstMark == false) {
					$script = 'function initTheOne() {
                                   var theOne = document.getElementById("'.$key2.'");
                                   artRow.reset();
		                           artRow.over( theOne );
		                           artRow.click( theOne )
                               }
                               initTheOne()';
					$firstMark = true;
					$tpl->set('s', 'ROWMARKSCRIPT', $script);
				}

				$cells = array();

				foreach ($listColumns as $key => $listColumn)
				{
					// Description for hover effect
					if($key == 'template')
					{
						$templateDescription = $artitem['templateDescription'];
						$descString = '<b>'.$artitem[$key].'</b>';
						
						if( sizeof($templateDescription)>0 )
						{
							$descString .= '<br>'.$templateDescription;
						}
                        $sTemplatename = capiStrTrimHard($artitem[$key], 20);
                        if (strlen($artitem[$key]) > 20) {
                            $cells[] = '<td nowrap="nowrap" class="bordercell" onmouseover="Tip(\''.$descString.'\', BALLOON, true, ABOVE, true);">'.$sTemplatename.'</td>';
                        } else {
                            $cells[] = '<td nowrap="nowrap" class="bordercell">'.$artitem[$key].'</td>';
                        }
                    }
					else
					{
						$cells[] = '<td nowrap="nowrap" class="bordercell">'.$artitem[$key].'</td>';
					}
				}
				$tpl->set('d', 'CELLS', implode("\n", $cells));
				$tpl->set('d', 'BGCOLOR', $colitem[$key2]);
                
                if ($colitem[$key2] == $cfg["color"]["table_dark_sync"] || $colitem[$key2] == $cfg["color"]["table_light_sync"]) {
                    $tpl->set('d', 'CSS_CLASS', 'class="con_sync"');
                } else {
                    $tpl->set('d', 'CSS_CLASS', '');
                }
                
				$tpl->set('d', 'ROWID', $key2);
				$tpl->next();
			}
		}else
		{
			$emptyCell = '<td nowrap="nowrap" class="bordercell" colspan="'.count($listColumns).'">'.i18n("No articles found").'</td>';
			$tpl->set('d', 'CELLS', $emptyCell);
			$tpl->set('s', 'ROWMARKSCRIPT', '');
		}

		# Sortierungs select
		$s_types = array(1 => i18n("Alphabetical"),
		2 => i18n("Last change"),
		3 => i18n("Published date"),
		4 => i18n("Sort key"));

		$tpl2 = new Template;
		$tpl2->set('s', 'NAME', 'sort');
		$tpl2->set('s', 'CLASS', 'text_medium');
		$tpl2->set('s', 'OPTIONS', 'onchange="artSort(this)"');

		foreach ($s_types as $key => $value) {

			$selected = ( $sort == $key ) ? 'selected="selected"' : '';

			$tpl2->set('d', 'VALUE',    $key);
			$tpl2->set('d', 'CAPTION',  $value);
			$tpl2->set('d', 'SELECTED', $selected);
			$tpl2->next();

		}

		$select     = ( !$no_article ) ? $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true) : '&nbsp;';
		$caption    = ( !$no_article ) ? i18n("Sort articles:") : '&nbsp;';

		$tpl->set('s', 'ARTSORTCAPTION', $caption);
		$tpl->set('s', 'ARTSORT', $select);

		# Elements per Page select
		$aElemPerPage =   array(0 	=> i18n("All"),
		25 	=> "25",
		50 	=> "50",
		75 	=> "75",
		100	=> "100");

		$tpl2 = new Template;
		$tpl2->set('s', 'NAME', 'sort');
		$tpl2->set('s', 'CLASS', 'text_medium');
		$tpl2->set('s', 'OPTIONS', 'onchange="changeElemPerPage(this)"');

		foreach ($aElemPerPage as $key => $value) {
			$selected = ( $elemperpage == $key ) ? 'selected="selected"' : '';

			$tpl2->set('d', 'VALUE',    $key);
			$tpl2->set('d', 'CAPTION',  $value);
			$tpl2->set('d', 'SELECTED', $selected);
			$tpl2->next();
		}

		$select     = ( !$no_article ) ? $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true) : '&nbsp;';
		$caption    = ( !$no_article ) ? i18n("Items per page:") : '&nbsp;';

		$tpl->set('s', 'ELEMPERPAGECAPTION', $caption);
		$tpl->set('s', 'ELEMPERPAGE', $select);

		
		# Extract Category and Catcfg
		$sql = "SELECT
                    b.name AS name,
                    d.idtpl AS idtpl
                FROM
                    (".$cfg["tab"]["cat"]." AS a,
                    ".$cfg["tab"]["cat_lang"]." AS b,
                    ".$cfg["tab"]["tpl_conf"]." AS c)
                LEFT JOIN
                    ".$cfg["tab"]["tpl"]." AS d
                ON
                    d.idtpl = c.idtpl
                WHERE
                    a.idclient = '".$client."' AND
                    a.idcat    = '".$idcat."' AND
                    b.idlang   = '".$lang."' AND
                    b.idcat    = a.idcat AND
                    c.idtplcfg = b.idtplcfg";

		$db->query($sql);

		if ($db->next_record())
		{
			//$foreignlang = false;
			//conCreateLocationString($idcat, "&nbsp;/&nbsp;", $cat_name);
		} 
		/*else {
			if ($syncoptions != "")
			{
				$foreignlang = true;
				conCreateLocationString($idcat, "&nbsp;/&nbsp;", $cat_name, false, "", 0, $syncoptions);
			} 
			else {
				$foreignlang = false;
				conCreateLocationString($idcat, "&nbsp;/&nbsp;", $cat_name);
			}
		}*/
		
		
		// Show path of selected category to user
		prCreateURLNameLocationString($idcat, '/', $cat_name_tmp);
		
		if ($cat_name_tmp != '') {
			$cat_name = '<div class="categorypath">';
			$cat_name .= $cat_name_tmp.'/'.htmlspecialchars($sFistArticleName);
			$cat_name .= "</div>";
		} else {
			$cat_name = '';
		}
		
		$cat_idtpl = $db->f("idtpl");

		# Hinweis wenn kein Artikel gefunden wurde
		if ( $no_article ) {

			$tpl->set("d", "START",         "&nbsp;");
			$tpl->set("d", "ARTICLE",       i18n("No articles found"));
			$tpl->set("d", "PUBLISHED",     "&nbsp;");
			$tpl->set("d", "LASTMODIFIED",  "&nbsp;");
			$tpl->set("d", "ARTCONF",       "&nbsp;");
			$tpl->set("d", "TPLNAME",       "&nbsp;");
			$tpl->set("d", "LOCKED",       "&nbsp;");
			$tpl->set("d", "DUPLICATE",     "&nbsp;");
			$tpl->set("d", "TPLCONF",       "&nbsp;");
			$tpl->set("d", "ONLINE",        "&nbsp;");
			$tpl->set("d", "DELETE",        "&nbsp;");
			$tpl->set("d", "USETIME",       "&nbsp;");
			$tpl->set("d", "TODO",       "&nbsp;");
			$tpl->set("d", "SORTKEY",       "&nbsp;");

			$tpl->next();
		}

		# Kategorie anzeigen und Konfigurieren button
		/* JL 23.06.03 Check right from "Content" instead of "Category"
		if ($perm->have_perm_area_action("str_tplcfg","str_tplcfg") ||
		$perm->have_perm_area_action_item("str_tplcfg","str_tplcfg",$lidcat)) */

		if (($perm->have_perm_area_action_item( "con", "con_tplcfg_edit", $idcat ) ||
		$perm->have_perm_area_action( "con", "con_tplcfg_edit" )) && $foreignlang == false) {

			if ( 0 != $idcat ) {
								//$tmp_link = '<a href="'.$sess->url("main.php?area=con_tplcfg&action=tplcfg_edit&idcat=$idcat&frame=4&mode=art").'">'.i18n("Configure Category").'</a>';
								//$tmp_img  = '<a href="'.$sess->url("main.php?area=con_tplcfg&action=tplcfg_edit&idcat=$idcat&frame=4&mode=art").'"><img src="'.$cfg["path"]["images"].'but_cat_conf2.gif" border="0" title="'.i18n("Configure Category").'" alt="'.i18n("Configure Category").'"></a>';

				$tpl->set('s', 'CATEGORY', $cat_name);
				$tpl->set('s', 'CATEGORY_CONF', $tmp_img);
				$tpl->set('s', 'CATEGORY_LINK', $tmp_link);
			} else {
				$tpl->set('s', 'CATEGORY', $cat_name);
				$tpl->set('s', 'CATEGORY_CONF', '&nbsp;');
				$tpl->set('s', 'CATEGORY_LINK', '&nbsp;');
			}
		} else {
			$tpl->set('s', 'CATEGORY', $cat_name);
			$tpl->set('s', 'CATEGORY_CONF', '&nbsp;');
			$tpl->set('s', 'CATEGORY_LINK', '&nbsp;');
		}

		# SELF_URL (Variable für das javascript);
		$tpl->set('s', 'SELF_URL', $sess->url("main.php?area=con&frame=4&idcat=$idcat"));

		# New Article link
		if (($perm->have_perm_area_action("con_editart", "con_newart") ||
		$perm->have_perm_area_action_item("con_editart", "con_newart", $idcat)) && $foreignlang == false)
		{
			if ( $idcat != 0 && $cat_idtpl != 0)
			{
				$tpl->set('s', 'NEWARTICLE_TEXT', '<a href="'.$sess->url("main.php?area=con_editart&frame=$frame&action=con_newart&idcat=$idcat").'">'.i18n("Create new article").'</a>');
				$tpl->set('s', 'NEWARTICLE_IMG', '<a href="'.$sess->url("main.php?area=con_editart&frame=$frame&action=con_newart&idcat=$idcat").'" title="'.i18n("Create new article").'"><img src="images/but_art_new.gif" border="0" alt="'.i18n("Create new article").'"></a>');
			}
			else
			{
				$tpl->set('s', 'NEWARTICLE_TEXT', '&nbsp;');
				$tpl->set('s', 'NEWARTICLE_IMG', '&nbsp;');
			}
		}
		else
		{
			$tpl->set('s', 'NEWARTICLE_TEXT', '&nbsp;');
			$tpl->set('s', 'NEWARTICLE_IMG', '&nbsp;');
		}

		$str = "";

		/* Session ID */
		$tpl->set('s', 'SID', $sess->id);

		 
		$tpl->set('s', 'NOTIFICATION', $str);

		# Generate template
		$tpl->generate($cfg['path']['templates'] . $cfg['templates']['con_art_overview']);
	} else {
		$notification->displayNotification("error", i18n("Permission denied"));
	}
} else {
	$tpl->reset();
	$tpl->set('s', 'CONTENTS', '');
	$tpl->generate($cfg['path']['templates'] . $cfg['templates']['blank']);
}

?>









dann meine neue "/plugins/workflow/includes/include.con_art_overview.php":

Code: Alles auswählen

<?php
include_once ($cfg["path"]['contenido'] . $cfg["path"]["plugins"] . "workflow/classes/class.workflow.php");
include_once ($cfg["path"]['contenido'] . $cfg["path"]["plugins"] . "workflow/includes/functions.workflow.php");

global $lngAct, $modidartlang;

$lngAct["workflow"]["workflow_delete"] = i18n("Delete workflow", "workflow");

$lngAct["workflow_common"]["workflow_show"] = i18n("Show workflow", "workflow");
$lngAct["workflow_common"]["workflow_create"] = i18n("Create workflow", "workflow");
$lngAct["workflow_common"]["workflow_save"] = i18n("Edit workflow", "workflow");
$lngAct["con"]["workflow_do_action"] = i18n("Process workflow step", "workflow");
$lngAct["str"]["workflow_inherit_down"] = i18n("Inherit workflow down", "workflow");
$lngAct["str"]["workflow_inherit_down"] = i18n("Inherit workflow down", "workflow");
$lngAct["workflow_steps"]["workflow_step_edit"] = i18n("Edit workflow step", "workflow");
$lngAct["workflow_steps"]["workflow_step_up"] = i18n("Move workflowstep up", "workflow");
$lngAct["workflow_steps"]["workflow_step_down"] = i18n("Move workflowstep down", "workflow");
$lngAct["workflow_steps"]["workflow_save_step"] = i18n("Save Workflowstep", "workflow");
$lngAct["workflow_steps"]["workflow_create_step"] = i18n("Create workflowstep", "workflow");
$lngAct["workflow_steps"]["workflow_step_delete"] = i18n("Delete workflowstep", "workflow");
$lngAct["workflow_steps"]["workflow_user_up"] = i18n("Move workflowstepuser up", "workflow");
$lngAct["workflow_steps"]["workflow_user_down"] = i18n("Move workflowstepuser down", "workflow");
$lngAct["workflow_steps"]["workflow_create_user"] = i18n("Create Workflowstepuser", "workflow");
$lngAct["workflow_steps"]["workflow_user_delete"] = i18n("Delete Workflowstepuser", "workflow");
$lngAct["str"]["workflow_cat_assign"] = i18n("Associate workflow with category", "workflow");

$_cecRegistry->addChainFunction("Contenido.ArticleCategoryList.ListItems", "piworkflowCreateTasksFolder");
$_cecRegistry->addChainFunction("Contenido.ArticleList.Columns", "piworkflowProcessArticleColumns");
$_cecRegistry->addChainFunction("Contenido.ArticleList.Actions", "piworkflowProcessActions");
$_cecRegistry->addChainFunction("Contenido.ArticleList.RenderColumn", "piworkflowRenderColumn");
$_cecRegistry->addChainFunction("Contenido.ArticleList.RenderAction", "piworkflowRenderAction");
$_cecRegistry->addChainFunction("Contenido.CategoryList.Columns", "piworkflowCategoryColumns");
$_cecRegistry->addChainFunction("Contenido.CategoryList.RenderColumn", "piworkflowCategoryRenderColumn");
$_cecRegistry->addChainFunction("Contenido.Frontend.AllowEdit", "piworkflowAllowArticleEdit");

function prepareWorkflowItems ()
{

	global $action, $lang, $modidcat, $workflowSelectBox, $workflowworkflows, $client, $tpl, $cfg;
	
	$workflowworkflows = new Workflows;

	if ($action === 'workflow_inherit_down')
	{
		
		$tmp = strDeeperCategoriesArray($modidcat);
		$asworkflow = getWorkflowForCat($modidcat);
		
		$wfa = new WorkflowAllocations;
		
		foreach ($tmp as $tmp_cat)
		{
	
			
			$idcatlang = getCatLang ($tmp_cat, $lang);
			
			if ($asworkflow == 0)
			{
				$wfa->select("idcatlang = '$idcatlang'");
			
				if ($item = $wfa->next())
				{
					$wfa->delete($item->get("idallocation"));
                    # delete user sequences for listing in tasklist for each included article
                    $oArticles = new ArticleCollection(array('idcat' => $idcatlang, 'start' => true, 'offline' => true));
                    while ($oArticle = $oArticles->nextArticle()) {
                       setUserSequence($oArticle->getField('idartlang'), -1); 
                    }
				}
			} else {
				$wfa->select("idcatlang = '$idcatlang'");
			
				if ($item = $wfa->next())
				{
					$item->setWorkflow($asworkflow);
					$item->store();
				} else {
					$wfa->create($asworkflow, $idcatlang);
                    # generate user sequences for listing in tasklist for each included article
                    $oArticles = new ArticleCollection(array('idcat' => $tmp_cat, 'start' => true, 'offline' => true));
                    while ($oArticle = $oArticles->nextArticle()) {
                       setUserSequence($oArticle->getField('idartlang'), $asworkflow); 
                    }
				}
			}			
		}
	}
	if ($action == "workflow_cat_assign")
	{
		$seltpl = "wfselect".$modidcat;
	
		$wfa = new WorkflowAllocations;
		$idcatlang = getCatLang($modidcat, $lang);
		
        #associate workflow with category
		if ($GLOBALS[$seltpl] != 0)
		{
			$wfa->select("idcatlang = '$idcatlang'");
			if ($item = $wfa->next())
			{
				$item->setWorkflow($GLOBALS[$seltpl]);
				$item->store();
			} else {
				$wfa->create($GLOBALS[$seltpl], $idcatlang);
			}
            
            # generate user sequences for listing in tasklist for each included article
            $oArticles = new ArticleCollection(array('idcat' => $modidcat, 'start' => true, 'offline' => true));
            while ($oArticle = $oArticles->nextArticle()) {
               setUserSequence($oArticle->getField('idartlang'), $GLOBALS[$seltpl]); 
            }
        #unlink workflow with category
		} else {
			$wfa->select("idcatlang = '$idcatlang'");
			
			if ($item = $wfa->next())
			{
				$alloc = $item->get("idallocation");
			}
			$wfa->delete($alloc);
            
            # delete user sequences for listing in tasklist for each included article
            $oArticles = new ArticleCollection(array('idcat' => $modidcat, 'start' => true, 'offline' => true));
            while ($oArticle = $oArticles->nextArticle()) {
               setUserSequence($oArticle->getField('idartlang'), -1); 
            }
            
		}
	}
	
	$workflowSelectBox = new cHTMLSelectElement("foo");
	$workflowSelectBox->setClass("text_medium");
	$workflowworkflows->select("idclient = '$client' AND idlang = '$lang'");
	
	$workflowOption = new cHTMLOptionElement("--- ".i18n("None", "workflow")." ---", 0);
	$workflowSelectBox->addOptionElement(0,$workflowOption);
		
	while ($workflow = $workflowworkflows->next())
	{
		$workflowOption = new cHTMLOptionElement($workflow->get("name"), $workflow->get("idworkflow"));
		$workflowSelectBox->addOptionElement($workflow->get("idworkflow"),$workflowOption);
	}	
    
    $workflowSelectBox->updateAttributes(array("id" => "wfselect{IDCAT}"));
	$workflowSelectBox->updateAttributes(array("name" => "wfselect{IDCAT}"));
    
    $tpl->set('s', 'PLUGIN_WORKFLOW', $workflowSelectBox->render().'<a href="javascript:setWorkflow({IDCAT}, \\\'wfselect{IDCAT}\\\')"><img src="'.$cfg["path"]["images"].'submit.gif" class="spaced"></a>');
    $tpl->set('s', 'PLUGIN_WORKFLOW_TRANSLATION', i18n("Inherit workflow down", "workflow"));
}
 
function piworkflowCategoryRenderColumn ($idcat, $type)
{

	switch ($type)
	{
		case "workflow":
			//$value = workflowInherit($idcat).workflowSelect($idcat,getWorkflowForCat($idcat), $idcat);
            $value = workflowInherit($idcat).'<script type="text/javascript" id="wf'.$idcat.'">printWorkflowSelect('.$idcat.', '.(int)getWorkflowForCat($idcat).');</script>';
			break;	
	}
	
	return ($value);
}

function piworkflowCategoryColumns ($array)
{
	prepareWorkflowItems();
	$myarray = array("workflow" => i18n("Workflow", "workflow"));
	
	return ($myarray);	
}

function piworkflowProcessActions ($array)
{
	global $idcat;
	$defaultidworkflow = getWorkflowForCat($idcat);
	
	if ($defaultidworkflow != 0)
	{	
		$narray = array("todo",
						"wfartconf",
						"wftplconf",
						"wfonline",
						"wflocked",
						"duplicate",
						"delete",
						"usetime");
	} else {
		$narray = $array;	
	}
	
	return ($narray);
}

function piworkflowRenderAction ($idcat, $idart, $idartlang, $type)
{
	global $area, $frame, $idtpl, $cfg, $alttitle, $tmp_articletitle;
	global $tmp_artconf, $onlinelink, $lockedlink, $tplconf_link;

	$defaultidworkflow = getWorkflowForCat($idcat);
	
	$idusersequence = getCurrentUserSequence($idartlang,$defaultidworkflow);
	$associatedUserSequence = new WorkflowUserSequence;
	$associatedUserSequence->loadByPrimaryKey($idusersequence);
	
	$currentEditor = $associatedUserSequence->get("iduser");	
	$workflowItem = $associatedUserSequence->getWorkflowItem();
	
	if (isCurrentEditor($associatedUserSequence->get("iduser")))
    {
    	/* Query rights for this user */
    	
    	$wfRights = $workflowItem->getStepRights();
    	$mayEdit = true;
    } else {
    	$wfRights = "";
    	$mayEdit = false;
    }
   
	switch ($type)
	{
		case "wfartconf":
			if ($wfRights["propertyedit"] == true)
			{
				return $tmp_artconf;
			}
			break;
		case "wfonline":
			if ($wfRights["publish"] == true)
			{
				return $onlinelink;
			}
			break;
		case "wflocked":
			if ($wfRights["lock"] == true)
			{
				return $lockedlink;	
			}
			break;
		case "wftplconf":
			if ($wfRights["templateedit"] == true)
			{
				return $tplconf_link;	
			}
		default:
			break;	
	}
	
	return "";
} 
function piworkflowProcessArticleColumns ($array)
{
	global $idcat, $action, $modidartlang;
	
	if ($action == "workflow_do_action")
	    {
	    	$selectedAction = "wfselect".$modidartlang;
	    	
	    	/* It would be nice to do the following:
	    	   $art = new ArtLang($idartlang);
	    	   $art->doWorkflowAction($

Snuppel007
Beiträge: 86
Registriert: Mi 20. Apr 2005, 16:16
Kontaktdaten:

Beitrag von Snuppel007 » Mo 21. Apr 2008, 10:01

Supi, ..., es Rockt! Mensch OliverL, der Schrein ist dir sicher, Con Gott :D

Stimmt, ich hab Dir hier die ungeänderte Datei gepostet, nur als vergleich ob wir mit der selben gearbeitet haben. Ich hab jetzt meine Datei durch Deine ersetzt, ..., bekomme keine Fehlermeldungen mehr ...,! Einfach Klasse, eh ich geschnalt hätte wo ich suchen muss um das zu ändern, ich Danke Dir OliverL!

Wünsche dann noch einen Sonnigen Gruß ..., Danke..., Snuppel

timo.trautmann_4fb
Beiträge: 472
Registriert: Di 15. Apr 2008, 15:57
Wohnort: Michelstadt
Kontaktdaten:

Beitrag von timo.trautmann_4fb » Mo 21. Apr 2008, 10:10

[ BUG ? ]
Sollten eine weitere CRC dazu kommen müste diese nach der Workflow-CRC (func. piworkflowProcessArticleColumns() ) geladen werden. ansonsten killt diese Function die neuen Werten im Array.
-> Mit der oben angegebenen verbesserung werden lediglich 3 spalten ausgelassen und die neuen ergänzt.
Hier eine mögliche Modifikation, die auch mit der nächsten Version kommen wird in der config.plugin:

Code: Alles auswählen

   if ($defaultidworkflow != 0)
	{
		$narray = array();
		$bInserted = false;
		foreach ($array as $sKey => $sValue) {
			$narray[$sKey] = $sValue;
			if ($sKey == 'title' && !$bInserted) {
				$narray["wftitle"] = $array["title"];
				$narray["wfstep"] = i18n("Workflow Step", "workflow");
				$narray["wfaction"] = i18n("Workflow Action", "workflow");
				$narray["wfeditor"] = i18n("Workflow Editor", "workflow");
				$narray["wflaststatus"] = i18n("Last status", "workflow");
				$bInserted = true;
			}
		}		
      unset ($narray['title']);
		unset ($narray['changeddate']);
		unset ($narray['publisheddate']);
		unset ($narray['sortorder']);
	} else {
		$narray = $array;	
	}
Der Code ergänzt nun nur das Array um die neuen Spalten und löscht die nicht benötigten. Unbekannte Spalten werden einfach mitkopiert.

Reihenfolgeänderung der Actions nach vorne dann am Besten in der include.con_art_overview.php

Code: Alles auswählen

$listColumns = array(	"start" => i18n("Article"),
                        "actions" => i18n("Actions"),
						"title" => i18n("Title"),
						"changeddate" => i18n("Changed"),
						"publisheddate" => i18n("Published"),
						"sortorder" => i18n("Sort order"),
						"template" => i18n("Template")
						);

Snuppel007
Beiträge: 86
Registriert: Mi 20. Apr 2005, 16:16
Kontaktdaten:

Beitrag von Snuppel007 » Di 22. Apr 2008, 19:08

Hallo Timo,

vielen Dank für die beiden Infos, .., ist ja lustig, kommt selten vor das man schon eine Antwort bekommt noch vor der Frage, da soll mal einer sagen "Es gibt keine falsche Fragen, nur falsche Antworten" hehe. :P

Liebe Grüße, der Snuppel

barni
Beiträge: 127
Registriert: Fr 28. Okt 2005, 20:54
Kontaktdaten:

Re: Artikel-Übersicht Template ändern???

Beitrag von barni » Di 28. Apr 2009, 09:53

Hey,
cool wie hast du das Contenido Backend umdesigned?
Wo finde ich die Daten/das Css?

Liebe Grüße
Barni

Gesperrt