示例#1
0
 /**
  * Generate the parameters for the raas plugin.
  * @return array
  */
 public function getParams()
 {
     // Parameters to be sent to the DOM.
     $params = array('actionRaas' => 'gigya_raas', 'redirect' => user_admin_url(), 'canEditUsers' => current_user_can('edit_users'), 'raasWebScreen' => _gigParam($this->login_options, 'raasWebScreen', 'Default-RegistrationLogin'), 'raasMobileScreen' => _gigParam($this->login_options, 'raasMobileScreen', 'DefaultMobile-RegistrationLogin'), 'raasLoginScreen' => _gigParam($this->login_options, 'raasLoginScreen', 'gigya-login-screen'), 'raasRegisterScreen' => _gigParam($this->login_options, 'raasRegisterScreen', 'gigya-register-screen'), 'raasProfileWebScreen' => _gigParam($this->login_options, 'raasProfileWebScreen', 'Default-ProfileUpdate'), 'raasProfileMobileScreen' => _gigParam($this->login_options, 'raasProfileMobileScreen', 'DefaultMobile-ProfileUpdate'), 'raasOverrideLinks' => _gigParamDefaultOn($this->login_options, 'raasOverrideLinks'), 'raasLoginDiv' => _gigParam($this->login_options, 'raasLoginDiv', 'loginform'), 'raasRegisterDiv' => _gigParam($this->login_options, 'raasRegisterDiv', 'registerform'), 'raasProfileDiv' => _gigParam($this->login_options, 'raasProfileDiv', 'profile-page'));
     // Let others plugins to modify the raas parameters.
     $params = apply_filters('gigya_raas_params', $params);
     return $params;
 }
/**
 * Form builder for 'Share Settings' configuration page.
 */
function followSettingsForm()
{
    $values = get_option(GIGYA__SETTINGS_FOLLOW);
    $form = array();
    $form['on'] = array('type' => 'checkbox', 'label' => __('Enable Follow Bar Plugin'), 'value' => _gigParamDefaultOn($values, 'on'));
    $form['followButtons'] = array('type' => 'textarea', 'label' => __('Follow Buttons'), 'value' => _gigParam($values, 'followButtons', _gigya_get_json('admin/forms/json/default_follow')), 'desc' => __('Please fill valid JSON for follow-bar button as describe') . ' ' . '<a href="http://developers.gigya.com/010_Developer_Guide/18_Plugins/050_Follow_Bar#Quick_Start_Implementation">' . __('here') . '</a>');
    $form['layout'] = array('type' => 'select', 'options' => array("horizontal" => __("Horizontal"), "vertical" => __("Vertical")), 'value' => _gigParam($values, 'layout', 'horizontal'), 'label' => __('Layout'));
    $form['iconSize'] = array('type' => 'text', 'value' => esc_attr(_gigParam($values, 'iconSize', 32)), 'label' => __('Icon size'), 'desc' => __('The size of the follow icons'));
    $form['advanced'] = array('type' => 'textarea', 'label' => __("Additional Parameters (advanced)"), 'value' => _gigParam($values, 'advanced', ''), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/010_Socialize/socialize.showFollowBarUI" target="_blank">' . __('parameters') . '</a>');
    // use this field in multisite to flag when sub site settings are saved locally for site
    if (is_multisite() && !$values['sub_site_settings_saved']) {
        $form['sub_site_settings_saved'] = array('type' => 'hidden', 'id' => 'sub_site_settings_saved', 'value' => 1, 'msg' => 1, 'msg_txt' => 'Settings are set to match the main site. once saved they will become independent', 'class' => 'gigya-raas-warn');
    }
    echo _gigya_form_render($form, GIGYA__SETTINGS_FOLLOW);
}
/**
 * Form builder for 'Comment Settings' configuration page.
 */
function commentsSettingsForm()
{
    $values = get_option(GIGYA__SETTINGS_COMMENTS);
    $form = array();
    $form['on'] = array('type' => 'checkbox', 'label' => __('Enable Gigya Comments'), 'value' => _gigParamDefaultOn($values, 'on'));
    $form['rating'] = array('type' => 'checkbox', 'label' => __('Rating & Reviews mode'), 'value' => _gigParam($values, 'rating', 0), 'desc' => sprintf(__('Checking this button will change the mode of the Comment plugin to Rating & Reviews. Please make sure that the Category ID defined below is set to Rating & Reviews mode in the %s.'), '<a href="https://platform.gigya.com/Site/partners/Settings.aspx#cmd%3DSettings.CommentsSetup">' . __('Gigya platform') . '</a>'));
    $form['categoryID'] = array('type' => 'text', 'label' => __('Category ID'), 'value' => _gigParam($values, 'categoryID', ''), 'desc' => sprintf(__("Copy the ID under 'Comments category name' from %s."), '<a href="https://platform.gigya.com/Site/partners/Settings.aspx#cmd%3DSettings.CommentsSetup">' . __('Gigya platform') . '</a>'));
    $form['enabledShareProviders'] = array('type' => 'text', 'label' => __('Providers'), 'value' => _gigParam($values, 'enabledShareProviders', '*'), 'desc' => __('Comma separated list of share providers to include. For example: facebook,twitter,linkedin. Leave empty or type * for all providers.'));
    $form['position'] = array('type' => 'select', 'options' => array('under' => __('Under Post'), 'none' => __('None')), 'label' => __('Set the position of the Comments in a post page'), 'value' => _gigParam($values, 'position', 'under'), 'desc' => sprintf(__('You can also add and position Gigya Comments using the %s settings page.'), '<a href="' . admin_url('widgets.php') . '">' . __('Widgets') . '</a>'));
    $form['advanced'] = array('type' => 'textarea', 'label' => __("Additional Parameters (advanced)"), 'value' => _gigParam($values, 'advanced', ''), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/030_Comments/comments.showCommentsUI" target="_blank">' . __('parameters') . '</a>');
    // use this field in multisite to flag when sub site settings are saved locally for site
    if (is_multisite() && !$values['sub_site_settings_saved']) {
        $form['sub_site_settings_saved'] = array('type' => 'hidden', 'id' => 'sub_site_settings_saved', 'value' => 1, 'msg' => 1, 'msg_txt' => 'Settings are set to match the main site. once saved they will become independent', 'class' => 'gigya-raas-warn');
    }
    echo _gigya_form_render($form, GIGYA__SETTINGS_COMMENTS);
}
示例#4
0
/**
 * Form builder for 'Gamification Settings' configuration page.
 */
function feedSettingsForm()
{
    $values = get_option(GIGYA__SETTINGS_FEED);
    $form = array();
    $form['on'] = array('type' => 'checkbox', 'label' => __('Enable Activity Feed Plugins'), 'value' => _gigParamDefaultOn($values, 'on'), 'desc' => __('Enable Sharing to Activity Feed.'));
    $form['privacy'] = array('type' => 'select', 'options' => array("private" => __("Private"), "public" => __("Public"), "friends" => __("Friends")), 'value' => _gigParam($values, 'privacy', 'private'), 'label' => __('Activity Feed privacy level'));
    $form['scope'] = array('type' => 'select', 'options' => array("both" => __("both"), "external" => __("External")), 'value' => _gigParam($values, 'scope', 'external'), 'label' => __('Enable Sharing to Activity Feed'), 'desc' => __('When publishing feed items, like comment and reactions, by default the feed items are published to social networks only and will not appear<br> on the site\'s Activity Feed plugin ("External"). To change this behavior, you must change the publish scope to "Both"'));
    $form['tabOrder'] = array('type' => 'text', 'label' => __('Tabs and order'), 'value' => _gigParam($values, 'tabOrder', 'everyone,friends,me'), 'desc' => __('A comma delimited list of tab names that defines which tabs to show and the tab order. The optional tab names are: "everyone", "friends", "me".'));
    $form['width'] = array('type' => 'text', 'label' => __('Custom Width'), 'value' => _gigParam($values, 'width', '170'), 'desc' => __('The width of the plugin in px'), 'class' => 'size');
    $form['height'] = array('type' => 'text', 'label' => __('Custom Height'), 'value' => _gigParam($values, 'height', '270'), 'desc' => __('The height of the plugin in px'), 'class' => 'size');
    $form['advanced'] = array('type' => 'textarea', 'value' => _gigParam($values, 'advanced', ''), 'label' => __('Additional Parameters (advanced)'), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/010_Socialize/socialize.showFeedUI" target="_blank">' . __('parameters') . '</a>');
    // use this field in multisite to flag when sub site settings are saved locally for site
    if (is_multisite() && !$values['sub_site_settings_saved']) {
        $form['sub_site_settings_saved'] = array('type' => 'hidden', 'id' => 'sub_site_settings_saved', 'value' => 1, 'msg' => 1, 'msg_txt' => 'Settings are set to match the main site. once saved they will become independent', 'class' => 'gigya-raas-warn');
    }
    echo _gigya_form_render($form, GIGYA__SETTINGS_FEED);
}
/**
 * Form builder for 'Share Settings' configuration page.
 */
function shareSettingsForm()
{
    $values = get_option(GIGYA__SETTINGS_SHARE);
    $form = array();
    $form['on'] = array('type' => 'checkbox', 'label' => __('Enable Share Bar Plugin'), 'value' => _gigParamDefaultOn($values, 'on'));
    $form['position'] = array('type' => 'select', 'options' => array("none" => __("None"), "bottom" => __("Bottom"), "top" => __("Top"), "both" => __("Both")), 'label' => __('Set the position of the Share Bar in a post page'), 'value' => _gigParam($values, 'position', 'none'), 'desc' => sprintf(__('You can also add and position Gigya Share Bar using the %s settings page.'), '<a href="' . admin_url('widgets.php') . '">' . __('Widgets') . '</a>'));
    $form['shareButtons'] = array('type' => 'text', 'label' => __('Share Providers'), 'value' => _gigParam($values, 'shareButtons', 'share,facebook-like,google-plusone,twitter,email'), 'desc' => __('For example: share,email,pinterest,twitter-tweet,google-plusone,facebook-like.'));
    $form['showCounts'] = array('type' => 'select', 'options' => array("right" => __("Right"), "top" => __("Top"), "none" => __("None")), 'value' => _gigParam($values, 'showCounts', 'right'), 'label' => __('Show Counts'));
    $form['layout'] = array('type' => 'select', 'options' => array("horizontal" => __("Horizontal"), "vertical" => __("Vertical")), 'value' => _gigParam($values, 'layout', 'horizontal'), 'label' => __('Layout'));
    $form['image'] = array('type' => 'checkbox', 'value' => _gigParam($values, 'image', 0), 'label' => __('Set image URL'), 'class' => 'conditional');
    $form['imageURL'] = array('type' => 'text', 'label' => __("Default URL of the image to share"), 'value' => _gigParam($values, 'imageURL', ''));
    $form['shortURLs'] = array('type' => 'checkbox', 'label' => __("Share using short URLs"), 'value' => _gigParam($values, 'shortURLs', 0));
    $form['advanced'] = array('type' => 'textarea', 'label' => __("Additional Parameters (advanced)"), 'value' => _gigParam($values, 'advanced', ''), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/020_Methods/socialize.showShareBarUI" target="_blank">' . __('parameters') . '</a>');
    // use this field in multisite to flag when sub site settings are saved locally for site
    if (is_multisite() && !$values['sub_site_settings_saved']) {
        $form['sub_site_settings_saved'] = array('type' => 'hidden', 'id' => 'sub_site_settings_saved', 'value' => 1, 'msg' => 1, 'msg_txt' => 'Settings are set to match the main site. once saved they will become independent', 'class' => 'gigya-raas-warn');
    }
    echo _gigya_form_render($form, GIGYA__SETTINGS_SHARE);
}
示例#6
0
/**
 * Form builder for 'Gamification Settings' configuration page.
 */
function gmSettingsForm()
{
    $values = get_option(GIGYA__SETTINGS_GM);
    $form = array();
    $form['on'] = array('type' => 'checkbox', 'label' => __('Enable Gamification Plugins'), 'value' => _gigParamDefaultOn($values, 'on'));
    $form['notification'] = array('type' => 'checkbox', 'label' => __('Enable Notifications'), 'value' => _gigParam($values, 'notification', 0));
    $form['period'] = array('type' => 'select', 'options' => array("7days" => __("7 Days"), "all" => __("All")), 'value' => _gigParam($values, 'period', '7days'), 'label' => __('Leaderboard time period'));
    $form['totalCount'] = array('type' => 'text', 'value' => _gigParam($values, 'totalCount', '12'), 'label' => __('Leaderboard user count'), 'desc' => __('Valid values are between 1 to 23'));
    $form['advanced_achievements'] = array('type' => 'textarea', 'value' => _gigParam($values, 'advanced_achievements', ''), 'label' => __('Additional Parameters (advanced) for showAchievementsUI'), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/040_GM/gm.showAchievementsUI" target="_blank">' . __('parameters') . '</a>');
    $form['advanced_challenge'] = array('type' => 'textarea', 'value' => _gigParam($values, 'advanced_challenge', ''), 'label' => __('Additional Parameters (advanced) showChallengeStatusUI'), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/040_GM/gm.showChallengeStatusUI" target="_blank">' . __('parameters') . '</a>');
    $form['advanced_leaderboard'] = array('type' => 'textarea', 'value' => _gigParam($values, 'advanced_leaderboard', ''), 'label' => __('Additional Parameters (advanced) showLeaderboardUI'), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/040_GM/gm.showLeaderboardUI" target="_blank">' . __('parameters') . '</a>');
    $form['advanced_user_status'] = array('type' => 'textarea', 'value' => _gigParam($values, 'advanced_user_status', ''), 'label' => __('Additional Parameters (advanced) showUserStatusUI'), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/040_GM/gm.showUserStatusUI" target="_blank">' . __('parameters') . '</a>');
    $form['advanced_notification'] = array('type' => 'textarea', 'value' => _gigParam($values, 'advanced_notification', ''), 'label' => __('Additional Parameters (advanced) showNotifications'), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/040_GM/gm.showNotifications" target="_blank">' . __('parameters') . '</a>');
    // use this field in multisite to flag when sub site settings are saved locally for site
    if (is_multisite() && !$values['sub_site_settings_saved']) {
        $form['sub_site_settings_saved'] = array('type' => 'hidden', 'id' => 'sub_site_settings_saved', 'value' => 1, 'msg' => 1, 'msg_txt' => 'Settings are set to match the main site. once saved they will become independent', 'class' => 'gigya-raas-warn');
    }
    echo _gigya_form_render($form, GIGYA__SETTINGS_GM);
}
/**
 * Form builder for 'Reaction Settings' configuration page.
 */
function reactionsSettingsForm()
{
    $values = get_option(GIGYA__SETTINGS_REACTIONS);
    $form = array();
    $form['on'] = array('type' => 'checkbox', 'label' => __('Enable Reactions Plugin'), 'default' => 0, 'value' => _gigParamDefaultOn($values, 'on'));
    $form['position'] = array('type' => 'select', 'label' => __('Set the position of the Reactions in a post page'), 'options' => array("none" => __("None"), "bottom" => __("Bottom"), "top" => __("Top"), "both" => __("Both")), 'value' => _gigParam($values, 'position', 'none'), 'desc' => sprintf(__('You can also add and position Gigya Reactions using the %s settings page.'), '<a href="' . admin_url('widgets.php') . '">' . __('Widgets') . '</a>'));
    $form['enabledProviders'] = array('type' => 'text', 'label' => __('Providers'), 'value' => _gigParam($values, 'enabledProviders', '*'), 'desc' => __('Comma separated list of share providers to include. For example: facebook,twitter,linkedin. Leave empty or type * for all providers. See the entire list of available') . ' <a href="http://developers.gigya.com/020_Client_API/010_Socialize/socialize.showReactionsBarUI">Providers</a>');
    $form['showCounts'] = array('type' => 'select', 'label' => __('Show Counts'), 'options' => array("right" => __("Right"), "top" => __("Top"), "none" => __("None")), 'value' => _gigParam($values, 'showCounts', 'right'));
    $form['countType'] = array('type' => 'select', 'options' => array("number" => __("Number"), "percentage" => __("Percentage")), 'value' => _gigParam($values, 'countType', 'number'), 'label' => __('Count Type'));
    $form['layout'] = array('type' => 'select', 'label' => __('Layout'), 'options' => array("horizontal" => __("Horizontal"), "vertical" => __("Vertical")), 'value' => _gigParam($values, 'layout', 'horizontal'));
    $form['image'] = array('type' => 'checkbox', 'value' => _gigParam($values, 'image', 0), 'label' => __('Set image URL'), 'class' => 'conditional');
    $form['imageURL'] = array('type' => 'text', 'label' => __("Default URL of the image to share"), 'value' => _gigParam($values, 'imageURL', ''));
    $form['multipleReactions'] = array('type' => 'checkbox', 'label' => __('Allow multiple reactions'), 'value' => _gigParam($values, 'multipleReactions', 0));
    $form['buttons'] = array('type' => 'textarea', 'label' => __('Reaction Buttons'), 'value' => _gigParam($values, 'buttons', _gigya_get_json('admin/forms/json/default_reaction')), 'desc' => sprintf(__('Please enter an array of %s, representing the buttons to display in the Reactions bar.'), '<a href="http://developers.gigya.com/020_Client_API/010_Socialize/socialize.showReactionsBarUI#Reaction_Object">' . _('Reaction objects') . '</a>'));
    $form['advanced'] = array('type' => 'textarea', 'label' => __("Additional Parameters (advanced)"), 'value' => _gigParam($values, 'advanced', ''), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/010_Socialize/socialize.showReactionsBarUI" target="_blank">' . __('parameters') . '</a>');
    // use this field in multisite to flag when sub site settings are saved locally for site
    if (is_multisite() && !$values['sub_site_settings_saved']) {
        $form['sub_site_settings_saved'] = array('type' => 'hidden', 'id' => 'sub_site_settings_saved', 'value' => 1, 'msg' => 1, 'msg_txt' => 'Settings are set to match the main site. once saved they will become independent', 'class' => 'gigya-raas-warn');
    }
    echo _gigya_form_render($form, GIGYA__SETTINGS_REACTIONS);
}
/**
 * Form builder for 'Social Login Settings' configuration page.
 */
function loginSettingsForm()
{
    $values = get_option(GIGYA__SETTINGS_LOGIN);
    $roles = get_editable_roles();
    $form = array();
    $form['mode'] = array('type' => 'radio', 'options' => array('wp_only' => __('WordPress only'), 'wp_sl' => __('WordPress + Social Login <small class="gigya-raas-warn hidden">Warning: this site is configured on Gigya server to use Registration-as-a-Service. Please contact your Gigya account manager for migration instruction.</small>'), 'raas' => __('Registration-as-a-Service <small>Selecting this option overrides the WordPress user management system. This requires additional administration steps. Learn more <a href="http://developers.gigya.com//015_Partners/030_CMS_and_Ecommerce_Platforms/030_Wordpress_Plugin/020_RaaS">here</a></small>')), 'value' => _gigParam($values, 'mode', 'wp_only'), 'class' => 'raas_disabled');
    // check if raas is enabled, and add the raas_enabled class to the form mode element
    $c = new GigyaCMS();
    //	$is_raas = $c->isRaaS();
    $is_raas = $c->isRaaNotIds($values);
    if ($is_raas) {
        $form['mode']['class'] = 'raas_enabled';
    }
    $form['gl_start'] = array('markup' => '<div class="global-login-wrapper">');
    $form['connectWithoutLoginBehavior'] = array('type' => 'select', 'options' => array('alwaysLogin' => __('Always Login'), 'loginExistingUser' => __('Login Existing User')), 'value' => _gigParam($values, 'connectWithoutLoginBehavior', 'loginExistingUser'), 'label' => __('Connect Without Login Behavior'));
    $form['redirect'] = array('type' => 'text', 'label' => __('Post Login Redirect'), 'value' => _gigParam($values, 'redirect', ''), 'desc' => __('Provide a URL to which users are redirected after they log-in via Gigya. External URLs must include the protocol prefix ( usually: http:// or https:// ).'));
    $form['gl_end'] = array('markup' => '</div>');
    $form['sl_start'] = array('markup' => '<div class="social-login-wrapper">');
    $form['buttonsStyle'] = array('type' => 'select', 'options' => array('fullLogo' => __('Full Logo'), 'standard' => __('Standard'), 'signInWith' => __('Sign In With')), 'value' => _gigParam($values, 'buttonsStyle', 'fullLogo'), 'label' => __('Button Style'));
    $form['width'] = array('type' => 'text', 'label' => __('Width'), 'value' => _gigParam($values, 'width', 320), 'desc' => __('The width of the plugin in px'), 'class' => 'size');
    $form['height'] = array('type' => 'text', 'label' => __('Height'), 'value' => _gigParam($values, 'height', 100), 'desc' => __('The height of the plugin in px'), 'class' => 'size');
    $form['enabledProviders'] = array('type' => 'text', 'label' => __('Login Providers'), 'value' => _gigParam($values, 'enabledProviders', ''), 'desc' => __('Leave empty or type * for all providers or define specific providers, for example: facebook, twitter, google, linkedin'));
    $form['showTermsLink'] = array('type' => 'checkbox', 'label' => __('Show Terms Link'), 'value' => _gigParam($values, 'showTermsLink', 0));
    $form['registerExtra'] = array('type' => 'checkbox', 'label' => __('Show Complete Registration Form'), 'value' => _gigParam($values, 'registerExtra', 0), 'desc' => __("Check this checkbox if you have defined required fields in you site registration form. When checked a 'Complete Registration' form will pop up during user social registration, to let the user enter the missing required fields"));
    $form['advancedLoginUI'] = array('type' => 'textarea', 'label' => __("Additional Parameters (advanced) LoginUI"), 'value' => _gigParam($values, 'advancedLoginUI', ''), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/030_Gigya_Socialize_API_2.0/030_API_reference/010_Client_API_%28JavaScript%29/Social_service/Socialize.showLoginUI" target="_blank">' . __('parameters') . '</a>');
    $form['advancedAddConnectionsUI'] = array('type' => 'textarea', 'label' => __("Additional Parameters (advanced) AddConnectionsUI"), 'value' => _gigParam($values, 'advancedAddConnectionsUI', ''), 'desc' => sprintf(__('Enter valid %s. See list of available:'), '<a class="gigya-json-example" href="javascript:void(0)">' . __('JSON format') . '</a>') . ' <a href="http://developers.gigya.com/020_Client_API/020_Methods/socialize.showAddConnectionsUI" target="_blank">' . __('parameters') . '</a>');
    $form['map_social_title'] = array('markup' => __('<h4>Mapping Gigya User Fields to WordPress Fields</h4><p>Define which fields to map from Gigya to WordPress. The WordPress mapped target fields will be populated with data copied from the corresponding source fields. Learn more <a href="http://developers.gigya.com/015_Partners/030_CMS_and_Ecommerce_Platforms/030_Wordpress_Plugin#User_Management_Settings" target="_blank"/>here</a></p>'));
    $form['map_social_first_name'] = array('type' => 'checkbox', 'label' => __('First Name'), 'value' => _gigParam($values, 'map_social_first_name', 1));
    $form['map_social_last_name'] = array('type' => 'checkbox', 'label' => __('Last Name'), 'value' => _gigParam($values, 'map_social_last_name', 1));
    $form['map_social_display_name'] = array('type' => 'checkbox', 'label' => __('Display Name'), 'value' => _gigParam($values, 'map_social_display_name', 1));
    $form['map_social_nickname'] = array('type' => 'checkbox', 'label' => __('Nickname'), 'value' => _gigParam($values, 'map_social_nickname', 1));
    $form['map_social_profile_image'] = array('type' => 'checkbox', 'label' => __('Profile Image (avatar)'), 'value' => _gigParam($values, 'map_social_profile_image', 1));
    $form['map_social_description'] = array('type' => 'checkbox', 'label' => __('Biographical Info'), 'value' => _gigParam($values, 'map_social_description', 1));
    $form['sl_end'] = array('markup' => '</div>');
    $form['raas_start'] = array('markup' => '<div class="raas-login-wrapper">');
    $form['raas_txt'] = array('markup' => '<h4>Registration-as-a-Service Settings</h4><small><span>RaaS requires initial configuration in Gigya\'s Admin Console. Screen sets can be defined in the <a class="link-https" target="_blank" rel="external nofollow" href="https://platform.gigya.com/site/partners/Settings.aspx#cmd%3DUserManagement360.ScreenSets" title="https://platform.gigya.com/site/partners/Settings.aspx#cmd%3DUserManagement360.ScreenSets">UI Builder</a>. The page will display a list of predefined default screen-sets, each with an ID. Click on the "Visual Editor" link next to the screen-set that you want to use, this will open the <a class="external" target="_blank" title="010_Developer_Guide/10_UM360/040_Raas/020_UI_Builder#Visual_Editor" rel="internal" href="http://dev-wiki.gigya.com/010_Developer_Guide/10_UM360/040_Raas/020_UI_Builder#Visual_Editor">Visual Editor</a> window. You can modify the screens, or just hit the "Save" button to activate them. Please make sure that the screen-set IDs that are defined below match the IDs of the screen-sets you have configured in the <a class="link-https" target="_blank" rel="external nofollow" href="https://platform.gigya.com/site/partners/Settings.aspx#cmd%3DUserManagement360.ScreenSets" title="https://platform.gigya.com/site/partners/Settings.aspx#cmd%3DUserManagement360.ScreenSets">UI Builder</a> page.</span></small>');
    $form['raas_screens'] = array('markup' => '<h4>Login/Registration Screen Sets</h4>');
    $form['raasWebScreen'] = array('type' => 'text', 'label' => __('Web Screen Set ID'), 'value' => _gigParam($values, 'raasWebScreen', 'Default-RegistrationLogin'));
    $form['raasMobileScreen'] = array('type' => 'text', 'label' => __('Mobile Screen Set ID'), 'value' => _gigParam($values, 'raasMobileScreen', 'DefaultMobile-RegistrationLogin'));
    $form['raasLoginScreen'] = array('type' => 'text', 'label' => __('Login Screen ID'), 'value' => _gigParam($values, 'raasLoginScreen', 'gigya-login-screen'));
    $form['raasRegisterScreen'] = array('type' => 'text', 'label' => __('Register Screen ID'), 'value' => _gigParam($values, 'raasRegisterScreen', 'gigya-register-screen'));
    $form['raas_profile_screens'] = array('markup' => '<h4>Profile Screen Sets</h4>');
    $form['raasProfileWebScreen'] = array('type' => 'text', 'label' => __('Web Screen Set ID'), 'value' => _gigParam($values, 'raasProfileWebScreen', 'Default-ProfileUpdate'));
    $form['raasProfileMobileScreen'] = array('type' => 'text', 'label' => __('Mobile Screen Set ID'), 'value' => _gigParam($values, 'raasProfileMobileScreen', 'DefaultMobile-ProfileUpdate'));
    $form['raasOverrideLinks'] = array('type' => 'checkbox', 'label' => __('Override WordPress Link'), 'desc' => __('When checked, the WordPress default "Login", "Registration" and "Edit Profile" links pop-up RaaS screens instead of WordPress screens.'), 'value' => _gigParamDefaultOn($values, 'raasOverrideLinks'));
    $form['raas_divs'] = array('markup' => '<h4>DIV IDs</h4><small>' . __('Specify the DIV IDs in which to embed the screen-sets.') . '</small>');
    $form['raasLoginDiv'] = array('type' => 'text', 'label' => __('Login'), 'value' => _gigParam($values, 'raasLoginDiv', 'loginform'));
    $form['raasRegisterDiv'] = array('type' => 'text', 'label' => __('Register'), 'value' => _gigParam($values, 'raasRegisterDiv', 'registerform'));
    $form['raasProfileDiv'] = array('type' => 'text', 'label' => __('Profile'), 'value' => _gigParam($values, 'raasProfileDiv', 'profile-page'));
    $form['map_rass_title'] = array('markup' => __('<h4>Mapping Gigya User Fields to WordPress Fields</h4><p>Define which fields to map from Gigya to WordPress. The WordPress mapped target fields will be populated with data copied from the corresponding source fields. Learn more <a href="http://developers.gigya.com/015_Partners/030_CMS_and_Ecommerce_Platforms/030_Wordpress_Plugin#User_Management_Settings" target="_blank"/>here</a></p>'));
    $form['map_raas_first_name'] = array('type' => 'checkbox', 'label' => __('First Name'), 'value' => _gigParam($values, 'map_raas_first_name', 1));
    $form['map_raas_last_name'] = array('type' => 'checkbox', 'label' => __('Last Name'), 'value' => _gigParam($values, 'map_raas_last_name', 1));
    $form['map_raas_nickname'] = array('type' => 'checkbox', 'label' => __('Nickname'), 'value' => _gigParam($values, 'map_raas_nickname', 1));
    $form['map_raas_profile_image'] = array('type' => 'checkbox', 'label' => __('Profile image (avatar)'), 'value' => _gigParam($values, 'map_raas_profile_image', 1));
    $form['map_raas_description'] = array('type' => 'checkbox', 'label' => __('Biographical Info'), 'value' => _gigParam($values, 'map_raas_description', 1));
    $form['raas_admin_roles_title'] = array('markup' => __('<h4>Admin Login Roles</h4><p>Select below which <a target="_blank" href=http://codex.wordpress.org/Roles_and_Capabilities#Roles>Roles</a> should be permitted to login via the default WordPress login UI in /wp-login.php <br/>For more information, please refer to <a href="http://developers.gigya.com/015_Partners/030_CMS_and_Ecommerce_Platforms/030_Wordpress_Plugin/020_RaaS#Admin_Users.2C_Roles_.26_Permissions" target="_blank">Users, Roles & Permissions</a> section in Gigya documentation.</p>'));
    // create checkbox for each role in site (except admin & super admin)
    // Check/Uncheck all roles
    $form['raas_allowed_admin_checkall'] = array('type' => 'checkbox', 'label' => __('Check All'), 'value' => 0, 'class' => 'raas_allowed_admin_checkall');
    // create the roles checkboxes
    foreach ($roles as $role) {
        if ($role['name'] != "Administrator" && $role['name'] != "Super Admin" && $role['name'] != "Subscriber") {
            $settings_role_name = "raas_allowed_admin_{$role['name']}";
            $form[$settings_role_name] = array('type' => 'checkbox', 'label' => __($role['name']), 'value' => _DefaultAdminValue($values, $role['name'], $settings_role_name), 'class' => 'gigya_raas_allowed_admin_roles');
        }
    }
    // use this field in multisite to flag when sub site settings are saved locally for site
    if (is_multisite() && !$values['sub_site_settings_saved']) {
        $form['sub_site_settings_saved'] = array('type' => 'hidden', 'id' => 'sub_site_settings_saved', 'value' => 1, 'msg' => 1, 'msg_txt' => 'Settings are set to match the main site. once saved they will become independent', 'class' => 'gigya-raas-warn');
    }
    $form['raas_end'] = array('markup' => '</div>');
    echo _gigya_form_render($form, GIGYA__SETTINGS_LOGIN);
}
示例#9
0
 /**
  * Check if the comments plugin is on
  *
  * @return bool plugin on/off
  */
 public function gigya_comments_on()
 {
     $comments_options = get_option(GIGYA__SETTINGS_COMMENTS);
     $comments_on = _gigParamDefaultOn($comments_options, 'on');
     return !empty($comments_on) ? TRUE : FALSE;
 }