TrackManiaControl/application/core/plugin.php

154 lines
2.7 KiB
PHP
Raw Normal View History

2013-11-09 11:06:04 +01:00
<?php
2013-11-09 12:20:38 +01:00
namespace ManiaControl;
2013-11-09 11:06:04 +01:00
/**
* Class plugin parent class for all plugins
*
* @author Lukas Kremsmayr and steeffeen
*/
class Plugin {
2013-11-09 12:15:02 +01:00
/**
* Private properties
*/
2013-11-09 13:29:18 +01:00
private $mc;
2013-11-09 12:15:02 +01:00
private $version;
private $author;
private $updateUrl;
private $name;
2013-11-09 19:26:57 +01:00
private $description;
2013-11-09 13:29:18 +01:00
private $active;
2013-11-09 11:06:04 +01:00
2013-11-09 19:26:57 +01:00
public function __construct($mc, $name, $version = 0, $author = '', $description = '', $updateUrl = ''){
2013-11-09 13:29:18 +01:00
$this->mc = $mc;
2013-11-09 12:15:02 +01:00
$this->name = $name;
2013-11-09 13:00:53 +01:00
$this->version = $version;
$this->author = $author;
2013-11-09 19:26:57 +01:00
$this->description = $description;
2013-11-09 13:00:53 +01:00
$this->updateUrl = $updateUrl;
2013-11-09 13:29:18 +01:00
$this->mc->pluginHandler->registerPlugin($this);
2013-11-09 12:15:02 +01:00
}
/**
* Reserves manialinks on the ManialinkIdHandler
*
* @param int $count
* @return array with manialink Ids
*/
public function reserveManialinkIds($count){
2013-11-09 13:29:18 +01:00
return $this->mc->manialinkIdHandler->reserveManialikIds($count);
2013-11-09 12:15:02 +01:00
}
2013-11-09 13:29:18 +01:00
2013-11-09 12:15:02 +01:00
public function checkUpdate(){
}
2013-11-09 13:29:18 +01:00
/**
* Enables the Plugin
*/
public function enablePlugin()
{
$this->active = true;
}
/**
* Disable the Plugin
*/
public function disablePlugin()
{
$this->active = true;
}
/**
* @return mixed
*/
public function isActive()
{
return $this->active;
}
2013-11-09 12:15:02 +01:00
/**
* @param mixed $author
*/
public function setAuthor($author)
{
$this->author = $author;
}
/**
* @return mixed
*/
public function getAuthor()
{
return $this->author;
}
/**
* @param mixed $updateUrl
*/
public function setUpdateUrl($updateUrl)
{
$this->updateUrl = $updateUrl;
}
/**
* @return mixed
*/
public function getUpdateUrl()
{
return $this->updateUrl;
}
/**
* @param mixed $version
*/
public function setVersion($version)
{
$this->version = $version;
}
/**
* @return mixed
*/
public function getVersion()
{
return $this->version;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
2013-11-09 19:26:57 +01:00
/**
* @param string $description
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
2013-11-09 11:06:04 +01:00
}
?>