$s = Asset::loaded($config->protocol . ICON_LIBRARY_PATH) ? '<i class="fa fa-times-circle"></i> ' : ""; echo ' <a href="' . $post->url . '" class="btn btn-reject btn-reject-reply"' . ($parent === false ? ' style="display:none;"' : "") . '>' . $s . $speak->cancel . '</a>'; } Weapon::add('comment_footer', 'do_response_reply', 20.1); Weapon::add('comment_form_button_after', 'do_response_reply_x'); Weapon::add('shell_before', 'do_response_reply_css'); Weapon::add('SHIPMENT_REGION_BOTTOM', 'do_response_reply_js'); // No JavaScript if ($parent !== false) { Guardian::memorize('parent', $parent); if ($response = Get::commentAnchor($parent)) { Weapon::add('chunk_before', function ($G) use($speak, $parent, $response) { if (File::N($G['data']['path']) === 'comment.form') { $prefix = File::B(File::D($response->path)); $to = Config::speak($prefix . '_reply_to_', Cell::a('#' . $prefix . '-' . $parent, $response->name)); echo Cell::h4($to); } }); } } // Error if ($s = Request::post('parent', false)) { Filter::add('guardian:kick', function ($url) use($config, $s) { if (!Notify::errors()) { return $url; } $ss = explode('#', $url, 2); return $config->url_current . HTTP::query('reply', $s) . '#' . $ss[1]; }); } }
$q = str_replace('&', '&', HTTP::query(array('parent' => $response->id, 'post' => $response->post))); echo (Weapon::exist($segment[0] . '_footer') ? ' / ' : "") . Cell::a($config->manager->slug . '/' . $segment[0] . '/ignite' . $q, $speak->reply); } // Show total comment repl(y|ies) function __do_response_reply_count($response) { global $config, $speak, $segment; $e = File::E($response->path); $replies = count(glob(COMMENT . DS . '*_*_' . Date::slug($response->id) . '.{txt,hold}', GLOB_NOSORT | GLOB_BRACE)); $t = Jot::icon('reply-all') . ' ' . $replies; $tt = array('title' => $replies . ' ' . ($replies === 1 ? $speak->{$segment[0] . '_reply'} : $speak->{$segment[0] . '_replies'})); echo ($e === 'hold' || $replies === 0 ? Cell::span($t, $tt) : Cell::a($config->manager->slug . '/' . $segment[0] . '?filter=parent%3A' . $response->id, $t, null, $tt)) . ' · '; } if (Route::is($config->manager->slug . '/' . $segment[0] . '/ignite') && ($parent = Request::get('parent', false))) { if ($response = call_user_func('Get::' . $segment[0], $parent)) { Weapon::add('tab_content_1_before', function () use($segment, $response) { $post = call_user_func('Get::' . $segment[1] . 'Anchor', $response->post); echo Cell::h3($response->name . ($post ? ' » ' . Cell::a($response->permalink, $post->title, '_blank') : "")) . $response->message . Cell::hr() . Cell::h4(Config::speak($segment[0] . '_reply_to_', $response->name)); }, 0.1); } Weapon::add('shield_before', function () use($config, $segment, $parent) { $to = call_user_func('Get::' . $segment[0] . 'Anchor', $parent); $to = $to !== false ? $to->name : $parent; $to_text = Config::speak($segment[0] . '_reply_to_', $to); Config::set('page_title', $to_text . $config->title_separator . Config::get('page_title')); }); } // Apply `__do_response_reply` weapon Weapon::add($segment[0] . '_footer', '__do_response_reply', 20.1); // Apply `__do_response_reply_count` weapon Weapon::add($segment[0] . '_footer', '__do_response_reply_count');