Commits

Christoph Mewes committed deeb103

removed 0.7 stuff, made 0.8 compatible

Comments (0)

Files changed (22)

assets/zend_framework.css

-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-.sly-form-row label[for="installation"] {
-	display: none;
-}
-
-#installation {
-	padding-left: 0;
-}
-
-.wv3-status {
-	margin: 0 10px 5px;
-
-	dd {
-		margin-left: 20px;
-		margin-bottom: 10px;
-	}
-
-	dd.install-type {
-		background: url(user.png) left center no-repeat;
-		padding-left: 20px;
-
-		&.addon  { background-image: url(addon.png);  }
-		&.system { background-image: url(system.png); }
-	}
-}
 WV3_ZendManager::init();
 
 $dispatcher = sly_Core::dispatcher();
-$dispatcher->register('ADDONS_INCLUDED',   array('WV3_Helper', 'initMenu'));
 $dispatcher->register('SLY_ADDONS_LOADED', array('WV3_Helper', 'initMenu'));
     "type": "sallycms-addon",
     "require": {
         "sallycms/composer-installer": "~1.1",
-        "sallycms/sallycms": ">=0.6,<0.8",
+        "sallycms/sallycms": ">=0.7,<0.9",
         "webvariants/developer-utils": "~5.1"
     },
     "autoload": {
         "psr-0": {
-            "": "lib/"
-        }
+            "WV3_": "lib/",
+            "sly_Controller_": "lib/"
+        },
+        "classmap": [
+            "lib/vendor/"
+        ]
     },
     "extra": {
         "sallycms": {
-            "version": "2.6.x-dev"
+            "version": "2.x-dev"
         },
         "branch-alias": {
             "dev-default": "2.x-dev"

config.inc.php

-<?php
-require dirname(__FILE__).'/boot.php';

lib/WV3/ZendManager.php

 	}
 
 	public static function getInternalDirectory() {
-		if (sly_Core::getVersion('X.Y') === '0.6') {
-			$path = sly_Service_Factory::getAddOnService()->internalFolder('zend_framework');
-		}
-		else {
-			$path = sly_Service_Factory::getAddOnService()->internalDirectory('webvariants/zend-framework');
-		}
-
+		$path = sly_Service_Factory::getAddOnService()->internalDirectory('webvariants/zend-framework');
 		return sly_Util_Directory::create($path, 0777);
 	}
 

lib/sly/Controller/Zendfw.php

 		if ($this->init) return;
 		$this->init = true;
 
-		sly_Core::getLayout()->addCSSFile('../data/dyn/public/'.(sly_Core::getVersion('X.Y') === '0.6' ? 'zend_framework/zend_framework.css' : 'webvariants/zend-framework/backend.less'));
+		sly_Core::getLayout()->addCSSFile(sly_Util_AddOn::assetBaseUri('webvariants/zend-framework').'backend.less');
 
 		$layout = sly_Core::getLayout();
 		$layout->pageHeader('Zend Framework');

plugins/gdata/LICENSE

-Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-http://www.opensource.org/licenses/mit-license.php
-http://de.wikipedia.org/wiki/MIT-Lizenz

plugins/gdata/config.inc.php

-<?php
-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-sly_Loader::addLoadPath(dirname(__FILE__).'/lib', 'WV3_');

plugins/gdata/globals.yml

-global_settings:
-   zf.gdata.username:
-      title: Benutzername
-      datatype: stringline
-      group: Zugangsdaten
-      pagename: Google Data
-      local: true
-   zf.gdata.password:
-      title: Passwort
-      datatype: stringline
-      group: Zugangsdaten
-      pagename: Google Data
-      local: true

plugins/gdata/lib/Gdata.php

-<?php
-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-abstract class WV3_Gdata {
-	private static $services = array();
-
-	public static function getService($service) {
-		$className = 'WV3_Gdata_'.$service.'_Service';
-
-		if (!isset(self::$services[$service])) {
-			if (!class_exists($className)) {
-				throw new Exception('Service '.$service.' could not be found!');
-			}
-
-			self::$services[$service] = new $className();
-		}
-
-		return self::$services[$service];
-	}
-
-	/**
-	 * @return array
-	 */
-	public static function getCredentials() {
-		static $credentials = null;
-
-		if ($credentials === null) {
-			$credentials = WV8_Settings::getValues('zf.gdata');
-		}
-
-		return $credentials;
-	}
-
-	/**
-	 * @param  string $serviceName
-	 * @param  string $source       a short string identifying your application
-	 * @return Zend_Http_Client
-	 */
-	public static function getHttpClient($serviceName, $source) {
-		$credentials       = self::getCredentials();
-		$authenticationURL = 'https://www.google.com/accounts/ClientLogin';
-
-		try {
-			$httpClient = Zend_Gdata_ClientLogin::getHttpClient(
-				/* username          */ $credentials['username'],
-				/* password          */ $credentials['password'],
-				/* service           */ $serviceName,
-				/* client            */ null,
-				/* source            */ $source,
-				/* loginToken        */ null,
-				/* loginCaptcha      */ null,
-				/* authenticationURL */ $authenticationURL
-			);
-
-			return $httpClient;
-		}
-		catch (Exception $e) {
-			throw new WV3_Gdata_Exception('Cannot create http client: '.$e->getMessage(), $e->getCode());
-		}
-	}
-}

plugins/gdata/lib/Gdata/Exception.php

-<?php
-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-class WV3_Gdata_Exception extends Exception { }

plugins/gdata/static.yml

-author: webvariants GbR
-supportpage: http://www.sallycms.de/
-requires: [global_settings]
-sally: ['0.6']
-version: '1.1'

plugins/gdata_youtube/LICENSE

-Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-http://www.opensource.org/licenses/mit-license.php
-http://de.wikipedia.org/wiki/MIT-Lizenz

plugins/gdata_youtube/config.inc.php

-<?php
-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-sly_Loader::addLoadPath(dirname(__FILE__).'/lib', 'WV3_Gdata_YouTube_');
-sly_Core::dispatcher()->register('SLY_CACHE_CLEARED', array('WV3_Gdata_YouTube_Cache', 'clear'));

plugins/gdata_youtube/globals.yml

-global_settings:
-   zf.gdata.youtube.source:
-      title: Anwendungs-Name
-      datatype: stringline
-      group: YouTube-API
-      pagename: Google Data
-      helptext: '"a short string identifying your application"'
-   zf.gdata.youtube.applicationid:
-      title: Anwendungs-ID
-      datatype: stringline
-      group: YouTube-API
-      pagename: Google Data
-   zf.gdata.youtube.clientid:
-      title: Client-ID
-      datatype: stringline
-      group: YouTube-API
-      pagename: Google Data
-   zf.gdata.youtube.developerkey:
-      title: Entwickler-Key
-      datatype: stringline
-      group: YouTube-API
-      pagename: Google Data
-      local: true
-   zf.gdata.youtube.ttl:
-      title: Cachezeit
-      datatype: stringline
-      params:
-         width: 30px
-         annotation: Sekunden
-      group: YouTube-API
-      pagename: Google Data
-      helptext: gibt an, wie lang Informationen über Videos gecacht werden sollen

plugins/gdata_youtube/lib/Cache.php

-<?php
-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-abstract class WV3_Gdata_YouTube_Cache {
-	protected static $cache = null;
-
-	public static function getCache() {
-		if (!self::$cache) self::$cache = sly_Core::cache();
-		return self::$cache;
-	}
-
-	public static function get($namespace, $key, $default = null) {
-		$def  = array('payload' => $default, 'expiry' => 0);
-		$data = self::getCache()->get(self::getNamespace($namespace), $key, $def);
-
-		extract($data); // $expiry, $payload
-
-		if ($expiry > 0 && time() > $expiry) {
-			self::delete($namespace, $key);
-			return $default;
-		}
-
-		return $payload;
-	}
-
-	public static function set($namespace, $key, $value) {
-		static $ttl = null;
-
-		if ($ttl === null) {
-			$ttl = (int) WV8_Settings::getValue('zf.gdata.youtube', 'ttl', 0);
-		}
-
-		$expiry = $ttl > 0 ? (time() + $ttl) : 0;
-		$data   = array('payload' => $value, 'expiry' => $expiry);
-
-		return self::getCache()->set(self::getNamespace($namespace), $key, $data);
-	}
-
-	public static function delete($namespace, $key) {
-		return self::getCache()->delete(self::getNamespace($namespace), $key);
-	}
-
-	public static function flush($namespace = '', $recursive = true) {
-		return self::getCache()->flush(self::getNamespace($namespace), $recursive);
-	}
-
-	public static function getNamespace($namespace) {
-		return empty($namespace) ? 'zf.gdata.youtube' : 'zf.gdata.youtube.'.$namespace;
-	}
-
-	public static function setIf($flag, $namespace, $key, $value) {
-		if ($flag) self::set($namespace, $key, $value);
-		else self::remove($namespace, $key);
-	}
-
-	public static function clear(array $params) {
-		self::flush();
-		return $params['subject'];
-	}
-}

plugins/gdata_youtube/lib/Exception.php

-<?php
-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-class WV3_Gdata_YouTube_Exception extends Exception {
-}

plugins/gdata_youtube/lib/Service.php

-<?php
-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-class WV3_Gdata_YouTube_Service {
-	public function getCredentials() {
-		return WV8_Settings::getValues('zf.gdata.youtube');
-	}
-
-	public function getAPI() {
-		static $api = null;
-
-		if ($api === null) {
-			$credentials   = $this->getCredentials();
-			$applicationID = $credentials['applicationid'];
-			$clientID      = $credentials['clientid'];
-			$developerKey  = $credentials['developerkey'];
-			$client        = WV3_Gdata::getHttpClient('youtube', $credentials['source']);
-
-			$api = new Zend_Gdata_YouTube($client, $applicationID, $clientID, $developerKey);
-		}
-
-		return $api;
-	}
-
-	public function createVideoEntry($file, $title, $description, $category, $tags = '', $mime = null, $slug = null) {
-		$api   = $this->getAPI();
-		$entry = new Zend_Gdata_YouTube_VideoEntry();
-
-		// create a new Zend_Gdata_App_MediaFileSource object
-		$filesource = $api->newMediaFileSource($file);
-		$filesource->setContentType($mime === null ? sly_Util_Mime::getType($file) : $mime);
-		$filesource->setSlug($slug === null ? basename($file) : $slug);
-
-		// add the filesource to the video entry
-		$entry->setMediaSource($filesource);
-
-		$entry->setVideoTitle($title);
-		$entry->setVideoDescription($description);
-		$entry->setVideoCategory($category); // must be a valid YouTube category!
-		$entry->setVideoTags($tags);
-
-		return $entry;
-	}
-
-	public function upload($file, $title, $description, $category, $tags = '', $mime = null, $slug = null) {
-		$api   = $this->getAPI();
-		$entry = $this->createVideoEntry($file, $title, $description, $category, $tags, $mime, $slug);
-
-		return $this->uploadVideoEntry($entry);
-	}
-
-	public function uploadVideoEntry(Zend_Gdata_YouTube_VideoEntry $entry) {
-		set_time_limit(0);
-
-		// upload URI for the currently authenticated user
-		$uploadUrl = 'http://uploads.gdata.youtube.com/feeds/api/users/default/uploads';
-		$api       = $this->getAPI();
-
-		try {
-			return $api->insertEntry($entry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry');
-		}
-		catch (Exception $e) {
-			throw new WV3_Gdata_YouTube_Exception('Upload failed: '.$e->getMessage(), $e->getCode());
-		}
-	}
-
-	public function getVideo($id) {
-		return new WV3_Gdata_YouTube_Video($id);
-	}
-
-	public function getVideoEntry($id, $full = false) {
-		try {
-			return $this->getAPI()->getVideoEntry($id, null, $full);
-		}
-		catch (Exception $e) {
-			throw new WV3_Gdata_YouTube_Exception('Could not find video: '.$e->getMessage(), $e->getCode());
-		}
-	}
-}

plugins/gdata_youtube/lib/Video.php

-<?php
-/*
- * Copyright (c) 2012, webvariants GbR, http://www.webvariants.de
- *
- * This file is released under the terms of the MIT license. You can find the
- * complete text in the attached LICENSE file or online at:
- *
- * http://www.opensource.org/licenses/mit-license.php
- */
-
-class WV3_Gdata_YouTube_Video {
-	protected $id;
-	protected $data;
-
-	public function __construct($id) {
-		$this->id   = $id;
-		$this->data = false;
-	}
-
-	public function getEntry() {
-		return WV3_Gdata::getService('YouTube')->getVideoEntry($this->id);
-	}
-
-	public function getData($key = null) {
-		if ($this->data === false) {
-			$cache = sly_Core::cache();
-			$data  = WV3_Gdata_YouTube_Cache::get('videodata', $this->id);
-
-			if ($data === null) {
-				$entry = $this->getEntry();
-				$data  = array(
-					'title'            => $entry->getVideoTitle(),
-					'updated'          => strtotime((string) $entry->getUpdated()),
-					'description'      => $entry->getVideoDescription(),
-					'category'         => $entry->getVideoCategory(),
-					'tags'             => $entry->getVideoTags(),
-					'watch_page'       => $entry->getVideoWatchPageUrl(),
-					'flash_player_url' => $entry->getFlashPlayerUrl(),
-					'duration'         => (int) $entry->getVideoDuration(),
-					'view_count'       => $entry->getVideoViewCount(),
-					'rating'           => $entry->getVideoRatingInfo(),
-					'geo_location'     => $entry->getVideoGeoLocation(),
-					'recorded_on'      => $entry->getVideoRecorded(),
-					'thumbnails'       => $entry->getVideoThumbnails(),
-					'edit_link'        => $entry->getEditLink(),
-					'private'          => $entry->isVideoPrivate(),
-					'state'            => null
-				);
-
-				$state = $entry->getVideoState();
-
-				if ($state) {
-					$data['state'] = array(
-						'name' => $state->getName(),
-						'code' => $state->getReasonCode(),
-						'text' => $state->getText()
-					);
-				}
-
-				WV3_Gdata_YouTube_Cache::set('videodata', $this->id, $data);
-			}
-
-			$this->data = $data;
-		}
-
-		return $key ? (isset($this->data[$key]) ? $this->data[$key] : null) : $this->data;
-	}
-
-	public function flushCache() {
-		WV3_Gdata_YouTube_Cache::delete('videodata', $this->id);
-		$this->data = false;
-	}
-
-	public function getTitle()          { return $this->getData('title');            }
-	public function getUpdated()        { return $this->getData('updated');          }
-	public function getDescription()    { return $this->getData('description');      }
-	public function getCategory()       { return $this->getData('category');         }
-	public function getTags()           { return $this->getData('tags');             }
-	public function getWatchPageUrl()   { return $this->getData('watch_page');       }
-	public function getFlashPlayerUrl() { return $this->getData('flash_player_url'); }
-	public function getDuration()       { return $this->getData('duration');         }
-	public function getViewCount()      { return $this->getData('view_count');       }
-	public function getRatingInfo()     { return $this->getData('rating');           }
-	public function getGeoLocation()    { return $this->getData('geo_location');     }
-	public function getRecorded()       { return $this->getData('recorded_on');      }
-	public function getThumbnails()     { return $this->getData('thumbnails');       }
-	public function getEditLink()       { return $this->getData('edit_link');        }
-	public function isPrivate()         { return $this->getData('private');          }
-	public function getState()          { return $this->getData('state');            }
-}

plugins/gdata_youtube/static.yml

-author: webvariants GbR
-supportpage: http://www.sallycms.de/
-requires: [global_settings, zend_framework/gdata]
-sally: ['0.6']
-version: '1.1'

static.yml

-author: webvariants GbR
-supportpage: http://www.sallycms.de/
-requires: [developer_utils]
-sally: ['0.6', '0.7']
-version: '2.6-dev'

uninstall.inc.php

-<?php
-require dirname(__FILE__).'/uninstall.php';