Merge pull request #4350 from MrPetovan/task/4116-move-twitteroauth-to-composer

Move TwitterOAuth to composer Part 1
This commit is contained in:
Michael Vogel 2018-01-28 19:19:21 +01:00 committed by GitHub
commit 946fc82c77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 27 deletions

View file

@ -254,25 +254,26 @@ class Addon
*
* like
* \code
*...* Name: addon
* * Description: An addon which plugs in
* . * Version: 1.2.3
* * Author: John <profile url>
* * Author: Jane <email>
* *
* *\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 <profile url>
* * Author: Jane <email>
* * Maintainer: Jess <email>
* *
* *\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;
}
}
}

View file

@ -1,22 +1,22 @@
<div id='adminpage'>
<h1>{{$title}} - {{$page}}</h1>
<p><span class='toggleplugin icon {{$status}}'></span> {{$info.name}} - {{$info.version}} : <a href="{{$baseurl}}/admin/{{$function}}/{{$addon}}/?a=t&amp;t={{$form_security_token}}">{{$action}}</a></p>
<p>{{$info.description}}</p>
<p class="author">{{$str_author}}
{{foreach $info.author as $a}}
{{if $a.link}}<a href="{{$a.link}}">{{$a.name}}</a>{{else}}{{$a.name}}{{/if}},
{{foreach $info.author as $a name=authors}}
{{if $a.link}}<a href="{{$a.link}}">{{$a.name}}</a>{{else}}{{$a.name}}{{/if}}{{if $smarty.foreach.authors.last}}{{else}}, {{/if}}
{{/foreach}}
</p>
<p class="maintainer">{{$str_maintainer}}
{{foreach $info.maintainer as $a}}
{{if $a.link}}<a href="{{$a.link}}">{{$a.name}}</a>{{else}}{{$a.name}}{{/if}},
{{foreach $info.maintainer as $a name=maintainers}}
{{if $a.link}}<a href="{{$a.link}}">{{$a.name}}</a>{{else}}{{$a.name}}{{/if}}{{if $smarty.foreach.maintainers.last}}{{else}}, {{/if}}
{{/foreach}}
</p>
{{if $screenshot}}
<a href="{{$screenshot.0}}" class='screenshot'><img src="{{$screenshot.0}}" alt="{{$screenshot.1}}" /></a>
{{/if}}