From 17faeca2417f576120da2218c73b48679f960df1 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 28 Jan 2018 00:05:28 -0500 Subject: [PATCH 1/5] Improve addon readme display - Add maintainer display support - Remove extra comma after author/maintainer lists --- src/Core/Addon.php | 41 ++++++++++++------------ view/templates/admin/plugins_details.tpl | 14 ++++---- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/Core/Addon.php b/src/Core/Addon.php index b1f401d28..af1d71ac4 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -254,25 +254,26 @@ class Addon * * like * \code - *...* Name: addon - * * Description: An addon which plugs in - * . * Version: 1.2.3 - * * Author: John - * * Author: Jane - * * - * *\endcode - * @param string $addon the name of the addon - * @return array with the addon information - */ - + * * Name: addon + * * Description: An addon which plugs in + * . * Version: 1.2.3 + * * Author: John + * * Author: Jane + * * Maintainer: Jess + * * + * *\endcode + * @param string $addon the name of the addon + * @return array with the addon information + */ public static function getInfo($addon) { $a = get_app(); - $info=[ + $info = [ 'name' => $addon, 'description' => "", 'author' => [], + 'maintainer' => [], 'version' => "", 'status' => "" ]; @@ -292,18 +293,18 @@ class Addon foreach ($ll as $l) { $l = trim($l, "\t\n\r */"); if ($l != "") { - list($k,$v) = array_map("trim", explode(":", $l, 2)); - $k= strtolower($k); - if ($k == "author") { - $r=preg_match("|([^<]+)<([^>]+)>|", $v, $m); + list($type, $v) = array_map("trim", explode(":", $l, 2)); + $type = strtolower($type); + if ($type == "author" || $type == "maintainer") { + $r = preg_match("|([^<]+)<([^>]+)>|", $v, $m); if ($r) { - $info['author'][] = ['name'=>$m[1], 'link'=>$m[2]]; + $info[$type][] = ['name' => $m[1], 'link' => $m[2]]; } else { - $info['author'][] = ['name'=>$v]; + $info[$type][] = ['name' => $v]; } } else { - if (array_key_exists($k, $info)) { - $info[$k]=$v; + if (array_key_exists($type, $info)) { + $info[$type] = $v; } } } diff --git a/view/templates/admin/plugins_details.tpl b/view/templates/admin/plugins_details.tpl index cbeb4171e..05e3e8aa0 100644 --- a/view/templates/admin/plugins_details.tpl +++ b/view/templates/admin/plugins_details.tpl @@ -1,22 +1,22 @@

{{$title}} - {{$page}}

- +

{{$info.name}} - {{$info.version}} : {{$action}}

{{$info.description}}

- +

{{$str_author}} - {{foreach $info.author as $a}} - {{if $a.link}}{{$a.name}}{{else}}{{$a.name}}{{/if}}, + {{foreach $info.author as $a name=authors}} + {{if $a.link}}{{$a.name}}{{else}}{{$a.name}}{{/if}}{{if $smarty.foreach.authors.last}}{{else}}, {{/if}} {{/foreach}}

{{$str_maintainer}} - {{foreach $info.maintainer as $a}} - {{if $a.link}}{{$a.name}}{{else}}{{$a.name}}{{/if}}, + {{foreach $info.maintainer as $a name=maintainers}} + {{if $a.link}}{{$a.name}}{{else}}{{$a.name}}{{/if}}{{if $smarty.foreach.maintainers.last}}{{else}}, {{/if}} {{/foreach}}

- + {{if $screenshot}} {{$screenshot.1}} {{/if}} From 0e19ce3a65907b21e4cb4e9ef561b35122fd8547 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 28 Jan 2018 00:06:53 -0500 Subject: [PATCH 2/5] [Doc] Add extra command for addon install/update --- doc/Install.md | 1 + doc/Update.md | 4 ++-- doc/de/Chats.md | 4 +++- doc/de/Install.md | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/Install.md b/doc/Install.md index c9fc4e603..0d992f660 100644 --- a/doc/Install.md +++ b/doc/Install.md @@ -61,6 +61,7 @@ Get the addons by going into your website folder. Clone the addon repository (separately): git clone https://github.com/friendica/friendica-addons.git addon + util/composer install -d addon If you copy the directory tree to your webserver, make sure that you also copy .htaccess - as "dot" files are often hidden and aren't normally copied. diff --git a/doc/Update.md b/doc/Update.md index 57d29bae4..a1b62748c 100644 --- a/doc/Update.md +++ b/doc/Update.md @@ -25,8 +25,8 @@ You can get the latest changes at any time with The addon tree has to be updated separately like so: - cd path/to/friendica/addon - git pull + git -C addon pull + util/composer.phar install -d addon For both repositories: The default branch to use is the ``master`` branch, which is the stable version of Friendica. diff --git a/doc/de/Chats.md b/doc/de/Chats.md index fc46af650..0f724cb2d 100644 --- a/doc/de/Chats.md +++ b/doc/de/Chats.md @@ -46,7 +46,9 @@ Als erstes musst Du die aktuellste Version herunterladen: Per Git:

-cd /var/www/<Pfad zu Deiner friendica-Installation>/addon; git pull +cd /var/www/<Pfad zu Deiner friendica-Installation> +git -C addon pull +util/composer.phar install -d addon

oder als normaler Download von hier: https://github.com/friendica/friendica-addons/blob/master/jappixmini.tgz (auf „view raw“ klicken) diff --git a/doc/de/Install.md b/doc/de/Install.md index 8c7c72cfc..6a72e218d 100644 --- a/doc/de/Install.md +++ b/doc/de/Install.md @@ -62,9 +62,9 @@ Wir planen, diese Einschränkung in einer zukünftigen Version zu beheben. - Um das Addon-Verzeichnis aktuell zu halten, solltest du in diesem Pfad ein "git pull"-Befehl eintragen - `cd meinewebseite/addon` + `git -C addon pull` - `git pull` + `util/composer.phar install -d addon` - Wenn du den Verzeichnispfad auf deinen Webserver kopierst, dann stelle sicher, dass du auch die .htaccess kopierst, da "Punkt"-Dateien oft versteckt sind und normalerweise nicht direkt kopiert werden. From 938c42cf901504d8fce17cf0ed83d6c0a4f2862a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 28 Jan 2018 00:09:23 -0500 Subject: [PATCH 3/5] [Doc] Fix indentation --- doc/Update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Update.md b/doc/Update.md index a1b62748c..2089b8e42 100644 --- a/doc/Update.md +++ b/doc/Update.md @@ -26,7 +26,7 @@ You can get the latest changes at any time with The addon tree has to be updated separately like so: git -C addon pull - util/composer.phar install -d addon + util/composer.phar install -d addon For both repositories: The default branch to use is the ``master`` branch, which is the stable version of Friendica. From de15984fd1d25353fe44c5b253332246dbd3a895 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 28 Jan 2018 12:57:01 -0500 Subject: [PATCH 4/5] Revert "[Doc] Fix indentation" This reverts commit 938c42cf901504d8fce17cf0ed83d6c0a4f2862a. --- doc/Update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Update.md b/doc/Update.md index 2089b8e42..a1b62748c 100644 --- a/doc/Update.md +++ b/doc/Update.md @@ -26,7 +26,7 @@ You can get the latest changes at any time with The addon tree has to be updated separately like so: git -C addon pull - util/composer.phar install -d addon + util/composer.phar install -d addon For both repositories: The default branch to use is the ``master`` branch, which is the stable version of Friendica. From 6d93c504578de4693a69d4052fa9c36e40941a84 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 28 Jan 2018 12:57:03 -0500 Subject: [PATCH 5/5] Revert "[Doc] Add extra command for addon install/update" This reverts commit 0e19ce3a65907b21e4cb4e9ef561b35122fd8547. --- doc/Install.md | 1 - doc/Update.md | 4 ++-- doc/de/Chats.md | 4 +--- doc/de/Install.md | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/doc/Install.md b/doc/Install.md index 0d992f660..c9fc4e603 100644 --- a/doc/Install.md +++ b/doc/Install.md @@ -61,7 +61,6 @@ Get the addons by going into your website folder. Clone the addon repository (separately): git clone https://github.com/friendica/friendica-addons.git addon - util/composer install -d addon If you copy the directory tree to your webserver, make sure that you also copy .htaccess - as "dot" files are often hidden and aren't normally copied. diff --git a/doc/Update.md b/doc/Update.md index a1b62748c..57d29bae4 100644 --- a/doc/Update.md +++ b/doc/Update.md @@ -25,8 +25,8 @@ You can get the latest changes at any time with The addon tree has to be updated separately like so: - git -C addon pull - util/composer.phar install -d addon + cd path/to/friendica/addon + git pull For both repositories: The default branch to use is the ``master`` branch, which is the stable version of Friendica. diff --git a/doc/de/Chats.md b/doc/de/Chats.md index 0f724cb2d..fc46af650 100644 --- a/doc/de/Chats.md +++ b/doc/de/Chats.md @@ -46,9 +46,7 @@ Als erstes musst Du die aktuellste Version herunterladen: Per Git:

-cd /var/www/<Pfad zu Deiner friendica-Installation> -git -C addon pull -util/composer.phar install -d addon +cd /var/www/<Pfad zu Deiner friendica-Installation>/addon; git pull

oder als normaler Download von hier: https://github.com/friendica/friendica-addons/blob/master/jappixmini.tgz (auf „view raw“ klicken) diff --git a/doc/de/Install.md b/doc/de/Install.md index 6a72e218d..8c7c72cfc 100644 --- a/doc/de/Install.md +++ b/doc/de/Install.md @@ -62,9 +62,9 @@ Wir planen, diese Einschränkung in einer zukünftigen Version zu beheben. - Um das Addon-Verzeichnis aktuell zu halten, solltest du in diesem Pfad ein "git pull"-Befehl eintragen - `git -C addon pull` + `cd meinewebseite/addon` - `util/composer.phar install -d addon` + `git pull` - Wenn du den Verzeichnispfad auf deinen Webserver kopierst, dann stelle sicher, dass du auch die .htaccess kopierst, da "Punkt"-Dateien oft versteckt sind und normalerweise nicht direkt kopiert werden.