CMS MADE SIMPLE FORGE

LISE

 

[#12497] LISEInstanceItem RenderforAdminListing

avatar
Created By: Darren Kierman (kierweb)
Date Submitted: 2021-11-18 07:50

Assigned To: Fernando Morgado (JoMorg)
Resolution: None
State: Open
Summary:
LISEInstanceItem RenderforAdminListing
Detailed Description:
If you select a LISE Instance Item in "Display these fields in item overview:" -
rather than seeing the Title of the selected Instance Item you only get either
the item_id or alias displaying which to a user means nothing ....

But if you add the following function code to the
"lib/fielddefs/LISEInstanceItem/lisefd.LISEInstanceItem.php" file it will grab
the title of the Instance Item and display that instead ...

	public function RenderForAdminListing($id, $returnid)

	{

		// Check if we have value.

		if(!$this->HasValue())

			return;

		$instance = $this->GetOptionValue('instance');
		
		$identifier = $this->GetOptionValue('identifier', 'item_id');

		$items = $this->GetOptionValue('value');
		
		$mod = cmsms()->GetModuleInstance($instance);

		$output = "";
	   
		foreach($this->value as $item) {
			$obj = $mod->LoadItemByIdentifier($identifier, $item);
			$output .= $obj->title;
			if (next($this->value) == true) $output .= ", ";
		}
		
		return $output;		

	}

History