* @copyright (c) 2014, OnePress Ltd * * @package core * @since 1.0.0 */ /** * The Social Settings * * @since 1.0.0 */ class OPanda_SocialSettings extends OPanda_Settings { public $id = 'social'; /** * Shows the header html of the settings screen. * * @since 1.0.0 * @return void */ public function header() { ?>

'separator' ); $options[] = array( 'type' => 'html', 'html' => '
' . '' . __('Social Buttons', 'bizpanda') . '' . '

' . __('Options to configure native social buttons (Like, Share, Tweet, Subscribe).', 'bizpanda') . '

' . '
' ); $options[] = array( 'type' => 'checkbox', 'way' => 'buttons', 'name' => 'lazy', 'title' => __( 'Lazy Loading', 'bizpanda' ), 'hint' => __( 'If on, start loading resources needed for the buttons only when the locker gets visible on the screen on scrolling. Speeds up loading the website.', 'bizpanda' ) ); $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'dropdown', 'name' => 'lang', 'title' => __( 'Language of Buttons', 'bizpanda' ), 'data' => $languages, 'hint' => sprintf( __( 'Optional. Select the language that will be used for the social buttons. Used only with the native buttons.', 'bizpanda' ), opanda_get_settings_url('text') ) ); $options[] = array( 'type' => 'dropdown', 'way' => 'buttons', 'name' => 'facebook_version', 'title' => __( 'Facebook API Version', 'bizpanda' ), 'default' => 'v5.0', 'data' => array( array('v5.0', 'v5.0'), array('v6.0', 'v6.0'), array('v7.0', 'v7.0'), ), 'hint' => __( 'Optional. Use the most recent version of the API by default.', 'bizpanda' ) ); $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'checkbox', 'way' => 'buttons', 'name' => 'own_apps_for_permissions', 'title' => __( 'Use Own Apps
To Request Permissions', 'bizpanda' ), 'hint' => __( 'Optional. Some social buttons require a user to grant a set of permissions to perform social actions. It works fine out-of-box by using embedded social apps. At the case if you wish to display a logo of your website when a user grants the permissions you need to register your own social apps.', 'bizpanda' ) ); $options[] = array( 'type' => 'div', 'id' => 'own_social_apps_wrap', 'items' => $this->getSocialAppsOptions() ); $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'html', 'html' => '
' . '' . __('Sign-In Buttons', 'bizpanda') . '' . '

' . __('Options to configure sign-in buttons used with sign-in lockers.', 'bizpanda') . '

' . '
' ); $options[] = array( 'type' => 'checkbox', 'way' => 'buttons', 'name' => 'own_apps_to_signin', 'title' => __( 'Use Own Apps
To Sign-In Users', 'bizpanda' ), 'hint' => __( 'Optional. Sign-In buttons work fine out-of-box by using embedded social apps. Set your own apps only if you wish to display a logo of your website when a user signs-in.', 'bizpanda' ) ); $options[] = array( 'type' => 'div', 'id' => 'own_signin_apps_wrap', 'items' => $this->getSignInAppsOptions() ); $options[] = array( 'type' => 'separator' ); return $options; } /** * Returns options for social buttons. */ protected function getSocialAppsOptions() { $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'textbox', 'name' => 'facebook_app_id', 'title' => __( 'Facebook App ID', 'bizpanda' ), 'hint' => sprintf( __( 'The App ID of your Facebook App.', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=facebook-app') ), 'after' => sprintf( __( 'How To Get', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=facebook-app') ) ); $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'textbox', 'name' => 'google_client_id', 'title' => __( 'Google Client ID', 'bizpanda' ), 'after' => sprintf( __( 'How To Get', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=google-client-id') ), 'hint' => sprintf( __( 'The Google Client ID of your Google App.', 'bizpanda' ) ) ); $options[] = array( 'type' => 'textbox', 'name' => 'google_client_secret', 'title' => __( 'Google Client Secret', 'bizpanda' ), 'hint' => __( 'The Google Client Secret of your Google App.', 'bizpanda' ) ); $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'textbox', 'name' => 'twitter_social_app_consumer_key', 'title' => __( 'Twitter App Key', 'bizpanda' ), 'after' => sprintf( __( 'How To Get', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=twitter-app') ), 'hint' => sprintf( __( 'The Twitter Consumer Key of your Twitter App (set only "Read" permission).', 'bizpanda' ) ) ); $options[] = array( 'type' => 'textbox', 'name' => 'twitter_social_app_consumer_secret', 'title' => __( 'Twitter App Key Secret', 'bizpanda' ), 'hint' => __( 'The Twitter Consumer Secret of your Twitter App.', 'bizpanda' ), 'for' => array(__('Connect Locker', 'bizpanda')) ); return $options; } /** * Returns options for sign-in buttons. */ protected function getSignInAppsOptions() { $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'textbox', 'name' => 'facebook_app_id', 'title' => __( 'Facebook App ID', 'bizpanda' ), 'after' => sprintf( __( 'How To Get', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=facebook-app') ), 'hint' => sprintf( __( 'The Facebook App ID of your Facebook App.', 'bizpanda' ) ) ); $options[] = array( 'type' => 'textbox', 'name' => 'facebook_app_secret', 'title' => __( 'Facebook App Secret', 'bizpanda' ), 'hint' => __( 'The Facebook App Secret of your Facebook App.', 'bizpanda' ) ); $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'textbox', 'name' => 'google_client_id', 'title' => __( 'Google Client ID', 'bizpanda' ), 'after' => sprintf( __( 'How To Get', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=google-client-id') ), 'hint' => sprintf( __( 'The Google Client ID of your Google App.', 'bizpanda' ) ) ); $options[] = array( 'type' => 'textbox', 'name' => 'google_client_secret', 'title' => __( 'Google Client Secret', 'bizpanda' ), 'hint' => __( 'The Google Client Secret of your Google App.', 'bizpanda' ) ); $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'textbox', 'name' => 'twitter_signin_app_consumer_key', 'title' => __( 'Twitter App Key', 'bizpanda' ), 'after' => sprintf( __( 'How To Get', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=twitter-app') ), 'hint' => sprintf( __( 'The Twitter Consumer Key of your Twitter App (set "Read" and "Write" permissions).', 'bizpanda' ) ) ); $options[] = array( 'type' => 'textbox', 'name' => 'twitter_signin_app_consumer_secret', 'title' => __( 'Twitter App Key Secret', 'bizpanda' ), 'hint' => __( 'The Twitter Consumer Secret of your Twitter App.', 'bizpanda' ), 'for' => array(__('Connect Locker', 'bizpanda')) ); $options[] = array( 'type' => 'separator' ); $options[] = array( 'type' => 'textbox', 'name' => 'linkedin_client_id', 'title' => __( 'LinkedIn Client ID', 'bizpanda' ), 'after' => sprintf( __( 'How To Get', 'bizpanda' ), admin_url('admin.php?page=how-to-use-' . $this->plugin->pluginName . '&onp_sl_page=linkedin-api-key') ), 'hint' => sprintf( __( 'The LinkedIn Client ID of your LinkedIn App.', 'bizpanda' ) ) ); $options[] = array( 'type' => 'textbox', 'name' => 'linkedin_client_secret', 'title' => __( 'LinkedIn Client Secret', 'bizpanda' ), 'hint' => __( 'The LinkedIn Client Secret of your LinkedIn App.', 'bizpanda' ) ); return $options; } }