1
0
Fork 0
cl-workflow/includes/include.workflow_subnav.php

107 Zeilen
2,8 KiB
PHP

2019-11-04 15:22:11 +00:00
<?php
2020-08-20 16:30:16 +00:00
2019-11-04 15:22:11 +00:00
/**
* Project:
* Contenido Content Management System
*
* Description:
* Builds the third navigation layer
*
* Requirements:
* @con_php_req 5.0
*
*
* @package Contenido Backend classes
* @version 1.1.1
* @author Timo Hummel
* @copyright four for business AG <www.4fb.de>
* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
*
* {@internal
* created 2003-05-20
* modified 2010-05-20, Murat Purc, removed request check during processing ticket [#CON-307]
*
* $Id: include.workflow_subnav.php 128 2019-07-03 11:58:28Z oldperl $
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
2020-08-20 16:30:16 +00:00
die('Illegal call');
2019-11-04 15:22:11 +00:00
}
2020-08-20 16:30:16 +00:00
$nav = new Contenido_Navigation;
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
$parentarea = getParentAreaID($area);
$sql = "SELECT
2019-11-04 15:22:11 +00:00
idarea
FROM
2020-08-20 16:30:16 +00:00
" . $cfg["tab"]["area"] . " AS a
2019-11-04 15:22:11 +00:00
WHERE
2020-08-20 16:30:16 +00:00
a.name = '" . Contenido_Security::escapeDB($parentarea, $db) . "' OR
a.parent_id = '" . Contenido_Security::escapeDB($parentarea, $db) . "'
2019-11-04 15:22:11 +00:00
ORDER BY
idarea";
2020-08-20 16:30:16 +00:00
$db->query($sql);
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
$in_str = "";
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
while ($db->next_record()) {
$in_str .= $db->f('idarea') . ',';
}
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
$len = strlen($in_str) - 1;
$in_str = substr($in_str, 0, $len);
$in_str = '(' . $in_str . ')';
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
$sql = "SELECT
2019-11-04 15:22:11 +00:00
b.location AS location,
a.name AS name
FROM
2020-08-20 16:30:16 +00:00
" . $cfg["tab"]["area"] . " AS a,
" . $cfg["tab"]["nav_sub"] . " AS b
2019-11-04 15:22:11 +00:00
WHERE
2020-08-20 16:30:16 +00:00
b.idarea IN " . Contenido_Security::escapeDB($in_str, $db) . " AND
2019-11-04 15:22:11 +00:00
b.idarea = a.idarea AND
b.level = 1
ORDER BY
b.idnavs";
2020-08-20 16:30:16 +00:00
$db->query($sql);
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
while ($db->next_record()) {
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
# Extract caption from
# the xml language file
$caption = $nav->getName($db->f("location"));
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
$tmp_area = $db->f("name");
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
# Set template data
$tpl->set("d", "ID", 'c_' . $tpl->dyn_cnt);
$tpl->set("d", "CLASS", '');
$tpl->set("d", "OPTIONS", '');
$tpl->set("d", "CAPTION", '<a class="white" onclick="sub.clicked(this)" target="right_bottom" href="' . $sess->url("main.php?area=$tmp_area&frame=4&idworkflow=$idworkflow") . '">' . $caption . '</a>');
if ($area == $tmp_area) {
$tpl->set('s', 'DEFAULT', markSubMenuItem($tpl->dyn_cnt, true));
2019-11-04 15:22:11 +00:00
}
2020-08-20 16:30:16 +00:00
$tpl->next();
}
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
$tpl->set('s', 'COLSPAN', ($tpl->dyn_cnt * 2) + 2);
$tpl->set('s', 'IDCAT', $idcat);
$tpl->set('s', 'SESSID', $sess->id);
$tpl->set('s', 'CLIENT', $client);
$tpl->set('s', 'LANG', $lang);
2019-11-04 15:22:11 +00:00
2020-08-20 16:30:16 +00:00
# Generate the third
# navigation layer
if ($idworkflow <= 0) {
$tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav_blank"]);
} else {
$tpl->generate($cfg["path"]["templates"] . $cfg["templates"]["subnav"]);
}