'style.css',
'styles'.DIRSEP.'core-styles.css' => 'styles'.DIRSEP.'core-styles.css',
'images'.DIRSEP.'child-screenshot.jpg' => 'screenshot.jpg',
'images'.DIRSEP.'child-theme-logo.png' => 'theme-logo.png',
'debug'.DIRSEP.'.htaccess' => 'debug'.DIRSEP.'.htaccess'
);
} else {
$childfiles = array(
'child'.DIRSEP.'style.css' => 'style.css',
'styles'.DIRSEP.'core-styles.css' => 'styles'.DIRSEP.'core-styles.css',
'child'.DIRSEP.'functions.php' => 'functions.php',
'child'.DIRSEP.'screenshot.jpg' => 'screenshot.jpg',
'child'.DIRSEP.'theme-logo.png' => 'theme-logo.png',
'debug'.DIRSEP.'.htaccess' => 'debug'.DIRSEP.'.htaccess'
);
}
// Create Child Theme directory(s)
// -------------------------------
// 2.1.4: added esc_attr to message string outputs
if (is_dir($childdir)) {
// --- always avoid overwriting an existing Child Theme! ---
$message = esc_attr(__('Aborted! Child Theme directory of that name already exists!','bioship')).'
';
$message .= esc_attr(__('Remove or rename the existing directory and try again.','bioship')).'
';
return $message;
} else {
// --- create child theme directory the WP Filesystem way ---
$wp_filesystem->mkdir($childdir);
if (!is_dir($childdir)) {
// --- fallback to the simple WP way ---
// 2.1.1: re-added this method as a fallback ---
wp_mkdir_p($childdir);
if (!is_dir($childdir)) {
$message = esc_attr(__('Aborted: Could not create Child Theme directory.','bioship')).'
';
$message .= esc_attr(__('Check your permissions or do a','bioship')).' ';
$message .= ''.esc_attr(__('manual install','bioship')).'.';
return $message;
}
// --- make child subdirectories ---
wp_mkdir_p($childimagedir);
wp_mkdir_p($childcssdir);
wp_mkdir_p($childjsdir);
wp_mkdir_p($childdebugdir);
} else {
// --- make child subdirectories ---
$wp_filesystem->mkdir($childimagedir);
$wp_filesystem->mkdir($childcssdir);
$wp_filesystem->mkdir($childjsdir);
$wp_filesystem->mkdir($childdebugdir);
}
}
// Copy Child Theme files
// ----------------------
$missingfiles = array();
foreach ($childfiles as $source => $destination) {
// 1.8.5: change 'child-source' directory to 'child'
// 1.9.0: no longer copy hooks.php by default, but copy .htaccess
// 1.9.5: fix to new child theme file destination directories
// 2.0.9: use new source file array for sources and destinations
$childsource = $vthemetemplatedir.$source;
$childdest = $childdir.$destination;
if (file_exists($childsource)) {
// --- read the Child Theme source file ---
// 1.8.0: read files using WP Filesystem
$filecontents = $wp_filesystem->get_contents($childsource);
// --- replace Child Theme name in style.css ---
if (!THEMEWPORG && ($source == 'child/style.css')) {
$filecontents = str_replace('Theme Name: BioShip Child', 'Theme Name: '.$newchildname, $filecontents);
// 1.9.5: match the child theme version to the parent version on creation
$filecontents = str_replace('1.0.0', THEMEVERSION, $filecontents);
}
// --- write the destination file ---
// 1.8.0: write the file using WP_Filesystem
$wp_filesystem->put_contents($childdest, $filecontents, FS_CHMOD_FILE);
} else {$missingfiles[] = $source;}
}
// --- create empty Child Theme functions.php ---
// 2.0.9: added this for WordPress.org version
if (THEMEWPORG) {
$functionspath = $childdir.'functions.php';
$wp_filesystem->put_contents($functionspath, '', FS_CHMOD_FILE);
}
// --- message for missing files ---
// 1.8.5: change 'child-source' directory to 'child'
// 2.0.7: fix to changed variable typo (vmissing)
if (count($missingfiles) > 0) {
$message .= esc_attr(__('Error: Child Theme source files missing','bioship')).':
';
foreach ($missingfiles as $missingfile) {
// 2.0.9: just display missing file paths from array
$message .= '/bioship/'.$missingfile.'
';
}
}
// Copy existing Parent Theme options to new Child Theme
// -----------------------------------------------------
// --- get parent theme settings ---
// 1.8.0: do check for Titan Framework
// 1.9.5: fix to parent settings framework logic
if (THEMEOPT) {$parentsettings = get_option('bioship'); $childoptionsslug = str_replace('-', '_', $newchildslug);}
else {$parentsettings = get_option('bioship_options'); $childoptionsslug = $newchildslug.'_options';}
// --- get existing settings ---
// 2.1.4: added esc_attr to message string outputs
$settingsmessage = '';
$existingsettings = get_option($childoptionsslug);
if (!$existingsettings) {
delete_option($childoptionsslug);
if (!$parentsettings || ($parentsettings == '')) {
// 1.9.5: set to default theme options
$defaultsettings = bioship_titan_theme_options(array());
add_option($childoptionsslug, $defaultsettings);
$settingsmessage .= esc_attr(__('No Parent Theme settings! Child Theme set to default settings.','bioship')).'
';
$settingsmessage .= esc_attr(__('See documentation to manually transfer settings between themes.','bioship')).'
';
} else {
add_option($childoptionsslug, $parentsettings);
$settingsmessage .= esc_attr(__('Parent Theme settings transferred to new Child Theme.','bioship')).'
';
}
} else {$message .= esc_attr(__('Child Theme settings exist, Parent Theme settings not transferred.','bioship')).'
';}
// --- copy widgets menus and menu locations ---
// 1.5.0: copy parent subsettings to child theme 'backup' options
// (in preparation for child theme activation)
$sidebarswidgets = get_option('sidebars_widgets');
$navmenus = get_option('nav_menu_options');
$menulocations = get_theme_mod('nav_menu_locations');
if (!get_option($childoptionsslug.'_widgets_backup')) {
delete_option($childoptionsslug.'_widgets_backup');
add_option($childoptionsslug.'_widgets_backup', $sidebarswidgets);
}
if (!get_option($childoptionsslug.'_menus_backup')) {
delete_option($childoptionsslug.'_menus_backup');
add_option($childoptionsslug.'_menus_backup', $navmenus);
}
if (!get_option($childoptionsslug.'_menu_locations_backup')) {
delete_option($childoptionsslug.'_menu_locations_backup');
add_option($childoptionsslug.'_menu_locations_backup', $menulocations);
}
// --- set Child creation output message ---
// 1.8.0: added translation strings to messages
// 2.1.4: added esc_attr to message string outputs
if ($message != '') {$creationresult = '('.esc_attr(__('with errors','bioship')).')'.'';}
else {$creationresult = esc_attr(__('successfully','bioship')).'';}
$message .= $settingsmessage;
$message .= esc_attr(__('New Child Theme','bioship')).' "'.esc_attr($newchildname).'" ';
$message .= esc_attr(__('created','bioship')).' '.esc_attr($creationresult).'.
';
$message .= esc_attr(__('Base Directory','bioship')).': '.esc_attr(ABSPATH).'
';
$message .= esc_attr(__('Theme Subdirectory','bioship')).': '.esc_attr(str_replace(ABSPATH, '', $childdir)).'
';
$message .= esc_attr(__('Activate it on your','bioship')).' ';
$message .= ''.esc_attr(__('Themes Page','bioship')).'.';
// One-Click Activation for New Child Theme
// ----------------------------------------
$wpnonce = wp_create_nonce('switch-theme_'.$newchildslug);
// 2.1.1: use add_query_arg to create URL
$activatelink = add_query_arg('action', 'activate', admin_url('themes.php'));
$activatelink = add_query_arg('stylesheet', $newchildslug, $activatelink);
$activatelink = add_query_arg('_wpnonce', $wpnonce, $activatelink);
// 2.1.4: added esc_url to sanitize link output
$message .= '... '.esc_attr(__('or just','bioship')).' ';
$message .= ''.esc_attr(__('click here to activate it','bioship')).'.';
// --- theme drive integration ---
if (function_exists('themedrive_determine_theme')) {
// 1.8.0: link for Titan or Options Framework
// CHECKME: if this is working
if (THEMETITAN) {$childthemeoptions = 'admin.php?page=bioship_options&theme='.$newchildslug;}
else {$childthemeoptions = 'themes.php?page=options-framework&theme='.$newchildslug;}
// 2.1.4: added esc_url to URL and esc_attr for message
$message .= '
('.esc_attr(__('or','bioship')).' ';
$message .= ''.esc_attr(__('Theme Test Drive without activating','bioship')).'.)';
}
return $message;
}
}
// -------------------------
// === Clone Child Theme ===
// -------------------------
// 1.9.5: added child theme cloning function
// 2.1.4: added esc_attr to message string outputs
if (!function_exists('bioship_admin_do_install_clone')) {
function bioship_admin_do_install_clone() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $wp_filesystem;
// --- check Child Theme Source ---
if (!isset($_REQUEST['clonetheme'])) {return esc_attr(__('Error: Source Child Theme not specified.','bioship'));}
elseif (trim($_REQUEST['clonetheme']) == '') {return esc_attr(__('Error: Source Child Theme not specified.','bioship'));}
else {$clonetheme = trim($_REQUEST['clonetheme']);}
// --- check for Child Theme Source settings ---
if (THEMEOPT) {$clonesettings = get_option($clonetheme);}
else {$clonesettings = get_option($clonetheme.'_options');}
if (!$clonesettings) {return esc_attr(__('Error: Source Child Theme Settings are empty!','bioship'));}
// --- check BioShip parent ---
// 2.1.1: match to THEMEPREFIX constant ---
$theme = wp_get_theme(get_stylesheet($clonetheme));
if (!isset($theme['Template']) || ($theme['Template'] != THEMEPREFIX)) {
return esc_attr(__('Cloning Aborted! Child Theme parent must be BioShip!','bioship'));
}
// --- check new Child Theme name ---
$newclonename = trim($_REQUEST['newclonename']);
if ($newclonename == '') {return esc_attr(__('Error: New Child Theme Name cannot be empty.','bioship'));}
if (!preg_match('/^[0-9a-z ]+$/i', $newclonename)) {return esc_attr(__('Error. Letters, numbers and spaces only please!','bioship'));}
$newcloneslug = preg_replace("/\W/", "-", strtolower($newclonename));
if (get_option($newcloneslug)) {return esc_attr(__('Aborted! Theme Settings already exist for this name!','bioship'));}
// --- get/set Child Theme dirs ---
$themesdir = get_theme_root().DIRSEP;
$childdir = $themesdir.$clonetheme.DIRSEP;
$clonedir = $themesdir.$newcloneslug.DIRSEP;
// --- check Child Theme Source files ---
if (!is_dir($childdir)) {return esc_attr(__('Aborted! Source Child Theme directory does not exist!','bioship'));}
// --- always avoid overwriting an existing Child Theme! ---
if (is_dir($clonedir)) {
$message = esc_attr(__('Aborted! Child Theme directory of that name already exists!','bioship')).'
';
$message .= esc_attr(__('Remove or rename the existing directory and try again.','bioship')).'
';
return $message;
}
// --- copy all Child Theme files to Clone ---
$childfiles = bioship_admin_get_directory_files($childdir, true);
foreach ($childfiles as $childfile) {
$sourcefile = $childdir.$childfile;
$destfile = $clonedir.$childfile;
echo "".PHP_EOL;
if (!is_dir(dirname($destfile))) {$wp_filesystem->mkdir(dirname($destfile));}
$filecontents = $wp_filesystem->get_contents($sourcefile);
// --- replace theme name in styles.css ---
if (substr($sourcefile, -9, 9) == 'style.css') {
$filecontents = str_replace('Theme Name: '.THEMEDISPLAYNAME, 'Theme Name: '.$newclonename, $filecontents);
}
// --- write the cloned file ---
$wp_filesystem->put_contents($destfile, $filecontents, FS_CHMOD_FILE);
}
// --- copy any empty subdirectories also ---
$subdirs = bioship_admin_get_directory_subdirs($childdir, true);
echo "";
foreach ($subdirs as $subdir) {
$destdir = $clonedir.$subdir;
if (!is_dir($destdir)) {$wp_filesystem->mkdir($destdir);}
}
// --- add a clone stamp file ---
global $current_user; $current_user = wp_get_current_user();
$filecontents = 'Cloned from existing Child Theme: '.THEMEDISPLAYNAME.' ('.$clonetheme.')'.PHP_EOL;
$filecontents .= 'on '.date('d/m/Y').' (timestamp: '.time().') by '.$current_user->user_login.PHP_EOL;
$filecontents .= 'Serialized Settings at Clone time after this line ------'.PHP_EOL;
if (is_serialized($clonesettings)) {$filecontents .= $clonesettings;} else {$filecontents .= serialize($clonesettings);}
$destfile = $clonedir.'clonestamp.txt';
$wp_filesystem->put_contents($destfile, $filecontents, FS_CHMOD_FILE);
// --- copy Child Theme settings
if (THEMEOPT) {$newclonekey = $newcloneslug;} else {$newclonekey = $newcloneslug.'_options';}
delete_option($newclonekey); add_option($newclonekey, $clonesettings);
// --- copy all widget / sidebar settings (from active or backups) ---
if ($clonetheme == get_stylesheet()) {
$sidebarswidgets = get_option('sidebars_widgets');
$navmenus = get_option('nav_menu_options');
$menulocations = get_theme_mod('nav_menu_locations');
} else {
$sidebarswidgets = get_option($clonetheme.'_widgets_backup');
$navmenus = get_option($clonetheme.'_menus_backup');
$menulocations = get_option($clonetheme.'_menu_locations_backup');
}
// --- copy widgets / menus / menu locations ---
// (assume that if the new clone settings were empty / deleted
// copying over these is safe / wanted as well)
// 2.1.1: just use update_option here
update_option($newcloneslug.'_widgets_backup', $sidebarswidgets);
update_option($newcloneslug.'_menus_backup', $navmenus);
update_option($newcloneslug.'_menu_locations_backup', $menulocations);
// --- set Clone Creation Output Message ---
$message = esc_attr(__('New Child Theme','bioship')).' "'.esc_attr($newclonename).'" ';
$message .= esc_attr(__('cloned successfully.','bioship')).'
';
$message .= esc_attr(__('Base Directory','bioship')).': '.esc_attr(ABSPATH).'
';
$message .= esc_attr(__('Theme Subdirectory','bioship')).': '.esc_attr(str_replace(ABSPATH, '', $clonedir)).'
';
$message .= esc_attr(__('Activate it on your','bioship')).' ';
$message .= ''.esc_attr(__('Themes Page','bioship')).'.';
// --- One-Click Activation for New Cloned Theme ---
$wpnonce = wp_create_nonce('switch-theme_'.$newcloneslug);
$activatelink = admin_url('themes.php');
$activatelink = add_query_arg('action', 'activate', $activatelink);
$activatelink = add_query_arg('stylesheet', $newcloneslug, $activatelink);
$activatelink = add_query_arg('_wpnonce', $wpnonce, $activatelink);
$message .= '... '.esc_attr(__('or just','bioship')).' ';
$message .= ''.esc_attr(__('click here to activate it','bioship')).'.';
// --- theme drive integration ---
if (function_exists('themedrive_determine_theme')) {
// 2.1.1: use add_query_arg and optimize
if (THEMETITAN) {$testdriveurl = add_query_arg('page', THEMEPREFIX.'-options', admin_url('admin.php'));}
else {$testdriveurl = add_query_arg('page', 'options-framework', admin_url('themes.php'));}
$testdriveurl = add_query_arg('theme', $newcloneslug, $testdriveurl);
$message .= '
('.esc_attr(__('or','bioship')).' ';
$message .= ''.esc_attr(__('Theme Test Drive without activating','bioship')).'.)';
}
// --- add hidden result indicator ---
$message .= "";
return $message;
}
}
// --------------------------------
// === Theme Settings Transfers ===
// --------------------------------
// ---------------------------
// Transfer Framework Settings
// ---------------------------
// 1.9.5: rewritten and expanded transfer function
// 2.1.1: check for trigger internally
add_action('init', 'bioship_admin_framework_settings_transfer');
if (!function_exists('bioship_admin_framework_settings_transfer')) {
function bioship_admin_framework_settings_transfer() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
// --- check trigger and permissions ---
if (!isset($_REQUEST['transfersettings'])) {return;}
if (!current_user_can('edit_theme_options')) {return;}
global $vthemestyledir, $vthemetemplatedir, $vthemeoptions;
// --- check transfer existing options triggers ---
if ($_REQUEST['transfersettings'] == 'totitan') {
$transferfrom = $transferto = false;
if ( (isset($_REQUEST['fromtheme'])) && (trim($_REQUEST['fromtheme']) != '') ) {
$transferfrom = preg_replace("/\W/", "_", strtolower(trim($_REQUEST['fromtheme'])));
$transferfrom = str_replace('-', '_', $transferfrom);
}
if ( (isset($_REQUEST['totheme'])) && (trim($_REQUEST['totheme']) != '') ) {
$transferto = preg_replace("/\W/", "-", strtolower(trim($_REQUEST['totheme'])));
$transferto = str_replace('_', '-', $transferto).'_options';
} elseif (THEMETITAN) {$transferto = THEMEKEY;}
if ( transferfrom && $transferto) {
$optionvalues = get_option($transferfrom);
if (!$optionvalues) {
// --- fallback to retrieving serialized settings from a file ---
// if the database is acting up (this code from when it has happened)
// used by copying the value from database to text in the debug directory
$stylefile = $vthemestyledir.'debug'.DIRSEP.$transferfrom.'.txt';
$templatefile = $vthemestyledir.'debug'.DIRSEP.$transferfrom.'.txt';
if (file_exists($stylefile)) {$settingsfile = $stylefile;}
elseif (file_exists($templatefile)) {$settingsfile = $templatefile;}
else {
$message = esc_attr(__('Transfer Failed! Could not retrieve existing settings.','bioship'));
global $vthemeadminmessages;
$vthemeadminmessages[] = $message;
bioship_admin_notices_enqueue(); return;
}
$filecontents = trim(bioship_file_get_contents($settingsfile));
$optionvalues = unserialize($filecontents);
if (!$optionvalues || !is_array($optionvalues)) {
$repaired = bioship_fix_serialized($filecontents);
$optionvalues = unserialize($repaired);
if (!$optionvalues) {
echo esc_attr(__('Error! Could not unserialize settings from file!','bioship')); exit;
}
}
} else {
if (is_string($optionvalues)) {$optionvalues = trim($optionvalues);}
if (is_serialized($optionvalues)) {$optionvalues = unserialize($optionvalues);}
}
if ( ($optionvalues != '') && (is_array($optionvalues)) ) {
// --- map settings via theme options array ---
foreach ($themeoptions as $option => $optionvalue) {
$optionkey = $optionvalue['id'];
// --- map missing defaults ---
if (!isset($optionvalues[$optionkey])) {
if (isset($optionvalues['std'])) {$optionvalues[$optionkey] = $optionvalue['std'];}
}
// --- fix to multicheck arrays ---
if ( ($optionvalue['type'] == 'multicheck') && (is_array($optionvalues[$optionkey])) ) {
$optionarray = array(); $i = 0;
foreach ($optionvalues[$optionkey] as $key => $value) {$optionarray[$i] = $key;}
$optionvalues[$optionkey] = $optionarray;
}
// --- fix to serialize all subarray values ---
if (is_array($optionvalues[$optionkey])) {
$optionvalues[$optionkey] = serialize($optionvalues[$optionkey]);
}
// TODO: fix for font values and multicheck value transfers ?
// TODO: fix for changing image URLs to attachment IDs ?
// (would need to be manually inserted as new attachments?)
}
// --- update theme settings ---
delete_option($transferto); add_option($transferto, serialize($optionvalues));
// --- also write settings to file just in case ---
bioship_write_debug_file($transferto.'.txt', serialize($optionvalues));
// echo serialize($optionvalues); exit; // for manual output
// --- set admin transferred message ---
$message = esc_attr(__('Transferred Existing Theme Settings to Titan Framework.','bioship'));
global $vthemeadminmessages;
$vthemeadminmessages[] = $message;
bioship_admin_notices_enqueue();
}
}
}
// TODO: Titan Framework settings to Options Framework settings Transfer here ?
// (this is likely not going to happen as moving forwards with using Titan)
// if ($_REQUEST['transfersettings'] == 'tooptions') {
// if ( (isset($_REQUEST['fromtheme'])) && (trim($_REQUEST['fromtheme']) != '') ) {
// $transferfrom = preg_replace("/\W/", "-", strtolower(trim($_REQUEST['fromtheme'])));
// $transferfrom = str_replace('_', '-', $transferfrom); $transferfrom .= '_options';
// }
// if ( (isset($_REQUEST['totheme'])) && (trim($_REQUEST['totheme']) != '') ) {
// $transferto = preg_replace("/\W/", "_", strtolower(trim($_REQUEST['fromtheme'])));
// $transferto = str_replace('-', '_', $transferto);
// } elseif (THEMEOPT) {$transferto = THEMEKEY;}
}
}
// ----------------------------
// Manually Copy Theme Settings
// ----------------------------
// WARNING: will overwrite the existing Theme Settings for a theme
// usage: ?copysettings=yes©from=source-theme-slug©to=destination-theme-slug
// 1.9.5: added this to copy to/from any theme settings
// 2.0.9: check action trigger internally
if (!function_exists('bioship_admin_copy_theme_settings')) {
// 2.0.9: move add action internally for consistency
add_action('admin_init', 'bioship_admin_copy_theme_settings');
function bioship_admin_copy_theme_settings() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
// --- check trigger and permissions ---
// 2.1.0: fix to AND instead of OR operator
if (!isset($_REQUEST['copysettings']) || ($_REQUEST['copysettings'] != 'yes')) {return;}
if (!current_user_can('edit_theme_options')) {return;}
// --- get copy from and copy to slugs ---
$copyto = $copyfrom = false;
if (isset($_REQUEST['fromtheme']) && (trim($_REQUEST['fromtheme']) != '')) {
$copyfrom = trim($_REQUEST['fromtheme']);
$copyfromslug = preg_replace("/\W/", "-", strtolower($copyfrom));
}
if (isset($_REQUEST['totheme']) && (trim($_REQUEST['totheme']) != '')) {
$copyto = trim($_REQUEST['totheme']);
$copytoslug = preg_replace("/\W/", "-", strtolower($copyto));
}
// --- use underscores for Options Framework slugs ---
if (THEMEOPT) {
$copyfromslug = str_replace('-', '_', $copyfromslug).'_options';
// 2.1.1: fix to incorrect variable vtransferto
$copytoslug = str_replace('-', '_', $copytoslug).'_options';
}
if ($copyfromslug && $copytoslug) {
// --- get theme settings ---
$fromsettings = get_option($copyfromslug);
$tosettings = get_option($copytoslug);
// --- copy theme settings ---
// 2.0.5: removed numerous separate message functions
// TODO: backup existing theme settings (if any) ?
// TODO: copy over parent widgets/menus ?
if ($fromsettings) {
$copysettings = update_option($copytoslug, $fromsettings);
if ($copysettings) {
$message = esc_attr(__('Theme Settings have been copied from ','bioship')).$copyfrom.' '.esc_attr(__('to','bioship')).' '.$copyto;
} else {$message = esc_attr(__('Theme Settings failed to copy to ','bioship')).$copyto;}
} else {
$message = esc_attr(__('Copy Theme Settings failed! Could not retrieve settings for ','bioship')).$copyfrom;
}
// --- set theme admin messages ---
global $vthemeadminmessages;
$vthemeadminmessages[] = $message;
bioship_admin_notices_enqueue();
}
}
}
// -----------------------
// === Theme Tools Box ===
// -----------------------
// Note: No Tracers added to theme tools functions (seems pointless.)
// 1.9.5: changed usage of 'options' to 'settings'
// note: Manual querystring usage
// ?backup_theme_settings=yes or admin-ajax.php?action=backup_theme_settings
// ?restore_theme_settings=yes (manual usage deprecated - requires nonce check)
// ?export_theme_settings=yes or admin-ajax.php?action=export_theme_settings
// ?import_theme_settings=yes (manual usage deprecated - requires nonce check)
// ?revert_theme_settings=yes (revert to pre-import - manual deprecated requires nonce)
// -----------------
// Theme Tools Forms
// -----------------
// for backup / restore / export / import / revert
// note: AJAX action for backup / export, post refresh for restore / import / revert
if (!function_exists('bioship_admin_theme_tools_forms')) {
function bioship_admin_theme_tools_forms() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthemesettings, $vthemename;
// Theme Tools Javascript
// ----------------------
// --- set action URLs ---
$adminajax = admin_url('admin-ajax.php');
$actionurl = add_query_arg('page', $_REQUEST['page'], admin_url('admin.php'));
// --- check theme selection for action URL ---
if (isset($_REQUEST['theme']) && ($_REQUEST['theme'] != '')) {
$actionurl = add_query_arg('theme', $_REQUEST['theme'], $actionurl);
}
// --- set confirm labels ---
$confirmrestore = __('Are you sure you want to Restore the Theme Settings Backup?','bioship');
$confirmimport = __('Are you sure you want to Import these Theme Settings?','bioship');
$confirmrevert = __('Are you sure you want to Revert to Theme Settings prior to Import?','bioship');
// --- output javascript ---
echo "";
// Theme Tools Interface
// ---------------------
// --- backup button ---
echo "
| "; echo ""; // --- restore button --- echo " | "; echo ""; // --- export button --- echo " | "; echo "▾"; echo ""; // --- import button --- echo " | "; echo "▾"; echo ""; // --- revert button --- if (isset($vthemesettings['importtime'])) { if ($vthemesettings['importtime'] != '') { echo " | "; echo ""; } } echo " | ||||