Permalink
Browse files

Merge branch 'wip-MDL-36112-master' of git://github.com/abgreeve/moodle

  • Loading branch information...
2 parents 20aea2e + 24054bb commit 092977fb0b61ab273e5801e70fa498f3d8d835e3 @danpoltawski danpoltawski committed Nov 7, 2012
Showing with 7 additions and 4 deletions.
  1. +3 −3 mod/data/field/url/field.class.php
  2. +4 −1 mod/data/import.php
@@ -54,17 +54,17 @@ function display_add_field($recordid=0) {
$str .= '<table><tr><td align="right">';
$str .= get_string('url','data').':</td><td>';
$str .= '<label class="accesshide" for="' . $fieldid . '">'. $this->field->name .'</label>';
- $str .= '<input type="text" name="field_'.$this->field->id.'_0" id="'.$fieldid.'" value="'.$url.'" size="60" /></td></tr>';
+ $str .= '<input type="text" name="field_'.$this->field->id.'_0" id="'.$fieldid.'" value="'.$url.'" size="60" />';
+ $str .= '<button id="filepicker-button-'.$options->client_id.'" style="display:none">'.$straddlink.'</button></td></tr>';
$str .= '<tr><td align="right">'.get_string('text','data').':</td><td><input type="text" name="field_'.$this->field->id.'_1" id="field_'.$this->field->id.'_1" value="'.s($text).'" size="60" /></td></tr>';
$str .= '</table>';
} else {
// Just the URL field
$str .= '<label class="accesshide" for="' . $fieldid . '">'. $this->field->name .'</label>';
$str .= '<input type="text" name="field_'.$this->field->id.'_0" id="'.$fieldid.'" value="'.s($url).'" size="60" />';
+ $str .= '<button id="filepicker-button-'.$options->client_id.'" style="display:none">'.$straddlink.'</button>';
}
- $str .= '<button id="filepicker-button-'.$options->client_id.'" style="display:none">'.$straddlink.'</button>';
-
// print out file picker
//$str .= $OUTPUT->render($fp);
View
@@ -159,7 +159,10 @@
if (preg_match("/^(latlong|url)$/", $field->type)) {
$values = explode(" ", $value, 2);
$content->content = $values[0];
- $content->content1 = $values[1];
+ // The url field doesn't always have two values (unforced autolinking).
+ if (count($values) > 1) {
+ $content->content1 = $values[1];
+ }
} else {
$content->content = $value;
}

0 comments on commit 092977f

Please sign in to comment.