diff --git a/lang/de/lang.php b/lang/de/lang.php new file mode 100644 index 0000000..d1760f2 --- /dev/null +++ b/lang/de/lang.php @@ -0,0 +1,17 @@ + + */ + +// menu entry for admin plugins +$lang['wiyh_heading'] = 'Raumstatus'; +$lang['wiyh_open'] = 'ist besetzt.'; +$lang['wiyh_closed'] = 'ist geschlossen.'; +$lang['wiyh_stats'] = 'Raumöffnungsstatistiken'; + + + + +//Setup VIM: ex: et ts=4 : diff --git a/lang/en/lang.php b/lang/en/lang.php index 7852d97..d7de60a 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -2,14 +2,14 @@ /** * English language file for whoisinyourhackspace plugin * - * @author Tim Schumacher + * @author Tim Schumacher */ // menu entry for admin plugins -// $lang['menu'] = 'Your menu entry'; - -// custom language strings for the plugin -// $lang['fixme'] = 'FIXME'; +$lang['wiyh_heading'] = 'State'; +$lang['wiyh_open'] = 'is open.'; +$lang['wiyh_closed'] = 'is closed.'; +$lang['wiyh_stats'] = 'Stats'; diff --git a/syntax.php b/syntax.php index 9db67b4..02e995d 100755 --- a/syntax.php +++ b/syntax.php @@ -44,16 +44,7 @@ class syntax_plugin_whoisinyourhackspace extends DokuWiki_Syntax_Plugin { public function connectTo($mode) { - $this->Lexer->addSpecialPattern(']*>',$mode,'plugin_whoisinyourhackspace'); - } - - public function handle($match, $state, $pos, &$handler){ - $return = array( - 'ample' => true - ); - - $this->_checkOption($match, "/-ample/i", $return['ample'], true); - return $return; + $this->Lexer->addSpecialPattern('\[wiyh\]',$mode,'plugin_whoisinyourhackspace'); } public function render($mode, &$renderer, $data) { @@ -69,23 +60,19 @@ class syntax_plugin_whoisinyourhackspace extends DokuWiki_Syntax_Plugin { $content = ''; $content .= '
'; - $content .= '

Raumstatus

'; + $content .= "

" . $this->getLang('wiyh_heading') . "

"; - //$content .= '
Status
'; if ($api->state->open) { - //$content .= '
Offen
'; $content .= "state->icon->open}\" alt=\"{$api->space} ist besetzt.\" title=\"{$api->space} ist besetzt.\" />"; - $content .= "

{$api->space} ist besetzt.

"; - //$renderer->doc .= sprintf('

%s ist besetzt :).

',$api->space); + $content .= "

{$api->space} " . $this->getLang('wiyh_open') . "

"; } else { - //$renderer->doc .= sprintf('

%s ist nicht besetzt :(.

',$api->space); $content .= "state->icon->closed}\" alt=\"{$api->space} ist geschlossen.\" title=\"{$api->space} ist geschlossen.\" />"; - $content .= "

{$api->space} ist geschlossen.

"; + $content .= "

{$api->space} " . $this->getLang('wiyh_closed') . "

"; } $content .= '
'; - $content .= sprintf('

Raum-Öffnungs-Statistiken

',strtolower($api->space)); + $content .= sprintf('

'.$this->getLang('wiyh_stats').'

',strtolower($api->space)); $content .= '
'; $renderer->doc .= $content;