Selaa lähdekoodia

Read-only mode for icon selector widget: display at least the icon.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3419 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 10 vuotta sitten
vanhempi
commit
43a0cadfc6
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 6 1
      application/forms.class.inc.php

+ 6 - 1
application/forms.class.inc.php

@@ -1205,14 +1205,19 @@ class DesignerIconSelectionField extends DesignerFormField
 		$sPostUploadTo = ($this->sUploadUrl == null) ? 'null' : "'{$this->sUploadUrl}'";
 		if (!$this->IsReadOnly())
 		{
+			$sValue = "<input type=\"hidden\" id=\"$sId\" name=\"$sName\" value=\"{$this->defaultValue}\"/>";
 			$oP->add_ready_script(
 <<<EOF
 	$('#$sId').icon_select({current_idx: $idx, items: $sJSItems, post_upload_to: $sPostUploadTo});
 EOF
 			);
 		}
+		else
+		{
+			$sValue = '<img src="'.$this->MakeFileUrl($this->defaultValue).'" />';
+		}
 		$sReadOnly = $this->IsReadOnly() ? 'disabled' : '';
-		return array('label' =>$this->sLabel, 'value' => "<input type=\"hidden\" id=\"$sId\" name=\"$sName\" value=\"{$this->defaultValue}\"/>");
+		return array('label' => $this->sLabel, 'value' => $sValue);
 	}
 }