Comments (6)
Hi
You might want to check out latest code. Plugin is now using hook
scenario and all plugin is stored on /application/plugins/.
There's some plugin example on the current code that might help you out.
from kalkun.
Thanks back2arie, but already look there and still feeling me a little lost.
Perhaps i don't explain correctly.
What i want to know is in what moment the entity "plugin" from DB Schema being update the field "plugin_status" with the installed plugins.
In my research i found in the file "application/models/plugin_model.php" and i found the function "getPluginStatus($name)". It's suppose this function check out plugin's status, but seem's don't work correctly because there isn't any record in the entity "plugin".
I only want to check if my plugin is loaded correctly to display (or not) some code, that's all.
Thansk in advance!
from kalkun.
I solved my problem, but i don't know if there is the best way, anyway i will try to explain what i done:
- Put the code below in the controller to check if the plugin is loaded:
/////////////////////////////////
// Inside the constructor put this
$this->load->model('Plugin_model', 'plugin_model');
/////////////////////////////////
.
.
.
/////////////////////////////////
// Inside the method who called the view put this
// Check if 'category_company' plugin is active
//
// Only plugins in the database are active ones
$encontrado = false;
$plugins = $this->plugin_model->get_plugins();
if ( $plugins->num_rows() > 0 ) {
foreach ($plugins->result() as $plugin) {
if($plugin->plugin_system_name == 'category_company') {
$encontrado = true;
}
}
}
// If found then make the dinamyc control
if($encontrado == true) {
// Options
$options = array('0' => 'Select a Company',
'1' => 'Option 1',
'2' => 'Option 2'
);
// Make select element and pass it throw the $data parameter
$data['category_company'] = form_dropdown('company', $options, '0');
}
// Pass the $data information to the view
$this->load->view($the_view, $data);
- Put the code below in the view to show/hide my select element
And that's all.
To try this only need to go to the item "plugin" from the menu and disable/enable the plugin.
I wonder if there is a better way to do the same without using the "Plugin_model", perhaps using a method in the plugin library ( I tried this using $plugins_active['plugin_system_name'] invoking the library from the constructor without lucky).
Thanks in advance!
from kalkun.
Hi
"application/models/plugin_model.php" is currently unused due the change of the plugin scenario.
To check whether plugin is already installed or not, you can do this ugly hack.
Add this function on "application/libraries/plugins.php":
function get_installed_plugin() { return Plugins::$plugins_active; }
And you can easily call it from your plugin.
from kalkun.
Or, even better:
function check_installed_plugin($name) { $installed_plugin = Plugins::$plugins_active; return array_key_exists($name, $installed_plugin); }
from kalkun.
Thanks back2arie :)
from kalkun.
Related Issues (20)
- White page after login even with last dev version HOT 1
- [request] LDAP auth HOT 1
- Kalkun doesnt load on Ubuntu 22.04 HOT 7
- Error on daemon.php with file_get_contents HOT 14
- REST_API - Missing or invalid default region HOT 4
- Phone format check error with 3 comma separated numbers HOT 4
- No available plugins HOT 2
- Not working Delivery report HOT 2
- rest_api plugin HOT 2
- Kalkun_API.php HOT 2
- Translation - norwegian HOT 3
- Possible XSS vulnerability HOT 1
- Blacklist plugin error HOT 4
- Error on the dashboard in "Gammu state" field HOT 2
- send sms from csv file HOT 4
- License issue: `GPL-3-or-later` not compatible with `GPL-2-only` HOT 2
- Distributed environment issue HOT 5
- A Database Error Occurred HOT 3
- Migrate away from CodeIgniter3, update to newer web standards
- Replace ci2 plugin system
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kalkun.