diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-10-25 16:54:18 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-10-25 16:54:18 -0700 |
commit | 917d0ced4a1f0890172b90a9551131fa43bea78b (patch) | |
tree | 7a8dc4572eb51d8ae3c49328117702e043b58e42 | |
parent | 7f3df847a2ba1e836c930f89a681e1589131f557 (diff) | |
download | volse-hubzilla-917d0ced4a1f0890172b90a9551131fa43bea78b.tar.gz volse-hubzilla-917d0ced4a1f0890172b90a9551131fa43bea78b.tar.bz2 volse-hubzilla-917d0ced4a1f0890172b90a9551131fa43bea78b.zip |
new feature: delayed posting
-rw-r--r-- | include/conversation.php | 7 | ||||
-rw-r--r-- | include/features.php | 3 | ||||
-rw-r--r-- | include/notifier.php | 2 | ||||
-rwxr-xr-x | view/tpl/jot-header.tpl | 13 | ||||
-rwxr-xr-x | view/tpl/jot.tpl | 28 |
5 files changed, 51 insertions, 2 deletions
diff --git a/include/conversation.php b/include/conversation.php index ebbc6684c..c2d9641ba 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1166,6 +1166,10 @@ function status_editor($a, $x, $popup = false) { if($defexpire) $defexpire = datetime_convert('UTC',date_default_timezone_get(),$defexpire,'Y-m-d H:i'); + $defpublish = ((($z = get_pconfig($x['profile_uid'], 'system', 'default_post_publish')) && (! $webpage)) ? $z : ''); + if($defpublish) + $defpublish = datetime_convert('UTC',date_default_timezone_get(),$defpublish,'Y-m-d H:i'); + $cipher = get_pconfig($x['profile_uid'], 'system', 'default_cipher'); if(! $cipher) $cipher = 'aes256'; @@ -1237,6 +1241,9 @@ function status_editor($a, $x, $popup = false) { '$defexpire' => $defexpire, '$feature_expire' => ((feature_enabled($x['profile_uid'], 'content_expire') && (! $webpage)) ? true : false), '$expires' => t('Set expiration date'), + '$defpublish' => $defpublish, + '$feature_future' => ((feature_enabled($x['profile_uid'], 'delayed_posting') && (! $webpage)) ? true : false), + '$future_txt' => t('Set publish date'), '$feature_encrypt' => ((feature_enabled($x['profile_uid'], 'content_encrypt') && (! $webpage)) ? true : false), '$encrypt' => t('Encrypt text'), '$cipher' => $cipher, diff --git a/include/features.php b/include/features.php index 993a2e33f..74ae7b3d7 100644 --- a/include/features.php +++ b/include/features.php @@ -58,7 +58,8 @@ function get_features() { array('large_photos', t('Large Photos'), t('Include large (1024px) photo thumbnails in posts. If not enabled, use small (640px) photo thumbnails'),false), array('channel_sources', t('Channel Sources'), t('Automatically import channel content from other channels or feeds'),false), array('content_encrypt', t('Even More Encryption'), t('Allow optional encryption of content end-to-end with a shared secret key'),false), - array('consensus_tools', t('Enable voting tools'), t('Provide a class of post which others can vote on'),false), + array('consensus_tools', t('Enable Voting Tools'), t('Provide a class of post which others can vote on'),false), + array('delayed_posting', t('Delayed Posting'), t('Allow posts to be published at a later date'),false), ), diff --git a/include/notifier.php b/include/notifier.php index 385062f07..0b29146c1 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -366,7 +366,7 @@ function notifier_run($argv, $argc){ logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG); return; } - if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed_publish'])) { + if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed'])) { logger('notifier: target item not published, so not forwardable', LOGGER_DEBUG); return; } diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 7e12c6bb3..b405e4ac8 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -234,6 +234,19 @@ function enableOnUser(){ }) } + function jotGetPubDate() { + //reply = prompt("{{$expirewhen}}", $('#jot-expire').val()); + $('#createdModal').modal(); + $('#created-modal-OKButton').on('click', function() { + reply=$('#created-date').val(); + if(reply && reply.length) { + $('#jot-created').val(reply); + $('#createdModal').modal('hide'); + } + }) + } + + function jotShare(id) { if ($('#jot-popup').length != 0) $('#jot-popup').show(); diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index e61d75fee..bc3915f93 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -8,6 +8,7 @@ <input type="hidden" name="return" value="{{$return_path}}" /> <input type="hidden" name="location" id="jot-location" value="{{$defloc}}" /> <input type="hidden" name="expire" id="jot-expire" value="{{$defexpire}}" /> + <input type="hidden" name="created" id="jot-created" value="{{$defpublish}}" /> <input type="hidden" name="media_str" id="jot-media" value="" /> <input type="hidden" name="source" id="jot-source" value="{{$source}}" /> <input type="hidden" name="coord" id="jot-coord" value="" /> @@ -91,6 +92,11 @@ <i id="profile-expires" class="icon-eraser jot-icons"></i> </button> {{/if}} + {{if $feature_future}} + <button id="profile-future-wrapper" class="btn btn-default btn-sm" title="{{$future_txt}}" onclick="jotGetPubDate();return false;"> + <i id="profile-future" class="icon-time jot-icons"></i> + </button> + {{/if}} {{if $feature_encrypt}} <button id="profile-encrypt-wrapper" class="btn btn-default btn-sm" title="{{$encrypt}}" onclick="red_encrypt('{{$cipher}}','#profile-jot-text',$('#profile-jot-text').val());return false;"> <i id="profile-encrypt" class="icon-key jot-icons"></i> @@ -180,6 +186,28 @@ </div><!-- /.modal-dialog --> </div><!-- /.modal --> +<!-- Modal for item created--> +<div class="modal" id="createdModal" tabindex="-1" role="dialog" aria-labelledby="createdModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="createdModalLabel">{{$future_txt}}</h4> + </div> + <!-- <div class="modal-body"> --> + <div class="modal-body form-group" style="width:90%"> + <div class='date'><input type='text' placeholder='yyyy-mm-dd HH:MM' name='start_text' id='created-date' class="form-control" /></div><script type='text/javascript'>$(function () {var picker = $('#created-date').datetimepicker({format:'Y-m-d H:i', minDate: 0 }); })</script> + </div> + <!-- </div> --> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">{{$expiryModalCANCEL}}</button> + <button id="created-modal-OKButton" type="button" class="btn btn-primary">{{$expiryModalOK}}</button> + </div> + </div><!-- /.modal-content --> + </div><!-- /.modal-dialog --> +</div><!-- /.modal --> + + {{if $content || $attachment || $expanded}} <script>initEditor();</script> {{/if}} |