use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode;
use Friendica\Core\ACL;
+use Friendica\Core\Addon;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
if (!DBA::isResult($items)) {
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+ /*
+ * Hmmm, code depending on the presence of a particular addon?
+ * This should be better if done by a hook
+ */
+ $qcomment = null;
+ if (Addon::isEnabled('qcomment')) {
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+ $qcomment = $words ? explode("\n", $words) : [];
+ }
+
$comments .= Renderer::replaceMacros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_path,
'$preview' => DI::l10n()->t('Preview'),
'$loading' => DI::l10n()->t('Loading...'),
'$sourceapp' => DI::l10n()->t($a->sourcename),
- '$ww' => '',
+ '$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12)
]);
}
}
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+ /*
+ * Hmmm, code depending on the presence of a particular addon?
+ * This should be better if done by a hook
+ */
+ $qcomment = null;
+ if (Addon::isEnabled('qcomment')) {
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+ $qcomment = $words ? explode("\n", $words) : [];
+ }
+
$comments .= Renderer::replaceMacros($cmnt_tpl,[
'$return_path' => '',
'$jsreload' => $return_path,
'$submit' => DI::l10n()->t('Submit'),
'$preview' => DI::l10n()->t('Preview'),
'$sourceapp' => DI::l10n()->t($a->sourcename),
- '$ww' => '',
+ '$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12)
]);
}
]);
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
+ /*
+ * Hmmm, code depending on the presence of a particular addon?
+ * This should be better if done by a hook
+ */
+ $qcomment = null;
+ if (Addon::isEnabled('qcomment')) {
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+ $qcomment = $words ? explode("\n", $words) : [];
+ }
+
$comments .= Renderer::replaceMacros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_path,
'$submit' => DI::l10n()->t('Submit'),
'$preview' => DI::l10n()->t('Preview'),
'$sourceapp' => DI::l10n()->t($a->sourcename),
- '$ww' => '',
+ '$qcomment' => $qcomment,
'$rand_num' => Crypto::randomDigits(12)
]);
}
$comment_box = '';
$conv = $this->getThread();
- $ww = '';
- if (($conv->getMode() === 'network') && $this->isWallToWall()) {
- $ww = 'ww';
- }
if ($conv->isWritable() && $this->isWritable()) {
- $qcomment = null;
-
/*
* Hmmm, code depending on the presence of a particular addon?
* This should be better if done by a hook
*/
+ $qcomment = null;
if (Addon::isEnabled('qcomment')) {
- $qc = ((local_user()) ? DI::pConfig()->get(local_user(), 'qcomment', 'words') : null);
- $qcomment = (($qc) ? explode("\n", $qc) : null);
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+ $qcomment = $words ? explode("\n", $words) : [];
}
// Fetch the user id from the parent when the owner user is empty
'$preview' => DI::l10n()->t('Preview'),
'$indent' => $indent,
'$sourceapp' => DI::l10n()->t($a->sourcename),
- '$ww' => $conv->getMode() === 'network' ? $ww : '',
'$rand_num' => Crypto::randomDigits(12)
]);
}
$("#comment-edit-text-" + id).val(tmpStr + ins);
}
- function qCommentInsert(obj,id) {
- var tmpStr = $("#comment-edit-text-" + id).val();
- if (tmpStr == "") {
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- openMenu("comment-edit-submit-wrapper-" + id);
- }
- var ins = $(obj).val();
- ins = ins.replace("<","<");
- ins = ins.replace(">",">");
- ins = ins.replace("&","&");
- ins = ins.replace(""","\"");
- $("#comment-edit-text-" + id).val(tmpStr + ins);
- $(obj).val("");
- }
-
function showHideCommentBox(id) {
if ($("#comment-edit-form-" + id).is(":visible")) {
$("#comment-edit-form-" + id).hide();