CMS MADE SIMPLE FORGE

LISE

 

[#12390] Dropdown RenderForAdminListing Function

avatar
Created By: Victor Avgust (Vavgust)
Date Submitted: 2020-11-20 15:32

Assigned To: Fernando Morgado (JoMorg)
Resolution: None
State: Open
Summary:
Dropdown RenderForAdminListing Function
Detailed Description:
It would be great to display Dropdown option Name instead or to addition to
Value (as it's now).
I've added function RenderForAdminListing to
modules/LISE/lib/fielddefs/Dropdown/lisefd.Dropdown.php

	public function RenderForAdminListing($id, $returnid)
	{
		$value = parent::RenderForAdminListing($id, $returnid);

		$options = $this->GetOptionValue('options');
		$options = explode("\n", $options);
		foreach($options as $option) {
		
			$option = explode("=", $option, 2);
			if(count($option) > 1) {
				if (trim($option[1]) == $value) {
					return trim($option[0]) . " (".trim($option[1]).")";
				}
			}
		}
		
		return $value;
	}

History