📄 serendipity_plugin_eventwrapper.php
字号:
<?php # $Id: serendipity_plugin_eventwrapper.php,v 1.2 2004/04/03 17:36:18 isotopp Exp $
/*******************************************************汉化作者:youngong(http://youngong.blogbus.com) **官方主页:http://www.s9y.corg **我的信箱:youngong@163.com **如果有问题,欢迎和作者及汉化作者联系。 ********************************************************/
switch ($serendipity['lang']) {
case 'de':
@define('PLUGIN_EVENT_WRAPPER_NAME', 'Event-Ausgabe Wrapper');
@define('PLUGIN_EVENT_WRAPPER_DESC', 'Zeigt die Ausgabedaten eines Event-Plugins an');
@define('PLUGIN_EVENT_WRAPPER_PLUGIN', 'Quell Event-Plugin');
@define('PLUGIN_EVENT_WRAPPER_PLUGINDESC', 'W鋒len Sie das Event-Plugin aus, f黵 das die Ausgabe dargestellt werden soll');
@define('PLUGIN_EVENT_WRAPPER_TITLEDESC', 'Geben Sie den Titel f黵 die Sidebar an. Die Eingabe eines leeren Titels zeigt den des Event-Plugins an.');
break;
case 'cn':
@define('PLUGIN_EVENT_WRAPPER_NAME', '事件-输出包装');
@define('PLUGIN_EVENT_WRAPPER_DESC', '显示通过一个特定的事件插件搜集的数据');
@define('PLUGIN_EVENT_WRAPPER_PLUGIN', '事件插件发起者');
@define('PLUGIN_EVENT_WRAPPER_PLUGINDESC', '选择要显示的事件插件');
@define('PLUGIN_EVENT_WRAPPER_TITLEDESC', '输入这个工具条条目的标题 (留空则继承事件插件)');
break;
case 'en':
case 'es':
default:
@define('PLUGIN_EVENT_WRAPPER_NAME', 'Event-Output wrapper');
@define('PLUGIN_EVENT_WRAPPER_DESC', 'Displays gathered data by a certain event plugin');
@define('PLUGIN_EVENT_WRAPPER_PLUGIN', 'Source event plugin');
@define('PLUGIN_EVENT_WRAPPER_PLUGINDESC', 'Select the event plugin for which the output should be displayed');
@define('PLUGIN_EVENT_WRAPPER_TITLEDESC', 'Enter the title for this sidebar item (leave empty for inheritance by event plugin)');
break;
}
class serendipity_plugin_eventwrapper extends serendipity_plugin
{
var $rewrite_from, $rewrite_to;
function introspect(&$propbag)
{
global $serendipity;
$propbag->add('name', PLUGIN_EVENT_WRAPPER_NAME);
$propbag->add('description', PLUGIN_EVENT_WRAPPER_DESC);
$propbag->add('configuration', array('event_plugin', 'title'));
}
function introspect_config_item($name, &$propbag)
{
global $serendipity;
switch($name) {
case 'event_plugin':
$plugins = serendipity_plugin_api::get_event_plugins();
$select = array();
if (is_array($plugins)) {
foreach($plugins AS $plugname => $plugarray) {
$select[$plugname] = $plugarray['t'];
}
}
$propbag->add('type', 'select');
$propbag->add('name', PLUGIN_EVENT_WRAPPER_PLUGIN);
$propbag->add('description', PLUGIN_EVENT_WRAPPER_PLUGINDESC);
$propbag->add('select_values', $select);
break;
case 'title':
$propbag->add('type', 'string');
$propbag->add('name', TITLE);
$propbag->add('description', PLUGIN_EVENT_WRAPPER_TITLEDESC);
break;
default:
return false;
}
return true;
}
function generate_content(&$title)
{
$bag = new serendipity_property_bag;
$this->introspect($bag);
$wrap = &serendipity_plugin_api::get_event_plugins($this->get_config('event_plugin'));
$faketitle = '';
if (is_object($wrap)) {
$wrap->generate_content($faketitle);
}
if ($this->get_config('title') != '') {
$title = $this->get_config('title');
} else {
$title = $faketitle;
}
}
}
/* vim: set sts=4 ts=4 expandtab : */
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -