|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Project:
|
|
|
|
|
* Contenido Content Management System
|
|
|
|
@ -32,20 +33,18 @@
|
|
|
|
|
* }}
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (!defined('CON_FRAMEWORK')) {
|
|
|
|
|
die('Illegal call');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$debug = false;
|
|
|
|
|
$debug = true;
|
|
|
|
|
|
|
|
|
|
$tmp_area = "str";
|
|
|
|
|
|
|
|
|
|
if ($action == "str_duplicate" &&
|
|
|
|
|
($perm->have_perm_area_action("str", "str_duplicate") ||
|
|
|
|
|
$perm->have_perm_area_action_item("str", "str_duplicate", $idcat)))
|
|
|
|
|
{
|
|
|
|
|
$perm->have_perm_area_action_item("str", "str_duplicate", $idcat))) {
|
|
|
|
|
strCopyTree($idcat, $parentid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -101,8 +100,7 @@ function buildCategorySelectRights() {
|
|
|
|
|
|
|
|
|
|
$categories = array();
|
|
|
|
|
|
|
|
|
|
while ($db->next_record())
|
|
|
|
|
{
|
|
|
|
|
while ($db->next_record()) {
|
|
|
|
|
$categories[$db->f("idcat")]["name"] = $db->f("name");
|
|
|
|
|
$categories[$db->f("idcat")]["idcat"] = $db->f("idcat");
|
|
|
|
|
|
|
|
|
@ -131,12 +129,10 @@ function buildCategorySelectRights() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$j = 1;
|
|
|
|
|
foreach ($categories as $tmpidcat => $props)
|
|
|
|
|
{
|
|
|
|
|
foreach ($categories as $tmpidcat => $props) {
|
|
|
|
|
$spaces = " ";
|
|
|
|
|
|
|
|
|
|
for ($i = 0; $i < $props["level"]; $i ++)
|
|
|
|
|
{
|
|
|
|
|
for ($i = 0; $i < $props["level"]; $i ++) {
|
|
|
|
|
$spaces .= " ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -150,8 +146,7 @@ function buildCategorySelectRights() {
|
|
|
|
|
return $oHtmlSelect->toHtml();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getExpandCollapseButton ($item, $catName)
|
|
|
|
|
{
|
|
|
|
|
function getExpandCollapseButton($item, $catName) {
|
|
|
|
|
global $sess, $PHP_SELF, $frame, $area;
|
|
|
|
|
$selflink = "main.php";
|
|
|
|
|
|
|
|
|
@ -159,10 +154,8 @@ function getExpandCollapseButton ($item, $catName)
|
|
|
|
|
$img->updateAttributes(array("style" => "padding:4px;"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (count($item->subitems) > 0)
|
|
|
|
|
{
|
|
|
|
|
if ($item->collapsed == true)
|
|
|
|
|
{
|
|
|
|
|
if (count($item->subitems) > 0) {
|
|
|
|
|
if ($item->collapsed == true) {
|
|
|
|
|
$expandlink = $sess->url($selflink . "?area=$area&frame=$frame&expand=" . $item->id);
|
|
|
|
|
|
|
|
|
|
$img->setSrc($item->collapsed_icon);
|
|
|
|
@ -223,14 +216,12 @@ if (isset($force) && $force == 1) {
|
|
|
|
|
$remakeStrTable = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($StrTableClient != $client)
|
|
|
|
|
{
|
|
|
|
|
if ($StrTableClient != $client) {
|
|
|
|
|
unset($expandedList);
|
|
|
|
|
$remakeStrTable = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($StrTableLang != $lang)
|
|
|
|
|
{
|
|
|
|
|
if ($StrTableLang != $lang) {
|
|
|
|
|
unset($expandedList);
|
|
|
|
|
$remakeStrTable = true;
|
|
|
|
|
}
|
|
|
|
@ -238,31 +229,53 @@ if ($StrTableLang != $lang)
|
|
|
|
|
$StrTableClient = $client;
|
|
|
|
|
$StrTableLang = $lang;
|
|
|
|
|
|
|
|
|
|
if (!isset($idcat) ) $idcat = 0;
|
|
|
|
|
if (!isset($action) ) $action = 0;
|
|
|
|
|
if (!isset($idcat))
|
|
|
|
|
$idcat = 0;
|
|
|
|
|
if (!isset($action))
|
|
|
|
|
$action = 0;
|
|
|
|
|
|
|
|
|
|
function buildTree (&$rootItem, &$items)
|
|
|
|
|
{
|
|
|
|
|
function buildTree(&$rootItem, &$items) {
|
|
|
|
|
global $nextItem, $perm, $tmp_area;
|
|
|
|
|
|
|
|
|
|
while ($item_list = each($items))
|
|
|
|
|
{
|
|
|
|
|
while ($item_list = each($items)) {
|
|
|
|
|
list($key, $item) = $item_list;
|
|
|
|
|
|
|
|
|
|
unset($newItem);
|
|
|
|
|
|
|
|
|
|
$bCheck = false;
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_newtree"); }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_newcat"); }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_makevisible");}
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_makepublic");}
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_deletecat");}
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_moveupcat");}
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_movedowncat");}
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_movesubtree");}
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_renamecat");}
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action("str_tplcfg", "str_tplcfg");}
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_item($tmp_area, $item['idcat']);}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_newtree");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_newcat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_makevisible");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_makepublic");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_deletecat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_moveupcat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_movedowncat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_movesubtree");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_renamecat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action("str_tplcfg", "str_tplcfg");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_item($tmp_area, $item['idcat']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($bCheck) {
|
|
|
|
|
$newItem = new TreeItem($item['name'], $item['idcat'], true);
|
|
|
|
@ -284,20 +297,17 @@ function buildTree (&$rootItem, &$items)
|
|
|
|
|
$newItem->custom['idtplcfg'] = $item['idtplcfg'];
|
|
|
|
|
$newItem->custom['public'] = $item['public'];
|
|
|
|
|
|
|
|
|
|
if ($perm->have_perm_item("str", $item['idcat']))
|
|
|
|
|
{
|
|
|
|
|
if ($perm->have_perm_item("str", $item['idcat'])) {
|
|
|
|
|
$newItem->custom['forcedisplay'] = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists($key+1, $items))
|
|
|
|
|
{
|
|
|
|
|
if (array_key_exists($key + 1, $items)) {
|
|
|
|
|
$nextItem = $items[$key + 1];
|
|
|
|
|
} else {
|
|
|
|
|
$nextItem = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (array_key_exists($key-1, $items))
|
|
|
|
|
{
|
|
|
|
|
if (array_key_exists($key - 1, $items)) {
|
|
|
|
|
$lastItem = $items[$key - 1];
|
|
|
|
|
} else {
|
|
|
|
|
$lastItem = 0;
|
|
|
|
@ -305,19 +315,16 @@ function buildTree (&$rootItem, &$items)
|
|
|
|
|
|
|
|
|
|
$rootItem->addItem($newItem);
|
|
|
|
|
|
|
|
|
|
if ($nextItem['level'] > $item['level'])
|
|
|
|
|
{
|
|
|
|
|
if ($nextItem['level'] > $item['level']) {
|
|
|
|
|
$oldRoot = $rootItem;
|
|
|
|
|
buildTree($newItem, $items);
|
|
|
|
|
$rootItem = $oldRoot;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($nextItem['level'] < $item['level'])
|
|
|
|
|
{
|
|
|
|
|
if ($nextItem['level'] < $item['level']) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($perm->have_perm_area_action($area)) {
|
|
|
|
@ -342,7 +349,6 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
echo "<pre>";
|
|
|
|
|
echo $sql;
|
|
|
|
|
echo "</pre>";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$db->query($sql);
|
|
|
|
@ -351,8 +357,7 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
$iIgnoreLevel = 0;
|
|
|
|
|
|
|
|
|
|
$items = array();
|
|
|
|
|
while ($db->next_record())
|
|
|
|
|
{
|
|
|
|
|
while ($db->next_record()) {
|
|
|
|
|
$bSkip = false;
|
|
|
|
|
|
|
|
|
|
if ($bIgnore == true && $iIgnoreLevel >= $db->f("level")) {
|
|
|
|
@ -400,33 +405,27 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
|
|
|
|
|
$expandedList = unserialize($currentuser->getUserProperty("system", "cat_expandstate"));
|
|
|
|
|
|
|
|
|
|
if (is_array($expandedList))
|
|
|
|
|
{
|
|
|
|
|
if (is_array($expandedList)) {
|
|
|
|
|
$rootStrItem->markExpanded($expandedList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($collapse) && is_numeric($collapse))
|
|
|
|
|
{
|
|
|
|
|
if (isset($collapse) && is_numeric($collapse)) {
|
|
|
|
|
$rootStrItem->markCollapsed($collapse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($expand) && is_numeric($expand))
|
|
|
|
|
{
|
|
|
|
|
if (isset($expand) && is_numeric($expand)) {
|
|
|
|
|
$rootStrItem->markExpanded($expand);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($expand) && $expand == "all")
|
|
|
|
|
{
|
|
|
|
|
if (isset($expand) && $expand == "all") {
|
|
|
|
|
$rootStrItem->expandAll(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($collapse) && $collapse == "all")
|
|
|
|
|
{
|
|
|
|
|
if (isset($collapse) && $collapse == "all") {
|
|
|
|
|
$rootStrItem->collapseAll(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($action === "str_newcat")
|
|
|
|
|
{
|
|
|
|
|
if ($action === "str_newcat") {
|
|
|
|
|
$rootStrItem->markExpanded($idcat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -447,22 +446,18 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
$_cecIterator = $_cecRegistry->getIterator("Contenido.CategoryList.Columns");
|
|
|
|
|
|
|
|
|
|
$listColumns = array();
|
|
|
|
|
if ($_cecIterator->count() > 0)
|
|
|
|
|
{
|
|
|
|
|
if ($_cecIterator->count() > 0) {
|
|
|
|
|
|
|
|
|
|
while ($chainEntry = $_cecIterator->next())
|
|
|
|
|
{
|
|
|
|
|
while ($chainEntry = $_cecIterator->next()) {
|
|
|
|
|
$tmplistColumns = $chainEntry->execute(array());
|
|
|
|
|
|
|
|
|
|
if (is_array($tmplistColumns))
|
|
|
|
|
{
|
|
|
|
|
if (is_array($tmplistColumns)) {
|
|
|
|
|
$listColumns = array_merge($listColumns, $tmplistColumns);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($listColumns as $content)
|
|
|
|
|
{
|
|
|
|
|
foreach ($listColumns as $content) {
|
|
|
|
|
// Header for additional columns
|
|
|
|
|
$additionalheaders[] = '<td class="header" nowrap="nowrap">' . $content . '</td>';
|
|
|
|
|
}
|
|
|
|
@ -480,15 +475,13 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
$selflink = "main.php";
|
|
|
|
|
$expandlink = $sess->url($selflink . "?area=$area&frame=$frame&expand=all&syncoptions=$syncoptions");
|
|
|
|
|
$collapselink = $sess->url($selflink . "?area=$area&frame=$frame&collapse=all&syncoptions=$syncoptions");
|
|
|
|
|
$collapseimg =
|
|
|
|
|
'<a class="black" href="'.
|
|
|
|
|
$collapseimg = '<a class="black" href="' .
|
|
|
|
|
$collapselink .
|
|
|
|
|
'" alt="' . i18n("Close all categories") .
|
|
|
|
|
'" title="' . i18n("Close all categories") . '">
|
|
|
|
|
<img src="images/close_all.gif"> ' . i18n("Close all categories") .
|
|
|
|
|
'</a>';
|
|
|
|
|
$expandimg =
|
|
|
|
|
'<a class="black" href="'.
|
|
|
|
|
$expandimg = '<a class="black" href="' .
|
|
|
|
|
$expandlink .
|
|
|
|
|
'" alt="' . i18n("Open all categories") .
|
|
|
|
|
'" title="' . i18n("Open all categories") . '">
|
|
|
|
@ -543,18 +536,42 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
foreach ($objects as $key => $value) {
|
|
|
|
|
// check if there area any permission for this $idcat in the mainarea 6 (=str) and there subareas
|
|
|
|
|
$bCheck = false;
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_newtree"); }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_newcat") ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_makevisible"); }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_makepublic") ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_deletecat") ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_moveupcat") ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_movedowncat") ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_movesubtree") ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action($tmp_area, "str_renamecat") ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_area_action("str_tplcfg", "str_tplcfg") ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $perm->have_perm_item($tmp_area, $value->id) ; }
|
|
|
|
|
if (!$bCheck) { $bCheck = $value->isCustomAttributeSet("forcedisplay") ; }
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_newtree");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_newcat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_makevisible");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_makepublic");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_deletecat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_moveupcat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_movedowncat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_movesubtree");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action($tmp_area, "str_renamecat");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_area_action("str_tplcfg", "str_tplcfg");
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $perm->have_perm_item($tmp_area, $value->id);
|
|
|
|
|
}
|
|
|
|
|
if (!$bCheck) {
|
|
|
|
|
$bCheck = $value->isCustomAttributeSet("forcedisplay");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($bCheck) {
|
|
|
|
|
|
|
|
|
@ -597,8 +614,7 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
|
|
|
|
|
$additionalColumns = array();
|
|
|
|
|
|
|
|
|
|
foreach ($listColumns as $content)
|
|
|
|
|
{
|
|
|
|
|
foreach ($listColumns as $content) {
|
|
|
|
|
// Content rows
|
|
|
|
|
$additionalColumns[] = '<td style="border: 0px; border-bottom:1px; border-right: 1px; border-color: #B3B3B3; border-style: solid;" nowrap="nowrap"> </td>';
|
|
|
|
|
}
|
|
|
|
@ -651,16 +667,14 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
|
|
|
|
|
$descString = '';
|
|
|
|
|
|
|
|
|
|
if ($template == "")
|
|
|
|
|
{
|
|
|
|
|
if ($template == "") {
|
|
|
|
|
$template = '--- ' . i18n("none") . ' ---';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Description for hover effect
|
|
|
|
|
$descString = '<b>' . $template . '</b>';
|
|
|
|
|
|
|
|
|
|
if( sizeof($templateDescription)>0 )
|
|
|
|
|
{
|
|
|
|
|
if (sizeof($templateDescription) > 0) {
|
|
|
|
|
$descString .= '<br>' . $templateDescription;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -678,8 +692,7 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
$bPermRename = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($perm->have_perm_area_action("str_tplcfg", "str_tplcfg") || $perm->have_perm_area_action_item("str_tplcfg","str_tplcfg",$value->id))
|
|
|
|
|
{
|
|
|
|
|
if ($perm->have_perm_area_action("str_tplcfg", "str_tplcfg") || $perm->have_perm_area_action_item("str_tplcfg", "str_tplcfg", $value->id)) {
|
|
|
|
|
$bPermTplcfg = 1;
|
|
|
|
|
} else {
|
|
|
|
|
$bPermTplcfg = 0;
|
|
|
|
@ -740,17 +753,14 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
} else {
|
|
|
|
|
$message = i18n("No permission");
|
|
|
|
|
|
|
|
|
|
if ($hasChildren)
|
|
|
|
|
{
|
|
|
|
|
if ($hasChildren) {
|
|
|
|
|
$button = 'delete_inact_h.gif';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($hasArticles)
|
|
|
|
|
{
|
|
|
|
|
if ($hasArticles) {
|
|
|
|
|
$button = 'delete_inact_g.gif';
|
|
|
|
|
}
|
|
|
|
|
if ($hasChildren && $hasArticles)
|
|
|
|
|
{
|
|
|
|
|
if ($hasChildren && $hasArticles) {
|
|
|
|
|
$button = 'delete_inact.gif';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -788,17 +798,13 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
$tpl->set('d', 'DOWNBUTTON', "<img src=\"images/folder_movedown_inact.gif\">");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (($action === "str_movesubtree") && (!isset($parentid_new)))
|
|
|
|
|
{
|
|
|
|
|
if($perm->have_perm_area_action($tmp_area, "str_movesubtree") || $perm->have_perm_area_action_item($tmp_area,"str_movesubtree",$value->id))
|
|
|
|
|
{
|
|
|
|
|
if ($value->id == $idcat)
|
|
|
|
|
{
|
|
|
|
|
if (($action === "str_movesubtree") && (!isset($parentid_new))) {
|
|
|
|
|
if ($perm->have_perm_area_action($tmp_area, "str_movesubtree") || $perm->have_perm_area_action_item($tmp_area, "str_movesubtree", $value->id)) {
|
|
|
|
|
if ($value->id == $idcat) {
|
|
|
|
|
$tpl->set('d', 'MOVEBUTTON', "<a name=#movesubtreehere><a href=\"" . $sess->url("main.php?area=$area&action=str_movesubtree&frame=$frame&idcat=$idcat&parentid_new=0") . "\"><img src=\"" . $cfg["path"]["images"] . "but_move_subtree_main.gif\"></a>");
|
|
|
|
|
} else {
|
|
|
|
|
$allowed = strMoveCatTargetallowed($value->id, $idcat);
|
|
|
|
|
if ($allowed == 1)
|
|
|
|
|
{
|
|
|
|
|
if ($allowed == 1) {
|
|
|
|
|
$tpl->set('d', 'MOVEBUTTON', "<a href=\"" . $sess->url("main.php?area=$area&action=str_movesubtree&frame=$frame&idcat=$idcat&parentid_new=" . $value->id) . "\"><img src=\"" . $cfg["path"]["images"] . "but_move_subtree_target.gif\"></a>");
|
|
|
|
|
} else {
|
|
|
|
|
$tpl->set('d', 'MOVEBUTTON', ' ');
|
|
|
|
@ -815,8 +821,7 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($perm->have_perm_area_action("str", "str_duplicate") || $perm->have_perm_area_action_item("str", "str_duplicate", $value->id))
|
|
|
|
|
{
|
|
|
|
|
if ($perm->have_perm_area_action("str", "str_duplicate") || $perm->have_perm_area_action_item("str", "str_duplicate", $value->id)) {
|
|
|
|
|
$duplicate = '<a href="javascript://" onclick="confDupl(' . $value->id . ',' . $value->custom['parentid'] . ', \'' . clHtmlSpecialChars($value->name) . '\')">' . "<img src=\"" . $cfg["path"]["images"] . "folder_duplicate.gif\"></a>";
|
|
|
|
|
|
|
|
|
|
$tpl->set('d', 'DUPLICATEBUTTON', $duplicate);
|
|
|
|
@ -830,17 +835,14 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
|
|
|
|
|
$columns = array();
|
|
|
|
|
|
|
|
|
|
foreach ($listColumns as $key => $content)
|
|
|
|
|
{
|
|
|
|
|
foreach ($listColumns as $key => $content) {
|
|
|
|
|
$columnInfo = array();
|
|
|
|
|
$_cecIterator = $_cecRegistry->getIterator("Contenido.CategoryList.RenderColumn");
|
|
|
|
|
|
|
|
|
|
$columnContents = array();
|
|
|
|
|
|
|
|
|
|
if ($_cecIterator->count() > 0)
|
|
|
|
|
{
|
|
|
|
|
while ($chainEntry = $_cecIterator->next())
|
|
|
|
|
{
|
|
|
|
|
if ($_cecIterator->count() > 0) {
|
|
|
|
|
while ($chainEntry = $_cecIterator->next()) {
|
|
|
|
|
$columnContents[] = $chainEntry->execute($value->id, $key);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -915,8 +917,7 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
# Show Layerbutton for adding new Cateogries and set options according to Permisssions
|
|
|
|
|
if (($perm->have_perm_area_action($tmp_area, "str_newtree") ||
|
|
|
|
|
$perm->have_perm_area_action($tmp_area, "str_newcat") ||
|
|
|
|
|
$bAreaAddNewCategory)
|
|
|
|
|
&& (int) $client > 0 && (int) $lang > 0) {
|
|
|
|
|
$bAreaAddNewCategory) && (int) $client > 0 && (int) $lang > 0) {
|
|
|
|
|
$tpl->set('s', 'NEWCAT', $string . "<a class=\"black\" id=\"new_tree_button\" href=\"javascript:showNewForm();\"><img src=\"images/folder_new.gif\"> " . i18n('Create new category') . "</a>");
|
|
|
|
|
if ($perm->have_perm_area_action($tmp_area, "str_newtree")) {
|
|
|
|
|
if ($perm->have_perm_area_action($tmp_area, "str_newcat") || $bAreaAddNewCategory) {
|
|
|
|
@ -928,7 +929,6 @@ if ( $perm->have_perm_area_action($area) ) {
|
|
|
|
|
}
|
|
|
|
|
$tpl->set('s', 'INPUT_ACTION_NEW', $oActionNew->render());
|
|
|
|
|
$tpl->set('s', 'PERMISSION_NEWTREE_DISPLAY', 'block');
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$oActionNew = new cHTMLHiddenField('action', 'str_newcat', 'cat_new_action');
|
|
|
|
|
$tpl->set('s', 'PERMISSION_NEWTREE', 'disabled');
|
|
|
|
|