applied common formatting
This commit is contained in:
		| @@ -24,8 +24,8 @@ use ManiaControl\Plugins\Plugin; | ||||
| /** | ||||
|  * ManiaControl Widget Plugin | ||||
|  * | ||||
|  * @author    steeffeen and kremsy | ||||
|  * @copyright ManiaControl Copyright © 2014 ManiaControl Team | ||||
|  * @author    ManiaControl Team <mail@maniacontrol.com> | ||||
|  * @copyright 2014 ManiaControl Team | ||||
|  * @license   http://www.gnu.org/licenses/ GNU General Public License, Version 3 | ||||
|  */ | ||||
| class WidgetPlugin implements CallbackListener, TimerListener, Plugin { | ||||
| @@ -88,6 +88,51 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { | ||||
| 		//do nothing | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get plugin id | ||||
| 	 * | ||||
| 	 * @return int | ||||
| 	 */ | ||||
| 	public static function getId() { | ||||
| 		return self::PLUGIN_ID; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get Plugin Name | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	public static function getName() { | ||||
| 		return self::PLUGIN_NAME; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get Plugin Version | ||||
| 	 * | ||||
| 	 * @return float,, | ||||
| 	 */ | ||||
| 	public static function getVersion() { | ||||
| 		return self::PLUGIN_VERSION; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get Plugin Author | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	public static function getAuthor() { | ||||
| 		return self::PLUGIN_AUTHOR; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get Plugin Description | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	public static function getDescription() { | ||||
| 		return 'Plugin offers some Widgets'; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Load the plugin | ||||
| 	 * | ||||
| @@ -135,19 +180,6 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { | ||||
| 		return true; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Unload the plugin and its resources | ||||
| 	 */ | ||||
| 	public function unload() { | ||||
| 		$this->closeWidget(self::MLID_CLOCKWIDGET); | ||||
| 		$this->closeWidget(self::MLID_SERVERINFOWIDGET); | ||||
| 		$this->closeWidget(self::MLID_MAPWIDGET); | ||||
| 		$this->closeWidget(self::MLID_NEXTMAPWIDGET); | ||||
| 		$this->maniaControl->callbackManager->unregisterCallbackListener($this); | ||||
| 		$this->maniaControl->timerManager->unregisterTimerListenings($this); | ||||
| 		unset($this->maniaControl); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Display the Widgets | ||||
| 	 */ | ||||
| @@ -316,7 +348,7 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { | ||||
| 		/** | ||||
| 		 * @var Player $player | ||||
| 		 */ | ||||
| 		foreach($players as $player) { | ||||
| 		foreach ($players as $player) { | ||||
| 			if ($player->isSpectator) { | ||||
| 				$spectatorCount++; | ||||
| 			} else { | ||||
| @@ -381,16 +413,16 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Handle on Begin Map | ||||
| 	 * | ||||
| 	 * @param Map $map | ||||
| 	 * Unload the plugin and its resources | ||||
| 	 */ | ||||
| 	public function handleOnBeginMap(Map $map) { | ||||
| 		// Display Map Widget | ||||
| 		if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) { | ||||
| 			$this->displayMapWidget(); | ||||
| 		} | ||||
| 	public function unload() { | ||||
| 		$this->closeWidget(self::MLID_CLOCKWIDGET); | ||||
| 		$this->closeWidget(self::MLID_SERVERINFOWIDGET); | ||||
| 		$this->closeWidget(self::MLID_MAPWIDGET); | ||||
| 		$this->closeWidget(self::MLID_NEXTMAPWIDGET); | ||||
| 		$this->maniaControl->callbackManager->unregisterCallbackListener($this); | ||||
| 		$this->maniaControl->timerManager->unregisterTimerListenings($this); | ||||
| 		unset($this->maniaControl); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| @@ -403,6 +435,19 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { | ||||
| 		$this->maniaControl->manialinkManager->sendManialink($emptyManialink); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Handle on Begin Map | ||||
| 	 * | ||||
| 	 * @param Map $map | ||||
| 	 */ | ||||
| 	public function handleOnBeginMap(Map $map) { | ||||
| 		// Display Map Widget | ||||
| 		if ($this->maniaControl->settingManager->getSetting($this, self::SETTING_MAP_WIDGET_ACTIVATED)) { | ||||
| 			$this->displayMapWidget(); | ||||
| 		} | ||||
| 		$this->closeWidget(self::MLID_NEXTMAPWIDGET); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Handle on End Map | ||||
| 	 * | ||||
| @@ -541,49 +586,4 @@ class WidgetPlugin implements CallbackListener, TimerListener, Plugin { | ||||
| 			$this->displayServerInfoWidget(); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get plugin id | ||||
| 	 * | ||||
| 	 * @return int | ||||
| 	 */ | ||||
| 	public static function getId() { | ||||
| 		return self::PLUGIN_ID; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get Plugin Name | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	public static function getName() { | ||||
| 		return self::PLUGIN_NAME; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get Plugin Version | ||||
| 	 * | ||||
| 	 * @return float,, | ||||
| 	 */ | ||||
| 	public static function getVersion() { | ||||
| 		return self::PLUGIN_VERSION; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get Plugin Author | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	public static function getAuthor() { | ||||
| 		return self::PLUGIN_AUTHOR; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get Plugin Description | ||||
| 	 * | ||||
| 	 * @return string | ||||
| 	 */ | ||||
| 	public static function getDescription() { | ||||
| 		return 'Plugin offers some Widgets'; | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user