diff --git a/app/templates/People/fields-nav.inc b/app/templates/People/fields-nav.inc index cf904e33d..5ee314e2f 100644 --- a/app/templates/People/fields-nav.inc +++ b/app/templates/People/fields-nav.inc @@ -26,6 +26,8 @@ */ // XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc + +// Output for $topLinks from this specific configuration is presented in the Person canvas "Actions" menu. $topLinks = [ [ 'icon' => 'history', @@ -37,8 +39,62 @@ $topLinks = [ '?' => [ 'person_id' => $vv_obj->id ] - ], - 'class' => '' + ] + ] +]; + +// $addMenuLinks is also given slightly different treatment from the typical $topLinks found in most views: +// it is a page-global menu used for adding MVEAs to the person canvas and is given special treatment in +// element/personCanvas.php. +$addMenuLinks = [ + [ + 'controller' => 'names', + 'action' => 'add', + 'icon' => 'account_box', + 'iconClass' => 'material-icons-outlined' + ], + [ + 'controller' => 'email_addresses', + 'action' => 'add', + 'icon' => 'email', + 'iconClass' => 'material-icons-outlined' + ], + [ + 'controller' => 'identifiers', + 'action' => 'add', + 'icon' => 'fingerprint' + ], + [ + 'controller' => 'ad_hoc_attributes', + 'action' => 'add', + 'icon' => 'check_box', + 'iconClass' => 'material-icons-outlined' + ], + [ + 'controller' => 'addresses', + 'action' => 'add', + 'icon' => 'contact_mail', + 'iconClass' => 'material-icons-outlined' + ], + [ + 'controller' => 'history_records', + 'action' => 'add', + 'icon' => 'history' + ], + [ + 'controller' => 'pronouns', + 'action' => 'add', + 'icon' => 'transgender' + ], + [ + 'controller' => 'telephone_numbers', + 'action' => 'add', + 'icon' => 'phone' + ], + [ + 'controller' => 'urls', + 'action' => 'add', + 'icon' => 'link' ] ]; diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php index 3f84dd449..b1c2e2c3e 100644 --- a/app/templates/Standard/add-edit-view.php +++ b/app/templates/Standard/add-edit-view.php @@ -71,6 +71,10 @@ if(!empty($subnav)) { // Include the $flashArgs for the subnavigation element $subnav['flashArgs'] = $flashArgs; + if(!empty($topLinks) && ($modelsName == 'People' && $vv_action == 'edit')) { + // We are in Person canvas mode: pass along the top links for building the Actions menu. + $subnav['topLinks'] = $topLinks; + } // Generate the subnavigation title and tabs print $this->element('subnavigation', $subnav); } @@ -79,53 +83,10 @@ id; - } + // The person canvas has $addMenuLinks defined in templates/People/fields-nav.inc config. + print $this->element('personCanvas', ['vv_add_menu_links' => $addMenuLinks]); ?> -