]> git.mjollnir.org Git - moodle.git/commitdiff
Tidying up the interface.
authorikawhero <ikawhero>
Fri, 12 Jan 2007 12:58:15 +0000 (12:58 +0000)
committerikawhero <ikawhero>
Fri, 12 Jan 2007 12:58:15 +0000 (12:58 +0000)
Fixed default data bug in menu type.

user/profile/field/menu/field.class.php
user/profile/index.php
user/profile/lib.php

index ca9733b896a02ed6059105f3d278c8cfe9ab0fa8..584e083e6d31995b0d754ebd3a3050dbfad14d21 100644 (file)
@@ -41,6 +41,7 @@ class profile_field_menu extends profile_field_base {
     }
 
     function save_data_preprocess($data) {
+
         if (!isset($this->options[$data])) { /// validate_data should already have caught this
             return '';
         } else {
@@ -60,7 +61,9 @@ class profile_field_menu extends profile_field_base {
 
     function edit_validate_specific($data) {
         $err = array();
-        
+
+        $data->param1 = str_replace("\r", '', $data->param1);
+
         /// Check that we have at least 2 options
         if (($options = explode("\n", $data->param1)) === false) {
             $err['param1'] = get_string('profilemenunooptions', 'admin');
@@ -73,6 +76,13 @@ class profile_field_menu extends profile_field_base {
         }
         return $err;        
     }
+
+    function edit_save_preprocess($data) {
+        $data->param1 = str_replace("\r", '', $data->param1);
+        
+        return $data;
+    }
+        
 }
 
 ?>
index 98f45f6cbc3d562bdef87a16477b951895f03ee5..3251a393002043c422f89ea34a1410b39293d437 100644 (file)
@@ -172,7 +172,7 @@ if ( ($action == 'editcategory' )) {
         } else {
 
             if ($id == 0) {
-                $strheading = get_string('profilecreatenewfield', 'admin');
+                $strheading = get_string('profilecreatenewfield', 'admin', $datatypes[$type]);
             } else {
                 $strheading = get_string('profileeditfield', 'admin', $field->name);
             }
index dff24522c26c8f8e9b1bc69dd7f3ac6d0b9e495a..e3e7e420bbf00e1d249bc474c377c24d62322c6e 100644 (file)
@@ -218,6 +218,8 @@ class profile_field_base {
         $choices[2] = get_string('profilevisibleall', 'admin');
         $form->addElement('select', 'visible', get_string('profilevisible', 'admin'), $choices);
         $form->setType('visible', PARAM_INT);
+        $form->setDefault('visible', 2);
+        $form->setHelpButton('visible', array('profilevisible', get_string('profilevisible','admin')));
 
         unset($choices);
         $choices = profile_list_categories();