| | 116 | |
| | 117 | echo '<style type="text/css"> |
| | 118 | table#plugins-table-of-contents { border: 1px solid #ccc; width: 100%; margin-bottom: 10px; } |
| | 119 | table#plugins-table-of-contents ul { list-style-type: none; } |
| | 120 | </style>'; |
| | 121 | |
| | 122 | $number_of_plugins = count($plugins); |
| | 123 | $i = 1; |
| | 124 | |
| | 125 | foreach ($plugins as $plugin_file => $plugin_data) |
| | 126 | { |
| | 127 | $plugins[$i] = array_merge($plugin_data, array('file' => $plugin_file)); |
| | 128 | $plugins[$plugin_file] = array_merge($plugin_data, array('order' => $i)); |
| | 129 | $i++; |
| | 130 | } |
| | 131 | |
| | 132 | $table_columns = 4; |
| | 133 | $plugins_per_table = ceil(count($plugins) / 2 / $table_columns); |
| | 134 | |
| | 135 | echo '<h3>Plugins Table of Contents for ' . (count($plugins) / 2) . ' plugins</h3><table id="plugins-table-of-contents"><tr>'; |
| | 136 | |
| | 137 | $k = 1; |
| | 138 | $starting_plugin = $plugins_per_table; |
| | 139 | for ($i = 1; $i <= $table_columns; $i++) |
| | 140 | { |
| | 141 | echo '<td valign="top"><ul>'; |
| | 142 | for ($j = $k; $j <= $starting_plugin; $j++) |
| | 143 | { |
| | 144 | $plugins[$k]['order'] = $k; |
| | 145 | echo '<li>' . $k . '. <a href="#plugin-' . $k . '">' . $plugins[$k]['Name'] . '</a>' . (!in_array($plugins[$k]['file'], $current_plugins) ? ' (disabled)' : '') . '</li>'; |
| | 146 | if ($k == $number_of_plugins) |
| | 147 | break; |
| | 148 | $k++; |
| | 149 | } |
| | 150 | $starting_plugin += $plugins_per_table; |
| | 151 | echo '</ul></td>'; |
| | 152 | } |
| | 153 | |
| | 154 | echo '</tr></table>'; |
| | 155 | |
| | 156 | for ($i = 1; $i <= $number_of_plugins; $i++) |
| | 157 | { |
| | 158 | unset($plugins[$i]); |
| | 159 | } |
| | 160 | |