当前位置: 首页>>代码示例>>PHP>>正文


PHP FormContainer::construct_row方法代码示例

本文整理汇总了PHP中FormContainer::construct_row方法的典型用法代码示例。如果您正苦于以下问题:PHP FormContainer::construct_row方法的具体用法?PHP FormContainer::construct_row怎么用?PHP FormContainer::construct_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormContainer的用法示例。


在下文中一共展示了FormContainer::construct_row方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

    $form_container->output_row_header($lang->smilie_delete, array("class" => "align_center", 'width' => '5%'));
    $query = $db->simple_select("smilies", "*", "", array('order_by' => 'disporder'));
    while ($smilie = $db->fetch_array($query)) {
        $smilie['image'] = str_replace("{theme:imgdir}", $theme['imgdir'], $smilie['image']);
        if (my_strpos($smilie['image'], "p://") || substr($smilie['image'], 0, 1) == "/") {
            $image = $smilie['image'];
        } else {
            $image = "../" . $smilie['image'];
        }
        $form_container->output_cell("<img src=\"{$image}\" alt=\"\" />", array("class" => "align_center", "width" => 1));
        $form_container->output_cell($form->generate_text_box("name[{$smilie['sid']}]", $smilie['name'], array('id' => 'name', 'style' => 'width: 98%')));
        $form_container->output_cell($form->generate_text_box("find[{$smilie['sid']}]", $smilie['find'], array('id' => 'find', 'style' => 'width: 95%')));
        $form_container->output_cell($form->generate_text_box("disporder[{$smilie['sid']}]", $smilie['disporder'], array('id' => 'disporder', 'style' => 'width: 80%')));
        $form_container->output_cell($form->generate_yes_no_radio("showclickable[{$smilie['sid']}]", $smilie['showclickable']), array("class" => "align_center"));
        $form_container->output_cell($form->generate_check_box("delete[{$smilie['sid']}]", 1, $mybb->input['delete']), array("class" => "align_center"));
        $form_container->construct_row();
    }
    if ($form_container->num_rows() == 0) {
        $form_container->output_cell($lang->no_smilies, array('colspan' => 6));
        $form_container->construct_row();
    }
    $form_container->end();
    $buttons[] = $form->generate_submit_button($lang->save_smilies);
    $buttons[] = $form->generate_reset_button($lang->reset);
    $form->output_submit_wrapper($buttons);
    $form->end();
    $page->output_footer();
}
if (!$mybb->input['action']) {
    $plugins->run_hooks("admin_config_smilies_start");
    $page->output_header($lang->manage_smilies);
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:31,代码来源:smilies.php

示例2: retrieve_single_permissions_row

/**
 * @param int $gid
 * @param int $fid
 *
 * @return string
 */
function retrieve_single_permissions_row($gid, $fid)
{
    global $mybb, $lang, $cache, $db;
    $query = $db->simple_select("usergroups", "*", "gid='{$gid}'");
    $usergroup = $db->fetch_array($query);
    $query = $db->simple_select("forums", "*", "fid='{$fid}'");
    $forum_data = $db->fetch_array($query);
    $query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'");
    while ($existing = $db->fetch_array($query)) {
        $existing_permissions[$existing['gid']] = $existing;
    }
    $cached_forum_perms = $cache->read("forumpermissions");
    $field_list = array('canview' => $lang->permissions_canview, 'canpostthreads' => $lang->permissions_canpostthreads, 'canpostreplys' => $lang->permissions_canpostreplys, 'canpostpolls' => $lang->permissions_canpostpolls);
    $field_list2 = array('canview' => $lang->perm_drag_canview, 'canpostthreads' => $lang->perm_drag_canpostthreads, 'canpostreplys' => $lang->perm_drag_canpostreplys, 'canpostpolls' => $lang->perm_drag_canpostpolls);
    $form = new Form('', '', "", 0, "", true);
    $form_container = new FormContainer();
    $perms = array();
    if (is_array($existing_permissions) && $existing_permissions[$usergroup['gid']]) {
        $perms = $existing_permissions[$usergroup['gid']];
        $default_checked = false;
    } elseif (is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']]) {
        $perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
        $default_checked = true;
    } else {
        if (is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) {
            $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
            $default_checked = true;
        }
    }
    if (!$perms) {
        $perms = $usergroup;
        $default_checked = true;
    }
    foreach ($field_list as $forum_permission => $forum_perm_title) {
        if ($perms[$forum_permission] == 1) {
            $perms_checked[$forum_permission] = 1;
        } else {
            $perms_checked[$forum_permission] = 0;
        }
    }
    $usergroup['title'] = htmlspecialchars_uni($usergroup['title']);
    if ($default_checked == 1) {
        $inherited_text = $lang->inherited_permission;
    } else {
        $inherited_text = $lang->custom_permission;
    }
    $form_container->output_cell("<strong>{$usergroup['title']}</strong> <small style=\"vertical-align: middle;\">({$inherited_text})</small>");
    $field_select = "<div class=\"quick_perm_fields\">\n";
    $field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled_{$usergroup['gid']}\">\n";
    foreach ($perms_checked as $perm => $value) {
        if ($value == 1) {
            $field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";
        }
    }
    $field_select .= "</ul></div>\n";
    $field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled_{$usergroup['gid']}\">\n";
    foreach ($perms_checked as $perm => $value) {
        if ($value == 0) {
            $field_select .= "<li id=\"field-{$perm}\">{$field_list2[$perm]}</li>";
        }
    }
    $field_select .= "</ul></div></div>\n";
    $field_select .= $form->generate_hidden_field("fields_" . $usergroup['gid'], @implode(",", @array_keys($perms_checked, 1)), array('id' => 'fields_' . $usergroup['gid']));
    $field_select = str_replace("\n", "", $field_select);
    foreach ($field_list as $forum_permission => $permission_title) {
        $field_options[$forum_permission] = $permission_title;
    }
    $form_container->output_cell($field_select, array('colspan' => 2));
    if (!$default_checked) {
        $form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=permissions&amp;pid={$perms['pid']}\" onclick=\"MyBB.popupWindow('index.php?module=forum-management&action=permissions&pid={$perms['pid']}&ajax=1', null, true); return false;\">{$lang->edit_permissions}</a>", array("class" => "align_center"));
        $form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=clear_permission&amp;pid={$perms['pid']}&amp;my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_clear_custom_permission}')\">{$lang->clear_custom_perms}</a>", array("class" => "align_center"));
    } else {
        $form_container->output_cell("<a href=\"index.php?module=forum-management&amp;action=permissions&amp;gid={$usergroup['gid']}&amp;fid={$fid}\"  onclick=\"MyBB.popupWindow('index.php?module=forum-management&action=permissions&gid={$usergroup['gid']}&fid={$fid}&ajax=1', null, true); return false;\">{$lang->set_custom_perms}</a>", array("class" => "align_center", "colspan" => 2));
    }
    $form_container->construct_row();
    return $form_container->output_row_cells(0, true);
}
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:83,代码来源:management.php

示例3: while

    if ($count == 0) {
        $table->output_cell($lang->bam_manage_null);
        // no announcements found
        $table->output_cell("");
        $table->output_cell("");
        $table->output_row("");
    } else {
        $i = 0;
        while ($i <= $count) {
            if (isset($data[$i]['PID']) && $data[$i]['PID'] != null) {
                $table->output_cell($data[$i]['announcement']);
                $table->output_cell($data[$i]['class']);
                $table->output_cell("<center><input type='text' name=\"disporder[" . $data[$i]['PID'] . "]\" value='" . $data[$i]['disporder'] . "' /></center>");
                $table->output_cell("<center><a href='index.php?module=config-bam&action=edit&id=" . $data[$i]['PID'] . "'>" . $lang->bam_manage_edit . "</a></center>");
                $table->output_cell("<center><a href='index.php?module=config-bam&action=delete&id=" . $data[$i]['PID'] . "&my_post_key=" . $mybb->post_code . "' onclick=' return confirm(\"" . $lang->bam_manage_delete_confirm . "\");'>" . $lang->bam_manage_delete . "</a></center>");
                if ($data[$i]['pinned'] == 1) {
                    $table->output_cell("<center><a href='index.php?module=config-bam&action=unpin&id=" . $data[$i]['PID'] . "&my_post_key=" . $mybb->post_code . "'>" . $lang->bam_manage_unpin . "</a></center>");
                } else {
                    $table->output_cell("<center><a href='index.php?module=config-bam&action=pin&id=" . $data[$i]['PID'] . "&my_post_key=" . $mybb->post_code . "'>" . $lang->bam_manage_pin . "</a></center>");
                }
                $table->construct_row();
            }
            $i++;
        }
    }
    $table->end();
    $buttons = array();
    $buttons[] = $form_t->generate_submit_button($lang->bam_manage_order_submit);
    $form_t->output_submit_wrapper($buttons);
    $page->output_footer($lang->bam_title_acronym);
}
开发者ID:Darth-Apple,项目名称:BAM,代码行数:31,代码来源:bam.php

示例4: tslink_admin

function tslink_admin()
{
    global $db, $lang, $mybb, $page, $run_module, $action_file, $plugins, $cache;
    $lang->load('tslink');
    if ($run_module == 'user' && $action_file == 'tslink') {
        $page->add_breadcrumb_item($lang->tslink_plugin_name, 'index.php?module=tslink');
        if ($mybb->input['action'] == 'tslink_changestatus') {
            $mybb_uid = intval($mybb->input['uid']);
            $changeto = intval($mybb->input['changeto']);
            $db->query('UPDATE ' . TABLE_PREFIX . "users SET memberstatus= '" . $changeto . "' WHERE uid='" . $mybb_uid . "'");
            $queryUser = $db->simple_select('users', 'username, lastip', "uid='{$mybb_uid}'");
            $bin_ip_in_db = $db->fetch_field($queryUser, 'lastip');
            $givenip = my_inet_ntop($db->unescape_binary($bin_ip_in_db));
            $forUser = $db->fetch_field($queryUser, 'username');
            // If there's an ip of the user in de database, update the unique id's in the database
            if (!empty($givenip)) {
                tslink_log("=============================================================\n=================== " . date('d-m-Y H:i:s') . " =====================\n=============================================================\n", $forUser);
                tslink_log('Started on AdminCP by ' . $mybb->user['username'] . ' - IP address of user available (' . $givenip . ') - doing tslink_update_uids & tslink_update_groups', $forUser);
                $tslink_update_uids_results = tslink_update_uids($givenip);
                tslink_log($tslink_update_uids_results, $forUser);
                $message = $lang->tslink_status_changed;
            }
            // If there's no lastip of the user in the database - dont try to update the unique id's in the database
            if (empty($givenip)) {
                tslink_log("=============================================================\n=================== " . date('d-m-Y H:i:s') . " =====================\n=============================================================\n", $forUser);
                tslink_log('Started on AdminCP ' . $mybb->user['username'] . ' - IP address of user NOT available - only doing tslink_update_groups to update previously registered TS uids', $forUser);
                $tslink_update_groups_results = tslink_update_groups($mybb_uid);
                tslink_log($tslink_update_groups_results, $forUser);
                $message = $lang->tslink_status_changed;
            }
            admin_redirect('index.php?module=user-tslink');
        }
        if (!$mybb->input['action'] || $mybb->input['action'] == 'conntest') {
            $page->output_header($lang->tslink);
            $sub_tabs['tslink'] = ['title' => $lang->tslink_tab_home, 'link' => 'index.php?module=user-tslink', 'description' => $lang->tslink_admin_tab_home_desc];
            $sub_tabs['tslink-conntest'] = ['title' => $lang->tslink_admin_tsinfo_title, 'link' => 'index.php?module=user-tslink&action=conntest', 'description' => $lang->tslink_admin_tsinfo_desc];
        }
        if ($mybb->input['action'] == 'conntest') {
            require __DIR__ . '/config.php';
            $page->output_nav_tabs($sub_tabs, 'tslink-conntest');
            //build a new ts3admin object
            $ts3 = new ts3admin($ts3_server, $ts3_query_port);
            if ($ts3->getElement('success', $ts3->connect())) {
                //login as serveradmin
                $ts3->login($ts3_username, $ts3_password);
                //select teamspeakserver
                $ts3->selectServer($ts3_server_port);
                // Set displayed name in TS to given
                $ts3->setName($ts3_nickname);
                $form = new Form('index.php?module=user-tslink&action=conntest', 'post');
                $form_container = new FormContainer($lang->tslink_admin_tsinfo_full_title);
                $form_container->output_row($lang->tslink_admin_server_version, $ts3->version()['data']['version']);
                $form_container->output_row($lang->tslink_admin_server_platform, $ts3->version()['data']['platform']);
                $form_container->output_row($lang->tslink_admin_server_online_clients, $ts3->serverInfo()['data']['virtualserver_clientsonline'] . '/' . $ts3->serverInfo()['data']['virtualserver_maxclients']);
                $form_container->end();
                $form->end();
            } else {
                echo 'Connection could not be established.';
            }
            /*
             * This code retuns all errors from the debugLog
             */
            if (count($ts3->getDebugLog()) > 0) {
                foreach ($ts3->getDebugLog() as $logEntry) {
                    echo '<script>alert("' . $logEntry . '");</script>';
                }
            }
            $page->output_footer();
        }
        if (!$mybb->input['action']) {
            $page->output_nav_tabs($sub_tabs, 'tslink');
            $form = new Form('index.php?module=user-tslink', 'post');
            $form_container = new FormContainer($lang->tslink_admin_table_heading_users);
            $form_container->output_row_header($lang->tslink_admin_row_username, ['class' => 'align_left', width => '50%']);
            $form_container->output_row_header($lang->tslink_admin_row_status, ['class' => 'align_center']);
            $form_container->output_row_header($lang->tslink_admin_row_options, ['class' => 'align_center']);
            $form_container->output_row_header($lang->tslink_admin_row_options, ['class' => 'align_center']);
            $query = $db->simple_select('users', 'uid, username, memberstatus', '', ['order_by' => 'username', 'order_dir' => 'ASC']);
            while ($users = $db->fetch_array($query)) {
                $form_container->output_cell("<div style=\"\"><strong>{$users['username']}</strong></div>");
                if ($users['memberstatus'] == '0') {
                    $form_container->output_cell('<div style=""><strong>Member</strong></div>', ['class' => 'align_center']);
                    $form_container->output_cell("<a href=\"index.php?module=user-tslink&amp;action=tslink_changestatus&amp;uid={$users['uid']}&amp;changeto=1\">{$lang->tslink_admin_row_changestatus1}</a>", ['class' => 'align_center']);
                    $form_container->output_cell("<a href=\"index.php?module=user-tslink&amp;action=tslink_changestatus&amp;uid={$users['uid']}&amp;changeto=2\">{$lang->tslink_admin_row_changestatus2}</a>", ['class' => 'align_center']);
                } elseif ($users['memberstatus'] == '1') {
                    $form_container->output_cell('<div style=""><strong>Donating Member</strong></div>', ['class' => 'align_center']);
                    $form_container->output_cell("<a href=\"index.php?module=user-tslink&amp;action=tslink_changestatus&amp;uid={$users['uid']}&amp;changeto=0\">{$lang->tslink_admin_row_changestatus0}</a>", ['class' => 'align_center']);
                    $form_container->output_cell("<a href=\"index.php?module=user-tslink&amp;action=tslink_changestatus&amp;uid={$users['uid']}&amp;changeto=2\">{$lang->tslink_admin_row_changestatus2}</a>", ['class' => 'align_center']);
                } elseif ($users['memberstatus'] == '2') {
                    $form_container->output_cell('<div style=""><strong>VIP Member</strong></div>', ['class' => 'align_center']);
                    $form_container->output_cell("<a href=\"index.php?module=user-tslink&amp;action=tslink_changestatus&amp;uid={$users['uid']}&amp;changeto=0\">{$lang->tslink_admin_row_changestatus0}</a>", ['class' => 'align_center']);
                    $form_container->output_cell("<a href=\"index.php?module=user-tslink&amp;action=tslink_changestatus&amp;uid={$users['uid']}&amp;changeto=1\">{$lang->tslink_admin_row_changestatus1}</a>", ['class' => 'align_center']);
                }
                $form_container->construct_row();
            }
            $form_container->end();
            $form->end();
            $page->output_footer();
        }
    }
//.........这里部分代码省略.........
开发者ID:f0nt4,项目名称:TSLink,代码行数:101,代码来源:tslinkfunctions.php


注:本文中的FormContainer::construct_row方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。