Support passing additional arguments.
authorCMDR furrycat <elite@furrycat.net>
Tue, 2 Feb 2016 11:05:53 +0000 (06:05 -0500)
committerCMDR furrycat <elite@furrycat.net>
Tue, 2 Feb 2016 11:05:53 +0000 (06:05 -0500)
index.php
lib/competitor.php
lib/entry.php
lib/hull.php
lib/lap.php
lib/race.php
lib/raikogram.php
lib/ship.php
lib/station.php
lib/system.php
lib/timeline.php

index 24ef45c..a3a4f69 100644 (file)
--- a/index.php
+++ b/index.php
   parse_str($_SERVER['QUERY_STRING'], $params);
   $module = $params['module'];
   $action = $params['action'];
+  $args = $params['args'];
 
   include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "header.php")));
   if ($module) {
     $include = join(DIRECTORY_SEPARATOR, array($lib_root, "$module.php"));
     if (file_exists($include)) {
       include_once($include);
-      call_user_func("module_$module", $action);
+      call_user_func("module_$module", $action, $args);
     }
     else echo "<p>What's all that about, then?</p>\n";
   }
index c625eb1..d550bff 100644 (file)
@@ -44,7 +44,7 @@
     }
   }
 
-  function module_competitor($action) {
+  function module_competitor($action, $args) {
     if ($_POST['add_competitor']) {
       if (add_competitor($_POST["cmdr_name"], $_POST["forum_name"])) unset($_POST);
     }
index 462bd2e..2ce0d41 100644 (file)
     return false;
   }
 
-  function module_entry($action) {
+  function module_entry($action, $args) {
     if ($action && ! count($_POST)) {
       $eq = new EntryQuery;
       $eq->joinWith('Entry.Race');
index 4619b43..342d622 100644 (file)
@@ -41,7 +41,7 @@
     }
   }
 
-  function module_hull($action) {
+  function module_hull($action, $args) {
     if ($_POST['add_hull']) {
       if (add_hull($_POST["name"])) unset($_POST);
     }
index c01a7dd..c3bee57 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-  function module_lap($action) {
+  function module_lap($action, $args) {
 
     $rq = new RaceQuery;
     $races = $rq->find();
index 3d4e1a6..7887162 100644 (file)
     return $ret;
   }
 
-  function module_race($action) {
+  function module_race($action, $args) {
     if ($_POST['add_race']) {
       if (add_race($_POST["name"], $_POST["allotted_time"])) unset($_POST);
     }
index 49d9d73..dd0f7dc 100644 (file)
@@ -73,7 +73,7 @@
     return false;
   }
 
-  function module_raikogram($action) {
+  function module_raikogram($action, $args) {
     if ($_POST['edit_raikogram']) {
       if (edit_raikogram($_POST["race_id"])) unset($_POST);
     }
index 979c7fb..09f251d 100644 (file)
@@ -35,7 +35,7 @@
     }
   }
 
-  function module_ship($action) {
+  function module_ship($action, $args) {
     if ($_POST['add_ship']) {
       if (add_ship($_POST["competitor_id"], $_POST["hull_id"], $_POST["name"])) unset($_POST);
     }
index ddf96ed..1f608fa 100644 (file)
@@ -24,7 +24,7 @@
     return false;
   }
 
-  function module_station($action) {
+  function module_station($action, $args) {
     if ($_POST['add_station']) {
       if (add_station($_POST["system_id"], $_POST["type"], $_POST["name"])) unset($_POST);
     }
index a774046..6313084 100644 (file)
@@ -18,7 +18,7 @@
     return false;
   }
 
-  function module_system($action) {
+  function module_system($action, $args) {
     if ($_POST['add_system']) {
       if (add_system($_POST["system_name"])) unset($_POST);
     }
index 1f569dc..915edc4 100644 (file)
     echo "//--></script>\n";
   }
 
-  function module_timeline($action) {
+  function module_timeline($action, $args) {
     if ($action) show_timeline($action);
     $rq = new RaceQuery;
     $rq->joinWith('Race.Entry');