|
|
|
|
@ -168,20 +168,16 @@ class AppPlugin { |
|
|
|
|
|
|
|
|
|
// Loading the plugin/XXX/index.php file |
|
|
|
|
$plugin_file = api_get_path(SYS_PLUGIN_PATH)."$plugin_name/index.php"; |
|
|
|
|
|
|
|
|
|
if (file_exists($plugin_file)) { |
|
|
|
|
require $plugin_file; |
|
|
|
|
|
|
|
|
|
//We set the $template variable in order to use smarty |
|
|
|
|
//We set the $template variable in order to use Smarty |
|
|
|
|
if (isset($_template) && !empty($_template)) { |
|
|
|
|
/* |
|
|
|
|
foreach ($_template as $key =>$value) { |
|
|
|
|
$template->assign($plugin_name[$key], $value); |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
$template->assign($plugin_name, $_template); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Loading the smarty template files if exists |
|
|
|
|
//Loading the Smarty template plugin files if exists |
|
|
|
|
$template_list = array(); |
|
|
|
|
if (isset($plugin_info) && isset($plugin_info['templates'])) { |
|
|
|
|
$template_list = $plugin_info['templates']; |
|
|
|
|
@ -205,8 +201,8 @@ class AppPlugin { |
|
|
|
|
* |
|
|
|
|
* Loads plugin info |
|
|
|
|
* @staticvar array $plugin_data |
|
|
|
|
* @param type $plugin_name |
|
|
|
|
* @param type bool |
|
|
|
|
* @param string plugin name |
|
|
|
|
* @param bool load from DB or from the static array |
|
|
|
|
* @todo filter setting_form |
|
|
|
|
* @return array |
|
|
|
|
*/ |
|
|
|
|
@ -220,7 +216,6 @@ class AppPlugin { |
|
|
|
|
if (file_exists($plugin_file)) { |
|
|
|
|
require $plugin_file; |
|
|
|
|
} |
|
|
|
|
$plugin_data[$plugin_name] = $plugin_info; |
|
|
|
|
|
|
|
|
|
//extra options |
|
|
|
|
$plugin_settings = api_get_settings_params(array("subkey = ? AND category = ? AND type = ? " => |
|
|
|
|
@ -230,6 +225,7 @@ class AppPlugin { |
|
|
|
|
$settings_filtered[$item['variable']] = $item['selected_value']; |
|
|
|
|
} |
|
|
|
|
$plugin_info['settings'] = $settings_filtered; |
|
|
|
|
$plugin_data[$plugin_name] = $plugin_info; |
|
|
|
|
return $plugin_info; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|