00001 <?php
00002
00015
00016
00017
00018 import('classes.plugins.ImportExportPlugin');
00019
00020 class SampleImportExportPlugin extends ImportExportPlugin {
00027 function register($category, $path) {
00028 $success = parent::register($category, $path);
00029
00030
00031 $this->addLocaleData();
00032
00033
00034
00035
00036
00037
00038 return false;
00039 }
00040
00046 function getName() {
00047
00048 return 'SampleImportExportPlugin';
00049 }
00050
00051 function getDisplayName() {
00052 return Locale::translate('plugins.importexport.sample.displayName');
00053 }
00054
00055 function getDescription() {
00056 return Locale::translate('plugins.importexport.sample.description');
00057 }
00058
00059 function display(&$args) {
00060 parent::display($args);
00061 switch (array_shift($args)) {
00062 case 'exportIssue':
00063
00064 break;
00065 default:
00066
00067 $journal = &Request::getJournal();
00068 $issueDao = &DAORegistry::getDAO('IssueDAO');
00069 $issues = &$issueDao->getIssues($journal->getJournalId(), Handler::getRangeInfo('issues'));
00070
00071 $templateMgr = &TemplateManager::getManager();
00072 $templateMgr->assign_by_ref('issues', $issues);
00073 $templateMgr->display($this->getTemplatePath() . 'issues.tpl');
00074 }
00075 }
00076
00081 function executeCLI($scriptName, &$args) {
00082 $this->usage($scriptName);
00083 }
00084
00088 function usage($scriptName) {
00089 echo "USAGE NOT AVAILABLE.\n"
00090 . "This is a sample plugin and does not actually perform a function.\n";
00091 }
00092 }
00093
00094 ?>