Added option to define a schedule date when posting items
This commit is contained in:
@@ -1143,6 +1143,9 @@ class Item
|
||||
|
||||
if (!$dontcache) {
|
||||
if ($notify) {
|
||||
if (!\Friendica\Content\Feature::isEnabled($posted_item['uid'], 'explicit_mentions') && ($posted_item['gravity'] == GRAVITY_COMMENT)) {
|
||||
Tag::createImplicitMentions($posted_item['uri-id'], $posted_item['thr-parent-id']);
|
||||
}
|
||||
Hook::callAll('post_local_end', $posted_item);
|
||||
} else {
|
||||
Hook::callAll('post_remote_end', $posted_item);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
namespace Friendica\Module\Item;
|
||||
|
||||
use DateTime;
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\ACL;
|
||||
@@ -34,6 +35,8 @@ use Friendica\Model\User;
|
||||
use Friendica\Module\Security\Login;
|
||||
use Friendica\Network\HTTPException\NotImplementedException;
|
||||
use Friendica\Util\Crypto;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
class Compose extends BaseModule
|
||||
{
|
||||
@@ -162,6 +165,14 @@ class Compose extends BaseModule
|
||||
'$wait' => DI::l10n()->t('Please wait'),
|
||||
'$placeholdertitle' => DI::l10n()->t('Set title'),
|
||||
'$placeholdercategory' => (Feature::isEnabled(local_user(),'categories') ? DI::l10n()->t('Categories (comma-separated list)') : ''),
|
||||
'$scheduled_at' => Temporal::getDateTimeField(
|
||||
new DateTime(),
|
||||
DateTime::createFromFormat(DateTimeFormat::MYSQL, DateTimeFormat::local('now + 6 months')),
|
||||
null,
|
||||
DI::l10n()->t('Scheduled at'),
|
||||
'scheduled_at',
|
||||
),
|
||||
|
||||
|
||||
'$title' => $title,
|
||||
'$category' => $category,
|
||||
|
||||
@@ -225,7 +225,7 @@ class Temporal
|
||||
public static function getDateTimeField(
|
||||
DateTime $minDate,
|
||||
DateTime $maxDate,
|
||||
DateTime $defaultDate,
|
||||
DateTime $defaultDate = null,
|
||||
$label,
|
||||
$id = 'datetimepicker',
|
||||
$pickdate = true,
|
||||
|
||||
Reference in New Issue
Block a user