web/wp-content/plugins/wptouch/include/submit.php
changeset 136 bde1974c263b
equal deleted inserted replaced
135:53cff4b4a802 136:bde1974c263b
       
     1 <?php
       
     2 
       
     3 	if ( isset( $_POST['submit'] ) ) {
       
     4 		// let's rock and roll
       
     5 
       
     6 		unset( $_POST['submit'] );
       
     7 		$a = array();
       
     8 
       
     9 		if ( isset( $_POST['enable-post-excerpts'] ) ) {
       
    10 			$a['enable-post-excerpts'] = 1;
       
    11 		} else {
       
    12 			$a['enable-post-excerpts'] = 0;
       
    13 		}
       
    14 
       
    15 		if ( isset( $_POST['enable-page-coms'] ) ) {
       
    16 			$a['enable-page-coms'] = 1;
       
    17 		} else {
       
    18 			$a['enable-page-coms'] = 0;
       
    19 		}
       
    20 
       
    21 		if ( isset( $_POST['enable-cats-button'] ) ) {
       
    22 			$a['enable-cats-button'] = 1;
       
    23 		} else {
       
    24 			$a['enable-cats-button'] = 0;
       
    25 		}
       
    26 
       
    27 		if ( isset( $_POST['enable-tags-button'] ) ) {
       
    28 			$a['enable-tags-button'] = 1;
       
    29 		} else {
       
    30 			$a['enable-tags-button'] = 0;
       
    31 		}
       
    32 
       
    33 		if ( isset( $_POST['enable-search-button'] ) ) {
       
    34 			$a['enable-search-button'] = 1;
       
    35 		} else {
       
    36 			$a['enable-search-button'] = 0;
       
    37 		}
       
    38 
       
    39 		if ( isset( $_POST['enable-login-button'] ) ) {
       
    40 			$a['enable-login-button'] = 1;
       
    41 		} else {
       
    42 			$a['enable-login-button'] = 0;
       
    43 		}
       
    44 
       
    45 		if ( isset( $_POST['enable-gigpress-button'] ) ) {
       
    46 			$a['enable-gigpress-button'] = 1;
       
    47 		} else {
       
    48 			$a['enable-gigpress-button'] = 0;
       
    49 		}
       
    50 
       
    51 		if ( isset( $_POST['enable-gravatars'] ) ) {
       
    52 			$a['enable-gravatars'] = 1;
       
    53 		} else {
       
    54 			$a['enable-gravatars'] = 0;
       
    55 		}
       
    56 
       
    57 		if ( isset( $_POST['enable-ajax-comments'] ) ) {
       
    58 			$a['enable-ajax-comments'] = 1;
       
    59 		} else {
       
    60 			$a['enable-ajax-comments'] = 0;
       
    61 		}
       
    62 		
       
    63 		if ( isset( $_POST['enable-main-home'] ) ) {
       
    64 			$a['enable-main-home'] = 1;
       
    65 		} else {
       
    66 			$a['enable-main-home'] = 0;
       
    67 		}
       
    68 		
       
    69 		if ( isset( $_POST['enable-main-rss'] ) ) {
       
    70 			$a['enable-main-rss'] = 1;
       
    71 		} else {
       
    72 			$a['enable-main-rss'] = 0;
       
    73 		}
       
    74 		
       
    75 		if ( isset( $_POST['enable-main-email'] ) ) {
       
    76 			$a['enable-main-email'] = 1;
       
    77 		} else {
       
    78 			$a['enable-main-email'] = 0;
       
    79 		}
       
    80 		
       
    81 		if ( isset( $_POST['enable-main-name'] ) ) {
       
    82 			$a['enable-main-name'] = 1;
       
    83 		} else {
       
    84 			$a['enable-main-name'] = 0;
       
    85 		}
       
    86 		
       
    87 		if ( isset( $_POST['enable-main-tags'] ) ) {
       
    88 			$a['enable-main-tags'] = 1;
       
    89 		} else {
       
    90 			$a['enable-main-tags'] = 0;
       
    91 		}
       
    92 
       
    93 		if ( isset( $_POST['enable-main-categories'] ) ) {
       
    94 			$a['enable-main-categories'] = 1;
       
    95 		} else {
       
    96 			$a['enable-main-categories'] = 0;
       
    97 		}
       
    98 
       
    99 //Prowl
       
   100 		if ( isset($_POST['prowl-api']) ) {
       
   101 			$a['prowl-api'] = $_POST['prowl-api'];
       
   102 		}
       
   103 		
       
   104 		if ( isset( $_POST['enable-prowl-comments-button'] ) ) {
       
   105 			$a['enable-prowl-comments-button'] = 1;
       
   106 		} else {
       
   107 			$a['enable-prowl-comments-button'] = 0;
       
   108 		}
       
   109 		
       
   110 		if ( isset( $_POST['enable-prowl-users-button'] ) ) {
       
   111 			$a['enable-prowl-users-button'] = 1;
       
   112 		} else {
       
   113 			$a['enable-prowl-users-button'] = 0;
       
   114 		}
       
   115 
       
   116 		if ( isset( $_POST['enable-prowl-message-button'] ) ) {
       
   117 			$a['enable-prowl-message-button'] = 1;
       
   118 		} else {
       
   119 			$a['enable-prowl-message-button'] = 0;
       
   120 		}
       
   121 //
       
   122 
       
   123 		if ( isset( $_POST['home-page'] ) ) {
       
   124 			$a['home-page'] = $_POST['home-page'];
       
   125 			if (strlen($a['home-page']) == 0) {
       
   126 				$a['home-page'] = 'Default';
       
   127 			}
       
   128 		} else {
       
   129 			$a['home-page'] = 'Default';
       
   130 		}
       
   131 
       
   132 		if ( isset($_POST['statistics']) ) {
       
   133 			$a['statistics'] = $_POST['statistics'];
       
   134 		}
       
   135 
       
   136 		if ( isset($_POST['sort-order']) ) {
       
   137 			$a['sort-order'] = $_POST['sort-order'];
       
   138 		}
       
   139 
       
   140 		if ( isset($_POST['enable-regular-default']) ) {
       
   141 			$a['enable-regular-default'] = 1;
       
   142 		} else {
       
   143 			$a['enable-regular-default'] = 0;
       
   144 		}
       
   145 		
       
   146 		if ( isset($_POST['enable-show-tweets']) ) {
       
   147 			$a['enable-show-tweets'] = 1;
       
   148 		} else {
       
   149 			$a['enable-show-tweets'] = 0;
       
   150 		}		
       
   151 		
       
   152 		if ( isset( $_POST['custom-user-agents'] ) ) {
       
   153 			$new_array = array();
       
   154 			if ( !strlen( trim( $_POST['custom-user-agents'] ) ) ) {
       
   155 				$a['custom-user-agents'] = array();
       
   156 			} else {				
       
   157 				$a['custom-user-agents'] = explode( ",", $_POST['custom-user-agents'] );
       
   158 				foreach( $a['custom-user-agents'] as $agent ) {
       
   159 					$new_array[] = trim( $agent );	
       
   160 				}
       
   161 				$a['custom-user-agents'] = $new_array;
       
   162 			}
       
   163 		} else {
       
   164 			$a['custom-user-agents'] = array();	
       
   165 		}
       
   166 
       
   167 		if ( isset($_POST['excluded-cat-ids']) ) {
       
   168 			$a['excluded-cat-ids'] = $_POST['excluded-cat-ids'];
       
   169 		}
       
   170 
       
   171 		if ( isset($_POST['adsense-id']) ) {
       
   172 			$a['adsense-id'] = trim( $_POST['adsense-id'] );
       
   173 		}
       
   174 
       
   175 		if ( isset($_POST['adsense-channel']) ) {
       
   176 			$a['adsense-channel'] = $_POST['adsense-channel'];
       
   177 		}		
       
   178 
       
   179 		if ( isset($_POST['post-cal-thumb']) ) {
       
   180 			$a['post-cal-thumb'] = $_POST['post-cal-thumb'];
       
   181 		}
       
   182 
       
   183 		if ( isset($_POST['h2-font']) ) {
       
   184 			$a['h2-font'] = $_POST['h2-font'];
       
   185 		}
       
   186 
       
   187 		if ( isset($_POST['style-text-justify']) ) {
       
   188 			$a['style-text-justify'] = $_POST['style-text-justify'];
       
   189 		}
       
   190 
       
   191 		if ( isset($_POST['style-background']) ) {
       
   192 			$a['style-background'] = $_POST['style-background'];
       
   193 		}
       
   194 
       
   195 		if ( isset( $_POST['enable-exclusive'] ) ) {
       
   196 			$a['enable-exclusive'] = 1;	
       
   197 		} else {
       
   198 			$a['enable-exclusive'] = 0;
       
   199 		}
       
   200 
       
   201 		foreach ($_POST as $k => $v) {
       
   202 			if ($k == 'enable_main_title') {
       
   203 				$a['main_title'] = $v;
       
   204 			} else {
       
   205 				if (preg_match('#enable_(.*)#', $k, $matches)) {
       
   206 					$id = $matches[1];
       
   207 					if (!isset($a[$id]))
       
   208 					$a[$id] = $_POST['icon_' . $id];
       
   209 				}
       
   210 			}
       
   211 		}
       
   212 
       
   213 		$a['header-title'] = $_POST['header-title'];
       
   214 		if (!isset($a['header-title']) || (isset($a['header-title']) && strlen($a['header-title']) == 0)) {
       
   215 		$a['header-title'] = get_bloginfo('title');
       
   216 	}
       
   217 
       
   218 	$a['header-background-color'] = $_POST['header-background-color'];
       
   219 	$a['header-border-color'] = $_POST['header-border-color'];
       
   220 	$a['header-text-color'] = $_POST['header-text-color'];
       
   221 	$a['link-color'] = $_POST['link-color'];
       
   222 //Prowl
       
   223 	$a['prowl-api'] = $_POST['prowl-api'];
       
   224 
       
   225 	$values = serialize($a);
       
   226 	update_option('bnc_iphone_pages', $values);
       
   227  	} 
       
   228 // The Master Kill Switch
       
   229 	elseif ( isset( $_POST['reset'] ) ) {
       
   230 		update_option( 'bnc_iphone_pages', '' );
       
   231  }
       
   232 
       
   233 global $wptouch_settings;
       
   234 $wptouch_settings = bnc_wptouch_get_settings();
       
   235 ?>