fixed bug with empty description
Dieser Commit ist enthalten in:
Ursprung
c0e250a21f
Commit
0589fd287e
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project:
|
* Project:
|
||||||
* Contenido Content Management System
|
* Contenido Content Management System
|
||||||
|
@ -29,7 +30,6 @@
|
||||||
* }}
|
* }}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('CON_FRAMEWORK')) {
|
if (!defined('CON_FRAMEWORK')) {
|
||||||
die('Illegal call');
|
die('Illegal call');
|
||||||
}
|
}
|
||||||
|
@ -46,12 +46,10 @@ $rights_list_old = array ();
|
||||||
while ($db->next_record()) { //set a new rights list fore this user
|
while ($db->next_record()) { //set a new rights list fore this user
|
||||||
$rights_list_old[$db->f(3) . "|" . $db->f(4) . "|" . $db->f("idcat")] = "x";
|
$rights_list_old[$db->f(3) . "|" . $db->f(4) . "|" . $db->f("idcat")] = "x";
|
||||||
}
|
}
|
||||||
if (($perm->have_perm_area_action($area, $action)) && ($action == "user_edit"))
|
if (($perm->have_perm_area_action($area, $action)) && ($action == "user_edit")) {
|
||||||
{
|
|
||||||
saverights();
|
saverights();
|
||||||
} else {
|
} else {
|
||||||
if (!$perm->have_perm_area_action($area, $action))
|
if (!$perm->have_perm_area_action($area, $action)) {
|
||||||
{
|
|
||||||
$notification->displayNotification("error", i18n("Permission denied"));
|
$notification->displayNotification("error", i18n("Permission denied"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,12 +63,10 @@ $sTable = '';
|
||||||
$sJsBefore .= "var itemids=new Array();
|
$sJsBefore .= "var itemids=new Array();
|
||||||
var actareaids=new Array(); \n";
|
var actareaids=new Array(); \n";
|
||||||
|
|
||||||
if (($perm->have_perm_area_action($area, $action)) && ($action == "group_edit"))
|
if (($perm->have_perm_area_action($area, $action)) && ($action == "group_edit")) {
|
||||||
{
|
|
||||||
saverights();
|
saverights();
|
||||||
} else {
|
} else {
|
||||||
if (!$perm->have_perm_area_action($area, $action))
|
if (!$perm->have_perm_area_action($area, $action)) {
|
||||||
{
|
|
||||||
$notification->displayNotification("error", i18n("Permission denied"));
|
$notification->displayNotification("error", i18n("Permission denied"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,13 +86,11 @@ $sCheckboxesRow = '';
|
||||||
$aSecondHeaderRow = array();
|
$aSecondHeaderRow = array();
|
||||||
|
|
||||||
// look for possible actions in mainarea []
|
// look for possible actions in mainarea []
|
||||||
foreach($right_list["lay"] as $value2)
|
foreach ($right_list["lay"] as $value2) {
|
||||||
{
|
|
||||||
//if there are some actions
|
//if there are some actions
|
||||||
if (is_array($value2["action"]))
|
if (is_array($value2["action"]))
|
||||||
//set the areas that are in use
|
//set the areas that are in use
|
||||||
foreach($value2["action"] as $key3 => $value3)
|
foreach ($value2["action"] as $key3 => $value3) {
|
||||||
{
|
|
||||||
$possible_areas[$value2["perm"]] = "";
|
$possible_areas[$value2["perm"]] = "";
|
||||||
$colspan++;
|
$colspan++;
|
||||||
//set the possible areas and actions for this areas
|
//set the possible areas and actions for this areas
|
||||||
|
@ -105,7 +99,6 @@ foreach($right_list["lay"] as $value2)
|
||||||
//checkbox for the whole action
|
//checkbox for the whole action
|
||||||
$sTable .= $oTable->header_cell($lngAct[$value2["perm"]][$value3]);
|
$sTable .= $oTable->header_cell($lngAct[$value2["perm"]][$value3]);
|
||||||
array_push($aSecondHeaderRow, "<input type=\"checkbox\" name=\"checkall_" . $value2["perm"] . "_$value3\" value=\"\" onClick=\"setRightsFor('" . $value2["perm"] . "','$value3','')\">");
|
array_push($aSecondHeaderRow, "<input type=\"checkbox\" name=\"checkall_" . $value2["perm"] . "_$value3\" value=\"\" onClick=\"setRightsFor('" . $value2["perm"] . "','$value3','')\">");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,29 +123,24 @@ $sTable .= $oTable->end_row();
|
||||||
$sql = "SELECT * FROM " . $cfg["tab"]["lay"] . " WHERE idclient='" . Contenido_Security::toInteger($rights_client) . "' ORDER BY name";
|
$sql = "SELECT * FROM " . $cfg["tab"]["lay"] . " WHERE idclient='" . Contenido_Security::toInteger($rights_client) . "' ORDER BY name";
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
|
|
||||||
|
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
|
|
||||||
$sTplName = clHtmlEntities($db->f("name"));
|
$sTplName = clHtmlEntities($db->f("name"));
|
||||||
$sDescription = clHtmlEntities($db->f("description"));
|
$sDescription = empty($db->f("description")) ? '' : clHtmlEntities($db->f("description"));
|
||||||
|
|
||||||
|
|
||||||
$sTable .= $oTable->row();
|
$sTable .= $oTable->row();
|
||||||
$sTable .= $oTable->cell($sTplName, "", "", " class=\"td_rights0\"", false);
|
$sTable .= $oTable->cell($sTplName, "", "", " class=\"td_rights0\"", false);
|
||||||
$sTable .= $oTable->cell($sDescription, "", "", " class=\"td_rights1\" style=\"white-space:normal; \"", false);
|
$sTable .= $oTable->cell($sDescription, "", "", " class=\"td_rights1\" style=\"white-space:normal; \"", false);
|
||||||
|
|
||||||
|
|
||||||
//set javscript array for itemids
|
//set javscript array for itemids
|
||||||
$sJsBefore .= "itemids[\"" . $db->f("idlay") . "\"]=\"x\";\n";
|
$sJsBefore .= "itemids[\"" . $db->f("idlay") . "\"]=\"x\";\n";
|
||||||
|
|
||||||
// look for possible actions in mainarea[]
|
// look for possible actions in mainarea[]
|
||||||
foreach($right_list["lay"] as $value2)
|
foreach ($right_list["lay"] as $value2) {
|
||||||
{
|
|
||||||
|
|
||||||
//if there area some
|
//if there area some
|
||||||
if (is_array($value2["action"]))
|
if (is_array($value2["action"]))
|
||||||
foreach($value2["action"] as $key3 => $value3)
|
foreach ($value2["action"] as $key3 => $value3) {
|
||||||
{
|
|
||||||
//does the user have the right
|
//does the user have the right
|
||||||
if (in_array($value2["perm"] . "|$value3|" . $db->f("idlay"), array_keys($rights_list_old)))
|
if (in_array($value2["perm"] . "|$value3|" . $db->f("idlay"), array_keys($rights_list_old)))
|
||||||
$checked = "checked=\"checked\"";
|
$checked = "checked=\"checked\"";
|
||||||
|
@ -163,15 +151,11 @@ while ($db->next_record()) {
|
||||||
//set the checkbox the name consits of areait+actionid+itemid
|
//set the checkbox the name consits of areait+actionid+itemid
|
||||||
//"<input type=\"checkbox\" name=\"rights_list[".$value2["perm"]."|$value3|".$db->f("idlay")."]\" value=\"x\" $checked>
|
//"<input type=\"checkbox\" name=\"rights_list[".$value2["perm"]."|$value3|".$db->f("idlay")."]\" value=\"x\" $checked>
|
||||||
$sTable .= $oTable->cell("<input type=\"checkbox\" name=\"rights_list[" . $value2["perm"] . "|$value3|" . $db->f("idlay") . "]\" value=\"x\" $checked>", "", "", " class=\"td_rights3\"", false);
|
$sTable .= $oTable->cell("<input type=\"checkbox\" name=\"rights_list[" . $value2["perm"] . "|$value3|" . $db->f("idlay") . "]\" value=\"x\" $checked>", "", "", " class=\"td_rights3\"", false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//checkbox for checking all actions fore this itemid
|
//checkbox for checking all actions fore this itemid
|
||||||
$sTable .= $oTable->cell("<input type=\"checkbox\" name=\"checkall_" . $value2["perm"] . "_" . $value3 . "_" . $db->f("idlay") . "\" value=\"\" onClick=\"setRightsFor('" . $value2["perm"] . "','$value3','" . $db->f("idlay") . "')\">", "", "", " class=\"td_rights3\"", false);
|
$sTable .= $oTable->cell("<input type=\"checkbox\" name=\"checkall_" . $value2["perm"] . "_" . $value3 . "_" . $db->f("idlay") . "\" value=\"\" onClick=\"setRightsFor('" . $value2["perm"] . "','$value3','" . $db->f("idlay") . "')\">", "", "", " class=\"td_rights3\"", false);
|
||||||
$sTable .= $oTable->end_row();
|
$sTable .= $oTable->end_row();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sTable .= $oTable->end_row();
|
$sTable .= $oTable->end_row();
|
||||||
|
@ -180,12 +164,9 @@ $sTable .= $oTable->sumcell("<a href=javascript:submitrightsform('','area')><img
|
||||||
$sTable .= $oTable->end_row();
|
$sTable .= $oTable->end_row();
|
||||||
$sTable .= $oTable->end_table();
|
$sTable .= $oTable->end_table();
|
||||||
|
|
||||||
|
|
||||||
// generate Template
|
// generate Template
|
||||||
$oTpl->set('s', 'JS_SCRIPT_BEFORE', $sJsBefore);
|
$oTpl->set('s', 'JS_SCRIPT_BEFORE', $sJsBefore);
|
||||||
$oTpl->set('s', 'JS_SCRIPT_AFTER', $sJsAfter);
|
$oTpl->set('s', 'JS_SCRIPT_AFTER', $sJsAfter);
|
||||||
$oTpl->set('s', 'RIGHTS_CONTENT', $sTable);
|
$oTpl->set('s', 'RIGHTS_CONTENT', $sTable);
|
||||||
$oTpl->set('s', 'EXTERNAL_SCRIPTS', $sJsExternal);
|
$oTpl->set('s', 'EXTERNAL_SCRIPTS', $sJsExternal);
|
||||||
$oTpl->generate('templates/standard/' . $cfg['templates']['rights_inc']);
|
$oTpl->generate('templates/standard/' . $cfg['templates']['rights_inc']);
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ $db->query($sql);
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
|
|
||||||
$tplname = clHtmlEntities($db->f("name"));
|
$tplname = clHtmlEntities($db->f("name"));
|
||||||
$description = clHtmlEntities($db->f("description"));
|
$description = empty($db->f("description"))?'':clHtmlEntities($db->f("description"));
|
||||||
|
|
||||||
$sTable .= $table->row();
|
$sTable .= $table->row();
|
||||||
$sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false);
|
$sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false);
|
||||||
|
|
|
@ -122,7 +122,7 @@ $db->query($sql);
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
|
|
||||||
$tplname = clHtmlEntities($db->f("name"));
|
$tplname = clHtmlEntities($db->f("name"));
|
||||||
$description = clHtmlEntities($db->f("description"));
|
$description = empty($db->f("description"))?'':clHtmlEntities($db->f("description"));
|
||||||
|
|
||||||
$sTable .= $table->row();
|
$sTable .= $table->row();
|
||||||
$sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false);
|
$sTable .= $table->cell($tplname,"", "", " class=\"td_rights0\"", false);
|
||||||
|
|
Laden…
In neuem Issue referenzieren