1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-26 05:32:59 +00:00

Umm I forgot to add to the globals list... :P

This commit is contained in:
Starbeamrainbowlabs 2015-11-09 07:25:28 +00:00
parent 9489d6a555
commit e7dfda5f75
8 changed files with 17 additions and 19 deletions

View file

@ -752,7 +752,7 @@ class ids
*/ */
protected static function assign($pagename) protected static function assign($pagename)
{ {
global $idindex; global $idindex, $paths;
$nextid = count(array_keys(get_object_vars($idindex))); $nextid = count(array_keys(get_object_vars($idindex)));
@ -1169,7 +1169,7 @@ register_module([
"id" => "action-protect", "id" => "action-protect",
"code" => function() { "code" => function() {
add_action("protect", function() { add_action("protect", function() {
global $env, $pageindex; global $env, $pageindex, $paths;
// Make sure that the user is logged in as an admin / mod. // Make sure that the user is logged in as an admin / mod.
if($env->is_admin) if($env->is_admin)
@ -1407,7 +1407,7 @@ register_module([
}); });
add_action("search", function() { add_action("search", function() {
global $settings, $env, $pageindex; global $settings, $env, $pageindex, $paths;
if(!isset($_GET["query"])) if(!isset($_GET["query"]))
exit(page_renderer::render("No Search Terms - Error - $settings->sitename", "<p>You didn't specify any search terms. Try typing some into the box above.</p>")); exit(page_renderer::render("No Search Terms - Error - $settings->sitename", "<p>You didn't specify any search terms. Try typing some into the box above.</p>"));
@ -1850,8 +1850,7 @@ register_module([
"id" => "feature-upload", "id" => "feature-upload",
"code" => function() { "code" => function() {
add_action("upload", function() { add_action("upload", function() {
global $settings, $env, $pageindex; global $settings, $env, $pageindex, $paths;
switch($_SERVER["REQUEST_METHOD"]) switch($_SERVER["REQUEST_METHOD"])
{ {
@ -2270,7 +2269,7 @@ register_module([
"id" => "page-delete", "id" => "page-delete",
"code" => function() { "code" => function() {
add_action("delete", function() { add_action("delete", function() {
global $pageindex, $settings, $env; global $pageindex, $settings, $env, $paths;
if(!$settings->editing) if(!$settings->editing)
{ {
exit(page_renderer::render_main("Deleting $env->page - error", "<p>You tried to delete $env->page, but editing is disabled on this wiki.</p> exit(page_renderer::render_main("Deleting $env->page - error", "<p>You tried to delete $env->page, but editing is disabled on this wiki.</p>
@ -2391,7 +2390,7 @@ register_module([
* %save% * %save%
*/ */
add_action("save", function() { add_action("save", function() {
global $pageindex, $settings, $env, $save_preprocessors; global $pageindex, $settings, $env, $save_preprocessors, $paths;
if(!$settings->editing) if(!$settings->editing)
{ {
header("location: index.php?page=$env->page"); header("location: index.php?page=$env->page");

View file

@ -414,7 +414,7 @@ class ids
*/ */
protected static function assign($pagename) protected static function assign($pagename)
{ {
global $idindex; global $idindex, $paths;
$nextid = count(array_keys(get_object_vars($idindex))); $nextid = count(array_keys(get_object_vars($idindex)));

View file

@ -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": 1446975126, "lastupdate": 1447053764,
"optional": false "optional": false
}, },
{ {
@ -50,7 +50,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds proper search functionality to Pepperminty Wiki. Note that this module, at the moment, just contains test code while I figure out how best to write a search engine.", "description": "Adds proper search functionality to Pepperminty Wiki. Note that this module, at the moment, just contains test code while I figure out how best to write a search engine.",
"id": "feature-search", "id": "feature-search",
"lastupdate": 1446975588, "lastupdate": 1447053773,
"optional": false "optional": false
}, },
{ {
@ -59,7 +59,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.", "description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
"id": "feature-upload", "id": "feature-upload",
"lastupdate": 1447053529, "lastupdate": 1447053880,
"optional": false "optional": false
}, },
{ {
@ -77,7 +77,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds an action to allow administrators to delete pages.", "description": "Adds an action to allow administrators to delete pages.",
"id": "page-delete", "id": "page-delete",
"lastupdate": 1447002847, "lastupdate": 1447053826,
"optional": false "optional": false
}, },
{ {
@ -86,7 +86,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.", "description": "Allows you to edit pages by adding the edit and save actions. You should probably include this one.",
"id": "page-edit", "id": "page-edit",
"lastupdate": 1447002999, "lastupdate": 1447053850,
"optional": false "optional": false
}, },
{ {

View file

@ -7,7 +7,7 @@ register_module([
"id" => "action-protect", "id" => "action-protect",
"code" => function() { "code" => function() {
add_action("protect", function() { add_action("protect", function() {
global $env, $pageindex; global $env, $pageindex, $paths;
// Make sure that the user is logged in as an admin / mod. // Make sure that the user is logged in as an admin / mod.
if($env->is_admin) if($env->is_admin)

View file

@ -28,7 +28,7 @@ register_module([
}); });
add_action("search", function() { add_action("search", function() {
global $settings, $env, $pageindex; global $settings, $env, $pageindex, $paths;
if(!isset($_GET["query"])) if(!isset($_GET["query"]))
exit(page_renderer::render("No Search Terms - Error - $settings->sitename", "<p>You didn't specify any search terms. Try typing some into the box above.</p>")); exit(page_renderer::render("No Search Terms - Error - $settings->sitename", "<p>You didn't specify any search terms. Try typing some into the box above.</p>"));

View file

@ -7,8 +7,7 @@ register_module([
"id" => "feature-upload", "id" => "feature-upload",
"code" => function() { "code" => function() {
add_action("upload", function() { add_action("upload", function() {
global $settings, $env, $pageindex; global $settings, $env, $pageindex, $paths;
switch($_SERVER["REQUEST_METHOD"]) switch($_SERVER["REQUEST_METHOD"])
{ {

View file

@ -7,7 +7,7 @@ register_module([
"id" => "page-delete", "id" => "page-delete",
"code" => function() { "code" => function() {
add_action("delete", function() { add_action("delete", function() {
global $pageindex, $settings, $env; global $pageindex, $settings, $env, $paths;
if(!$settings->editing) if(!$settings->editing)
{ {
exit(page_renderer::render_main("Deleting $env->page - error", "<p>You tried to delete $env->page, but editing is disabled on this wiki.</p> exit(page_renderer::render_main("Deleting $env->page - error", "<p>You tried to delete $env->page, but editing is disabled on this wiki.</p>

View file

@ -83,7 +83,7 @@ register_module([
* %save% * %save%
*/ */
add_action("save", function() { add_action("save", function() {
global $pageindex, $settings, $env, $save_preprocessors; global $pageindex, $settings, $env, $save_preprocessors, $paths;
if(!$settings->editing) if(!$settings->editing)
{ {
header("location: index.php?page=$env->page"); header("location: index.php?page=$env->page");