diff --git a/conlite/classes/cApi/class.nav.main.php b/conlite/classes/cApi/class.nav.main.php
new file mode 100644
index 0000000..5d10255
--- /dev/null
+++ b/conlite/classes/cApi/class.nav.main.php
@@ -0,0 +1,31 @@
+_setItemClass("cApiNavMain");
+ }
+}
+
+class cApiNavMain extends Item {
+ public function __construct($mId = false) {
+ global $cfg;
+ parent::__construct(cRegistry::getConfigValue('tab', 'nav_main'), 'idnavm');
+ if ($mId !== false) {
+ $this->loadByPrimaryKey($mId);
+ }
+ }
+}
\ No newline at end of file
diff --git a/conlite/classes/cApi/class.nav.sub.php b/conlite/classes/cApi/class.nav.sub.php
new file mode 100644
index 0000000..689a4d2
--- /dev/null
+++ b/conlite/classes/cApi/class.nav.sub.php
@@ -0,0 +1,31 @@
+_setItemClass("cApiNavSub");
+ }
+}
+
+class cApiNavSub extends Item {
+ public function __construct($mId = false) {
+ global $cfg;
+ parent::__construct(cRegistry::getConfigValue('tab', 'nav_sub'), 'idnavs');
+ if ($mId !== false) {
+ $this->loadByPrimaryKey($mId);
+ }
+ }
+}
\ No newline at end of file
diff --git a/conlite/includes/include.str_overview.php b/conlite/includes/include.str_overview.php
index 50ce455..f3d59c6 100644
--- a/conlite/includes/include.str_overview.php
+++ b/conlite/includes/include.str_overview.php
@@ -1,4 +1,5 @@
have_perm_area_action("str", "str_duplicate") ||
- $perm->have_perm_area_action_item("str", "str_duplicate", $idcat)))
-{
- strCopyTree($idcat, $parentid);
+ ($perm->have_perm_area_action("str", "str_duplicate") ||
+ $perm->have_perm_area_action_item("str", "str_duplicate", $idcat))) {
+ strCopyTree($idcat, $parentid);
}
//Everybody is allowed to update aliases, if there is no Permission to update category names, this block updates category alias only
-if(isset($_POST['newcategoryalias']) && isset($_POST['action']) && $_POST['action'] == 'str_renamecat') {
- $iIdCat = (int) $_POST['idcat'];
- if(!($perm->have_perm_area_action($tmp_area, "str_renamecat") || $perm->have_perm_area_action_item($tmp_area, "str_renamecat", $iIdCat)) ) {
- if (trim($_POST['newcategoryalias']) != '') {
- $sUrlName = capiStrCleanURLCharacters($_POST['newcategoryalias']);
- $sql = "UPDATE {$cfg['tab']['cat_lang']} SET urlname = '". Contenido_Security::escapeDB($sUrlName, $db) ."' WHERE idcat = '".Contenido_Security::toInteger($iIdCat)."' AND idlang = '".Contenido_Security::toInteger($lang)."'";
- $db->query($sql);
- } else {
- //Use categoryname as default -> get it escape it save it as urlname
- $sql = "SELECT name from {$cfg['tab']['cat_lang']} WHERE idcat = '".Contenido_Security::toInteger($iIdCat)."' AND idlang = '".Contenido_Security::toInteger($lang)."'";
- $db->query($sql);
- if ($db->next_record()) {
- $sUrlName = capiStrCleanURLCharacters($db->f('name'));
- $sql = "UPDATE {$cfg['tab']['cat_lang']} SET urlname = '". $sUrlName ."' WHERE idcat = '".Contenido_Security::toInteger($iIdCat)."' AND idlang = '".Contenido_Security::toInteger($lang)."'";
- $db->query($sql);
- $lang = Contenido_Security::escapeDB($lang, null);
- @unlink($cfgClient[$client]["path"]["frontend"]."cache/locationstring-url-cache-$lang.txt");
- }
+if (isset($_POST['newcategoryalias']) && isset($_POST['action']) && $_POST['action'] == 'str_renamecat') {
+ $iIdCat = (int) $_POST['idcat'];
+ if (!($perm->have_perm_area_action($tmp_area, "str_renamecat") || $perm->have_perm_area_action_item($tmp_area, "str_renamecat", $iIdCat))) {
+ if (trim($_POST['newcategoryalias']) != '') {
+ $sUrlName = capiStrCleanURLCharacters($_POST['newcategoryalias']);
+ $sql = "UPDATE {$cfg['tab']['cat_lang']} SET urlname = '" . Contenido_Security::escapeDB($sUrlName, $db) . "' WHERE idcat = '" . Contenido_Security::toInteger($iIdCat) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
+ $db->query($sql);
+ } else {
+ //Use categoryname as default -> get it escape it save it as urlname
+ $sql = "SELECT name from {$cfg['tab']['cat_lang']} WHERE idcat = '" . Contenido_Security::toInteger($iIdCat) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
+ $db->query($sql);
+ if ($db->next_record()) {
+ $sUrlName = capiStrCleanURLCharacters($db->f('name'));
+ $sql = "UPDATE {$cfg['tab']['cat_lang']} SET urlname = '" . $sUrlName . "' WHERE idcat = '" . Contenido_Security::toInteger($iIdCat) . "' AND idlang = '" . Contenido_Security::toInteger($lang) . "'";
+ $db->query($sql);
+ $lang = Contenido_Security::escapeDB($lang, null);
+ @unlink($cfgClient[$client]["path"]["frontend"] . "cache/locationstring-url-cache-$lang.txt");
+ }
+ }
}
- }
}
@@ -81,42 +80,41 @@ $oDirectionDb = new DB_ConLite();
* @return String HTML
*/
function buildCategorySelectRights() {
- global $cfg, $client, $lang, $idcat, $perm, $tmp_area;
+ global $cfg, $client, $lang, $idcat, $perm, $tmp_area;
+
+ $db = new DB_ConLite();
+
+ $oHtmlSelect = new cHTMLSelectElement('idcat', "", "new_idcat");
- $db = new DB_ConLite();
-
- $oHtmlSelect = new cHTMLSelectElement ('idcat', "", "new_idcat");
-
$oHtmlSelectOption = new cHTMLOptionElement(i18n("Please choose"), '', true);
$oHtmlSelect->addOptionElement(0, $oHtmlSelectOption);
- $sql = "SELECT a.idcat AS idcat, b.name AS name, c.level FROM
- ".$cfg["tab"]["cat"]." AS a, ".$cfg["tab"]["cat_lang"]." AS b,
- ".$cfg["tab"]["cat_tree"]." AS c WHERE a.idclient = '".Contenido_Security::toInteger($client)."'
- AND b.idlang = '".Contenido_Security::toInteger($lang)."' AND b.idcat = a.idcat AND c.idcat = a.idcat
+ $sql = "SELECT a.idcat AS idcat, b.name AS name, c.level FROM
+ " . $cfg["tab"]["cat"] . " AS a, " . $cfg["tab"]["cat_lang"] . " AS b,
+ " . $cfg["tab"]["cat_tree"] . " AS c WHERE a.idclient = '" . Contenido_Security::toInteger($client) . "'
+ AND b.idlang = '" . Contenido_Security::toInteger($lang) . "' AND b.idcat = a.idcat AND c.idcat = a.idcat
ORDER BY c.idtree";
- $db->query($sql);
+ $db->query($sql);
- $categories = array ();
+ $categories = array();
- while ($db->next_record())
- {
- $categories[$db->f("idcat")]["name"] = $db->f("name");
+ while ($db->next_record()) {
+ $categories[$db->f("idcat")]["name"] = $db->f("name");
$categories[$db->f("idcat")]["idcat"] = $db->f("idcat");
-
+
if ($perm->have_perm_area_action($tmp_area, "str_newcat") || $perm->have_perm_area_action_item($tmp_area, "str_newcat", $db->f("idcat"))) {
$categories[$db->f("idcat")]["perm"] = 1;
} else {
$categories[$db->f("idcat")]["perm"] = 0;
}
-
- $categories[$db->f("idcat")]["level"] = $db->f("level");
- }
-
+
+ $categories[$db->f("idcat")]["level"] = $db->f("level");
+ }
+
$aCategoriesReversed = array_reverse($categories);
-
+
$iLevel = 0;
foreach ($aCategoriesReversed as $iKeyIdCat => $aValues) {
if ($aValues['level'] > $iLevel && $aValues['perm']) {
@@ -131,74 +129,69 @@ function buildCategorySelectRights() {
}
$j = 1;
- foreach ($categories as $tmpidcat => $props)
- {
- $spaces = " ";
+ foreach ($categories as $tmpidcat => $props) {
+ $spaces = " ";
- for ($i = 0; $i < $props["level"]; $i ++)
- {
- $spaces .= " ";
- }
+ for ($i = 0; $i < $props["level"]; $i ++) {
+ $spaces .= " ";
+ }
$sCategoryname = clHtmlSpecialChars($props["name"]);
$sCategoryname = capiStrTrimHard($sCategoryname, 30);
- $oHtmlSelectOption = new cHTMLOptionElement($spaces.">".$sCategoryname, $tmpidcat, false, !$props["perm"]);
- $oHtmlSelect->addOptionElement($j, $oHtmlSelectOption);
- $j++;
- }
+ $oHtmlSelectOption = new cHTMLOptionElement($spaces . ">" . $sCategoryname, $tmpidcat, false, !$props["perm"]);
+ $oHtmlSelect->addOptionElement($j, $oHtmlSelectOption);
+ $j++;
+ }
- return $oHtmlSelect->toHtml();
+ return $oHtmlSelect->toHtml();
}
-function getExpandCollapseButton ($item, $catName)
-{
- global $sess, $PHP_SELF, $frame, $area;
- $selflink = "main.php";
-
- $img = new cHTMLImage;
- $img->updateAttributes(array ("style" => "padding:4px;"));
-
+function getExpandCollapseButton($item, $catName) {
+ global $sess, $PHP_SELF, $frame, $area;
+ $selflink = "main.php";
- 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);
- $img->setAlt(i18n("Open category"));
- return (''.$img->render().' '.''.$catName.'');
- } else {
- $collapselink = $sess->url($selflink . "?area=$area&frame=$frame&collapse=". $item->id);
- $img->setSrc($item->expanded_icon);
- $img->setAlt(i18n("Close category"));
-
- return(''.$img->render().' '.''.$catName.'');
- }
- } else {
- return ' '.$catName;
- }
+ $img = new cHTMLImage;
+ $img->updateAttributes(array("style" => "padding:4px;"));
+
+
+ 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);
+ $img->setAlt(i18n("Open category"));
+ return ('' . $img->render() . ' ' . '' . $catName . '');
+ } else {
+ $collapselink = $sess->url($selflink . "?area=$area&frame=$frame&collapse=" . $item->id);
+ $img->setSrc($item->expanded_icon);
+ $img->setAlt(i18n("Close category"));
+
+ return('' . $img->render() . ' ' . '' . $catName . '');
+ }
+ } else {
+ return ' ' . $catName;
+ }
}
function getTemplateSelect() {
global $client, $cfg, $db;
-
- $oHtmlSelect = new cHTMLSelectElement ('cat_template_select', "", "cat_template_select");
-
- $oHtmlSelectOption = new cHTMLOptionElement('--- '.i18n("none"). ' ---', 0, false);
+
+ $oHtmlSelect = new cHTMLSelectElement('cat_template_select', "", "cat_template_select");
+
+ $oHtmlSelectOption = new cHTMLOptionElement('--- ' . i18n("none") . ' ---', 0, false);
$oHtmlSelect->addOptionElement(0, $oHtmlSelectOption);
-
+
$sql = "SELECT
idtpl,
name, defaulttemplate
FROM
- ".$cfg['tab']['tpl']."
+ " . $cfg['tab']['tpl'] . "
WHERE
- idclient = '".$client."'
+ idclient = '" . $client . "'
ORDER BY
name";
-
- $i = 1;
+
+ $i = 1;
if ($db->query($sql)) {
while ($db->next_record()) {
$bDefaultTemplate = $db->f('defaulttemplate');
@@ -207,7 +200,7 @@ function getTemplateSelect() {
$i++;
}
}
-
+
return $oHtmlSelect->toHtml();
}
@@ -223,148 +216,160 @@ if (isset($force) && $force == 1) {
$remakeStrTable = true;
}
-if ($StrTableClient != $client)
-{
- unset($expandedList);
+if ($StrTableClient != $client) {
+ unset($expandedList);
$remakeStrTable = true;
}
-if ($StrTableLang != $lang)
-{
- unset($expandedList);
- $remakeStrTable = true;
+if ($StrTableLang != $lang) {
+ unset($expandedList);
+ $remakeStrTable = true;
}
$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)
-{
- global $nextItem, $perm, $tmp_area;
+function buildTree(&$rootItem, &$items) {
+ global $nextItem, $perm, $tmp_area;
- while ($item_list = each($items))
- {
- list($key, $item) = $item_list;
+ 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) {
- $newItem = new TreeItem($item['name'], $item['idcat'], true);
- } else {
- $newItem = new TreeItem($item['name'], $item['idcat'], false);
+ 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']);
}
- $newItem->collapsed_icon = 'images/open_all.gif';
- $newItem->expanded_icon = 'images/close_all.gif';
- $newItem->custom['idtree'] = $item['idtree'];
- $newItem->custom['level'] = $item['level'];
- $newItem->custom['idcat'] = $item['idcat'];
- $newItem->custom['idtree'] = $item['idtree'];
- $newItem->custom['parentid'] = $item['parentid'];
+ if ($bCheck) {
+ $newItem = new TreeItem($item['name'], $item['idcat'], true);
+ } else {
+ $newItem = new TreeItem($item['name'], $item['idcat'], false);
+ }
+
+ $newItem->collapsed_icon = 'images/open_all.gif';
+ $newItem->expanded_icon = 'images/close_all.gif';
+ $newItem->custom['idtree'] = $item['idtree'];
+ $newItem->custom['level'] = $item['level'];
+ $newItem->custom['idcat'] = $item['idcat'];
+ $newItem->custom['idtree'] = $item['idtree'];
+ $newItem->custom['parentid'] = $item['parentid'];
$newItem->custom['alias'] = $item['alias'];
- $newItem->custom['preid'] = $item['preid'];
- $newItem->custom['postid'] = $item['postid'];
- $newItem->custom['visible'] = $item['visible'];
- $newItem->custom['idtplcfg'] = $item['idtplcfg'];
- $newItem->custom['public'] = $item['public'];
+ $newItem->custom['preid'] = $item['preid'];
+ $newItem->custom['postid'] = $item['postid'];
+ $newItem->custom['visible'] = $item['visible'];
+ $newItem->custom['idtplcfg'] = $item['idtplcfg'];
+ $newItem->custom['public'] = $item['public'];
- if ($perm->have_perm_item("str", $item['idcat']))
- {
- $newItem->custom['forcedisplay'] = 1;
- }
+ if ($perm->have_perm_item("str", $item['idcat'])) {
+ $newItem->custom['forcedisplay'] = 1;
+ }
- if (array_key_exists($key+1, $items))
- {
- $nextItem = $items[$key+1];
- } else {
- $nextItem = 0;
- }
-
- if (array_key_exists($key-1, $items))
- {
- $lastItem = $items[$key-1];
- } else {
- $lastItem = 0;
- }
+ if (array_key_exists($key + 1, $items)) {
+ $nextItem = $items[$key + 1];
+ } else {
+ $nextItem = 0;
+ }
- $rootItem->addItem($newItem);
+ if (array_key_exists($key - 1, $items)) {
+ $lastItem = $items[$key - 1];
+ } else {
+ $lastItem = 0;
+ }
- if ($nextItem['level'] > $item['level'])
- {
- $oldRoot = $rootItem;
- buildTree($newItem, $items);
- $rootItem = $oldRoot;
- }
+ $rootItem->addItem($newItem);
- if ($nextItem['level'] < $item['level'])
- {
- return;
- }
- }
+ if ($nextItem['level'] > $item['level']) {
+ $oldRoot = $rootItem;
+ buildTree($newItem, $items);
+ $rootItem = $oldRoot;
+ }
+ if ($nextItem['level'] < $item['level']) {
+ return;
+ }
+ }
}
-if ( $perm->have_perm_area_action($area) ) {
+if ($perm->have_perm_area_action($area)) {
$sql = "SELECT
idtree, A.idcat, level, name, parentid, preid, postid, visible, public, idtplcfg, C.urlname as alias
FROM
- ".$cfg["tab"]["cat_tree"]." AS A,
- ".$cfg["tab"]["cat"]." AS B,
- ".$cfg["tab"]["cat_lang"]." AS C
+ " . $cfg["tab"]["cat_tree"] . " AS A,
+ " . $cfg["tab"]["cat"] . " AS B,
+ " . $cfg["tab"]["cat_lang"] . " AS C
WHERE
A.idcat = B.idcat AND
B.idcat = C.idcat AND
- C.idlang = '".Contenido_Security::toInteger($lang)."' AND
- B.idclient = '".Contenido_Security::toInteger($client)."'
+ C.idlang = '" . Contenido_Security::toInteger($lang) . "' AND
+ B.idclient = '" . Contenido_Security::toInteger($client) . "'
ORDER BY
idtree";
# Debug info
- if ( $debug ) {
+ if ($debug) {
echo "
";
echo $sql;
echo "
";
-
}
$db->query($sql);
-
- $bIgnore = false;
- $iIgnoreLevel = 0;
- $items = array();
- while ($db->next_record())
- {
+ $bIgnore = false;
+ $iIgnoreLevel = 0;
+
+ $items = array();
+ while ($db->next_record()) {
$bSkip = false;
-
- if ($bIgnore == true && $iIgnoreLevel >= $db->f("level")) {
- $bIgnore = false;
- }
-
- if ($db->f("idcat") == $movesubtreeidcat) {
- $bIgnore = true;
- $iIgnoreLevel = $db->f("level");
- $sMoveSubtreeCatName = $db->f("name");
- }
-
+
+ if ($bIgnore == true && $iIgnoreLevel >= $db->f("level")) {
+ $bIgnore = false;
+ }
+
+ if ($db->f("idcat") == $movesubtreeidcat) {
+ $bIgnore = true;
+ $iIgnoreLevel = $db->f("level");
+ $sMoveSubtreeCatName = $db->f("name");
+ }
+
if ($iCurLevel == $db->f("level")) {
if ($iCurParent != $db->f("parentid")) {
$bSkip = true;
@@ -374,137 +379,125 @@ if ( $perm->have_perm_area_action($area) ) {
$iCurParent = $db->f("parentid");
}
- if ($bIgnore == false && $bSkip == false) {
- $entry = array();
- $entry['idtree'] = $db->f("idtree");
- $entry['idcat'] = $db->f("idcat");
- $entry['level'] = $db->f("level");
- $entry['name'] = htmldecode($db->f("name"));
- $entry['alias'] = htmldecode($db->f("alias"));
- $entry['parentid'] = $db->f("parentid");
- $entry['preid'] = $db->f("preid");
- $entry['postid'] = $db->f("postid");
- $entry['visible'] = $db->f("visible");
- $entry['public'] = $db->f("public");
- $entry['idtplcfg'] = $db->f("idtplcfg");
-
- array_push($items, $entry);
- }
- }
+ if ($bIgnore == false && $bSkip == false) {
+ $entry = array();
+ $entry['idtree'] = $db->f("idtree");
+ $entry['idcat'] = $db->f("idcat");
+ $entry['level'] = $db->f("level");
+ $entry['name'] = htmldecode($db->f("name"));
+ $entry['alias'] = htmldecode($db->f("alias"));
+ $entry['parentid'] = $db->f("parentid");
+ $entry['preid'] = $db->f("preid");
+ $entry['postid'] = $db->f("postid");
+ $entry['visible'] = $db->f("visible");
+ $entry['public'] = $db->f("public");
+ $entry['idtplcfg'] = $db->f("idtplcfg");
- $rootStrItem = new TreeItem("root",-1);
- $rootStrItem->collapsed_icon = 'images/open_all.gif';
- $rootStrItem->expanded_icon = 'images/close_all.gif';
-
- buildTree($rootStrItem, $items);
-
- $expandedList = unserialize($currentuser->getUserProperty("system","cat_expandstate"));
-
- if (is_array($expandedList))
- {
- $rootStrItem->markExpanded($expandedList);
- }
-
- if (isset($collapse) && is_numeric($collapse))
- {
- $rootStrItem->markCollapsed($collapse);
- }
-
- if (isset($expand) && is_numeric($expand))
- {
- $rootStrItem->markExpanded($expand);
- }
-
- if (isset($expand) && $expand == "all")
- {
- $rootStrItem->expandAll(-1);
+ array_push($items, $entry);
+ }
}
-
- if (isset($collapse) && $collapse == "all")
- {
- $rootStrItem->collapseAll(-1);
- }
-
- if ($action === "str_newcat")
- {
- $rootStrItem->markExpanded($idcat);
- }
- $expandedList = Array();
- $objects = array();
+ $rootStrItem = new TreeItem("root", -1);
+ $rootStrItem->collapsed_icon = 'images/open_all.gif';
+ $rootStrItem->expanded_icon = 'images/close_all.gif';
- $rootStrItem->traverse($objects);
-
- $rootStrItem->getExpandedList($expandedList);
- $currentuser->setUserProperty("system","cat_expandstate", serialize($expandedList));
+ buildTree($rootStrItem, $items);
+
+ $expandedList = unserialize($currentuser->getUserProperty("system", "cat_expandstate"));
+
+ if (is_array($expandedList)) {
+ $rootStrItem->markExpanded($expandedList);
+ }
+
+ if (isset($collapse) && is_numeric($collapse)) {
+ $rootStrItem->markCollapsed($collapse);
+ }
+
+ if (isset($expand) && is_numeric($expand)) {
+ $rootStrItem->markExpanded($expand);
+ }
+
+ if (isset($expand) && $expand == "all") {
+ $rootStrItem->expandAll(-1);
+ }
+
+ if (isset($collapse) && $collapse == "all") {
+ $rootStrItem->collapseAll(-1);
+ }
+
+ if ($action === "str_newcat") {
+ $rootStrItem->markExpanded($idcat);
+ }
+
+ $expandedList = Array();
+ $objects = array();
+
+ $rootStrItem->traverse($objects);
+
+ $rootStrItem->getExpandedList($expandedList);
+ $currentuser->setUserProperty("system", "cat_expandstate", serialize($expandedList));
# Reset Template
$tpl->reset();
$tpl->set('s', 'SID', $sess->id);
$tpl->set('s', 'AREA', $area);
$tpl->set('s', 'FRAME', $frame);
-
+
$_cecIterator = $_cecRegistry->getIterator("Contenido.CategoryList.Columns");
- $listColumns = array();
- if ($_cecIterator->count() > 0)
- {
+ $listColumns = array();
+ if ($_cecIterator->count() > 0) {
- while ($chainEntry = $_cecIterator->next())
- {
- $tmplistColumns = $chainEntry->execute(array());
-
- if (is_array($tmplistColumns))
- {
- $listColumns = array_merge($listColumns, $tmplistColumns);
- }
- }
-
-
- foreach ($listColumns as $content)
- {
- // Header for additional columns
- $additionalheaders[] = '';
- }
-
- $additionalheader = implode("", $additionalheaders);
- } else {
- $additionalheader = "";
- }
-
- $tpl->set('s', 'ADDITIONALHEADERS', $additionalheader);
+ while ($chainEntry = $_cecIterator->next()) {
+ $tmplistColumns = $chainEntry->execute(array());
- // We don't want to show our root
- unset($objects[0]);
+ if (is_array($tmplistColumns)) {
+ $listColumns = array_merge($listColumns, $tmplistColumns);
+ }
+ }
+
+
+ foreach ($listColumns as $content) {
+ // Header for additional columns
+ $additionalheaders[] = '';
+ }
+
+ $additionalheader = implode("", $additionalheaders);
+ } else {
+ $additionalheader = "";
+ }
+
+ $tpl->set('s', 'ADDITIONALHEADERS', $additionalheader);
+
+ // We don't want to show our root
+ unset($objects[0]);
$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 =
- '
- '.i18n("Close all categories").
- '';
- $expandimg =
- '
- '.i18n("Open all categories").
- '';
-
-
+ $collapseimg = '
+ ' . i18n("Close all categories") .
+ '';
+ $expandimg = '
+ ' . i18n("Open all categories") .
+ '';
+
+
$tpl->set('s', 'COLLAPSE_ALL', $collapseimg);
$tpl->set('s', 'EXPAND_ALL', $expandimg);
$sMouseover = 'onmouseover="str.over(this)" onmouseout="str.out(this)" onclick="str.click(this)"';
-
+
//Fill inline edit table row
- $tpl->set('s', 'SUM_COLUMNS_EDIT', 14+count($listColumns));
+ $tpl->set('s', 'SUM_COLUMNS_EDIT', 14 + count($listColumns));
$tpl->set('s', 'ACTION_EDIT_URL', $sess->url("main.php?frame=$frame"));
- $tpl->set('s', 'SRC_CANCEL', $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"].'but_cancel.gif');
- $tpl->set('s', 'SRC_OK', $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"].'but_ok.gif');
+ $tpl->set('s', 'SRC_CANCEL', $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_cancel.gif');
+ $tpl->set('s', 'SRC_OK', $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"] . 'but_ok.gif');
$tpl->set('s', 'HREF_CANCEL', "javascript:handleInlineEdit(0)");
$tpl->set('s', 'LABEL_ALIAS_NAME', i18n('Alias'));
$tpl->set('s', 'TEMPLATE_URL', $sess->url("main.php?area=str_tplcfg&frame=$frame"));
@@ -513,53 +506,77 @@ if ( $perm->have_perm_area_action($area) ) {
$tpl->set('s', 'DELETE_MESSAGE', i18n("Do you really want to delete the following category:
%s"));
$bAreaAddNewCategory = false;
-
+
$aInlineEditData = array();
$sql = "SELECT
idtplcfg, idtpl
FROM
- ".$cfg["tab"]["tpl_conf"];
- $db->query($sql);
- $aTplconfigs = array();
- while ($db->next_record()) {
+ " . $cfg["tab"]["tpl_conf"];
+ $db->query($sql);
+ $aTplconfigs = array();
+ while ($db->next_record()) {
$aTplconfigs[$db->f('idtplcfg')] = $db->f('idtpl');
}
-
+
$sql = "SELECT
name, description, idtpl
FROM
- ".$cfg["tab"]["tpl"];
-
+ " . $cfg["tab"]["tpl"];
+
$db->query($sql);
- $aTemplates = array();
- while ($db->next_record()) {
+ $aTemplates = array();
+ while ($db->next_record()) {
$aTemplates[$db->f('idtpl')] = array(
- 'name' => $db->f('name'),
- 'description' => $db->f('description')
+ 'name' => $db->f('name'),
+ 'description' => $db->f('description')
);
}
- foreach ($objects as $key=>$value) {
+ 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) {
+ 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) {
//Insert empty row
- if ( $value->custom['level'] == 0 && $value->custom['preid'] != 0 ) {
+ if ($value->custom['level'] == 0 && $value->custom['preid'] != 0) {
$tpl->set('d', 'BGCOLOR', '#FFFFFF');
$tpl->set('d', 'BGCOLOR_EDIT', '#F1F1F1');
@@ -582,7 +599,7 @@ if ( $perm->have_perm_area_action($area) ) {
$tpl->set('d', 'DUPLICATEBUTTON', ' ');
$tpl->set('d', 'TEMPLATEBUTTON', ' ');
$tpl->set('d', 'MOUSEOVER', '');
- $tpl->set('d', 'SUM_COLUMNS_EDIT', 14+count($listColumns));
+ $tpl->set('d', 'SUM_COLUMNS_EDIT', 14 + count($listColumns));
$tpl->set('d', 'CATID', '');
$tpl->set('d', 'ACTION_EDIT_URL', '');
$tpl->set('d', 'INPUT_CATEGORY', '');
@@ -596,16 +613,15 @@ if ( $perm->have_perm_area_action($area) ) {
$tpl->set('d', 'BORDER_CLASS', 'str-style-b');
$additionalColumns = array();
-
- foreach ($listColumns as $content)
- {
- // Content rows
- $additionalColumns[] = ' | ';
- }
- $tpl->set('d', 'ADDITIONALCOLUMNS', implode("", $additionalColumns));
- $tpl->next();
+
+ foreach ($listColumns as $content) {
+ // Content rows
+ $additionalColumns[] = ' | ';
+ }
+ $tpl->set('d', 'ADDITIONALCOLUMNS', implode("", $additionalColumns));
+ $tpl->next();
}
-
+
$bgcolor = ( is_int($tpl->dyn_cnt / 2) ) ? $cfg["color"]["table_light"] : $cfg["color"]["table_dark"];
@@ -620,74 +636,71 @@ if ( $perm->have_perm_area_action($area) ) {
$sCategoryname = $value->name;
if (strlen($value->name) > 30) {
$sCategoryname = capiStrTrimHard($sCategoryname, 30);
- }
-
+ }
+
//$tpl->set('d', 'CATEGORY', $sCategoryname);
if (strlen($value->name) > 30) {
- $tpl->set('d', 'SHOW_MOUSEOVER_CATEGORY', 'onmouseover="Tip(\''.$value->name.'\', BALLOON, true, ABOVE, true);"');
+ $tpl->set('d', 'SHOW_MOUSEOVER_CATEGORY', 'onmouseover="Tip(\'' . $value->name . '\', BALLOON, true, ABOVE, true);"');
} else {
$tpl->set('d', 'SHOW_MOUSEOVER_CATEGORY', '');
}
-
+
$tpl->set('d', 'COLLAPSE_CATEGORY_NAME', getExpandCollapseButton($value, $sCategoryname));
if ($value->custom['alias']) {
- $sCategoryalias = $value->custom['alias'];
- if (strlen($value->custom['alias']) > 30) {
- $sCategoryalias = capiStrTrimHard($sCategoryalias, 30);
- }
- $tpl->set('d', 'ALIAS', $sCategoryalias);
- if (strlen($value->custom['alias']) > 30) {
- $tpl->set('d', 'SHOW_MOUSEOVER_ALIAS', 'onmouseover="Tip(\''.$value->custom['alias'].'\', BALLOON, true, ABOVE, true);"');
- } else {
- $tpl->set('d', 'SHOW_MOUSEOVER_ALIAS', '');
- }
+ $sCategoryalias = $value->custom['alias'];
+ if (strlen($value->custom['alias']) > 30) {
+ $sCategoryalias = capiStrTrimHard($sCategoryalias, 30);
+ }
+ $tpl->set('d', 'ALIAS', $sCategoryalias);
+ if (strlen($value->custom['alias']) > 30) {
+ $tpl->set('d', 'SHOW_MOUSEOVER_ALIAS', 'onmouseover="Tip(\'' . $value->custom['alias'] . '\', BALLOON, true, ABOVE, true);"');
+ } else {
+ $tpl->set('d', 'SHOW_MOUSEOVER_ALIAS', '');
+ }
} else {
- $tpl->set('d', 'SHOW_MOUSEOVER_ALIAS', '');
- $tpl->set('d', 'ALIAS', ' ');
+ $tpl->set('d', 'SHOW_MOUSEOVER_ALIAS', '');
+ $tpl->set('d', 'ALIAS', ' ');
}
- $template = $aTemplates[$aTplconfigs[$value->custom['idtplcfg']]]['name'];
- $templateDescription = $aTemplates[$aTplconfigs[$value->custom['idtplcfg']]]['description'];
-
+ $template = $aTemplates[$aTplconfigs[$value->custom['idtplcfg']]]['name'];
+ $templateDescription = $aTemplates[$aTplconfigs[$value->custom['idtplcfg']]]['description'];
+
$descString = '';
- if ($template == "")
- {
- $template = '--- '.i18n("none").' ---';
+ if ($template == "") {
+ $template = '--- ' . i18n("none") . ' ---';
}
-
+
// Description for hover effect
- $descString = ''.$template.'';
-
- if( sizeof($templateDescription)>0 )
- {
- $descString .= '
'.$templateDescription;
- }
-
+ $descString = '' . $template . '';
+
+ if (sizeof($templateDescription) > 0) {
+ $descString .= '
' . $templateDescription;
+ }
+
$sTemplatename = $template;
if (strlen($template) > 20) {
$sTemplatename = capiStrTrimHard($sTemplatename, 20);
}
-
+
$tpl->set('d', 'TPLNAME', $sTemplatename);
$tpl->set('d', 'TPLDESC', $descString);
-
- if($perm->have_perm_area_action($tmp_area, "str_renamecat") || $perm->have_perm_area_action_item($tmp_area, "str_renamecat", $value->id)) {
+
+ if ($perm->have_perm_area_action($tmp_area, "str_renamecat") || $perm->have_perm_area_action_item($tmp_area, "str_renamecat", $value->id)) {
$bPermRename = 1;
- }else{
+ } else {
$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;
}
-
+
$aRecord = array();
$sCatName = $value->name;
-
+
$aRecord['catn'] = str_replace('\'', '\\\'', $sCatName);
$sAlias = $value->custom['alias'];
$aRecord['alias'] = str_replace('\'', '\\\'', $sAlias);
@@ -695,37 +708,37 @@ if ( $perm->have_perm_area_action($area) ) {
$aRecord['pName'] = $bPermRename;
$aRecord['pTplcfg'] = $bPermTplcfg;
$aInlineEditData[$value->id] = $aRecord;
-
- $tpl->set('d', 'RENAMEBUTTON', "id.");\">id."_image\">");
+
+ $tpl->set('d', 'RENAMEBUTTON', "id . ");\">id . "_image\">");
$tpl->set('d', 'CATID', $value->id);
-
+
if (strlen($template) > 20) {
- $tpl->set('d', 'SHOW_MOUSEOVER', 'onmouseover="Tip(\''.$descString.'\', BALLOON, true, ABOVE, true);"');
+ $tpl->set('d', 'SHOW_MOUSEOVER', 'onmouseover="Tip(\'' . $descString . '\', BALLOON, true, ABOVE, true);"');
} else {
$tpl->set('d', 'SHOW_MOUSEOVER', '');
}
-
+
$tpl->set('d', 'MOUSEOVER', $sMouseover);
- if($perm->have_perm_area_action($tmp_area, "str_newcat") || $perm->have_perm_area_action_item($tmp_area, "str_newcat", $value->id)) {
- $bAreaAddNewCategory = true;
+ if ($perm->have_perm_area_action($tmp_area, "str_newcat") || $perm->have_perm_area_action_item($tmp_area, "str_newcat", $value->id)) {
+ $bAreaAddNewCategory = true;
}
- if($perm->have_perm_area_action($tmp_area, "str_makevisible") || $perm->have_perm_area_action_item($tmp_area,"str_makevisible",$value->id)) {
+ if ($perm->have_perm_area_action($tmp_area, "str_makevisible") || $perm->have_perm_area_action_item($tmp_area, "str_makevisible", $value->id)) {
if ($value->custom['visible'] == 1) {
- $tpl->set('d', 'VISIBLEBUTTON', "url("main.php?area=$area&action=str_makevisible&frame=$frame&idcat=".$value->id."&visible=".$value->custom['visible'])."#clickedhere\">");
+ $tpl->set('d', 'VISIBLEBUTTON', "url("main.php?area=$area&action=str_makevisible&frame=$frame&idcat=" . $value->id . "&visible=" . $value->custom['visible']) . "#clickedhere\">");
} else {
- $tpl->set('d', 'VISIBLEBUTTON', "url("main.php?area=$area&action=str_makevisible&frame=$frame&idcat=".$value->id."&visible=".$value->custom['visible'])."#clickedhere\">");
+ $tpl->set('d', 'VISIBLEBUTTON', "url("main.php?area=$area&action=str_makevisible&frame=$frame&idcat=" . $value->id . "&visible=" . $value->custom['visible']) . "#clickedhere\">");
}
} else {
$tpl->set('d', 'VISIBLEBUTTON', ' ');
}
- if($perm->have_perm_area_action($tmp_area, "str_makepublic") || $perm->have_perm_area_action_item($tmp_area,"str_makepublic",$value->id)) {
+ if ($perm->have_perm_area_action($tmp_area, "str_makepublic") || $perm->have_perm_area_action_item($tmp_area, "str_makepublic", $value->id)) {
if ($value->custom['public'] == 1) {
- $tpl->set('d', 'PUBLICBUTTON', "url("main.php?area=$area&action=str_makepublic&frame=$frame&idcat=".$value->id."&public=".$value->custom['public'])."#clickedhere\">");
+ $tpl->set('d', 'PUBLICBUTTON', "url("main.php?area=$area&action=str_makepublic&frame=$frame&idcat=" . $value->id . "&public=" . $value->custom['public']) . "#clickedhere\">");
} else {
- $tpl->set('d', 'PUBLICBUTTON', "url("main.php?area=$area&action=str_makepublic&frame=$frame&idcat=".$value->id."&public=".$value->custom['public'])."#clickedhere\">");
+ $tpl->set('d', 'PUBLICBUTTON', "url("main.php?area=$area&action=str_makepublic&frame=$frame&idcat=" . $value->id . "&public=" . $value->custom['public']) . "#clickedhere\">");
}
} else {
$tpl->set('d', 'PUBLICBUTTON', ' ');
@@ -733,270 +746,257 @@ if ( $perm->have_perm_area_action($area) ) {
$hasChildren = strNextDeeper($value->id);
$hasArticles = strHasArticles($value->id);
- if(($hasChildren == 0) && ($hasArticles == false) &&($perm->have_perm_area_action($tmp_area, "str_deletecat") || $perm->have_perm_area_action_item($tmp_area,"str_deletecat",$value->id))) {
+ if (($hasChildren == 0) && ($hasArticles == false) && ($perm->have_perm_area_action($tmp_area, "str_deletecat") || $perm->have_perm_area_action_item($tmp_area, "str_deletecat", $value->id))) {
- $delete = ''."";
+ $delete = '' . "";
$tpl->set('d', 'DELETEBUTTON', $delete);
} 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';
}
- $tpl->set('d', 'DELETEBUTTON', '');
+ $tpl->set('d', 'DELETEBUTTON', '');
}
- if($perm->have_perm_area_action($tmp_area, "str_moveupcat") || $perm->have_perm_area_action_item($tmp_area,"str_moveupcat",$value->id)) {
+ if ($perm->have_perm_area_action($tmp_area, "str_moveupcat") || $perm->have_perm_area_action_item($tmp_area, "str_moveupcat", $value->id)) {
$rand = rand();
- if ($value->custom['parentid']==0 && $value->custom['preid']==0) {
+ if ($value->custom['parentid'] == 0 && $value->custom['preid'] == 0) {
$tpl->set('d', 'UPBUTTON', "");
} else {
- if ($value->custom['preid']!=0) {
- $tpl->set('d', 'UPBUTTON', "url("main.php?area=$area&action=str_moveupcat&frame=$frame&idcat=".$value->id."&rand=$rand")."#clickedhere\">");
- } else {
- $tpl->set('d', 'UPBUTTON', "");
- }
- }
+ if ($value->custom['preid'] != 0) {
+ $tpl->set('d', 'UPBUTTON', "url("main.php?area=$area&action=str_moveupcat&frame=$frame&idcat=" . $value->id . "&rand=$rand") . "#clickedhere\">");
+ } else {
+ $tpl->set('d', 'UPBUTTON', "");
+ }
+ }
} else {
$tpl->set('d', 'UPBUTTON', "");
}
- if($perm->have_perm_area_action($tmp_area, "str_movedowncat") || $perm->have_perm_area_action_item($tmp_area,"str_movedowncat",$value->id)) {
+ if ($perm->have_perm_area_action($tmp_area, "str_movedowncat") || $perm->have_perm_area_action_item($tmp_area, "str_movedowncat", $value->id)) {
$rand = rand();
- if ($value->custom['postid']==0) {
+ if ($value->custom['postid'] == 0) {
$tpl->set('d', 'DOWNBUTTON', "");
} else {
- $tpl->set('d', 'DOWNBUTTON', "url("main.php?area=$area&action=str_movedowncat&frame=$frame&idcat=".$value->id."&rand=$rand")."#clickedhere\">");
+ $tpl->set('d', 'DOWNBUTTON', "url("main.php?area=$area&action=str_movedowncat&frame=$frame&idcat=" . $value->id . "&rand=$rand") . "#clickedhere\">");
}
} else {
$tpl->set('d', 'DOWNBUTTON', "");
}
- 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', "url("main.php?area=$area&action=str_movesubtree&frame=$frame&idcat=$idcat&parentid_new=0")."\">");
+ 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', "url("main.php?area=$area&action=str_movesubtree&frame=$frame&idcat=$idcat&parentid_new=0") . "\">");
} else {
- $allowed = strMoveCatTargetallowed($value->id, $idcat);
- if ($allowed == 1)
- {
- $tpl->set('d', 'MOVEBUTTON', "url("main.php?area=$area&action=str_movesubtree&frame=$frame&idcat=$idcat&parentid_new=".$value->id)."\">");
- } else {
- $tpl->set('d', 'MOVEBUTTON', ' ');
- }
+ $allowed = strMoveCatTargetallowed($value->id, $idcat);
+ if ($allowed == 1) {
+ $tpl->set('d', 'MOVEBUTTON', "url("main.php?area=$area&action=str_movesubtree&frame=$frame&idcat=$idcat&parentid_new=" . $value->id) . "\">");
+ } else {
+ $tpl->set('d', 'MOVEBUTTON', ' ');
+ }
}
} else {
$tpl->set('d', 'MOVEBUTTON', ' ');
}
} else {
- if($perm->have_perm_area_action($tmp_area, "str_movesubtree") || $perm->have_perm_area_action_item($tmp_area,"str_movesubtree",$value->id)) {
- $tpl->set('d', 'MOVEBUTTON', "url("main.php?area=$area&action=str_movesubtree&frame=$frame&idcat=".$value->id)."#movesubtreehere\">");
- }else{
+ if ($perm->have_perm_area_action($tmp_area, "str_movesubtree") || $perm->have_perm_area_action_item($tmp_area, "str_movesubtree", $value->id)) {
+ $tpl->set('d', 'MOVEBUTTON', "url("main.php?area=$area&action=str_movesubtree&frame=$frame&idcat=" . $value->id) . "#movesubtreehere\">");
+ } else {
$tpl->set('d', 'MOVEBUTTON', ' ');
}
}
-
- if ($perm->have_perm_area_action("str", "str_duplicate") || $perm->have_perm_area_action_item("str", "str_duplicate", $value->id))
- {
- $duplicate = ''."";
-
- $tpl->set('d', 'DUPLICATEBUTTON', $duplicate);
+
+ if ($perm->have_perm_area_action("str", "str_duplicate") || $perm->have_perm_area_action_item("str", "str_duplicate", $value->id)) {
+ $duplicate = '' . "";
+
+ $tpl->set('d', 'DUPLICATEBUTTON', $duplicate);
} else {
- $tpl->set('d', 'DUPLICATEBUTTON', ' ');
+ $tpl->set('d', 'DUPLICATEBUTTON', ' ');
}
-
+
// DIRECTION
- cInclude('includes', 'functions.lang.php');
- $tpl->set('d', 'DIRECTION', 'dir="' . langGetTextDirection($lang, $oDirectionDb) . '"');
-
+ cInclude('includes', 'functions.lang.php');
+ $tpl->set('d', 'DIRECTION', 'dir="' . langGetTextDirection($lang, $oDirectionDb) . '"');
+
$columns = array();
-
- foreach ($listColumns as $key => $content)
- {
- $columnInfo = array();
- $_cecIterator = $_cecRegistry->getIterator("Contenido.CategoryList.RenderColumn");
-
- $columnContents = array();
-
- if ($_cecIterator->count() > 0)
- {
- while ($chainEntry = $_cecIterator->next())
- {
- $columnContents[] = $chainEntry->execute($value->id, $key);
- }
- } else {
- $columnContents[] = '';
- }
-
- $columns[] = ''.implode("", $columnContents).' | ';
- }
-
- $tpl->set('d', 'ADDITIONALCOLUMNS', implode("", $columns));
+
+ foreach ($listColumns as $key => $content) {
+ $columnInfo = array();
+ $_cecIterator = $_cecRegistry->getIterator("Contenido.CategoryList.RenderColumn");
+
+ $columnContents = array();
+
+ if ($_cecIterator->count() > 0) {
+ while ($chainEntry = $_cecIterator->next()) {
+ $columnContents[] = $chainEntry->execute($value->id, $key);
+ }
+ } else {
+ $columnContents[] = '';
+ }
+
+ $columns[] = '' . implode("", $columnContents) . ' | ';
+ }
+
+ $tpl->set('d', 'ADDITIONALCOLUMNS', implode("", $columns));
$tpl->next();
}//end if -> perm
}
-
+
$jsDataArray = "";
foreach ($aInlineEditData as $iIdCat => $aData) {
$aTmp = array();
foreach ($aData as $aKey => $aValue) {
- array_push($aTmp, $aKey."':'".$aValue);
+ array_push($aTmp, $aKey . "':'" . $aValue);
}
- $jsDataArray.= "tmpObject = new Object();
- tmpObject = {'".implode("', '", $aTmp)."'};
+ $jsDataArray .= "tmpObject = new Object();
+ tmpObject = {'" . implode("', '", $aTmp) . "'};
dataArray[$iIdCat] = tmpObject;
- ";
+ ";
}
-
+
$tpl->set('s', 'JS_DATA', $jsDataArray);
- $string = markSubMenuItem(0, true);
-
+ $string = markSubMenuItem(0, true);
+
//Set DHTML generic Values
$sImagepath = $cfg["path"]["images"];
- $tpl->set('s', 'SUM_COLUMNS', 14+count($listColumns));
+ $tpl->set('s', 'SUM_COLUMNS', 14 + count($listColumns));
$tpl->set('s', 'HREF_ACTION', $sess->url("main.php?frame=$frame"));
- $tpl->set('s', 'CON_IMAGES', $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]);
-
+ $tpl->set('s', 'CON_IMAGES', $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["images"]);
+
//Generate input fields for category new layer and category edit layer
- $oSession = new cHTMLHiddenField ($sess->name, $sess->id);
- $oActionEdit = new cHTMLHiddenField ('action', 'str_renamecat');
- $oIdcat = new cHTMLHiddenField ('idcat');
-
+ $oSession = new cHTMLHiddenField($sess->name, $sess->id);
+ $oActionEdit = new cHTMLHiddenField('action', 'str_renamecat');
+ $oIdcat = new cHTMLHiddenField('idcat');
+
$tpl->set('s', 'INPUT_SESSION', $oSession->render());
$tpl->set('s', 'INPUT_ACTION_EDIT', $oActionEdit->render());
$tpl->set('s', 'INPUT_IDCAT', $oIdcat->render());
-
- $oVisible = new cHTMLHiddenField ('visible', 0, 'visible_input');
- $oPublic = new cHTMLHiddenField ('public', 1, 'public_input');
- $oTemplate = new cHTMLHiddenField ('idtplcfg', 0, 'idtplcfg_input');
-
+
+ $oVisible = new cHTMLHiddenField('visible', 0, 'visible_input');
+ $oPublic = new cHTMLHiddenField('public', 1, 'public_input');
+ $oTemplate = new cHTMLHiddenField('idtplcfg', 0, 'idtplcfg_input');
+
$tpl->set('s', 'INPUT_VISIBLE', $oVisible->render());
$tpl->set('s', 'INPUT_PUBLIC', $oPublic->render());
$tpl->set('s', 'INPUT_TEMPLATE', $oTemplate->render());
-
- $oCatName = new cHTMLTextbox ('categoryname', '', '', '', 'cat_categoryname');
+
+ $oCatName = new cHTMLTextbox('categoryname', '', '', '', 'cat_categoryname');
$oCatName->setStyle('width:150px; vertical-align:middle;');
$tpl->set('s', 'INPUT_CATNAME_NEW', $oCatName->render());
-
- $oAlias = new cHTMLTextbox ('categoryalias');
+
+ $oAlias = new cHTMLTextbox('categoryalias');
$oAlias->setStyle('width:150px; vertical-align:middle;');
$tpl->set('s', 'INPUT_ALIAS_NEW', $oAlias->render());
- $oNewCatName = new cHTMLTextbox ('newcategoryname');
+ $oNewCatName = new cHTMLTextbox('newcategoryname');
$oNewCatName->setStyle('width:150px; vertical-align:middle;');
$tpl->set('s', 'INPUT_CATNAME_EDIT', $oNewCatName->render());
-
- $oNewAlias = new cHTMLTextbox ('newcategoryalias');
+
+ $oNewAlias = new cHTMLTextbox('newcategoryalias');
$oNewAlias->setStyle('width:150px; vertical-align:middle;');
- $tpl->set('s', 'INPUT_ALIAS_EDIT', $oNewAlias->render());
-
+ $tpl->set('s', 'INPUT_ALIAS_EDIT', $oNewAlias->render());
+
$sCategorySelect = buildCategorySelectRights('idcat', '');
# 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) {
- $tpl->set('s', 'NEWCAT', $string . " ".i18n('Create new category')."");
- if ($perm->have_perm_area_action($tmp_area,"str_newtree")) {
- if ($perm->have_perm_area_action($tmp_area,"str_newcat") || $bAreaAddNewCategory) {
+ 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) {
+ $tpl->set('s', 'NEWCAT', $string . " " . i18n('Create new category') . "");
+ if ($perm->have_perm_area_action($tmp_area, "str_newtree")) {
+ if ($perm->have_perm_area_action($tmp_area, "str_newcat") || $bAreaAddNewCategory) {
$tpl->set('s', 'PERMISSION_NEWTREE', '');
- $oActionNew = new cHTMLHiddenField ('action', 'str_newcat', 'cat_new_action');
+ $oActionNew = new cHTMLHiddenField('action', 'str_newcat', 'cat_new_action');
} else {
$tpl->set('s', 'PERMISSION_NEWTREE', 'disabled checked');
- $oActionNew = new cHTMLHiddenField ('action', 'str_newcat', 'str_newtree');
+ $oActionNew = new cHTMLHiddenField('action', 'str_newcat', 'str_newtree');
}
$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');
+ } else {
+ $oActionNew = new cHTMLHiddenField('action', 'str_newcat', 'cat_new_action');
$tpl->set('s', 'PERMISSION_NEWTREE', 'disabled');
$tpl->set('s', 'PERMISSION_NEWTREE_DISPLAY', 'none');
$tpl->set('s', 'NEW_ACTION', 'str_newcat');
$tpl->set('s', 'INPUT_ACTION_NEW', $oActionNew->render());
}
-
- if ($perm->have_perm_area_action($tmp_area,"str_newcat") || $bAreaAddNewCategory) {
+
+ if ($perm->have_perm_area_action($tmp_area, "str_newcat") || $bAreaAddNewCategory) {
$tpl->set('s', 'CATEGORY_SELECT', $sCategorySelect);
$tpl->set('s', 'PERMISSION_NEWCAT_DISPLAY', 'block');
} else {
$tpl->set('s', 'CATEGORY_SELECT', '');
$tpl->set('s', 'PERMISSION_NEWCAT_DISPLAY', 'none');
}
-
+
if ($perm->have_perm_area_action("str_tplcfg", "str_tplcfg")) {
- $tpl->set('s', 'TEMPLATE_BUTTON_NEW', '');
+ $tpl->set('s', 'TEMPLATE_BUTTON_NEW', '');
$tpl->set('s', 'SELECT_TEMPLATE', getTemplateSelect());
} else {
- $tpl->set('s', 'TEMPLATE_BUTTON_NEW', '');
+ $tpl->set('s', 'TEMPLATE_BUTTON_NEW', '');
$tpl->set('s', 'SELECT_TEMPLATE', '');
}
-
+
if ($perm->have_perm_area_action($tmp_area, "str_makevisible")) {
- $tpl->set('s', 'MAKEVISIBLE_BUTTON_NEW', '');
+ $tpl->set('s', 'MAKEVISIBLE_BUTTON_NEW', '');
} else {
- $tpl->set('s', 'MAKEVISIBLE_BUTTON_NEW', '');
+ $tpl->set('s', 'MAKEVISIBLE_BUTTON_NEW', '');
}
-
+
if ($perm->have_perm_area_action($tmp_area, "str_makepublic")) {
- $tpl->set('s', 'MAKEPUBLIC_BUTTON_NEW', '');
+ $tpl->set('s', 'MAKEPUBLIC_BUTTON_NEW', '');
} else {
- $tpl->set('s', 'MAKEPUBLIC_BUTTON_NEW', '');
+ $tpl->set('s', 'MAKEPUBLIC_BUTTON_NEW', '');
}
} else {
$tpl->set('s', 'NEWCAT', $string);
-
+
$tpl->set('s', 'PERMISSION_NEWTREE', 'disabled');
$tpl->set('s', 'PERMISSION_NEWTREE_DISPLAY', 'none');
-
+
$tpl->set('s', 'CATEGORY_SELECT', '');
$tpl->set('s', 'PERMISSION_NEWCAT_DISPLAY', 'none');
-
+
$tpl->set('s', 'TEMPLATE_BUTTON_NEW', '');
$tpl->set('s', 'MAKEVISIBLE_BUTTON_NEW', '');
$tpl->set('s', 'MAKEPUBLIC_BUTTON_NEW', '');
-
+
$tpl->set('s', 'NEW_ACTION', 'str_newcat');
$tpl->set('s', 'SELECT_TEMPLATE', '');
}
# Generate template
- $clang = new cApiLanguage($lang);
-
- if ( $movesubtreeidcat != 0 ) {
- if ( strlen ( $sMoveSubtreeCatName ) > 30 ) {
- $sLimiter = "...";
- } else {
- $sLimiter = "";
- }
- $sButtonDesc = sprintf( i18n( 'Cancel moving %s' ), '"' . substr( $sMoveSubtreeCatName, 0, 30) . $sLimiter . '"' );
- $tpl->set('s', 'CANCEL_MOVE_TREE', ' '.$sButtonDesc.'');
- } else {
- $tpl->set('s', 'CANCEL_MOVE_TREE', '');
- }
-
- $tpl->setEncoding($clang->get("encoding"));
+ $clang = new cApiLanguage($lang);
+
+ if ($movesubtreeidcat != 0) {
+ if (strlen($sMoveSubtreeCatName) > 30) {
+ $sLimiter = "...";
+ } else {
+ $sLimiter = "";
+ }
+ $sButtonDesc = sprintf(i18n('Cancel moving %s'), '"' . substr($sMoveSubtreeCatName, 0, 30) . $sLimiter . '"');
+ $tpl->set('s', 'CANCEL_MOVE_TREE', ' ' . $sButtonDesc . '');
+ } else {
+ $tpl->set('s', 'CANCEL_MOVE_TREE', '');
+ }
+
+ $tpl->setEncoding($clang->get("encoding"));
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['str_overview']);
}
?>
diff --git a/conlite/styles/conlite.css b/conlite/styles/conlite.css
index ac0a9cf..96607ae 100644
--- a/conlite/styles/conlite.css
+++ b/conlite/styles/conlite.css
@@ -61,6 +61,25 @@ and open the template in the editor.
select#lang {
width: 180px;
+ height: 17px;
+ line-height: 17px;
margin-left: 4px;
- margin-top: 0;
+ margin-top: 3px;
+ border: 1px solid #999;
+}
+
+#cl_beuser, #cl_passwd {
+ font-family: verdana,arial,helvetica,sans-serif;
+ height: 17px;
+ line-height: 17px;
+ margin-left: 13px;
+ margin-top: 3px;
+ padding: 0 2px;
+ border: 1px solid #999;
+}
+
+#cLanguageSelect {
+ color: #000;
+ font-family: verdana,arial,helvetica,sans-serif;
+ font-size: 11px;
}
\ No newline at end of file
diff --git a/conlite/styles/contenido.css b/conlite/styles/contenido.css
index e66c0b9..b4e1998 100644
--- a/conlite/styles/contenido.css
+++ b/conlite/styles/contenido.css
@@ -54,8 +54,8 @@ form, h1, h2, h3, h4{
padding-left: 10px;
}
#head_info{
- height: 25px;
- line-height: 25px;
+ height: 35px;
+ line-height: 35px;
background-color: #F1F1F1;
}
.head_nav{
diff --git a/conlite/templates/standard/template.con_str_overview.html b/conlite/templates/standard/template.con_str_overview.html
index 02f1583..087ff3a 100644
--- a/conlite/templates/standard/template.con_str_overview.html
+++ b/conlite/templates/standard/template.con_str_overview.html
@@ -1,6 +1,6 @@
-
+ test
diff --git a/conlite/templates/standard/template.str_overview.html b/conlite/templates/standard/template.str_overview.html
index dd14631..c172757 100644
--- a/conlite/templates/standard/template.str_overview.html
+++ b/conlite/templates/standard/template.str_overview.html
@@ -1,6 +1,6 @@
-
+ test