/** * Display gadgets and their status for the current layout * */ public function ShowGadgets() { global $langmessage, $config; $gadget_info = \gp\tool\Output::WhichGadgets($this->curr_layout); echo '<h2>' . $langmessage['gadgets'] . '</h2>'; echo '<table class="bordered full_width">'; echo '<tr><th colspan="2"> </th></tr>'; if (!isset($config['gadgets']) || count($config['gadgets']) == 0) { echo '<tr><td colspan="2">'; echo $langmessage['Empty']; echo '</td></tr>'; } else { foreach ($config['gadgets'] as $gadget => $temp) { echo '<tr><td>'; echo str_replace('_', ' ', $gadget); echo '</td><td>'; if (isset($gadget_info[$gadget])) { echo $this->LayoutLink($this->curr_layout, $langmessage['remove'], 'cmd=RmGadget&gadget=' . urlencode($gadget), array('data-cmd' => 'cnreq')); } else { echo $langmessage['disabled']; } echo '</td></tr>'; } } echo '</table>'; }