Code: Select all
<?php
/*************************************************************************************
Copyright notice
(c) 2002-2005 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
This script is part of PHPWCMS. The PHPWCMS web content management system is
free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.
The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
A copy is found in the textfile GPL.txt and important notices to the license
from the author is found in LICENSE.txt distributed with these scripts.
This script is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/
//26-04-2004 Oliver Georgi -> $level seems to be unused
//19-11-2004 Fernando Batista -> Copy article, Copy strutures :http://fernandobatista.web.pt
//31-03-2005 Fernando Batista -> copy&cut Article Content :http://fernandobatista.web.pt
function struct_list ($id, $dbcon, $copy_article_content, $cut_article_content, $copy_id, $copy_article, $cut_id, $cut_article, $listmode=1, $forbid_cut=0, $forbid_copy=0, $counter=0) {
$counter++;
$sql = "SELECT * FROM ".DB_PREPEND."phpwcms_articlecat WHERE acat_trash=0 AND acat_struct=".intval($id)." ORDER BY acat_sort;";
if($result = mysql_query($sql, $dbcon) or die("error while browsing structure".$sql)) {
$count_row = 0;
while($row = mysql_fetch_array($result)) {
//$struct[$sx] = $row; $sx++;
$struct[$count_row] = $row;
$count_row++;
}
mysql_free_result($result);
if(isset($struct[0])) {
foreach($struct as $key => $value) {
struct_levellist($struct, $key, $counter, $copy_article_content, $cut_article_content, $copy_id, $copy_article, $cut_id, $forbid_cut, $forbid_copy, $listmode, $cut_article, $count_row, $dbcon);
}
}
}
}
function struct_levellist($struct, $key, $counter, $copy_article_content, $cut_article_content, $copy_id, $copy_article, $cut_id, $forbid_cut, $forbid_copy, $listmode, $cut_article, $count_row, $dbcon) {
$page_val = ($listmode) ? "do=admin&p=6" : "do=articles";
$child_count = get_root_childcount($struct[$key]["acat_id"], $dbcon);
$child_sort = (($child_count+1)*10);
$forbid_cut = ($struct[$key]["acat_struct"] == $cut_id || $forbid_cut) ? 1 : 0;
$forbid_copy = ($struct[$key]["acat_struct"] == $copy_id || $forbid_copy) ? 1 : 0;
///////////////////////////////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
$beta_test = $struct[$key]["acat_permit"]; // store category's permissions in $beta_test
///////////////////////////////////////////////////////////////////////////////////////////
$an = html_specialchars($struct[$key]["acat_name"]);
$a = "<tr onMouseOver=\"this.bgColor='#CCFF00';\" onMouseOut=\"this.bgColor='#FFFFFF';\">\n";
$a .= "<td width=\"450\">";
$a .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n";
$a .= "<td nowrap><img src=\"img/leer.gif\" width=\"".(14+(14*($counter-1)))."\" height=\"1\">"; //14
$a .= ($child_count) ? "<a href=\"phpwcms.php?".$page_val."&open=".$struct[$key]["acat_id"].":".((!empty($_SESSION["structure"][$struct[$key]["acat_id"]]))?0:1)."\">" : "";
$a .= "<img src=\"img/symbole/plus_".(($child_count) ? ((!empty($_SESSION["structure"][ $struct[$key]["acat_id"] ])) ? "close" : "open") : "empty");
$a .= ".gif\" width=\"15\" height=\"15\" border=\"0\">".(($child_count) ? "</a>" : "");
$a .= "<img src=\"img/symbole/page_".((!$struct[$key]["acat_hidden"])?1:7).".gif\" width=\"11\" height=\"15\" ";
$a .= getAltTitle('ID: '.$struct[$key]["acat_id"].($struct[$key]["acat_alias"] ? " \nALIAS: ".html_specialchars($struct[$key]["acat_alias"]) : ""));
$a .= "></td>\n";
$a .= "<td><img src=\"img/leer.gif\" width=\"2\" height=\"15\"></td>\n";
$a .= "<td class=\"dir\"><strong>".$an."</strong></td>\n</tr>\n</table></td>\n<td width=\"88\" nowrap>";
///////////////////////////////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
//$a .= ($listmode,$struct,$key,$an,$copy_article_content,$cut_article_content,$copy_article,$copy_id,$cut_article,$cut_id,$forbid_cut,$forbid_copy,$count_row,$child_sort);
$a .= listmode_edits ($listmode,$struct,$key,$an,$copy_article_content,$cut_article_content,$copy_article,$copy_id,$cut_article,$cut_id,$forbid_cut,$forbid_copy,$count_row,$child_sort,$beta_test);
///////////////////////////////////////////////////////////////////////////////////////////
$a .= "</td>\n</tr>\n";
echo $a;
if(isset($_SESSION["structure"][$struct[$key]["acat_id"]]) && $_SESSION["structure"][$struct[$key]["acat_id"]]) {
if(!$listmode) {
///////////////////////////////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
// pass $beta_test (=permissions) to function struct_articlelist
struct_articlelist ($struct[$key]["acat_id"], $counter, $copy_article_content, $cut_article_content, $copy_article, $cut_article, $struct[$key]["acat_order"], $beta_test);
//struct_articlelist ($struct[$key]["acat_id"], $counter, $copy_article_content, $cut_article_content, $copy_article, $cut_article, $struct[$key]["acat_order"]);
///////////////////////////////////////////////////////////////////////////////////////////
}
//26-04-2004 Oliver Georgi
//struct_list ($struct[$key]["acat_id"], $dbcon, $cut_id, $cut_article, $listmode, $forbid_cut, $counter, $level);
//$level seems to be unused
struct_list ($struct[$key]["acat_id"], $dbcon, $copy_article_content, $cut_article_content, $copy_id, $copy_article, $cut_id, $cut_article, $listmode, $forbid_cut, $forbid_copy, $counter);
}
}
function get_root_childcount($id, $dbcon) {
//Ermittelt Anzahl bereits vorhandener aktiver Unterlevels
$p1_count = $p2_count = 0;
$id = intval($id);
if($p_result = mysql_query("SELECT COUNT(acat_id) FROM ".DB_PREPEND."phpwcms_articlecat WHERE acat_trash=0 AND acat_struct=".$id.";", $dbcon)) {
if($p_row = mysql_fetch_row($p_result)) $p1_count = $p_row[0];
mysql_free_result($p_result);
}
if($p_result = mysql_query("SELECT COUNT(article_id) FROM ".DB_PREPEND."phpwcms_article WHERE article_deleted=0 AND article_cid=".$id.";", $dbcon)) {
if($p_row = mysql_fetch_row($p_result)) $p2_count = $p_row[0];
mysql_free_result($p_result);
}
return $p1_count + $p2_count;
}
//31-03-2005 Fernando Batista start-----------------------------------------------------------------------------------------------------------
function get_article_content_count($id, $dbcon) {
$p_count = 0;
$id = intval($id);
if($p_result = mysql_query("SELECT COUNT(acontent_id) FROM ".DB_PREPEND."phpwcms_articlecontent WHERE acontent_trash=0 AND acontent_aid=".$id.";", $dbcon)) {
if($p_row = mysql_fetch_row($p_result)) $p_count = $p_row[0];
mysql_free_result($p_result);
}
return $p_count;
}
//31-03-2005 Fernando Batista end-------------------
///////////////////////////////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
// function struct_articlelist ($struct_id, $counter, $copy_article_content, $cut_article_content, $copy_article, $cut_article, $article_order=0) {
function struct_articlelist ($struct_id, $counter, $copy_article_content, $cut_article_content, $copy_article, $cut_article, $article_order=0, $beta_innertest) {
///////////////////////////////////////////////////////////////////////////////////////////
$count_article = 0;
$article_order = intval($article_order);
$show_sort = (!$article_order || $article_order == 1) ? 1 : 0;
$ao = get_order_sort($article_order);
echo "\n\n\n".'<!-- ORDER: '.$ao[2].' //-->'."\n\n\n";
$sql = "SELECT article_id, article_cid, article_title, article_public, article_aktiv, article_uid, ".
"date_format(article_tstamp, '%Y-%m-%d %H:%i:%s') AS article_date FROM ".
DB_PREPEND."phpwcms_article WHERE article_cid='".$struct_id."' AND article_deleted=0 ".
"ORDER BY ".$ao[2].";";
//"ORDER BY article_sort;";
if($result = mysql_query($sql, $GLOBALS['db']) or die ("error while browsing related articles")) {
while($row = mysql_fetch_array($result)) {
$article[$count_article] = $row;
$count_article++;
}
mysql_free_result($result);
}
if(isset($article[0])) {
foreach($article as $akey => $avalue) {
///////////////////////////////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
// look if logged in user has got permission to edit category or not / max: 20 users
$hasPermission = false;
if ($beta_innertest == '') {
// if no permissions are defined
$hasPermission = true;
}
else {
for ($loop = 0; $loop < 20; $loop++) {
if ($_SESSION["wcs_user_id"] == $beta_innertest[$loop]) {
$hasPermission = true;
break;
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////
$at = html_specialchars(str_replace("'", '"', $article[$akey]["article_title"]));
//31-03-2005 Fernando Batista start-----------------------------------------------------------------------------------------------------------
if($cut_article == $article[$akey]["article_id"] ) {
$a = "<tr bgColor='#B4E101'>\n";
}elseif($copy_article == $article[$akey]["article_id"]){
$a = "<tr bgColor='#B4E101'>\n";
}else{
$a = "<tr onMouseOver=\"this.bgColor='#CCFF00';\" onMouseOut=\"this.bgColor='#FFFFFF';\">\n";
}
$a .= "<td width=\"450\">";
$a .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n";
$acontent_count = get_article_content_count($article[$akey]["article_id"], $GLOBALS['db']);
///////////////////////////////////////////////////////////////////////////////////////////
if($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"] || $hasPermission == true) {
///////////////////////////////////////////////////////////////////////////////////////////
$a .= "<td nowrap><img src=\"img/leer.gif\" width=\"".(14+14+(14*($counter-1)))."\" height=\"1\">";
$a .= ($acontent_count) ? "<a href=\"phpwcms.php?do=articles&opena=".$article[$akey]["article_id"].":".((!empty($_SESSION["structure"]["article"][$article[$akey]["article_id"]]))?0:1)."\">" : "";
$a .= "<img src=\"img/symbole/plus_".(($acontent_count) ? ((!empty($_SESSION["structure"]["article"][ $article[$akey]["article_id"] ])) ? "close" : "open") : "empty");
$a .= ".gif\" width=\"15\" height=\"15\" border=\"0\">".(($acontent_count) ? "</a>" : "");
}else{
$a .= "<td nowrap><img src=\"img/leer.gif\" width=\"".(14+29+(14*($counter-1)))."\" height=\"1\">";
}
//31-03-2005 Fernando Batista end-------------------
$a .= "<img src=\"img/symbole/text_1.gif\" width=\"11\" height=\"15\" ";
$a .= getAltTitle($GLOBALS["BL"]['be_func_struct_articleID'].": ".$article[$akey]["article_id"]);
$a .= "></td>\n";
$a .= "<td><img src=\"img/leer.gif\" width=\"2\" height=\"15\"></td>\n";
$a .= "<td class=\"dir\"><a href=\"index.php?id=".$article[$akey]["article_cid"].",".$article[$akey]["article_id"];
$a .= ",0,0,1,0\" target=\"_blank\" title=\"".$GLOBALS["BL"]['be_func_struct_preview'].": ".$at."\">";
$a .= $at."</a></td>\n</tr>\n</table></td>\n<td width=\"88\" nowrap>";
///////////////////////////////////////////////////////////////////////////////////////////
if($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"] || $hasPermission == true ) {
///////////////////////////////////////////////////////////////////////////////////////////
$a .= "<a href=\"phpwcms.php?do=articles&p=2&s=1&id=".$article[$akey]["article_id"];
$a .= "\" title=\"".$GLOBALS["BL"]['be_func_struct_edit']." \n[".$at."]\">";
$a .= "<img src=\"img/button/edit_11x11.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<img src=\"img/button/edit_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\">";
}
if($cut_article != $article[$akey]["article_id"] && !$cut_article_content) {
$a .= "<a href=\"phpwcms.php?do=articles&acut=".$article[$akey]["article_id"];
$a .= "\" title=\"".$GLOBALS["BL"]['be_func_struct_cut']." \n[".$at."]\">";
$a .= "<img src=\"img/button/cut_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
//31-03-2005 Fernando Batista start-----------------------------------------------------------------------------------------------------------
} elseif($cut_article_content) {
$a .= "<a href=\"include/inc_act/act_structure.php?do=7|".$cut_article_content."|".$article[$akey]["article_id"]."|-10";
$a .= "\" title=\"".$GLOBALS['BL']['be_func_content_paste0'];
$a .= " [".$at."]\"><img src=\"img/button/cut_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
//31-03-2005 Fernando Batista end-------------------
} else {
$a .= "<a href=\"phpwcms.php?do=articles\" title=\"".$GLOBALS["BL"]['be_func_struct_nocut'].'">';
$a .= "<img src=\"img/button/cut_11x11_3.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
if($copy_article != $article[$akey]["article_id"] && !$copy_article_content) {
$a .= "<a href=\"phpwcms.php?do=articles&acopy=".$article[$akey]["article_id"];
$a .= "\" title=\"".$GLOBALS["BL"]['be_func_struct_copy']." \n[".$at."]\">";
$a .= "<img src=\"img/button/copy_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
//31-03-2005 Fernando Batista start-----------------------------------------------------------------------------------------------------------
} elseif($copy_article_content) {
$a .= "<a href=\"include/inc_act/act_structure.php?do=8|".$copy_article_content."|".$article[$akey]["article_id"]."|-10";
$a .= "\" title=\"".$GLOBALS['BL']['be_func_content_paste0'];
$a .= " [".$at."]\"><img src=\"img/button/copy_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
//31-03-2005 Fernando Batista end-------------------
} else {
$a .= "<a href=\"phpwcms.php?do=articles\" title=\"".$GLOBALS["BL"]['be_func_struct_nocopy'].'">';
$a .= "<img src=\"img/button/copy_11x11_3.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
//Sortierungslink
$sort_up = ($count_article > 1 && $akey && $show_sort) ? 1 : 0;
$sort_down = ($count_article > 1 && $akey + 1 < $count_article && $show_sort) ? 1 : 0;
//davor sortieren
$a .= ($sort_up) ? '<a href="include/inc_act/act_structure.php?do=4|'.$article[$akey]["article_id"].'|'.
($akey*10).'|'.$article[$akey-1]["article_id"].'|'.(($akey+1)*10).
'" title="'.$GLOBALS['BL']['be_func_struct_sort_up'].'">':'';
$a .= "<img src=\"img/button/sort_1_".$sort_up.".gif\" width=\"11\" height=\"11\" border=\"0\">".(($sort_up)?"</a>":"");
//dahinter sortieren
$a .= ($sort_down) ? '<a href="include/inc_act/act_structure.php?do=4|'.$article[$akey]["article_id"]."|".
(($akey+2)*10)."|".$article[$akey+1]["article_id"]."|".(($akey+1)*10).
'" title="'.$GLOBALS['BL']['be_func_struct_sort_down'].'">':'';
$a .= "<img src=\"img/button/sort_2_".$sort_down.".gif\" width=\"11\" height=\"11\" border=\"0\">".(($sort_down)?"</a>":"");
//active und visible Status wechseln
$a .= "<a href=\"include/inc_act/act_articlecontent.php?do=3,".$article[$akey]["article_id"].",,".(($article[$akey]["article_aktiv"])?0:1);
$a .= '" title="'.$GLOBALS["BL"]['be_func_struct_svisible'].'">';
$a .= "<img src=\"img/button/visible_11x11_".$article[$akey]["article_aktiv"].".gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
$a .= "<a href=\"include/inc_act/act_articlecontent.php?do=4,".$article[$akey]["article_id"].",,".(($article[$akey]["article_public"])?0:1);
$a .= '" title="'.$GLOBALS["BL"]['be_func_struct_spublic'].'">';
$a .= "<img src=\"img/button/public_11x11_".$article[$akey]["article_public"].".gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
//Article Löschen
///////////////////////////////////////////////////////////////////////////////////////////
if($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"] || $hasPermission == true ) {
///////////////////////////////////////////////////////////////////////////////////////////
$a .= "<a href=\"include/inc_act/act_articlecontent.php?do=1,".$article[$akey]["article_id"];
$a .= "\" title=\"".$GLOBALS['BL']['be_func_struct_del_article']." \n[".$at."]\" ";
$a .= "onClick=\"GP_popupConfirmMsg('".$GLOBALS['BL']['be_func_struct_del_jsmsg']." \\n[".js_singlequote($at)."] ');return document.MM_returnValue\">";
$a .= "<img src=\"img/button/del_11x11.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<img src=\"img/button/del_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\">";
}
$a .= "</td>\n</tr>\n";
echo $a;
//31-03-2005 Fernando Batista start-----------------------------------------------------------------------------------------------------------
$sql = "SELECT acontent_id, acontent_sorting, acontent_trash, acontent_block FROM ".DB_PREPEND."phpwcms_articlecontent ";
$sql .= "WHERE acontent_aid=".$article[$akey]["article_id"]." ORDER BY acontent_block, acontent_sorting, acontent_id";
if($result = mysql_query($sql, $GLOBALS['db']) or die("error while listing contents for this article")) {
$sc = 0; $scc = 0; //Sort-Zwischenzähler
while($row = mysql_fetch_row($result)) {
$scc++;
if($row[2] == 0) {
$sc++;
$sbutton[$sc]["id"] = $row[0];
$sbutton[$sc]["sort"] = $row[1];
$sbutton[$sc]["block"] = $row[3];
}
}
}
if($sc) {
//Jetzt aufbauen der Sortieranweisung
foreach($sbutton as $key => $value) {
if($key == 1) {
// if 1st content part in list
$sbutton[$key]["top"] = "<img src=\"img/button/sort_1_0.gif\" border=\"0\">";
} elseif(isset($sbutton[$key-1]["block"]) && $sbutton[$key-1]["block"] != $sbutton[$key]["block"]) {
// if this content part is selected for different block than previous
$sbutton[$key]["top"] = "<img src=\"img/button/sort_1_0.gif\" border=\"0\">";
} else {
$sbutton[$key]["top"] = "<a href=\"include/inc_act/act_articlecontent.php?sort=".
$sbutton[$key]["id"].":".$sbutton[$key-1]["sort"]."|".
$sbutton[$key-1]["id"].":".$sbutton[$key]["sort"].
"\" title=\"".$GLOBALS["BL"]['be_article_cnt_up']."\"><img src=\"img/button/sort_1_1.gif\" border=\"0\"></a>";
}
if($key == $sc) {
// if this is the last content part in list
$sbutton[$key]["bottom"] = "<img src=\"img/button/sort_2_0.gif\" border=\"0\">";
} elseif(isset($sbutton[$key+1]["block"]) && $sbutton[$key+1]["block"] != $sbutton[$key]["block"]) {
// if this is the last content part in current block and next is different
$sbutton[$key]["bottom"] = "<img src=\"img/button/sort_2_0.gif\" border=\"0\">";
} else {
$sbutton[$key]["bottom"] = "<a href=\"include/inc_act/act_articlecontent.php?sort=".
$sbutton[$key]["id"].":".$sbutton[$key+1]["sort"]."|".
$sbutton[$key+1]["id"].":".$sbutton[$key]["sort"].
"\" title=\"".$GLOBALS["BL"]['be_article_cnt_down']."\"><img src=\"img/button/sort_2_1.gif\" border=\"0\"></a>";
}
$sbutton_string[$sbutton[$key]["id"]] = $sbutton[$key]["top"].
//changed - not neccessary - Oliver: 10-04-2005
//"<img src=\"img/leer.gif\" width=\"1\" height=\"1\">".
$sbutton[$key]["bottom"];
}
unset($sbutton);
}
//-----------------------
/////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
if($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"] || $hasPermission == true ) {
/////////////////////////////////////////////////////////////////
if(isset($_SESSION["structure"]["article"][$article[$akey]["article_id"]]) && $_SESSION["structure"]["article"][$article[$akey]["article_id"]]) {
struct_articlecontentlist ($article, $akey, $copy_article_content, $cut_article_content, $counter, $sbutton_string, $GLOBALS['db'], $beta_innertest);
}
}
//31-03-2005 Fernando Batista end-------------------
}
}
}
//31-03-2005 Fernando Batista start-----------------------------------------------------------------------------------------------------------
//////////////////////////////////////////////////////////////
function struct_articlecontentlist ($article, $akey, $copy_article_content, $cut_article_content, $counter, $sbutton_string, $db, $beta_innertest){
$a = '';
$sql = "SELECT * FROM ".DB_PREPEND."phpwcms_articlecontent ".
"WHERE acontent_aid=".$article[$akey]["article_id"]." AND acontent_trash=0 ".
"ORDER BY acontent_block, acontent_sorting, acontent_id;";
if($result = mysql_query($sql, $db) or die("error while listing contents for this article")) {
while($article_content = mysql_fetch_assoc($result)) {
if($cut_article_content == $article_content["acontent_id"] ) {
$a .= "<tr bgColor='#FFA801'>\n";
}elseif($copy_article_content == $article_content["acontent_id"]){
$a .= "<tr bgColor='#FFA801'>\n";
}else{
$a .= "<tr onMouseOver=\"this.bgColor='#FFDE01';\" onMouseOut=\"this.bgColor='#FFFFFF';\">\n"; //#F1F5F9
}
$a .= "<td><img src=\"img/leer.gif\" width=\"".(14+14+29+(14*($counter-1)))."\" height=\"1\"><td>"; //$counter-1
$a .= "<td align=\"right\"><img src=\"img/symbole/content_9x11.gif\" width=\"9\" height=\"11\" border=\"0\"><img src=\"img/leer.gif\" width=\"5\" height=\"1\"></td>";
$a .= "<td width=\"300\" class=\"v09\" style=\"color:#727889;\" style=\"padding-top:1px;padding-bottom:1px;\">";
$a .= "[ID:".$article_content["acontent_id"]."] ";
$a .= "<strong>".$GLOBALS["wcs_content_type"][$article_content["acontent_type"]]."</strong>";
$a .= "</td>";
$a .= "<td align=\"left\"><img src=\"img/leer.gif\" width=\"5\" height=\"1\"><img src=\"img/symbole/block.gif\" width=\"9\" height=\"11\" border=\"0\"><img src=\"img/leer.gif\" width=\"5\" height=\"1\"></td>";
$a .= "<td width=\"150\" align=\"left\" class=\"v09\" style=\"color:#727889;\">".htmlentities(' {'.$article_content['acontent_block'].'} ')."</td>";
$a .= '<td width="88" nowrap style="padding-top:1px;padding-bottom:1px;">';
$at = " [ID:".$article_content["acontent_id"]."] ".$GLOBALS["wcs_content_type"][$article_content["acontent_type"]]." ";
///////////////////////////////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
// look if logged in user has got permission to edit category or not / max: 20 users
$hasPermission = false;
if ($beta_innertest == '') {
// if no permissions are defined
$hasPermission = true;
}
else {
for ($loop = 0; $loop < 20; $loop++) {
if ($_SESSION["wcs_user_id"] == $beta_innertest[$loop]) {
$hasPermission = true;
break;
}
}
}
if($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"] || $hasPermission == true ) {
///////////////////////////////////////////////////////////////////////////////////////////
$a .= "<a href=\"phpwcms.php?do=articles&p=2&s=1&aktion=2&id=".$article[$akey]["article_id"]."&acid=".$article_content["acontent_id"];
$a .= "\" title=\"".$GLOBALS["BL"]['be_func_content_edit']." [".$at."]\">";
$a .= "<img src=\"img/button/edit_11x11.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<img src=\"img/button/edit_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\">";
}
//----------------
if($cut_article_content) {
if($cut_article_content != $article_content["acontent_id"]) {
$a .= "<a href=\"include/inc_act/act_structure.php?do=7|".$cut_article_content."|".$article_content["acontent_aid"]."|".$article_content["acontent_sorting"];
$a .= "\" title=\"".$GLOBALS['BL']['be_func_content_paste'];
$a .= " [".$at."]\"><img src=\"img/button/cut_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<a href=\"phpwcms.php?do=articles\" title=\"";
$a .= $GLOBALS['BL']['be_func_content_paste_cancel']." [".$at."]";
$a .= "\"><img src=\"img/button/cut_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
} else {
if($article_content["acontent_id"]) {
$a .= "<a href=\"phpwcms.php?do=articles&accut=".$article_content["acontent_id"]."\" title=\"";
$a .= $GLOBALS['BL']['be_func_content_cut']." [".$at;
$a .= "]\"><img src=\"img/button/cut_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<a href=\"phpwcms.php?do=articles\" title=\"".$GLOBALS['BL']['be_func_content_no_cut']."\">";
$a .= "<img src=\"img/button/cut_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
}
if($copy_article_content) {
if($copy_article_content != $article_content["acontent_id"]) {
$a .= "<a href=\"include/inc_act/act_structure.php?do=8|".$copy_article_content."|".$article_content["acontent_aid"]."|".$article_content["acontent_sorting"];
$a .= "\" title=\"".$GLOBALS['BL']['be_func_content_paste'];
$a .= " [".$at."]\"><img src=\"img/button/copy_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<a href=\"phpwcms.php?do=articles\" title=\"";
$a .= $GLOBALS['BL']['be_func_content_paste_cancel']." [".$at."]";
$a .= "\"><img src=\"img/button/copy_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
} else {
if($article_content["acontent_id"]) {
$a .= "<a href=\"phpwcms.php?do=articles&accopy=".$article_content["acontent_id"]."\" title=\"";
$a .= $GLOBALS['BL']['be_func_content_copy']." [".$at;
$a .= "]\"><img src=\"img/button/copy_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<a href=\"phpwcms.php?do=articles\" title=\"".$GLOBALS['BL']['be_func_content_no_copy']."\">";
$a .= "<img src=\"img/button/copy_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
}
$a .=$sbutton_string[$article_content["acontent_id"]];
$a .= "<a href=\"include/inc_act/act_articlecontent.php?do=2,".$article_content["acontent_aid"].",".$article_content["acontent_id"].",".(($article_content["acontent_visible"])?0:1);
$a .= '" title="'.$GLOBALS["BL"]['be_func_struct_svisible'].'">';
$a .= "<img src=\"img/button/visible_11x11_".$article_content["acontent_visible"].".gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
// added space between visible icon and delete icon
$a .= '<img src="img/leer.gif" width="11" height="1" border="0" alt="">';
///////////////////////////////////////////////////////////////////////////////////////////
if($article_content["acontent_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"] || hasPermission == true) {
///////////////////////////////////////////////////////////////////////////////////////////
$a .= "<a href=\"include/inc_act/act_articlecontent.php?do=9,".$article_content["acontent_aid"].",".$article_content["acontent_id"];
$a .= "\" title=\"".$GLOBALS['BL']['be_article_cnt_delpart']." [".$at."]\" ";
$a .= "onClick=\"GP_popupConfirmMsg('".$GLOBALS['BL']['be_article_cnt_delpart']." \\n[".js_singlequote($at)."] ');return document.MM_returnValue\">";
$a .= "<img src=\"img/button/del_11x11.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<img src=\"img/button/del_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\">";
}
//-------
$a .= "</td>";
$a .= "\n</tr>";
}
if($a){
$aa = "<tr>\n<td colspan=\"2\">"; // bgColor=#F1F5F9
$aa .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"538\">\n";
$aa .= $a;
$aa .= "</table></td></tr>";
echo $aa;
}
}
}
//31-03-2005 Fernando Batista end-------------------
///////////////////////////////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
//function listmode_edits ($listmode, $struct, $key, $an, $copy_article_content, $cut_article_content, $copy_article, $copy_id, $cut_article, $cut_id, $forbid_cut, $forbid_copy, $count_row, $child_sort) {
function listmode_edits ($listmode, $struct, $key, $an, $copy_article_content, $cut_article_content, $copy_article, $copy_id, $cut_article, $cut_id, $forbid_cut, $forbid_copy, $count_row, $child_sort, $beta_innertest) {
///////////////////////////////////////////////////////////////////////////////////////////
//Unterscheidung, welche bearbeitungsfunktionen angezeigt werden sollen
$a = "";
switch($listmode) {
// case 0 = structlevels in "structlevel and articlelist"
case 0:
///////////////////////////////////////////////////////////////////////////////////////////
//////////////// edit article depending on category permission // beta_bi
// look if logged in user has got permission to edit category or not / max: 20 users
$hasPermission = false;
if ($beta_innertest == '') {
// if no permissions are defined
$hasPermission = true;
}
else {
for ($loop = 0; $loop < 20; $loop++) {
if ($_SESSION["wcs_user_id"] == $beta_innertest[$loop]) {
$hasPermission = true;
break;
}
}
}
///////////////////////////////////////////////////////////////////////////////////////////
if($article[$akey]["article_uid"] == $_SESSION["wcs_user_id"] || $_SESSION["wcs_user_admin"] || $hasPermission == true ) {
$a .= "<a href=\"phpwcms.php?do=articles&p=1&struct=".$struct[$key]["acat_id"]."\" ";
$a .= "title=\"".$GLOBALS['BL']['be_func_struct_new_article']." \n[".$an."]\">";
$a .= "<img src=\"img/button/add_11x11.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
///////////////////////////////////////////////////////////////////////////////////////////
if($cut_article) { //Wenn ID zum Artikelausschneiden angegeben
$a .= "<a href=\"include/inc_act/act_structure.php?do=3|".$cut_article."|";
$a .= $struct[$key]["acat_id"]."\" title=\"".$GLOBALS['BL']['be_func_struct_paste_article']." \n[".$an;
$a .= "]\"><img src=\"img/button/cut_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<img src=\"img/button/cut_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\">";
}
if($copy_article) {
$a .= "<a href=\"include/inc_act/act_structure.php?do=5|".$copy_article."|";
$a .= $struct[$key]["acat_id"]."\" title=\"".$GLOBALS['BL']['be_func_struct_paste_article']." \n[".$an;
$a .= "]\"><img src=\"img/button/copy_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<img src=\"img/button/copy_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\">";
}
$a .= "<img src=\"img/button/sort_1_0.gif\" width=\"11\" height=\"11\" border=\"0\">";
$a .= "<img src=\"img/button/sort_2_0.gif\" width=\"11\" height=\"11\" border=\"0\">";
$a .= "<img src=\"img/button/visible_11x11a_".$struct[$key]["acat_aktiv"].".gif\" width=\"11\" height=\"11\" border=\"0\">";
$a .= "<img src=\"img/button/public_11x11a_".$struct[$key]["acat_public"].".gif\" width=\"11\" height=\"11\" border=\"0\">";
break;
// case 0 = structlevels in "structlevel admin"
case 1: $a .= "<a href=\"phpwcms.php?do=admin&p=6&struct=".$struct[$key]["acat_id"]."&sort=".$child_sort."\" title=\"";
$a .= $GLOBALS['BL']['be_func_struct_insert_level']." [".$an."]\"><img src=\"img/button/add_11x11.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
if($cut_id) {
if($cut_id != $struct[$key]["acat_id"] && !$forbid_cut) {
$a .= "<a href=\"include/inc_act/act_structure.php?do=1|".$cut_id."|".$struct[$key]["acat_id"]."|";
$a .= $child_sort."\" title=\"".$GLOBALS['BL']['be_func_struct_paste_level'];
$a .= " [".$an."]\"><img src=\"img/button/cut_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<a href=\"phpwcms.php?do=admin&p=6\" title=\"";
$a .= ($forbid_cut) ? $GLOBALS['BL']['be_func_struct_no_paste1']."\n[".$an."]\n".
$GLOBALS['BL']['be_func_struct_no_paste2']."\n".
$GLOBALS['BL']['be_func_struct_no_paste3'] :
$GLOBALS['BL']['be_func_struct_paste_cancel']." [".$an."]";
$a .= "\"><img src=\"img/button/cut_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
} else {
if($struct[$key]["acat_id"]) {
$a .= "<a href=\"phpwcms.php?do=admin&p=6&cut=".$struct[$key]["acat_id"]."\" title=\"";
$a .= $GLOBALS['BL']['be_func_struct_cut_level']." [".$an;
$a .= "]\"><img src=\"img/button/cut_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<a href=\"phpwcms.php?do=admin&p=6\" title=\"".$GLOBALS['BL']['be_func_struct_no_cut']."\">";
$a .= "<img src=\"img/button/cut_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
}
if($copy_id) {
if($copy_id != $struct[$key]["acat_id"] && !$forbid_copy) {
$a .= "<a href=\"include/inc_act/act_structure.php?do=6|".$copy_id."|".$struct[$key]["acat_id"]."|";
$a .= $child_sort."\" title=\"".$GLOBALS['BL']['be_func_struct_paste_level'];
$a .= " [".$an."]\"><img src=\"img/button/copy_11x11_1.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<a href=\"phpwcms.php?do=admin&p=6\" title=\"";
$a .= ($forbid_copy) ? $GLOBALS['BL']['be_func_struct_no_paste1']."\n[".$an."]\n".
$GLOBALS['BL']['be_func_struct_no_paste2']."\n".
$GLOBALS['BL']['be_func_struct_no_paste3'] :
$GLOBALS['BL']['be_func_struct_paste_cancel']." [".$an."]";
$a .= "\"><img src=\"img/button/copy_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
} else {
if($struct[$key]["acat_id"]) {
$a .= "<a href=\"phpwcms.php?do=admin&p=6&cop=".$struct[$key]["acat_id"]."\" title=\"";
$a .= $GLOBALS['BL']['be_func_struct_copy_level']." [".$an;
$a .= "]\"><img src=\"img/button/copy_11x11_0.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
} else {
$a .= "<a href=\"phpwcms.php?do=admin&p=6\" title=\"".$GLOBALS['BL']['be_func_struct_no_copy']."\">";
$a .= "<img src=\"img/button/copy_11x11_9.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
}
//if($struct[$key]["acat_id"]) {
$a .= "<a href=\"phpwcms.php?do=admin&p=6&struct=";
if($struct[$key]["acat_id"]) {
$a .= $struct[$key]["acat_struct"]."&cat=".$struct[$key]["acat_id"];
} else {
$a .= 'index';
}
$a .= '" title="'.$GLOBALS['BL']['be_func_struct_sedit'].' ['.$an.']">';
$a .= "<img src=\"img/button/edit_22x11.gif\" width=\"22\" height=\"11\" border=\"0\"></a>";
//} else {
// $a .= "<img src=\"img/leer.gif\" width=\"22\" height=\"1\">";
//}
//Sortierungslink
$sort_up = (($count_row>1 && $key)?1:0);
$sort_down = (($count_row>1 && $key+1<$count_row)?1:0);
//davor sortieren
$a .= ($sort_up)? "<a href=\"include/inc_act/act_structure.php?do=2|".$struct[$key]["acat_id"]."|".($key*10)."|".$struct[$key-1]["acat_id"].
"|".(($key+1)*10).'" title="'.$GLOBALS['BL']['be_func_struct_sort_up'].'">':'';
$a .= "<img src=\"img/button/sort_1_".$sort_up.".gif\" width=\"11\" height=\"11\" border=\"0\">".(($sort_up)?"</a>":"");
//dahinter sortieren
$a .= ($sort_down)? "<a href=\"include/inc_act/act_structure.php?do=2|".$struct[$key]["acat_id"]."|".(($key+2)*10)."|".$struct[$key+1]["acat_id"].
"|".(($key+1)*10).'" title="'.$GLOBALS['BL']['be_func_struct_sort_down'].'">':'';
$a .= "<img src=\"img/button/sort_2_".$sort_down.".gif\" width=\"11\" height=\"11\" border=\"0\">".(($sort_down)?"</a>":"");
if($struct[$key]["acat_id"]) {
$a .= "<a href=\"include/inc_act/act_structure.php?do=9|".$struct[$key]["acat_id"];
$a .= "\" title=\"".$GLOBALS['BL']['be_func_struct_del_struct']." [".$an."]\" ";
$a .= "onClick=\"GP_popupConfirmMsg('".$GLOBALS['BL']['be_func_struct_del_sjsmsg']." \\n\\n[".js_singlequote($an)."] ');return document.MM_returnValue\">";
$a .= "<img src=\"img/button/del_11x11.gif\" width=\"11\" height=\"11\" border=\"0\"></a>";
}
break;
default: $a .= " ";
}
return $a;
}
?>