str_replace('/item/', '/conversation/', $arr['parent_mid']), 'type' => 'Collection', 'attributedTo' => z_root() . '/channel/' . $channel['channel_address'], ]; $arr['tgt_type'] = 'Collection'; $post = item_store($arr); $item_id = $post['item_id']; $approval_id = $post['approval_id'] ?? 0; if ($item_id) { Run::Summon(['Notifier', 'activity', $item_id]); if ($approval_id) { Run::Summon(['Notifier', 'activity', $approval_id]); } } Hook::call('post_local_end', $arr); if ($_SESSION['return_url']) { goaway(z_root() . '/' . $_SESSION['return_url']); } return; } public function get() { if (!local_channel()) { notice(t('Permission denied.') . EOL); return ''; } if (!Apps::system_app_installed(local_channel(), 'Mood')) { //Do not display any associated widgets at this point App::$pdl = ''; $o = 'Mood App (Not Installed):
'; $o .= t('Set your current mood and tell your friends'); return $o; } Navbar::set_selected('Mood'); $parent = ((x($_GET, 'parent')) ? intval($_GET['parent']) : '0'); $verbs = get_mood_verbs(); $shortlist = []; foreach ($verbs as $k => $v) { if ($v !== 'NOTRANSLATION') { $shortlist[] = [$k, $v]; } } $tpl = Theme::get_template('mood_content.tpl'); $o = replace_macros($tpl, [ '$title' => t('Mood'), '$desc' => t('Set your current mood and tell your friends'), '$verbs' => $shortlist, '$parent' => $parent, '$submit' => t('Submit'), ]); return $o; } }