This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
// File cannot be called directly
if (isset($_SERVER['SCRIPT_FILENAME']) && 'settings.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
die ('Please do not load this page directly. Thanks!');
}
include_once ( dirname(__FILE__) .'/framework/formating.php' );
global $cham_theme_data, $cham_settings; // = get_option('chameleon_settings');
$cham_styles = akv_dir_content(dirname(__FILE__) . '/styles', 'extensions=css&tree=0&with_ext=0');
$uploads = wp_upload_dir();
$dirname = $uploads['basedir'] . '/alkivia';
$dir_url = $uploads['baseurl'] . '/alkivia';
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
check_admin_referer('chameleon-theme-settings');
if ( isset($_POST['action']) && 'update' == $_POST['action'] ) {
$cham_settings = stripslashes_deep($_POST['cham_settings']);
update_option('chameleon_settings', $cham_settings);
akv_admin_notify();
// Upload the header file
include_once ( CHAM_ABSPATH . '/framework/upload.php');
$handle = new akvUpload($_FILES['header-file'], 'chameleon');
if ( $handle->uploaded ) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 972;
$handle->file_overwrite = true;
$handle->file_auto_rename = false;
$handle->file_new_name_body = 'theme_head';
$handle->image_convert = 'jpg';
$handle->Process($dirname);
if ( ! $handle->processed ) {
akv_admin_notify(__('Error', 'chameleon') . ': ' . $handle->error);
}
// Process a miniature for this image. This is a banner width image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 468;
$handle->file_overwrite = true;
$handle->file_auto_rename = false;
$handle->file_new_name_body = 'theme_head_thumb';
$handle->image_convert = 'jpg';
$handle->Process($dirname);
if ( ! $handle->processed ) {
akv_admin_notify(__('Error creating thumbnail', 'chameleon') . ': ' . $handle->error);
}
}
} else { // Missing action
wp_die('Bad form received.', 'chameleon');
}
}
?>