| @@ 207-224 (lines=18) @@ | ||
| 204 | } |
|
| 205 | ||
| 206 | // load all plugins execpt the plugins in setting["exclude_plugins"] |
|
| 207 | function loadPlugins() |
|
| 208 | { |
|
| 209 | $xoops_root_path = \XoopsBaseConfig::get('root-path'); |
|
| 210 | $plugins = array(); |
|
| 211 | $plugins_list = XoopsLists::getDirListAsArray( $xoops_root_path . $this->rootpath . "/plugins" ); |
|
| 212 | if (empty($this->setting["plugins"])) { |
|
| 213 | $plugins = $plugins_list; |
|
| 214 | } else { |
|
| 215 | $plugins = array_intersect(explode(",", $this->setting["plugins"]), $plugins_list); |
|
| 216 | } |
|
| 217 | if (!empty($this->setting["exclude_plugins"])) { |
|
| 218 | $plugins = array_diff($plugins, explode(",", $this->setting["exclude_plugins"])); |
|
| 219 | } |
|
| 220 | if (!empty($this->config["plugins"])) { |
|
| 221 | $plugins = array_merge($plugins, $this->config["plugins"]); |
|
| 222 | } |
|
| 223 | return $plugins; |
|
| 224 | } |
|
| 225 | ||
| 226 | // return all xoops plugins |
|
| 227 | function get_xoopsPlugins() { |
|
| @@ 223-240 (lines=18) @@ | ||
| 220 | * |
|
| 221 | * @return array plugins |
|
| 222 | */ |
|
| 223 | public function loadPlugins() |
|
| 224 | { |
|
| 225 | $plugins = array(); |
|
| 226 | $plugins_list = XoopsLists::getDirListAsArray(\XoopsBaseConfig::get('root-path') . $this->rootpath . "/plugins"); |
|
| 227 | if (empty($this->setting["plugins"])) { |
|
| 228 | $plugins = $plugins_list; |
|
| 229 | } else { |
|
| 230 | $plugins = array_intersect(explode(",", $this->setting["plugins"]), $plugins_list); |
|
| 231 | } |
|
| 232 | if (!empty($this->setting["exclude_plugins"])) { |
|
| 233 | $plugins = array_diff($plugins, explode(",", $this->setting["exclude_plugins"])); |
|
| 234 | } |
|
| 235 | if (!empty($this->config["plugins"])) { |
|
| 236 | $plugins = array_merge($plugins, $this->config["plugins"]); |
|
| 237 | } |
|
| 238 | ||
| 239 | return $plugins; |
|
| 240 | } |
|
| 241 | ||
| 242 | /** |
|
| 243 | * get_xoopsPlugins - return all xoops plugins |
|