forked from ERM-HD/issnimporter.ontowiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IssnimporterPlugin.php
51 lines (47 loc) · 1.58 KB
/
IssnimporterPlugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* This file is part of the {@link http://amsl.technology amsl} project.
*
* @author Norman Radtke
* @copyright Copyright (c) 2015, {@link http://ub.uni-leipzig.de Leipzig University Library}
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
*/
/**
* The main class for the basicimporter plugin.
*
* @category OntoWiki
* @package Extensions_Issnimporter
* @author Norman Radtke <[email protected]>
* @author Sebastian Tramp <[email protected]>
*/
class IssnimporterPlugin extends OntoWiki_Plugin
{
/*
* our event method
*/
public function onProvideImportActions($event)
{
$this->provideImportActions($event);
}
/*
* here we add new import actions
*/
private function provideImportActions($event)
{
$translate = OntoWiki::getInstance()->translate;
$myImportActions = array(
'issnimporter-titlelist' => array(
'controller' => 'issnimporter',
'action' => 'titlelistimport',
'label' => $translate->translate('Import a titlelist with csv upload'),
'description' => 'Imports a CSV file title list of different formatting (e.g. KBART).'
)
);
// sad but true, some php installation do not allow this
if (!ini_get('allow_url_fopen')) {
unset($myImportActions['basicimporter-rdfwebimport']);
}
$event->importActions = array_merge($event->importActions, $myImportActions);
return $event;
}
}