Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
frontend:colltab [2012/05/04 22:05] giancarlo |
frontend:colltab [2012/05/29 10:41] giancarlo |
====== Custom Collection tab title ====== | ====== Custom Collection tab title and info====== |
| |
Edit ''CollectionClass.inc'' in islandora module and change '''#title''' value: | Edit ''CollectionClass.inc'' in islandora module and change '''#title''' value: |
} | } |
$results = $this->getRelatedItems($this->pid, $query); | $results = $this->getRelatedItems($this->pid, $query); |
| |
$collection_items = $this->renderCollection($results, $this->pid, NULL, NULL, $page_number); | |
$collection_item = new Fedora_Item($this->pid); | |
// Check the form post to see if we are in the middle of an ingest operation. | |
$show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_ingest_form$ | |
$add_to_collection = $this->getIngestInterface(); | |
if (!$show_ingest_tab) { | |
$view_selected = true; | |
} | |
drupal_set_message(); | |
</code> | </code> |
<WRAP center tip 90%> | <wrap tip>Tip</wrap> |
| <WRAP prewrap center caution> |
<code php> | <code php> |
$tabset['view_tab'] = array( | $colleinfo = NULL; |
'#type' => 'tabpage', | if ($item->exists() && array_key_exists('INFO', $item->datastreams)) { |
// '#title' => 'View', | $colleinfo = $item->get_datastream_dissemination('INFO'); |
'#title' => $collection_item->objectProfile->objLabel, | } |
'#selected' => $view_selected, | $collection_items = $this->renderCollection($results, $this->pid, NULL, NULL, $page_number); |
'#content' => $collection_items | $collection_item = new Fedora_Item($this->pid); |
); | // Check the form post to see if we are in the middle of an ingest operation. |
| $show_ingest_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_ingest_form'); |
| $add_to_collection = $this->getIngestInterface(); |
| $view_selected = true; |
| $coll_selected = false; |
| $qstring = $_GET['q']; |
| $qparts = explode('/', $qstring); |
| $tail = end($qparts); |
| if ($tail == 'info') { |
| $view_selected = false; |
| $coll_selected = true; |
| } |
| drupal_set_message(); |
| $tabset['1'] = array('#type' => 'tabpage', '#title' => $collection_item->objectProfile->objLabel, '#selected' => $view_selected, '#content' => $collection_items, '#weight' => '1'); |
| if ($colleinfo != NULL) { |
| $tabset['2'] = array('#type' => 'tabpage', '#title' => 'Collection info', '#selected' => $coll_selected, '#content' => $colleinfo, '#weight' => '2'); |
| } |
</code> | </code> |
</WRAP> | </WRAP> |