function wdwt_admin_options_page() { global $wdwt_options; global $wdwt_licensing_page; global $wdwt_themes_support_page; $currenttab = wdwt_get_current_tab(); $tabs = wdwt_get_tabs(); $options = $wdwt_options; $current_settings_sections = 'wdwt_' . $currenttab . '_tab'; $tab = isset($_GET['tab']) ? $_GET['tab'] : 'general'; if (WDWT_LOGO_SHOW) { ?> <a href="<?php echo WDWT_HOMEPAGE; ?> /wordpress-themes.html" target="_blank"> <div style="background:url(<?php echo WDWT_IMG_INC; ?> adminheader.jpg) no-repeat; background-size: auto 100%; background-position:center; width:calc(100% - 4px); height:72px; margin:2px;"></div> </a> <?php } ?> <div class="wrap free" id="main_<?php echo $currenttab; ?> _page"> <?php wdwt_admin_options_page_tabs(); if (isset($_GET['settings-updated'])) { echo "<div class='updated'><p>" . __('Theme settings updated successfully', "news-magazine") . "</p></div>"; } /*pages without option submit forms*/ if ($currenttab == 'licensing') { echo $wdwt_licensing_page->view(); } elseif ($currenttab == 'themes_support') { echo $wdwt_themes_support_page->view(); /*pages with forms to submit options*/ } else { echo $WDWT_licensing_page->view(); } ?> </div> <?php }
function WDWT_admin_options_page_tabs() { $page = WDWT_SLUG; $current = wdwt_get_current_tab(); $tabs = wdwt_get_tabs(); $links = array(); foreach ($tabs as $tab) { $tabname = $tab['name']; if ($tabname == 'licensing' || $tabname == 'themes_support') { $tabtitle = $tab['title']; if ($tabname == $current) { $links[] = "<li><a class='nav-tab nav-tab-active' href='?page=" . WDWT_SLUG . "&tab=" . $tabname . "'>" . esc_html($tabtitle) . "</a></li>"; } else { $links[] = "<li><a class='nav-tab' href='?page=" . WDWT_SLUG . "&tab=" . $tabname . "'>" . esc_html($tabtitle) . "</a></li>"; } } } echo '<div id="icon-themes" class="icon32"><br /></div>'; echo '<div class="wdwt_nav-tab-wrapper"><ul>'; foreach ($links as $link) { echo $link; } echo '</ul></div>'; echo isset($tabs[$current]['description']) ? $tabs[$current]['description'] : ''; }