113 'subtype' =>
'comment',
116 'wheres' => [$condition],
133 $parts[
'fragment'] =
"elgg-object-{$comment->guid}";
197 function _elgg_comments_notification_email_subject($hook,
$type, $returnvalue,
$params) {
198 if (!is_array($returnvalue) || !is_array($returnvalue[
'params'])) {
203 if (empty($returnvalue[
'params'][
'notification'])) {
208 $notification = $returnvalue[
'params'][
'notification'];
210 if ($notification instanceof
Elgg\Notifications\Notification) {
216 $returnvalue[
'subject'] =
'Re: ' .
$container->getDisplayName();
243 'subtype' =>
'comment',
244 'container_guid' =>
$entity->getGUID(),
245 'wheres' => [
function(\Elgg\Database\QueryBuilder $qb, $main_alias) use (
$entity) {
251 $batch = new \ElggBatch(
'elgg_get_entities',
$options, null, 25,
false);
254 $comment->access_id =
$entity->access_id;
278 if (!$event instanceof \
Elgg\Notifications\SubscriptionNotificationEvent) {
282 if ($event->getAction() !==
'create') {
291 $content_owner =
$object->getContainerEntity()->getOwnerEntity();
292 if (!$content_owner instanceof
ElggUser) {
301 $returnvalue[$content_owner->guid] = [];
307 $returnvalue[$content_owner->guid][] = $method;
335 if (
$content->owner_guid !== $recipient->guid) {
344 $returnvalue->subject =
elgg_echo(
'generic_comment:notification:owner:subject', [],
$language);
345 $returnvalue->summary =
elgg_echo(
'generic_comment:notification:owner:summary', [],
$language);
346 $returnvalue->body =
elgg_echo(
'generic_comment:notification:owner:body', [
380 if (
$content->getOwnerGUID() === $recipient->getGUID()) {
391 $returnvalue->body =
elgg_echo(
'generic_comment:notification:user:body', [
400 $returnvalue->url =
$comment->getURL();
416 $entity = $hook->getEntityParam();
421 $return = $hook->getValue();
424 $can_comment =
$entity->canComment();
430 'icon' =>
'speech-bubble',
434 'href' =>
$entity->getURL() .
'#comments',
437 $item = $hook->getParam(
'item');
438 if (
$item && $can_comment) {
439 $options[
'href'] =
"#comments-add-{$entity->guid}-{$item->id}";
470 $events->registerHandler(
'init',
'system',
'_elgg_comments_init');
471 $hooks->registerHandler(
'unit_test',
'system',
'_elgg_comments_test');
elgg_http_add_url_query_elements($url, array $elements)
Sets elements in a URL's query string.
if(!$item instanceof ElggRiverItem) $object
$params
Saves global plugin settings.
const ELGG_VALUE_INTEGER
Value types.
Database abstraction query builder.
elgg parse_url
Parse a URL into its parts.
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Base class for events and hooks.
elgg_get_entities(array $options=[])
Fetches/counts entities or performs a calculation on their properties.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
$enabled
Sample cli installer script.
compare($x, $comparison, $y=null, $type=null, $case_sensitive=null)
Build value comparison clause.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
elgg_register_ajax_view($view)
Register a view to be available for ajax calls.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
elgg_register_notification_event($object_type, $object_subtype, array $actions=[])
Register a notification event.
elgg register_error
Wrapper function for system_messages.
elgg_http_build_url(array $parts, $html_encode=true)
Builds a URL from the a parts array like one returned by parse_url().
if(!empty($item->annotation_id)||!$object instanceof ElggEntity||$object instanceof ElggComment) $comment_count
elgg_register_entity_type($type, $subtype=null)
Registers an entity type and subtype as a public-facing entity that should be shown in search and by ...
get_entity($guid)
Loads and returns an entity object from a guid.