diff --git a/Code/Lib/Activity.php b/Code/Lib/Activity.php index 222d63bd6..df6bf02cb 100644 --- a/Code/Lib/Activity.php +++ b/Code/Lib/Activity.php @@ -3774,9 +3774,8 @@ class Activity $commentApproval?->Reject(); return; } - - - } else { + } + else { // By default, if we allow you to send_stream and comments and this is a comment, it is allowed. // A side effect of this action is that if you take away send_stream permission, comments to those // posts you previously allowed will still be accepted. It is possible but might be difficult to fix this. diff --git a/Code/Module/Sources.php b/Code/Module/Sources.php index e367347f1..0b2cb1a0f 100644 --- a/Code/Module/Sources.php +++ b/Code/Module/Sources.php @@ -119,6 +119,7 @@ class Sources extends Controller ]); return $o; } + $required = t('This name currently must autocomplete to one of your connections'); if (argc() == 2 && argv(1) === 'new') { // TODO add the words 'or RSS feed' and corresponding code to manage feeds and frequency @@ -127,7 +128,7 @@ class Sources extends Controller '$title' => t('New Source'), '$desc' => t('Import all or selected content from the following channel into this channel and re-distribute it according to your channel settings.'), '$words' => ['words', t('Only import content with these words (one per line)'), '', t('Leave blank to import all public content')], - '$name' => ['name', t('Channel Name'), '', '', '', 'autocomplete="off"'], + '$name' => ['name', t('Channel Name'), '', $required, '', 'autocomplete="off"'], '$tags' => ['tags', t('Add the following categories to posts imported from this source (comma separated)'), '', t('Optional')], '$submit' => t('Submit') ]); @@ -155,16 +156,19 @@ class Sources extends Controller $r[0]['src_patt'] = htmlspecialchars($r[0]['src_patt'], ENT_QUOTES, 'UTF-8'); + $required = t('This name currently must autocomplete to one of your connections'); + $o = replace_macros(Theme::get_template('sources_edit.tpl'), array( '$title' => t('Edit Source'), '$drop' => t('Delete Source'), '$id' => $r[0]['src_id'], + '$desc' => t('Import all or selected content from the following channel into this channel and re-distribute it according to your channel settings.'), '$words' => array('words', t('Only import content with these words (one per line)'), $r[0]['src_patt'], t('Leave blank to import all public content')), '$xchan' => $r[0]['src_xchan'], '$abook' => $x[0]['abook_id'], '$tags' => array('tags', t('Add the following categories to posts imported from this source (comma separated)'), $r[0]['src_tag'], t('Optional')), - '$name' => array('name', t('Channel Name'), $r[0]['xchan_name'], ''), + '$name' => array('name', t('Channel Name'), $r[0]['xchan_name'], $required), '$submit' => t('Submit') )); return $o; diff --git a/Code/Widget/Settings_menu.php b/Code/Widget/Settings_menu.php index 792a24179..bbb2182ea 100644 --- a/Code/Widget/Settings_menu.php +++ b/Code/Widget/Settings_menu.php @@ -103,6 +103,23 @@ class Settings_menu implements WidgetInterface 'selected' => ((argv(1) === 'identities') ? 'active' : '') ]; + $links = q("select * from linkid where sigtype = %d and ident = '%s'", + intval(IDLINK_RELME), + dbesc($channel['channel_hash']) + ); + + $sources = q("select * from sources where src_channel_id = %d", + intval($channel['channel_id']) + ); + + if ($links || $sources) { + $tabs[] = [ + 'label' => t('Channel Sources'), + 'url' => z_root() . '/sources', + 'selected' => ((argv(1) === 'sources') ? 'active' : ''), + ]; + } + return replace_macros(Theme::get_template('generic_links_widget.tpl'), [ '$title' => t('Settings'), '$class' => 'settings-widget', diff --git a/view/tpl/sources_edit.tpl b/view/tpl/sources_edit.tpl index c65ab4b9d..06a6ab9d7 100644 --- a/view/tpl/sources_edit.tpl +++ b/view/tpl/sources_edit.tpl @@ -1,22 +1,25 @@ -
-

{{$title}}

+
+
+

{{$title}}

+
+
+
{{$desc}}
-
{{$desc}}
+
+ + + {{include file="field_input.tpl" field=$name}} + {{include file="field_input.tpl" field=$tags}} + {{include file="field_textarea.tpl" field=$words}} - - - -{{include file="field_input.tpl" field=$name}} -{{include file="field_input.tpl" field=$tags}} -{{include file="field_textarea.tpl" field=$words}} - -
- -
-
-
-
-{{$drop}} +
+ +
+ +
+
+ {{$drop}} +
diff --git a/view/tpl/sources_list.tpl b/view/tpl/sources_list.tpl index 76be35b1a..a0577a398 100644 --- a/view/tpl/sources_list.tpl +++ b/view/tpl/sources_list.tpl @@ -1,17 +1,20 @@ -
-

{{$title}}

+
+
+

{{$title}}

+
+
+
{{$desc}}
-
{{$desc}}
+ - - -{{if $sources}} - -{{/if}} + {{if $sources}} + + {{/if}} +
diff --git a/view/tpl/sources_new.tpl b/view/tpl/sources_new.tpl index 70fc512ae..4fb7ce290 100644 --- a/view/tpl/sources_new.tpl +++ b/view/tpl/sources_new.tpl @@ -1,17 +1,20 @@ -
-

{{$title}}

+
+
+

{{$title}}

+
+
+
{{$desc}}
-
{{$desc}}
+
+ + {{include file="field_input.tpl" field=$name}} + {{include file="field_input.tpl" field=$tags}} + {{include file="field_textarea.tpl" field=$words}} - - -{{include file="field_input.tpl" field=$name}} -{{include file="field_input.tpl" field=$tags}} -{{include file="field_textarea.tpl" field=$words}} - -
- -
-
+
+ +
+ +