From d04c00fd50a17deff314de48ac1fd23ecfde1c16 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Fri, 7 Jun 2013 10:29:07 -0300 Subject: [PATCH] Use the utility function as opposed to re-defining a query. --- includes/content_model.autocomplete.inc | 28 +++---------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/includes/content_model.autocomplete.inc b/includes/content_model.autocomplete.inc index c6fd34df..67923e9e 100644 --- a/includes/content_model.autocomplete.inc +++ b/includes/content_model.autocomplete.inc @@ -28,37 +28,15 @@ function islandora_content_model_autocomplete($string) { * Gets a map of form names suitable for use as select #options. */ function islandora_get_content_model_names() { - $results = islandora_query_content_models(); + module_load_include('inc', 'islandora', 'includes/utilities'); + $results = islandora_get_content_models(); $ret = array(); foreach ($results as $result) { - $ret[$result['model']['value']] = "{$result['label']['value']} ({$result['model']['value']})"; + $ret[$result['pid']] = "{$result['label']} ({$result['pid']})"; } return $ret; } -/** - * Perform a resource index query to determine get a list of content models. - * - * Only returns content models with at least one subscribing object. - * - * @return array - * An array of RI results, as given by the Tuque RI query interface. - */ -function islandora_query_content_models() { - $connection = islandora_get_tuque_connection(); - if ($connection) { - $query = 'select $model $label from <#ri> where - $model and $model $label - minus $model - minus $model - minus $model - minus $model '; - $results = $connection->repository->ri->itqlQuery($query); - return $results; - } - return array(); -} - /** * Minor array transformation. *