00001 <?php
00002
00015
00016
00017
00018 class ImportExportPlugin extends Plugin {
00024 function getName() {
00025
00026 return 'ImportExportPlugin';
00027 }
00028
00034 function getDisplayName() {
00035
00036
00037 return 'Abstract Import/Export Plugin';
00038 }
00039
00043 function getDescription() {
00044 return 'This is the ImportExportPlugin base class. Its functions can be overridden by subclasses to provide import/export functionality for various formats.';
00045 }
00046
00053 function setBreadcrumbs($crumbs = array(), $isSubclass = false) {
00054 $templateMgr = &TemplateManager::getManager();
00055 $pageCrumbs = array(
00056 array(
00057 Request::url(null, 'user'),
00058 'navigation.user'
00059 ),
00060 array(
00061 Request::url(null, 'manager'),
00062 'user.role.manager'
00063 ),
00064 array (
00065 Request::url(null, 'manager', 'importexport'),
00066 'manager.importExport'
00067 )
00068 );
00069 if ($isSubclass) $pageCrumbs[] = array(
00070 Request::url(null, 'manager', 'importexport', array('plugin', $this->getName())),
00071 $this->getDisplayName(),
00072 true
00073 );
00074
00075 $templateMgr->assign('pageHierarchy', array_merge($pageCrumbs, $crumbs));
00076 }
00077
00082 function display(&$args) {
00083 $templateManager =& TemplateManager::getManager();
00084 $templateManager->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
00085 }
00086
00092 function executeCLI($scriptName, &$args) {
00093 $this->usage();
00094
00095 }
00096
00100 function usage($scriptName) {
00101
00102 }
00103
00107 function getManagementVerbs() {
00108 return array(
00109 array(
00110 'importexport',
00111 Locale::translate('manager.importExport')
00112 )
00113 );
00114 }
00115
00119 function manage($verb, $args) {
00120 if ($verb === 'importexport') {
00121 Request::redirect(null, 'manager', 'importexport', array('plugin', $this->getName()));
00122 }
00123 return false;
00124 }
00125
00129 function smartyPluginUrl($params, &$smarty) {
00130 $path = array('plugin', $this->getName());
00131 if (is_array($params['path'])) {
00132 $params['path'] = array_merge($path, $params['path']);
00133 } elseif (!empty($params['path'])) {
00134 $params['path'] = array_merge($path, array($params['path']));
00135 } else {
00136 $params['path'] = $path;
00137 }
00138 return $smarty->smartyUrl($params, $smarty);
00139 }
00140
00141 }
00142 ?>