Files
plugins/UpdateAssistant/Plugin.php
chorblack e75f275ef4
Some checks failed
定时更新GitHub源插件 / 自动更新GitHub插件 (push) Has been cancelled
Initial commit
2026-03-07 11:19:25 +08:00

43 lines
1.3 KiB
PHP

<?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.
}
}