Get and display list description if you edit a list (Preparation for #6)

This commit is contained in:
2021-10-28 13:40:15 +02:00
parent 82741bc121
commit 2231b80846
2 changed files with 31 additions and 0 deletions

View File

@@ -71,6 +71,20 @@ $prefix = file_get_contents("$lists_path/$domain/$list_name/control/prefix");
// Remove trailing empty symbols
$prefix = trim($prefix);
# Check whether there is a listdescription file
if (file_exists("$lists_path/$domain/$list_name/control/listdescription"))
{
// Get list description
$listdescription = file_get_contents("$lists_path/$domain/$list_name/control/listdescription");
// Remove trailing empty symbols
$listdescription = trim($listdescription);
}
else
{
$listdescription = NULL;
}
// Load page
$smarty->assign("headline", $headline);
$smarty->assign("web_url", $web_url);
@@ -79,6 +93,7 @@ $smarty->assign("list_name", $list_name);
$smarty->assign("domain", $domain);
$smarty->assign("moderators", $moderators);
$smarty->assign("prefix", $prefix);
$smarty->assign("listdescription", $listdescription);
$smarty->assign("username", $_SESSION["username"]);
$smarty->assign("success", $success);
$smarty->display("edit_list.tpl");

View File

@@ -96,6 +96,22 @@
</td>
</tr>
</table>
<table style="width: 100%; text-align: center; margin-top: 50px; padding: 0 25px 0 25px;">
<tr>
<td colspan="2">
<div id="listdescription_header">
<div class="tooltip">
<img src="help.svg" width=15 height=15>
<span class="help_prefix">
This is the list description which is displayed in the overview.<br /><br />Can be left blank.
</span>
</div>
&nbsp;List description:
</div>
<textarea name="listdescription" id="listdescription" style="height: 100%; width: 100%;">{$listdescription|escape:'htmlall'}</textarea>
</td>
</tr>
</table>
</div>
<div id="save_btn">
<input type="submit" name="submit" value="Save">