Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
page.

@author Vova Feldman (@svovaf)
@author Leo Fajardo (@leorw)
@since  1.1.2
352869
function _add_deactivation_feedback_dialog_box() {
            /* Check the type of user:
			 * 1. Long-term (long-term)
			 * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
			 * 3. Short-term (short-term)
			 */
            $is_long_term_user = true;

            // Check if the site is at least 2 days old.
            $time_installed = $this->_storage->install_timestamp;

            // Difference in seconds.
            $date_diff = time() - $time_installed;

            // Convert seconds to days.
            $date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) );

            if ( $date_diff_days < 2 ) {
                $is_long_term_user = false;
            }

            $is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user );

            if ( $is_long_term_user ) {
                $user_type = 'long-term';
            } else {
                if ( ! $this->is_registered() && ! $this->is_anonymous() ) {
                    $user_type = 'non-registered-and-non-anonymous-short-term';
                } else {
                    $user_type = 'short-term';
                }
            }

            $uninstall_reasons = $this->_get_uninstall_reasons( $user_type );

            // Load the HTML template for the deactivation feedback dialog box.
            $vars = array(
                'reasons' => $uninstall_reasons,
                'id'      => $this->_module_id
            );

            /**
             * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
             */
            fs_require_template( 'forms/deactivation/form.php', $vars );
        }
1016801
function add_plugin_action_link( $label, $url, $external = false, $priority = WP_FS__DEFAULT_PRIORITY, $key = false ) {
            $this->_logger->entrance();

            if ( ! isset( $this->_action_links[ $priority ] ) ) {
                $this->_action_links[ $priority ] = array();
            }

            if ( false === $key ) {
                $key = preg_replace( "/[^A-Za-z0-9 ]/", '', strtolower( $label ) );
            }

            $this->_action_links[ $priority ][] = array(
                'label'    => $label,
                'href'     => $url,
                'key'      => $key,
                'external' => $external
            );
        }
922193
function add_js( $type, $key, $src ) {
		$heading = Product::PLUGIN_TYPE === $type ? $this->heading_plugin : str_replace( '{theme}', $this->product->get_name(), $this->heading_theme );
		$key     = esc_attr( $key );
		$heading = apply_filters( $this->product->get_key() . '_feedback_deactivate_heading', $heading );
		?>
		<script type="text/javascript" id="ti-deactivate-js">
			(function ($) {
				$(document).ready(function () {
					var auto_trigger = false;
					var target_element = 'tr[data-plugin^="<?php echo $this->product->get_slug(); ?>/"] span.deactivate a';
					<?php
					if ( 'theme' === $type ) {
						?>
					auto_trigger = true;
					if ($('a.ti-auto-anchor').length == 0) {
						$('body').append($('<a class="ti-auto-anchor" href=""></a>'));
					}
					target_element = 'a.ti-auto-anchor';
						<?php
					}
					?>

					if (auto_trigger) {
						setTimeout(function () {
							$('a.ti-auto-anchor').trigger('click');
						}, <?php echo self::AUTO_TRIGGER_DEACTIVATE_WINDOW_SECONDS * 1000; ?> );
					}
					$(document).on('thickbox:removed', function () {
						$.post(ajaxurl, {
							'action': '<?php echo $key . '_uninstall_feedback'; ?>',
							'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
							'type': '<?php echo $type; ?>',
							'key': '<?php echo $key; ?>'
						});
					});
					var href = $(target_element).attr('href');
					$('#<?php echo $key; ?>ti-deactivate-no').attr('data-ti-action', href).on('click', function (e) {
						e.preventDefault();
						e.stopPropagation();

						$('body').unbind('thickbox:removed');
						tb_remove();
						var redirect = $(this).attr('data-ti-action');
						if (redirect !== '') {
							location.href = redirect;
						}
					});

					$('#<?php echo $key; ?> ul.ti-list label, #<?php echo $key; ?> ul.ti-list input[name="ti-deactivate-option"]').on('click', function (e) {
						$('#<?php echo $key; ?>ti-deactivate-yes').val($('#<?php echo $key; ?>ti-deactivate-yes').attr('data-after-text'));

						var radio = $(this).prop('tagName') === 'LABEL' ? $(this).parent() : $(this);
						if (radio.parent().find('textarea').length > 0 && radio.parent().find('textarea').val().length === 0) {
							$('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
							radio.parent().find('textarea').on('keyup', function (ee) {
								if ($(this).val().length === 0) {
									$('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
								} else {
									$('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
								}
							});
						} else {
							$('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
						}
					});
					$("#<?php echo $key; ?>-info-disclosure").on('click', function () {
						$("#TB_window").toggleClass("<?php echo $key; ?>-container-disc-open");
						return false;
					});
					$('#<?php echo $key; ?>ti-deactivate-yes').attr('data-ti-action', href).on('click', function (e) {
						e.preventDefault();
						e.stopPropagation();
						$.post(ajaxurl, {
							'action': '<?php echo $key . '_uninstall_feedback'; ?>',
							'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
							'id': $('#<?php echo $key; ?> input[name="ti-deactivate-option"]:checked').parent().attr('ti-option-id'),
							'msg': $('#<?php echo $key; ?> input[name="ti-deactivate-option"]:checked').parent().find('textarea').val(),
							'type': '<?php echo $type; ?>',
						});
						var redirect = $(this).attr('data-ti-action');
						if (redirect != '') {
							location.href = redirect;
						} else {
							$('body').unbind('thickbox:removed');
							tb_remove();
						}
					});

					$(target_element).attr('name', '<?php echo wp_kses( $heading, array( 'span' => array() ) ); ?>').attr('href', '<?php echo $src; ?>').addClass('thickbox');
					var thicbox_timer;
					$(target_element).on('click', function () {
						tiBindThickbox();
					});

					function tiBindThickbox() {
						var thicbox_timer = setTimeout(function () {
							if ($("#<?php echo esc_html( $key ); ?>").is(":visible")) {
								$("body").trigger('thickbox:iframe:loaded');
								$("#TB_window").addClass("<?php echo $key; ?>-container");
								clearTimeout(thicbox_timer);
								$('body').unbind('thickbox:removed');
							} else {
								tiBindThickbox();
							}
						}, 100);
					}
				});
			})(jQuery);
		</script>
		<?php

		do_action( $this->product->get_key() . '_uninstall_feedback_after_js' );
	}
709034
function() {
			this.writeDebug('modalWindow');

			if (this.settings.modal !== true) {
				return;
			}

			var _this = this;

			// Callback
			if (_this.settings.callbackModalOpen) {
				_this.settings.callbackModalOpen.call(this);
			}

			// Pop up the modal window
			$('.' + _this.settings.overlay).fadeIn();
			// Close modal when close icon is clicked and when background overlay is clicked
			$(document).on('click.'+pluginName, '.' + _this.settings.closeIcon + ', .' + _this.settings.overlay, function () {
				_this.modalClose();
			});
			// Prevent clicks within the modal window from closing the entire thing
			$(document).on('click.'+pluginName, '.' + _this.settings.modalWindow, function (e) {
				e.stopPropagation();
			});
			// Close modal when escape key is pressed
			$(document).on('keyup.'+pluginName, function (e) {
				if (e.keyCode === 27) {
					_this.modalClose();
				}
			});
		}
1059431
public function render_assign_feedback_plugin_feedback(assign_feedback_plugin_feedback $feedbackplugin) {
        $o = '';

        if ($feedbackplugin->view == assign_feedback_plugin_feedback::SUMMARY) {
            $showviewlink = false;
            $summary = $feedbackplugin->plugin->view_summary($feedbackplugin->grade, $showviewlink);

            $classsuffix = $feedbackplugin->plugin->get_subtype() .
                           '_' .
                           $feedbackplugin->plugin->get_type() .
                           '_' .
                           $feedbackplugin->grade->id;
            $o .= $this->output->box_start('boxaligncenter plugincontentsummary summary_' . $classsuffix);

            $link = '';
            if ($showviewlink) {
                $previewstr = get_string('viewfeedback', 'assign');
                $icon = $this->output->pix_icon('t/preview', $previewstr);

                $expandstr = get_string('viewfull', 'assign');
                $options = array('class'=>'expandsummaryicon expand_' . $classsuffix);
                $o .= $this->output->pix_icon('t/switch_plus', $expandstr, null, $options);

                $jsparams = array($feedbackplugin->plugin->get_subtype(),
                                  $feedbackplugin->plugin->get_type(),
                                  $feedbackplugin->grade->id);
                $this->page->requires->js_init_call('M.mod_assign.init_plugin_summary', $jsparams);

                $urlparams = array('id' => $feedbackplugin->coursemoduleid,
                                   'gid'=>$feedbackplugin->grade->id,
                                   'plugin'=>$feedbackplugin->plugin->get_type(),
                                   'action'=>'viewplugin' . $feedbackplugin->plugin->get_subtype(),
                                   'returnaction'=>$feedbackplugin->returnaction,
                                   'returnparams'=>http_build_query($feedbackplugin->returnparams));
                $url = new moodle_url('/mod/assign/view.php', $urlparams);
                $link .= '<noscript>';
                $link .= $this->output->action_link($url, $icon);
                $link .= '</noscript>';

                $link .= $this->output->spacer(array('width'=>15));
            }

            $o .= $link . $summary;
            $o .= $this->output->box_end();
            if ($showviewlink) {
                $o .= $this->output->box_start('boxaligncenter hidefull full_' . $classsuffix);
                $classes = 'expandsummaryicon contract_' . $classsuffix;
                $o .= $this->output->pix_icon('t/switch_minus',
                                              get_string('viewsummary', 'assign'),
                                              null,
                                              array('class'=>$classes));
                $o .= $feedbackplugin->plugin->view($feedbackplugin->grade);
                $o .= $this->output->box_end();
            }
        } else if ($feedbackplugin->view == assign_feedback_plugin_feedback::FULL) {
            $o .= $this->output->box_start('boxaligncenter feedbackfull');
            $o .= $feedbackplugin->plugin->view($feedbackplugin->grade);
            $o .= $this->output->box_end();
        }

        return $o;
    }
214752
def _post_activate_injection(self):
        
        self.active = True
        self.app.signals.send("plugin_activate_post", self)
296524
function(e) {
            // show menu
            var $this = $(this);
            if ($this.data('contextMenuActive') && $currentTrigger && $currentTrigger.length && $currentTrigger.is($this) && !$this.hasClass('context-menu-disabled')) {
                e.preventDefault();
                e.stopImmediatePropagation();
                $currentTrigger = $this;
                $this.trigger($.Event("contextmenu", { data: e.data, pageX: e.pageX, pageY: e.pageY }));
            }
            
            $this.removeData('contextMenuActive');
        }
1271282
function preferencesDialog_close(saveChanges) {
    saveChanges = (saveChanges == undefined) ? false : saveChanges;

    var button = this.getElement({type: "button", subtype: (saveChanges ? "accept" : "cancel")});
    this._controller.click(button);
  }
617788
function Plugin() {
    this.each(function () {
      var $this = $(this);
      var data = $this.data('bui.disable');

      if (!data) {
        data = new Disable($this);
        $this.data('bui.disable', data);
      }

      data.toggle();
    });

    return this;
  }
136516
def closing_plugin(self, cancelable=False):
        """"""
        self.mainwindow_close = True
        for client in self.clients:
            client.shutdown()
            client.remove_stderr_file()
            client.dialog_manager.close_all()
            client.close()
        return True
1028199
public function _after_site_deactivated_callback( $context_blog_id = 0 ) {
            $this->_logger->entrance();

            $install = $this->get_install_by_blog_id( $context_blog_id );

            if ( ! is_object( $install ) ) {
                // Site not connected.
                return;
            }

            $this->update_multisite_data_after_site_deactivation( $context_blog_id );

            $current_blog_id = get_current_blog_id();

            $this->switch_to_blog( $context_blog_id );

            // Send deactivation event.
            $this->sync_install( array(
                'is_active' => false,
            ) );

            $this->switch_to_blog( $current_blog_id );
        }
544399
def togglePopup(self):
        
        if not self._popupWidget.isVisible():
            self.showPopup()
        elif self._popupWidget.currentMode() != self._popupWidget.Mode.Dialog:
            self._popupWidget.close()
1234567
function _add_connectivity_issue_message( $api_result, $is_first_failure = true ) {
            if ( ! $this->is_premium() && $this->_enable_anonymous ) {
                // Don't add message if it's the free version and can run anonymously.
                return;
            }

            if ( ! function_exists( 'wp_nonce_url' ) ) {
                require_once ABSPATH . 'wp-includes/functions.php';
            }

            $current_user = self::_get_current_wp_user();
//			$admin_email = get_option( 'admin_email' );
            $admin_email = $current_user->user_email;

            // Aliases.
            $deactivate_plugin_title = $this->esc_html_inline( 'That\'s exhausting, please deactivate', 'deactivate-plugin-title' );
            $deactivate_plugin_desc  = $this->esc_html_inline( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'deactivate-plugin-desc' );
            $install_previous_title  = $this->esc_html_inline( 'Let\'s try your previous version', 'install-previous-title' );
            $install_previous_desc   = $this->esc_html_inline( 'Uninstall this version and install the previous one.', 'install-previous-desc' );
            $fix_issue_title         = $this->esc_html_inline( 'Yes - I\'m giving you a chance to fix it', 'fix-issue-title' );
            $fix_issue_desc          = $this->esc_html_inline( 'We will do our best to whitelist your server and resolve this issue ASAP. You will get a follow-up email to %s once we have an update.', 'fix-issue-desc' );
            /* translators: %s: product title (e.g. "Awesome Plugin" requires an access to...) */
            $x_requires_access_to_api    = $this->esc_html_inline( '%s requires an access to our API.', 'x-requires-access-to-api' );
            $sysadmin_title              = $this->esc_html_inline( 'I\'m a system administrator', 'sysadmin-title' );
            $happy_to_resolve_issue_asap = $this->esc_html_inline( 'We are sure it\'s an issue on our side and more than happy to resolve it for you ASAP if you give us a chance.', 'happy-to-resolve-issue-asap' );

            $message = false;
            if ( is_object( $api_result ) &&
                 isset( $api_result->error ) &&
                 isset( $api_result->error->code )
            ) {
                switch ( $api_result->error->code ) {
                    case 'curl_missing':
                        $missing_methods = '';
                        if ( is_array( $api_result->missing_methods ) &&
                             ! empty( $api_result->missing_methods )
                        ) {
                            foreach ( $api_result->missing_methods as $m ) {
                                if ( 'curl_version' === $m ) {
                                    continue;
                                }

                                if ( ! empty( $missing_methods ) ) {
                                    $missing_methods .= ', ';
                                }

                                $missing_methods .= sprintf( '<code>%s</code>', $m );
                            }

                            if ( ! empty( $missing_methods ) ) {
                                $missing_methods = sprintf(
                                    '<br><br><b>%s</b> %s',
                                    $this->esc_html_inline( 'Disabled method(s):', 'curl-disabled-methods' ),
                                    $missing_methods
                                );
                            }
                        }

                        $message = sprintf(
                            $x_requires_access_to_api . ' ' .
                            $this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . ' ' .
                            $missing_methods .
                            ' %s',
                            '<b>' . $this->get_plugin_name() . '</b>',
                            sprintf(
                                '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
                                sprintf(
                                    '<a class="fs-resolve" data-type="curl" href="#"><b>%s</b></a>%s',
                                    $this->get_text_inline( 'I don\'t know what is cURL or how to install it, help me!', 'curl-missing-no-clue-title' ),
                                    ' - ' . sprintf(
                                        $this->get_text_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'curl-missing-no-clue-desc' ),
                                        '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
                                    )
                                ),
                                sprintf(
                                    '<b>%s</b> - %s',
                                    $sysadmin_title,
                                    esc_html( sprintf( $this->get_text_inline( 'Great, please install cURL and enable it in your php.ini file. In addition, search for the \'disable_functions\' directive in your php.ini file and remove any disabled methods starting with \'curl_\'. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the %s and reactivate it back again.', 'curl-missing-sysadmin-desc' ), $this->get_module_label( true ) ) )
                                ),
                                sprintf(
                                    '<a href="%s"><b>%s</b></a> - %s',
                                    wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $this->_plugin_basename ),
                                    $deactivate_plugin_title,
                                    $deactivate_plugin_desc
                                )
                            )
                        );
                        break;
                    case 'cloudflare_ddos_protection':
                        $message = sprintf(
                            $x_requires_access_to_api . ' ' .
                            $this->esc_html_inline( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'cloudflare-blocks-connection-message' ) . ' ' .
                            $happy_to_resolve_issue_asap .
                            ' %s',
                            '<b>' . $this->get_plugin_name() . '</b>',
                            sprintf(
                                '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
                                sprintf(
                                    '<a class="fs-resolve" data-type="cloudflare" href="#"><b>%s</b></a>%s',
                                    $fix_issue_title,
                                    ' - ' . sprintf(
                                        $fix_issue_desc,
                                        '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
                                    )
                                ),
                                sprintf(
                                    '<a href="%s" target="_blank"><b>%s</b></a> - %s',
                                    sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
                                    $install_previous_title,
                                    $install_previous_desc
                                ),
                                sprintf(
                                    '<a href="%s"><b>%s</b></a> - %s',
                                    wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=' . '', 'deactivate-plugin_' . $this->_plugin_basename ),
                                    $deactivate_plugin_title,
                                    $deactivate_plugin_desc
                                )
                            )
                        );
                        break;
                    case 'squid_cache_block':
                        $message = sprintf(
                            $x_requires_access_to_api . ' ' .
                            $this->esc_html_inline( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.', 'squid-blocks-connection-message' ) .
                            ' %s',
                            '<b>' . $this->get_plugin_name() . '</b>',
                            sprintf(
                                '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
                                sprintf(
                                    '<a class="fs-resolve" data-type="squid" href="#"><b>%s</b></a> - %s',
                                    $this->esc_html_inline( 'I don\'t know what is Squid or ACL, help me!', 'squid-no-clue-title' ),
                                    sprintf(
                                        $this->esc_html_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'squid-no-clue-desc' ),
                                        '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
                                    )
                                ),
                                sprintf(
                                    '<b>%s</b> - %s',
                                    $sysadmin_title,
                                    sprintf(
                                        $this->esc_html_inline( 'Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again.', 'squid-sysadmin-desc' ),
                                        // We use a filter since the plugin might require additional API connectivity.
                                        '<b>' . implode( ', ', $this->apply_filters( 'api_domains', array(
                                            'api.freemius.com',
                                            'wp.freemius.com'
                                        ) ) ) . '</b>',
                                        $this->_module_type
                                    )
                                ),
                                sprintf(
                                    '<a href="%s"><b>%s</b></a> - %s',
                                    wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $this->_plugin_basename ),
                                    $deactivate_plugin_title,
                                    $deactivate_plugin_desc
                                )
                            )
                        );
                        break;
//					default:
//						$message = $this->get_text_inline( 'connectivity-test-fails-message' );
//						break;
                }
            }

            $message_id = 'failed_connect_api';
            $type       = 'error';

            $connectivity_test_fails_message = $this->esc_html_inline( 'From unknown reason, the API connectivity test failed.', 'connectivity-test-fails-message' );

            if ( false === $message ) {
                if ( $is_first_failure ) {
                    // First attempt failed.
                    $message = sprintf(
                        $x_requires_access_to_api . ' ' .
                        $connectivity_test_fails_message . ' ' .
                        $this->esc_html_inline( 'It\'s probably a temporary issue on our end. Just to be sure, with your permission, would it be o.k to run another connectivity test?', 'connectivity-test-maybe-temporary' ) . '<br><br>' .
                        '%s',
                        '<b>' . $this->get_plugin_name() . '</b>',
                        sprintf(
                            '<div id="fs_firewall_issue_options">%s %s</div>',
                            sprintf(
                                '<a  class="button button-primary fs-resolve" data-type="retry_ping" href="#">%s</a>',
                                $this->get_text_inline( 'Yes - do your thing', 'yes-do-your-thing' )
                            ),
                            sprintf(
                                '<a href="%s" class="button">%s</a>',
                                wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $this->_plugin_basename ),
                                $this->get_text_inline( 'No - just deactivate', 'no-deactivate' )
                            )
                        )
                    );

                    $message_id = 'failed_connect_api_first';
                    $type       = 'promotion';
                } else {
                    // Second connectivity attempt failed.
                    $message = sprintf(
                        $x_requires_access_to_api . ' ' .
                        $connectivity_test_fails_message . ' ' .
                        $happy_to_resolve_issue_asap .
                        ' %s',
                        '<b>' . $this->get_plugin_name() . '</b>',
                        sprintf(
                            '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
                            sprintf(
                                '<a class="fs-resolve" data-type="general" href="#"><b>%s</b></a>%s',
                                $fix_issue_title,
                                ' - ' . sprintf(
                                    $fix_issue_desc,
                                    '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
                                )
                            ),
                            sprintf(
                                '<a href="%s" target="_blank"><b>%s</b></a> - %s',
                                sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
                                $install_previous_title,
                                $install_previous_desc
                            ),
                            sprintf(
                                '<a href="%s"><b>%s</b></a> - %s',
                                wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=all&amp;paged=1&amp;s=', 'deactivate-plugin_' . $this->_plugin_basename ),
                                $deactivate_plugin_title,
                                $deactivate_plugin_desc
                            )
                        )
                    );
                }
            }

            $this->_admin_notices->add_sticky(
                $message,
                $message_id,
                $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
                $type
            );
        }
1171359
function post_deactivate() {
		check_ajax_referer( (string) __CLASS__, 'nonce' );

		$this->post_deactivate_or_cancel();

		if ( empty( $_POST['id'] ) ) {

			wp_send_json( [] );

			return;
		}
		$this->call_api(
			array(
				'type'    => 'deactivate',
				'id'      => $_POST['id'],
				'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
			)
		);
		wp_send_json( [] );

	}
510499
public function onBulkAction()
    {
        if (($bulkAction = post('action')) &&
            ($checkedIds = post('checked')) &&
            is_array($checkedIds) &&
            count($checkedIds)
        ) {
            $manager = PluginManager::instance();

            foreach ($checkedIds as $pluginId) {
                if (!$plugin = PluginVersion::find($pluginId)) {
                    continue;
                }

                $savePlugin = true;
                switch ($bulkAction) {
                    // Enables plugin's updates.
                    case 'freeze':
                        $plugin->is_frozen = 1;
                        break;

                    // Disables plugin's updates.
                    case 'unfreeze':
                        $plugin->is_frozen = 0;
                        break;

                    // Disables plugin on the system.
                    case 'disable':
                        $plugin->is_disabled = 1;
                        $manager->disablePlugin($plugin->code, true);
                        break;

                    // Enables plugin on the system.
                    case 'enable':
                        $plugin->is_disabled = 0;
                        $manager->enablePlugin($plugin->code, true);
                        break;

                    // Rebuilds plugin database migrations.
                    case 'refresh':
                        $savePlugin = false;
                        $manager->refreshPlugin($plugin->code);
                        break;

                    // Rollback and remove plugins from the system.
                    case 'remove':
                        $savePlugin = false;
                        $manager->deletePlugin($plugin->code);
                        break;
                }

                if ($savePlugin) {
                    $plugin->save();
                }
            }
        }

        Flash::success(Lang::get("system::lang.plugins.{$bulkAction}_success"));
        return $this->listRefresh('manage');
    }
1361953
public function deactivateAction()
    {
        $user           = $this->auth->getUser();

        $jobEntity = $this->initializeJob()->get($this->params());

        try {
            $jobEntity->changeStatus(Status::INACTIVE, sprintf(/*@translate*/ "Job was deactivated by %s", $user->getInfo()->getDisplayName()));
            $this->notification()->success(/*@translate*/ 'Job has been deactivated');
        } catch (\Exception $e) {
            $this->notification()->danger(/*@translate*/ 'Job could not be deactivated');
        }
        exit;
        return $this->save(array('page' => 2));
    }
630864
function() {
			var self = this;
			var content;

			content = '<div class="modaal-content-container">' +
					'<h1 id="modaal-title">' + self.options.confirm_title + '</h1>' +
					'<div class="modaal-confirm-content">' + self.options.confirm_content + '</div>' +
						'<div class="modaal-confirm-wrap">' +
							'<button type="button" class="modaal-confirm-btn modaal-ok" aria-label="Confirm">' + self.options.confirm_button_text + '</button>' +
							'<button type="button" class="modaal-confirm-btn modaal-cancel" aria-label="Cancel">' + self.options.confirm_cancel_button_text + '</button>' +
						'</div>' +
					'</div>' +
				'</div>';

			// now push content into markup
			self.build_modal(content);
		}