00001 <?php
00002
00015
00016
00017
00018 class ReportPlugin extends Plugin {
00024 function getName() {
00025
00026 return 'ReportPlugin';
00027 }
00028
00034 function getDisplayName() {
00035
00036
00037 return 'Abstract Report Plugin';
00038 }
00039
00043 function getDescription() {
00044
00045
00046 return 'This is the ReportPlugin base class. Its functions can be overridden by subclasses to provide import/export functionality for various formats.';
00047 }
00048
00055 function setBreadcrumbs($crumbs = array(), $isSubclass = false) {
00056 $templateMgr = &TemplateManager::getManager();
00057 $pageCrumbs = array(
00058 array(
00059 Request::url(null, 'user'),
00060 'navigation.user'
00061 ),
00062 array(
00063 Request::url(null, 'manager'),
00064 'user.role.manager'
00065 ),
00066 array (
00067 Request::url(null, 'manager', 'reports'),
00068 'manager.statistics.reports'
00069 )
00070 );
00071 if ($isSubclass) $pageCrumbs[] = array(
00072 Request::url(null, 'manager', 'reports', array('plugin', $this->getName())),
00073 $this->getDisplayName(),
00074 true
00075 );
00076
00077 $templateMgr->assign('pageHierarchy', array_merge($pageCrumbs, $crumbs));
00078 }
00079
00084 function display(&$args) {
00085 $templateManager =& TemplateManager::getManager();
00086 $templateManager->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
00087 }
00088
00092 function getManagementVerbs() {
00093 return array(
00094 array(
00095 'reports',
00096 Locale::translate('manager.statistics.reports')
00097 )
00098 );
00099 }
00100
00104 function manage($verb, $args) {
00105 if ($verb === 'reports') {
00106 Request::redirect(null, 'manager', 'report', $this->getName());
00107 }
00108 return false;
00109 }
00110
00114 function smartyPluginUrl($params, &$smarty) {
00115 $path = array('plugin', $this->getName());
00116 if (is_array($params['path'])) {
00117 $params['path'] = array_merge($path, $params['path']);
00118 } elseif (!empty($params['path'])) {
00119 $params['path'] = array_merge($path, array($params['path']));
00120 } else {
00121 $params['path'] = $path;
00122 }
00123 return $smarty->smartyUrl($params, $smarty);
00124 }
00125 }
00126
00127 ?>