' . __('Cheatin’ uh?') . '' . '

' . __('You are not allowed to edit theme options on this site.') . '

', 403); } global $sitepad; $title = __('Manage Themes'); $parent_file = 'setup.php'; if (current_user_can('switch_themes')) { $themes = wp_prepare_themes_for_js(); } else { $themes = wp_prepare_themes_for_js(array(wp_get_theme())); } // r_print($themes); require_once(ABSPATH . 'site-admin/admin-header.php'); //r_print($themes); $category = optGET('category'); echo '
'; ?>

 

$theme) { if ($category != strtolower($theme['category'])) { unset($themes[$id]); } } } // Filter the themes by search query $query = optGET('q'); $query = rawurldecode($query); $searched = array(); if (!empty($query)) { $pagedurl .= 'q=' . $query . '&'; foreach ($themes as $id => $theme) { // Search by theme name if (substr(strtolower($theme['name']), 0, strlen($query)) === $query) { $searched[$id] = $theme; } // Search by Slug if (substr($theme['id'], 0, strlen($query)) === $query) { $searched[$id] = $theme; } // Search by tags $tags = explode(',', $theme['tags']); foreach ($tags as $x => $v) { if (substr($v, 0, strlen($query)) === $query) { $searched[$id] = $theme; } } } } // Pagination $paged = (int) optGET('paged'); $perpage = 21; // Don't Show Pagination if search value less than perpage if (!empty($searched)) { $total_pages = ceil(count($searched) / $perpage); } else { $total_pages = ceil(count($themes) / $perpage); } $current_page = 1; // Is it a valid page if (!empty($paged)) { $current_page = $paged; } if ($paged > $total_pages) { $current_page = $paged = 1; } if ($total_pages > 1) { echo '
    '; $pagedurl .= 'paged='; $previous = $current_page - 1; $next = $current_page + 1; if ($current_page > 1) { echo '
  • «
  • <
  • '; } $start = 1; if ($current_page > 1) { $start = $current_page - 1; } $end = $current_page + 1; if ($end >= $total_pages) { $end = $total_pages; } for ($start; $start <= $end; $start++) { echo '
  • ' . $start . '
  • '; } if ($current_page < $total_pages) { echo '
  • >
  • »
  • '; } echo '
'; } // Pagination ends ?>

Visit site'), home_url('/')); ?>

' . __('Your new theme has been activated. You will now be redirected to the') . ' ' . BRAND_SM_EDITOR . '

'; } else { ?>

Visit site'), home_url('/')); ?>

'; /* * This PHP is synchronized with the tmpl-theme template below! */ if (empty($paged)) $paged = 1; $skip = ($paged - 1) * $perpage; $count = 0; $skipped = 0; // Display Search Query (condition added to search from all themes and not only search results) if(!empty($searched)){ $show_themes = $searched; } else { $show_themes = $themes; } // r_print($themes); $selected_themes = $unselected_themes = array(); // Show the selected theme 1st and then others foreach($show_themes as $key => $theme){ if($theme['id'] == $selected_theme){ $selected_themes[] = $theme; }else{ $unselected_themes[] = $theme; } } $show_themes = array_merge($selected_themes, $unselected_themes); // r_print($show_themes); foreach($show_themes as $theme): $aria_action = esc_attr($theme['id'] . '-action'); $aria_name = esc_attr($theme['id'] . '-name'); // We have already displayed themes allowed per page if ($count >= $perpage) { break; } // Are we to skip themes until we reach the themes for desired page if (!empty($skip) && $skipped < $skip) { $skipped++; continue; } $count++; $needs_premium = 0; if($theme['type'] > $sitepad['features']['themes']){ $needs_premium = 1; } ?>
'.$sitepad['theme_levels'][$theme['type']].'
'; } echo '
'; if(!empty($theme['screenshot'][0])){ echo '
'; }else{ echo '
'; } if ($theme['id'] == $selected_theme) { echo '

'; /* translators: %s: theme name */ printf(__('Selected: %s'), $theme['name']); echo '

'; } else { echo '

'.$theme['name'].'
'; if ($theme['id'] != $selected_theme) { if (!empty($needs_premium)) { echo ''.__('View Plans').''; } else { $active_url = str_replace('themes.php', 'setup.php', $theme['actions']['activate']); ?>

'; } ?>