classes/plugins/ReportPlugin.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 class ReportPlugin extends Plugin {
00018    function ReportPlugin() {
00019       parent::Plugin();
00020    }
00021 
00027    function getName() {
00028       // This should not be used as this is an abstract class
00029       return 'ReportPlugin';
00030    }
00031 
00037    function getDisplayName() {
00038       // This name should never be displayed because child classes
00039       // will override this method.
00040       return 'Abstract Report Plugin';
00041    }
00042 
00046    function getDescription() {
00047       // This name should never be displayed because child classes
00048       // will override this method.
00049       return 'This is the ReportPlugin base class. Its functions can be overridden by subclasses to provide import/export functionality for various formats.';
00050    }
00051 
00058    function setBreadcrumbs($crumbs = array(), $isSubclass = false) {
00059       $templateMgr =& TemplateManager::getManager();
00060       $pageCrumbs = array(
00061          array(
00062             Request::url(null, null, 'user'),
00063             'navigation.user'
00064          ),
00065          array(
00066             Request::url(null, null, 'manager'),
00067             'user.role.manager'
00068          ),
00069          array (
00070             Request::url(null, null, 'manager', 'reports'),
00071             'manager.statistics.reports'
00072          )
00073       );
00074       if ($isSubclass) $pageCrumbs[] = array(
00075          Request::url(null, null, 'manager', 'reports', array('plugin', $this->getName())),
00076          $this->getDisplayName(),
00077          true
00078       );
00079 
00080       $templateMgr->assign('pageHierarchy', array_merge($pageCrumbs, $crumbs));
00081    }
00082 
00087    function display(&$args) {
00088       $templateManager =& TemplateManager::getManager();
00089       $templateManager->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
00090    }
00091 
00095    function getManagementVerbs() {
00096       $schedConf =& Request::getSchedConf();
00097       if ($schedConf) return array(
00098          array(
00099             'reports',
00100             __('manager.statistics.reports')
00101          )
00102       );
00103       else return array();
00104    }
00105 
00109    function manage($verb, $args) {
00110       if ($verb === 'reports') {
00111          Request::redirect(null, null, 'manager', 'report', $this->getName());
00112       }
00113       return false;
00114    }
00115 
00119    function smartyPluginUrl($params, &$smarty) {
00120       $path = array('plugin', $this->getName());
00121       if (is_array($params['path'])) {
00122          $params['path'] = array_merge($path, $params['path']);
00123       } elseif (!empty($params['path'])) {
00124          $params['path'] = array_merge($path, array($params['path']));
00125       } else {
00126          $params['path'] = $path;
00127       }
00128       return $smarty->smartyUrl($params, $smarty);
00129    }
00130 }
00131 
00132 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7