Skip to content

Commit

Permalink
Merge branch 'wip-MDL-36112-master' of git://github.com/abgreeve/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Nov 7, 2012
2 parents 20aea2e + 24054bb commit 092977f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions mod/data/field/url/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 4 additions & 1 deletion mod/data/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 092977f

Please sign in to comment.