-
Notifications
You must be signed in to change notification settings - Fork 7
/
Plugin.php
42 lines (36 loc) · 1.29 KB
/
Plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* Update Assistant
*
* @package UpdateAssistant
* @author mrgeneral
* @version 1.0.1
* @link https://www.chengxiaobai.cn
*/
class UpdateAssistant_Plugin implements Typecho_Plugin_Interface
{
public static function activate()
{
Helper::addPanel(1, 'UpdateAssistant/Start.php', _t('Update Blogging Platform'), _t('Update Blogging Platform'), 'administrator');
Helper::addRoute('version_latest', '/update-assistant/version/latest', 'UpdateAssistant_Action', 'getVersion');
Helper::addRoute('version_process', '/update-assistant/version/process', 'UpdateAssistant_Action', 'action');
}
/**
* For safety's sake, history is not deleted
*/
public static function deactivate()
{
Helper::removePanel(1, 'UpdateAssistant/Start.php');
Helper::removeRoute('version_latest');
Helper::removeRoute('version_process');
}
public static function config(Typecho_Widget_Helper_Form $form)
{
$element = new Typecho_Widget_Helper_Form_Element_Radio('isDevelop', [0 => _t('No'), 1 => _t('Yes')], 1, _t('Upgrade to developer edition'));
$form->addInput($element);
}
public static function personalConfig(Typecho_Widget_Helper_Form $form)
{
// TODO: Implement personalConfig() method.
}
}