| 1 | # -*- coding: utf-8 -*- |
|---|
| 2 | ## |
|---|
| 3 | ## $id$ |
|---|
| 4 | ## |
|---|
| 5 | ## This file is part of CDS Indico. |
|---|
| 6 | ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. |
|---|
| 7 | ## |
|---|
| 8 | ## CDS Indico is free software; you can redistribute it and/or |
|---|
| 9 | ## modify it under the terms of the GNU General Public License as |
|---|
| 10 | ## published by the Free Software Foundation; either version 2 of the |
|---|
| 11 | ## License, or (at your option) any later version. |
|---|
| 12 | ## |
|---|
| 13 | ## CDS Indico is distributed in the hope that it will be useful, but |
|---|
| 14 | ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 16 | ## General Public License for more details. |
|---|
| 17 | ## |
|---|
| 18 | ## You should have received a copy of the GNU General Public License |
|---|
| 19 | ## along with CDS Indico; if not, write to the Free Software Foundation, Inc., |
|---|
| 20 | ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 21 | |
|---|
| 22 | from indico.core.api import Component |
|---|
| 23 | from indico.core.api.conference import ITimetableContributor |
|---|
| 24 | from MaKaC.plugins.base import Observable |
|---|
| 25 | import zope.interface |
|---|
| 26 | |
|---|
| 27 | class ImporterContributor(Component, Observable): |
|---|
| 28 | """ |
|---|
| 29 | Adds interface extension to event's timetable modification websites. |
|---|
| 30 | """ |
|---|
| 31 | |
|---|
| 32 | zope.interface.implements(ITimetableContributor) |
|---|
| 33 | |
|---|
| 34 | @classmethod |
|---|
| 35 | def includeTimetableJSFiles(cls, obj, params = {}): |
|---|
| 36 | """ |
|---|
| 37 | Includes additional javascript file. |
|---|
| 38 | """ |
|---|
| 39 | params['paths'].append("importer/js/importer.js") |
|---|
| 40 | |
|---|
| 41 | @classmethod |
|---|
| 42 | def includeTimetableCSSFiles(cls, obj, params = {}): |
|---|
| 43 | """ |
|---|
| 44 | Includes additional Css files. |
|---|
| 45 | """ |
|---|
| 46 | params['paths'].append("importer/importer.css") |
|---|
| 47 | |
|---|
| 48 | @classmethod |
|---|
| 49 | def customTimetableLinks(cls, obj, params = {}): |
|---|
| 50 | """ |
|---|
| 51 | Inserts an "Import" link in a timetable header. |
|---|
| 52 | """ |
|---|
| 53 | params.update({"Import" : "createImporterDialog"}) |
|---|