Revision: 1514
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1514&view=rev
Author:   jberanek
Date:     2010-10-19 08:36:05 +0000 (Tue, 19 Oct 2010)

Log Message:
-----------
* Renamed the new config array $mandatory_fields to $is_mandatory_field
 to match the existing convention. Also added some documentation of
 this new configuration option into systemdefaults.inc.php.

Modified Paths:
--------------
    mrbs/trunk/INSTALL
    mrbs/trunk/web/edit_entry.php
    mrbs/trunk/web/edit_entry_handler.php
    mrbs/trunk/web/systemdefaults.inc.php

Modified: mrbs/trunk/INSTALL
===================================================================
--- mrbs/trunk/INSTALL  2010-10-18 16:44:06 UTC (rev 1513)
+++ mrbs/trunk/INSTALL  2010-10-19 08:36:05 UTC (rev 1514)
@@ -226,7 +226,7 @@
 user specifies a value for a field that may be empty, like a text box
 or a selection, as in 1) above. For example:
 
-$mandatory_fields['entry.conference_facilities'] = true;
+$is_mandatory_field['entry.conference_facilities'] = true;
 
 would define the 'conference_facilities' custom field to be mandatory.
 In the case of a select field, this adds an empty value to the dropdown

Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php       2010-10-18 16:44:06 UTC (rev 1513)
+++ mrbs/trunk/web/edit_entry.php       2010-10-19 08:36:05 UTC (rev 1514)
@@ -424,10 +424,10 @@
   }
   
   <?php
-  if (count($mandatory_fields))
+  if (count($is_mandatory_field))
   {
     $m_fields = array();
-    foreach ($mandatory_fields as $field => $value)
+    foreach ($is_mandatory_field as $field => $value)
     {
       if ($value)
       {
@@ -918,8 +918,8 @@
         // Output a select box if they want one
         elseif (count($select_options["entry.$key"]) > 0)
         {
-          $mandatory = (array_key_exists("entry.$key", $mandatory_fields) &&
-                        $mandatory_fields["entry.$key"]) ? true : false;
+          $mandatory = (array_key_exists("entry.$key", $is_mandatory_field) &&
+                        $is_mandatory_field["entry.$key"]) ? true : false;
           generate_select($label_text, $var_name, $value,
                           $select_options["entry.$key"], $mandatory);
         }

Modified: mrbs/trunk/web/edit_entry_handler.php
===================================================================
--- mrbs/trunk/web/edit_entry_handler.php       2010-10-18 16:44:06 UTC (rev 
1513)
+++ mrbs/trunk/web/edit_entry_handler.php       2010-10-19 08:36:05 UTC (rev 
1514)
@@ -249,9 +249,9 @@
   print_footer(TRUE);
 }
 
-if (count($mandatory_fields))
+if (count($is_mandatory_field))
 {
-  foreach ($mandatory_fields as $field => $value)
+  foreach ($is_mandatory_field as $field => $value)
   {
     $field = preg_replace('/^entry\./', '', $field);
     if ($value && ($custom_fields[$field] == ''))

Modified: mrbs/trunk/web/systemdefaults.inc.php
===================================================================
--- mrbs/trunk/web/systemdefaults.inc.php       2010-10-18 16:44:06 UTC (rev 
1513)
+++ mrbs/trunk/web/systemdefaults.inc.php       2010-10-19 08:36:05 UTC (rev 
1514)
@@ -499,7 +499,11 @@
 //     - Entry table: name, description and custom fields
 //     - Users table: custom fields
 
+// You can define custom entry fields to be mandatory by setting
+// items in the array $is_mandatory_field. For example:
 
+// $is_mandatory_field['entry.coffee_required'] = true;
+
  
 /***********************************************
  * Authentication settings - read AUTHENTICATION


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to