00001 <?php
00002
00015
00016
00017 class ImportExportPlugin extends Plugin {
00018 function ImportExportPlugin() {
00019 parent::Plugin();
00020 }
00021
00027 function getName() {
00028
00029 return 'ImportExportPlugin';
00030 }
00031
00037 function getDisplayName() {
00038
00039
00040 return 'Abstract Import/Export Plugin';
00041 }
00042
00046 function getDescription() {
00047 return 'This is the ImportExportPlugin base class. Its functions can be overridden by subclasses to provide import/export functionality for various formats.';
00048 }
00049
00056 function setBreadcrumbs($crumbs = array(), $isSubclass = false) {
00057 $templateMgr =& TemplateManager::getManager();
00058 $pageCrumbs = array(
00059 array(
00060 Request::url(null, null, 'user'),
00061 'navigation.user'
00062 ),
00063 array(
00064 Request::url(null, null, 'manager'),
00065 'user.role.manager'
00066 ),
00067 array (
00068 Request::url(null, null, 'manager', 'importexport'),
00069 'manager.importExport'
00070 )
00071 );
00072 if ($isSubclass) $pageCrumbs[] = array(
00073 Request::url(null, null, 'manager', 'importexport', array('plugin', $this->getName())),
00074 $this->getDisplayName(),
00075 true
00076 );
00077
00078 $templateMgr->assign('pageHierarchy', array_merge($pageCrumbs, $crumbs));
00079 }
00080
00085 function display(&$args) {
00086 $templateManager =& TemplateManager::getManager();
00087 $templateManager->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
00088 }
00089
00095 function executeCLI($scriptName, &$args) {
00096 $this->usage();
00097
00098 }
00099
00103 function usage($scriptName) {
00104
00105 }
00106
00110 function manage($verb, $args) {
00111 if ($verb === 'importexport') {
00112 Request::redirect(null, null, 'manager', 'importexport', array('plugin', $this->getName()));
00113 }
00114 return false;
00115 }
00116
00120 function smartyPluginUrl($params, &$smarty) {
00121 $path = array('plugin', $this->getName());
00122 if (is_array($params['path'])) {
00123 $params['path'] = array_merge($path, $params['path']);
00124 } elseif (!empty($params['path'])) {
00125 $params['path'] = array_merge($path, array($params['path']));
00126 } else {
00127 $params['path'] = $path;
00128 }
00129 return $smarty->smartyUrl($params, $smarty);
00130 }
00131
00132 }
00133 ?>