private function getButtons(GWF_PM $pm) { $transid = 'pm_trans_' . $pm->getID(); $u = GWF_Session::getUser(); $buttons = ''; if (false !== ($prevs = $pm->getReplyToPrev())) { foreach ($prevs as $prev) { $buttons .= GWF_Button::prev($prev->getDisplayHREF(), $this->module->lang('btn_prev')); } } if (!$pm->hasDeleted($u)) { $buttons .= GWF_Button::delete($pm->getDeleteHREF($u->getID()), $this->module->lang('btn_delete')); } else { $buttons .= GWF_Button::restore($pm->getRestoreHREF(), $this->module->lang('btn_restore')); } if ($pm->canEdit($u)) { $buttons .= GWF_Button::edit($pm->getEditHREF(), $this->module->lang('btn_edit')); } $buttons .= GWF_Button::options($pm->getAutoFolderHREF(), $this->module->lang('btn_autofolder')); if (!$pm->isGuestPM()) { $buttons .= GWF_Button::reply($pm->getReplyHREF(), $this->module->lang('btn_reply')) . PHP_EOL . GWF_Button::quote($pm->getQuoteHREF(), $this->module->lang('btn_quote')); } $u2 = $pm->getOtherUser($u); $buttons .= GWF_Button::ignore($pm->getIgnoreHREF($pm->getOtherUser($u)), $this->module->lang('btn_ignore', array($u2->display('user_name')))); $buttons .= GWF_Button::translate($pm->getTranslateHREF(), $this->module->lang('btn_translate'), '', 'gwfGoogleTrans(\'' . $transid . '\'); return false;'); if (false !== ($nexts = $pm->getReplyToNext())) { foreach ($nexts as $next) { $buttons .= GWF_Button::next($next->getDisplayHREF(), $this->module->lang('btn_next')); } } return $buttons; }
$t instanceof GWF_ForumThread; $edit = $t->hasEditPermission() ? GWF_Button::edit($t->getEditHREF(), $tLang->lang('btn_edit')) : ''; $unread = $t->hasRead($user) ? '' : GWF_Button::bell($tVars['href_unread']); $hrefLastPage = $t->getLastPageHREF(); $lastdate = $t->displayLastDate(); $b2 = $t->getBoard(); $anchor_board = GWF_HTML::anchor($b2->getShowBoardHREF(), $b2->getVar('board_title')); $anchor_thread = GWF_HTML::anchor($t->getPageHREF(1), $t->getVar('thread_title')); echo GWF_Table::rowStart(); echo GWF_Table::column($anchor_board . '<br/>' . $anchor_thread); // GWF_HTML::anchor($t->getPageHREF(1), $t->displayBoardTitle().'<br/>'.$t->display('thread_title'), '', '', false)); echo GWF_Table::column($edit . $unread); echo GWF_Table::column($t->getFirstPosterLink()); echo GWF_Table::column($t->getVar('thread_postcount'), 'gwf_num'); echo GWF_Table::column($t->getLastPosterLink()); $btn_next = GWF_Button::next($hrefLastPage, $lastposttxt); echo GWF_Table::column(GWF_HTML::anchor($hrefLastPage, $lastdate, '', '', false) . $btn_next, 'gwf_date'); echo GWF_Table::column(GWF_HTML::anchor($hrefLastPage, $t->getVar('thread_thanks')), 'gwf_num'); echo GWF_Table::column(GWF_HTML::anchor($hrefLastPage, $t->getVar('thread_votes_up')), 'gwf_num'); echo GWF_Table::column(GWF_HTML::anchor($hrefLastPage, $t->getVar('thread_viewcount')), 'gwf_num'); echo GWF_Table::rowEnd(); } echo GWF_table::end(); } ?> <!-- End Of Latest Threads --> <!-- Boards --> <?php echo $tVars['pagemenu_boards']; ?>
} // if ($tVars['page'] === 1) { if ($t->hasPoll()) { if (false !== ($mod_votes = GWF_Module::loadModuleDB('Votes'))) { $mod_votes->onInclude(); $buttons .= $t->getPoll()->showResults(); } } // } // else if ($t->mayAddPoll(GWF_Session::getUser())) { $buttons .= GWF_Button::generic($tLang->lang('btn_add_poll'), $tVars['href_add_poll']); } if (false !== ($next = $t->getNextThread())) { $href = $next->getPageHREF(1); $buttons .= GWF_Button::next($href, $next->getVar('thread_title')); } if ($buttons !== '') { echo GWF_Button::wrap($buttons); } } echo $tVars['pagemenu']; echo '<div class="gwf_posts">' . PHP_EOL; $tVars['thread'] = $t; foreach ($tVars['posts'] as $post) { $tVars['post'] = $post; include 'show_post.php'; } echo '</div>' . PHP_EOL; if ($actions) { $buttons = '';
} else { // $buttons .= GWF_Button::prev('#', $tLang->lang('btn_prev')); } if (!$pm->hasDeleted($u)) { $buttons .= GWF_Button::delete($pm->getDeleteHREF($u->getID()), $tLang->lang('btn_delete')); } else { $buttons .= GWF_Button::restore($pm->getRestoreHREF(), $tLang->lang('btn_restore')); } if ($pm->canEdit($u)) { $buttons .= GWF_Button::edit($pm->getEditHREF(), $tLang->lang('btn_edit')); } $buttons .= GWF_Button::options($pm->getAutoFolderHREF(), $tLang->lang('btn_autofolder')); if (!$pm->isGuestPM()) { $buttons .= GWF_Button::reply($pm->getReplyHREF(), $tLang->lang('btn_reply')) . PHP_EOL . GWF_Button::quote($pm->getQuoteHREF(), $tLang->lang('btn_quote')); } $u2 = $pm->getOtherUser($u); $buttons .= GWF_Button::ignore($pm->getIgnoreHREF($pm->getOtherUser($u)), $tLang->lang('btn_ignore', array($u2->display('user_name')))); $buttons .= GWF_Button::translate($pm->getTranslateHREF(), $tLang->lang('btn_translate'), '', 'gwfGoogleTrans(\'' . $transid . '\'); return false;'); if (false !== ($nexts = $pm->getReplyToNext())) { foreach ($nexts as $next) { $buttons .= GWF_Button::next($next->getDisplayHREF(), $tLang->lang('btn_next')); } } else { // $buttons .= GWF_Button::next('#', $tLang->lang('btn_next')); } echo GWF_HTML::div($buttons, 'gwf_pm_foot'); } ?> </div> <div class="cl"></div>