Skip to content

Delete Plugin Tables Function Help #13

Answered by alfredbuehler
aljawaid asked this question in Q&A
Discussion options

You must be logged in to vote

After analyzing things, my suggestion for the delete function looks like this:

public function deletePluginTables()
{
    $this->checkCSRFParam();

    // Pull variable from button
    $plugin_job_name = $this->request->getStringParam('plugin_job_name');
    $plugin_tables = [];

    // Match variable to json content
    foreach ($this->helper->pluginCleaningHelper->getDeletablePlugins() as $plugin) {
        if ($plugin['plugin_title'] === $plugin_job_name && isset($plugin['plugin_tables'])) {
            $plugin_tables = $plugin['plugin_tables'];
            break;
        }
    }

    // Delete the tables
    $success = true;
    foreach ($plugin_tables as $table) {
        if (!$this->a…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@aljawaid
Comment options

aljawaid May 12, 2023
Maintainer Author

@creecros
Comment options

@aljawaid
Comment options

aljawaid May 12, 2023
Maintainer Author

@creecros
Comment options

Comment options

You must be logged in to vote
5 replies
@aljawaid
Comment options

aljawaid May 12, 2023
Maintainer Author

@aljawaid
Comment options

aljawaid May 12, 2023
Maintainer Author

@aljawaid
Comment options

aljawaid Jul 6, 2023
Maintainer Author

@aljawaid
Comment options

aljawaid Jul 7, 2023
Maintainer Author

@aljawaid
Comment options

aljawaid Jul 10, 2023
Maintainer Author

Answer selected by aljawaid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed question Further information is requested
3 participants