3 * Gallery - a web based photo album viewer and editor
4 * Copyright (C) 2000-2007 Bharat Mediratta
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
22 * The implementation of the ItemAddEmbedVideo
23 * Supports ItemAddEmbedVideo
26 * @author Alan Pippin <apippin@pippins.net>
27 * @version $Revision: 1 $
29 class EmbedVideoModule extends GalleryModule {
31 function EmbedVideoModule() {
33 $this->setId('embedvideo');
34 $this->setName($gallery->i18n('Embed Video'));
35 $this->setDescription($gallery->i18n('Add embedded videos from the web'));
36 $this->setVersion('1.0.9');
37 $this->setGroup('import', $gallery->i18n('Import'));
38 $this->setCallbacks('getSiteAdminViews');
39 $this->setRequiredCoreApi(array(7, 3));
40 $this->setRequiredModuleApi(array(3, 0));
44 * @see GalleryModule::performFactoryRegistrations
46 function performFactoryRegistrations() {
48 $ret = GalleryCoreApi::registerFactoryImplementation(
49 'ItemAddPlugin', 'ItemAddEmbedVideo', 'ItemAddEmbedVideo',
50 'modules/embedvideo/ItemAddEmbedVideo.inc', 'embedvideo', null);
59 * @see GalleryModule::getSiteAdminViews
61 function getSiteAdminViews() {
62 return array(null, array(array('name' => $this->translate($this->getName()),
63 'view' => 'embedvideo.EmbedVideoSiteAdmin')));
67 * @see GalleryModule::upgrade
69 function upgrade($currentVersion) {
72 list ($ret, $params) =
73 GalleryCoreApi::fetchAllPluginParameters('module', 'embedvideo');
78 if (!isset($params['embedvideodefaultVariables'])) {
79 $ret = $this->setParameter('embedvideodefaultVariables',
82 '|useInternalFlvPlayer=true'.
83 '|useRemoteSize=false'.
84 '|youtubeShowRelated=false'.
85 '|watermarkVideos=true'
92 if (!isset($params['embedvideooverrideVariables'])) {
93 $ret = $this->setParameter('embedvideooverrideVariables', '');