A real fix for #36.

This commit is contained in:
Starbeamrainbowlabs 2015-11-12 09:59:08 +00:00
parent 839767ad62
commit 414eb58850
3 changed files with 7 additions and 19 deletions

View File

@ -1233,23 +1233,17 @@ register_module([
// They check out ok, toggle the page's protection.
$page = $env->page;
$toggled = false;
if(!isset($pageindex->$page->protect))
{
$pageindex->$page->protect = true;
$toggled = true;
}
if(!$toggled && $pageindex->$page->protect === true)
else if($pageindex->$page->protect === true)
{
$pageindex->$page->protect = false;
$toggled = false;
}
if(!$toggled && $pageindex->$page->protect === false)
else if($pageindex->$page->protect === false)
{
$pageindex->$page->protected = true;
$toggled = true;
$pageindex->$page->protect = true;
}
// Save the pageindex

View File

@ -14,7 +14,7 @@
"author": "Starbeamrainbowlabs",
"description": "Exposes Pepperminty Wiki's new page protection mechanism and makes the protect button in the 'More...' menu on the top bar work.",
"id": "action-protect",
"lastupdate": 1447320607,
"lastupdate": 1447322278,
"optional": false
},
{

View File

@ -15,23 +15,17 @@ register_module([
// They check out ok, toggle the page's protection.
$page = $env->page;
$toggled = false;
if(!isset($pageindex->$page->protect))
{
$pageindex->$page->protect = true;
$toggled = true;
}
if(!$toggled && $pageindex->$page->protect === true)
else if($pageindex->$page->protect === true)
{
$pageindex->$page->protect = false;
$toggled = false;
}
if(!$toggled && $pageindex->$page->protect === false)
else if($pageindex->$page->protect === false)
{
$pageindex->$page->protected = true;
$toggled = true;
$pageindex->$page->protect = true;
}
// Save the pageindex