/**
 * Form builder for 'Global Settings' configuration page.
 */
function globalSettingsForm()
{
    $values = _getGigyaSettingsValues(GIGYA__SETTINGS_GLOBAL);
    $form = array();
    $form['api_key'] = array('type' => 'text', 'label' => __('Gigya API Key'), 'value' => _gigParam($values, 'api_key', ''));
    if (current_user_can(GIGYA__SECRET_PERMISSION_LEVEL) || current_user_can(CUSTOM_GIGYA_EDIT_SECRET)) {
        $form['api_secret'] = array('type' => 'text', 'label' => __('Gigya Secret Key'), 'value' => _gigParam($values, 'api_secret', ''));
    } else {
        $form['api_secret'] = array('type' => 'customText', 'label' => __('Gigya Secret Key'), 'class' => 'secret_key_placeholder', 'id' => 'secret_key_placeholder');
    }
    $dataCenter = _gigParam($values, 'data_center', 'us1.gigya.com');
    $options = array('us1.gigya.com' => __('US Data Center'), 'eu1.gigya.com' => __('EU Data Center'), 'au1.gigya.com' => __('AU Data Center'), 'other' => __('Other'));
    if (!array_key_exists($dataCenter, $options)) {
        $dataCenter = "other";
    }
    $val = $dataCenter == "other" ? current(explode('.', $values['data_center'])) : "";
    $form['data_center'] = array('type' => 'select', 'options' => $options, 'label' => __('Data Center'), 'class' => 'data_center', 'value' => $dataCenter, 'markup' => "<span class='other_dataCenter'><input type='text' size='5' maxlength='5' class='input-xlarge' id='other_ds' name='other_ds' value='" . $val . "' /> <span>.gigya.com</span><p>Please specify the Gigya data center in which your site is defined. For example: 'EU1'. To verify your site location contact your Gigya implementation manager.</p></span>");
    $form['enabledProviders'] = array('type' => 'text', 'label' => __('List of providers'), 'value' => _gigParam($values, 'enabledProviders', '*'), 'desc' => __('Comma separated list of providers to include. For example: facebook,twitter,google. Leave empty or type * for all providers. See the entire list of available') . ' <a href="http://developers.gigya.com/020_Client_API/020_Methods/Socialize.showLoginUI">Providers</a>');
    $form['lang'] = array('type' => 'select', 'options' => array('en' => 'English', 'zh-cn' => 'Chinese', 'zh-hk' => 'Chinese (Hong Kong)', 'zh-tw' => 'Chinese (Taiwan)', 'cs' => 'Czech', 'da' => 'Danish', 'nl' => 'Dutch', 'fi' => 'Finnish', 'fr' => 'French', 'de' => 'German', 'el' => 'Greek', 'hu' => 'Hungarian', 'id' => 'Indonesian', 'it' => 'Italian', 'ja' => 'Japanese', 'ko' => 'Korean', 'ms' => 'Malay', 'no' => 'Norwegian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'pt-br' => 'Portuguese (Brazil)', 'ro' => 'Romanian', 'ru' => 'Russian', 'es' => 'Spanish', 'es-mx' => 'Spanish (Mexican)', 'sv' => 'Swedish', 'tl' => 'Tagalog (Philippines)', 'th' => 'Thai', 'tr' => 'Turkish', 'uk' => 'Ukrainian', 'vi' => 'Vietnamese'), 'value' => _gigParam($values, 'lang', 'en'), 'label' => __('Language'), 'desc' => __('Please select the interface language'));
    $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/030_API_reference/010_Client_API/010_Objects/Conf_object" target="_blank">' . __('parameters') . '</a>');
    $form['google_analytics'] = array('type' => 'checkbox', 'label' => __("Enable Google Social Analytics"), 'value' => _gigParam($values, 'google_analytics', 0));
    $form['debug'] = array('type' => 'checkbox', 'label' => __('Enable Gigya debug log'), 'value' => _gigParam($values, 'debug', 0), 'desc' => __('Log all Gigya\'s requests and responses. You can then find the log') . ' <a href="javascript:void(0)" class="gigya-debug-log">' . __('here') . '</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');
    }
    if (get_option('gigya_settings_fields')) {
        $form['clean_db'] = array('markup' => '<a href="javascript:void(0)" class="clean-db">Database cleaner after upgrade</a><br><small>Press this button to remove all unnecessary elements of the previous version from your database.Please make sure to backup your database before performing the clean. Learn more about upgrading from the previous version <a href="http://developers.gigya.com/015_Partners/030_CMS_and_Ecommerce_Platforms/030_Wordpress_Plugin#Installing_the_Gigya_WordPress_Plugin">here.</a></small>');
    }
    echo _gigya_form_render($form, GIGYA__SETTINGS_GLOBAL);
}
Esempio n. 2
0
 /**
  * Generate the parameters for the reactions-bar plugin.
  * @return array
  */
 public function getParams()
 {
     // The current post.
     global $post;
     // Set image path.
     $image_by = _gigParam($this->reactions_options, 'image', '0');
     if (!empty($image_by)) {
         $img = _gigParam($this->reactions_options, 'imageURL', get_bloginfo('wpurl') . '/' . WPINC . '/images/blank.gif');
     } else {
         $img = $this->getImage($post);
     }
     // Unique bar ID.
     $bar_id = 'bar-' . get_the_ID();
     // The parameters array.
     $params = array('barID' => $bar_id, 'layout' => _gigParam($this->reactions_options, 'layout', 'horizontal'), 'showCounts' => _gigParam($this->reactions_options, 'showCounts', 'right'), 'countType' => _gigParam($this->reactions_options, 'countType', 'right'), 'enabledProviders' => _gigParam($this->reactions_options, 'enabledProviders', 'reactions,facebook-like,google-plusone,twitter,email'), 'multipleReactions' => _gigParam($this->reactions_options, 'multipleReactions', 0), 'scope' => _gigParam($this->feed_options, 'scope', 'external'), 'privacy' => _gigParam($this->feed_options, 'privacy', 'private'), 'ua' => array('linkBack' => esc_url(apply_filters('the_permalink', get_permalink())), 'postTitle' => get_the_title(), 'postDesc' => _gigParam($post, 'post_excerpt', ''), 'imageURL' => $img));
     // Add reactions buttons parameters if exist.
     if (!empty($this->reactions_options['buttons'])) {
         $buttons = gigyaCMS::parseJSON(_gigParam($this->reactions_options, 'buttons', _gigya_get_json('admin/forms/json/default_reaction')));
         $params['reactions'] = $buttons;
     }
     // Add advanced parameters if exist.
     if (!empty($this->reactions_options['advanced'])) {
         $advanced = gigyaCMS::parseJSON(_gigParam($this->reactions_options, 'advanced', ''));
         $params = array_merge($params, $advanced);
     }
     // Let others plugins to modify the reactions parameters.
     $params = apply_filters('gigya_reactions_params', $params);
     return $params;
 }
Esempio n. 3
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;
 }
 /**
  * Back-end widget form.
  *
  * @see WP_Widget::form()
  *
  * @param array $instance Previously saved values from database.
  *
  * @return string|void
  */
 public function form($instance)
 {
     $form = array();
     $form[$this->get_field_id('title')] = array('type' => 'text', 'value' => esc_attr(_gigParam($instance, 'title', '')), 'label' => __('Title'), 'class' => 'size', 'name' => $this->get_field_name('title'));
     $form[$this->get_field_id('type')] = array('type' => 'select', 'options' => array('game' => 'Game status', 'challenge' => 'Challenge Status', 'leaderboard' => 'Leaderboard', 'achievements' => 'Achievements'), 'value' => esc_attr(_gigParam($instance, 'type', 'game')), 'label' => __('Type'), 'name' => $this->get_field_name('type'));
     $form[$this->get_field_id('width')] = array('type' => 'text', 'value' => esc_attr(_gigParam($instance, 'width', '200')), 'label' => __('Width'), 'class' => 'size', 'name' => $this->get_field_name('width'));
     echo _gigya_form_render($form);
 }
Esempio n. 5
0
 /**
  * Back-end widget form.
  *
  * @see WP_Widget::form()
  *
  * @param array $instance Previously saved values from database.
  *
  * @return string|void
  */
 public function form($instance)
 {
     $form = array();
     $form[$this->get_field_id('title')] = array('type' => 'text', 'value' => esc_attr(_gigParam($instance, 'title', '')), 'label' => __('Title'), 'class' => 'size', 'name' => $this->get_field_name('title'));
     $form[$this->get_field_id('override')] = array('type' => 'checkbox', 'value' => esc_attr(_gigParam($instance, 'override', '')), 'label' => __('Override'), 'class' => 'gigya-widget-override', 'name' => $this->get_field_name('override'));
     $form[$this->get_field_id('width')] = array('type' => 'text', 'value' => esc_attr(_gigParam($instance, 'width', '')), 'label' => __('Width'), 'class' => 'size', 'name' => $this->get_field_name('width'));
     $form[$this->get_field_id('height')] = array('type' => 'text', 'value' => esc_attr(_gigParam($instance, 'height', '')), 'label' => __('Height'), 'class' => 'size', 'name' => $this->get_field_name('height'));
     echo _gigya_form_render($form);
 }
 /**
  * Back-end widget form.
  *
  * @see WP_Widget::form()
  *
  * @param array $instance Previously saved values from database.
  *
  * @return string|void
  */
 public function form($instance)
 {
     $form = array();
     $form[$this->get_field_id('title')] = array('type' => 'text', 'value' => esc_attr(_gigParam($instance, 'title', '')), 'label' => __('Title'), 'class' => 'size', 'name' => $this->get_field_name('title'));
     $form[$this->get_field_id('override')] = array('type' => 'checkbox', 'value' => esc_attr(_gigParam($instance, 'override', '')), 'label' => __('Override'), 'class' => 'gigya-widget-override', 'name' => $this->get_field_name('override'));
     $form[$this->get_field_id('rating')] = array('type' => 'checkbox', 'label' => __('Rating Mode'), 'value' => esc_attr(_gigParam($instance, 'rating', 0)), 'name' => $this->get_field_name('rating'));
     $form[$this->get_field_id('categoryID')] = array('type' => 'text', 'label' => __('Category ID'), 'value' => esc_attr(_gigParam($instance, 'categoryID', '')), 'desc' => __("The category ID on 'Comments category name' at Gigya's settings") . ' ' . '<a href=https://platform.gigya.com/Site/partners/Settings.aspx#cmd=Settings.CommentsSetup>' . __('here') . '</a>', 'class' => 'size', 'name' => $this->get_field_name('categoryID'));
     echo _gigya_form_render($form);
 }
Esempio n. 7
0
 /**
  * Back-end widget form.
  *
  * @see WP_Widget::form()
  *
  * @param array $instance Previously saved values from database.
  *
  * @return string|void
  */
 public function form($instance)
 {
     $form = array();
     $form[$this->get_field_id('title')] = array('type' => 'text', 'value' => esc_attr(_gigParam($instance, 'title', '')), 'label' => __('Title'), 'class' => 'size', 'name' => $this->get_field_name('title'));
     $form[$this->get_field_id('override')] = array('type' => 'checkbox', 'value' => esc_attr(_gigParam($instance, 'override', '')), 'label' => __('Override'), 'class' => 'gigya-widget-override', 'name' => $this->get_field_name('override'));
     $form[$this->get_field_id('iconSize')] = array('type' => 'text', 'value' => esc_attr(_gigParam($instance, 'iconSize', 32)), 'label' => __('Icon size'), 'class' => 'size', 'name' => $this->get_field_name('iconSize'));
     $form[$this->get_field_id('layout')] = array('type' => 'select', 'options' => array('horizontal' => __('Horizontal'), 'vertical' => __('Vertical')), 'value' => esc_attr(_gigParam($instance, 'layout', 'horizontal')), 'label' => __('Layout'), 'class' => 'size', 'name' => $this->get_field_name('layout'));
     $form[$this->get_field_id('followButtons')] = array('type' => 'textarea', 'value' => _gigParam($instance, 'buttons', _gigya_get_json('admin/forms/json/default_follow')), 'label' => __('Follow Bar buttons'), '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>', 'name' => $this->get_field_name('buttons'), 'class' => 'json');
     echo _gigya_form_render($form);
 }
Esempio n. 8
0
 /**
  * Generate the parameters for the feed plugin.
  * @return array
  */
 public function getParams()
 {
     // The parameters array.
     $params = array('on' => _gigParam($this->follow_options, 'on', true), 'layout' => _gigParam($this->follow_options, 'layout', 'horizontal'), 'iconSize' => _gigParam($this->follow_options, 'iconSize', '32'), 'buttons' => _gigParam($this->follow_options, 'followButtons', _gigya_get_json('admin/forms/json/default_follow')));
     if (!empty($this->follow_options['advanced'])) {
         $params = array_merge($params, json_decode($this->follow_options['advanced'], true));
     }
     // Let others plugins to modify the comments parameters.
     $params = apply_filters('gigya_follow_params', $params);
     return $params;
 }
Esempio n. 9
0
 /**
  * Generate the parameters for the feed plugin.
  * @return array
  */
 public function getParams()
 {
     // The parameters array.
     $params = array('tabOrder' => _gigParam($this->feed_options, 'tabOrder', 'everyone,friends,me'), 'width' => _gigParam($this->feed_options, 'width', '170'), 'height' => _gigParam($this->feed_options, 'height', '270'), 'siteName' => get_option('blogname', ''));
     if (!empty($this->feed_options['advanced'])) {
         $params = array_merge($params, json_decode($this->feed_options['advanced'], true));
     }
     // Let others plugins to modify the comments parameters.
     $params = apply_filters('gigya_feed_params', $params);
     return $params;
 }
Esempio n. 10
0
/**
 * 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);
}
Esempio n. 11
0
 /**
  * Generate the parameters for the Comments plugin.
  * @return array
  */
 public function getParams()
 {
     $params = array('categoryID' => _gigParam($this->comments_options, 'categoryID', ''), 'rating' => _gigParam($this->comments_options, 'rating', 0), 'enabledShareProviders' => _gigParam($this->comments_options, 'enabledShareProviders', '*'), 'streamID' => get_the_ID(), 'scope' => _gigParam($this->feed_options, 'scope', 'external'), 'privacy' => _gigParam($this->feed_options, 'privacy', 'private'), 'version' => 2);
     if (!empty($this->comments_options['advanced'])) {
         $advanced = gigyaCMS::parseJSON(_gigParam($this->comments_options, 'advanced', ''));
         $params = array_merge($params, $advanced);
     }
     // Let other plugins modify the comments parameters.
     // For example:
     // $params['useSiteLogin'] = true;
     // $params['onSiteLoginClicked'] = 'onSiteLoginHandler';
     // To registering to the onSiteLoginClicked event.
     $params = apply_filters('gigya_comments_params', $params);
     return $params;
 }
 /**
  * Generate the parameters for the gamification plugin.
  * @return array
  */
 public function getParams($type)
 {
     // The parameters array.
     $params = array();
     if ($type == "leaderboard") {
         $params = array('period' => _gigParam($this->gm_options, 'period', '7days'), 'totalCount' => _gigParam($this->gm_options, 'totalCount', '12'));
     }
     $advanced = $this->getAdvancedConfig($type);
     if (!empty($advanced)) {
         $params = array_merge($params, $advanced);
     }
     // Let others plugins to modify the gamification parameters.
     $params = apply_filters('gigya_gamification_params', $params);
     return $params;
 }
/**
 * 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);
}
Esempio n. 14
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);
}
Esempio n. 15
0
/**
 * 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);
}
Esempio n. 16
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);
}
Esempio n. 17
0
 /**
  * Generate the parameters for the login plugin.
  * @return array
  */
 public function getParams()
 {
     // Parameters to be sent to the DOM.
     $params = array('actionLogin' => 'gigya_login', 'actionCustomLogin' => 'custom_login', 'redirect' => _gigParam($this->login_options, 'redirect', user_admin_url()));
     $params['ui'] = array();
     $params['ui']['showTermsLink'] = false;
     $params['ui']['version'] = 2;
     if (!empty($this->login_options['width'])) {
         $params['ui']['width'] = $this->login_options['width'];
     }
     if (!empty($this->login_options['height'])) {
         $params['ui']['height'] = $this->login_options['height'];
     }
     if (!empty($this->login_options['showTermsLink'])) {
         $params['ui']['showTermsLink'] = $this->login_options['showTermsLink'];
     }
     if (!empty($this->login_options['enabledProviders'])) {
         $params['ui']['enabledProviders'] = $this->login_options['enabledProviders'];
     }
     if (!empty($this->login_options['buttonsStyle'])) {
         $params['ui']['buttonsStyle'] = $this->login_options['buttonsStyle'];
     }
     if (!empty($this->login_options['advancedLoginUI'])) {
         $arr = gigyaCMS::parseJSON($this->login_options['advancedLoginUI']);
         if (!empty($arr)) {
             foreach ($arr as $key => $val) {
                 $params['ui'][$key] = $val;
             }
         }
     }
     if (!empty($this->login_options['advancedAddConnectionsUI'])) {
         $arr = gigyaCMS::parseJSON($this->login_options['advancedAddConnectionsUI']);
         if (!empty($arr)) {
             foreach ($arr as $key => $val) {
                 $params['addConnection'][$key] = $val;
             }
         }
     }
     // Let others plugins to modify the login parameters.
     $params = apply_filters('gigya_login_params', $params);
     return $params;
 }
/**
 * 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);
}
Esempio n. 19
0
 /**
  * Generate the parameters for the share-bar plugin.
  * @return array
  */
 public function getParams()
 {
     // The current post.
     global $post;
     // Set image path.
     $image_by = _gigParam($this->share_options, 'image', '0');
     if (!empty($image_by)) {
         $img = _gigParam($this->share_options, 'imageURL', get_bloginfo('wpurl') . '/' . WPINC . '/images/blank.gif');
     } else {
         $img = $this->getImage($post);
     }
     // The parameters array.
     $params = array('layout' => _gigParam($this->share_options, 'layout', 'horizontal'), 'showCounts' => _gigParam($this->share_options, 'showCounts', 'right'), 'shareButtons' => _gigParam($this->share_options, 'shareButtons', 'share,facebook-like,google-plusone,twitter,email'), 'shortURLs' => !empty($this->share_options['shortURLs']) ? 'always' : 'never', 'ua' => array('linkBack' => esc_url(apply_filters('the_permalink', get_permalink())), 'postTitle' => get_the_title(), 'postDesc' => _gigParam($post, 'post_excerpt', ''), 'imageURL' => $img));
     // Add advanced parameters if exist.
     if (!empty($this->share_options['advanced'])) {
         $advanced = gigyaCMS::parseJSON(_gigParam($this->share_options, 'advanced', ''));
         $params = array_merge($params, $advanced);
     }
     // Let others plugins to modify the share parameters.
     $params = apply_filters('gigya_share_params', $params);
     return $params;
 }
Esempio n. 20
0
/**
 * 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);
}
Esempio n. 21
0
 /**
  * Initialize hook.
  */
 public function init()
 {
     require_once GIGYA__PLUGIN_DIR . 'sdk/GSSDK.php';
     require_once GIGYA__PLUGIN_DIR . 'sdk/gigyaCMS.php';
     // Load jQuery and jQueryUI from WP.
     wp_enqueue_script('jquery');
     wp_enqueue_script('jquery-ui-core');
     wp_enqueue_script('jquery-ui-dialog');
     wp_enqueue_script('gigya_js', GIGYA__PLUGIN_URL . 'gigya.js');
     wp_enqueue_style('gigya_css', GIGYA__PLUGIN_URL . 'gigya.css');
     // Parameters to be sent to the DOM.
     $params = array('ajaxurl' => admin_url('admin-ajax.php'), 'logoutUrl' => wp_logout_url(), 'connectWithoutLoginBehavior' => _gigParam($this->login_options, 'connectWithoutLoginBehavior', 'loginExistingUser'), 'jsonExampleURL' => GIGYA__PLUGIN_URL . 'admin/forms/json/advance_example.json', 'enabledProviders' => _gigParam($this->global_options, 'enabledProviders', '*'), 'lang' => _gigParam($this->global_options, 'lang', 'en'), 'sessionExpiration' => gigyaSyncLoginSession());
     // Add advanced parameters if exist.
     if (!empty($this->global_options['advanced'])) {
         $advanced = gigyaCMS::parseJSON(_gigParam($this->global_options, 'advanced', ''));
         $params = array_merge($params, $advanced);
     }
     // Let others plugins to modify the global parameters.
     $params = apply_filters('gigya_global_params', $params);
     // Load params to be available to client-side script.
     wp_localize_script('gigya_js', 'gigyaParams', $params);
     // Checking that we have an API key and Gigya's plugin is turn on.
     $api_key = GIGYA__API_KEY;
     if (!empty($api_key)) {
         // Loads requirements for any Gigya's login.
         // Load Gigya's socialize.js from CDN.
         wp_enqueue_script('gigya_cdn', GIGYA__JS_CDN . GIGYA__API_KEY . '&lang=' . $params['lang']);
         // Loads requirements for any Gigya's social login.
         if ($this->login_options['mode'] == 'wp_sl') {
             require_once GIGYA__PLUGIN_DIR . 'features/login/GigyaLoginSet.php';
             $gigyaLoginSet = new GigyaLoginSet();
             $gigyaLoginSet->init();
         }
         // Loads requirements for any Gigya's RaaS login.
         if ($this->login_options['mode'] == 'raas') {
             // Loads RaaS links class.
             require_once GIGYA__PLUGIN_DIR . 'features/raas/GigyaRaasSet.php';
             $gigyaRaasSet = new GigyaRaasSet();
             $gigyaRaasSet->init();
         }
         // Loads requirements for any Gigya's Google-Analytics integration.
         if (!empty($this->global_options['google_analytics'])) {
             wp_enqueue_script('gigya_ga', GIGYA__CDN_PROTOCOL . '.gigya.com/js/gigyaGAIntegration.js');
         }
     }
     if (is_admin()) {
         // Loads requirements for the admin settings section.
         require_once GIGYA__PLUGIN_DIR . 'admin/admin.GigyaSettings.php';
         new GigyaSettings();
     }
 }
Esempio n. 22
0
 /**
  * Deal with missing fields on registration.
  */
 private function registerExtraForm()
 {
     // Set submit button value.
     $submit_value = sprintf(__('Register %s'), !empty($this->gigya_user['loginProvider']) ? ' ' . __('with') . ' ' . $this->gigya_user['loginProvider'] : '');
     $output = '';
     // Set form.
     $output .= '<form name="registerform" class="gigya-register-extra" id="registerform" action="' . wp_registration_url() . '" method="post">';
     $output .= '<h4 class="title">' . __('Please fill required field') . '</h4>';
     // Set form elements.
     $form = array();
     $form['user_login'] = array('type' => 'text', 'id' => 'user_login', 'label' => __('Username'), 'value' => _gigParam($this->gigya_user, 'nickname', ''));
     $form['user_email'] = array('type' => 'text', 'id' => 'user_email', 'label' => __('E-mail'), 'value' => _gigParam($this->gigya_user, 'email', ''));
     $form['form_name'] = array('type' => 'hidden', 'value' => 'registerform-gigya-extra');
     $form['gigyaUID'] = array('type' => 'hidden', 'value' => _gigParam($this->gigya_user, 'UID', ''));
     // Render form elements.
     $output .= _gigya_form_render($form);
     // Get other plugins register form implementation.
     do_action('register_form');
     $extra_fields = ob_get_clean();
     if (!empty($extra_fields)) {
         $output .= $extra_fields;
     }
     // Add submit button.
     $output .= '<input type="submit" id="gigya-submit" class="button button-primary button-large" value="' . $submit_value . '">';
     $output .= '</form>';
     // Tokens replace.
     do_shortcode($output);
     // Set a return array.
     $ret = array('type' => 'form', 'html' => $output);
     // Return JSON to client.
     wp_send_json_success($ret);
 }