Changeset 8386 for extensions/FacebookPlug/Plugin/admin.config.php
- Timestamp:
- Dec 29, 2010, 11:45:21 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/FacebookPlug/Plugin/admin.config.php
r8375 r8386 54 54 l10n('Advanced'), 55 55 add_url_params($base_url, array('tab' => 'advanced'))); 56 $tabsheet->add('activity', 57 l10n('Activity'), 58 add_url_params($base_url, array('tab' => 'activity'))); 56 59 $tabsheet->select($page['tab']); 57 60 $tabsheet->assign(); 61 62 function fbp_intval($n) 63 { 64 return (is_numeric($n) ? $n : null); 65 } 66 67 function fbp_checked($b) 68 { 69 return ($b ? 'checked="checked"' : ''); 70 } 58 71 59 72 // Update … … 67 80 { 68 81 // Like button 69 $conf['fbp']['social_plugin_like_button']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED']) ? false : true;82 $conf['fbp']['social_plugin_like_button']['enabled'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ENABLED']); 70 83 $conf['fbp']['social_plugin_like_button']['layout'] = $layout[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_LAYOUT']]; 71 $conf['fbp']['social_plugin_like_button']['show_faces'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_SHOW_FACES']) ? false : true;84 $conf['fbp']['social_plugin_like_button']['show_faces'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_SHOW_FACES']); 72 85 $conf['fbp']['social_plugin_like_button']['action'] = $action[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_ACTION']]; 73 86 $conf['fbp']['social_plugin_like_button']['colorscheme'] = $colorscheme[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BUTTON_COLORSCHEME']]; 74 87 // Facepile 75 $conf['fbp']['social_plugin_facepile']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED']) ? false : true;88 $conf['fbp']['social_plugin_facepile']['enabled'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_ENABLED']); 76 89 $conf['fbp']['social_plugin_facepile']['max_rows'] = intval($_POST['FBP_SOCIAL_PLUGIN_FACEPILE_MAX_ROWS']); 77 90 // Comments 78 $conf['fbp']['social_plugin_comments']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED']) ? false : true;79 $conf['fbp']['social_plugin_comments']['numposts'] = intval($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_NUMPOSTS']);91 $conf['fbp']['social_plugin_comments']['enabled'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_ENABLED']); 92 $conf['fbp']['social_plugin_comments']['numposts'] = fbp_intval($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_NUMPOSTS']); 80 93 $conf['fbp']['social_plugin_comments']['title'] = $_POST['FBP_SOCIAL_PLUGIN_COMMENTS_TITLE']; 81 $conf['fbp']['social_plugin_comments']['simple'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_SIMPLE']) ? false : true; 82 $conf['fbp']['social_plugin_comments']['reverse'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_REVERSE']) ? false : true; 83 $conf['fbp']['social_plugin_comments']['publish_feed'] = empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_PUBLISH_FEED']) ? false : true; 94 $conf['fbp']['social_plugin_comments']['simple'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_SIMPLE']); 95 $conf['fbp']['social_plugin_comments']['reverse'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_REVERSE']); 96 $conf['fbp']['social_plugin_comments']['publish_feed'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_COMMENTS_PUBLISH_FEED']); 97 // Actvity feed 98 $conf['fbp']['social_plugin_activity_feed']['enabled'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_ACTIVITY_FEED_ENABLED']); 99 $conf['fbp']['social_plugin_activity_feed']['colorscheme'] = $colorscheme[$_POST['FBP_SOCIAL_PLUGIN_ACTIVITY_FEED_COLORSCHEME']]; 100 $conf['fbp']['social_plugin_activity_feed']['recommendations'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_ACTIVITY_FEED_RECOMMENDATIONS']); 101 $conf['fbp']['social_plugin_activity_feed']['header'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_ACTIVITY_FEED_HEADER']); 102 $conf['fbp']['social_plugin_activity_feed']['height'] = fbp_intval($_POST['FBP_SOCIAL_PLUGIN_ACTIVITY_FEED_HEIGHT']); 84 103 // Like box 85 $conf['fbp']['social_plugin_like_box']['enabled'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED']) ? false : true;104 $conf['fbp']['social_plugin_like_box']['enabled'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_ENABLED']); 86 105 $conf['fbp']['social_plugin_like_box']['url'] = $_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_URL']; 87 106 $conf['fbp']['social_plugin_like_box']['colorscheme'] = $colorscheme[$_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_COLORSCHEME']]; 88 $conf['fbp']['social_plugin_like_box']['show_faces'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_SHOW_FACES']) ? false : true; 89 $conf['fbp']['social_plugin_like_box']['stream'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_STREAM']) ? false : true; 90 $conf['fbp']['social_plugin_like_box']['header'] = empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_HEADER']) ? false : true; 91 107 $conf['fbp']['social_plugin_like_box']['show_faces'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_SHOW_FACES']); 108 $conf['fbp']['social_plugin_like_box']['stream'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_STREAM']); 109 $conf['fbp']['social_plugin_like_box']['header'] = ! empty($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_HEADER']); 110 $conf['fbp']['social_plugin_like_box']['height'] = fbp_intval($_POST['FBP_SOCIAL_PLUGIN_LIKE_BOX_HEIGHT']); 111 92 112 // Check 93 113 if ($conf['fbp']['social_plugin_like_button']['enabled'] and $conf['fbp']['social_plugin_comments']['enabled']) … … 103 123 { 104 124 $conf['fbp']['facebook_app_id'] = $_POST['FBP_FACEBOOK_APP_ID']; 105 $conf['fbp']['async_script'] = empty($_POST['FBP_ASYNC_SCRIPT']) ? false : true;106 $conf['fbp']['force_facebook_init'] = empty($_POST['FBP_FORCE_FACEBOOK_INIT']) ? false : true;125 $conf['fbp']['async_script'] = ! empty($_POST['FBP_ASYNC_SCRIPT']); 126 $conf['fbp']['force_facebook_init'] = ! empty($_POST['FBP_FORCE_FACEBOOK_INIT']); 107 127 $conf['fbp']['picture_url_type'] = $picture_url_type[$_POST['FBP_PICTURE_URL_TYPE']]; 108 $conf['fbp']['allow_fb_access_private_page'] = empty($_POST['FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE']) ? false : true;109 $conf['fbp']['add_about_informations'] = empty($_POST['FBP_ADD_ABOUT_INFORMATIONS']) ? false : true;110 $conf['fbp']['add_group_footer'] = empty($_POST['FBP_ADD_GROUP_FOOTER']) ? false : true;111 $conf['fbp']['add_application_footer'] = empty($_POST['FBP_ADD_APPLICATION_FOOTER']) ? false : true;128 $conf['fbp']['allow_fb_access_private_page'] = ! empty($_POST['FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE']); 129 $conf['fbp']['add_about_informations'] = ! empty($_POST['FBP_ADD_ABOUT_INFORMATIONS']); 130 $conf['fbp']['add_group_footer'] = ! empty($_POST['FBP_ADD_GROUP_FOOTER']); 131 $conf['fbp']['add_application_footer'] = ! empty($_POST['FBP_ADD_APPLICATION_FOOTER']); 112 132 break; 113 133 } … … 145 165 ( 146 166 'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/like/', 147 'ENABLED' => ($conf['fbp']['social_plugin_like_button']['enabled'] ? 'checked="checked"' : ''),167 'ENABLED' => fbp_checked($conf['fbp']['social_plugin_like_button']['enabled']), 148 168 'LAYOUT_OPTIONS' => $layout_l10n, 149 169 'LAYOUT_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_button']['layout'], $layout), 150 'SHOW_FACES' => ($conf['fbp']['social_plugin_like_button']['show_faces'] ? 'checked="checked"' : ''),170 'SHOW_FACES' => fbp_checked($conf['fbp']['social_plugin_like_button']['show_faces']), 151 171 'ACTION_OPTIONS' => $action_l10n, 152 172 'ACTION_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_button']['action'], $action), … … 157 177 ( 158 178 'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/facepile/', 159 'ENABLED' => ($conf['fbp']['social_plugin_facepile']['enabled'] ? 'checked="checked"' : ''),179 'ENABLED' => fbp_checked($conf['fbp']['social_plugin_facepile']['enabled']), 160 180 'MAX_ROWS' => $conf['fbp']['social_plugin_facepile']['max_rows'], 161 181 ), … … 163 183 ( 164 184 'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/comments/', 165 'ENABLED' => ($conf['fbp']['social_plugin_comments']['enabled'] ? 'checked="checked"' : ''),185 'ENABLED' => fbp_checked($conf['fbp']['social_plugin_comments']['enabled']), 166 186 'NUMPOSTS' => $conf['fbp']['social_plugin_comments']['numposts'], 167 187 'TITLE' => $conf['fbp']['social_plugin_comments']['title'], 168 'SIMPLE' => ($conf['fbp']['social_plugin_comments']['simple'] ? 'checked="checked"' : ''), 169 'REVERSE' => ($conf['fbp']['social_plugin_comments']['reverse'] ? 'checked="checked"' : ''), 170 'PUBLISH_FEED' => ($conf['fbp']['social_plugin_comments']['publish_feed'] ? 'checked="checked"' : ''), 188 'SIMPLE' => fbp_checked($conf['fbp']['social_plugin_comments']['simple']), 189 'REVERSE' => fbp_checked($conf['fbp']['social_plugin_comments']['reverse']), 190 'PUBLISH_FEED' => fbp_checked($conf['fbp']['social_plugin_comments']['publish_feed']), 191 ), 192 'activity_feed' => array 193 ( 194 'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/activity/', 195 'ENABLED' => fbp_checked($conf['fbp']['social_plugin_activity_feed']['enabled']), 196 'COLORSCHEME_OPTIONS' => $colorscheme_l10n, 197 'COLORSCHEME_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_activity_feed']['colorscheme'], $colorscheme), 198 'RECOMMENDATIONS' => fbp_checked($conf['fbp']['social_plugin_activity_feed']['recommendations']), 199 'HEADER' => fbp_checked($conf['fbp']['social_plugin_activity_feed']['header']), 200 'HEIGHT' => $conf['fbp']['social_plugin_activity_feed']['height'], 171 201 ), 172 202 'like_box' => array 173 203 ( 174 204 'FB_PAGE' => FACEBOOK_DOC_PLUGINS_URL.'/like-box/', 175 'ENABLED' => ($conf['fbp']['social_plugin_like_box']['enabled'] ? 'checked="checked"' : ''),205 'ENABLED' => fbp_checked($conf['fbp']['social_plugin_like_box']['enabled']), 176 206 'URL' => $conf['fbp']['social_plugin_like_box']['url'], 177 207 'COLORSCHEME_OPTIONS' => $colorscheme_l10n, 178 208 'COLORSCHEME_OPTIONS_SELECTED' => array_search($conf['fbp']['social_plugin_like_box']['colorscheme'], $colorscheme), 179 'SHOW_FACES' => ($conf['fbp']['social_plugin_like_box']['show_faces'] ? 'checked="checked"' : ''), 180 'STREAM' => ($conf['fbp']['social_plugin_like_box']['stream'] ? 'checked="checked"' : ''), 181 'HEADER' => ($conf['fbp']['social_plugin_like_box']['header'] ? 'checked="checked"' : ''), 209 'SHOW_FACES' => fbp_checked($conf['fbp']['social_plugin_like_box']['show_faces']), 210 'STREAM' => fbp_checked($conf['fbp']['social_plugin_like_box']['stream']), 211 'HEADER' => fbp_checked($conf['fbp']['social_plugin_like_box']['header']), 212 'HEIGHT' => $conf['fbp']['social_plugin_like_box']['height'], 182 213 ), 183 214 )); … … 190 221 array( 191 222 'FBP_FACEBOOK_APP_ID' => $conf['fbp']['facebook_app_id'], 192 'FBP_ASYNC_SCRIPT' => ($conf['fbp']['async_script'] ? 'checked="checked"' : ''),193 'FBP_FORCE_FACEBOOK_INIT' => ($conf['fbp']['force_facebook_init'] ? 'checked="checked"' : ''),223 'FBP_ASYNC_SCRIPT' => fbp_checked($conf['fbp']['async_script']), 224 'FBP_FORCE_FACEBOOK_INIT' => fbp_checked($conf['fbp']['force_facebook_init']), 194 225 'FBP_PICTURE_URL_TYPE_OPTIONS' => $picture_url_type_l10n, 195 226 'FBP_PICTURE_URL_TYPE_OPTIONS_SELECTED' => array_search($conf['fbp']['picture_url_type'], $picture_url_type), 196 'FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE'=> ($conf['fbp']['allow_fb_access_private_page'] ? 'checked="checked"' : ''), 197 'FBP_ADD_ABOUT_INFORMATIONS' => ($conf['fbp']['add_about_informations'] ? 'checked="checked"' : ''), 198 'FBP_ADD_GROUP_FOOTER' => ($conf['fbp']['add_group_footer'] ? 'checked="checked"' : ''), 199 'FBP_ADD_APPLICATION_FOOTER' => ($conf['fbp']['add_application_footer'] ? 'checked="checked"' : ''), 227 'FBP_ALLOW_FB_ACCESS_PRIVATE_PAGE'=> fbp_checked($conf['fbp']['allow_fb_access_private_page']), 228 'FBP_ADD_ABOUT_INFORMATIONS' => fbp_checked($conf['fbp']['add_about_informations']), 229 'FBP_ADD_GROUP_FOOTER' => fbp_checked($conf['fbp']['add_group_footer']), 230 'FBP_ADD_APPLICATION_FOOTER' => fbp_checked($conf['fbp']['add_application_footer']), 231 )); 232 break; 233 } 234 case 'activity' : 235 { 236 $template->assign( 237 $page['tab'], 238 array( 200 239 )); 201 240 break; … … 216 255 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 217 256 218 219 257 ?>
Note: See TracChangeset
for help on using the changeset viewer.