0){ // If plugin exist } $update_availabe = get_pref('updates'); if(is_null($update_availabe)){ $update_availabe = []; } else { $update_availabe = json_decode($update_availabe, true); } $pages = array ( array(_t('Dashboard'), 'dashboard', 'home'), array(_t('Game list'), 'gamelist', 'gamepad'), array(_t('Add game'), 'addgame', 'plus-circle'), array(_t('Categories'), 'categories', 'th-large'), array(_t('Collections'), 'collections', 'th-list'), array(_t('Pages'), 'pages', 'book'), array(_t('Themes'), 'themes', 'palette'), array(_t('Plugins'), 'plugin', 'plug'), array(_t('Layout'), 'layout', 'columns'), array(_t('Settings'), 'settings', 'cog'), array(_t('Updater'), 'update', 'sync-alt'), ); if(file_exists( ABSPATH . TEMPLATE_PATH . '/options.php' )){ // Find the index of 'Themes' and insert 'Theme Options' after it $theme_index = array_search('themes', array_column($pages, 1)); if ($theme_index !== false) { array_splice($pages, $theme_index + 1, 0, array(array(_t('Theme Options'), 'theme-options', 'paint-brush'))); } } $page_name = 'Dashboard'; $page_slug = 'dashboard'; $page_icon = null; if(isset($_GET['viewpage'])){ $page_slug = htmlspecialchars($_GET['viewpage']); } if(!check_purchase_code()){ if($page_slug != 'settings'){ header('Location: dashboard.php?viewpage=settings', true); exit(); } for ($i=count($pages)-1; $i >= 0 ; $i--) { if($pages[$i][1] != 'settings'){ array_splice($pages, $i, 1); } } } foreach ($pages as $item) { $active = ''; if($item[1] == $page_slug){ $page_name = _t(esc_string($item[0])); $page_slug = esc_string($item[1]); $page_icon = $item[2]; $active = 'active'; } } if(is_null($page_icon)){ $page_icon = 'exclamation'; } ?>