]> git.mjollnir.org Git - moodle.git/commitdiff
Additional settings for the custom profile fields
authorikawhero <ikawhero>
Wed, 15 Aug 2007 13:37:52 +0000 (13:37 +0000)
committerikawhero <ikawhero>
Wed, 15 Aug 2007 13:37:52 +0000 (13:37 +0000)
user/profile/definelib.php
user/profile/lib.php

index 60ff80baf2ce4fa824d52ec082b215a7c92c7be2..8dc42977d6a6ad8433645cf226843133a5f4c3c8 100644 (file)
@@ -38,6 +38,10 @@ class profile_define_base {
 
         $form->addElement('selectyesno', 'locked', get_string('profilelocked', 'admin'));
 
+        $form->addElement('selectyesno', 'forceunique', get_string('profileforceunique', 'admin'));
+        
+        $form->addElement('selectyesno', 'signup', get_string('profilesignup', 'admin'));
+
         $choices = array();
         $choices[PROFILE_VISIBLE_NONE]    = get_string('profilevisiblenone', 'admin');
         $choices[PROFILE_VISIBLE_PRIVATE] = get_string('profilevisibleprivate', 'admin');
@@ -470,4 +474,4 @@ function profile_edit_field($id, $datatype, $redirect) {
     }
 }
 
-?>
\ No newline at end of file
+?>
index bb0062776a5aa0396870e4727909d1f27bae6859..84ea1288ab36bc4733fb3963b3ff947f38a03223 100644 (file)
@@ -247,6 +247,23 @@ class profile_field_base {
         return (boolean)$this->field->locked;
     }
 
+    /**
+     * Check if the field data should be unique
+     * @return   boolean
+     */
+    function is_unique() {
+        return (boolean)$tihs->field->forceunique;
+    }
+
+    /**
+     * Check if the field should appear on the signup page
+     * @return   boolean
+     */
+    function is_signup_field() {
+        return (boolean)$this->field->signup;
+    }
+     
+
 } /// End of class definition