Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
BrowseBlockPlugin.inc.php
1 <?php
2 
16 import('lib.pkp.classes.plugins.BlockPlugin');
17 
24  return $this->getPluginPath() . '/settings.xml';
25  }
26 
31  function getDisplayName() {
32  return __('plugins.block.browse.displayName');
33  }
34 
38  function getDescription() {
39  return __('plugins.block.browse.description');
40  }
41 
47  function getContents($templateMgr, $request = null) {
48  $press = $request->getPress();
49 
50  // Provide a list of series to browse
51  $seriesDao = DAORegistry::getDAO('SeriesDAO');
52  $series = $seriesDao->getByPressId($press->getId());
53  $templateMgr->assign('browseSeries', $series);
54 
55  // Provide a list of categories to browse
56  $categoryDao = DAORegistry::getDAO('CategoryDAO');
57  $categories = $categoryDao->getByPressId($press->getId());
58  $templateMgr->assign('browseCategories', $categories);
59 
60  // If we're currently viewing a series or catalog, detect it
61  // so that we can highlight the current selection in the
62  // dropdown.
63 
64  switch ($request->getUserVar('type') ) {
65  case 'category':
66  $templateMgr->assign('browseBlockSelectedCategory', $request->getUserVar('path'));
67  break;
68  case 'series':
69  $templateMgr->assign('browseBlockSelectedSeries', $request->getUserVar('path'));
70  break;
71  }
72 
73  return parent::getContents($templateMgr);
74  }
75 }
76 
77 ?>
static & getDAO($name, $dbconn=null)
Class for browse block plugin.
getPluginPath()
Definition: Plugin.inc.php:324
getContents($templateMgr, $request=null)
Abstract class for block plugins.