当前位置: 首页>>代码示例>>PHP>>正文


PHP Plugins::get_plugins方法代码示例

本文整理汇总了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();
}
开发者ID:precurse,项目名称:netharbour,代码行数:26,代码来源:plugins.php

示例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);
 }
开发者ID:phanhung0906,项目名称:demo1,代码行数:7,代码来源:AdminController.php

示例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;
}
开发者ID:precurse,项目名称:netharbour,代码行数:15,代码来源:controlBar.php

示例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);
    }
}
开发者ID:precurse,项目名称:netharbour,代码行数:34,代码来源:configurations.php


注:本文中的Plugins::get_plugins方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。