' .'
'; foreach ($FolderIds as $Id) { $Result .= getFolderTileHtml($LaunchId, $Id); } $Result .= '
'; return $Result; } /** * Get HTML for a folder. * @param string $LaunchId LTI Launch Id for this request. * @param int $FolderId Folder to display. * @return string HTML. */ function getFolderTileHtml(string $LaunchId, int $FolderId) { static $ViewFolderUrl = false; static $RFactory = false; if ($ViewFolderUrl === false) { $AF = ApplicationFramework::getInstance(); $ViewFolderUrl = $AF->baseUrl()."index.php" ."?P=P_EduLink_ViewFolder" ."&L=".$LaunchId; } if ($RFactory === false) { $RFactory = new RecordFactory(MetadataSchema::SCHEMAID_DEFAULT); } $Folder = new Folder($FolderId); $CoverImageId = $Folder->getCoverImageId(); $FolderNote = $Folder->note(); $ItemIds = RecordFactory::buildMultiSchemaRecordList( $Folder->getItemIds() ); $ResourceIds = $ItemIds[MetadataSchema::SCHEMAID_DEFAULT] ?? []; if (count($ResourceIds) > 0) { $ResourceIds = $RFactory->filterOutUnviewableRecords( $ResourceIds, User::getAnonymousUser() ); } $NumResources = count($ResourceIds); # use the tile set styles for layout # see Metavus.scss, look for the comment about 'TILE SET' $Result = '
' .'
' .'' .'
' .'
'; $Result .= "

### ".$Folder->name()."

"; if ($CoverImageId !== false) { $Image = new Image($CoverImageId); $Result .= $Image->getHtml("mv-image-thumbnail"); } if (strlen($FolderNote) > 0) { $Result .= "

".nl2br($FolderNote)."

"; } $Result .= "

".$NumResources." resource" .($NumResources >= 2 ? "s" : "")."

" .'
' .'
' .'
'; return $Result; } # ----- SETUP ---------------------------------------------------------------- if (!isset($H_FolderIds)) { throw new Exception("H_FolderIds not defined."); } if (!isset($H_LaunchId)) { throw new Exception("H_LaunchId not defined."); } if (!isset($H_OwnerId)) { throw new Exception("H_LaunchId not defined."); } $AF = ApplicationFramework::getInstance(); $Plugin = EduLink::getInstance(); $SelectPublisherUrl = $AF->baseUrl() ."index.php?P=P_EduLink_SelectPublisher&L=".$H_LaunchId; # ----- DISPLAY -------------------------------------------------------------- include($AF->gUIFile("EduLink-StdPageStart.html")); if (isset($H_Error)) { print "
" ."

ERROR: ".$H_Error."

" ."
"; include($AF->gUIFile("EduLink-StdPageEnd.html")); return; } if (count($H_FolderIds) == 0) { $IntConfig = InterfaceConfiguration::getInstance(); print "

You have no folders that contain publicly visible resources.

" ."

Visit " .$IntConfig->getString("PortalName")."" ." to create and manage folders.

" ."

You can also return to " ."Select Resources" ." to incorporate resources individually.

"; include($AF->gUIFile("EduLink-StdPageEnd.html")); return; } ?>

## Collections from getBestName() ?>

gUIFile("EduLink-StdPageEnd.html"));