本文整理汇总了PHP中Plugins::get_plugins方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugins::get_plugins方法的具体用法?PHP Plugins::get_plugins怎么用?PHP Plugins::get_plugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins
的用法示例。
在下文中一共展示了Plugins::get_plugins方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayPlugins
function displayPlugins($location)
{
global $pluginForm;
$allPlugins = Plugins::get_plugins();
$pluginNames = array();
$pluginHandler = array();
$pluginHeadings = array("All Plugins");
foreach ($allPlugins as $id => $value) {
$curPlugin = new Plugins($id);
if ($curPlugin->get_location() == $location && $curPlugin->get_enabled() == true) {
if ($curPlugin->get_icon_path() != "NONE") {
$iconPath = str_replace(" ", "%20", $curPlugin->get_icon_path());
array_push($pluginNames, "<img class='plugIcon' src='" . $iconPath . "'></img>" . $curPlugin->get_name());
} else {
array_push($pluginNames, $curPlugin->get_name());
}
array_push($pluginHandler, "handleEvent('plugins.php?pluginaction=showPlugin&pluginID=" . $id . "&className=" . $curPlugin->get_class_name() . "')");
}
}
$pluginForm->setHeadings($pluginHeadings);
$pluginForm->setTableWidth("150px");
$pluginForm->setEventHandler($pluginHandler);
$pluginForm->setTitles($pluginNames);
$pluginForm->setSortable(true);
return $pluginForm->showAll();
}
示例2: plugins
public function plugins()
{
$plugins_in_folder = Plugins::get_plugins();
$plugins = Plugin::where('active', '=', 1)->get();
$data = array('plugins' => $plugins, 'plugins_available' => $plugins_in_folder);
return View::make('admin.sections.plugins', $data);
}
示例3: checkPlugin
function checkPlugin($location)
{
$allPlugins = Plugins::get_plugins();
$location = strtolower($location);
$pluginNames = array();
$pluginHeadings = array("All Plugins");
foreach ($allPlugins as $id => $value) {
$curPlugin = new Plugins($id);
$plugLocation = strtolower($curPlugin->get_location());
if ($plugLocation == $location && $curPlugin->get_enabled() == true) {
$pluginNames[$id] = $curPlugin->get_name();
}
}
return $pluginNames;
}
示例4: updatePlugins
function updatePlugins()
{
global $tool, $propertyForm;
$enabledPlugins = $_POST['list'];
//print_r($enabledWidgets);
$plugins = Plugins::get_plugins();
$update = true;
foreach ($plugins as $id => $value) {
$isEnabled = false;
$curPlugin = new Plugins($id);
foreach ($enabledPlugins as $eID => $eValue) {
if ($id == $eValue) {
$curPlugin->set_enabled(true);
$isEnabled = true;
}
}
if (!$isEnabled) {
$curPlugin->set_enabled(false);
}
if ($curPlugin->update_plugin()) {
$update = true;
} else {
$update = false;
$error = $curPlugin->get_error();
break;
}
}
if ($update) {
$status = "success";
echo "<script language='javascript'>LoadPage(\"configurations.php?action=plugins&mode=edit&update=" . $status . "\", 'settingsInfo');</script>";
} else {
$propertyForm->error("Warning: Failed to enable plugins. Reason: " . $error);
}
}