mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
Hide contributors with display-seq == 0
This commit is contained in:
parent
f8da23ab9d
commit
628d467d3f
1 changed files with 13 additions and 8 deletions
|
@ -194,6 +194,7 @@ class Ebook{
|
||||||
if($contributor->attributes() !== null){
|
if($contributor->attributes() !== null){
|
||||||
$id = $contributor->attributes()->id;
|
$id = $contributor->attributes()->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($xml->xpath('/package/metadata/meta[@property="role"][@refines="#' . $id . '"]') ?: [] as $role){
|
foreach($xml->xpath('/package/metadata/meta[@property="role"][@refines="#' . $id . '"]') ?: [] as $role){
|
||||||
$c = new Contributor(
|
$c = new Contributor(
|
||||||
(string)$contributor,
|
(string)$contributor,
|
||||||
|
@ -202,16 +203,20 @@ class Ebook{
|
||||||
$this->NullIfEmpty($xml->xpath('/package/metadata/meta[@property="se:url.encyclopedia.wikipedia"][@refines="#' . $id . '"]'))
|
$this->NullIfEmpty($xml->xpath('/package/metadata/meta[@property="se:url.encyclopedia.wikipedia"][@refines="#' . $id . '"]'))
|
||||||
);
|
);
|
||||||
|
|
||||||
if($role == 'trl'){
|
// A display-sequence of 0 indicates that we don't want to process this contributor
|
||||||
$this->Translators[] = $c;
|
$displaySequence = $this->NullIfEmpty($xml->xpath('/package/metadata/meta[@property="display-seq"][@refines="#' . $id . '"]'));
|
||||||
}
|
if($displaySequence !== '0'){
|
||||||
|
if($role == 'trl'){
|
||||||
|
$this->Translators[] = $c;
|
||||||
|
}
|
||||||
|
|
||||||
if($role == 'ill'){
|
if($role == 'ill'){
|
||||||
$this->Illustrators[] = $c;
|
$this->Illustrators[] = $c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($role == 'ctb'){
|
if($role == 'ctb'){
|
||||||
$this->Contributors[] = $c;
|
$this->Contributors[] = $c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue