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; }
echo $tLang->lang('th_thanks'); ?> </th> <th><?php echo $tLang->lang('th_votes_up'); ?> </th> <th><?php echo $tLang->lang('th_thread_viewcount'); ?> </th> </tr> <?php foreach ($tVars['latest_threads'] as $t) { $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(); echo GWF_Table::rowStart(); ?> <td><a href="<?php echo $t->getPageHREF(1); ?> "><?php echo $t->display('thread_title'); ?> </a></td> <td><?php echo $edit . $unread; ?> </td>
echo '<td class="gwf_num">' . $linkid . '</td>'; echo '<td colspan="2" class="ri"><em>[' . $perm_text . ']</em></td>'; echo '<td class="gwf_num">' . $link->getVar('link_favcount') . '</td>'; echo '<td class="gwf_num">' . $link->getVar('link_clicks') . '</td>'; echo sprintf('<td class="gwf_num"><span%s>%s</span></td>', $idc, $votecount); echo sprintf('<td class="gwf_num"><span%s>%.02f%%</span></td>', $ida, $voteperc); if ($wv) { echo '<td></td>'; } if ($wv && $user !== false) { echo '<td></td><td></td>'; } } else { $updown = $link->isDown() ? 'down' : 'up'; $mayEdit = $wv ? $link->mayEdit($user, $staff) : false; echo '<td class="gwf_num">' . ($mayEdit ? GWF_Button::edit($link->hrefEdit(), $t_edit) : $linkid) . '</td>'; echo '<td colspan="2" class="ri">' . $link->displayText($updown) . '</td>'; // echo '<td colspan="2">'.sprintf($link->isInModeration()?'<span style="color:#ff0000">%s</span>':'%s', $link->displayText()).'</td>'; echo '<td class="gwf_num">' . $link->displayFavCount() . '</td>'; echo '<td class="gwf_num">' . $link->displayClickCount() . '</td>'; if ($wv) { echo sprintf('<td class="gwf_num"><span%s>%s</span></td>', $idc, $votecount); echo sprintf('<td class="gwf_num"><span%s>%.02f%%</span></td>', $ida, $voteperc); echo '<td class="nowrap">' . $vote->displayButtons() . '</td>'; } else { echo sprintf('<td class="gwf_num"><span%s>%s</span></td>', $idc, $votecount); echo sprintf('<td class="gwf_num"><span%s>%.02f%%</span></td>', $ida, $voteperc); // echo '<td class="gwf_num">0</td>'; // echo '<td class="gwf_num">50.00%</td>'; } if ($user !== false && $wv) {
echo $attach; $sig = $opts->hasSignature() ? GWF_HTML::div($opts->displaySignature(), 'gwf_forum_sig') : ''; echo $sig; ?> </div> <?php $edit_by = GWF_HTML::div($post->displayEditBy($tVars['module']), 'gwf_post_edited'); ?> <?php $action_div = ''; if ($actions) { $buttons = ''; if ($tVars['reply']) { $buttons .= GWF_Button::reply($post->getReplyHREF(), $tLang->lang('btn_reply')); $buttons .= GWF_Button::quote($post->getQuoteHREF(), $tLang->lang('btn_quote')); } if ($can_edit) { $buttons .= GWF_Button::edit($post->getEditHREF(), $tLang->lang('btn_edit')); $buttons .= GWF_Button::generic($tLang->lang('btn_add_attach'), $post->hrefAddAttach()); } $action_div = GWF_HTML::div($buttons, 'gwf_buttons'); } echo GWF_HTML::div($edit_by . $action_div, 'gwf_post_foot'); # echo GWF_Table::rowEnd(); ?> </div> </div> <div class="cl"></div>
<?php echo GWF_Button::wrapStart(); echo GWF_Button::generic($tLang->lang('menu_sites'), $tVars['href_site']); echo GWF_Button::generic($tLang->lang('btn_edit_site_descr'), $tVars['href_descr']); echo GWF_Button::wrapEnd(); echo GWF_Table::start(); $headers = array(array('EDIT'), array('ID'), array('NAME'), array('HOST'), array('IP'), array('STATUS')); echo GWF_Table::displayHeaders1($headers); foreach ($tVars['boxes'] as $box) { $box instanceof WC_Warbox; echo GWF_Table::rowStart(); echo GWF_Table::column(GWF_Button::edit($box->hrefEdit())); echo GWF_Table::column($box->getID()); echo GWF_Table::column($box->display('wb_name')); echo GWF_Table::column($box->displayLink()); echo GWF_Table::column($box->getVar('wb_ip')); echo GWF_Table::column(WC_HTML::lang('wb_' . $box->getVar('wb_status'))); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo GWF_Button::wrapStart(); echo GWF_Button::add('Add a new warbox', $tVars['href_add']); echo GWF_Button::wrapEnd();
public function getEditButton(Module_Guestbook $module) { return GWF_Button::edit($this->getEditHref(), $module->lang('btn_edit_entry')); }
echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); foreach ($tVars['groups'] as $group) { $group instanceof GWF_Group; $groupname = $group->getVar('group_name'); $founder = $group->getFounder(); $in_grp = $user->isInGroupName($groupname); if ($in_grp) { $ugopt = $user->getUserGroupOptions($group->getID()); #getGroupByName($groupname)->getInt('group_options'); // $ugopt = $user->getUserGroupOptions($groupname); } else { $ugopt = 0; } if (($ugopt & (GWF_UserGroup::LEADER | GWF_UserGroup::CO_LEADER)) > 0) { $edit = GWF_Button::edit(GWF_WEB_ROOT . 'edit_usergroup/' . $group->getID() . '/' . $group->urlencodeSEO('group_name')); } else { $edit = ''; } $parent_board = $tVars['module']->getForumBoard(); if (false !== ($board = GWF_ForumBoard::getByID($group->getVar('group_bid')))) { $href = $board->getShowBoardHREF(); $forum = GWF_HTML::anchor($href, $group->getVar('group_name')); } else { $forum = $group->display('group_name'); } $members = GWF_HTML::anchor(GWF_WEB_ROOT . 'users_in_group/' . $group->getID() . '/' . $group->urlencodeSEO('group_name'), $group->getVar('group_memberc')); echo GWF_Table::rowStart(); echo GWF_Table::column($edit . $forum, 'nowrap'); echo GWF_Table::column($members, 'gwf_num'); echo GWF_Table::column($founder->displayProfileLink());
$icon_voted = GWF_WEB_ROOT . 'tpl/wc4/ico/voted.gif'; $icon_novote = GWF_WEB_ROOT . 'tpl/wc4/ico/show_votes.gif'; $alt = $tLang->lang('alt_challvotes'); $txt_edit = WC_HTML::lang('btn_edit_chall'); foreach ($challs as $chall) { $chall instanceof WC_Challenge; if ($tVars['tag'] !== '' and !$chall->hasTag($tVars['tag'])) { continue; } $cid = $chall->getID(); $solved = isset($solved_bits[$cid]); if ($solved) { $icon = $solved_bits[$cid]['csolve_options'] & 1 ? $icon_voted : $icon_vote; } else { $icon = $icon_novote; } $edit = $is_admin ? GWF_Button::edit($chall->getEditHREF(), $txt_edit) : ''; $href_votes = $chall->hrefVotes(); echo GWF_Table::rowStart(); echo '<td class="gwf_num">' . $chall->getVar('chall_score') . '</td>' . PHP_EOL; echo '<td class="nowrap" colspan="2">' . $edit . $chall->displayLink($solved) . '</td>' . PHP_EOL; echo '<td class="gwf_num"><a href="' . $chall->getSolverHREF() . '">' . $chall->getVar('chall_solvecount') . '</a></td>' . PHP_EOL; echo '<td class="gwf_date">' . $chall->displayAge() . '</td>' . PHP_EOL; echo sprintf('<td class="gwf_num"><a href="%s">%s<img src="%s" title="%s" alt="%s" /></a></td>', $href_votes, $chall->getVar('chall_votecount'), $icon, $alt, $alt) . PHP_EOL; echo '<td class="gwf_num">' . sprintf('<a href="%s">%s</a>', $href_votes, $chall->displayDif()) . '</td>' . PHP_EOL; echo '<td class="gwf_num">' . sprintf('<a href="%s">%s</a>', $href_votes, $chall->displayEdu()) . '</td>' . PHP_EOL; echo '<td class="gwf_num">' . sprintf('<a href="%s">%s</a>', $href_votes, $chall->displayFun()) . '</td>' . PHP_EOL; echo '<td>' . $chall->displayBoardLinks(true, $solved) . '</td>' . PHP_EOL; echo GWF_Table::rowEnd(); } echo '</table>';
<?php $user = GWF_Session::getUser(); $headers = array(array($tLang->lang('th_dl_id'), 'dl_id'), array($tLang->lang('th_dl_date'), 'dl_date'), array($tLang->lang('th_dl_filename'), 'dl_filename'), array($tLang->lang('th_dl_price'), 'dl_price'), array($tLang->lang('th_purchases'), 'dl_purchases'), array($tLang->lang('th_user_name'), 'user_name'), array($tLang->lang('th_dl_count'), 'dl_count'), array($tLang->lang('th_dl_descr'), 'dl_descrs'), array($tLang->lang('th_vs_avg'), 'vs_avg'), array()); //$headers = GWF_Table::getHeade<<<<##rs2($headers, $tVars['sort_url']); echo $tVars['page_menu']; echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); foreach ($tVars['downloads'] as $dl) { $dl instanceof GWF_Download; $href = $dl->hrefDownload(); $u = $dl->getUser(); $v = $dl->getVotes(); $editbtn = $dl->mayEdit($user) ? GWF_Button::edit($dl->hrefEdit(), $tLang->lang('btn_edit')) : ''; $onclick = sprintf("return confirm('%s')", $tLang->lang('prompt_download')); echo GWF_Table::rowStart(); echo sprintf('<td>%s%s</td>', $editbtn, $dl->getVar('dl_id')); echo sprintf('<td class="gwf_date">%s</td>', GWF_Time::displayDate($dl->getVar('dl_date'))); echo sprintf('<td><a href="%s" onclick="%s">%s</a></td>', $href, $onclick, $dl->display('dl_filename')); echo sprintf('<td class="gwf_num">%s</td>', $dl->displayPrice()); echo sprintf('<td class="gwf_num">%s</td>', $dl->getVar('dl_purchases')); if ($dl->isUsernameHidden()) { echo '<td></td>'; } else { echo sprintf('<td><a href="%s">%s</a></td>', GWF_WEB_ROOT . 'profile/' . $u->urlencode('user_name'), $u->display('user_name')); } echo sprintf('<td class="gwf_num"><a href="%s" onclick="%s">%s</a></td>', $href, $onclick, $dl->getVar('dl_count')); echo sprintf('<td><a href="%s" onclick="%s" title="%s">%s</a></td>', $href, $onclick, $dl->display('dl_descr'), GWF_HTML::display(Common::stripMessage($dl->getVar('dl_descr'), 50))); echo sprintf('<td class="gwf_num"><a id="gwf_vsba_%d" href="%s" onclick="%s">%.02f%%</a></td>', $v->getID(), $href, $onclick, $v->getAvgPercent()); echo sprintf('<td class="nowrap">%s</td>', $v->displayButtons()); echo GWF_Table::rowEnd();
if (isset($tVars['form_add'])) { echo $tVars['form_add']; } if (isset($tVars['form_edit'])) { echo $tVars['form_edit']; } $headers = array(array(), array($tLang->lang('th_wf_order'), 'wf_order'), array($tLang->lang('th_mov')), array($tLang->lang('th_wf_cat'), 'wf_cat'), array($tLang->lang('th_wf_score'), 'wf_score'), array($tLang->lang('th_wf_title'), 'wf_title'), array($tLang->lang('th_wf_login'), 'wf_login'), array($tLang->lang('th_wf_status'))); $wbid = Common::getGetString('wbid'); echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers); foreach ($tVars['flags'] as $flag) { $flag instanceof WC_Warflag; $fid = $flag->getID(); echo GWF_Table::rowStart(); $edit = GWF_Button::edit($flag->hrefEdit()); echo GWF_Table::column($edit); echo GWF_Table::column($flag->getVar('wf_order'), 'gwf_num'); $up = sprintf('<a href="%sindex.php?mo=WeChall&me=Warflags&up=%s&wbid=%s">^</a>', GWF_WEB_ROOT, $fid, $wbid); $down = sprintf('<a href="%sindex.php?mo=WeChall&me=Warflags&down=%s&wbid=%s">v</a>', GWF_WEB_ROOT, $fid, $wbid); echo GWF_Table::column("{$up}<br/>{$down}", 'gwf_num'); echo GWF_Table::column($flag->display('wf_cat')); echo GWF_Table::column($flag->getVar('wf_score'), 'gwf_num'); echo GWF_Table::column($flag->display('wf_title')); echo GWF_Table::column($flag->display('wf_login')); echo GWF_Table::column($flag->display('wf_status')); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo GWF_Button::wrapStart(); echo GWF_Button::add($tLang->lang('btn_add_warflag'), $tVars['href_add']);
$headers[] = array($tLang->lang('th_user_name'), 'user_name'); $headers[] = array($tLang->lang('th_vs_avg'), 'vs_avg'); $headers[] = array(); echo $tVars['page_menu']; echo GWF_Table::start(); echo GWF_Table::displayHeaders1($headers, $tVars['sort_url']); foreach ($tVars['downloads'] as $dl) { $dl instanceof GWF_Download; $may_edit = $dl->mayEdit($user); $href = $dl->hrefDownload(); $u = $dl->getUser(); $v = $dl->getVotes(); $onclick = sprintf("return confirm('%s')", $tLang->lang('prompt_download')); echo GWF_Table::rowStart(); if ($may_edit) { $editbtn = GWF_Button::edit($dl->hrefEdit(), $tLang->lang('btn_edit')); printf('<td>%s%s</td>', $editbtn, $dl->getVar('dl_id')); } else { printf('<td>%s</td>', $dl->getVar('dl_id')); } printf('<td><a href="%s" onclick="%s">%s</a></td>', $href, $onclick, $dl->display('dl_filename')); printf('<td><a href="%s" onclick="%s" title="%s">%s</a></td>', $href, $onclick, $dl->display('dl_descr'), GWF_HTML::display(Common::stripMessage($dl->getVar('dl_descr'), 50))); printf('<td class="gwf_date">%s</td>', GWF_Time::displayDateFormat($dl->getVar('dl_date'), $df)); printf('<td class="gwf_num ce"><a href="%s" onclick="%s">%s</a></td>', $href, $onclick, $dl->getVar('dl_count')); echo $dl->isUsernameHidden() ? '<td></td>' : sprintf('<td><a href="%s">%s</a></td>', GWF_WEB_ROOT . 'profile/' . $u->urlencode('user_name'), $u->display('user_name')); echo sprintf('<td class="gwf_num"><a id="gwf_vsba_%d" href="%s" onclick="%s">%.02f%%</a></td>', $v->getID(), $href, $onclick, $v->getAvgPercent()); echo sprintf('<td class="nowrap">%s</td>', $v->displayButtons()); echo GWF_Table::rowEnd(); } echo GWF_Table::end(); echo $tVars['page_menu'];
public function getEditButton(Module_WeChall $module, $user) { if ($user === false) { return ''; } if ($user->isAdmin() || $this->isSiteAdmin($user)) { return GWF_Button::edit($this->hrefEdit(), $module->lang('ft_edit_site', array($this->displayName()))); } return ''; }