Skip to content

Commit

Permalink
Vorbereitung Documentation, #52
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaddade committed Jun 21, 2022
1 parent c67c1cd commit b348e8b
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 17 deletions.
1 change: 1 addition & 0 deletions boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

rex_extension::register('PACKAGES_INCLUDED', '\Watson\Foundation\Extension::run', rex_extension::LATE, ['workflows' => $workflows]);
rex_extension::register('PACKAGES_INCLUDED', '\Watson\Foundation\Extension::callWatsonFunc', rex_extension::LATE);
//rex_extension::register('OUTPUT_FILTER', '\Watson\Foundation\Extension::legend', rex_extension::LATE, ['workflows' => $workflows]);
}

rex_extension::register('PAGE_HEADER', '\Watson\Foundation\Extension::head');
Expand Down
29 changes: 27 additions & 2 deletions lib/Watson/Foundation/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ public static function toggleButton(\rex_extension_point $ep)

public static function agent(\rex_extension_point $ep)
{
$panel = '';
$panel .= '
$panel = '
<div id="watson-agent">
<form action="">
<fieldset>
Expand All @@ -70,7 +69,33 @@ public static function agent(\rex_extension_point $ep)
$panel .= '<div id="watson-agent-overlay"></div>';

$ep->setSubject(str_replace('</body>', $panel.'</body>', $ep->getSubject()));

/*
<div class="watson-legend">
<!-- WATSON_LEGEND //-->
</div>
*/
}

/*
public static function legend(\rex_extension_point $ep)
{
$replace = [];
/** @var Workflow[] $workflows * /
$workflows = $ep->getParam('workflows');
foreach ($workflows as $workflow) {
$documentation = $workflow->documentation();
$replace[] = sprintf('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',
implode(', ', $documentation->getCommand()),
$documentation->getDescription(),
$documentation->getUsage(),
implode('', $documentation->getOptions()),
);
}
$ep->setSubject(str_replace('<!-- WATSON_LEGEND //-->', '<table><tbody>'.implode('', $replace).'</tbody></table>', $ep->getSubject()));
}
*/

public static function run(\rex_extension_point $ep)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Watson/Foundation/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class Workflow
abstract public function commands();

/**
* @return Documention
* @return Documentation
*/
abstract public function documentation();

Expand Down
2 changes: 1 addition & 1 deletion lib/Watson/Workflows/Media/MediaSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation = new Documentation($this->commands());
$documentation->setDescription(Watson::translate('watson_media_documentation_description'));
$documentation->setUsage('m keyword');
$documentation->setExample('m filename');
Expand Down
2 changes: 1 addition & 1 deletion lib/Watson/Workflows/Module/ModuleGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation = new Documentation($this->commands());
$documentation->setDescription(Watson::translate('watson_module_documentation_description'));
$documentation->setUsage('m keyword');
$documentation->setExample('$headline');
Expand Down
2 changes: 1 addition & 1 deletion lib/Watson/Workflows/Module/ModuleSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation = new Documentation($this->commands());
$documentation->setDescription(Watson::translate('watson_module_documentation_description'));
$documentation->setUsage('m keyword');
$documentation->setExample('$headline');
Expand Down
4 changes: 2 additions & 2 deletions lib/Watson/Workflows/Sprog/WildcardCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation->setDescription(Watson::translate('watson_wildcard_documentation_description'));
$documentation = new Documentation($this->commands());
$documentation->setDescription(Watson::translate('watson_wildcard_create_documentation_description'));
$documentation->setUsage('sp:make Wildcard');
$documentation->setExample('sp:make Wildcard');
$documentation->setExample('sp:miss');
Expand Down
4 changes: 2 additions & 2 deletions lib/Watson/Workflows/Sprog/WildcardSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation->setDescription(Watson::translate('watson_wildcard_documentation_description'));
$documentation = new Documentation($this->commands());
$documentation->setDescription(Watson::translate('watson_wildcard_search_documentation_description'));
$documentation->setUsage('sp wildcard');
$documentation->setExample('wildcard');
$documentation->setExample('sp wildcard');
Expand Down
7 changes: 4 additions & 3 deletions lib/Watson/Workflows/Sprog/de_de.lang
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
watson_open_wildcard = Platzhalter öffnen
watson_wildcard_legend = Platzhalter
watson_wildcard_legend_create = Platzhalter erstellen
watson_wildcard_legend_missing = Noch nicht ersetzte Platzhalter innerhalb der Struktur
watson_wildcard_legend_create = Sprog-Platzhalter erstellen
watson_wildcard_legend_missing = Noch nicht ersetzte Sprog-Platzhalter innerhalb der Struktur
watson_wildcard_create_description = Nutze Quicklook um auf der jetzigen Seite zu bleiben
watson_wildcard_documentation_description = Sucht innerhalb von Platzhalter
watson_wildcard_create_documentation_description = Erstellt Sprog-Platzhalter
watson_wildcard_search_documentation_description = Sucht innerhalb von Sprog-Platzhalter
2 changes: 1 addition & 1 deletion lib/Watson/Workflows/Structure/ArticleSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation = new Documentation($this->commands());
$documentation->setDescription(Watson::translate(''));
$documentation->setUsage('a keyword');
$documentation->setExample('article content');
Expand Down
2 changes: 1 addition & 1 deletion lib/Watson/Workflows/Structure/CategoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation = new Documentation($this->commands());

return $documentation;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Watson/Workflows/Template/TemplateSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation = new Documentation($this->commands());
$documentation->setDescription(Watson::translate('watson_template_documentation_description'));
$documentation->setUsage('t keyword');
$documentation->setExample('$navi');
Expand Down
2 changes: 1 addition & 1 deletion lib/Watson/Workflows/YForm/YFormSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function commands()
*/
public function documentation()
{
$documentation = new Documentation();
$documentation = new Documentation($this->commands());
$documentation->setDescription(Watson::translate('watson_yform_documentation_description'));
$documentation->setUsage('yf keyword');
$documentation->setExample('yf Phrase');
Expand Down

0 comments on commit b348e8b

Please sign in to comment.