* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
* @since file available since contenido release <= 4.6
*
* {@internal
* created 2003-05-20
* modified 2008-06-30, Dominik Ziegler, add security fix
* modified 2010-12-13, Ortwin Pinke, count up object id's in cScrollList while rendering
*
* $Id$:
* }}
*
*/
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
class UI_Left_Top {
var $link;
var $javascripts;
function __construct() {
}
function setLink($link) {
$this->link = $link;
}
function setJS($type, $script) {
$this->javascripts[$type] = $script;
}
function render() {
global $sess, $cfg;
$tpl = new Template();
$tpl->reset();
$tpl->set('s', 'SESSID', $sess->id);
$scripts = "";
if (is_array($this->javascripts)) {
foreach ($this->javascripts as $script) {
$scripts .= '';
}
}
if (is_object($this->link)) {
$tpl->set('s', 'LINK', $this->link->render() . $this->additional);
} else {
$tpl->set('s', 'LINK', '');
}
$tpl->set('s', 'JAVASCRIPTS', $scripts);
$tpl->set('s', 'CAPTION', $this->caption);
$tpl->generate($cfg['path']['contenido'] . $cfg['path']['templates'] . $cfg['templates']['generic_left_top']);
}
function setAdditionalContent($content) {
$this->additional = $content;
}
}
class UI_Menu {
var $link;
var $title;
var $caption;
var $javascripts;
var $type;
var $image;
var $alt;
var $actions;
var $padding;
var $imagewidth;
var $extra;
var $border;
var $show;
var $bgColor;
function __construct() {
$this->padding = 2;
$this->border = 0;
$this->rowmark = true;
}
function setTitle($item, $title) {
$this->title[$item] = $title;
}
function setRowmark($rowmark = true) {
$this->rowmark = $rowmark;
}
function setImage($item, $image, $maxwidth = 0) {
$this->image[$item] = $image;
$this->imagewidth[$item] = $maxwidth;
$this->show[$item] = $show;
}
function setExtra($item, $extra) {
$this->extra[$item] = $extra;
}
function setLink($item, $link) {
$this->link[$item] = $link;
}
function setActions($item, $key, $action) {
$this->actions[$item][$key] = $action;
}
function setPadding($padding) {
$this->padding = $padding;
}
function setBorder($border) {
$this->border = $border;
}
function setBgColor($item, $bgColor) {
$this->bgColor[$item] = $bgColor;
}
function render($print = true) {
global $sess, $cfg;
$tpl = new Template();
$tpl->reset();
$tpl->set('s', 'SID', $sess->id);
$scripts = "";
if (is_array($this->javascripts)) {
foreach ($this->javascripts as $script) {
$scripts .= '';
}
}
#echo '
Debug (B.A.): ' . $scripts;
$tpl->set('s', 'JSACTIONS', $scripts);
$tpl->set('s', 'CELLPADDING', $this->padding);
$tpl->set('s', 'BORDER', $this->border);
$tpl->set('s', 'BORDERCOLOR', $cfg['color']['table_border']);
if (is_array($this->link)) {
$dark = false;
foreach ($this->link as $key => $value) {
if ($value != NULL) {
if ($this->imagewidth[$key] != 0) {
$value->setContent('');
$img = $value->render();
} else {
$value->setContent('');
$img = $value->render();
}
$value->setContent($this->title[$key]);
$link = $value->render();
} else {
$link = $this->title[$key];
if ($this->image[$key] != "") {
if ($this->imagewidth[$key] != 0) {
$img = '';
} else {
$img = '';
}
} else {
$img = " ";
}
}
if (isset($this->bgColor[$key])) {
$bgColor = $this->bgColor[$key];
} else {
$dark = !$dark;
if ($dark) {
$bgColor = $cfg["color"]["table_dark"];
} else {
$bgColor = $cfg["color"]["table_light"];
}
if (isset($_GET['idworkflow']) && $_GET['idworkflow'] == $value) {
//$mlist->setExtra($iMenu, 'id="marked" ');
$bgColor = $cfg["color"]["table_light_active"];
}
if ($this->extra[$key] == 'id="marked" ') {
$bgColor = $cfg["color"]["table_light_active"];
}
}
$tpl->set('d', 'NAME', $link);
if ($this->image[$key] == "") {
$tpl->set('d', 'ICON', '');
} else {
$tpl->set('d', 'ICON', $img);
}
if ($this->extra[$key] != "" || $this->rowmark == true) {
$extraadd = "";
if ($this->rowmark == true) {
$extraadd = 'onmouseover="row.over(this)" onmouseout="row.out(this)" onclick="row.click(this)"';
#echo '
Debug(B.A): ' . $extraadd;
}
$tpl->set('d', 'EXTRA', $this->extra[$key] . $extraadd);
} else {
$tpl->set('d', 'EXTRA', '');
}
$fullactions = "";
if (is_array($this->actions[$key])) {
$fullactions = '
' . $singleaction . ' | '; } $fullactions .= '