Example #1
0
 public function admin_print_styles()
 {
     $screen = get_current_screen();
     if ('users-network' == $screen->base) {
         gPluginHTML::linkStyleSheet($this->constants['plugin_url'] . 'assets/css/network.admin.users.css', $this->constants['plugin_ver']);
     } else {
         if ('dashboard-network' == $screen->base) {
             gPluginHTML::linkStyleSheet($this->constants['plugin_url'] . 'assets/css/network.admin.dashboard.css', $this->constants['plugin_ver']);
         }
     }
 }
Example #2
0
 public static function selectAttachment($mime_type = '', $selected = NULL, $name = 'attach_id')
 {
     $attachments = get_posts(array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => NULL, 'post_mime_type' => $mime_type, 'post_parent' => NULL, 'orderby' => 'post_date', 'order' => 'DESC'));
     if ($attachments) {
         $html = '';
         if (is_null($selected) && isset($_REQUEST[$name])) {
             $selected = $_REQUEST[$name];
         }
         foreach ($attachments as $attachment) {
             $html .= gPluginHTML::tag('option', array('value' => $attachment->ID, 'selected' => $selected == $attachment->ID), esc_html(date_i18n(__('Y/m/j'), strtotime($attachment->post_date)) . ' — ' . $attachment->post_title));
         }
         echo gPluginHTML::tag('select', array('name' => $name), $html);
     }
     return $selected;
 }
Example #3
0
 public function admin_print_styles_settings()
 {
     if (strpos($_SERVER['REQUEST_URI'], 'page=' . $this->args['domain'])) {
         gPluginHTML::linkStyleSheet($this->constants['plugin_url'] . 'assets/css/' . $this->component . '.admin.settings.css', $this->constants['plugin_ver']);
     }
 }
Example #4
0
 public static function notice($notice, $class = 'notice-success fade', $echo = TRUE)
 {
     self::__dep('gPluginHTML::notice()');
     return gPluginHTML::notice($notice, $class, $echo);
 }
Example #5
0
 protected static function sendError($message)
 {
     wp_send_json_error(gPluginHTML::error($message));
 }
Example #6
0
 public static function updated($message)
 {
     self::__dep('self::success()');
     return gPluginHTML::success($message);
 }
Example #7
0
 public static function dropdown($list, $name, $prop = FALSE, $selected = 0, $none = FALSE, $none_val = 0, $obj = FALSE)
 {
     self::__dep('gPluginFormHelper::genDropdown()');
     $html = '';
     if ($none) {
         $html .= gPluginHTML::tag('option', array('value' => $none_val, 'selected' => $selected == $none_val), esc_html($none));
     }
     foreach ($list as $key => $item) {
         $html .= gPluginHTML::tag('option', array('value' => $key, 'selected' => $selected == $key), esc_html($prop ? $obj ? $item->{$prop} : $item[$prop] : $item));
     }
     return gPluginHTML::tag('select', array('id' => $name, 'name' => $name), $html);
 }
Example #8
0
 public function do_settings_field($atts)
 {
     $args = self::atts(array('title' => '', 'label_for' => '', 'type' => 'enabled', 'field' => FALSE, 'values' => array(), 'exclude' => '', 'none_title' => NULL, 'none_value' => NULL, 'filter' => FALSE, 'dir' => FALSE, 'default' => '', 'description' => isset($atts['desc']) ? $atts['desc'] : '', 'before' => '', 'after' => '', 'field_class' => '', 'class' => '', 'option_group' => $this->option_group, 'disabled' => FALSE, 'name_attr' => FALSE, 'id_attr' => FALSE, 'placeholder' => FALSE, 'constant' => FALSE, 'rekey' => FALSE), $atts);
     if ($args['rekey']) {
         self::__dep('gPluginUtils::sameKey()');
     }
     if (!$args['field']) {
         return;
     }
     $html = '';
     $value = isset($this->options[$args['field']]) ? $this->options[$args['field']] : $args['default'];
     $name = $args['name_attr'] ? $args['name_attr'] : $args['option_group'] . '[' . esc_attr($args['field']) . ']';
     $id = $args['id_attr'] ? $args['id_attr'] : $args['option_group'] . '-' . esc_attr($args['field']);
     $exclude = $args['exclude'] && !is_array($args['exclude']) ? array_filter(explode(',', $args['exclude'])) : array();
     if ($args['constant'] && defined($args['constant'])) {
         $value = constant($args['constant']);
         $args['disabled'] = TRUE;
         $args['after'] = '<code>' . $args['constant'] . '</code>';
     }
     if ($args['before']) {
         echo $args['before'] . '&nbsp;';
     }
     switch ($args['type']) {
         case 'hidden':
             echo gPluginHTML::tag('input', array('type' => 'hidden', 'name' => $name, 'id' => $id, 'value' => $value));
             $args['description'] = FALSE;
             break;
         case 'enabled':
             $html = gPluginHTML::tag('option', array('value' => '0', 'selected' => '0' == $value), isset($args['values'][0]) ? $args['values'][0] : esc_html__('Disabled'));
             $html .= gPluginHTML::tag('option', array('value' => '1', 'selected' => '1' == $value), isset($args['values'][1]) ? $args['values'][1] : esc_html__('Enabled'));
             echo gPluginHTML::tag('select', array('class' => $args['field_class'], 'name' => $name, 'id' => $id, 'dir' => $args['dir']), $html);
             break;
         case 'text':
             if (!$args['field_class']) {
                 $args['field_class'] = 'regular-text';
             }
             echo gPluginHTML::tag('input', array('type' => 'text', 'class' => $args['field_class'], 'name' => $name, 'id' => $id, 'value' => $value, 'dir' => $args['dir'], 'disabled' => $args['disabled'], 'placeholder' => $args['placeholder']));
             break;
         case 'number':
             if (!$args['field_class']) {
                 $args['field_class'] = 'small-text';
             }
             if (!$args['dir']) {
                 $args['dir'] = 'ltr';
             }
             echo gPluginHTML::tag('input', array('type' => 'number', 'class' => $args['field_class'], 'name' => $name, 'id' => $id, 'value' => $value, 'step' => '1', 'min' => '0', 'dir' => $args['dir'], 'disabled' => $args['disabled'], 'placeholder' => $args['placeholder']));
             break;
         case 'checkbox':
             if (count($args['values'])) {
                 if (!is_null($args['none_title'])) {
                     $html = gPluginHTML::tag('input', array('type' => 'checkbox', 'class' => $args['field_class'], 'name' => $name . (is_null($args['none_value']) ? '' : '-' . $args['none_value']), 'id' => $id . (is_null($args['none_value']) ? '' : '-' . $args['none_value']), 'value' => is_null($args['none_value']) ? '1' : $args['none_value'], 'checked' => in_array($args['none_value'], (array) $value), 'disabled' => $args['disabled'], 'dir' => $args['dir']));
                     echo '<p>' . gPluginHTML::tag('label', array('for' => $id . (is_null($args['none_value']) ? '' : '-' . $args['none_value'])), $html . '&nbsp;' . esc_html($args['none_title'])) . '</p>';
                 }
                 foreach ($args['values'] as $value_name => $value_title) {
                     if (in_array($value_name, $exclude)) {
                         continue;
                     }
                     $html = gPluginHTML::tag('input', array('type' => 'checkbox', 'class' => $args['field_class'], 'name' => $name . '[' . $value_name . ']', 'id' => $id . '-' . $value_name, 'value' => '1', 'checked' => in_array($value_name, (array) $value), 'disabled' => $args['disabled'], 'dir' => $args['dir']));
                     echo '<p>' . gPluginHTML::tag('label', array('for' => $id . '-' . $value_name), $html . '&nbsp;' . esc_html($value_title)) . '</p>';
                 }
             } else {
                 $html = gPluginHTML::tag('input', array('type' => 'checkbox', 'class' => $args['field_class'], 'name' => $name, 'id' => $id, 'value' => '1', 'checked' => $value, 'disabled' => $args['disabled'], 'dir' => $args['dir']));
                 echo '<p>' . gPluginHTML::tag('label', array('for' => $id), $html . '&nbsp;' . $args['description']) . '</p>';
                 $args['description'] = FALSE;
             }
             break;
         case 'radio':
             if (count($args['values'])) {
                 if (!is_null($args['none_title'])) {
                     $html = gPluginHTML::tag('input', array('type' => 'radio', 'class' => $args['field_class'], 'name' => $name, 'id' => $id . (is_null($args['none_value']) ? '' : '-' . $args['none_value']), 'value' => is_null($args['none_value']) ? FALSE : $args['none_value'], 'checked' => in_array($args['none_value'], (array) $value), 'disabled' => $args['disabled'], 'dir' => $args['dir']));
                     echo '<p>' . gPluginHTML::tag('label', array('for' => $id . (is_null($args['none_value']) ? '' : '-' . $args['none_value'])), $html . '&nbsp;' . esc_html($args['none_title'])) . '</p>';
                 }
                 foreach ($args['values'] as $value_name => $value_title) {
                     if (in_array($value_name, $exclude)) {
                         continue;
                     }
                     $html = gPluginHTML::tag('input', array('type' => 'radio', 'class' => $args['field_class'], 'name' => $name, 'id' => $id . '-' . $value_name, 'value' => $value_name, 'checked' => in_array($value_name, (array) $value), 'disabled' => $args['disabled'], 'dir' => $args['dir']));
                     echo '<p>' . gPluginHTML::tag('label', array('for' => $id . '-' . $value_name), $html . '&nbsp;' . esc_html($value_title)) . '</p>';
                 }
             }
             break;
         case 'select':
             if (FALSE !== $args['values']) {
                 // alow hiding
                 if (!is_null($args['none_title'])) {
                     $html .= gPluginHTML::tag('option', array('value' => is_null($args['none_value']) ? FALSE : $args['none_value'], 'selected' => $value == $args['none_value']), esc_html($args['none_title']));
                 }
                 foreach ($args['values'] as $value_name => $value_title) {
                     if (in_array($args['rekey'] ? $value_title : $value_name, $exclude)) {
                         continue;
                     }
                     $html .= gPluginHTML::tag('option', array('value' => $args['rekey'] ? $value_title : $value_name, 'selected' => $value == $value_name), esc_html($value_title));
                 }
                 echo gPluginHTML::tag('select', array('name' => $name, 'id' => $id, 'class' => $args['field_class'], 'disabled' => $args['disabled'], 'dir' => $args['dir']), $html);
             }
             break;
         case 'textarea':
             if (!$args['field_class']) {
                 $args['field_class'] = 'large-text';
             }
             echo gPluginHTML::tag('textarea', array('name' => $name, 'id' => $id, 'rows' => 5, 'cols' => 45, 'class' => $args['field_class'], 'disabled' => $args['disabled'], 'placeholder' => $args['placeholder']), $value);
             break;
         case 'button':
             echo get_submit_button($value, empty($args['field_class']) ? 'secondary' : $args['field_class'], $args['field'], FALSE, $args['values']);
             break;
         case 'file':
             echo gPluginHTML::tag('input', array('type' => 'file', 'name' => $id, 'id' => $id, 'class' => $args['field_class'], 'disabled' => $args['disabled'], 'dir' => $args['dir']));
             break;
         case 'posttypes':
             foreach (gPluginWPHelper::getPostTypes() as $value_name => $value_title) {
                 if (in_array($value_name, $exclude)) {
                     continue;
                 }
                 $html = gPluginHTML::tag('input', array('type' => 'checkbox', 'class' => $args['field_class'], 'name' => $name . '[' . $value_name . ']', 'id' => $id . '-' . $value_name, 'value' => '1', 'checked' => in_array($value_name, (array) $value), 'disabled' => $args['disabled'], 'dir' => $args['dir']));
                 echo '<p>' . gPluginHTML::tag('label', array('for' => $id . '-' . $value_name), $html . '&nbsp;' . esc_html($value_title)) . '</p>';
             }
             break;
         case 'custom':
             if (!is_array($args['values'])) {
                 echo $args['values'];
             } else {
                 echo $value;
             }
             break;
         case 'debug':
             gPluginUtils::dump($this->options);
             break;
         default:
             echo 'Error: setting type not defind';
     }
     if ($args['after']) {
         echo '&nbsp;' . $args['after'];
     }
     if ($args['description'] && FALSE !== $args['values']) {
         echo gPluginHTML::tag('p', array('class' => 'description'), $args['description']);
     }
 }
Example #9
0
 public function signup_form_shortcode($atts, $content = NULL, $tag = '')
 {
     global $current_site;
     if (!is_multisite()) {
         return $content;
     }
     if (is_page()) {
         $this->signup_form_page = get_page_link();
         // add_filter( 'wpmu_signup_user_notification_email', array( $this, 'wpmu_signup_user_notification_email' ), 10, 5 );
         add_filter('site_url', array($this, 'site_url'), 10, 4);
     }
     $args = shortcode_atts(array('class' => 'member-signup', 'title' => sprintf(__('Get your own %s account in seconds'), $current_site->site_name), 'title_wrap' => 'h3', 'field_wrap' => 'div', 'field_wrap_class' => 'member-signup-field', 'logged_in_redirect' => false, 'logged_in_text' => __('You are logged in already. No need to register again!'), 'disabled_redirect' => false, 'disabled_text' => __('Registration has been disabled.')), $atts, $tag);
     $labels = apply_filters('gmember_signup_form_labels', array('user_name' => __('Username:'******'user_email' => __('Email&nbsp;Address:'), 'user_pass' => __('Password:'******'submit' => __('Submit')), $args);
     $descriptions = apply_filters('gmember_signup_form_descriptions', array('user_name' => __('(Must be at least 4 characters, letters and numbers only.)'), 'user_email' => __('We send your registration email to this address. (Double-check your email address before continuing.)')), $args);
     if (isset($_GET['key']) || isset($_POST['key'])) {
         $key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
         $current = wpmu_activate_signup($key);
         if (is_wp_error($current)) {
             if ('already_active' == $current->get_error_code() || 'blog_taken' == $current->get_error_code()) {
                 $signup = $current->get_error_data();
                 $activate = gPluginHTML::tag($args['title_wrap'], array('class' => 'member-signup-title member-signup-activate-title'), __('Your account is now active!'));
                 $activate .= gPluginHTML::tag('p', array('class' => 'lead-in member-signup-activate-text'), '' == $signup->domain . $signup->path ? sprintf(__('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url('wp-login.php', 'login'), $signup->user_login, $signup->user_email, wp_lostpassword_url()) : sprintf(__('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url()));
                 defined('DONOTCACHEPAGE') or define('DONOTCACHEPAGE', true);
                 return gPluginHTML::tag('div', array('class' => $args['class'] . ' member-signup-activate'), $activate);
             } else {
                 $activate = gPluginHTML::tag($args['title_wrap'], array('class' => 'member-signup-title member-signup-activate-title member-signup-activate-error-title'), __('An error occurred during the activation'));
                 $activate .= gPluginHTML::tag('p', array('class' => 'member-signup-activate-error-text'), $current->get_error_message());
                 defined('DONOTCACHEPAGE') or define('DONOTCACHEPAGE', true);
                 return gPluginHTML::tag('div', array('class' => $args['class'] . ' member-signup-activate-error'), $activate);
             }
         } else {
             $user = get_userdata((int) $current['user_id']);
             $activate = gPluginHTML::tag($args['title_wrap'], array('class' => 'member-signup-title member-signup-activate-title'), __('Your account is now active!'));
             $welcome = '<p>' . gPluginHTML::tag('span', array('class' => 'h3'), $labels['user_name']);
             $welcome .= gPluginHTML::tag('span', array(), $user->user_login) . '</p>';
             $welcome .= '<p>' . gPluginHTML::tag('span', array('class' => 'h3'), $labels['user_pass']);
             $welcome .= gPluginHTML::tag('span', array(), $current['password']) . '</p>';
             $activate .= gPluginHTML::tag('div', array('id' => 'signup-welcome', 'class' => 'member-signup-activate-welcome'), $welcome);
             $url = get_blogaddress_by_id((int) $current['blog_id']);
             $activate .= gPluginHTML::tag('p', array('class' => 'view member-signup-activate-text'), $url != network_home_url('', 'http') ? sprintf(__('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>'), $url, $url . 'wp-login.php') : sprintf(__('Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.'), network_site_url('wp-login.php', 'login'), network_home_url()));
             defined('DONOTCACHEPAGE') or define('DONOTCACHEPAGE', true);
             return gPluginHTML::tag('div', array('class' => $args['class'] . ' member-signup-activate'), $activate);
         }
     }
     if (is_user_logged_in()) {
         if ($args['logged_in_redirect']) {
             wp_redirect($args['logged_in_redirect']);
             die;
         } else {
             $logged_in = gPluginHTML::tag('p', array('class' => 'member-signup-logged-in'), $args['logged_in_text']);
             return gPluginHTML::tag('div', array('class' => $args['class']), $logged_in);
         }
     }
     $active_signup = apply_filters('wpmu_active_signup', get_site_option('registration', 'all'));
     // return "all", "none", "blog" or "user"
     if ($active_signup == 'none') {
         if ($args['disabled_redirect']) {
             wp_redirect($args['disabled_redirect']);
             die;
         } else {
             $disabled = gPluginHTML::tag('p', array('class' => 'member-signup-disabled'), $args['logged_disabled']);
             return gPluginHTML::tag('div', array('class' => $args['class']), $disabled);
         }
     }
     $current = array('stage' => isset($_POST['stage']) ? $_POST['stage'] : 'default', 'user_name' => isset($_POST['user_name']) ? $_POST['user_name'] : '', 'user_email' => isset($_POST['user_email']) ? $_POST['user_email'] : '', 'errors' => new WP_Error());
     switch ($current['stage']) {
         case 'validate-user-signup':
             // removed beacause: the filter not checked wp nounce if its not on wp-signup.php and wp_die is not acceptable!
             remove_filter('wpmu_validate_user_signup', 'signup_nonce_check');
             if (wp_create_nonce('member_signup_form_' . $_POST['member_signup_form_id']) != $_POST['_member_signup_form']) {
                 $error = gPluginHTML::tag('p', array('class' => 'member-signup-error'), __('Please try again.'));
                 defined('DONOTCACHEPAGE') or define('DONOTCACHEPAGE', true);
                 return gPluginHTML::tag('div', array('class' => $args['class']), $error);
             }
             $current = array_merge($current, wpmu_validate_user_signup($current['user_name'], $current['user_email']));
             //$result = array('user_name' => $user_name, 'orig_username' => $orig_username, 'user_email' => $user_email, 'errors' => $errors);
             if (!$current['errors']->get_error_code()) {
                 wpmu_signup_user($current['user_name'], $current['user_email'], apply_filters('add_signup_meta', array()));
                 $confirm = gPluginHTML::tag($args['title_wrap'], array('class' => 'member-signup-title member-signup-title-confirm'), sprintf(__('%s is your new username'), $current['user_name']));
                 $confirm .= gPluginHTML::tag('p', array(), __('But, before you can start using your new username, <strong>you must activate it</strong>.'));
                 $confirm .= gPluginHTML::tag('p', array(), sprintf(__('Check your inbox at <strong>%s</strong> and click the link given.'), $current['user_email']));
                 $confirm .= gPluginHTML::tag('p', array(), __('If you do not activate your username within two days, you will have to sign up again.'));
                 ob_start();
                 do_action('signup_finished');
                 $confirm .= ob_get_clean();
                 defined('DONOTCACHEPAGE') or define('DONOTCACHEPAGE', true);
                 return gPluginHTML::tag('div', array('class' => $args['class'] . ' member-signup-confirm'), $confirm);
             }
     }
     $current = apply_filters('signup_user_init', $current);
     // allow definition of default variables
     ob_start();
     do_action('preprocess_signup_form');
     $pre = ob_get_clean();
     $header = gPluginHTML::tag($args['title_wrap'], array('class' => 'member-signup-title'), $args['title']);
     $fields_hidden = gPluginHTML::tag('input', array('type' => 'hidden', 'name' => 'stage', 'value' => 'validate-user-signup'), false);
     remove_action('signup_hidden_fields', 'signup_nonce_fields');
     $id_nonce = mt_rand();
     $fields_hidden .= gPluginHTML::tag('input', array('type' => 'hidden', 'name' => 'member_signup_form_id', 'value' => $id_nonce), false);
     $fields_hidden .= wp_nonce_field('member_signup_form_' . $id_nonce, '_member_signup_form', false, false);
     ob_start();
     do_action('signup_hidden_fields');
     $fields_hidden .= ob_get_clean();
     $field_user_name = gPluginHTML::tag('label', array('for' => 'user_name'), $labels['user_name']);
     if ($username_error = $current['errors']->get_error_message('user_name')) {
         $field_user_name .= gPluginHTML::tag('p', array('class' => 'error'), $username_error);
     }
     $field_user_name .= gPluginHTML::tag('input', array('name' => 'user_name', 'id' => 'user_name', 'class' => 'textInput', 'type' => 'text', 'value' => esc_attr($current['user_name']), 'maxlength' => '60'), false);
     if ($descriptions['user_name']) {
         $field_user_name .= gPluginHTML::tag('p', array('class' => 'description formHint'), $descriptions['user_name']);
     }
     $field_user_name = gPluginHTML::tag($args['field_wrap'], array('class' => $args['field_wrap_class'] . ' ctrlHolder'), $field_user_name);
     $field_user_email = gPluginHTML::tag('label', array('for' => 'user_email'), $labels['user_email']);
     if ($useremail_error = $current['errors']->get_error_message('user_email')) {
         $field_user_email .= gPluginHTML::tag('p', array('class' => 'error'), $useremail_error);
     }
     $field_user_email .= gPluginHTML::tag('input', array('name' => 'user_email', 'id' => 'user_email', 'class' => 'textInput', 'type' => 'text', 'value' => esc_attr($current['user_email']), 'maxlength' => '200'), false);
     if ($descriptions['user_email']) {
         $field_user_email .= gPluginHTML::tag('p', array('class' => 'description formHint'), $descriptions['user_email']);
     }
     $field_user_email = gPluginHTML::tag($args['field_wrap'], array('class' => $args['field_wrap_class'] . ' ctrlHolder'), $field_user_email);
     $user_email = gPluginHTML::tag('fieldset', array(), $field_user_name . $field_user_email);
     ob_start();
     do_action('signup_extra_fields', $current['errors'], $args);
     $fields_extra = ob_get_clean();
     $submit = gPluginHTML::tag('input', array('name' => 'submit', 'class' => 'primaryAction', 'type' => 'submit', 'value' => esc_attr($labels['submit'])), false);
     $submit = gPluginHTML::tag('p', array('class' => 'submit buttonHolder'), $submit);
     $form = gPluginHTML::tag('form', array('id' => 'member_signup_form', 'method' => 'post', 'class' => 'uniForm', 'action' => ''), $fields_hidden . $user_email . $fields_extra . $submit);
     defined('DONOTCACHEPAGE') or define('DONOTCACHEPAGE', true);
     return gPluginHTML::tag('div', array('class' => $args['class']), $pre . $header . $form);
 }
Example #10
0
 public function getIPLookup($ip)
 {
     if ($service = $this->settings->get('lookup_ip_service', 'http://freegeoip.net/?q=%s')) {
         return gPluginHTML::tag('a', array('href' => esc_url(sprintf($service, $ip)), 'class' => '-ip-lookup', 'target' => '_blank'), $ip);
     }
     return $ip;
 }
Example #11
0
 public function network_settings()
 {
     $uri = 'settings.php?page=' . $this->args['domain'];
     $sub = isset($_GET['sub']) ? trim($_GET['sub']) : 'general';
     $messages = $this->getFilters('network_settings_messages', array());
     $subs = $this->getFilters('network_settings_subs', array());
     $titles = $this->getFilters('network_settings_titles', array());
     echo '<div class="wrap -settings-wrap">';
     printf('<h1>%s</h1>', isset($titles['title']) ? $titles['title'] : $this->args['title']);
     gPluginFormHelper::headerNav($uri, $sub, $subs);
     if (!empty($_GET['message'])) {
         if (empty($messages[$_REQUEST['message']])) {
             gPluginHTML::notice($_REQUEST['message'], 'notice-error');
         } else {
             echo $messages[$_REQUEST['message']];
         }
         $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
     }
     if (file_exists($this->constants['plugin_dir'] . 'admin/network.' . $sub . '.php')) {
         require_once $this->constants['plugin_dir'] . 'admin/network.' . $sub . '.php';
     } else {
         do_action($this->args['domain'] . '_network_settings_sub_' . $sub, $uri, $sub);
     }
     echo '<div class="clear"></div></div>';
 }
Example #12
0
 public function admin_print_styles()
 {
     if (in_array(get_current_screen()->base, array('profile', 'user-edit'))) {
         gPluginHTML::linkStyleSheet($this->constants['plugin_url'] . 'assets/css/network.admin.profile.css', $this->constants['plugin_ver']);
     }
 }