code cleanup

This commit is contained in:
Nathan Coad
2019-09-10 19:08:26 +10:00
parent e8df551c94
commit a3472d6fb4
7 changed files with 20 additions and 23 deletions

View File

@@ -8,8 +8,8 @@
function booking_event_admin() function booking_event_admin()
{ {
//see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios //see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios
$form = array (); $form = array();
$options = array (); $options = array();
$prefix = t("<p>!link</p>", $prefix = t("<p>!link</p>",
array ('!link' => l('Add New Event', 'admin/config/booking/events/create'))); array ('!link' => l('Add New Event', 'admin/config/booking/events/create')));
@@ -106,7 +106,7 @@ function booking_event_admin_submit($form, &$form_state) {
function booking_event_form($node, &$form_state, $create, $editid = 0) function booking_event_form($node, &$form_state, $create, $editid = 0)
{ {
$form = array (); $form = array();
$prefix = "<p>Add a new event to the bookings module.</p>"; $prefix = "<p>Add a new event to the bookings module.</p>";
if ($create == true) if ($create == true)

View File

@@ -8,8 +8,8 @@
function booking_price_admin() function booking_price_admin()
{ {
//see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios //see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios
$form = array (); $form = array();
$options = array (); $options = array();
$prefix = t("<p>!link</p>", $prefix = t("<p>!link</p>",
array ('!link' => l('Add New Price Entry', 'admin/config/booking/prices/create'))); array ('!link' => l('Add New Price Entry', 'admin/config/booking/prices/create')));
@@ -128,7 +128,7 @@ function booking_price_admin_submit($form, &$form_state) {
function booking_price_form($node, &$form_state, $create, $editid = 0) function booking_price_form($node, &$form_state, $create, $editid = 0)
{ {
$form = array (); $form = array();
$prefix = "<p>Add a new payment option</p>"; $prefix = "<p>Add a new payment option</p>";
if ($create == true) if ($create == true)

View File

@@ -45,7 +45,7 @@ function booking_room_view_summary() {
*/ */
function booking_roomlocation_define_form($node, &$form_state, $create, $editid = 0) function booking_roomlocation_define_form($node, &$form_state, $create, $editid = 0)
{ {
$form = array (); $form = array();
$prefix = "<p>Add a new room location definition</p>"; $prefix = "<p>Add a new room location definition</p>";
if ($create == true) if ($create == true)

View File

@@ -13,8 +13,8 @@ function booking_available_leadhelp_select_form($node, &$form_state, $group_id)
global $event; global $event;
//see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios //see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios
$form = array (); $form = array();
$options = array (); $options = array();
$group_options = array(); $group_options = array();
$session_options = array(); $session_options = array();
@@ -358,8 +358,8 @@ function booking_studygroups_edit_form($node, &$form_state, $nid) {
global $event; global $event;
//see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios //see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios
$form = array (); $form = array();
$rows = array (); $rows = array();
$session_options = array(); $session_options = array();
$readinggroup_options = array(); $readinggroup_options = array();
$session_options[0] = ''; $session_options[0] = '';

View File

@@ -88,7 +88,7 @@ function booking_studygroups_view_summary() {
*/ */
function booking_studygroups_define_form($node, &$form_state, $create, $editid = 0) function booking_studygroups_define_form($node, &$form_state, $create, $editid = 0)
{ {
$form = array (); $form = array();
$prefix = "<p>Add a new study group definition</p>"; $prefix = "<p>Add a new study group definition</p>";
if ($create == true) { if ($create == true) {

View File

@@ -13,7 +13,7 @@ function booking_tokens_admin() {
'format' => filter_default_format(), 'format' => filter_default_format(),
); );
$form = array (); $form = array();
$default_aims_and_rules_text = "<p>During [booking:eventname] we ask that you consider the following so that each of us can be free from distraction whilst we grow in Christ together. Christ is our ultimate example so in all actions, thoughts and words we ask that you demonstrate behaviour that emulates him.</p>\n" . $default_aims_and_rules_text = "<p>During [booking:eventname] we ask that you consider the following so that each of us can be free from distraction whilst we grow in Christ together. Christ is our ultimate example so in all actions, thoughts and words we ask that you demonstrate behaviour that emulates him.</p>\n" .
"<ul><li>Please leave distractions like iPods, MP3 players, etc at home as this will help us all have a more uplifting time</li>\n" . "<ul><li>Please leave distractions like iPods, MP3 players, etc at home as this will help us all have a more uplifting time</li>\n" .
"<li>No alcohol or illicit drugs are allowed at [booking:eventname]. Not only do these do serious harm to you but can endanger others who attend. Only bring things that better yourself and others</li>\n" . "<li>No alcohol or illicit drugs are allowed at [booking:eventname]. Not only do these do serious harm to you but can endanger others who attend. Only bring things that better yourself and others</li>\n" .

View File

@@ -12,11 +12,8 @@ function booking_variety_admin() {
// tableselect with text fields http://drupal.stackexchange.com/questions/75950/tableselect-with-textfields/82763#82763 // tableselect with text fields http://drupal.stackexchange.com/questions/75950/tableselect-with-textfields/82763#82763
// inline edit buttons http://drupal.stackexchange.com/questions/31942/how-do-i-add-an-edit-button-on-each-row-of-a-tableselect-form-element // inline edit buttons http://drupal.stackexchange.com/questions/31942/how-do-i-add-an-edit-button-on-each-row-of-a-tableselect-form-element
// tabledrag example http://dropbucket.org/node/204 // tabledrag example http://dropbucket.org/node/204
$form = array (); $form = array();
$options = array (); $options = array();
//$result = db_query("SELECT * FROM {booking_variety_timeslots}");
//$result = db_query("SELECT * FROM {booking_variety_timeslots} WHERE booking_eventid = :eid",
// array(':eid' => $event->eid));
$query = db_select('booking_variety_timeslots', 't'); $query = db_select('booking_variety_timeslots', 't');
$query->leftJoin('booking_event', 'e', 't.booking_eventid = e.eid'); $query->leftJoin('booking_event', 'e', 't.booking_eventid = e.eid');
@@ -69,8 +66,8 @@ function booking_variety_admin() {
*/ */
function booking_variety_timeslot_form($node, &$form_state, $create, $editid = 0) { function booking_variety_timeslot_form($node, &$form_state, $create, $editid = 0) {
global $event; global $event;
$form = array (); $form = array();
$prefix = "<p>Add a new variety session timeslot for the bookings module.</p>"; $prefix = t("<p>Add a new variety session timeslot for !event variety sessions.</p>", array('!event' => $event->booking_eventname));
if ($create == true) { if ($create == true) {
$data = $node; $data = $node;
@@ -217,7 +214,7 @@ function booking_variety_timeslot_form_submit($form, &$form_state) {
*/ */
function booking_variety_create_session_form($node, &$form_state, $create = TRUE, $timeslot_id = 0, $session_id = 0) { function booking_variety_create_session_form($node, &$form_state, $create = TRUE, $timeslot_id = 0, $session_id = 0) {
global $event; global $event;
$form = array (); $form = array();
$prefix = ""; $prefix = "";
//add this to the form in a hidden field so we can update the right event //add this to the form in a hidden field so we can update the right event
@@ -376,8 +373,8 @@ function booking_variety_create_session_form_submit($form, &$form_state) {
function booking_variety_list_session_form($node, &$form_state, $timeslot_id = 0) function booking_variety_list_session_form($node, &$form_state, $timeslot_id = 0)
{ {
global $event; global $event;
$form = array (); $form = array();
$options = array (); $options = array();
$data = $node; $data = $node;
//verify that $editid is a number //verify that $editid is a number