Tagging version 2.1.0
Dieser Commit ist enthalten in:
Ursprung
a0ea0e7255
Commit
ad75f4b3fc
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
|
@ -18,12 +17,15 @@
|
|||
*
|
||||
* $Id$:
|
||||
*/
|
||||
|
||||
if(!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
// create Navigation array for one level
|
||||
function createNavigationArray($start_id, $db) {
|
||||
function createNavigationArray($start_id, $db)
|
||||
{
|
||||
global $user, $cfg, $client, $lang, $auth;
|
||||
|
||||
$navigation = array();
|
||||
|
@ -50,7 +52,8 @@ function createNavigationArray($start_id, $db) {
|
|||
A.idtree";
|
||||
$db->query($sql);
|
||||
|
||||
while ($db->next_record()) {
|
||||
while($db->next_record())
|
||||
{
|
||||
$cat_id = $db->f("idcat");
|
||||
$cat_idlang = $db->f("idcatlang");
|
||||
$visible=false;
|
||||
|
@ -86,6 +89,7 @@ function createNavigationArray($start_id, $db) {
|
|||
return $navigation;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return target of a given category id
|
||||
*
|
||||
|
@ -120,6 +124,7 @@ function getTarget($cat_id, $db) {
|
|||
/**
|
||||
* Return true if $parentid is parent of $catid
|
||||
*/
|
||||
|
||||
function isParent($parentid, $catid, $db) {
|
||||
|
||||
|
||||
|
@ -141,9 +146,12 @@ function isParent($parentid, $catid, $db) {
|
|||
|
||||
$pre = $db->f("parentid");
|
||||
|
||||
if ($parentid == $pre) {
|
||||
if($parentid == $pre)
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -166,14 +174,18 @@ function getParent($preid, &$db) {
|
|||
|
||||
$db->query($sql);
|
||||
|
||||
if ($db->next_record()) {
|
||||
if ($db->next_record())
|
||||
{
|
||||
return $db->f("parentid");
|
||||
} else {
|
||||
}else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getLevel($catid, &$db) {
|
||||
function getLevel($catid, &$db)
|
||||
{
|
||||
global $cfg, $client, $lang;
|
||||
|
||||
// SECURITY-FIX
|
||||
|
@ -186,13 +198,17 @@ function getLevel($catid, &$db) {
|
|||
|
||||
$db->query($sql);
|
||||
|
||||
if ($db->next_record()) {
|
||||
if ($db->next_record())
|
||||
{
|
||||
return $db->f("level");
|
||||
} else {
|
||||
}else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return path of a given category up to a certain level
|
||||
*/
|
||||
|
@ -203,47 +219,63 @@ function getCategoryPath($cat_id, $level, $reverse = true, &$db) {
|
|||
|
||||
$parent_id = $cat_id;
|
||||
|
||||
while (getLevel($parent_id, $db) != false AND getLevel($parent_id, $db) > $level AND getLevel($parent_id, $db) >= 0) {
|
||||
while (getLevel($parent_id, $db) != false AND getLevel($parent_id, $db) > $level AND getLevel($parent_id, $db) >= 0)
|
||||
{
|
||||
|
||||
$parent_id = getParent($parent_id, $db);
|
||||
if ($parent_id != false) {
|
||||
if ($parent_id != false)
|
||||
{
|
||||
array_push($root_path, $parent_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($reverse == true) {
|
||||
if ($reverse == true)
|
||||
{
|
||||
$root_path = array_reverse($root_path);
|
||||
}
|
||||
|
||||
return $root_path;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return location string of a given category
|
||||
*/
|
||||
function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sTextStyleClass, $fullweblink = false, $reverse = true, $mod_rewrite = true, $db) {
|
||||
function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sTextStyleClass, $fullweblink = false, $reverse = true, $mod_rewrite = true, $db)
|
||||
{
|
||||
global $sess, $cfgClient, $client;
|
||||
|
||||
$aCatPath = getCategoryPath($iStartCat, $level, $reverse, $db);
|
||||
|
||||
if (is_array($aCatPath) AND count($aCatPath) > 0) {
|
||||
if(is_array($aCatPath) AND count($aCatPath) > 0)
|
||||
{
|
||||
$aLocation = array();
|
||||
foreach ($aCatPath as $value) {
|
||||
if (!$fullweblink) {
|
||||
if ($mod_rewrite == true) {
|
||||
foreach($aCatPath as $value)
|
||||
{
|
||||
if (!$fullweblink)
|
||||
{
|
||||
if ($mod_rewrite == true)
|
||||
{
|
||||
$linkUrl = $sess->url("index-a-$value.html");
|
||||
} else {
|
||||
}else
|
||||
{
|
||||
$linkUrl = $sess->url("front_content.php?idcat=$value");
|
||||
}
|
||||
} else {
|
||||
if ($mod_rewrite == true) {
|
||||
}else
|
||||
{
|
||||
if ($mod_rewrite == true)
|
||||
{
|
||||
$linkUrl = $sess->url($cfgClient[$client]["path"]["htmlpath"] . "index-a-$value.html");
|
||||
} else {
|
||||
}else
|
||||
{
|
||||
$linkUrl = $sess->url($cfgClient[$client]["path"]["htmlpath"] . "front_content.php?idcat=$value");
|
||||
}
|
||||
}
|
||||
$name = getCategoryName($value, $db);
|
||||
$aLocation[] = '<a href="'.$linkUrl.'" class="'.$sLinkStyleClass.'"><nobr>'.$name.'</nobr></a>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,6 +286,7 @@ function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sT
|
|||
return $sLocation;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* get subtree by a given id
|
||||
|
@ -263,7 +296,9 @@ function getLocationString($iStartCat, $level, $seperator, $sLinkStyleClass, $sT
|
|||
*
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
*/
|
||||
function getSubTree($idcat_start, $db) {
|
||||
|
||||
function getSubTree($idcat_start, $db)
|
||||
{
|
||||
global $client, $cfg;
|
||||
|
||||
// SECURITY-FIX
|
||||
|
@ -282,11 +317,14 @@ function getSubTree($idcat_start, $db) {
|
|||
|
||||
$subCats = false;
|
||||
$curLevel = 0;
|
||||
while ($db->next_record()) {
|
||||
if ($db->f("idcat") == $idcat_start) {
|
||||
while ($db->next_record())
|
||||
{
|
||||
if ($db->f("idcat") == $idcat_start)
|
||||
{
|
||||
$curLevel = $db->f("level");
|
||||
$subCats = true;
|
||||
} else if ($db->f("level") <= $curLevel) { // ending part of tree
|
||||
} else if ($db->f("level") <= $curLevel) // ending part of tree
|
||||
{
|
||||
$subCats = false;
|
||||
}
|
||||
|
||||
|
@ -297,7 +335,8 @@ function getSubTree($idcat_start, $db) {
|
|||
return $deeper_cats;
|
||||
}
|
||||
|
||||
function getTeaserDeeperCategories($iIdcat, $db) {
|
||||
function getTeaserDeeperCategories($iIdcat, $db)
|
||||
{
|
||||
global $client, $cfg, $lang;
|
||||
|
||||
// SECURITY-FIX
|
||||
|
@ -320,10 +359,12 @@ function getTeaserDeeperCategories($iIdcat, $db) {
|
|||
$subCats = false;
|
||||
$curLevel = 0;
|
||||
while ($db->next_record()) {
|
||||
if ($db->f("idcat") == $iIdcat) {
|
||||
if ($db->f("idcat") == $iIdcat)
|
||||
{
|
||||
$curLevel = $db->f("level");
|
||||
$subCats = true;
|
||||
} else if ($curLevel == $db->f("level")) { // ending part of tree
|
||||
} else if ($curLevel == $db->f("level")) // ending part of tree
|
||||
{
|
||||
$subCats = false;
|
||||
}
|
||||
|
||||
|
@ -343,7 +384,9 @@ function getTeaserDeeperCategories($iIdcat, $db) {
|
|||
*
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
*/
|
||||
function getProtectedSubTree($idcat_start, $db) {
|
||||
|
||||
function getProtectedSubTree($idcat_start, $db)
|
||||
{
|
||||
global $client, $cfg, $lang;
|
||||
|
||||
// SECURITY-FIX
|
||||
|
@ -368,10 +411,12 @@ function getProtectedSubTree($idcat_start, $db) {
|
|||
$subCats = false;
|
||||
$curLevel = 0;
|
||||
while ( $db->next_record() ) {
|
||||
if ($db->f("idcat") == $idcat_start) {
|
||||
if ($db->f("idcat") == $idcat_start)
|
||||
{
|
||||
$curLevel = $db->f("level");
|
||||
$subCats = true;
|
||||
} else if ($curLevel == $db->f("level")) { // ending part of tree
|
||||
} else if ($curLevel == $db->f("level")) // ending part of tree
|
||||
{
|
||||
$subCats = false;
|
||||
}
|
||||
|
||||
|
@ -382,9 +427,12 @@ function getProtectedSubTree($idcat_start, $db) {
|
|||
return $deeper_cats;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return category name
|
||||
*/
|
||||
|
||||
function getCategoryName($cat_id, &$db) {
|
||||
|
||||
global $cfg, $client, $lang;
|
||||
|
@ -404,15 +452,17 @@ function getCategoryName($cat_id, &$db) {
|
|||
|
||||
$db->query($sql);
|
||||
|
||||
if ($db->next_record()) {
|
||||
if ($db->next_record())
|
||||
{
|
||||
$cat_name = $db->f("name");
|
||||
return $cat_name;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// end function
|
||||
} // end function
|
||||
|
||||
// get direct subcategories of a given category
|
||||
function getSubCategories($parent_id, $db) {
|
||||
|
@ -444,12 +494,13 @@ function getSubCategories($parent_id, $db) {
|
|||
while ( $db->next_record() ) {
|
||||
|
||||
$subcategories[] = $db->f("idcat");
|
||||
|
||||
} // end while
|
||||
|
||||
return $subcategories;
|
||||
}
|
||||
|
||||
// end function
|
||||
} // end function
|
||||
|
||||
|
||||
// get direct subcategories with protected categories
|
||||
function getProtectedSubCategories($parent_id, $db) {
|
||||
|
@ -480,26 +531,25 @@ function getProtectedSubCategories($parent_id, $db) {
|
|||
while ( $db->next_record() ) {
|
||||
|
||||
$subcategories[] = $db->f("idcat");
|
||||
|
||||
} // end while
|
||||
|
||||
return $subcategories;
|
||||
}
|
||||
|
||||
// end function
|
||||
} // end function
|
||||
|
||||
function checkCatPermission($idcatlang, $public) {
|
||||
#Check if current user has permissions to access cat
|
||||
|
||||
global $auth;
|
||||
|
||||
$oDB = new DB_ConLite();
|
||||
$oDB = new DB_Contenido;
|
||||
|
||||
$FrontendPermissionCollection = new FrontendPermissionCollection;
|
||||
$visible=false;
|
||||
|
||||
if($public!=0){
|
||||
$visible = true;
|
||||
$groups = array();
|
||||
}elseif(($auth->auth['uid']!='')&&($auth->auth['uid']!='nobody')){
|
||||
$FrontendGroupMemberCollection = new FrontendGroupMemberCollection;
|
||||
$FrontendGroupMemberCollection->setWhere("idfrontenduser",$auth->auth['uid']);
|
||||
|
@ -519,3 +569,4 @@ function checkCatPermission($idcatlang, $public) {
|
|||
|
||||
return $visible;
|
||||
}
|
||||
?>
|
|
@ -43,7 +43,6 @@ INSERT INTO !PREFIX!_area VALUES('47', 'lang', 'lang_edit', '1', '1', '0');
|
|||
INSERT INTO !PREFIX!_area VALUES('48', 'client', 'client_edit', '1', '1', '0');
|
||||
INSERT INTO !PREFIX!_area VALUES('49', '0', 'logs', '1', '1', '1');
|
||||
INSERT INTO !PREFIX!_area VALUES('50', '0', 'recipients', '1', '1', '0');
|
||||
INSERT INTO !PREFIX!_area VALUES('51', '0', 'myArea', '1', '1', '1');
|
||||
INSERT INTO !PREFIX!_area VALUES('52', '0', 'info', '0', '1', '1');
|
||||
INSERT INTO !PREFIX!_area VALUES('53', '0', 'symbolhelp', '0', '1', '1');
|
||||
INSERT INTO !PREFIX!_area VALUES('54', '0', 'groups', '1', '1', '0');
|
||||
|
@ -85,8 +84,6 @@ INSERT INTO !PREFIX!_area VALUES('91', 'recipients', 'recipients_import', '1', '
|
|||
INSERT INTO !PREFIX!_area VALUES('92', 'mod', 'mod_package', '1', '1', '0');
|
||||
INSERT INTO !PREFIX!_area VALUES('93', 'mod', 'mod_sync', '1', '1', '0');
|
||||
INSERT INTO !PREFIX!_area VALUES('96', '0', 'cl_sample_plugin', '1', '1', '1');
|
||||
INSERT INTO !PREFIX!_area VALUES('97', '0', 'myArea', '1', '1', '1');
|
||||
INSERT INTO !PREFIX!_area VALUES('98', '0', 'myArea', '1', '1', '1');
|
||||
INSERT INTO !PREFIX!_area VALUES('400', 'lay', 'lay_history', '1', '1', '0');
|
||||
INSERT INTO !PREFIX!_area VALUES('401', 'style', 'style_history', '1', '1', '0');
|
||||
INSERT INTO !PREFIX!_area VALUES('402', 'js', 'js_history', '1', '1', '0');
|
||||
|
|
Laden…
In neuem Issue referenzieren