Exemplo n.º 1
0
function AM_farmGold_showRestore()
{
    global $TB_settings;
    $info = AM_farmGold_getIDs();
    $IDs = $info['IDs'];
    $building = $info['building'];
    $checked = $TB_settings['AM_farmGoldRestore'] ? 'checked' : '';
    echo "<input type='checkbox' name='farmGoldRestore' onclick='this.form.submit();' value=true " . $checked . " > use restore function? (should be checked)<br>";
    if ($IDs == 0) {
        echo 'no IDs! :)';
    } else {
        echo 'found ' . count($IDs) . ' IDs <br>';
        echo 'building: ' . GetNameByItem($building['itemName']) . '<br>';
        $objects = array();
        $objects = TB_loadObjects();
        $i = 1;
        echo '<table border="1px">';
        echo '<tr>';
        foreach ($IDs as $ID) {
            $obj = TB_getObject($ID, $objects);
            echo '<td>&raquo;' . $obj['itemName'] . '</td>';
            if ($i % 8 == 0) {
                echo '</tr><tr>';
            }
            $i++;
        }
        echo '</tr>';
        echo '</table>';
    }
}
Exemplo n.º 2
0
function TB_showSections()
{
    global $TB_settings;
    global $TB_settings_place;
    if (isset($TB_settings_place['useSections']) && isset($TB_settings_place['useGiftBox'])) {
        $ignore[] = 'useGiftBox';
        $ignore[] = 'useSections';
        $ignore[] = 'GiftBox';
        $ignore[] = 'decoration';
        echo 'Click here to update settings. ';
        echo '<i><a href="' . ToolBox_URL . '?show=TB&importSections=true" class="headerLinks">update</a></i>';
        echo '<table width="100%">';
        echo '<tr>';
        //giftbox
        if ($TB_settings_place['useGiftBox'] == true) {
            echo '<td width="25%">';
            echo 'found GiftBox\'s settings';
            echo '</td>';
            echo '<td>';
            $checked = $TB_settings['TB_sectionsUseGiftBox'] ? 'checked' : '';
            echo "<input type='checkbox' name='sectionsUseGiftBox' onclick='this.form.submit();' value=true " . $checked . ">";
            echo 'use this section to place <i>animals</i>';
            echo '</td>';
            echo '</tr>';
            echo '<tr>';
            echo '<td>';
            echo '&nbsp;';
            echo '</td>';
            echo '<td>';
            $checked = $TB_settings['TB_sectionsUseGiftBoxDecoration'] ? 'checked' : '';
            echo "<input type='checkbox' name='sectionsUseGiftBoxDecoration' onclick='this.form.submit();' value=true " . $checked . ">";
            echo 'use this section to place <i>flowers</i>';
            echo '</td>';
        } else {
            $TB_settings['TB_sectionsUseGiftBox'] = false;
            $TB_settings['TB_sectionsUseGiftBoxDecoration'] = false;
        }
        echo '</tr>';
        //sections
        echo '<tr>';
        if ($TB_settings_place['useSections'] == true) {
            echo '<td>';
            echo 'found Sections\' settings for:';
            echo '</td>';
            echo '<td>';
            $checked = $TB_settings['TB_sectionsUseSections'] ? 'checked' : '';
            echo "<input type='checkbox' name='sectionsUseSections' onclick='this.form.submit();' value=true " . $checked . ">";
            echo 'use this section(s) to place <i>animals & flowers</i>';
            echo '</td>';
            echo '</tr>';
            foreach ($TB_settings_place as $itemName => $section) {
                if (!in_array($itemName, $ignore)) {
                    echo '<tr>';
                    echo '<td>';
                    echo '<small>&raquo; ' . GetNameByItem($itemName) . '</small>';
                    echo '</td>';
                    echo '</tr>';
                }
            }
        } else {
            $TB_settings['TB_sectionsUseSections'] = false;
        }
        echo '</tr>';
        echo '</table>';
    } else {
        echo 'Can\'t find settings. Click here to import settings now!<br>';
        echo '<i><a href="' . ToolBox_URL . '?show=TB&importSections=true" class="headerLinks">import</a></i>';
    }
}