Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/user/profile/field/text/field.class.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class profile_field_text extends profile_field_base {
00004 
00008     function display_data() {
00010         $data = parent::display_data();
00011 
00013         if (!empty($this->field->param4) and !empty($data)) {
00014 
00016             if (! empty($this->field->param5)) {
00017                 $target = 'target="'.$this->field->param5.'"';
00018             } else {
00019                 $target = '';
00020             }
00021 
00023             $data = '<a href="'.str_replace('$$', urlencode($data), $this->field->param4).'" '.$target.'>'.htmlspecialchars($data).'</a>';
00024         }
00025 
00026         return $data;
00027     }
00028 
00029     function edit_field_add(&$mform) {
00030         $size = $this->field->param1;
00031         $maxlength = $this->field->param2;
00032         $fieldtype = ($this->field->param3 == 1 ? 'password' : 'text');
00033 
00035         $mform->addElement($fieldtype, $this->inputname, format_string($this->field->name), 'maxlength="'.$maxlength.'" size="'.$size.'" ');
00036         $mform->setType($this->inputname, PARAM_MULTILANG);
00037     }
00038 
00039 }
00040 
00041 
 All Data Structures Namespaces Files Functions Variables Enumerations