do not load plugins ignored

Dieser Commit ist enthalten in:
Oldperl 2019-11-04 14:52:56 +00:00
Ursprung 20b2a52534
Commit 15bcdb5600
2 geänderte Dateien mit 688 neuen und 789 gelöschten Zeilen

Datei anzeigen

@ -47,6 +47,11 @@ if ($bDebug && $frame == 4) {
// Include all active plugins // Include all active plugins
foreach ($aPlugins as $sPluginName) { foreach ($aPlugins as $sPluginName) {
$sPluginIgnoreFile = $sPluginsPath . $sPluginName . DIRECTORY_SEPARATOR . 'plugin.ignore';
if (file_exists($sPluginIgnoreFile)) {
continue;
}
$sPluginLocaleDir = $sPluginsPath . $sPluginName . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR; $sPluginLocaleDir = $sPluginsPath . $sPluginName . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR;
$sPluginConfigFile = $sPluginsPath . $sPluginName . DIRECTORY_SEPARATOR . 'includes/config.plugin.php'; $sPluginConfigFile = $sPluginsPath . $sPluginName . DIRECTORY_SEPARATOR . 'includes/config.plugin.php';
$sPluginAutoloaderFile = $sPluginsPath . $sPluginName . DIRECTORY_SEPARATOR . 'includes/config.autoloader.php'; $sPluginAutoloaderFile = $sPluginsPath . $sPluginName . DIRECTORY_SEPARATOR . 'includes/config.autoloader.php';

Datei anzeigen

@ -1,5 +1,6 @@
<?php <?php
/** /**
* Project: * Project:
* Contenido Content Management System * Contenido Content Management System
@ -29,13 +30,12 @@
* }} * }}
* *
*/ */
if (!defined('CON_FRAMEWORK')) {
if(!defined('CON_FRAMEWORK')) {
die('Illegal call'); die('Illegal call');
} }
cInclude("includes","functions.tpl.php"); cInclude("includes", "functions.tpl.php");
cInclude("includes","functions.str.php"); cInclude("includes", "functions.str.php");
cInclude("includes", "functions.pathresolver.php"); cInclude("includes", "functions.pathresolver.php");
$firstMark = false; $firstMark = false;
$db2 = new DB_ConLite; $db2 = new DB_ConLite;
@ -47,25 +47,21 @@ $dateformat = getEffectiveSetting("backend", "timeformat_date", "Y-m-d");
$debug = false; $debug = false;
$templateDescription = ''; $templateDescription = '';
if (!isset($syncfrom)) if (!isset($syncfrom)) {
{
$syncfrom = -1; $syncfrom = -1;
} }
$syncoptions = $syncfrom; $syncoptions = $syncfrom;
if ($action == "con_duplicate") if ($action == "con_duplicate") {
{
$newidartlang = conCopyArticle($duplicate, $idcat); $newidartlang = conCopyArticle($duplicate, $idcat);
} }
if ($action == "con_syncarticle") if ($action == "con_syncarticle") {
{
/* Verify that the category is available in this language */ /* Verify that the category is available in this language */
$sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='".Contenido_Security::toInteger($idcat)."' AND idlang='".Contenido_Security::toInteger($lang)."'"; $sql = "SELECT idcatlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang='" . Contenido_Security::toInteger($lang) . "'";
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{
conSyncArticle($syncarticle, $sourcelanguage, $lang); conSyncArticle($syncarticle, $sourcelanguage, $lang);
} else { } else {
strSyncCategory($idcat, $sourcelanguage, $lang); strSyncCategory($idcat, $sourcelanguage, $lang);
@ -74,7 +70,7 @@ if ($action == "con_syncarticle")
} }
/* Which columns to display? */ /* Which columns to display? */
$listColumns = array( "start" => i18n("Article"), $listColumns = array("start" => i18n("Article"),
"title" => i18n("Title"), "title" => i18n("Title"),
"changeddate" => i18n("Changed"), "changeddate" => i18n("Changed"),
"publisheddate" => i18n("Published"), "publisheddate" => i18n("Published"),
@ -83,7 +79,7 @@ $listColumns = array( "start" => i18n("Article"),
"actions" => i18n("Actions")); "actions" => i18n("Actions"));
/* Which actions to display? */ /* Which actions to display? */
$actionList = array( "online", $actionList = array("online",
"duplicate", "duplicate",
"locked", "locked",
"todo", "todo",
@ -94,14 +90,11 @@ $actionList = array( "online",
/* Call chains to process the columns and the action list */ /* Call chains to process the columns and the action list */
$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.Columns"); $_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.Columns");
if ($_cecIterator->count() > 0) if ($_cecIterator->count() > 0) {
{ while ($chainEntry = $_cecIterator->next()) {
while ($chainEntry = $_cecIterator->next())
{
$newColumnList = $chainEntry->execute($listColumns); $newColumnList = $chainEntry->execute($listColumns);
if (is_array($newColumnList)) if (is_array($newColumnList)) {
{
$listColumns = $newColumnList; $listColumns = $newColumnList;
} }
} }
@ -109,14 +102,11 @@ if ($_cecIterator->count() > 0)
$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.Actions"); $_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.Actions");
if ($_cecIterator->count() > 0) if ($_cecIterator->count() > 0) {
{ while ($chainEntry = $_cecIterator->next()) {
while ($chainEntry = $_cecIterator->next())
{
$newActionList = $chainEntry->execute($actionList); $newActionList = $chainEntry->execute($actionList);
if (is_array($newActionList)) if (is_array($newActionList)) {
{
$actionList = $newActionList; $actionList = $newActionList;
} }
} }
@ -124,57 +114,28 @@ if ($_cecIterator->count() > 0)
$cat_idtpl = 0; $cat_idtpl = 0;
if ( is_numeric($idcat) && ($idcat >= 0)) { if (is_numeric($idcat) && ($idcat >= 0)) {
// Saving sort and elements per page user settings (if specified) // Saving sort and elements per page user settings (if specified)
// Should be changed to User->setProperty... someday // Should be changed to User->setProperty... someday
if (isset($sort)) if (isset($sort)) {
{ $currentuser->setUserProperty("system", "sortorder-idlang-$lang-idcat-$idcat", $sort);
$currentuser->setUserProperty("system","sortorder-idlang-$lang-idcat-$idcat",$sort);
} }
if (isset($elemperpage) && is_numeric($elemperpage)) if (isset($elemperpage) && is_numeric($elemperpage)) {
{ $currentuser->setUserProperty("system", "elemperpage-idlang-$lang-idcat-$idcat", $elemperpage);
$currentuser->setUserProperty("system","elemperpage-idlang-$lang-idcat-$idcat", $elemperpage);
} else { } else {
$elemperpage = $currentuser->getUserProperty("system","elemperpage-idlang-$lang-idcat-$idcat"); $elemperpage = $currentuser->getUserProperty("system", "elemperpage-idlang-$lang-idcat-$idcat");
if (!is_numeric($elemperpage)) if (!is_numeric($elemperpage)) {
{
$elemperpage = 25; $elemperpage = 25;
} }
} }
$col = new InUseCollection(); $col = new InUseCollection();
if ((( $idcat == 0 || 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)) {
$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"); $sort = $currentuser->getUserProperty("system", "sortorder-idlang-$lang-idcat-$idcat");
$sql = "SELECT $sql = "SELECT
a.idart AS idart, a.idart AS idart,
@ -196,50 +157,46 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
a.redirect AS redirect, a.redirect AS redirect,
a.locked AS locked a.locked AS locked
FROM FROM
".$cfg["tab"]["art_lang"]." AS a, " . $cfg["tab"]["art_lang"] . " AS a,
".$cfg["tab"]["art"]." AS b, " . $cfg["tab"]["art"] . " AS b,
".$cfg["tab"]["cat_art"]." AS c " . $cfg["tab"]["cat_art"] . " AS c
WHERE WHERE
(a.idlang = '".$lang."' {SYNCOPTIONS}) AND (a.idlang = '" . $lang . "' {SYNCOPTIONS}) AND
a.idart = b.idart AND a.idart = b.idart AND
b.idclient = '".$client."' AND b.idclient = '" . $client . "' AND
b.idart = c.idart AND b.idart = c.idart AND
c.idcat = '".$idcat."'"; c.idcat = '" . $idcat . "'";
// Simple SQL statement to get the number of articles // Simple SQL statement to get the number of articles
$sql_count = $sql_count = "SELECT
"SELECT
COUNT(*) AS article_count COUNT(*) AS article_count
FROM FROM
".$cfg["tab"]["art_lang"]." AS a, " . $cfg["tab"]["art_lang"] . " AS a,
".$cfg["tab"]["art"]." AS b, " . $cfg["tab"]["art"] . " AS b,
".$cfg["tab"]["cat_art"]." AS c " . $cfg["tab"]["cat_art"] . " AS c
WHERE WHERE
(a.idlang = '".Contenido_Security::toInteger($lang)."' {SYNCOPTIONS}) AND (a.idlang = '" . Contenido_Security::toInteger($lang) . "' {SYNCOPTIONS}) AND
a.idart = b.idart AND a.idart = b.idart AND
b.idclient = '".Contenido_Security::toInteger($client)."' AND b.idclient = '" . Contenido_Security::toInteger($client) . "' AND
b.idart = c.idart AND b.idart = c.idart AND
c.idcat = '".Contenido_Security::toInteger($idcat)."'"; c.idcat = '" . Contenido_Security::toInteger($idcat) . "'";
if ($cfg["is_start_compatible"] == true) if ($cfg["is_start_compatible"] == true) {
{
$sql = str_replace("{ISSTART}", "c.is_start AS is_start,", $sql); $sql = str_replace("{ISSTART}", "c.is_start AS is_start,", $sql);
} else { } else {
$sql = str_replace("{ISSTART}", "", $sql); $sql = str_replace("{ISSTART}", "", $sql);
} }
if ($syncoptions == -1) if ($syncoptions == -1) {
{
$sql = str_replace("{SYNCOPTIONS}", "", $sql); $sql = str_replace("{SYNCOPTIONS}", "", $sql);
$sql_count = str_replace("{SYNCOPTIONS}", "", $sql_count); $sql_count = str_replace("{SYNCOPTIONS}", "", $sql_count);
} else { } else {
$sql = str_replace("{SYNCOPTIONS}", "OR a.idlang = '".$syncoptions."'", $sql); $sql = str_replace("{SYNCOPTIONS}", "OR a.idlang = '" . $syncoptions . "'", $sql);
$sql_count = str_replace("{SYNCOPTIONS}", "OR a.idlang = '".$syncoptions."'", $sql_count); $sql_count = str_replace("{SYNCOPTIONS}", "OR a.idlang = '" . $syncoptions . "'", $sql_count);
} }
# Article sort # Article sort
switch ($sort) switch ($sort) {
{
case 2: case 2:
$sql .= " ORDER BY a.lastmodified DESC"; $sql .= " ORDER BY a.lastmodified DESC";
break; break;
@ -257,15 +214,13 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
# Getting article count, if necessary # Getting article count, if necessary
if ($elemperpage > 0) if ($elemperpage > 0) {
{
$db->query($sql_count); $db->query($sql_count);
$db->next_record(); $db->next_record();
$iArticleCount = $db->f("article_count"); $iArticleCount = $db->f("article_count");
# If not beyond scope, limit # If not beyond scope, limit
if ($iArticleCount == 0) if ($iArticleCount == 0) {
{
$next = 0; $next = 0;
} else if ($next >= $iArticleCount) { } else if ($next >= $iArticleCount) {
$next = (ceil($iArticleCount / $elemperpage) - 1) * $elemperpage; $next = (ceil($iArticleCount / $elemperpage) - 1) * $elemperpage;
@ -276,7 +231,7 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
} }
# Debug info # Debug info
if ( $debug ) { if ($debug) {
echo "<pre>"; echo "<pre>";
echo $sql; echo $sql;
echo "</pre>"; echo "</pre>";
@ -293,7 +248,7 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$aArticles = Array(); $aArticles = Array();
while ($db->next_record() ) { while ($db->next_record()) {
$sItem = "k" . $db->f("idart"); $sItem = "k" . $db->f("idart");
if ($db->f("idlang") == $lang || !array_key_exists($sItem, $aArticles)) { if ($db->f("idlang") == $lang || !array_key_exists($sItem, $aArticles)) {
@ -351,13 +306,12 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$locked = $sart["locked"]; $locked = $sart["locked"];
$redirect = $sart["redirect"]; $redirect = $sart["redirect"];
$published = ($published != '1000-01-01 00:00:00') ? date($dateformat,strtotime($published)) : i18n("not yet published"); $published = ($published != '1000-01-01 00:00:00') ? date($dateformat, strtotime($published)) : i18n("not yet published");
$created = date($dateformat,strtotime($created)); $created = date($dateformat, strtotime($created));
$modified = date($dateformat,strtotime($modified)); $modified = date($dateformat, strtotime($modified));
$alttitle = "idart".'&#58; '.$idart.' '."idcatart".'&#58; '.$idcatart.' '."idartlang".'&#58; '.$idartlang; $alttitle = "idart" . '&#58; ' . $idart . ' ' . "idcatart" . '&#58; ' . $idcatart . ' ' . "idartlang" . '&#58; ' . $idartlang;
if (($obj = $col->checkMark("article", $idartlang)) === false) if (($obj = $col->checkMark("article", $idartlang)) === false) {
{
$inUse = false; $inUse = false;
} else { } else {
$vuser = new User; $vuser = new User;
@ -366,20 +320,19 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$inUseUserRealName = $vuser->getField("realname"); $inUseUserRealName = $vuser->getField("realname");
$inUse = true; $inUse = true;
$title = $title . " (" . i18n("Article is in use").")"; $title = $title . " (" . i18n("Article is in use") . ")";
$alttitle = sprintf(i18n("Article in use by %s (%s)"), $inUseUser, $inUseUserRealName). " ". $alttitle; $alttitle = sprintf(i18n("Article in use by %s (%s)"), $inUseUser, $inUseUserRealName) . " " . $alttitle;
} }
$bgcolor = $cfg["color"]["table_light"]; $bgcolor = $cfg["color"]["table_light"];
if ($idlang != $lang) if ($idlang != $lang) {
{
$bgcolor = ( is_int($dyn_cnt / 2) ) ? $cfg["color"]["table_light_sync"] : $cfg["color"]["table_dark_sync"]; $bgcolor = ( is_int($dyn_cnt / 2) ) ? $cfg["color"]["table_light_sync"] : $cfg["color"]["table_dark_sync"];
} }
/* Id of the row, /* Id of the row,
stores informations about stores informations about
the article and category */ the article and category */
$tmp_rowid = $idart."-".$idartlang."-".$lidcat."-".$idcatlang."-".$idcatart."-".$idlang; $tmp_rowid = $idart . "-" . $idartlang . "-" . $lidcat . "-" . $idcatlang . "-" . $idcatart . "-" . $idlang;
$tpl->set('d', 'ROWID', $tmp_rowid); $tpl->set('d', 'ROWID', $tmp_rowid);
$colitem[$tmp_rowid] = $bgcolor; $colitem[$tmp_rowid] = $bgcolor;
@ -387,24 +340,20 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tpl->set('d', 'BGCOLOR', $bgcolor); $tpl->set('d', 'BGCOLOR', $bgcolor);
# Article Title # Article Title
if ($perm->have_perm_area_action( "con_editcontent", "con_editart" ) || if ($perm->have_perm_area_action("con_editcontent", "con_editart") || $perm->have_perm_area_action_item("con_editcontent", "con_editart", $idcat)) {
$perm->have_perm_area_action_item( "con_editcontent", "con_editart" ,$idcat) ) if ($idlang != $lang) {
{
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"); $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>'; $titlelink = '<a href="' . $tmp_alink . '" title="' . $alttitle . '">' . $title . '</a>';
} else { } else {
$tmp_alink = $sess->url("main.php?area=con_editcontent&action=con_editart&changeview=edit&idartlang=$idartlang&idart=$idart&idcat=$idcat&frame=$frame"); $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>'; $titlelink = '<a href="' . $tmp_alink . '" title="' . $alttitle . '">' . $title . '</a>';
} }
} else { } else {
$tmp_alink = ""; $tmp_alink = "";
$titlelink = $title; $titlelink = $title;
} }
if ($timemgmt == "1") if ($timemgmt == "1") {
{
$sql = "SELECT NOW() AS TIME"; $sql = "SELECT NOW() AS TIME";
$db3 = new DB_ConLite; $db3 = new DB_ConLite;
@ -416,8 +365,7 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$endtimestamp = strtotime($dateend); $endtimestamp = strtotime($dateend);
$nowtimestamp = strtotime($db3->f("TIME")); $nowtimestamp = strtotime($db3->f("TIME"));
if (($nowtimestamp < $endtimestamp) && ($nowtimestamp > $starttimestamp)) 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;">'; $usetime = '<img src="images/but_time_2.gif" alt="Artikel mit Zeitsteuerung online" title="Artikel mit Zeitsteuerung online" style="margin-left:3px;">';
} else { } else {
$usetime = '<img src="images/but_time_1.gif" alt="Artikel mit Zeitsteuerung offline" title="Artikel mit Zeitsteuerung offline" style="margin-left:3px;">'; $usetime = '<img src="images/but_time_1.gif" alt="Artikel mit Zeitsteuerung offline" title="Artikel mit Zeitsteuerung offline" style="margin-left:3px;">';
@ -427,85 +375,72 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
} }
# Article Title # Article Title
if (($perm->have_perm_area_action( "con", "con_lock" ) || if (($perm->have_perm_area_action("con", "con_lock") || $perm->have_perm_area_action_item("con", "con_lock", $idcat)) && $inUse == false) {
$perm->have_perm_area_action_item( "con", "con_lock" ,$idcat)) && $inUse == false ) if ($locked == 1) {
{
if ($locked == 1)
{
$lockimg = 'images/article_locked.gif'; $lockimg = 'images/article_locked.gif';
$lockalt = i18n("Unfreeze article"); $lockalt = i18n("Unfreeze article");
} else { } else {
$lockimg = 'images/article_unlocked.gif'; $lockimg = 'images/article_unlocked.gif';
$lockalt = i18n("Freeze article"); $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>'; $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 { } else {
if ($locked == 1) if ($locked == 1) {
{
$lockimg = 'images/article_locked.gif'; $lockimg = 'images/article_locked.gif';
$lockalt = i18n("Article is frozen"); $lockalt = i18n("Article is frozen");
} else { } else {
$lockimg = 'images/article_unlocked.gif'; $lockimg = 'images/article_unlocked.gif';
$lockalt = i18n("Article is not frozen"); $lockalt = i18n("Article is not frozen");
} }
$tmp_lock = '<img src="'.$lockimg.'" title="'.$lockalt.'" alt="'.$lockalt.'" border="0">'; $tmp_lock = '<img src="' . $lockimg . '" title="' . $lockalt . '" alt="' . $lockalt . '" border="0">';
} }
if ($idlang != $lang) if ($idlang != $lang) {
{
$lockedlink = ""; $lockedlink = "";
} else { } else {
$lockedlink = $tmp_lock; $lockedlink = $tmp_lock;
} }
if ($sortkey == "") if ($sortkey == "") {
{
$sortkey = "&nbsp;"; $sortkey = "&nbsp;";
} }
$tmp_articletitle = $titlelink; $tmp_articletitle = $titlelink;
# Article conf button # Article conf button
if ($perm->have_perm_area_action("con_editart","con_edit") || if ($perm->have_perm_area_action("con_editart", "con_edit") || $perm->have_perm_area_action_item("con_editart", "con_edit", $idcat)) {
$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>';
{
$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 { } else {
$tmp_artconf=""; $tmp_artconf = "";
} }
$tmp_sync = ''; $tmp_sync = '';
if ($idlang != $lang) if ($idlang != $lang) {
{
$sql = "SELECT idcatlang FROM ".$cfg["tab"]["cat_lang"]." WHERE idcat='".Contenido_Security::toInteger($idcat)."' AND idlang='".Contenido_Security::toInteger($lang)."'"; $sql = "SELECT idcatlang FROM " . $cfg["tab"]["cat_lang"] . " WHERE idcat='" . Contenido_Security::toInteger($idcat) . "' AND idlang='" . Contenido_Security::toInteger($lang) . "'";
$db->query($sql); $db->query($sql);
if ($db->next_record()) 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>';
$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 { } else {
$tmp_sync = ""; $tmp_sync = "";
} }
} }
# Article Template # Article Template
if ( !is_object($db2) ) if (!is_object($db2)) {
{
$db2 = new DB_ConLite; $db2 = new DB_ConLite;
} }
$sql2 = $sql2 = "SELECT
"SELECT
b.name AS tplname, b.name AS tplname,
b.idtpl AS idtpl, b.idtpl AS idtpl,
b.description AS description b.description AS description
FROM FROM
".$cfg["tab"]["tpl_conf"]." AS a, " . $cfg["tab"]["tpl_conf"] . " AS a,
".$cfg["tab"]["tpl"]." AS b " . $cfg["tab"]["tpl"] . " AS b
WHERE WHERE
a.idtplcfg = '".Contenido_Security::toInteger($idtplcfg)."' AND a.idtplcfg = '" . Contenido_Security::toInteger($idtplcfg) . "' AND
a.idtpl = b.idtpl"; a.idtpl = b.idtpl";
$db2->query($sql2); $db2->query($sql2);
@ -518,35 +453,34 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
# Uses Category Template # Uses Category Template
if ( 0 == $idtplcfg ) if (0 == $idtplcfg) {
{ $a_tplname = "--- " . i18n("None") . " ---";
$a_tplname = "--- ".i18n("None")." ---";
} }
# Make Startarticle button # Make Startarticle button
$imgsrc = "isstart"; $imgsrc = "isstart";
if ($is_start == false) { if ($is_start == false) {
$imgsrc.='0'; $imgsrc .= '0';
} else { } else {
$imgsrc.='1'; $imgsrc .= '1';
} }
if (isArtInMultipleUse($idart)) { if (isArtInMultipleUse($idart)) {
$imgsrc.='m'; $imgsrc .= 'm';
} }
if ((int)$redirect == 1) { if ((int) $redirect == 1) {
$imgsrc.='r'; $imgsrc .= 'r';
} }
$imgsrc.='.gif'; $imgsrc .= '.gif';
if ( ($perm->have_perm_area_action("con","con_makestart") || $perm->have_perm_area_action_item("con","con_makestart",$idcat)) && $idcat != 0) { 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) { if ($is_start == false) {
$tmp_link = '<a href="'.$sess->url("main.php?area=con&amp;idcat=$idcat&amp;action=con_makestart&amp;idcatart=$idcatart&amp;frame=4&is_start=1&amp;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>'; $tmp_link = '<a href="' . $sess->url("main.php?area=con&amp;idcat=$idcat&amp;action=con_makestart&amp;idcatart=$idcatart&amp;frame=4&is_start=1&amp;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 { } else {
$tmp_link = '<a href="'.$sess->url("main.php?area=con&amp;idcat=$idcat&amp;action=con_makestart&amp;idcatart=$idcatart&amp;frame=4&amp;is_start=0&amp;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>'; $tmp_link = '<a href="' . $sess->url("main.php?area=con&amp;idcat=$idcat&amp;action=con_makestart&amp;idcatart=$idcatart&amp;frame=4&amp;is_start=0&amp;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 { } else {
if ($is_start == true) { if ($is_start == true) {
@ -555,7 +489,7 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$sTitle = i18n("Normal article"); $sTitle = i18n("Normal article");
} }
$tmp_img = '<img src="images/'.$imgsrc.'" border="0" title="'.$sTitle.'" alt="'.$sTitle.'" style="margin-left:3px;">'; $tmp_img = '<img src="images/' . $imgsrc . '" border="0" title="' . $sTitle . '" alt="' . $sTitle . '" style="margin-left:3px;">';
$tmp_link = $tmp_img; $tmp_link = $tmp_img;
} }
@ -563,74 +497,63 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tmp_start = $tmp_link; $tmp_start = $tmp_link;
# Make copy button # Make copy button
if ( ($perm->have_perm_area_action("con","con_duplicate") || $perm->have_perm_area_action_item("con","con_duplicate",$idcat)) && $idcat != 0) { 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"; $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>'; $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 { } else {
$tmp_link = ""; $tmp_link = "";
} }
if ($idlang != $lang) if ($idlang != $lang) {
{
$duplicatelink = ""; $duplicatelink = "";
} else { } else {
$duplicatelink = $tmp_link; $duplicatelink = $tmp_link;
} }
$subject = urlencode(sprintf(i18n("Reminder for Article '%s'"),$title)); $subject = urlencode(sprintf(i18n("Reminder for Article '%s'"), $title));
$mycatname = ""; $mycatname = "";
conCreateLocationString($idcat, "&nbsp;/&nbsp;", $mycatname); conCreateLocationString($idcat, "&nbsp;/&nbsp;", $mycatname);
$message = urlencode(sprintf(i18n("Reminder for Article '%s'\nCategory: %s"),$title,$mycatname)); $message = urlencode(sprintf(i18n("Reminder for Article '%s'\nCategory: %s"), $title, $mycatname));
$todolink = new TODOLink("idart", $idart, $subject, $message); $todolink = new TODOLink("idart", $idart, $subject, $message);
# Make On-/Offline button # Make On-/Offline button
if ( $online ) { if ($online) {
if (($perm->have_perm_area_action("con","con_makeonline") || if (($perm->have_perm_area_action("con", "con_makeonline") || $perm->have_perm_area_action_item("con", "con_makeonline", $idcat)) && ($idcat != 0)) {
$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>';
{
$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 { } else {
$tmp_online = '<img src="images/online.gif" title="'.i18n("Article is online").'" alt="'.i18n("Article is online").'" border="0" style="margin-left:3px;">'; $tmp_online = '<img src="images/online.gif" title="' . i18n("Article is online") . '" alt="' . i18n("Article is online") . '" border="0" style="margin-left:3px;">';
} }
} else { } else {
if (($perm->have_perm_area_action("con","con_makeonline") || if (($perm->have_perm_area_action("con", "con_makeonline") || $perm->have_perm_area_action_item("con", "con_makeonline", $idcat)) && ($idcat != 0)) {
$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>';
{
$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 { } else {
$tmp_online = '<img src="images/offline.gif" title="'.i18n("Article is offline").'" alt="'.i18n("Article is offline").'" border="0" style="margin-left:3px;">'; $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) if ($idlang != $lang) {
{
$onlinelink = ""; $onlinelink = "";
} else { } else {
$onlinelink = $tmp_online; $onlinelink = $tmp_online;
} }
# Delete button # Delete button
if (($perm->have_perm_area_action("con","con_deleteart") || if (($perm->have_perm_area_action("con", "con_deleteart") || $perm->have_perm_area_action_item("con", "con_deleteart", $idcat)) && $inUse == false) {
$perm->have_perm_area_action_item("con","con_deleteart",$idcat)) && $inUse == false)
{
$tmp_title = $title; $tmp_title = $title;
if (strlen($tmp_title) > 30) if (strlen($tmp_title) > 30) {
{
$tmp_title = substr($tmp_title, 0, 27) . "..."; $tmp_title = substr($tmp_title, 0, 27) . "...";
} }
$confirmString = sprintf(i18n("Are you sure to delete the following article:<br><br><b>%s</b>"),clHtmlSpecialChars($tmp_title)); $confirmString = sprintf(i18n("Are you sure to delete the following article:<br><br><b>%s</b>"), clHtmlSpecialChars($tmp_title));
$tmp_del = '<a href="javascript://" onclick="box.confirm(&quot;'.i18n("Delete article").'&quot;, &quot;'.addslashes($confirmString).'&quot;, &quot;deleteArticle('.$idart.','.$idcat.','.$next.')&quot;)" title="'.i18n("Delete article").'"><img src="images/delete.gif" title="'.i18n("Delete article").'" alt="'.i18n("Delete article").'" border="0" style="margin-left:3px;"></a>'; $tmp_del = '<a href="javascript://" onclick="box.confirm(&quot;' . i18n("Delete article") . '&quot;, &quot;' . addslashes($confirmString) . '&quot;, &quot;deleteArticle(' . $idart . ',' . $idcat . ',' . $next . ')&quot;)" 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 { } else {
$tmp_del = ""; $tmp_del = "";
} }
if ($idlang != $lang) if ($idlang != $lang) {
{
$deletelink = ""; $deletelink = "";
} else { } else {
$deletelink = $tmp_del; $deletelink = $tmp_del;
@ -641,13 +564,10 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tpl->set('d', 'DIRECTION', 'dir="' . langGetTextDirection($lang) . '"'); $tpl->set('d', 'DIRECTION', 'dir="' . langGetTextDirection($lang) . '"');
# Next iteration # Next iteration
# Articles found # Articles found
$no_article = false; $no_article = false;
foreach ($listColumns as $listColumn => $ctitle) foreach ($listColumns as $listColumn => $ctitle) {
{ switch ($listColumn) {
switch ($listColumn)
{
case "start": case "start":
$value = $tmp_start; $value = $tmp_start;
break; break;
@ -668,10 +588,8 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
break; break;
case "actions": case "actions":
$actions = array(); $actions = array();
foreach ($actionList as $actionItem) foreach ($actionList as $actionItem) {
{ switch ($actionItem) {
switch ($actionItem)
{
case "todo": case "todo":
$actionValue = $todolink->render(); $actionValue = $todolink->render();
break; break;
@ -697,10 +615,8 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
/* Ask chain about the entry */ /* Ask chain about the entry */
$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.RenderAction"); $_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.RenderAction");
$contents = array(); $contents = array();
if ($_cecIterator->count() > 0) if ($_cecIterator->count() > 0) {
{ while ($chainEntry = $_cecIterator->next()) {
while ($chainEntry = $_cecIterator->next())
{
$contents[] = $chainEntry->execute($idcat, $idart, $idartlang, $actionItem); $contents[] = $chainEntry->execute($idcat, $idart, $idartlang, $actionItem);
} }
} }
@ -722,11 +638,9 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
/* Call chain to retrieve value */ /* Call chain to retrieve value */
$_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.RenderColumn"); $_cecIterator = $_cecRegistry->getIterator("Contenido.ArticleList.RenderColumn");
if ($_cecIterator->count() > 0) if ($_cecIterator->count() > 0) {
{
$contents = array(); $contents = array();
while ($chainEntry = $_cecIterator->next()) while ($chainEntry = $_cecIterator->next()) {
{
$contents[] = $chainEntry->execute($idcat, $idart, $idartlang, $listColumn); $contents[] = $chainEntry->execute($idcat, $idart, $idartlang, $listColumn);
} }
} }
@ -740,20 +654,18 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$headers = array(); $headers = array();
foreach ($listColumns as $key => $listColumn) foreach ($listColumns as $key => $listColumn) {
{
/* Dirty hack to force column widths */ /* Dirty hack to force column widths */
if ($key == "title" || $listColumn == i18n("Title")) if ($key == "title" || $listColumn == i18n("Title")) {
{ $headers[] = '<td width="100%" class="headerbordercell" nowrap="nowrap">' . $listColumn . '</td>';
$headers[] = '<td width="100%" class="headerbordercell" nowrap="nowrap">'.$listColumn.'</td>';
} else { } else {
$headers[] = '<td width="1%" class="headerbordercell" nowrap="nowrap">'.$listColumn.'</td>'; $headers[] = '<td width="1%" class="headerbordercell" nowrap="nowrap">' . $listColumn . '</td>';
} }
} }
$tpl->set('s', 'HEADERS', implode("\n", $headers)); $tpl->set('s', 'HEADERS', implode("\n", $headers));
if($elemperpage > 0 && $iArticleCount > 0) { if ($elemperpage > 0 && $iArticleCount > 0) {
$sBrowseLinks = ""; $sBrowseLinks = "";
for ($i = 1; $i <= ceil($iArticleCount / $elemperpage); $i++) { for ($i = 1; $i <= ceil($iArticleCount / $elemperpage); $i++) {
$iNext = ($i - 1) * $elemperpage; $iNext = ($i - 1) * $elemperpage;
@ -761,10 +673,10 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$sBrowseLinks .= "&nbsp;"; $sBrowseLinks .= "&nbsp;";
} }
if ($next == $iNext) { if ($next == $iNext) {
$sBrowseLinks .= $i."\n"; // I'm on the current page, no link $sBrowseLinks .= $i . "\n"; // I'm on the current page, no link
} else { } else {
$tmp_alink = $sess->url("main.php?area=con&frame=$frame&idcat=$idcat&next=$iNext"); $tmp_alink = $sess->url("main.php?area=con&frame=$frame&idcat=$idcat&next=$iNext");
$sBrowseLinks .= '<a href="'.$tmp_alink.'">'.$i.'</a>'."\n"; $sBrowseLinks .= '<a href="' . $tmp_alink . '">' . $i . '</a>' . "\n";
} }
} }
$tpl->set('s', 'NEXT', $next); $tpl->set('s', 'NEXT', $next);
@ -777,13 +689,11 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tpl->set('s', 'CLICK_ROW_NOTIFICATION', i18n("with click select line for further treatment")); $tpl->set('s', 'CLICK_ROW_NOTIFICATION', i18n("with click select line for further treatment"));
if (count($artlist) > 0) if (count($artlist) > 0) {
{ foreach ($artlist as $key2 => $artitem) {
foreach ($artlist as $key2 => $artitem)
{
if ($firstMark == false) { if ($firstMark == false) {
$script = 'function initTheOne() { $script = 'function initTheOne() {
var theOne = document.getElementById("'.$key2.'"); var theOne = document.getElementById("' . $key2 . '");
artRow.reset(); artRow.reset();
artRow.over( theOne ); artRow.over( theOne );
artRow.click( theOne ) artRow.click( theOne )
@ -795,24 +705,20 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$cells = array(); $cells = array();
foreach ($listColumns as $key => $listColumn) foreach ($listColumns as $key => $listColumn) {
{
// Description for hover effect // Description for hover effect
if($key == 'template') if ($key == 'template') {
{
$templateDescription = $artitem['templateDescription']; $templateDescription = $artitem['templateDescription'];
$descString = '<b>'.$artitem[$key].'</b>'; $descString = '<b>' . $artitem[$key] . '</b>';
$sTemplatename = capiStrTrimHard($artitem[$key], 20); $sTemplatename = capiStrTrimHard($artitem[$key], 20);
if (strlen($artitem[$key]) > 20) { if (strlen($artitem[$key]) > 20) {
$cells[] = '<td nowrap="nowrap" class="bordercell" onmouseover="Tip(\''.$descString.'\', BALLOON, true, ABOVE, true);">'.$sTemplatename.'</td>'; $cells[] = '<td nowrap="nowrap" class="bordercell" onmouseover="Tip(\'' . $descString . '\', BALLOON, true, ABOVE, true);">' . $sTemplatename . '</td>';
} else { } else {
$cells[] = '<td nowrap="nowrap" class="bordercell">'.$artitem[$key].'</td>'; $cells[] = '<td nowrap="nowrap" class="bordercell">' . $artitem[$key] . '</td>';
} }
} } else {
else $cells[] = '<td nowrap="nowrap" class="bordercell">' . $artitem[$key] . '</td>';
{
$cells[] = '<td nowrap="nowrap" class="bordercell">'.$artitem[$key].'</td>';
} }
} }
$tpl->set('d', 'CELLS', implode("\n", $cells)); $tpl->set('d', 'CELLS', implode("\n", $cells));
@ -827,9 +733,8 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tpl->set('d', 'ROWID', $key2); $tpl->set('d', 'ROWID', $key2);
$tpl->next(); $tpl->next();
} }
}else } else {
{ $emptyCell = '<td nowrap="nowrap" class="bordercell" colspan="' . count($listColumns) . '">' . i18n("No articles found") . '</td>';
$emptyCell = '<td nowrap="nowrap" class="bordercell" colspan="'.count($listColumns).'">'.i18n("No articles found").'</td>';
$tpl->set('d', 'CELLS', $emptyCell); $tpl->set('d', 'CELLS', $emptyCell);
$tpl->set('s', 'ROWMARKSCRIPT', ''); $tpl->set('s', 'ROWMARKSCRIPT', '');
} }
@ -853,11 +758,10 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tpl2->set('d', 'CAPTION', $value); $tpl2->set('d', 'CAPTION', $value);
$tpl2->set('d', 'SELECTED', $selected); $tpl2->set('d', 'SELECTED', $selected);
$tpl2->next(); $tpl2->next();
} }
$select = ( !$no_article ) ? $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true) : '&nbsp;'; $select = (!$no_article ) ? $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true) : '&nbsp;';
$caption = ( !$no_article ) ? i18n("Sort articles:") : '&nbsp;'; $caption = (!$no_article ) ? i18n("Sort articles:") : '&nbsp;';
$tpl->set('s', 'ARTSORTCAPTION', $caption); $tpl->set('s', 'ARTSORTCAPTION', $caption);
$tpl->set('s', 'ARTSORT', $select); $tpl->set('s', 'ARTSORT', $select);
@ -883,8 +787,8 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tpl2->next(); $tpl2->next();
} }
$select = ( !$no_article ) ? $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true) : '&nbsp;'; $select = (!$no_article ) ? $tpl2->generate($cfg["path"]["templates"] . $cfg['templates']['generic_select'], true) : '&nbsp;';
$caption = ( !$no_article ) ? i18n("Items per page:") : '&nbsp;'; $caption = (!$no_article ) ? i18n("Items per page:") : '&nbsp;';
$tpl->set('s', 'ELEMPERPAGECAPTION', $caption); $tpl->set('s', 'ELEMPERPAGECAPTION', $caption);
$tpl->set('s', 'ELEMPERPAGE', $select); $tpl->set('s', 'ELEMPERPAGE', $select);
@ -895,24 +799,23 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
b.name AS name, b.name AS name,
d.idtpl AS idtpl d.idtpl AS idtpl
FROM FROM
(".$cfg["tab"]["cat"]." AS a, (" . $cfg["tab"]["cat"] . " AS a,
".$cfg["tab"]["cat_lang"]." AS b, " . $cfg["tab"]["cat_lang"] . " AS b,
".$cfg["tab"]["tpl_conf"]." AS c) " . $cfg["tab"]["tpl_conf"] . " AS c)
LEFT JOIN LEFT JOIN
".$cfg["tab"]["tpl"]." AS d " . $cfg["tab"]["tpl"] . " AS d
ON ON
d.idtpl = c.idtpl d.idtpl = c.idtpl
WHERE WHERE
a.idclient = '".Contenido_Security::toInteger($client)."' AND a.idclient = '" . Contenido_Security::toInteger($client) . "' AND
a.idcat = '".Contenido_Security::toInteger($idcat)."' AND a.idcat = '" . Contenido_Security::toInteger($idcat) . "' AND
b.idlang = '".Contenido_Security::toInteger($lang)."' AND b.idlang = '" . Contenido_Security::toInteger($lang) . "' AND
b.idcat = a.idcat AND b.idcat = a.idcat AND
c.idtplcfg = b.idtplcfg"; c.idtplcfg = b.idtplcfg";
$db->query($sql); $db->query($sql);
if ($db->next_record()) if ($db->next_record()) {
{
//$foreignlang = false; //$foreignlang = false;
//conCreateLocationString($idcat, "&nbsp;/&nbsp;", $cat_name); //conCreateLocationString($idcat, "&nbsp;/&nbsp;", $cat_name);
} }
@ -922,8 +825,8 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
if ($cat_name_tmp != '') { if ($cat_name_tmp != '') {
$cat_name = '<div class="categorypath">'; $cat_name = '<div class="categorypath">';
$cat_name .= $cat_name_tmp.'/'; $cat_name .= $cat_name_tmp . '/';
$cat_name .= (isset($sFistArticleName))?clHtmlSpecialChars($sFistArticleName):''; $cat_name .= (isset($sFistArticleName)) ? clHtmlSpecialChars($sFistArticleName) : '';
$cat_name .= "</div>"; $cat_name .= "</div>";
} else { } else {
$cat_name = ''; $cat_name = '';
@ -932,7 +835,7 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$cat_idtpl = $db->f("idtpl"); $cat_idtpl = $db->f("idtpl");
# Hinweis wenn kein Artikel gefunden wurde # Hinweis wenn kein Artikel gefunden wurde
if ( $no_article ) { if ($no_article) {
$tpl->set("d", "START", "&nbsp;"); $tpl->set("d", "START", "&nbsp;");
$tpl->set("d", "ARTICLE", i18n("No articles found")); $tpl->set("d", "ARTICLE", i18n("No articles found"));
@ -957,10 +860,9 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
if ($perm->have_perm_area_action("str_tplcfg","str_tplcfg") || if ($perm->have_perm_area_action("str_tplcfg","str_tplcfg") ||
$perm->have_perm_area_action_item("str_tplcfg","str_tplcfg",$lidcat)) */ $perm->have_perm_area_action_item("str_tplcfg","str_tplcfg",$lidcat)) */
if (($perm->have_perm_area_action_item( "con", "con_tplcfg_edit", $idcat ) || if (($perm->have_perm_area_action_item("con", "con_tplcfg_edit", $idcat) || $perm->have_perm_area_action("con", "con_tplcfg_edit"))) {
$perm->have_perm_area_action( "con", "con_tplcfg_edit" ))) {
if ( 0 != $idcat ) { if (0 != $idcat) {
$tpl->set('s', 'CATEGORY', $cat_name); $tpl->set('s', 'CATEGORY', $cat_name);
$tpl->set('s', 'CATEGORY_CONF', $tmp_img); $tpl->set('s', 'CATEGORY_CONF', $tmp_img);
@ -980,22 +882,15 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tpl->set('s', 'SELF_URL', $sess->url("main.php?area=con&frame=4&idcat=$idcat")); $tpl->set('s', 'SELF_URL', $sess->url("main.php?area=con&frame=4&idcat=$idcat"));
# New Article link # New Article link
if (($perm->have_perm_area_action("con_editart", "con_newart") || if (($perm->have_perm_area_action("con_editart", "con_newart") || $perm->have_perm_area_action_item("con_editart", "con_newart", $idcat))) {
$perm->have_perm_area_action_item("con_editart", "con_newart", $idcat))) 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>');
if ( $idcat != 0 && $cat_idtpl != 0) $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', '<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_TEXT', '&nbsp;');
$tpl->set('s', 'NEWARTICLE_IMG', '&nbsp;'); $tpl->set('s', 'NEWARTICLE_IMG', '&nbsp;');
} }
} } else {
else
{
$tpl->set('s', 'NEWARTICLE_TEXT', '&nbsp;'); $tpl->set('s', 'NEWARTICLE_TEXT', '&nbsp;');
$tpl->set('s', 'NEWARTICLE_IMG', '&nbsp;'); $tpl->set('s', 'NEWARTICLE_IMG', '&nbsp;');
} }
@ -1017,5 +912,4 @@ if ( is_numeric($idcat) && ($idcat >= 0)) {
$tpl->set('s', 'CONTENTS', ''); $tpl->set('s', 'CONTENTS', '');
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['blank']); $tpl->generate($cfg['path']['templates'] . $cfg['templates']['blank']);
} }
?> ?>