diff --git a/module/VuFind/src/VuFind/Controller/AbstractRecord.php b/module/VuFind/src/VuFind/Controller/AbstractRecord.php index 28fcf35d3bde9967b0d6d17020b51107d6587193..260c21a81ca2de71a261c4e08fc8c91972b09e44 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractRecord.php +++ b/module/VuFind/src/VuFind/Controller/AbstractRecord.php @@ -222,6 +222,19 @@ class AbstractRecord extends AbstractBase return $this->showTab($this->params()->fromRoute('tab', $this->defaultTab)); } + /** + * AJAX tab action -- render a tab without surrounding context. + * + * @return mixed + */ + public function ajaxtabAction() + { + $this->loadRecord(); + return $this->showTab( + $this->params()->fromPost('tab', $this->defaultTab), true + ); + } + /** * ProcessSave -- store the results of the Save action. * @@ -529,11 +542,12 @@ class AbstractRecord extends AbstractBase /** * Display a particular tab. * - * @param string $tab Name of tab to display + * @param string $tab Name of tab to display + * @param bool $ajax Are we in AJAX mode? * * @return mixed */ - protected function showTab($tab) + protected function showTab($tab, $ajax = false) { // Special case -- handle login request (currently needed for holdings // tab when driver-based holds mode is enabled, but may also be useful @@ -559,7 +573,7 @@ class AbstractRecord extends AbstractBase $view->scrollData = $this->resultScroller()->getScrollData($driver); } - $view->setTemplate('record/view'); + $view->setTemplate($ajax ? 'record/ajaxtab' : 'record/view'); return $view; } } \ No newline at end of file diff --git a/themes/blueprint/templates/record/ajaxtab.phtml b/themes/blueprint/templates/record/ajaxtab.phtml new file mode 100644 index 0000000000000000000000000000000000000000..6f7d520981ebef08a220bd6ef46f1afaf76ecd02 --- /dev/null +++ b/themes/blueprint/templates/record/ajaxtab.phtml @@ -0,0 +1,7 @@ +<? +foreach ($this->tabs as $tab => $obj) { + if (strtolower($this->activeTab) == strtolower($tab)) { + echo $this->record($this->driver)->getTab($obj); + } +} +?> \ No newline at end of file diff --git a/themes/jquerymobile/templates/record/ajaxtab.phtml b/themes/jquerymobile/templates/record/ajaxtab.phtml new file mode 100644 index 0000000000000000000000000000000000000000..6f7d520981ebef08a220bd6ef46f1afaf76ecd02 --- /dev/null +++ b/themes/jquerymobile/templates/record/ajaxtab.phtml @@ -0,0 +1,7 @@ +<? +foreach ($this->tabs as $tab => $obj) { + if (strtolower($this->activeTab) == strtolower($tab)) { + echo $this->record($this->driver)->getTab($obj); + } +} +?> \ No newline at end of file