18.10.2016 Views

Drupal 7 Module Development

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6<br />

'fieldable' => TRUE,<br />

'entity keys' => array(<br />

'id' => 'aid',<br />

'revision' => 'vid',<br />

'bundle' => 'type',<br />

'label' => 'title',<br />

),<br />

'bundle keys' => array(<br />

'bundle' => 'type',<br />

),<br />

'static cache' => TRUE,<br />

'bundles' => array(),<br />

'view modes' => array(<br />

'full' => array(<br />

'label' => t('Full content'),<br />

'custom settings' => FALSE,<br />

),<br />

'teaser' => array(<br />

'label' => t('Teaser'),<br />

'custom settings' => FALSE,<br />

),<br />

),<br />

);<br />

foreach (artwork_types() as $type => $info) {<br />

$return['artwork']['bundles'][$type] = array(<br />

'label' => $info->name,<br />

'admin' => array(<br />

'path' => 'admin/structure/artworks/manage/%artwork_type',<br />

'real path' => 'admin/structure/artworks/manage/' .<br />

str_replace('_', '-', $type),<br />

'bundle argument' => 4,<br />

'access arguments' => array('administer artworks'),<br />

),<br />

);<br />

}<br />

return $return;<br />

}<br />

[ 157 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!