added option to edit pool description to pool edit page
This commit is contained in:
parent
b79a042bdc
commit
9511569ed4
@ -209,6 +209,17 @@ class Pools extends Extension {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "edit_description":
|
||||||
|
if ($this->have_permission($user, $pool)) {
|
||||||
|
$this->edit_description();
|
||||||
|
$page->set_mode("redirect");
|
||||||
|
$page->set_redirect(make_link("pool/view/".$pool_id));
|
||||||
|
} else {
|
||||||
|
$this->theme->display_error(403, "Permission Denied", "You do not have permission to access this page");
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case "nuke":
|
case "nuke":
|
||||||
// Completely remove the given pool.
|
// Completely remove the given pool.
|
||||||
// -> Only admins and owners may do this
|
// -> Only admins and owners may do this
|
||||||
@ -508,6 +519,17 @@ class Pools extends Extension {
|
|||||||
return $poolID;
|
return $poolID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allows editing of pool description.
|
||||||
|
*/
|
||||||
|
private function edit_description() {
|
||||||
|
global $database;
|
||||||
|
|
||||||
|
$poolID = int_escape($_POST['pool_id']);
|
||||||
|
$database->execute("UPDATE pools SET description=:dsc WHERE id=:pid", array("dsc"=>$_POST['description'], "pid"=>$poolID));
|
||||||
|
|
||||||
|
return $poolID;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks if a given image is contained within a given pool.
|
* This function checks if a given image is contained within a given pool.
|
||||||
|
@ -322,8 +322,17 @@ class PoolsTheme extends Themelet {
|
|||||||
public function edit_pool(Page $page, /*array*/ $pools, /*array*/ $images) {
|
public function edit_pool(Page $page, /*array*/ $pools, /*array*/ $images) {
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
$this->display_top($pools, "Editing Pool", true);
|
|
||||||
|
|
||||||
|
/* EDIT POOL DESCRIPTION */
|
||||||
|
$desc_html = "
|
||||||
|
".make_form(make_link("pool/edit_description"))."
|
||||||
|
<textarea name='description'>".$pools[0]['description']."</textarea><br />
|
||||||
|
<input type='hidden' name='pool_id' value='".$pools[0]['id']."'>
|
||||||
|
<input type='submit' value='Change Description' />
|
||||||
|
</form>
|
||||||
|
";
|
||||||
|
|
||||||
|
/* REMOVE POOLS */
|
||||||
$pool_images = "\n<form action='".make_link("pool/remove_posts")."' method='POST' name='checks'>";
|
$pool_images = "\n<form action='".make_link("pool/remove_posts")."' method='POST' name='checks'>";
|
||||||
|
|
||||||
foreach($images as $pair) {
|
foreach($images as $pair) {
|
||||||
@ -341,6 +350,9 @@ class PoolsTheme extends Themelet {
|
|||||||
"<input type='hidden' name='pool_id' value='".$pools[0]['id']."'>".
|
"<input type='hidden' name='pool_id' value='".$pools[0]['id']."'>".
|
||||||
"</form>";
|
"</form>";
|
||||||
|
|
||||||
|
$pools[0]['description'] = ""; //This is a rogue fix to avoid showing the description twice.
|
||||||
|
$this->display_top($pools, "Editing Pool", true);
|
||||||
|
$page->add_block(new Block("Editing Description", $desc_html, "main", 28));
|
||||||
$page->add_block(new Block("Editing Posts", $pool_images, "main", 30));
|
$page->add_block(new Block("Editing Posts", $pool_images, "main", 30));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user