'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'
);
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' );
?>
Apple Icons and Loading Screens
channel){
$channel = (array)$rss->channel;
$items = $channel['item'];
}
}
?>
-
title; ?>
description; ?>
-
Sorry we cannot load url
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 = $_FILES[$name];
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;
}
}
$deAppleIcons = new deAppleIcons();
?>