mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
A real fix for #36.
This commit is contained in:
parent
839767ad62
commit
414eb58850
3 changed files with 7 additions and 19 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue