pid = $pid; $this->item = new Fedora_Item($pid); } } public function showFieldSets() { module_load_include('inc', 'fedora_repository', 'plugins/tagging_form'); module_load_include('inc', 'fedora_repository', 'plugins/DarwinCore'); module_load_include('module', 'islandora_book'); global $base_url; $show_purge_tab = (!empty($_POST['form_id']) && ($_POST['form_id'] == 'islandora_book_purge_pages_form')); $first_page = new Fedora_Item($this->pid . '-0001'); $hasPage = $first_page->exists(); $tabset = array(); global $user; $qs = ''; if ($user->uid != 0) { $qs = '?uid=' . base64_encode($user->name . ':' . $user->pass); } $viewer_url = variable_get('fedora_base_url', '') . '/get/' . $this->pid . '/islandora:viewerSdef/getViewer' . $qs; $html = ''; $pages_selected = FALSE; $pagina_selected = FALSE; $libro_selected = FALSE; if ($hasPage) { $libropid = $this->pid; $paginapid = $this->pid . '-0001'; $numeropagina = '0001'; $libro_selected = TRUE; } else { $libropid = substr($this->pid, 0, -5); $paginapid = $this->pid; $numeropagina = substr($this->pid, -4); $pagina_selected = TRUE; } $size = 20; $page_number = floor(($numeropagina - 1) / $size) + 1; $qstring = $_GET['q']; $qparts = explode('/', $qstring); $tail = end($qparts); if (is_numeric($tail)) { $pages_selected = TRUE; $pagina_selected = FALSE; $libro_selected = FALSE; $page_number = $tail; } $class = new CollectionClass(); // grow default (1000) risearch limit to 2000 $results = $class->getRelatedItems($libropid,NULL,2000); $page_items = $class->renderCollection($results, $paginapid, NULL, NULL, $page_number); $book_contenuto = islandora_book_create_book_view($libropid); $titololibro = substr(strstr(strstr($book_contenuto, "title"), "creator", TRUE), 31); drupal_set_title("$titololibro"); $stringhe = islandora_book_create_book_index($libropid); $indice_html = $stringhe[0]; $colleinfo_html = $stringhe[1]; $bookinfo_html = $stringhe[2]; $tabset['1'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', '#title' => 'BOOK', '#content' => $book_contenuto, '#selected' => $libro_selected, '#weight' => '1',); $tabset['2'] = array('#type' => 'tabpage', '#title' => t('Read'), '#content' => $html, '#weight' => '2',); $tabset['3'] = array( // #type and #title are the minimum requirements. '#type' => 'tabpage', '#title' => 'Index', // '#content' => islandora_book_create_book_index($libropid), '#content' => $indice_html, '#weight' => '3',); $tabset['4'] = array('#type' => 'tabpage', '#title' => t('Pages'), '#selected' => $pages_selected, '#content' => $page_items, '#weight' => '4',); $tabset['5'] = array('#type' => 'tabpage', '#title' => 'PAGE ' . substr($paginapid, -4), '#content' => islandora_book_create_book_view($paginapid), '#selected' => $pagina_selected, '#weight' => '5',); $tabset['6'] = array('#type' => 'tabpage', '#title' => 'Book info', '#content' => $bookinfo_html, '#weight' => '6',); $tabset['7'] = array('#type' => 'tabpage', '#title' => 'Collection info', '#content' => $colleinfo_html, '#weight' => '7',); return $tabset; } }