fixing PHP 8.1 errors

pull/31/head
o.pinke 1 year ago
parent 8a06c55f75
commit 50553924d4

@ -1302,8 +1302,7 @@ class cScrollList {
$this->sortkey = $field;
$this->sortmode = $order;
$field = $field + 1;
$field = intval($field) + 1;
$this->data = array_csort($this->data, "$field", $order);
}

@ -1052,6 +1052,8 @@ class cApiModule extends Item {
class cApiModuleTranslationCollection extends ItemCollection {
protected $_error;
protected $f_obj;
/**
* Constructor Function

@ -421,12 +421,19 @@ if ($contenido) {
$col = new InUseCollection;
if ($overrideid != "" && $overridetype != "") {
if (!empty($overrideid) && !empty($overridetype)) {
$col->removeItemMarks($overridetype, $overrideid);
}
/* Remove all own marks */
$col->removeSessionMarks($sess->id);
/* If the override flag is set, override a specific InUseItem */
if(empty($type)) {
$type = '';
}
if(empty($typenr)) {
$typenr = '';
}
list ($inUse, $message) = $col->checkAndMark("article", $idartlang, true, i18n("Article is in use by %s (%s)"), true, $cfg['path']['contenido_fullhtml'] . "external/backendedit/front_content.php?changeview=edit&action=con_editart&idartlang=$idartlang&type=$type&typenr=$typenr&idart=$idart&idcat=$idcat&idcatart=$idcatart&client=$client&lang=$lang");

@ -112,7 +112,7 @@ class cTinyMCEEditor extends cWYSIWYGEditor {
}
// GZIP
if ($this->_aSettings["contenido_gzip"] == "true") {
if (isset($this->_aSettings["contenido_gzip"]) && $this->_aSettings["contenido_gzip"] == "true") {
$this->setGZIPMode(true);
} else {
$this->setGZIPMode(false);

@ -31,6 +31,8 @@ if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
$bDebug = false;
if (!$idcat) {
$idcat = Contenido_Security::toInteger($_REQUEST['idcat']);
}

@ -475,7 +475,7 @@ if (is_numeric($idcat) && ($idcat >= 0)) {
}
$imgsrc .= '.gif';
$tmp_img = '';
if (($perm->have_perm_area_action("con", "con_makestart") || $perm->have_perm_area_action_item("con", "con_makestart", $idcat)) && $idcat != 0) {
if ($is_start == false) {
$tmp_link = '<a href="' . $sess->url("main.php?area=con&amp;idcat=$idcat&amp;action=con_makestart&amp;idcatart=$idcatart&amp;frame=4&is_start=1&amp;next=$next") . '" title="' . i18n("Flag as start article") . '"><img src="images/' . $imgsrc . '" border="0" title="' . i18n("Flag as start article") . '" alt="' . i18n("Flag as start article") . '" style="margin-left:3px;"></a>';

@ -596,7 +596,8 @@ if ($action == "con_newart" && $newart != true) {
</script>';
foreach ($availableTags as $key => $value) {
$tpl->set('d', 'METAINPUT', 'META' . $value);
// @todo seems to be unused, check if we can delete it (op 17.05.2022)
//$tpl->set('d', 'METAINPUT', 'META' . $value);
switch ($value["fieldtype"]) {
case "text":

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -32,56 +33,50 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude("includes","functions.str.php");
cInclude("includes","functions.tpl.php");
cInclude("includes", "functions.str.php");
cInclude("includes", "functions.tpl.php");
cInclude('includes', 'functions.lang.php');
if(!isset($oTpl) || !is_object($oTpl)) {
if (!isset($oTpl) || !is_object($oTpl)) {
$oTpl = new Template();
}
$oTpl->reset();
global $sess, $frame, $area;
$idcat = ( isset($_GET['idcat']) && is_numeric($_GET['idcat'])) ? $_GET['idcat'] : -1;
$idcat = ( isset($_GET['idcat']) && is_numeric($_GET['idcat'])) ? $_GET['idcat'] : -1;
//Get sync options
if (isset($syncoptions))
{
$syncfrom = (int) $syncoptions;
$remakeCatTable = true;
if (isset($syncoptions)) {
$syncfrom = (int) $syncoptions;
$remakeCatTable = true;
}
if (!isset($syncfrom))
{
$syncfrom = -1;
if (!isset($syncfrom)) {
$syncfrom = -1;
}
$syncoptions = $syncfrom;
$oTpl->set('s', 'SYNC_LANG', $syncfrom);
##########################################
# Delete a saved search
##########################################
$bShowArticleSearch = false;
if( isset($_GET['delsavedsearch']) )
{
if( isset($_GET['itemtype']) && sizeof($_GET['itemtype'])>0 && isset($_GET['itemid']) && sizeof($_GET['itemid'])>0 )
{
$propertyCollection = new PropertyCollection;
$propertyCollection->deleteProperties($_GET['itemtype'], $_GET['itemid']);
$bShowArticleSearch = true;
}
if (isset($_GET['delsavedsearch'])) {
if (isset($_GET['itemtype']) && sizeof($_GET['itemtype']) > 0 && isset($_GET['itemid']) && sizeof($_GET['itemid']) > 0) {
$propertyCollection = new PropertyCollection;
$propertyCollection->deleteProperties($_GET['itemtype'], $_GET['itemid']);
$bShowArticleSearch = true;
}
}
if( isset($_GET['save_search']) && $_GET['save_search'] == 'true') {
$bShowArticleSearch = true;
if (isset($_GET['save_search']) && $_GET['save_search'] == 'true') {
$bShowArticleSearch = true;
}
@ -91,22 +86,22 @@ if( isset($_GET['save_search']) && $_GET['save_search'] == 'true') {
# modified 20/04/2007 by H. Librenz for backend search
$arrDays = array();
for ($i = 0; $i < 32; $i ++) {
if ($i == 0) {
$arrDays[$i] = '--';
} else {
$arrDays[$i] = $i;
}
for ($i = 0; $i < 32; $i++) {
if ($i == 0) {
$arrDays[$i] = '--';
} else {
$arrDays[$i] = $i;
}
}
$arrMonths = array();
for ($i = 0; $i < 13; $i++) {
if ($i == 0) {
$arrMonths[$i] = '--';
} else {
$arrMonths[$i] = $i;
}
if ($i == 0) {
$arrMonths[$i] = '--';
} else {
$arrMonths[$i] = $i;
}
}
$arrYears = array();
@ -114,20 +109,20 @@ $arrYears = array();
$arrYears[0] = '-----';
$sActualYear = (int) date("Y");
for ($i = $sActualYear-10; $i < $sActualYear+30; $i++) {
$arrYears[$i] = $i;
for ($i = $sActualYear - 10; $i < $sActualYear + 30; $i++) {
$arrYears[$i] = $i;
}
$arrUsers = array();
$query = "SELECT * FROM ".$cfg['tab']['phplib_auth_user_md5']." ORDER BY realname";
$query = "SELECT * FROM " . $cfg['tab']['phplib_auth_user_md5'] . " ORDER BY realname";
$arrUsers['n/a'] = '-';
$db->query($query);
while ($db->next_record()) {
$arrUsers[$db->f('username')] = $db->f('realname');
$arrUsers[$db->f('username')] = $db->f('realname');
}
$arrDateTypes = array();
@ -137,16 +132,16 @@ $arrDateTypes['created'] = i18n('Date created');
$arrDateTypes['lastmodified'] = i18n('Date modified');
$arrDateTypes['published'] = i18n('Date published');
$articleLink="editarticle";
$articleLink = "editarticle";
$oListOptionRow = new cFoldingRow("3498dbba-ed4a-4618-8e49-3a3635396e22", i18n("Article Search"), $articleLink, $bShowArticleSearch);
$oTpl->set('s', 'ARTICLELINK', $articleLink);
#Textfeld
$oTextboxArtTitle = new cHTMLTextbox("bs_search_text", (isset($_REQUEST["bs_search_text"])?$_REQUEST["bs_search_text"]:''), 10);
$oTextboxArtTitle = new cHTMLTextbox("bs_search_text", (isset($_REQUEST["bs_search_text"]) ? $_REQUEST["bs_search_text"] : ''), 10);
$oTextboxArtTitle->setStyle('width:135px;');
#Artikel_ID-Feld
$oTextboxArtID = new cHTMLTextbox("bs_search_id", (isset($_REQUEST["bs_search_id"])?$_REQUEST["bs_search_id"]:''), 10);
$oTextboxArtID = new cHTMLTextbox("bs_search_id", (isset($_REQUEST["bs_search_id"]) ? $_REQUEST["bs_search_id"] : ''), 10);
$oTextboxArtID->setStyle('width:135px;');
#Date type
@ -155,10 +150,10 @@ $oSelectArtDateType->autoFill($arrDateTypes);
$oSelectArtDateType->setStyle('width:135px;');
$oSelectArtDateType->setEvent("Change", "toggle_tr_visibility('tr_date_from');toggle_tr_visibility('tr_date_to');");
if (isset($_REQUEST["bs_search_date_type"]) && $_REQUEST["bs_search_date_type"] !='') {
$oSelectArtDateType->setDefault($_REQUEST["bs_search_date_type"]);
if (isset($_REQUEST["bs_search_date_type"]) && $_REQUEST["bs_search_date_type"] != '') {
$oSelectArtDateType->setDefault($_REQUEST["bs_search_date_type"]);
} else {
$oSelectArtDateType->setDefault('n/a');
$oSelectArtDateType->setDefault('n/a');
}
#DateFrom
@ -175,21 +170,21 @@ $oSelectArtDateFromYear->setStyle('width:55px;');
$oSelectArtDateFromYear->autoFill($arrYears);
if (isset($_REQUEST["bs_search_date_from_day"]) && $_REQUEST["bs_search_date_from_day"] > 0) {
$oSelectArtDateFromDay->setDefault($_REQUEST["bs_search_date_from_day"]);
$oSelectArtDateFromDay->setDefault($_REQUEST["bs_search_date_from_day"]);
} else {
$oSelectArtDateFromDay->setDefault(0);
$oSelectArtDateFromDay->setDefault(0);
}
if (isset($_REQUEST["bs_search_date_from_month"]) && $_REQUEST["bs_search_date_from_month"] > 0) {
$oSelectArtDateFromMonth->setDefault($_REQUEST["bs_search_date_from_month"]);
$oSelectArtDateFromMonth->setDefault($_REQUEST["bs_search_date_from_month"]);
} else {
$oSelectArtDateFromMonth->setDefault(0);
$oSelectArtDateFromMonth->setDefault(0);
}
if (isset($_REQUEST["bs_search_date_from_year"]) && $_REQUEST["bs_search_date_from_year"] > 0) {
$oSelectArtDateFromYear->setDefault($_REQUEST["bs_search_date_from_year"]);
$oSelectArtDateFromYear->setDefault($_REQUEST["bs_search_date_from_year"]);
} else {
$oSelectArtDateFromYear->setDefault(0);
$oSelectArtDateFromYear->setDefault(0);
}
#DateTo
@ -206,21 +201,21 @@ $oSelectArtDateToYear->setStyle('width:55px;');
$oSelectArtDateToYear->autoFill($arrYears);
if (isset($_REQUEST["bs_search_date_to_day"]) && $_REQUEST["bs_search_date_to_day"] > 0) {
$oSelectArtDateToDay->setDefault($_REQUEST["bs_search_date_to_day"]);
$oSelectArtDateToDay->setDefault($_REQUEST["bs_search_date_to_day"]);
} else {
$oSelectArtDateToDay->setDefault(0);
$oSelectArtDateToDay->setDefault(0);
}
if (isset($_REQUEST["bs_search_date_to_month"]) && $_REQUEST["bs_search_date_to_month"] > 0) {
$oSelectArtDateToMonth->setDefault($_REQUEST["bs_search_date_to_month"]);
$oSelectArtDateToMonth->setDefault($_REQUEST["bs_search_date_to_month"]);
} else {
$oSelectArtDateToMonth->setDefault(0);
$oSelectArtDateToMonth->setDefault(0);
}
if (isset($_REQUEST["bs_search_date_to_year"]) && $_REQUEST["bs_search_date_to_year"] > 0) {
$oSelectArtDateToYear->setDefault($_REQUEST["bs_search_date_to_year"]);
$oSelectArtDateToYear->setDefault($_REQUEST["bs_search_date_to_year"]);
} else {
$oSelectArtDateToYear->setDefault(0);
$oSelectArtDateToYear->setDefault(0);
}
#Author
@ -228,57 +223,56 @@ $oSelectArtAuthor = new cHTMLSelectElement("bs_search_author");
$oSelectArtAuthor->setStyle('width:135px;');
$oSelectArtAuthor->autoFill($arrUsers);
if (isset($_REQUEST["bs_search_author"]) && $_REQUEST["bs_search_author"] !='') {
$oSelectArtAuthor->setDefault($_REQUEST["bs_search_author"]);
if (isset($_REQUEST["bs_search_author"]) && $_REQUEST["bs_search_author"] != '') {
$oSelectArtAuthor->setDefault($_REQUEST["bs_search_author"]);
} else {
$oSelectArtAuthor->setDefault('n/a');
$oSelectArtAuthor->setDefault('n/a');
}
$oSubmit = new cHTMLButton("submit", i18n("Search"));
$content = '<div id="artsearch" style="border: 1px solid #B3B3B3; border-top: none; margin:0;padding:0; padding-bottom: 10px;background: '.$cfg['color']['table_dark'].';">';
$content = '<div id="artsearch" style="border: 1px solid #B3B3B3; border-top: none; margin:0;padding:0; padding-bottom: 10px;background: ' . $cfg['color']['table_dark'] . ';">';
$content .= '<form action="backend_search.php" method="post" name="backend_search" target="right_bottom" id="backend_search">';
$content .= '<table dir="'.langGetTextDirection($lang).'">';
$content .= '<input type="hidden" name="area" value="'.$area.'">';
$content .= '<input type="hidden" name="frame" value="'.$frame.'">';
$content .= '<input type="hidden" name="contenido" value="'.$sess->id.'">';
$content .= '<input type="hidden" name="speach" value="'.$lang.'">';
$content .= '<table dir="' . langGetTextDirection($lang) . '">';
$content .= '<input type="hidden" name="area" value="' . $area . '">';
$content .= '<input type="hidden" name="frame" value="' . $frame . '">';
$content .= '<input type="hidden" name="contenido" value="' . $sess->id . '">';
$content .= '<input type="hidden" name="speach" value="' . $lang . '">';
$content .= '<tr>';
$content .= '<td style="padding-left: 15px;">'. i18n("Title/Content").'</td>';
$content .= '<td>'.$oTextboxArtTitle->render().'</td>';
$content .= '<td style="padding-left: 15px;">' . i18n("Title/Content") . '</td>';
$content .= '<td>' . $oTextboxArtTitle->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td style="padding-left: 15px;">'. i18n("Article ID").'</td>';
$content .= '<td>'.$oTextboxArtID->render().'</td>';
$content .= '<td style="padding-left: 15px;">' . i18n("Article ID") . '</td>';
$content .= '<td>' . $oTextboxArtID->render() . '</td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td style="padding-left: 15px;">'. i18n("Datum").'</td>';
$content .= '<td><nobr>'.$oSelectArtDateType->render().'</nobr></td>';
$content .= '<td style="padding-left: 15px;">' . i18n("Datum") . '</td>';
$content .= '<td><nobr>' . $oSelectArtDateType->render() . '</nobr></td>';
$content .= '</tr>';
$content .= '<tr id="tr_date_from" style="display:none;">';
$content .= '<td>'. i18n("Date from").'</td>';
$content .= '<td><nobr>'.$oSelectArtDateFromDay->render().$oSelectArtDateFromMonth->render().$oSelectArtDateFromYear->render().'</nobr></td>';
$content .= '<td>' . i18n("Date from") . '</td>';
$content .= '<td><nobr>' . $oSelectArtDateFromDay->render() . $oSelectArtDateFromMonth->render() . $oSelectArtDateFromYear->render() . '</nobr></td>';
$content .= '</tr>';
$content .= '<tr id="tr_date_to" style="display:none;">';
$content .= '<td>'. i18n("Date to").'</td>';
$content .= '<td><nobr>'.$oSelectArtDateToDay->render().$oSelectArtDateToMonth->render().$oSelectArtDateToYear->render().'</nobr></td>';
$content .= '<td>' . i18n("Date to") . '</td>';
$content .= '<td><nobr>' . $oSelectArtDateToDay->render() . $oSelectArtDateToMonth->render() . $oSelectArtDateToYear->render() . '</nobr></td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td style="padding-left: 15px;">'. i18n("Author").'</td>';
$content .= '<td><nobr>'.$oSelectArtAuthor->render().'</nobr></td>';
$content .= '<td style="padding-left: 15px;">' . i18n("Author") . '</td>';
$content .= '<td><nobr>' . $oSelectArtAuthor->render() . '</nobr></td>';
$content .= '</tr>';
$content .= '<tr>';
$content .= '<td>&nbsp;</td>';
$content .= '<td>'.$oSubmit->render().'</td>';
$content .= '<td>' . $oSubmit->render() . '</td>';
$content .= '</tr>';
$content .= '</table>';
$content .= '</form>';
@ -288,7 +282,7 @@ $content .= '</form>';
*/
$content .= '<div class="artikel_search">';
$content .= '<div style="font-weight:bold; margin-bottom: 10px;">'.i18n("Saved Searches").':</div>';
$content .= '<div style="font-weight:bold; margin-bottom: 10px;">' . i18n("Saved Searches") . ':</div>';
$proppy = new PropertyCollection();
$savedSearchList = $proppy->getAllValues('type', 'savedsearch', $auth);
@ -298,40 +292,37 @@ $init_itemtype = '';
$content .= '<ul class="artikel_search">';
// Recently edited articles search - predefined, not deleteable
$searchRecentlyEdited = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=".$area."&frame=4&contenido=".$sess->id."&recentedit=true'); resetSearchForm();";
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle; padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="'.$searchRecentlyEdited.'">'.i18n("Recently edited articles").'</a></li>';
$searchRecentlyEdited = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=" . $area . "&frame=4&contenido=" . $sess->id . "&recentedit=true'); resetSearchForm();";
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle; padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="' . $searchRecentlyEdited . '">' . i18n("Recently edited articles") . '</a></li>';
// My articles search - predefined, not deleteable
$searchMyArticles = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=".$area."&frame=4&contenido=".$sess->id."&myarticles=true'); resetSearchForm();";
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="'.$searchMyArticles.'">'.i18n("My articles").'</a></li>';
$searchMyArticles = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=" . $area . "&frame=4&contenido=" . $sess->id . "&myarticles=true'); resetSearchForm();";
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="' . $searchMyArticles . '">' . i18n("My articles") . '</a></li>';
// Workflow
$link = $sess->url("main.php?area=con_workflow&frame=4");
$sWorflowLink = 'conMultiLink(\'right_bottom\', \''.$link.'\'); resetSearchForm();';
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="javascript:'.$sWorflowLink.'">'.i18n("Workflow").'</a></li>';
foreach ($savedSearchList as $value)
{
if( ($init_itemid != $value['itemid']) && ($init_itemtype != $value['itemtype']) )
{
$init_itemid = $value['itemid'];
$init_itemtype = $value['itemtype'];
// Create delete icon
$deleteSearch = "javascript:conMultiLink('left_top', 'main.php?area=".$area."&frame=1&delsavedsearch=true&contenido=".$sess->id."&itemid=".$value['itemid']."&itemtype=".$value['itemtype']."')";
$content .= '<li style="margin-bottom: 3px;">';
$content .= '<a href="'.$deleteSearch.'"><img style="padding-left: 3px; vertical-align:middle;" src="images/delete.gif" /></a>';
// create new link
$savedSearchLink = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=".$area."&frame=4&contenido=".$sess->id."&itemid=".$value['itemid']."&itemtype=".$value['itemtype']."')";
$content .= '<a style="padding-left: 3px;" href="'.$savedSearchLink.'">';
}
// Name the link
if($value['name'] == 'save_name')
{
$content .= $value['value'] . '</a>';
$content .= '</li>';
}
$sWorflowLink = 'conMultiLink(\'right_bottom\', \'' . $link . '\'); resetSearchForm();';
$content .= '<li style="margin-bottom: 3px;"><img style="vertical-align:middle;padding-left: 3px;" src="images/delete_inact.gif" /><a style="padding-left: 3px;" href="javascript:' . $sWorflowLink . '">' . i18n("Workflow") . '</a></li>';
foreach ($savedSearchList as $value) {
if (($init_itemid != $value['itemid']) && ($init_itemtype != $value['itemtype'])) {
$init_itemid = $value['itemid'];
$init_itemtype = $value['itemtype'];
// Create delete icon
$deleteSearch = "javascript:conMultiLink('left_top', 'main.php?area=" . $area . "&frame=1&delsavedsearch=true&contenido=" . $sess->id . "&itemid=" . $value['itemid'] . "&itemtype=" . $value['itemtype'] . "')";
$content .= '<li style="margin-bottom: 3px;">';
$content .= '<a href="' . $deleteSearch . '"><img style="padding-left: 3px; vertical-align:middle;" src="images/delete.gif" /></a>';
// create new link
$savedSearchLink = "javascript:conMultiLink('right_bottom', 'backend_search.php?area=" . $area . "&frame=4&contenido=" . $sess->id . "&itemid=" . $value['itemid'] . "&itemtype=" . $value['itemtype'] . "')";
$content .= '<a style="padding-left: 3px;" href="' . $savedSearchLink . '">';
}
// Name the link
if ($value['name'] == 'save_name') {
$content .= $value['value'] . '</a>';
$content .= '</li>';
}
}
$content .= '</ul>';
$content .= '</div>';
@ -351,38 +342,37 @@ $sql = "SELECT
idtpl,
name
FROM
".$cfg['tab']['tpl']."
" . $cfg['tab']['tpl'] . "
WHERE
idclient = '".Contenido_Security::toInteger($client)."'
idclient = '" . Contenido_Security::toInteger($client) . "'
ORDER BY
name";
$db->query($sql);
$oTpl->set('s', 'ID', 'oTplSel');
$oTpl->set('s', 'CLASS', 'text_medium');
$oTpl->set('s', 'OPTIONS', '');
$oTpl->set('s', 'SESSID', $sess->id);
$oTpl->set('s', 'ID', 'oTplSel');
$oTpl->set('s', 'CLASS', 'text_medium');
$oTpl->set('s', 'OPTIONS', '');
$oTpl->set('s', 'SESSID', $sess->id);
$oTpl->set('s', 'BELANG', $belang);
$oTpl->set('d', 'VALUE', '0');
$oTpl->set('d', 'CAPTION', i18n("Choose template"));
$oTpl->set('d', 'SELECTED', '');
$oTpl->set('d', 'VALUE', '0');
$oTpl->set('d', 'CAPTION', i18n("Choose template"));
$oTpl->set('d', 'SELECTED', '');
$oTpl->next();
$oTpl->set('d', 'VALUE', '0');
$oTpl->set('d', 'CAPTION', '--- '. i18n("none"). ' ---');
$oTpl->set('d', 'SELECTED', '');
$oTpl->set('d', 'VALUE', '0');
$oTpl->set('d', 'CAPTION', '--- ' . i18n("none") . ' ---');
$oTpl->set('d', 'SELECTED', '');
$oTpl->next();
$categoryLink="editcat";
$categoryLink = "editcat";
$editCategory = new cFoldingRow("3498dbbb-ed4a-4618-8e49-3a3635396e22", i18n("Edit Category"), $categoryLink);
while ($db->next_record()) {
$oTplname = $db->f('name');
if (strlen($oTplname) > 18)
{
if (strlen($oTplname) > 18) {
$oTplname = substr($oTplname, 0, 15) . "...";
}
$oTpl->set('d', 'VALUE', $db->f('idtpl'));
@ -391,25 +381,25 @@ while ($db->next_record()) {
$oTpl->next();
}
// Template Dropdown
$editCat = '<div style="height:110px;padding-top:5px; padding-left: 17px; margin-bottom:-1px; border-right:1px solid #B3B3B3">';
$editCat .= i18n("Template:") . "<br />";
$editCat .= '<div style="">';
$editCat .= $oTpl->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true);
$editCat .='<a id="changetpl" href="#"><img style="vertical-align: middle;" src="images/submit.gif" border="0"></a><br />';
$editCat .= '</div>';
$editCat = '<div style="height:110px;padding-top:5px; padding-left: 17px; margin-bottom:-1px; border-right:1px solid #B3B3B3">';
$editCat .= i18n("Template:") . "<br />";
$editCat .= '<div style="">';
$editCat .= $oTpl->generate($cfg['path']['templates'] . $cfg['templates']['generic_select'], true);
$editCat .= '<a id="changetpl" href="#"><img style="vertical-align: middle;" src="images/submit.gif" border="0"></a><br />';
$editCat .= '</div>';
// Category
$editCat .= '<div style="margin: 5px 0 5px 0;">';
$oTpl->set('s', 'CAT_HREF', $sess->url("main.php?area=con_tplcfg&action=tplcfg_edit&frame=4&mode=art").'&idcat=');
$editCat .= '<div style="margin: 5px 0 5px 0;">';
$oTpl->set('s', 'CAT_HREF', $sess->url("main.php?area=con_tplcfg&action=tplcfg_edit&frame=4&mode=art") . '&idcat=');
$oTpl->set('s', 'IDCAT', $idcat);
$editCat .= '<div id="oTemplatecfg_label"><a href="javascript:configureCategory();"><img style="vertical-align: middle;" id="oTemplatecfg" vspace="3" hspace="2" src="'.$cfg["path"]["images"].'but_cat_conf2.gif" border="0" title="'.i18n("Configure Category").'" alt="'.i18n("Configure Category").'"><a>';
$editCat .= '<a href="javascript:configureCategory();">'.i18n("Configure Category").'</a></div>';
$editCat .= '<div id="oTemplatecfg_label"><a href="javascript:configureCategory();"><img style="vertical-align: middle;" id="oTemplatecfg" vspace="3" hspace="2" src="' . $cfg["path"]["images"] . 'but_cat_conf2.gif" border="0" title="' . i18n("Configure Category") . '" alt="' . i18n("Configure Category") . '"><a>';
$editCat .= '<a href="javascript:configureCategory();">' . i18n("Configure Category") . '</a></div>';
// Online / Offline
$editCat .= '<div id="oOnline_label"><a href="#"><img style="vertical-align: middle;" id="oOnline" src="images/offline.gif" vspace="2" hspace="2" border="0" title="'.i18n("Online / Offline").'" alt="'.i18n("Online / Offline").'"></a>';
$editCat .= '<a href="#">'.i18n("Online / Offline").'</a></div>';
$editCat .= '<div id="oOnline_label"><a href="#"><img style="vertical-align: middle;" id="oOnline" src="images/offline.gif" vspace="2" hspace="2" border="0" title="' . i18n("Online / Offline") . '" alt="' . i18n("Online / Offline") . '"></a>';
$editCat .= '<a href="#">' . i18n("Online / Offline") . '</a></div>';
// Lock / Unlock
$editCat .= '<div id="oLock_label"><a href="#"><img style="vertical-align: middle;" id="oLock" src="images/folder_lock.gif" vspace="2" hspace="2" border="0" title="'.i18n("Lock / Unlock").'" alt="'.i18n("Lock / Unlock").'"></a>';
$editCat .= '<a href="#">'.i18n("Lock / Unlock").'</a></div>';
$editCat .= '<br />';
$editCat .= '<div id="oLock_label"><a href="#"><img style="vertical-align: middle;" id="oLock" src="images/folder_lock.gif" vspace="2" hspace="2" border="0" title="' . i18n("Lock / Unlock") . '" alt="' . i18n("Lock / Unlock") . '"></a>';
$editCat .= '<a href="#">' . i18n("Lock / Unlock") . '</a></div>';
$editCat .= '<br />';
$editCat .= '</div>';
$editCat .= '</div>';
@ -418,95 +408,90 @@ $editCategory->setContentData($editCat);
$oTpl->set('s', 'EDIT', $editCategory->render());
$oTpl->set('s', 'CATEGORYLINK', $categoryLink);
#####################################
# Collapse / Expand / Config Category
#####################################
$selflink = "main.php";
$expandlink = $sess->url($selflink . "?area=$area&frame=2&expand=all");
$collapselink = $sess->url($selflink . "?area=$area&frame=2&collapse=all");
$collapseimg = '<a target="left_bottom" class="black" id="collapser" href="'.$collapselink.'" alt="'.i18n("close all").'" title="'.i18n("Close all categories").'"><img src="images/close_all.gif" border="0">&nbsp;'.i18n("close all").'</a>';
$expandimg = '<a target="left_bottom"class="black" id="expander" href="'.$expandlink.'" alt="'.i18n("open all").'" title="'.i18n("Open all categories").'"><img src="images/open_all.gif" border="0">&nbsp;'.i18n("open all").'</a>';
$collapseimg = '<a target="left_bottom" class="black" id="collapser" href="' . $collapselink . '" alt="' . i18n("close all") . '" title="' . i18n("Close all categories") . '"><img src="images/close_all.gif" border="0">&nbsp;' . i18n("close all") . '</a>';
$expandimg = '<a target="left_bottom"class="black" id="expander" href="' . $expandlink . '" alt="' . i18n("open all") . '" title="' . i18n("Open all categories") . '"><img src="images/open_all.gif" border="0">&nbsp;' . i18n("open all") . '</a>';
$oTpl->set('s', 'MINUS', $collapseimg);
$oTpl->set('s', 'PLUS', $expandimg);
/**************/
/* * *********** */
/* SYNCSTUFF */
/**************/
/* * *********** */
$languages = getLanguageNamesByClient($client);
$sListId = '';
if (count($languages) > 1 && $perm->have_perm_area_action($area, "con_synccat")) {
$sListId = 'sync';
$oListOptionRow = new cFoldingRow("4808dbba-ed4a-4618-8e49-3a3635396e22", i18n("Synchronize from"), $sListId);
if (($syncoptions > 0) && ($syncoptions != $lang)) {
$oListOptionRow->setExpanded (true);
}
$sListId = 'sync';
$oListOptionRow = new cFoldingRow("4808dbba-ed4a-4618-8e49-3a3635396e22", i18n("Synchronize from"), $sListId);
if (($syncoptions > 0) && ($syncoptions != $lang)) {
$oListOptionRow->setExpanded(true);
}
#'dir="' . langGetTextDirection($lang) . '"');
$selectbox = new cHTMLSelectElement("syncoptions");
$option = new cHTMLOptionElement("--- ".i18n("None")." ---", -1);
$option = new cHTMLOptionElement("--- " . i18n("None") . " ---", -1);
$selectbox->addOptionElement(-1, $option);
foreach ($languages as $languageid => $languagename)
{
if ($lang != $languageid && $perm->have_perm_client_lang($client, $languageid))
{
$option = new cHTMLOptionElement($languagename . " (".$languageid.")",$languageid);
$selectbox->addOptionElement($languageid, $option);
}
foreach ($languages as $languageid => $languagename) {
if ($lang != $languageid && $perm->have_perm_client_lang($client, $languageid)) {
$option = new cHTMLOptionElement($languagename . " (" . $languageid . ")", $languageid);
$selectbox->addOptionElement($languageid, $option);
}
}
$selectbox->setDefault($syncoptions);
$form = new UI_Form("syncfrom");
$form->setVar("area",$area);
$form->setVar("area", $area);
$form->setVar("frame", $frame);
$form->add("sel", $selectbox->render());
$link = $sess->url("main.php?area=".$area."&frame=2").'&syncoptions=';
$sJsLink = 'conMultiLink(\'left_bottom\', \''.$link.'\'+document.getElementsByName(\'syncoptions\')[0].value+\'&refresh_syncoptions=true\');';
$oTpl->set('s', 'UPDATE_SYNC_REFRESH_FRAMES', $sJsLink);
$form->add("submit", '<img style="vertical-align:middle; margin-left:5px;" onMouseover="this.style.cursor=\'pointer\'" onclick="updateCurLanguageSync();" src="'.$cfg["path"]["contenido_fullhtml"].$cfg['path']['images'].'submit.gif">');
$sSyncButton = '<div id="sync_cat_single" style="display:none;"><a href="javascript:generateSyncAction(0);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="'.i18n("Copy to current language").'" alt="'.i18n("Copy to current language").'"></a>';
$sSyncButton .= '<a href="javascript:generateSyncAction(0);">'.i18n("Copy to current language").'</a></div>';
$sSyncButtonMultiple = '<div id="sync_cat_multiple" style="display:none;"><a href="javascript:generateSyncAction(1);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="'.i18n("Also copy subcategories").'" alt="'.i18n("Also copy subcategories").'"></a>';
$sSyncButtonMultiple .= '<a href="javascript:generateSyncAction(1);">'.i18n("Also copy subcategories").'</a></div>';
$content = '<table style="padding:3px; margin-left:12px; border-right: 1px solid #B3B3B3;" width="100%" border="0" dir="'.langGetTextDirection($lang).'">
$link = $sess->url("main.php?area=" . $area . "&frame=2") . '&syncoptions=';
$sJsLink = 'conMultiLink(\'left_bottom\', \'' . $link . '\'+document.getElementsByName(\'syncoptions\')[0].value+\'&refresh_syncoptions=true\');';
$oTpl->set('s', 'UPDATE_SYNC_REFRESH_FRAMES', $sJsLink);
$form->add("submit", '<img style="vertical-align:middle; margin-left:5px;" onMouseover="this.style.cursor=\'pointer\'" onclick="updateCurLanguageSync();" src="' . $cfg["path"]["contenido_fullhtml"] . $cfg['path']['images'] . 'submit.gif">');
$sSyncButton = '<div id="sync_cat_single" style="display:none;"><a href="javascript:generateSyncAction(0);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="' . i18n("Copy to current language") . '" alt="' . i18n("Copy to current language") . '"></a>';
$sSyncButton .= '<a href="javascript:generateSyncAction(0);">' . i18n("Copy to current language") . '</a></div>';
$sSyncButtonMultiple = '<div id="sync_cat_multiple" style="display:none;"><a href="javascript:generateSyncAction(1);"><img style="vertical-align: middle;" src="images/but_sync_cat.gif" vspace="2" hspace="2" border="0" title="' . i18n("Also copy subcategories") . '" alt="' . i18n("Also copy subcategories") . '"></a>';
$sSyncButtonMultiple .= '<a href="javascript:generateSyncAction(1);">' . i18n("Also copy subcategories") . '</a></div>';
$content = '<table style="padding:3px; margin-left:12px; border-right: 1px solid #B3B3B3;" width="100%" border="0" dir="' . langGetTextDirection($lang) . '">
<tr>
<td>'.$form->render().'</td>
<td>' . $form->render() . '</td>
</tr>
<tr>
<td>'.$sSyncButton.$sSyncButtonMultiple.'</td>
<td>' . $sSyncButton . $sSyncButtonMultiple . '</td>
</tr>
</table>';
</table>';
$oListOptionRow->setContentData($content);
$oTpl->set('s', 'SYNCRONIZATION',$oListOptionRow->render());
$oTpl->set('s', 'SYNCRONIZATION', $oListOptionRow->render());
$oTpl->set('s', 'SYNCLINK', $sListId);
$sSyncLink = $sess->url($selflink . "?area=$area&frame=2&action=con_synccat");
$oTpl->set('s', 'SYNC_HREF', $sSyncLink);
$sSyncLink = $sess->url($selflink . "?area=$area&frame=2&action=con_synccat");
$oTpl->set('s', 'SYNC_HREF', $sSyncLink);
} else {
$oTpl->set('s', 'SYNCRONIZATION','');
$oTpl->set('s', 'SYNCLINK',$sListId);
$oTpl->set('s', 'SYNC_HREF', '');
$oTpl->set('s', 'SYNCRONIZATION', '');
$oTpl->set('s', 'SYNCLINK', $sListId);
$oTpl->set('s', 'SYNC_HREF', '');
}
/*
* necessary for expanding/collapsing of navigation tree per javascript/AJAX (I. van Peeren)
*/
*/
$oTpl->set('s', 'AREA', $area);
$oTpl->set('s', 'SESSION', $contenido);
$oTpl->set('s', 'AJAXURL', $cfg['path']['contenido_fullhtml'].'ajaxmain.php');
$oTpl->set('s', 'AJAXURL', $cfg['path']['contenido_fullhtml'] . 'ajaxmain.php');
##########################################
# Help
##########################################
$oTpl->set('s', 'HELPSCRIPT', setHelpContext("con"));
$oTpl->generate($cfg['path']['templates'] . $cfg['templates']['con_left_top']);
?>
$oTpl->generate($cfg['path']['templates'] . $cfg['templates']['con_left_top']);

@ -278,7 +278,7 @@ $tpl->set('s', 'TEMPLATECAPTION', i18n("Template"));
$tpl2 = new Template;
$tpl2->set('s', 'NAME', 'idtpl');
$tpl2->set('s', 'CLASS', 'text_medium');
$disabled2 = '';
if (!$perm->have_perm_area_action_item("con", "con_changetemplate", $idcat)) {
$disabled2 = 'disabled="disabled"';
}

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -31,63 +32,61 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude('pear', 'XML/Parser.php');
cInclude('pear', 'XML/RSS.php');
if(!isset($oTpl) || !is_object($oTpl)) {
if (!isset($oTpl) || !is_object($oTpl)) {
$oTpl = new Template();
}
$oTpl->reset();
if ($saveLoginTime == true) {
$sess->register("saveLoginTime");
$saveLoginTime= 0;
$sess->register("saveLoginTime");
$saveLoginTime = 0;
$vuser= new User();
$vuser = new User();
$vuser->loadUserByUserID($auth->auth["uid"]);
$lastTime= $vuser->getUserProperty("system", "currentlogintime");
$timestamp= date("Y-m-d H:i:s");
$vuser->setUserProperty("system", "currentlogintime", $timestamp);
$vuser->setUserProperty("system", "lastlogintime", $lastTime);
$vuser->loadUserByUserID($auth->auth["uid"]);
$lastTime = $vuser->getUserProperty("system", "currentlogintime");
$timestamp = date("Y-m-d H:i:s");
$vuser->setUserProperty("system", "currentlogintime", $timestamp);
$vuser->setUserProperty("system", "lastlogintime", $lastTime);
}
$vuser= new User();
$vuser = new User();
$vuser->loadUserByUserID($auth->auth["uid"]);
$lastlogin= $vuser->getUserProperty("system", "lastlogintime");
$lastlogin = $vuser->getUserProperty("system", "lastlogintime");
if ($lastlogin == "") {
$lastlogin= i18n("No Login Information available.");
$lastlogin = i18n("No Login Information available.");
}
$aNotifications = array();
// notification for requested password
if($vuser->getField('using_pw_request') == 1) {
if ($vuser->getField('using_pw_request') == 1) {
//$sPwNoti = $notification->returnNotification("warning", i18n("You're logged in with a temporary password. Please change your password."));
$aNotifications[] = i18n("You're logged in with a temporary password. Please change your password.");
}
// Check, if setup folder is still available
if (file_exists(dirname(dirname(dirname(__FILE__)))."/setup")) {
$aNotifications[] = i18n("The setup directory still exists. Please remove the setup directory before you continue.");
if (file_exists(dirname(dirname(dirname(__FILE__))) . "/setup")) {
$aNotifications[] = i18n("The setup directory still exists. Please remove the setup directory before you continue.");
}
// Check, if sysadmin and/or admin accounts are still using well-known default passwords
$sDate = date('Y-m-d');
$sSQL = "SELECT * FROM ".$cfg["tab"]["phplib_auth_user_md5"]."
$sSQL = "SELECT * FROM " . $cfg["tab"]["phplib_auth_user_md5"] . "
WHERE (username = 'sysadmin' AND password = '48a365b4ce1e322a55ae9017f3daf0c0'
AND (valid_from <= '".Contenido_Security::escapeDB($sDate, $db)."' OR valid_from = '0000-00-00' OR valid_from = '1000-01-01' OR valid_from is NULL) AND
(valid_to >= '".Contenido_Security::escapeDB($sDate, $db)."' OR valid_to = '0000-00-00' OR valid_to is NULL))
AND (valid_from <= '" . Contenido_Security::escapeDB($sDate, $db) . "' OR valid_from = '0000-00-00' OR valid_from = '1000-01-01' OR valid_from is NULL) AND
(valid_to >= '" . Contenido_Security::escapeDB($sDate, $db) . "' OR valid_to = '0000-00-00' OR valid_to is NULL))
OR (username = 'admin' AND password = '21232f297a57a5a743894a0e4a801fc3'
AND (valid_from <= '".Contenido_Security::escapeDB($sDate, $db)."' OR valid_from = '0000-00-00' OR valid_from = '1000-01-01' OR valid_from is NULL) AND
(valid_to >= '".Contenido_Security::escapeDB($sDate, $db)."' OR valid_to = '0000-00-00' OR valid_to = '1000-01-01' OR valid_to is NULL))
AND (valid_from <= '" . Contenido_Security::escapeDB($sDate, $db) . "' OR valid_from = '0000-00-00' OR valid_from = '1000-01-01' OR valid_from is NULL) AND
(valid_to >= '" . Contenido_Security::escapeDB($sDate, $db) . "' OR valid_to = '0000-00-00' OR valid_to = '1000-01-01' OR valid_to is NULL))
";
$db->query($sSQL);
@ -97,7 +96,7 @@ if ($db->num_rows() > 0) {
if (count($aNotifications) > 0) {
$oNotification = new Contenido_Notification();
$sNotification = $oNotification->messageBox("warning", implode("<br />", $aNotifications), 1). "<br />";
$sNotification = $oNotification->messageBox("warning", implode("<br />", $aNotifications), 1) . "<br />";
} else {
$sNotification = "";
}
@ -109,128 +108,126 @@ $userid = $auth->auth["uid"];
$oTpl->set('s', 'WELCOME', "<b>" . i18n("Welcome") . " </b>" . $vuser->getRealname($userid, true) . ".");
$oTpl->set('s', 'LASTLOGIN', i18n("Last login") . ": " . $lastlogin);
$clients= $classclient->getAccessibleClients();
$clients = $classclient->getAccessibleClients();
$cApiClient= new cApiClient;
$warnings= array ();
$cApiClient = new cApiClient;
$warnings = array();
if (count($clients) > 1) {
$clientform= '<form style="margin: 0px" name="clientselect" method="post" target="_top" action="' . $sess->url("index.php") . '">';
$select= new cHTMLSelectElement("changeclient");
$choices= array ();
foreach ($clients as $key => $v_client) {
if ($perm->hasClientPermission($key)) {
$cApiClient->loadByPrimaryKey($key);
if ($cApiClient->hasLanguages()) {
$choices[$key]= $v_client['name'] . " (" . $key . ')';
} else {
$warnings[]= sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
}
}
}
$select->autoFill($choices);
$select->setDefault($client);
$clientselect= $select->render();
$oTpl->set('s', 'CLIENTFORM', $clientform);
$oTpl->set('s', 'CLIENTFORMCLOSE', "</form>");
$oTpl->set('s', 'CLIENTSDROPDOWN', $clientselect);
if ($perm->have_perm() && count($warnings) > 0) {
$oTpl->set('s', 'WARNINGS', "<br>" . $notification->messageBox("warning", implode("<br>", $warnings), 0));
} else {
$oTpl->set('s', 'WARNINGS', '');
}
$oTpl->set('s', 'OKBUTTON', '<input type="image" src="images/but_ok.gif" alt="' . i18n("Change client") . '" title="' . i18n("Change client") . '" border="0">');
$clientform = '<form style="margin: 0px" name="clientselect" method="post" target="_top" action="' . $sess->url("index.php") . '">';
$select = new cHTMLSelectElement("changeclient");
$choices = array();
foreach ($clients as $key => $v_client) {
if ($perm->hasClientPermission($key)) {
$cApiClient->loadByPrimaryKey($key);
if ($cApiClient->hasLanguages()) {
$choices[$key] = $v_client['name'] . " (" . $key . ')';
} else {
$warnings[] = sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
}
}
}
$select->autoFill($choices);
$select->setDefault($client);
$clientselect = $select->render();
$oTpl->set('s', 'CLIENTFORM', $clientform);
$oTpl->set('s', 'CLIENTFORMCLOSE', "</form>");
$oTpl->set('s', 'CLIENTSDROPDOWN', $clientselect);
if ($perm->have_perm() && count($warnings) > 0) {
$oTpl->set('s', 'WARNINGS', "<br>" . $notification->messageBox("warning", implode("<br>", $warnings), 0));
} else {
$oTpl->set('s', 'WARNINGS', '');
}
$oTpl->set('s', 'OKBUTTON', '<input type="image" src="images/but_ok.gif" alt="' . i18n("Change client") . '" title="' . i18n("Change client") . '" border="0">');
} else {
$oTpl->set('s', 'OKBUTTON', '');
$sClientForm = '';
if ( count($clients) == 0 ) {
$sClientForm = i18n('No clients available!');
}
$oTpl->set('s', 'CLIENTFORM', $sClientForm);
$oTpl->set('s', 'CLIENTFORMCLOSE', '');
foreach ($clients as $key => $v_client) {
if ($perm->hasClientPermission($key)) {
$cApiClient->loadByPrimaryKey($key);
if ($cApiClient->hasLanguages()) {
$name= $v_client['name'] . " (" . $key . ')';
} else {
$warnings[]= sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
}
$oTpl->set('s', 'OKBUTTON', '');
$sClientForm = '';
if (count($clients) == 0) {
$sClientForm = i18n('No clients available!');
}
$oTpl->set('s', 'CLIENTFORM', $sClientForm);
$oTpl->set('s', 'CLIENTFORMCLOSE', '');
foreach ($clients as $key => $v_client) {
if ($perm->hasClientPermission($key)) {
$cApiClient->loadByPrimaryKey($key);
if ($cApiClient->hasLanguages()) {
$name = $v_client['name'] . " (" . $key . ')';
} else {
$warnings[] = sprintf(i18n("Client %s (%s) has no languages"), $v_client['name'], $key);
}
}
}
}
if ($perm->have_perm() && count($warnings) > 0) {
$oTpl->set('s', 'WARNINGS', "<br>" . $notification->messageBox("warning", implode("<br>", $warnings), 0));
} else {
$oTpl->set('s', 'WARNINGS', '');
}
$oTpl->set('s', 'CLIENTSDROPDOWN', $name);
$oTpl->set('s', 'WARNINGS', "<br>" . $notification->messageBox("warning", implode("<br>", $warnings), 0));
} else {
$oTpl->set('s', 'WARNINGS', '');
}
$oTpl->set('s', 'CLIENTSDROPDOWN', $name);
}
$props= new PropertyCollection;
$props = new PropertyCollection;
$props->select("itemtype = 'idcommunication' AND idclient='$client' AND type = 'todo' AND name = 'status' AND value != 'done'");
$todoitems= array ();
$aItemsTodo = [];
while ($prop= $props->next()) {
$todoitems[]= $prop->get("itemid");
while ($prop = $props->next()) {
$aItemsTodo[] = $prop->get("itemid");
}
if (count($todoitems) > 0) {
$in= "idcommunication IN (" . implode(",", $todoitems) . ")";
if (count($aItemsTodo) > 0) {
$in = "idcommunication IN (" . implode(",", $aItemsTodo) . ")";
} else {
$in= 1;
$in = 1;
}
$todoitems= new TODOCollection;
$recipient= $auth->auth["uid"];
$todoitems = new TODOCollection();
$recipient = $auth->auth["uid"];
$todoitems->select("recipient = '$recipient' AND idclient='$client' AND $in");
while ($todo= $todoitems->next()) {
if ($todo->getProperty("todo", "status") != "done") {
$todoitems++;
}
$iItemsTodoOpen = 0;
while ($todo = $todoitems->next()) {
if ($todo->getProperty("todo", "status") != "done") {
$iItemsTodoOpen++;
}
}
$sTaskTranslation = '';
if ($todoitems->count() == 1) {
$sTaskTranslation = i18n("Reminder list: %d Task open");
if ($iItemsTodoOpen == 1) {
$sTaskTranslation = i18n("Reminder list: %d Task open");
} else {
$sTaskTranslation = i18n("Reminder list: %d Tasks open");
$sTaskTranslation = i18n("Reminder list: %d Tasks open");
}
$mycontenido_overview= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido&frame=4") . '">' . i18n("Overview") . '</a>';
$mycontenido_lastarticles= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_recent&frame=4") . '">' . i18n("Recently edited articles") . '</a>';
$mycontenido_tasks= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_tasks&frame=4") . '">' . sprintf($sTaskTranslation, $todoitems->count()) . '</a>';
$mycontenido_settings= '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_settings&frame=4") . '">' . i18n("Settings") . '</a>';
$mycontenido_overview = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido&frame=4") . '">' . i18n("Overview") . '</a>';
$mycontenido_lastarticles = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_recent&frame=4") . '">' . i18n("Recently edited articles") . '</a>';
$mycontenido_tasks = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_tasks&frame=4") . '">' . sprintf($sTaskTranslation, $iItemsTodoOpen) . '</a>';
$mycontenido_settings = '<a class="blue" href="' . $sess->url("main.php?area=mycontenido_settings&frame=4") . '">' . i18n("Settings") . '</a>';
$oTpl->set('s', 'MYCONTENIDO_OVERVIEW', $mycontenido_overview);
$oTpl->set('s', 'MYCONTENIDO_LASTARTICLES', $mycontenido_lastarticles);
$oTpl->set('s', 'MYCONTENIDO_TASKS', $mycontenido_tasks);
$oTpl->set('s', 'MYCONTENIDO_SETTINGS', $mycontenido_settings);
$admins= $classuser->getSystemAdmins(true);
$admins = $classuser->getSystemAdmins(true);
$sAdminTemplate = '<li class="welcome">%s, %s</li>';
$sAdminName= "";
$sAdminName = "";
$sAdminEmail = "";
$sOutputAdmin = "";
foreach ($admins as $key => $value) {
if ($value["email"] != "") {
$sAdminEmail= '<a class="blue" href="mailto:' . $value["email"] . '">' . $value["email"] . '</a>';
$sAdminName= $value['realname'];
$sOutputAdmin .= sprintf($sAdminTemplate, $sAdminName, $sAdminEmail);
}
if ($value["email"] != "") {
$sAdminEmail = '<a class="blue" href="mailto:' . $value["email"] . '">' . $value["email"] . '</a>';
$sAdminName = $value['realname'];
$sOutputAdmin .= sprintf($sAdminTemplate, $sAdminName, $sAdminEmail);
}
}
$oTpl->set('s', 'ADMIN_EMAIL', $sOutputAdmin);
@ -238,14 +235,14 @@ $oTpl->set('s', 'ADMIN_EMAIL', $sOutputAdmin);
$oTpl->set('s', 'SYMBOLHELP', '<a href="' . $sess->url("frameset.php?area=symbolhelp&frame=4") . '">' . i18n("Symbol help") . '</a>');
if (isset($cfg["contenido"]["handbook_path"]) && file_exists($cfg["contenido"]["handbook_path"])) {
$oTpl->set('s', 'CONTENIDOMANUAL', '<a href="' . $cfg["contenido"]["handbook_url"] . '" target="_blank">' . i18n("Contenido Manual") . '</a>');
$oTpl->set('s', 'CONTENIDOMANUAL', '<a href="' . $cfg["contenido"]["handbook_url"] . '" target="_blank">' . i18n("Contenido Manual") . '</a>');
} else {
$oTpl->set('s', 'CONTENIDOMANUAL', '');
$oTpl->set('s', 'CONTENIDOMANUAL', '');
}
// For display current online user in Contenido-Backend
$aMemberList= array ();
$oActiveUsers= new ActiveUsers($db, $cfg, $auth);
$aMemberList = array();
$oActiveUsers = new ActiveUsers($db, $cfg, $auth);
$iNumberOfUsers = 0;
// Start()
@ -255,17 +252,17 @@ $oActiveUsers->startUsersTracking();
$iNumberOfUsers = $oActiveUsers->getNumberOfUsers();
// Find all User who is online
$aMemberList= $oActiveUsers->findAllUser();
$aMemberList = $oActiveUsers->findAllUser();
// Template for display current user
$sTemplate = "";
$sOutput = "";
$sTemplate= '<li class="welcome">%s, %s</li>';
$sOutput = "";
$sTemplate = '<li class="welcome">%s, %s</li>';
foreach ($aMemberList as $key) {
$sRealName= $key['realname'];
$aPerms['0']= $key['perms'];
$sOutput .= sprintf($sTemplate, $sRealName, $aPerms['0']);
$sRealName = $key['realname'];
$aPerms['0'] = $key['perms'];
$sOutput .= sprintf($sTemplate, $sRealName, $aPerms['0']);
}
// set template welcome
@ -273,12 +270,11 @@ $oTpl->set('s', 'USER_ONLINE', $sOutput);
$oTpl->set('s', 'Anzahl', $iNumberOfUsers);
// rss feed
if($perm->isSysadmin($vuser) && isset($cfg["backend"]["newsfeed"]) && $cfg["backend"]["newsfeed"] == true){
$newsfeed = 'some news';
$oTpl->set('s', 'CONTENIDO_NEWS', $newsfeed);
}
else{
$oTpl->set('s', 'CONTENIDO_NEWS', '');
if ($perm->isSysadmin($vuser) && isset($cfg["backend"]["newsfeed"]) && $cfg["backend"]["newsfeed"] == true) {
$newsfeed = 'some news';
$oTpl->set('s', 'CONTENIDO_NEWS', $newsfeed);
} else {
$oTpl->set('s', 'CONTENIDO_NEWS', '');
}
// check for new updates
@ -287,5 +283,4 @@ $sUpdateNotifierOutput = $oUpdateNotifier->displayOutput();
$oTpl->set('s', 'UPDATENOTIFICATION', $sUpdateNotifierOutput);
$oTpl->generate($cfg["path"]["templates"] . $cfg["templates"]["welcome"]);
?>

@ -1,106 +0,0 @@
var display_url;
function createMenu (menuname, items, links)
{
document.writeln('<div id="' + menuname + '" class="skin0" onMouseover="highlightie5(event)" onMouseout="lowlightie5(event)" onClick="jumptoie5(event)" display:none>');
document.writeln('<div class="skin1">Context Menu</div>');
for (var i = 0; i < items.length; i++)
{
if (items[i] == "--")
{
document.writeln('<hr style="line-height:4px;border: 0px;border-bottom:1px;border-color: black; border-style: solid;">');
} else {
document.writeln('<div class="menuitems" url="' + links[i] + '">' + items[i] + '</div>');
}
}
document.writeln('</div>');
document.getElementById(menuname).style.display = '';
}
var ie5 = document.all && document.getElementById
var ns6 = document.getElementById && !document.all
if (ie5 || ns6)
//var menuobj=document.getElementById("ie5menu")
function showmenuie5(e){
if (ie5)
{
menuobj = document.getElementById(window.event.srcElement.getAttribute("helpid"));
} else
{
menuobj = document.getElementById(e.target.getAttribute("helpid"));
}
//Find out how close the mouse is to the corner of the window
var rightedge = ie5? document.body.clientWidth - event.clientX : window.innerWidth - e.clientX
var bottomedge = ie5? document.body.clientHeight - event.clientY : window.innerHeight - e.clientY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge < menuobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left = ie5? document.body.scrollLeft + event.clientX - menuobj.offsetWidth : window.pageXOffset + e.clientX - menuobj.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left = ie5? document.body.scrollLeft + event.clientX : window.pageXOffset + e.clientX
//same concept with the vertical position
if (bottomedge < menuobj.offsetHeight)
menuobj.style.top = ie5? document.body.scrollTop + event.clientY - menuobj.offsetHeight : window.pageYOffset + e.clientY - menuobj.offsetHeight
else
menuobj.style.top = ie5? document.body.scrollTop + event.clientY : window.pageYOffset + e.clientY
menuobj.style.visibility = "visible"
return false;
}
function hidemenuie5(e){
if (typeof menuobj == "object")
{
menuobj.style.visibility = "hidden"
}
}
function highlightie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode //up one node
firingobj.style.backgroundColor = "#F4F8BD"
firingobj.style.color = "black"
firingobj.style.cursor = "pointer"
if (display_url == 1)
window.status = event.srcElement.url
}
}
function lowlightie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode //up one node
firingobj.style.backgroundColor = ""
firingobj.style.color = "black"
window.status = ''
}
}
function jumptoie5(e){
var firingobj = ie5? event.srcElement : e.target
if (firingobj.className == "menuitems" || ns6 && firingobj.parentNode.className == "menuitems"){
if (ns6 && firingobj.parentNode.className == "menuitems") firingobj = firingobj.parentNode
if (firingobj.getAttribute("target"))
window.open(firingobj.getAttribute("url"), firingobj.getAttribute("target"))
else
window.location = firingobj.getAttribute("url")
}
}
var menuobj;
if (ie5 || ns6){
//menuobj.style.display=''
document.oncontextmenu = showmenuie5
document.onclick = hidemenuie5
}

@ -1,227 +1,229 @@
<html>
<head>
<title></title>
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<link rel="stylesheet" type="text/css" href="styles/contenido.css">
<style type="text/css">@import url(scripts/jscalendar/calendar-contenido.css);</style>
<script type="text/javascript" src="scripts/jscalendar/calendar.js"></script>
<script type="text/javascript" src="scripts/jscalendar/lang/calendar-{CAL_LANG}.js"></script>
<script type="text/javascript" src="scripts/jscalendar/calendar-setup.js"></script>
<script type="text/javascript" src="scripts/messageBox.js.php?contenido={SID}"></script>
<script type="text/javascript">
var sid = "{SID}";
box = new messageBox("", "", "", 0, 0);
function removeAssignments(idart, idcat) {
url = 'main.php?area=con_editart';
url += '&action=remove_assignments';
url += '&frame=4';
url += '&idart=' + idart;
url += '&idcat=' + idcat;
url += '&contenido=' + sid;
window.location.href = url;
}
function disableFunctionsOnTimeControl()
{
// Timecontrol enabled => disable Online and Startaticle
if(document.getElementById("timemgmt").checked == true)
{
document.getElementById("is_start").checked = false;
document.getElementById("is_start").disabled = true;
<head>
<title></title>
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<link rel="stylesheet" type="text/css" href="styles/contenido.css">
<style type="text/css">@import url(scripts/jscalendar/calendar-contenido.css);</style>
<script type="text/javascript" src="scripts/jscalendar/calendar.js"></script>
<script type="text/javascript" src="scripts/jscalendar/lang/calendar-{CAL_LANG}.js"></script>
<script type="text/javascript" src="scripts/jscalendar/calendar-setup.js"></script>
<script type="text/javascript" src="scripts/messageBox.js.php?contenido={SID}"></script>
<script type="text/javascript">
var sid = "{SID}";
box = new messageBox("", "", "", 0, 0);
function removeAssignments(idart, idcat) {
url = 'main.php?area=con_editart';
url += '&action=remove_assignments';
url += '&frame=4';
url += '&idart=' + idart;
url += '&idcat=' + idcat;
url += '&contenido=' + sid;
window.location.href = url;
}
function disableFunctionsOnTimeControl()
{
// Timecontrol enabled => disable Online and Startaticle
if (document.getElementById("timemgmt").checked == true)
{
document.getElementById("is_start").checked = false;
document.getElementById("is_start").disabled = true;
if (document.getElementById("datestart").value != '') {
document.getElementById("online").checked = false;
document.getElementById("online").disabled = true;
}
}
// Timecontrol disable => enable Online and Startarticle
else
{
document.getElementById("is_start").disabled = false;
}
// Timecontrol disable => enable Online and Startarticle
else
{
document.getElementById("is_start").disabled = false;
document.getElementById("online").disabled = false;
}
}
if (document.getElementById("datestart").value == '') {
document.getElementById("online").disabled = false;
}
}
</script>
</head>
<body style="margin: 10px" onload="disableFunctionsOnTimeControl()">
<div class="categorypath">{CATEGORY}</div>
<form method="post" name="art_props" action="{ACTION}">
<input type="hidden" name="action" value="con_saveart">
{HIDDENSESSION}
{HIDDENFIELDS}
<input type="hidden" name="tmp_firstedit" value="{TMP_FIRSTEDIT}">
<input type="hidden" name="idart" value="{IDART}">
<input type="hidden" name="idcat" value="{IDCAT}">
<input type="hidden" name="idartlang" value="{IDARTLANG}">
<table cellspacing="0" cellpadding="2" border="0">
{NOTIFICATION}
<tr valign="top">
<td class="text_medium" style="border: 1px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{TITEL}</td>
<td colspan="3" class="text_medium" style="border: 1px; border-left:0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{TITEL-FIELD}</td>
</tr>
<!-- plugin Advanced Mod Rewrite - edit by stese //-->
<tr valign="top">
<td class="text_medium" style="border:1px; border-top:0px; border-color:#B3B3B3; border-style:solid; background-color:#fff">{URLNAME}</td>
<td colspan="3" class="text_medium" style="border: 1px; border-top:0px; border-left:0px; border-color: #B3B3B3; border-style: solid; background-color:#fff">{URLNAME-FIELD}</td>
</tr>
<!-- end plugin Advanced Mod Rewrite //-->
<tr valign="top">
<td width="25%" class="text_medium" style="border: 1px; border-top: 0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{DIRECTLINKTEXT}</td>
<td width="75%" colspan="3" class="text_medium" style="border: 1px; border-top: 0px; border-left:0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{DIRECTLINK}</td>
</tr>
<tr valign="top">
<td width="25%" class="text_medium" style="border: 1px;border-top: 0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ARTIKELART}</td>
<td width="75%" colspan="3" class="text_medium" style="border: 1px; border-top: 0px; border-left:0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ARTIKELARTSELECT}</td>
</tr>
<tr valign="top">
<td width="25%" class="text_medium" style="border: 1px; border-top: 0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ARTIKELID}</td>
<td width="25%" class="text_medium" style="border: 1px; border-top: 0px; border-left:0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ARTID}</td>
<td width="25%" class="text_medium" style="border: 1px;border-top: 0px; border-left:0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ZUORDNUNGSID}</td>
<td width="25%" class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ALLOCID}</td>
</tr>
<tr valign="top">
<td width="25%" class="text_medium" style="border: 1px; border-top: 0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ERSTELLT}</td>
<td width="25%" class="text_medium" style="border: 1px; border-top: 0px; border-left:0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{ERSTELLUNGS-DATUM}</td>
<td width="25%" class="text_medium" style="border: 1px;border-top: 0px; border-left:0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{AUTHOR_CREATOR}</td>
<td width="25%" class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{AUTOR-ERSTELLUNGS-NAME}</td>
</tr>
<tr valign="top">
<td class="text_medium" style="border: 1px;border-top: 0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{LETZTE-AENDERUNG}</td>
<td class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{AENDERUNGS-DATUM}</td>
<td class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{AUTHOR_MODIFIER}</td>
<td class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{AUTOR-AENDERUNG-NAME}</td>
</tr>
<tr valign="top">
<td class="text_medium" style="border: 1px;border-top: 0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{PUBLISHING_DATE_LABEL}</td>
<td class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{PUBLISHING_DATE}</td>
<td class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{PUBLISHER}</td>
<td class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{PUBLISHER_NAME}</td>
</tr>
<tr valign="top">
<td class="text_medium" style="border: 1px;border-top: 0px; border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">{WEITERLEITUNG}</td>
<td valign="bottom" colspan="3" class="text_medium" style="border: 1px; border-top: 0px; border-left:0px;border-color: #B3B3B3; border-style: solid; background-color: #FFFFFF">
<table border="0" cellspacing="0" cellpadding="0">
}
</script>
</head>
<body style="margin: 10px" onload="disableFunctionsOnTimeControl()">
<div class="categorypath">{CATEGORY}</div>
<form method="post" name="art_props" action="{ACTION}">
<input type="hidden" name="action" value="con_saveart">
{HIDDENSESSION}
{HIDDENFIELDS}
<input type="hidden" name="tmp_firstedit" value="{TMP_FIRSTEDIT}">
<input type="hidden" name="idart" value="{IDART}">
<input type="hidden" name="idcat" value="{IDCAT}">
<input type="hidden" name="idartlang" value="{IDARTLANG}">
<table cellspacing="0" cellpadding="2" border="0">