2018-10-12 03:21:49 +02:00
|
|
|
<?php
|
|
|
|
$unnatributed = (object) array(
|
2018-11-09 19:34:12 +01:00
|
|
|
'name' => 'none (anonymous)',
|
2018-10-12 22:31:23 +02:00
|
|
|
'claim_id' => 'null'
|
2018-10-12 03:21:49 +02:00
|
|
|
);
|
|
|
|
$channels = LBRY()->daemon->channel_list();
|
2018-10-12 22:31:23 +02:00
|
|
|
$channels[] = $unnatributed;
|
|
|
|
// Sort the channels in a natural way
|
|
|
|
usort($channels, array('LBRYPress', 'channel_name_comp'));
|
|
|
|
$cur_channel = get_post_meta($post->ID, LBRY_POST_CHANNEL, true);
|
|
|
|
$will_publish = get_post_meta($post->ID, LBRY_WILL_PUBLISH, true);
|
2018-10-12 03:21:49 +02:00
|
|
|
?>
|
2018-10-12 05:59:01 +02:00
|
|
|
<?php wp_nonce_field('lbry_publish_channels', '_lbrynonce'); ?>
|
2018-10-12 22:31:23 +02:00
|
|
|
<div class="lbry-meta-checkbox-wrapper">
|
|
|
|
<label class="lbry-meta-label">
|
|
|
|
<input type="checkbox" class="lbry-meta-checkbox" name="<?= LBRY_WILL_PUBLISH ?>" value="true"
|
|
|
|
<?php
|
|
|
|
if ($will_publish === 'true' || $will_publish === '') {
|
|
|
|
echo 'checked';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
>
|
|
|
|
Sync this post on channel:
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<select class="lbry-meta-select" name="<?= LBRY_POST_CHANNEL ?>">
|
|
|
|
<?php foreach ($channels as $index=>$channel): ?>
|
|
|
|
<option value="<?= $channel->claim_id ?>"
|
|
|
|
<?php
|
|
|
|
if ($cur_channel) {
|
|
|
|
if ($cur_channel === $channel->claim_id) {
|
|
|
|
echo 'selected';
|
|
|
|
}
|
|
|
|
} elseif ($index === 0) {
|
|
|
|
echo 'selected';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
>
|
|
|
|
<?= $channel->name ?>
|
|
|
|
</option>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|