本文整理汇总了PHP中Table::construct_row方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::construct_row方法的具体用法?PHP Table::construct_row怎么用?PHP Table::construct_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::construct_row方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: myalerts_acp_manage_alert_types
function myalerts_acp_manage_alert_types()
{
global $mybb, $lang, $page, $db, $cache;
$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::getInstance();
$alertTypes = $alertTypeManager->getAlertTypes();
if (strtolower($mybb->request_method) == 'post') {
if (!verify_post_check($mybb->get_input('my_post_key'))) {
flash_message($lang->invalid_post_verify_key2, 'error');
admin_redirect("index.php?module=config-myalerts_alert_types");
}
$enabledAlertTypes = $mybb->get_input('alert_types_enabled', MyBB::INPUT_ARRAY);
$canBeUserDisabled = $mybb->get_input('alert_types_can_be_user_disabled', MyBB::INPUT_ARRAY);
$enabledAlertTypes = array_map('intval', array_keys($enabledAlertTypes));
$canBeUserDisabled = array_map('intval', array_keys($canBeUserDisabled));
$updateArray = array();
foreach ($alertTypes as $alertType) {
$type = MybbStuff_MyAlerts_Entity_AlertType::unserialize($alertType);
$type->setEnabled(in_array($type->getId(), $enabledAlertTypes));
$type->setCanBeUserDisabled(in_array($type->getId(), $canBeUserDisabled));
$updateArray[] = $type;
}
$alertTypeManager->updateAlertTypes($updateArray);
flash_message($lang->myalerts_alert_types_updated, 'success');
admin_redirect("index.php?module=config-myalerts_alert_types");
} else {
$page->output_header($lang->myalerts_alert_types);
$form = new Form('index.php?module=config-myalerts_alert_types', 'post');
$table = new Table();
$table->construct_header($lang->myalerts_alert_type_code);
$table->construct_header($lang->myalerts_alert_type_enabled, array('width' => '5%', 'class' => 'align_center'));
$table->construct_header($lang->myalerts_alert_type_can_be_user_disabled, array('width' => '10%', 'class' => 'align_center'));
$noResults = false;
if (!empty($alertTypes)) {
foreach ($alertTypes as $type) {
$alertCode = htmlspecialchars_uni($type['code']);
$table->construct_cell($alertCode);
$table->construct_cell($form->generate_check_box('alert_types_enabled[' . $type['id'] . ']', '', '', array('checked' => $type['enabled'])));
$table->construct_cell($form->generate_check_box('alert_types_can_be_user_disabled[' . $type['id'] . ']', '', '', array('checked' => $type['can_be_user_disabled'])));
$table->construct_row();
}
} else {
$table->construct_cell($lang->myalerts_no_alert_types, array('colspan' => 2));
$table->construct_row();
$noResults = true;
}
$table->output($lang->myalerts_alert_types);
if (!$noResults) {
$buttons[] = $form->generate_submit_button($lang->myalerts_update_alert_types);
$form->output_submit_wrapper($buttons);
}
$form->end();
$page->output_footer();
}
}
示例2: jb_update_core
function jb_update_core()
{
$auto = jb_download_core();
if ($auto === false) {
global $page;
$page->output_header(JB_Lang::get("update_failed"));
$table = new Table();
$table->construct_header(JB_Lang::get("attention"));
$table->construct_cell(JB_Lang::get("update_get"));
$table->construct_row();
$table->output(JB_Lang::get("update_failed"));
$page->output_footer();
exit;
}
}
示例3: main_page
function main_page()
{
global $cloudflare, $mybb;
$request = $cloudflare->get_access_rules();
$table = new Table();
$table->construct_header("Mode");
$table->construct_header("IP Address");
$table->construct_header("Notes");
$table->construct_header("Modify");
foreach ($request->result as $rule) {
$table->construct_cell($rule->mode);
$table->construct_cell($rule->configuration->value);
$table->construct_cell($rule->notes);
$table->construct_cell("<a href=\"index.php?module=cloudflare-manage_firewall&action=modify_rule_by_ip&ip={$rule->configuration->value}&my_post_key={$mybb->post_code}¤t_mode={$rule->mode}¤t_notes={$rule->notes}\">Modify</a> / <a href=\"index.php?module=cloudflare-manage_firewall&action=delete_rule_by_id&rule_id={$rule->id}&ip_address={$rule->configuration->value}&my_post_key={$mybb->post_code}\">Delete</a>");
$table->construct_row();
}
$table->output("Firewall Rules");
}
示例4: array
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->save_post_tool);
$form->output_submit_wrapper($buttons);
$form->end();
$page->output_footer();
}
if (!$mybb->input['action']) {
$plugins->run_hooks("admin_config_mod_tools_start");
$page->output_header($lang->mod_tools . " - " . $lang->thread_tools);
$sub_tabs['thread_tools'] = array('title' => $lang->thread_tools, 'link' => "index.php?module=config-mod_tools", 'description' => $lang->thread_tools_desc);
$sub_tabs['add_thread_tool'] = array('title' => $lang->add_new_thread_tool, 'link' => "index.php?module=config-mod_tools&action=add_thread_tool");
$sub_tabs['post_tools'] = array('title' => $lang->post_tools, 'link' => "index.php?module=config-mod_tools&action=post_tools");
$sub_tabs['add_post_tool'] = array('title' => $lang->add_new_post_tool, 'link' => "index.php?module=config-mod_tools&action=add_post_tool");
$page->output_nav_tabs($sub_tabs, 'thread_tools');
$table = new Table();
$table->construct_header($lang->title);
$table->construct_header($lang->controls, array('class' => "align_center", 'colspan' => 2));
$query = $db->simple_select('modtools', 'tid, name, description, type', "type='t'", array('order_by' => 'name'));
while ($tool = $db->fetch_array($query)) {
$table->construct_cell("<a href=\"index.php?module=config-mod_tools&action=edit_thread_tool&tid={$tool['tid']}\"><strong>" . htmlspecialchars_uni($tool['name']) . "</strong></a><br /><small>" . htmlspecialchars_uni($tool['description']) . "</small>");
$table->construct_cell("<a href=\"index.php?module=config-mod_tools&action=edit_thread_tool&tid={$tool['tid']}\">{$lang->edit}</a>", array('width' => 100, 'class' => "align_center"));
$table->construct_cell("<a href=\"index.php?module=config-mod_tools&action=delete_thread_tool&tid={$tool['tid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_thread_tool_deletion}')\">{$lang->delete}</a>", array('width' => 100, 'class' => "align_center"));
$table->construct_row();
}
if ($table->num_rows() == 0) {
$table->construct_cell($lang->no_thread_tools, array('colspan' => 3));
$table->construct_row();
}
$table->output($lang->thread_tools);
$page->output_footer();
}
示例5: akismet_admin
//.........这里部分代码省略.........
}
if ($mybb->input['delete'] && $mybb->request_method == "post") {
$deletepost = $mybb->input['akismet'];
if (empty($deletepost)) {
flash_message($lang->error_deletepost, 'error');
admin_redirect("index.php?module=forum-akismet");
}
$posts_in = '';
$comma = '';
foreach ($deletepost as $key => $val) {
$posts_in .= $comma . intval($key);
$comma = ',';
}
$query = $db->simple_select("posts", "pid, tid", "pid IN ({$posts_in}) AND replyto = '0'");
while ($post = $db->fetch_array($query)) {
$threadp[$post['pid']] = $post['tid'];
}
if (!is_array($threadp)) {
$threadp = array();
}
require_once MYBB_ROOT . "inc/functions_upload.php";
foreach ($deletepost as $pid => $val) {
if (array_key_exists($pid, $threadp)) {
$db->delete_query("posts", "pid IN ({$posts_in})");
$db->delete_query("attachments", "pid IN ({$posts_in})");
// Get thread info
$query = $db->simple_select("threads", "poll", "tid='" . $threadp[$pid] . "'");
$poll = $db->fetch_field($query, 'poll');
// Delete threads, redirects, favorites, polls, and poll votes
$db->delete_query("threads", "tid='" . $threadp[$pid] . "'");
$db->delete_query("threads", "closed='moved|" . $threadp[$pid] . "'");
$db->delete_query("threadsubscriptions", "tid='" . $threadp[$pid] . "'");
$db->delete_query("polls", "tid='" . $threadp[$pid] . "'");
$db->delete_query("pollvotes", "pid='{$poll}'");
}
// Remove attachments
remove_attachments($pid);
// Delete the post
$db->delete_query("posts", "pid='{$pid}'");
}
// Log admin action
log_admin_action();
flash_message($lang->success_spam_deleted, 'success');
admin_redirect("index.php?module=forum-akismet");
}
if (!$mybb->input['action']) {
require MYBB_ROOT . "inc/class_parser.php";
$parser = new postParser();
$page->output_header($lang->akismet);
$form = new Form("index.php?module=forum-akismet", "post");
$table = new Table();
$table->construct_header($form->generate_check_box("checkall", 1, '', array('class' => 'checkall')), array('width' => '5%'));
$table->construct_header("Title / Username / Post", array('class' => 'align_center'));
$mybb->input['page'] = intval($mybb->input['page']);
if ($mybb->input['page'] > 0) {
$start = $mybb->input['page'] * 20;
} else {
$start = 0;
}
$query = $db->simple_select("posts", "COUNT(pid) as spam", "visible = '-4'");
$total_rows = $db->fetch_field($query, 'spam');
if ($start > $total_rows) {
$start = $total_rows - 20;
}
if ($start < 0) {
$start = 0;
}
$query = $db->simple_select("posts", "*", "visible = '-4'", array('limit_start' => $start, 'limit' => '20', 'order_by' => 'dateline', 'order_dir' => 'desc'));
while ($post = $db->fetch_array($query)) {
if ($post['uid'] != 0) {
$username = "<a href=\"../" . str_replace("{uid}", $post['uid'], PROFILE_URL) . "\" target=\"_blank\">" . format_name($post['username'], $post['usergroup'], $post['displaygroup']) . "</a>";
} else {
$username = $post['username'];
}
$table->construct_cell($form->generate_check_box("akismet[{$post['pid']}]", 1, ''));
$table->construct_cell("<span style=\"float: right;\">{$lang->username} {$username}</span> <span style=\"float: left;\">{$lang->title}: " . htmlspecialchars_uni($post['subject']) . " <strong>(" . my_date($mybb->settings['dateformat'], $post['dateline']) . ", " . my_date($mybb->settings['timeformat'], $post['dateline']) . ")</strong></span>");
$table->construct_row();
$parser_options = array("allow_html" => 0, "allow_mycode" => 0, "allow_smilies" => 0, "allow_imgcode" => 0, "me_username" => $post['username'], "filter_badwords" => 1);
$post['message'] = $parser->parse_message($post['message'], $parser_options);
$table->construct_cell($post['message'], array("colspan" => 2));
$table->construct_row();
}
$num_rows = $table->num_rows();
if ($num_rows == 0) {
$table->construct_cell($lang->no_spam_found, array("class" => "align_center", "colspan" => 2));
$table->construct_row();
}
$table->output($lang->detected_spam_messages);
echo "<br />" . draw_admin_pagination($mybb->input['page'], 20, $total_rows, "index.php?module=forum-akismet&page={page}");
$buttons[] = $form->generate_submit_button($lang->unmark_selected, array('name' => 'unmark'));
$buttons[] = $form->generate_submit_button($lang->deleted_selected, array('name' => 'delete'));
if ($num_rows > 0) {
$buttons[] = $form->generate_submit_button($lang->delete_all, array('name' => 'delete_all', 'onclick' => "return confirm('{$lang->confirm_spam_deletion}');"));
}
$form->output_submit_wrapper($buttons);
$form->end();
$page->output_footer();
}
exit;
}
示例6: view_manager
//.........这里部分代码省略.........
$admin_view['title'] = str_replace(']]>', ']]]]><![CDATA[>', $admin_view['title']);
$admin_view['sortby'] = str_replace(']]>', ']]]]><![CDATA[>', $admin_view['sortby']);
$admin_view['sortorder'] = str_replace(']]>', ']]]]><![CDATA[>', $admin_view['sortorder']);
$admin_view['view_type'] = str_replace(']]>', ']]]]><![CDATA[>', $admin_view['view_type']);
$xml .= "\t<view vid=\"{$admin_view['vid']}\" uid=\"{$admin_view['uid']}\" type=\"{$admin_view['type']}\" visibility=\"{$admin_view['visibility']}\">\n";
$xml .= "\t\t<title><![CDATA[{$admin_view['title']}]]></title>\n";
$xml .= "\t\t<fields>\n";
foreach ($fields as $field) {
$xml .= "\t\t\t<field name=\"{$field}\" />\n";
}
$xml .= "\t\t</fields>\n";
$xml .= "\t\t<conditions>\n";
foreach ($conditions as $name => $condition) {
if (!$conditions) {
continue;
}
if (is_array($condition)) {
$condition = my_serialize($condition);
$is_serialized = " is_serialized=\"1\"";
}
$condition = str_replace(']]>', ']]]]><![CDATA[>', $condition);
$xml .= "\t\t\t<condition name=\"{$name}\"{$is_serialized}><![CDATA[{$condition}]]></condition>\n";
}
$xml .= "\t\t</conditions>\n";
$xml .= "\t\t<sortby><![CDATA[{$admin_view['sortby']}]]></sortby>\n";
$xml .= "\t\t<sortorder><![CDATA[{$admin_view['sortorder']}]]></sortorder>\n";
$xml .= "\t\t<perpage><![CDATA[{$admin_view['perpage']}]]></perpage>\n";
$xml .= "\t\t<view_type><![CDATA[{$admin_view['view_type']}]]></view_type>\n";
$xml .= "\t</view>\n";
}
$xml .= "</adminviews>\n";
$mybb->settings['bbname'] = urlencode($mybb->settings['bbname']);
header("Content-disposition: filename=" . $mybb->settings['bbname'] . "-views.xml");
header("Content-Length: " . my_strlen($xml));
header("Content-type: unknown/unknown");
header("Pragma: no-cache");
header("Expires: 0");
echo $xml;
exit;
} else {
$page->output_header($lang->view_manager);
$page->output_nav_tabs($sub_tabs, 'views');
$table = new Table();
$table->construct_header($lang->view);
$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));
$default_view = fetch_default_view($type);
$query = $db->simple_select("adminviews", "COUNT(vid) as views");
$views = $db->fetch_field($query, "views");
$query = $db->query("\n\t\t\tSELECT v.*, u.username\n\t\t\tFROM " . TABLE_PREFIX . "adminviews v\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=v.uid)\n\t\t\tWHERE v.visibility='2' OR (v.visibility='1' AND v.uid='{$mybb->user['uid']}')\n\t\t\tORDER BY title\n\t\t");
while ($view = $db->fetch_array($query)) {
$created = "";
if ($view['uid'] == 0) {
$view_type = "default";
$default_class = "grey";
} else {
if ($view['visibility'] == 2) {
$view_type = "group";
if ($view['username']) {
$created = "<br /><small>{$lang->created_by} {$view['username']}</small>";
}
} else {
$view_type = "user";
}
}
$default_add = '';
if ($default_view == $view['vid']) {
$default_add = " ({$lang->default})";
}
$title_string = "view_title_{$view['vid']}";
if ($lang->{$title_string}) {
$view['title'] = $lang->{$title_string};
}
$table->construct_cell("<div class=\"float_right\"><img src=\"styles/{$page->style}/images/icons/{$view_type}.png\" title=\"" . $lang->sprintf($lang->this_is_a_view, $view_type) . "\" alt=\"{$view_type}\" /></div><div class=\"{$default_class}\"><strong><a href=\"{$base_url}&action=views&do=edit&vid={$view['vid']}\" >{$view['title']}</a></strong>{$default_add}{$created}</div>");
$popup = new PopupMenu("view_{$view['vid']}", $lang->options);
$popup->add_item($lang->edit_view, "{$base_url}&action=views&do=edit&vid={$view['vid']}");
if ($view['vid'] != $default_view) {
$popup->add_item($lang->set_as_default, "{$base_url}&action=views&do=set_default&vid={$view['vid']}");
}
if ($views > 1 && $view['vid'] != 1) {
$popup->add_item($lang->delete_view, "{$base_url}&action=views&do=delete&vid={$view['vid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_view_deletion}')");
}
$controls = $popup->fetch();
$table->construct_cell($controls, array("class" => "align_center"));
$table->construct_row();
}
$table->output($lang->view);
echo <<<LEGEND
<br />
<fieldset>
<legend>{$lang->legend}</legend>
<img src="styles/{$page->style}/images/icons/default.png" alt="{$lang->default}" style="vertical-align: middle;" /> {$lang->default_view_desc}<br />
<img src="styles/{$page->style}/images/icons/group.png" alt="{$lang->public}" style="vertical-align: middle;" /> {$lang->public_view_desc}<br />
<img src="styles/{$page->style}/images/icons/user.png" alt="{$lang->private}" style="vertical-align: middle;" /> {$lang->private_view_desc}</fieldset>
LEGEND;
$page->output_footer();
}
}
}
}
}
示例7: newpoints_shop_admin_stats
function newpoints_shop_admin_stats()
{
global $form, $db, $lang, $mybb;
newpoints_lang_load("newpoints_shop");
echo "<br />";
// table
$table = new Table();
$table->construct_header($lang->newpoints_shop_item, array('width' => '30%'));
$table->construct_header($lang->newpoints_shop_username, array('width' => '30%'));
$table->construct_header($lang->newpoints_shop_price, array('width' => '20%', 'class' => 'align_center'));
$table->construct_header($lang->newpoints_shop_date, array('width' => '20%', 'class' => 'align_center'));
$query = $db->simple_select('newpoints_log', '*', 'action=\'shop_purchase\'', array('order_by' => 'date', 'order_dir' => 'DESC', 'limit' => intval($mybb->settings['newpoints_shop_lastpurchases'])));
while ($stats = $db->fetch_array($query)) {
$data = explode('-', $stats['data']);
$item = newpoints_shop_get_item($data[0]);
$table->construct_cell(htmlspecialchars_uni($item['name']));
$link = build_profile_link(htmlspecialchars_uni($stats['username']), intval($stats['uid']));
$table->construct_cell($link);
$table->construct_cell(newpoints_format_points($data[1]), array('class' => 'align_center'));
$table->construct_cell(my_date($mybb->settings['dateformat'], intval($stats['date']), '', false) . ", " . my_date($mybb->settings['timeformat'], intval($stats['date'])), array('class' => 'align_center'));
$table->construct_row();
}
if ($table->num_rows() == 0) {
$table->construct_cell($lang->newpoints_error_gathering, array('colspan' => 4));
$table->construct_row();
}
$table->output($lang->newpoints_stats_lastpurchases);
}
示例8: restfulapi_admin_load
//.........这里部分代码省略.........
flash_message($lang->restfulapi_key_deleted_successfully, "success");
} else {
flash_message($lang->restfulapi_key_not_found, "error");
}
admin_redirect("index.php?module=config-restfulapi&action=manage-keys");
} elseif ($do == "regenerate" && isset($mybb->input["key_id"]) && isset($mybb->input["my_post_key"]) && verify_post_check($mybb->input["my_post_key"])) {
$key_id = $db->escape_string($mybb->input["key_id"]);
if ($db->simple_select("apikeys", "*", "id='{$key_id}'")->num_rows == 1) {
$apikey = restfulapi_generate_key();
/* can't figure out a better way to generate a random yet never-generated-before API key than this one */
while ($db->simple_select("apikeys", "*", "apikey='{$apikey}'")->num_rows != 0) {
$apikey = restfulapi_generate_key();
}
$update = array("apikey" => $db->escape_string(htmlspecialchars_uni($apikey)));
$db->update_query("apikeys", $update, "id='{$key_id}'");
restfulapi_cache_rebuild();
flash_message($lang->restfulapi_key_regenerated_successfully, "success");
} else {
flash_message($lang->restfulapi_key_not_found, "error");
}
admin_redirect("index.php?module=config-restfulapi&action=manage-keys");
}
} else {
$restfulapi_cache = $cache->read("restfulapi");
$apikeysets = $restfulapi_cache["keys"];
$table = new Table();
$table->construct_header($lang->restfulapi_customer, array("width" => "15%"));
$table->construct_header($lang->restfulapi_api_key, array("class" => "align_center", "width" => "29%"));
$table->construct_header($lang->restfulapi_comment, array("class" => "align_center", "width" => "30%"));
$table->construct_header($lang->restfulapi_usage, array("class" => "align_center", "width" => "5%"));
$table->construct_header($lang->restfulapi_controls, array("class" => "align_center", "width" => "21%", "colspan" => 3));
if (count($apikeysets) == 0) {
$table->construct_cell($lang->sprintf($lang->restfulapi_no_api_key, '<a href="index.php?module=config-restfulapi&action=add-key">', '</a>'), array("class" => "first", "colspan" => 5));
$table->construct_row();
} else {
// TODO : pagination maybe ?
foreach ($apikeysets as $key => $keyset) {
$table->construct_cell("<b>" . htmlspecialchars_uni($keyset['apicustomer']) . "</b>");
$table->construct_cell(htmlspecialchars_uni($keyset['apikey']));
$table->construct_cell(htmlspecialchars_uni($keyset['apicomment']));
$table->construct_cell(htmlspecialchars_uni($keyset['access']), array("class" => "align_center"));
$table->construct_cell("<a href=\"index.php?module=config-restfulapi&action=manage-keys&do=regenerate&key_id={$keyset['id']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->restfulapi_regenerate_api_key_confirmation}')\">{$lang->restfulapi_regenerate_api_key}</a>", array("class" => "align_center", "width" => "9%"));
$table->construct_cell("<a href=\"index.php?module=config-restfulapi&action=manage-keys&do=edit&key_id={$keyset['id']}\">{$lang->restfulapi_edit}</a>", array("class" => "align_center", "width" => "6%"));
$table->construct_cell("<a href=\"index.php?module=config-restfulapi&action=manage-keys&do=delete&key_id={$keyset['id']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->restfulapi_delete_confirm}')\">{$lang->restfulapi_delete}</a>", array("class" => "align_center", "width" => "6%"));
$table->construct_row();
}
}
$table->output($lang->restfulapi_manage_api_keys);
}
break;
case "add-key":
if ($mybb->request_method == "post" && isset($mybb->input["apicustomer"]) && is_string($mybb->input["apicustomer"]) && isset($mybb->input["apicomment"]) && is_string($mybb->input["apicomment"]) && isset($mybb->input["maxreq"]) && is_numeric($mybb->input["maxreq"]) && isset($mybb->input["maxreqrate"]) && in_array($mybb->input["maxreqrate"], array("m", "w", "d", "h"))) {
$apikey = restfulapi_generate_key();
/* can't figure out a better way to generate a random yet never-generated-before API key than this one */
while ($db->simple_select("apikeys", "*", "apikey='{$db->escape_string($apikey)}'")->num_rows != 0) {
$apikey = restfulapi_generate_key();
}
$insert = array("apicustomer" => $db->escape_string(htmlspecialchars_uni($mybb->input["apicustomer"])), "apicomment" => $db->escape_string(htmlspecialchars_uni($mybb->input["apicomment"])), "access" => 0, "maxreq" => (int) $mybb->input["maxreq"], "maxreqrate" => $db->escape_string(htmlspecialchars_uni($mybb->input["maxreqrate"])), "apikey" => $db->escape_string(htmlspecialchars_uni($apikey)));
$apikeyid = $db->insert_query("apikeys", $insert);
if (isset($mybb->input["apinames"]) && is_array($mybb->input["apinames"])) {
$insert_allowed = array();
foreach ($mybb->input["apinames"] as $apiname) {
$insert_allowed[] = array("apikey" => $db->escape_string($apikeyid), "apiname" => $db->escape_string($apiname));
}
$db->insert_query_multiple("apipermissions", $insert_allowed);
}
示例9: explode
} else {
$fids = array_unique(array_map('intval', array_map('trim', explode(',', $tf_forum))));
$fnames = '';
foreach ($fids as &$fid) {
if (!isset($forums[$fid]['name'])) {
// forum deleted
$fname = '<em>' . $lang->sprintf($lang->threadfields_deleted_forum_id, $fid) . '</em>';
} else {
$fname = $forums[$fid]['name'];
}
$fnames .= ($fnames ? ', ' : '') . $fname;
}
$celldata = $lang->sprintf($lang->threadfields_for_forums, $fnames);
}
$table->construct_cell($celldata, array('colspan' => 6, 'style' => 'padding: 2px;'));
$table->construct_row();
}
$tfname = htmlspecialchars_uni($tf['field']);
$table->construct_cell('<a href="' . xthreads_admin_url('config', 'threadfields') . '&action=edit&field=' . urlencode($tf['field']) . '"><strong>' . htmlspecialchars_uni($tf['title']) . '</strong></a>');
// ... but generate_check_box doesn't have a "style" thing for the options array ... :(
$table->construct_cell($tfname);
$inputtype_lang = '';
switch ($tf['inputtype']) {
case XTHREADS_INPUT_TEXT:
$inputtype_lang = 'threadfields_inputtype_text';
break;
case XTHREADS_INPUT_TEXTAREA:
$inputtype_lang = 'threadfields_inputtype_textarea';
break;
case XTHREADS_INPUT_SELECT:
$inputtype_lang = 'threadfields_inputtype_select';
示例10: array
/**
* Build a row for the table based form row.
*
* @param array $extra Array of extra options for the cell (optional).
*/
function construct_row($extra = array())
{
$this->_container->construct_row($extra);
}
示例11: asb_admin_manage_modules
function asb_admin_manage_modules()
{
global $lang, $mybb, $db, $page, $html, $min;
$page->extra_header .= <<<EOF
\t<link rel="stylesheet" type="text/css" href="styles/asb_acp.css" media="screen" />
\t<script src="jscripts/asb/asb{$min}.js" type="text/javascript"></script>
EOF;
$page->add_breadcrumb_item($lang->asb, $html->url());
$page->add_breadcrumb_item($lang->asb_manage_modules);
$page->output_header("{$lang->asb} - {$lang->asb_manage_modules}");
asb_output_tabs('asb_modules');
$table = new Table();
$table->construct_header($lang->asb_name, array("width" => '22%'));
$table->construct_header($lang->asb_description, array("width" => '55%'));
$table->construct_header($lang->asb_modules_author, array("width" => '15%'));
$table->construct_header($lang->asb_controls, array("width" => '8%'));
$addons = asb_get_all_modules();
// if there are installed modules display them
if (!empty($addons) && is_array($addons)) {
foreach ($addons as $this_module) {
$data = $this_module->get(array('title', 'description', 'base_name', 'author', 'author_site', 'module_site', 'version', 'public_version', 'compatibility'));
$out_of_date = '';
if (!$data['compatibility'] || version_compare('2.1', $data['compatibility'], '<')) {
$out_of_date = <<<EOF
<br /><span style="color: red;">{$lang->asb_module_out_of_date}</span>
EOF;
}
$version = $data['version'];
if ($data['public_version']) {
$version = $data['public_version'];
}
// title
$table->construct_cell($html->link($data['module_site'], $data['title'], array("style" => 'font-weight: bold;')) . " ({$version})");
// description
$table->construct_cell($data['description'] . $out_of_date);
if ($data['author'] == 'Wildcard') {
$data['author'] = 'default';
}
$author = $data['author'];
if ($data['author_site']) {
$author = $html->link($data['author_site'], $data['author'], array("style" => 'font-weight: bold;'));
}
// author
$table->construct_cell($author);
// options pop-up
$popup = new PopupMenu('module_' . $data['base_name'], $lang->asb_options);
// delete
$popup->add_item($lang->asb_delete, $html->url(array("action" => 'delete_addon', "addon" => $data['base_name'])), "return confirm('{$lang->asb_modules_del_warning}');");
// pop-up cell
$table->construct_cell($popup->fetch(), array("width" => '10%'));
// finish row
$table->construct_row();
}
} else {
$table->construct_cell("<span style=\"color: gray;\">{$lang->asb_no_modules_detected}</span>", array("colspan" => 3));
$table->construct_row();
}
$table->output($lang->asb_addon_modules);
// build link bar and ACP footer
asb_output_footer('addons');
}
示例12: automedia_admin
function automedia_admin()
{
global $db, $lang, $mybb, $page, $cache, $run_module, $action_file;
if (!isset($lang->automedia_modules)) {
$lang->load("automedia");
}
if ($page->active_action != 'automedia') {
return false;
}
if ($run_module == 'tools' && $action_file == 'automedia') {
$page->add_breadcrumb_item($lang->automedia, 'index.php?module=tools-automedia');
// Show site modules
if ($mybb->input['action'] == "" || !$mybb->input['action']) {
$page->add_breadcrumb_item($lang->automedia_modules);
$page->output_header($lang->automedia_modules . ' - ' . $lang->automedia_modules);
$sub_tabs['automedia'] = array('title' => $lang->automedia_modules, 'link' => 'index.php?module=tools-automedia', 'description' => $lang->automedia_modules_description1);
if ($mybb->settings['av_adultsites'] == 1) {
$sub_tabs['special'] = array('title' => $lang->automedia_adult, 'link' => 'index.php?module=tools-automedia&action=adult', 'description' => $lang->automedia_adult_description1);
}
$page->output_nav_tabs($sub_tabs, 'automedia');
$aotable = new Table();
$aotable->construct_header('#');
$aotable->construct_header($lang->automedia_oembed_desc);
if (isset($mybb->settings['av_embera']) && $mybb->settings['av_embera'] == 1) {
$aotable->construct_cell('<img src="styles/default/images/icons/success.png" width="16px" height="16px" alt="OK" />');
$aotable->construct_cell($lang->automedia_modules_embera);
$aotable->construct_row();
}
if (isset($mybb->settings['av_embedly']) && $mybb->settings['av_embedly'] == 1 && !empty($mybb->settings['av_embedly_key']) && $mybb->settings['av_embedly_key'] != "") {
$aotable->construct_cell('<img src="styles/default/images/icons/success.png" width="16px" height="16px" alt="' . $lang->automedia_modules_success . '" />');
$aotable->construct_cell($lang->automedia_modules_embedly);
$aotable->construct_row();
}
$aotable->output($lang->automedia_oembed);
$amtable = new Table();
$amtable->construct_header('#');
$amtable->construct_header($lang->automedia_modules_description2);
$amtable->construct_header('<div style="text-align: center;">' . $lang->automedia_modules_status . '</div>');
$amtable->construct_header('<div style="text-align: center;">' . $lang->automedia_modules_options . ':</div>');
$folder = MYBB_ROOT . "inc/plugins/automedia/mediasites/";
if (is_dir($folder)) {
$mediafiles = scandir($folder);
$mediatitles = str_replace(".php", "", $mediafiles);
$query = $db->simple_select('automedia', 'name', "class='site'");
// Find missing files for active modules
while ($missing = $db->fetch_array($query)) {
if (!in_array($missing['name'], $mediatitles)) {
$missingfile = ucfirst(htmlspecialchars_uni($missing['name']));
$amtable->construct_cell('<strong>!</strong>');
$amtable->construct_cell('<strong>' . $missingfile . '</strong> (<a href="' . $sub_tabs['automedia']['link'] . '&action=deactivate&site=' . urlencode($missing['name']) . '&my_post_key=' . $mybb->post_code . '"><strong>' . $lang->automedia_modules_deactivate . '</strong></a>)');
$amtable->construct_cell($lang->automedia_modules_notfound . ' ' . $folder . '' . htmlspecialchars_uni($missing['name']) . '.php', array('colspan' => '2'));
$amtable->construct_row();
}
}
$i = 1;
foreach ($mediafiles as $sites) {
// Fetch all files in the folder
$siteinfo = pathinfo($folder . "/" . $sites);
if ($sites != "." && $sites != "..") {
$filetype = "php";
// We need only php files
if ($siteinfo['extension'] == $filetype) {
$site = str_replace(".php", "", $sites);
$media = ucfirst(htmlspecialchars_uni($site));
$check = file_get_contents($folder . $siteinfo['basename']);
if (preg_match('"function automedia_"isU', $check)) {
$amtable->construct_cell($i);
$amtable->construct_cell('<a href="' . $sub_tabs['automedia']['link'] . '&action=showsite&site=' . urlencode($site) . '&my_post_key=' . $mybb->post_code . '"><strong>' . $media . '</strong></a>');
$query2 = $db->simple_select('automedia', '*', "name='" . htmlspecialchars_uni($site) . "'");
$active = $db->fetch_array($query2);
if ($active && $active['class'] == "site") {
$amtable->construct_cell('<div style="text-align: center;"><img src="' . $mybb->asset_url . '/images/mod-on.png" width="32" height="32" alt="' . $lang->automedia_modules_success . '" />');
$amtable->construct_cell('<div style="text-align: center;"><a href="' . $sub_tabs['automedia']['link'] . '&action=deactivate&site=' . urlencode($site) . '&my_post_key=' . $mybb->post_code . '"><strong>' . $lang->automedia_modules_deactivate . '</strong></a></div>');
} else {
$amtable->construct_cell('<div style="text-align: center;"><img src="' . $mybb->asset_url . '/images/mod-off.png" width="32" height="32" alt="' . $lang->automedia_modules_fail . '" />');
$amtable->construct_cell('<div style="text-align: center;"><a href="' . $sub_tabs['automedia']['link'] . '&action=activate&site=' . urlencode($site) . '&my_post_key=' . $mybb->post_code . '"><strong>' . $lang->automedia_modules_activate . '</strong></a></div>');
}
$amtable->construct_row();
$i++;
}
}
}
}
if ($amtable->num_rows() == 0) {
$amtable->construct_cell($lang->automedia_modules, array('colspan' => '4'));
$amtable->construct_row();
}
} else {
$amtable->construct_cell($lang->automedia_modules_missing_sitesfolder, array('colspan' => '4'));
$amtable->construct_row();
}
$amtable->output($lang->automedia_modules);
echo '<div style="text-align: center;">
<a href="' . $sub_tabs['automedia']['link'] . '&action=activateallsites&my_post_key=' . $mybb->post_code . '"><span style="border: 3px double #0F5C8E; padding: 3px; background: #fff url(images/submit_bg.png) repeat-x top; color: #0F5C8E; margin-right: 3px;">' . $lang->automedia_modules_activateall . '</span></a>
</div>';
$page->output_footer();
}
// Show special modules
if ($mybb->input['action'] == "adult" && $mybb->settings['av_adultsites'] == 1) {
$page->add_breadcrumb_item($lang->automedia_adult);
//.........这里部分代码省略.........
示例13: myfbconnect_settings_footer
/**
* Displays peekers in settings
**/
function myfbconnect_settings_footer()
{
global $mybb, $db, $lang;
if ($mybb->input["action"] == "change" and $mybb->request_method != "post") {
$gid = myfbconnect_settings_gid();
if ($mybb->input['gid'] == $gid) {
// Delete reports
if ($mybb->input['delete_report']) {
switch ($mybb->input['delete_report']) {
case 'all':
$db->delete_query('myfbconnect_reports');
break;
default:
$db->delete_query('myfbconnect_reports', 'id = ' . (int) $mybb->input['delete_report']);
}
flash_message($lang->myfbconnect_success_deleted_reports, 'success');
admin_redirect('index.php?module=config-settings&action=change&gid=' . $gid);
}
$reports = array();
$query = $db->simple_select('myfbconnect_reports');
while ($report = $db->fetch_array($query)) {
$reports[] = $report;
}
if ($reports) {
$table = new Table();
$table->construct_header($lang->myfbconnect_reports_date, array('width' => '15%'));
$table->construct_header($lang->myfbconnect_reports_code, array('width' => '5%'));
$table->construct_header($lang->myfbconnect_reports_file);
$table->construct_header($lang->myfbconnect_reports_line, array('width' => '5%'));
$table->construct_header($lang->options, array('width' => '10%', 'style' => 'text-align: center'));
foreach ($reports as $report) {
foreach ($report as $k => $val) {
if (in_array($k, array('id', 'message', 'trace'))) {
continue;
}
if ($k == 'dateline') {
$val = my_date($mybb->settings['dateformat'], $val) . ', ' . my_date($mybb->settings['timeformat'], $val);
}
$table->construct_cell($val);
}
$popup = new PopupMenu("item_{$report['id']}", $lang->options);
$popup->add_item($lang->myfbconnect_reports_download, 'index.php?module=config-settings&action=change&gid=' . $gid . '&export_id=' . $report['id']);
$popup->add_item($lang->myfbconnect_reports_delete, 'index.php?module=config-settings&action=change&gid=' . $gid . '&delete_report=' . $report['id']);
$table->construct_cell($popup->fetch(), array('class' => 'align_center'));
$table->construct_row();
}
$table->construct_cell('<a href="index.php?module=config-settings&action=change&gid=' . $gid . '&delete_report=all" class="button">' . $lang->myfbconnect_reports_delete_all . '</a>', array('colspan' => 5, 'class' => 'align_center'));
$table->construct_row();
$table->output($lang->myfbconnect_reports);
}
}
if ($mybb->input["gid"] == $gid or !$mybb->input['gid']) {
// 1.8 has jQuery, not Prototype
if ($mybb->version_code >= 1700) {
echo '<script type="text/javascript">
$(document).ready(function() {
loadMyFBConnectPeekers();
loadStars();
});
function loadMyFBConnectPeekers()
{
new Peeker($(".setting_myfbconnect_passwordpm"), $("#row_setting_myfbconnect_passwordpm_subject"), /1/, true);
new Peeker($(".setting_myfbconnect_passwordpm"), $("#row_setting_myfbconnect_passwordpm_message"), /1/, true);
new Peeker($(".setting_myfbconnect_passwordpm"), $("#row_setting_myfbconnect_passwordpm_fromid"), /1/, true);
new Peeker($(".setting_myfbconnect_fbbio"), $("#row_setting_myfbconnect_fbbiofield"), /1/, true);
new Peeker($(".setting_myfbconnect_fblocation"), $("#row_setting_myfbconnect_fblocationfield"), /1/, true);
new Peeker($(".setting_myfbconnect_fbdetails"), $("#row_setting_myfbconnect_fbdetailsfield"), /1/, true);
new Peeker($(".setting_myfbconnect_fbsex"), $("#row_setting_myfbconnect_fbsexfield"), /1/, true);
new Peeker($(".setting_myfbconnect_postonwall"), $("#row_setting_myfbconnect_postonwall_message"), /1/, true);
}
function loadStars()
{
add_star("row_setting_myfbconnect_appid");
add_star("row_setting_myfbconnect_appsecret");
}
</script>';
} else {
echo '<script type="text/javascript">
Event.observe(window, "load", function() {
loadMyFBConnectPeekers();
loadStars();
});
function loadMyFBConnectPeekers()
{
new Peeker($$(".setting_myfbconnect_passwordpm"), $("row_setting_myfbconnect_passwordpm_subject"), /1/, true);
new Peeker($$(".setting_myfbconnect_passwordpm"), $("row_setting_myfbconnect_passwordpm_message"), /1/, true);
new Peeker($$(".setting_myfbconnect_passwordpm"), $("row_setting_myfbconnect_passwordpm_fromid"), /1/, true);
new Peeker($$(".setting_myfbconnect_fbbio"), $("row_setting_myfbconnect_fbbiofield"), /1/, true);
new Peeker($$(".setting_myfbconnect_fblocation"), $("row_setting_myfbconnect_fblocationfield"), /1/, true);
new Peeker($$(".setting_myfbconnect_fbdetails"), $("row_setting_myfbconnect_fbdetailsfield"), /1/, true);
new Peeker($$(".setting_myfbconnect_fbsex"), $("row_setting_myfbconnect_fbsexfield"), /1/, true);
new Peeker($$(".setting_myfbconnect_postonwall"), $("row_setting_myfbconnect_postonwall_message"), /1/, true);
}
function loadStars()
{
add_star("row_setting_myfbconnect_appid");
add_star("row_setting_myfbconnect_appsecret");
//.........这里部分代码省略.........
示例14: PHP_files_cleaner_actions
function PHP_files_cleaner_actions()
{
global $lang, $mybb, $sub_tabs;
$lang->load('PHP_files_cleaner_acp');
$sub_tabs['PHP_files_cleaner'] = array('title' => $lang->PHP_files_cleaner, 'link' => 'index.php?module=tools-system_health&action=clean_PHP_files', 'description' => $lang->PHP_files_cleaner_info);
if ($mybb->input['action'] == 'do_clean_PHP_files' && $mybb->request_method == 'post') {
$errors = array();
$lead = $mybb->get_input('leading', MyBB::INPUT_ARRAY);
$trail = $mybb->get_input('trailing', MyBB::INPUT_ARRAY);
if (!$mybb->settings['PHP_files_cleaner_leading'] && !$mybb->settings['PHP_files_cleaner_trailing']) {
$errors[] = $lang->PHP_files_cleaner_nothing_enabled;
}
if (empty($lead) && empty($trail)) {
$errors[] = $lang->PHP_files_cleaner_nothing_chosen;
}
if (!$errors) {
$leadandtrail = array_unique(array_merge($lead, $trail));
$nonchangeable = array();
foreach ($leadandtrail as $filename) {
$fullfilename = MYBB_ROOT . $filename;
if (is_readable($fullfilename) && is_writable($fullfilename)) {
$file = file_get_contents($fullfilename);
// Remove BOM and leading whitespace
if ($mybb->settings['PHP_files_cleaner_leading'] && in_array($filename, $lead)) {
$file = preg_replace('/^\\x{FEFF}?\\s*/u', '', $file);
}
// Remove ending tag and trailing whitespace
if ($mybb->settings['PHP_files_cleaner_trailing'] && in_array($filename, $trail)) {
$file = preg_replace('/(\\s*\\?>)?\\s*$/', '', $file);
}
file_put_contents($fullfilename, $file);
} else {
$nonchangeable[] = htmlspecialchars_uni($filename);
}
}
if ($nonchangeable) {
flash_message($lang->sprintf($lang->PHP_files_cleaner_nonchangeable, implode($lang->comma, $nonchangeable)), 'error');
} else {
flash_message($lang->PHP_files_cleaner_success, 'success');
}
admin_redirect('index.php?module=tools-system_health&action=clean_PHP_files');
} else {
$mybb->input['action'] = 'clean_PHP_files';
}
}
if ($mybb->input['action'] == 'clean_PHP_files') {
global $page;
$page->add_breadcrumb_item($lang->PHP_files_cleaner);
$page->output_header($lang->PHP_files_cleaner);
$page->output_nav_tabs($sub_tabs, 'PHP_files_cleaner');
if (!empty($errors)) {
$page->output_inline_error($errors);
}
$table = new Table();
if (!$mybb->settings['PHP_files_cleaner_leading'] && !$mybb->settings['PHP_files_cleaner_trailing']) {
$table->construct_cell($lang->PHP_files_cleaner_nothing_enabled);
$table->construct_row();
} else {
$leading = $trailing = array();
$diriterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(MYBB_ROOT));
$phpfiles = new RegexIterator($diriterator, '/\\.php$/i', RegexIterator::GET_MATCH);
foreach ($phpfiles as $filename => $info) {
if (is_readable($filename)) {
$contents = file_get_contents($filename);
if ($mybb->settings['PHP_files_cleaner_leading'] && preg_match('/^\\x{FEFF}?\\s*/u', $contents, $matches) && $matches[0]) {
$leading[] = $filename;
}
if ($mybb->settings['PHP_files_cleaner_trailing'] && preg_match('/(\\s*\\?>)?\\s*$/', $contents, $matches) && $matches[0]) {
$trailing[] = $filename;
}
}
}
// Filenames sorted by the number of issues
$cnt = array_count_values(array_merge($leading, $trailing));
arsort($cnt);
$allfiles = array_keys($cnt);
if (empty($allfiles)) {
$table->construct_cell($lang->PHP_files_cleaner_nothing_found);
$table->construct_row();
} else {
$form = new Form('index.php?module=tools-system_health&action=do_clean_PHP_files', 'post');
$table->construct_header($lang->PHP_files_cleaner_filename);
$table->construct_header($lang->PHP_files_cleaner_leading, array('class' => 'align_center'));
$table->construct_header($lang->PHP_files_cleaner_trailing, array('class' => 'align_center'));
$table->construct_header($form->generate_check_box('allbox', 1, '', array('class' => 'checkall', 'checked' => 1)), array('style' => 'text-align: right;'));
foreach ($allfiles as $filename) {
$clean_filename = htmlspecialchars_uni(str_replace(MYBB_ROOT, '', $filename));
$leading_cbox = in_array($filename, $leading) ? $form->generate_check_box('leading[]', $clean_filename, '', array('checked' => 1)) : '';
$trailing_cbox = in_array($filename, $trailing) ? $form->generate_check_box('trailing[]', $clean_filename, '', array('checked' => 1)) : '';
$table->construct_cell($clean_filename);
$table->construct_cell($leading_cbox, array('class' => 'align_center'));
$table->construct_cell($trailing_cbox, array('class' => 'align_center'));
$table->construct_cell('');
$table->construct_row();
}
}
}
$table->output($lang->PHP_files_cleaner);
if (!empty($allfiles)) {
$buttons[] = $form->generate_submit_button($lang->PHP_files_cleaner_clean, array('name' => 'clean'));
//.........这里部分代码省略.........
示例15: GalleryPermissions
function GalleryPermissions()
{
global $page, $db, $lang, $mybb;
$page->output_header($lang->gallery_text_title . ' - ' . $lang->gallery_text_permissions);
DoGalleryAdminTabs('ezgallery_permissions');
echo '
<form method="post" name="frmpermissions" action="index.php?module=config/ezgallery&action=permissions2">
';
$table = new Table();
$table->construct_header($lang->gallery_membergroup);
$table->construct_header($lang->permissionname_ezgallery_view);
$table->construct_header($lang->permissionname_ezgallery_add);
$table->construct_header($lang->permissionname_ezgallery_edit);
$table->construct_header($lang->permissionname_ezgallery_delete);
$table->construct_header($lang->permissionname_ezgallery_comment);
$table->construct_header($lang->permissionname_ezgallery_report);
$table->construct_header($lang->permissionname_ezgallery_autoapprove);
$table->construct_header($lang->permissionname_ezgallery_manage);
$dbresult = $db->query("\n\t\t \tSELECT\n\t\t \t\tu.title, p.ID_GROUP, u.gid,\n\t\t \t\tp.view,p.add,p.edit,p.delete,p.comment,p.report,p.autoapprove, p.manage\n\t\t \tFROM " . TABLE_PREFIX . "usergroups AS u\n\t\t \tLEFT JOIN " . TABLE_PREFIX . "gallery_permissions as p ON (p.ID_GROUP = u.gid)\n\t\t \t");
while ($row = $db->fetch_array($dbresult)) {
$table->construct_cell($row['title']);
$table->construct_cell('<input type="checkbox" name="view_' . $row['gid'] . '" ' . ($row['view'] ? ' checked="checked"' : '') . ' />');
$table->construct_cell('<input type="checkbox" name="add_' . $row['gid'] . '" ' . ($row['add'] ? ' checked="checked"' : '') . ' />');
$table->construct_cell('<input type="checkbox" name="edit_' . $row['gid'] . '" ' . ($row['edit'] ? ' checked="checked"' : '') . ' />');
$table->construct_cell('<input type="checkbox" name="delete_' . $row['gid'] . '" ' . ($row['delete'] ? ' checked="checked"' : '') . ' />');
$table->construct_cell('<input type="checkbox" name="comment_' . $row['gid'] . '" ' . ($row['comment'] ? ' checked="checked"' : '') . ' />');
$table->construct_cell('<input type="checkbox" name="report_' . $row['gid'] . '" ' . ($row['report'] ? ' checked="checked"' : '') . ' />');
$table->construct_cell('<input type="checkbox" name="autoapprove_' . $row['gid'] . '" ' . ($row['autoapprove'] ? ' checked="checked"' : '') . ' />');
$table->construct_cell('<input type="checkbox" name="manage_' . $row['gid'] . '" ' . ($row['manage'] ? ' checked="checked"' : '') . ' />');
$table->construct_row();
}
$table->construct_cell('<input type="submit" value="' . $lang->gallery_update_permissions . '" />', array("colspan" => 9));
$table->construct_row();
$table->output($lang->gallery_text_permissions);
echo '
<input type="hidden" name="my_post_key" value="' . $mybb->post_code . '" />
</form>';
$page->output_footer();
}