'iphone_icon',
'iphone2x_icon'=>'iphone_icon4',
'ipad_icon'=>'ipad_icon',
'ipad2x_icon'=>'ipad_icon2',
'iphone_image'=>'iphone_image',
'iphone2x_image'=>'iphone_image4',
'iphone5_image'=>'iphone5_image',
'ipad_image'=>'ipad_image',
'ipad_land_image'=>'ipad_land_image',
'ipad2x_image'=>'ipad_image2',
'ipad2x_land_image'=>'ipad2x_land_image'
);
$options = array(
'iphone_icon'=>'iphone_icon57x57.png',
'iphone2x_icon'=>'iphone2x_icon114x114.png',
'ipad_icon'=>'ipad_icon72x72.png',
'ipad2x_icon'=>'ipad2x_icon144x144.png',
'iphone_image'=>'iphone_image320x460.png',
'iphone2x_image'=>'iphone2x_image640x920.png',
'iphone5_image'=>'iphone5_image640x1096.png',
'ipad_image'=>'ipad_image768x1004.png',
'ipad_land_image'=>'ipad_land_image748x1024.png',
'ipad2x_image'=>'ipad2x_image1536x2008.png',
'ipad2x_land_image'=>'ipad2x_land_image1496x2048.png'
);
$alreadyInstall = get_option('iphone_icon');
if($alreadyInstall){
foreach($oldOptionsRef as $newOption=>$oldOption){
$oldPath = get_option($oldOption);
if($oldPath){
$path = $oldPath;
}else{
$path = $this->getDynamicUrl('/wp-content/plugins/appleicons/images/icons/'.$options[$newOption]);
}
delete_option($oldOption);
update_option($newOption, $path);
}
return;
}
foreach($options as $option=>$image){
update_option($option, $this->getDynamicUrl('/wp-content/plugins/appleicons/images/icons/'.$image));
}
}
function pluginActionLinks( $links, $file ) {
//var_dump($file);
if ( strpos($file, '/appleicons.php' )>0 ) {
$links[] = ''.__('Settings').'';
}
return $links;
}
function deAddToAdminMenu(){
$this->pagehook = add_options_page('Apple Icon Settings', 'Apple Icons', 'administrator', $this->menuSlug, array($this, 'pluginPageContentCallback'));
}
function pluginsImageSrc($image_name){
return plugins_url( 'images/'.$image_name , __FILE__ );
}
function pluginPageContentCallback(){
wp_enqueue_script('common');
wp_enqueue_script('wp-lists');
wp_enqueue_script('postbox');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false );
add_meta_box( 'wpde_appleicons_icons', __( 'Icons' ), array($this, 'renderIcons'), $this->pagehook, 'normal', 'core' );
add_meta_box( 'wpde_appleicons_screen', __( 'Starup Screens' ), array($this, 'renderStartupScreens'), $this->pagehook, 'normal', 'core' );
add_meta_box( 'wpde_appleicons_helpdesk', __( 'Help Desk' ), array($this, 'renderhelpDesk'), $this->pagehook, 'side', 'core' );
add_meta_box( 'wpde_appleicons_newsdesk', __( 'News Desk' ), array($this, 'renderNewsDesk'), $this->pagehook, 'side', 'core' );
?>
If this plugin fulfill your requirement, please give a
review or you have any query or suggestion, please share it
here.
Apple Icons and Loading Screens
You can post your query on following sites. We will solve your issues free of cost.
channel){
$channel = (array)$rss->channel;
$items = $channel['item'];
}
}
?>
getUserBrowser();
$icons = array(
'iphone_icon'=>'57x57',
'iphone2x_icon'=>'114x114',
'ipad_icon'=>'72x72',
'ipad2x_icon'=>'144x144'
);
$appleTouchIconPrecomposed = 'apple-touch-icon'.((get_option('precomposed')!='')?'-precomposed':'');
if($this->browserName == "safari" || true){ ?>
$size){
$url = $this->getDynamicUrl(get_option($name));
if($url){
?>
nonceName], plugin_basename( __FILE__ )) ){
return $value;
}
$image = $_POST[$name];//$_FILES[$name];
if(preg_match('/png$/', $image)){
$value = $image;
}
/*if($image['size']){
if(preg_match('/png$/', $image['type'])){
$override = array('test_form' =>false);
$file = wp_handle_upload( $image, $override );
if($file){
$value = $file['url'];
}
}
}*/
return $value;
}
function __call($name, $arguments){
$name = explode('__', $name);
$functionName = $name[0];
return $this->$functionName($name[1]);
}
function deAppleIconsRegisterSettings(){
// whitelist options precomposed
register_setting( 'de-apple-icon-group', 'precomposed');
register_setting( 'de-apple-icon-group', 'iphone_icon', array($this, 'validateSetting__iphone_icon'));
register_setting( 'de-apple-icon-group', 'iphone_image', array($this, 'validateSetting__iphone_image'));
register_setting( 'de-apple-icon-group', 'iphone2x_icon', array($this, 'validateSetting__iphone2x_icon'));
register_setting( 'de-apple-icon-group', 'iphone2x_image', array($this, 'validateSetting__iphone2x_image'));
register_setting( 'de-apple-icon-group', 'iphone5_image', array($this, 'validateSetting__iphone5_image'));
register_setting( 'de-apple-icon-group', 'ipad_icon', array($this, 'validateSetting__ipad_icon'));
register_setting( 'de-apple-icon-group', 'ipad_image', array($this, 'validateSetting__ipad_image'));
register_setting( 'de-apple-icon-group', 'ipad_land_image', array($this, 'validateSetting__ipad_land_image'));
register_setting( 'de-apple-icon-group', 'ipad2x_icon', array($this, 'validateSetting__ipad2x_icon'));
register_setting( 'de-apple-icon-group', 'ipad2x_image', array($this, 'validateSetting__ipad2x_image'));
register_setting( 'de-apple-icon-group', 'ipad2x_land_image', array($this, 'validateSetting__ipad2x_land_image'));
}
function getUserBrowser(){
if(!$this->browserName){
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/Opera/i',$user_agent)){
$this->browserName = "opera";
}elseif(preg_match('/firefox/i', $user_agent)){
$this->browserName = "firefox";
}elseif(preg_match('/chrome/i', $user_agent)){
$this->browserName = "chrome";
}elseif(preg_match('/safari/i', $user_agent)){
$this->browserName = "safari";
}
}
}
function getDevice(){
$device_name;
$device_agent=$_SERVER['HTTP_USER_AGENT'];
if(preg_match('/iPad/i', $device_agent)){
$device_name="iPad";
}elseif(preg_match('/iPhone/i',$device_agent)){
$device_name="iPhone";
}
return $device_name;
}
function getDynamicUrl($url){
$siteUrl = site_url();
if(!$url){
return false;
}
$url = explode('wp-content', $url);
$url = $siteUrl.'/wp-content'.$url[1];
return $url;
}
function media_upload_styles() {
wp_enqueue_style('thickbox');
}
function media_upload_scripts($hook){
if($hook=='settings_page_deAppleIcons'){
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
wp_register_script('de_panel_uploader', plugin_dir_url('').'appleicons/appleicons.js', array('jquery','media-upload','thickbox'));
wp_enqueue_script('de_panel_uploader');
wp_enqueue_media();
wp_localize_script( 'de_panel_uploader', 'de_panel_uploader', array(
'media_window_title' => __( 'Choose an Image', $this->nonceName ),
)
);
}
}
function print_scripts(){
}
}
$deAppleIcons = new deAppleIcons();
?>