/** * Add top header table */ public function outputHeader() { ?> <div class="wrap"> <table width="100%"> <tbody> <tr> <td align="left"><h2><?php _e('Code Editor', 'add-actions-and-filters'); ?> </h2></td> <td align="right"> <a href="<?php echo $this->plugin->getAdminPageUrl(); ?> "> <img width="128" height="50" src="<?php echo $this->plugin->getPluginFileUrl('img/icon-256x100.png'); ?> "> </a> </td> </tr> </tbody> </table> </div> <?php }
public function display() { require_once 'AddActionsAndFilters_AdminViewUrlBuilder.php'; $urlBuilder = new AddActionsAndFilters_AdminViewUrlBuilder(); $cleanUrl = $urlBuilder->buildUrl(); // no action value in it echo '<div class="wrap">'; // Header $adminUrl = get_admin_url() . 'admin.php?page='; printf('<table width="%s"><tbody><tr><td><a href="%s"><img src="%s"/></a></td><td align="right"><span style="white-space: nowrap;"><a href="%s"><img src="%s"/></a><a href="%s"><img src="%s"/></a></span></td></tr></tbody></table>', '100%', $cleanUrl, $this->plugin->getPluginFileUrl('img/admin-banner.png'), $adminUrl . $this->plugin->getImportExportSlug(), $this->plugin->getPluginFileUrl('img/import-export.png'), $adminUrl . $this->plugin->getSettingsSlug(), $this->plugin->getPluginFileUrl('img/settings.png')); printf('<table><tbody><tr><td></td></tr></tbody></table>'); $actions = new AddActionsAndFilters_AdminPageActions(); printf('<a href="%s%s%s%s%s" class="page-title-action">%s</a>', get_admin_url(), 'admin.php?page=', $this->plugin->getAdminPageSlug(), '&action=', $actions->getEditKey(), __('Add New')); // Table Styles echo '<style type="text/css">'; echo '.wp-list-table .column-id { width: 7%; }'; echo '.wp-list-table .column-enabled { width: 10%; }'; echo '.wp-list-table .column-shortcode { width: 7%; }'; echo '.wp-list-table .column-name { width: 25%; }'; echo '.wp-list-table .column-capability { width: 20%; }'; echo '.wp-list-table .column-description { width: 31%; }'; echo '.wp-list-table .item-inactive { font-style: italic; opacity: 0.6; filter: alpha(opacity = 60); /* MSIE */ }'; echo '</style>'; // Form for bulk actions printf('<form action="%s" method="post">', $cleanUrl); // Search box $this->table->search_box('search', 'search_id'); // Code table $this->table->display(); // Closing Tags echo '</form>'; echo '</div>'; }
public function display() { $optionMetaData = $this->plugin->getOptionMetaData(); // Save Posted Options if ($optionMetaData != null) { foreach ($optionMetaData as $aOptionKey => $aOptionMeta) { if (isset($_POST[$aOptionKey])) { $this->plugin->updateOption($aOptionKey, $_POST[$aOptionKey]); } } } // HTML for the page $settingsGroup = get_class($this->plugin) . '-settings-group'; ?> <style type="text/css"> table.asaf-options-table { width: 100% } table.asaf-options-table tr:nth-child(even) { background: #f9f9f9 } table.asaf-options-table tr:nth-child(odd) { background: #FFF } table.asaf-options-table td { width: 350px } table.asaf-options-table td + td { width: auto } </style> <div class="wrap"> <table width="100%"> <tbody> <tr> <td align="left"><h2><?php _e('System Settings', 'add-actions-and-filters'); ?> </h2></td> <td align="right"> <a href="<?php echo $this->plugin->getAdminPageUrl(); ?> "> <img width="128" height="50" src="<?php echo $this->plugin->getPluginFileUrl('img/icon-256x100.png'); ?> "> </a> </td> </tr> </tbody> </table> <table class="asaf-options-table"> <tbody> <tr> <td><?php _e('System', 'add-actions-and-filters'); ?> </td> <td><?php echo php_uname(); ?> </td> </tr> <tr> <td><?php _e('PHP Version', 'add-actions-and-filters'); ?> </td> <td><?php echo phpversion(); ?> <?php if (version_compare('5.2', phpversion()) > 0) { echo ' <span style="background-color: #ffcc00;">'; _e('(WARNING: This plugin may not work properly with versions earlier than PHP 5.2)', 'add-actions-and-filters'); echo '</span>'; } ?> </td> </tr> <tr> <td><?php _e('MySQL Version', 'add-actions-and-filters'); ?> </td> <td><?php echo $this->getMySqlVersion(); ?> <?php echo ' <span style="background-color: #ffcc00;">'; if (version_compare('5.0', $this->getMySqlVersion()) > 0) { _e('(WARNING: This plugin may not work properly with versions earlier than MySQL 5.0)', 'add-actions-and-filters'); } echo '</span>'; ?> </td> </tr> </tbody> </table> <h2><?php echo $this->plugin->getPluginDisplayName(); echo ' '; _e('Settings', 'add-actions-and-filters'); ?> </h2> <form method="post" action=""> <?php settings_fields($settingsGroup); ?> <table class="asaf-options-table"> <tbody> <?php if ($optionMetaData != null) { foreach ($optionMetaData as $aOptionKey => $aOptionMeta) { $displayText = is_array($aOptionMeta) ? $aOptionMeta[0] : $aOptionMeta; ?> <tr valign="top"> <th scope="row"><p><label for="<?php echo $aOptionKey; ?> "><?php echo $displayText; ?> </label></p></th> <td> <?php $this->createFormControl($aOptionKey, $aOptionMeta, $this->plugin->getOption($aOptionKey)); ?> </td> </tr> <?php } } ?> </tbody> </table> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Save Settings', 'add-actions-and-filters'); ?> "/> </p> </form> </div> <?php }