mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-26 05:32:59 +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.
|
// They check out ok, toggle the page's protection.
|
||||||
$page = $env->page;
|
$page = $env->page;
|
||||||
|
|
||||||
$toggled = false;
|
|
||||||
if(!isset($pageindex->$page->protect))
|
if(!isset($pageindex->$page->protect))
|
||||||
{
|
{
|
||||||
$pageindex->$page->protect = true;
|
$pageindex->$page->protect = true;
|
||||||
$toggled = true;
|
|
||||||
}
|
}
|
||||||
|
else if($pageindex->$page->protect === true)
|
||||||
if(!$toggled && $pageindex->$page->protect === true)
|
|
||||||
{
|
{
|
||||||
$pageindex->$page->protect = false;
|
$pageindex->$page->protect = false;
|
||||||
$toggled = false;
|
|
||||||
}
|
}
|
||||||
|
else if($pageindex->$page->protect === false)
|
||||||
if(!$toggled && $pageindex->$page->protect === false)
|
|
||||||
{
|
{
|
||||||
$pageindex->$page->protected = true;
|
$pageindex->$page->protect = true;
|
||||||
$toggled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the pageindex
|
// Save the pageindex
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"author": "Starbeamrainbowlabs",
|
"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.",
|
"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",
|
"id": "action-protect",
|
||||||
"lastupdate": 1447320607,
|
"lastupdate": 1447322278,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,23 +15,17 @@ register_module([
|
||||||
// They check out ok, toggle the page's protection.
|
// They check out ok, toggle the page's protection.
|
||||||
$page = $env->page;
|
$page = $env->page;
|
||||||
|
|
||||||
$toggled = false;
|
|
||||||
if(!isset($pageindex->$page->protect))
|
if(!isset($pageindex->$page->protect))
|
||||||
{
|
{
|
||||||
$pageindex->$page->protect = true;
|
$pageindex->$page->protect = true;
|
||||||
$toggled = true;
|
|
||||||
}
|
}
|
||||||
|
else if($pageindex->$page->protect === true)
|
||||||
if(!$toggled && $pageindex->$page->protect === true)
|
|
||||||
{
|
{
|
||||||
$pageindex->$page->protect = false;
|
$pageindex->$page->protect = false;
|
||||||
$toggled = false;
|
|
||||||
}
|
}
|
||||||
|
else if($pageindex->$page->protect === false)
|
||||||
if(!$toggled && $pageindex->$page->protect === false)
|
|
||||||
{
|
{
|
||||||
$pageindex->$page->protected = true;
|
$pageindex->$page->protect = true;
|
||||||
$toggled = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save the pageindex
|
// Save the pageindex
|
||||||
|
|
Loading…
Reference in a new issue