removes unnecessary site iteration
This commit is contained in:
parent
9a4d3e2822
commit
3671b05828
|
@ -56,26 +56,18 @@ class ArchiveSiteMetaViewHelper extends AbstractHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCollections($sites){
|
public function getCollections($sites){
|
||||||
$collections = $this->omekaSettings->get('sitemeta_collections');
|
$sitemeta_collections = $this->omekaSettings->get('sitemeta_collections');
|
||||||
$collection_options = [];
|
$collections = [];
|
||||||
|
foreach ( explode("\n", $sitemeta_collections) as $value ) {
|
||||||
foreach ( explode("\n", $collections) as $value ) {
|
if ($value == "") {
|
||||||
$key_value = explode("=", str_replace(array("\r", "\n"), '',$value));
|
continue;
|
||||||
$collection_options[trim($key_value[1])] = trim($key_value[0]);
|
}
|
||||||
}
|
$key_value = explode("=", str_replace(array("\r", "\n"), '', $value));
|
||||||
//return $collections;
|
if ($key_value) {
|
||||||
//$site = $sites[0]->setting('sitemeta_collections');
|
$collections[trim($key_value[1])] = trim($key_value[0]);
|
||||||
//$collections = [];
|
|
||||||
$result = [];
|
|
||||||
foreach ($sites as $site) {
|
|
||||||
$settings = $this->getSiteMetaValues($site);
|
|
||||||
if ($settings && !in_array($settings['collection'], $result)) {
|
|
||||||
$name = $collection_options[$settings['collection']];
|
|
||||||
$result[$settings['collection']] = $name;
|
|
||||||
//array_push($collections, $settings['collection']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $collections;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPages()
|
public function getPages()
|
||||||
|
|
Loading…
Reference in New Issue