+ $o .= Renderer::replaceMacros(Renderer::getMarkupTemplate('voting_fakelink.tpl'), [
+ '$phrase' => $phrase,
+ '$type' => $verb,
+ '$id' => $id
+ ]);
+ $o .= $expanded;
+
+ $this->profiler->stopRecording();
+ return $o;
+ }
+
+ public function statusEditor(array $x = [], $notes_cid = 0, $popup = false)
+ {
+ $user = User::getById($this->app->getLoggedInUserId(), ['uid', 'nickname', 'allow_location', 'default-location']);
+ if (empty($user['uid'])) {
+ return '';
+ }
+
+ $this->profiler->startRecording('rendering');
+ $o = '';
+
+ $x['allow_location'] = $x['allow_location'] ?? $user['allow_location'];
+ $x['default_location'] = $x['default_location'] ?? $user['default-location'];
+ $x['nickname'] = $x['nickname'] ?? $user['nickname'];
+ $x['lockstate'] = $x['lockstate'] ?? ACL::getLockstateForUserId($user['uid']) ? 'lock' : 'unlock';
+ $x['acl'] = $x['acl'] ?? ACL::getFullSelectorHTML($this->page, $user['uid'], true);
+ $x['bang'] = $x['bang'] ?? '';
+ $x['visitor'] = $x['visitor'] ?? 'block';
+ $x['is_owner'] = $x['is_owner'] ?? true;
+ $x['profile_uid'] = $x['profile_uid'] ?? local_user();
+
+
+ $geotag = !empty($x['allow_location']) ? Renderer::replaceMacros(Renderer::getMarkupTemplate('jot_geotag.tpl'), []) : '';
+
+ $tpl = Renderer::getMarkupTemplate('jot-header.tpl');
+ $this->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
+ '$newpost' => 'true',
+ '$baseurl' => $this->baseURL->get(true),
+ '$geotag' => $geotag,
+ '$nickname' => $x['nickname'],
+ '$ispublic' => $this->l10n->t('Visible to <strong>everybody</strong>'),
+ '$linkurl' => $this->l10n->t('Please enter a image/video/audio/webpage URL:'),
+ '$term' => $this->l10n->t('Tag term:'),
+ '$fileas' => $this->l10n->t('Save to Folder:'),
+ '$whereareu' => $this->l10n->t('Where are you right now?'),
+ '$delitems' => $this->l10n->t("Delete item\x28s\x29?"),
+ '$is_mobile' => $this->mode->isMobile(),
+ ]);
+
+ $jotplugins = '';
+ Hook::callAll('jot_tool', $jotplugins);
+
+ if ($this->config->get('system', 'set_creation_date')) {
+ $created_at = Temporal::getDateTimeField(
+ new \DateTime(DBA::NULL_DATETIME),
+ new \DateTime('now'),
+ null,
+ $this->l10n->t('Created at'),
+ 'created_at'
+ );
+ } else {
+ $created_at = '';
+ }
+
+ $tpl = Renderer::getMarkupTemplate("jot.tpl");
+
+ $o .= Renderer::replaceMacros($tpl, [
+ '$new_post' => $this->l10n->t('New Post'),
+ '$return_path' => $this->args->getQueryString(),
+ '$action' => 'item',
+ '$share' => ($x['button'] ?? '') ?: $this->l10n->t('Share'),
+ '$loading' => $this->l10n->t('Loading...'),
+ '$upload' => $this->l10n->t('Upload photo'),
+ '$shortupload' => $this->l10n->t('upload photo'),
+ '$attach' => $this->l10n->t('Attach file'),
+ '$shortattach' => $this->l10n->t('attach file'),
+ '$edbold' => $this->l10n->t('Bold'),
+ '$editalic' => $this->l10n->t('Italic'),
+ '$eduline' => $this->l10n->t('Underline'),
+ '$edquote' => $this->l10n->t('Quote'),
+ '$edcode' => $this->l10n->t('Code'),
+ '$edimg' => $this->l10n->t('Image'),
+ '$edurl' => $this->l10n->t('Link'),
+ '$edattach' => $this->l10n->t('Link or Media'),
+ '$edvideo' => $this->l10n->t('Video'),
+ '$setloc' => $this->l10n->t('Set your location'),
+ '$shortsetloc' => $this->l10n->t('set location'),
+ '$noloc' => $this->l10n->t('Clear browser location'),
+ '$shortnoloc' => $this->l10n->t('clear location'),
+ '$title' => $x['title'] ?? '',
+ '$placeholdertitle' => $this->l10n->t('Set title'),
+ '$category' => $x['category'] ?? '',
+ '$placeholdercategory' => Feature::isEnabled(local_user(), 'categories') ? $this->l10n->t("Categories \x28comma-separated list\x29") : '',
+ '$scheduled_at' => Temporal::getDateTimeField(
+ new \DateTime(),
+ new \DateTime('now + 6 months'),
+ null,
+ $this->l10n->t('Scheduled at'),
+ 'scheduled_at'
+ ),
+ '$created_at' => $created_at,
+ '$wait' => $this->l10n->t('Please wait'),
+ '$permset' => $this->l10n->t('Permission settings'),
+ '$shortpermset' => $this->l10n->t('Permissions'),
+ '$wall' => $notes_cid ? 0 : 1,
+ '$posttype' => $notes_cid ? ItemModel::PT_PERSONAL_NOTE : ItemModel::PT_ARTICLE,
+ '$content' => $x['content'] ?? '',
+ '$post_id' => $x['post_id'] ?? '',
+ '$baseurl' => $this->baseURL->get(true),
+ '$defloc' => $x['default_location'],
+ '$visitor' => $x['visitor'],
+ '$pvisit' => $notes_cid ? 'none' : $x['visitor'],
+ '$public' => $this->l10n->t('Public post'),
+ '$lockstate' => $x['lockstate'],
+ '$bang' => $x['bang'],
+ '$profile_uid' => $x['profile_uid'],
+ '$preview' => $this->l10n->t('Preview'),
+ '$jotplugins' => $jotplugins,
+ '$notes_cid' => $notes_cid,
+ '$cancel' => $this->l10n->t('Cancel'),
+ '$rand_num' => Crypto::randomDigits(12),
+
+ // ACL permissions box
+ '$acl' => $x['acl'],
+
+ //jot nav tab (used in some themes)
+ '$message' => $this->l10n->t('Message'),
+ '$browser' => $this->l10n->t('Browser'),
+
+ '$compose_link_title' => $this->l10n->t('Open Compose page'),
+ ]);
+
+
+ if ($popup == true) {
+ $o = '<div id="jot-popup" style="display: none;">' . $o . '</div>';
+ }
+
+ $this->profiler->stopRecording();
+ return $o;