Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-09-09 09:36:03

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 215
Website

[Solved] Extension tab not showing

This is a problem I can’t wrap my head around :

let’s say I write a plugin. It stays inside the plugin folder. Not compiled and saved to the DB yet.
Let’s say this plugin have an extension tab. Everything works fine as long as my plugin stays inside its folder.
As soon as this plugin is
1. compiled and uploaded to the DB
2. and removed from the plugin folder
3. and activated,
no more entry in the extension tab. And if I access the page through the direct url, I get a "get off my lawn" message.

This is the kind of code I use :

class MyPlugin
{
     public function __construct()
    {

        if (txpinterface == 'admin')
        {
          add_privs('abc_my_plugin', '1,2,3');
          register_tab('extensions', 'abc_my_plugin', 'My plugin');
          register_callback([$this, 'my_plugin_function'], 'abc_my_plugin');
        }
    }
// stuff here ..
}

new MyPlugin();

what do I do wrong ? This is driving me crazy. Would gladly use some help :)

Offline

#2 2016-09-09 09:44:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: [Solved] Extension tab not showing

Long shot: have you set the appropriate plugin type? Has to be 1 or 3+ for admin-side plugins.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2016-09-09 10:02:57

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 215
Website

Re: [Solved] Extension tab not showing

Very short indeed \0/ That was it.

Sometimes you need to read the fineprint in the template …

Thanks a lot

Offline

Board footer

Powered by FluxBB