Change mp-syndicate-to to syndicate-to

This commit is contained in:
Jonny Barnes 2016-06-23 23:13:38 +01:00
parent 8d7b38169b
commit 578096419f
4 changed files with 10 additions and 9 deletions

View file

@ -160,10 +160,10 @@ class MicropubClientController extends Controller
'contents' => $request->input('reply-to'),
];
}
if ($request->input('mp-syndicate-to')) {
foreach ($request->input('mp-syndicate-to') as $syn) {
if ($request->input('syndicate-to')) {
foreach ($request->input('syndicate-to') as $syn) {
$multipart[] = [
'name' => 'mp-syndicate-to',
'name' => 'syndicate-to',
'contents' => $syn,
];
}
@ -320,14 +320,14 @@ class MicropubClientController extends Controller
if ($syndicationTargets === null) {
return;
}
$mpSyndicateTo = [];
$syndicateTo = [];
$parts = explode(';', $syndicationTargets);
foreach ($parts as $part) {
$target = explode('=', $part);
$mpSyndicateTo[] = urldecode($target[1]);
$syndicateTo[] = urldecode($target[1]);
}
if (count($mpSyndicateTo) > 0) {
return $mpSyndicateTo;
if (count($syndicateTo) > 0) {
return $syndicateTo;
}
}
}

View file

@ -109,7 +109,7 @@ class MicropubController extends Controller
//we have a valid token, is `syndicate-to` set?
if ($request->input('q') === 'syndicate-to') {
$content = http_build_query([
'mp-syndicate-to' => 'twitter.com/jonnybarnes',
'syndicate-to' => 'twitter.com/jonnybarnes',
]);
return (new Response($content, 200))

View file

@ -2,6 +2,7 @@
## Version {next}
- Automatically send webmentions
- Change `mp-syndicate-to` to `syndicate-to`
## Version 0.0.4 (2016-06-21)
- Move bower components into their own subdir

View file

@ -5,7 +5,7 @@
<label for="in-reply-to" accesskey="r">Reply-to: </label><input type="text" name="in-reply-to" id="in-reply-to" placeholder="in-reply-to-1 in-reply-to-2 …" value="{{ old('in-reply-to') }}">
<label for="content" accesskey="n">Note: </label><textarea name="content" id="content" placeholder="Note" autofocus>{{ old('content') }}</textarea>
@if ($micropub === true)
<label for="syndication" accesskey="s">Syndication: </label>@if($syndication)<ul class="syndication-targets-list" name="syndication">@foreach($syndication as $target)<li><input type="checkbox" name="mp-syndicate-to[]" id="{{ $target }}" value="{{ $target }}" checked="checked"> <label for="{{ $target }}">{{ $target }}</label></li>@endforeach</ul>@endif
<label for="syndication" accesskey="s">Syndication: </label>@if($syndication)<ul class="syndication-targets-list" name="syndication">@foreach($syndication as $target)<li><input type="checkbox" name="syndicate-to[]" id="{{ $target }}" value="{{ $target }}" checked="checked"> <label for="{{ $target }}">{{ $target }}</label></li>@endforeach</ul>@endif
<a href="/refresh-syndication-targets">Refresh Syndication Targets</a><br>
@endif
<label for="photo" accesskey="p">Photo: </label><input type="file" accept="image/*" value="Upload" name="photo[]" id="photo" multiple>