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; }
public function templateShow(GWF_Guestbook $gb) { $nested = $gb->isNestingAllowed(); if ($nested) { return $this->templateNested($gb); } $user = GWF_Session::getUser(); $can_moderate = $gb->canModerate($user); $gbid = $gb->getID(); $mod = GWF_GuestbookMSG::IN_MODERATION; $conditions = "gbm_gbid={$gbid}"; $conditions .= $can_moderate ? '' : " AND gbm_options&{$mod}=0"; // $orderby = $nested ? 'gbm_replyto ASC, gbm_date ASC' : 'gbm_date ASC'; $orderby = 'gbm_date ASC'; $msgs = GDO::table('GWF_GuestbookMSG'); $ipp = $this->module->cfgItemsPerPage(); $nItems = $msgs->countRows($conditions); $nPages = GWF_PageMenu::getPagecount($ipp, $nItems); $page = Common::clamp(intval(Common::getGet('page', $nPages)), 1, $nPages); $gbid_app = $gbid === 1 ? '' : '/' . $gbid; # append // TODO tVAR cleanup ? $tVars = array('gb' => $gb, 'entries' => $msgs->selectObjects('*', $conditions, $orderby, $ipp, GWF_PageMenu::getFrom($page, $ipp)), 'page_menu' => GWF_PageMenu::display($page, $nPages, GWF_WEB_ROOT . 'guestbook/show' . $gbid_app . '/page-%PAGE%'), 'href_sign' => GWF_WEB_ROOT . 'guestbook/sign/' . $gbid, 'href_moderate' => GWF_WEB_ROOT . 'guestbook/edit/' . $gbid, 'can_moderate' => $can_moderate, 'can_sign' => $gb->canSign(GWF_Session::getUser(), $this->module->cfgAllowGuest()), 'allow_url' => $this->module->cfgAllowURL(), 'allow_email' => $this->module->cfgAllowEMail(), 'btn_edit' => $can_moderate ? GWF_Button::options(GWF_WEB_ROOT . 'guestbook/edit/' . $gbid, $this->module->lang('btn_edit_gb')) : ''); $filename = 'show.tpl'; // $filename = $nested ? 'show_nested.php' : 'show.php'; return $this->module->template($filename, $tVars); }
$b instanceof GWF_ForumBoard; $user = GWF_Session::getUser(); $is_mod = GWF_User::isInGroupS('moderator'); ?> <!-- Banner Ads --> <?php echo GWF_Website::getBanners('forum', 'forum'); ?> <hr/> <!-- Title --> <?php $options = GWF_User::isLoggedIn() ? GWF_Button::options($tVars['href_options'], $tLang->lang('btn_options')) : ''; $bell = GWF_Button::bell($tVars['href_unread'], $tLang->lang('btn_unread')); $newthreads = $tVars['unread_threads'] > 0 ? sprintf('[%s]', $tVars['unread_threads']) . $bell : ''; $search = GWF_Button::search($tVars['href_search'], $tLang->lang('btn_search')); $pollsbtn = GWF_Button::generic($tLang->lang('btn_polls'), $tVars['href_polls']); ?> <h1><?php echo $options . $tLang->lang('forum_title') . $search . $newthreads . $pollsbtn; ?> </h1> <hr/> <!-- Nav Tree -->
<?php $b = $tVars['board']; $b instanceof GWF_ForumBoard; $user = GWF_Session::getUser(); $is_mod = GWF_User::isInGroupS('moderator'); ?> <!-- Title --> <?php $options = $user !== false ? GWF_Button::options($tVars['href_options'], $tLang->lang('btn_options')) : ''; $newthreads = $tVars['unread_threads'] > 0 ? GWF_Button::bell($tVars['href_unread'], $tLang->lang('btn_unread')) . '[' . $tVars['unread_threads'] . ']' : ''; $search = $tVars['module']->isSearchAllowed() ? GWF_Button::search($tVars['href_search'], $tLang->lang('btn_search')) : ''; $pollsbtn = GWF_Button::generic($tLang->lang('btn_polls'), $tVars['href_polls']); ?> <h1><?php echo $options . $search . $newthreads . $tLang->lang('forum_title') . $pollsbtn; ?> </h1> <!-- Nav Tree --> <?php if (!$b->isRoot()) { ?> <div class="gwf_board_quicktree"><?php echo Module_Forum::getNavTree(); ?> </div> <?php
<?php $gb = $tVars['gb']; $m = $tVars['module']; $can_sign = $gb->canSign(GWF_Session::getUser(), $m->cfgAllowGuest()); $allow_url = $m->cfgAllowURL(); $allow_email = $m->cfgAllowEMail(); $btn_edit = $tVars['can_moderate'] ? GWF_Button::options($tVars['href_moderate'], $tLang->lang('btn_edit_gb')) : ''; echo '<h1>' . $btn_edit . $gb->displayTitle() . '</h1>'; echo '<h2>' . $gb->displayDescr() . '</h2>'; echo $tVars['page_menu']; foreach ($tVars['entries'] as $e) { $e instanceof GWF_GuestbookMSG; gwfGBNested($e, $allow_email, $allow_url, $can_sign, $gb, $tLang, $tVars, $m); } echo $tVars['page_menu']; if ($can_sign) { echo GWF_Button::reply($tVars['href_sign'], $tLang->lang('btn_sign', array($gb->displayTitle()))); } function gwfGBNested(GWF_GuestbookMSG &$e, &$allow_email, &$allow_url, &$can_sign, &$gb, &$tLang, &$tVars, &$m) { // echo '<div class="gwf_gbe_nested" style="border: 1px solid black; margin: 10px; padding: 10px;" >'; echo '<div class="gwf_gb_entry gwf_gb_entry_nested">' . PHP_EOL; echo '<div class="gwf_gbe_head">' . PHP_EOL; echo sprintf('<div class="gwf_date">%s</div>', $e->displayDate()) . PHP_EOL; echo sprintf('<div>%s</div>', $e->displayUsernameLink()) . PHP_EOL; if ($allow_email) { echo sprintf('<div>%s</div>', $e->displayEMail($tVars['can_moderate'])) . PHP_EOL; } if ($allow_url) { echo sprintf('<div>%s</div>', $e->displayURL()) . PHP_EOL;
<h1> <?php echo GWF_Button::options($tVars['href_options'], $tLang->lang('btn_options')); ?> <?php echo GWF_Button::search($tVars['href_search'], $tLang->lang('btn_search')); ?> <?php echo GWF_Button::trashcan($tVars['href_trashcan'], $tLang->lang('btn_trashcan')); ?> <?php echo $tLang->lang('pt_pm'); ?> </h1> <div> <div class="fl"><?php echo $tVars['form_new_folder']; ?> </div> <div class="fl"><?php echo $tVars['new_pm']; ?> </div> <div class="cl"></div> </div> <div class="fl" id="gwf_pm_folders"> <?php echo $tVars['folders']; ?>
if (false !== ($prevs = $pm->getReplyToPrev())) { foreach ($prevs as $prev) { $buttons .= GWF_Button::prev($prev->getDisplayHREF(), $tLang->lang('btn_prev')); } } 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'); }