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


PHP Plugins::get_name方法代码示例

本文整理汇总了PHP中Plugins::get_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugins::get_name方法的具体用法?PHP Plugins::get_name怎么用?PHP Plugins::get_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plugins的用法示例。


在下文中一共展示了Plugins::get_name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: displayPlugins

function displayPlugins()
{
    global $tool, $propertyForm;
    $plugins = Plugins::get_plugins();
    echo "<style>";
    foreach ($plugins as $id => $value) {
        echo "#modalBox #dialog" . $id;
        echo "{\n\t\t\twidth:auto;\n\t\t\tmax-width: 80%;\n\t\t\tmin-width:40%;\n\t\t\theight:auto;\n\t\t\tpadding:10px;\n\t\t\tpadding-top:10px;\n\t\t\toverflow:auto;\n\t\t}";
    }
    echo "</style>";
    echo "</div><form method='post' action='' style='width:1024px;'>";
    echo "<table id=\"sortDataTable\" class='sortable' cellspacing=\"0\" cellpadding=\"0\" border=\"1\" style='width:100%; clear:left;'>\n\t\t<thead>\n\t\t<tr><th style='text-align:left;'>Plugins</th>\n\t\t\t<th style='text-align:left;'>Description</th>\n\t\t\t<th style='text-align:left;'>Version</th>\n\t\t\t<th style='text-align:left;'>Poller Script</th>\n\t\t\t<th style='text-align:left;'>Poller Interval</th>\n\t\t\t<th style='text-align:left;'>Location</th>\n\t\t\t<th style='text-align:left;'>Action</th></tr>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>";
    if ($_GET['mode'] == refreshPlugins) {
        $dir = "plugins/";
        $status = checkDirForPlugins($dir);
        if ($status != true) {
            $propertyForm->warning("Failed to refresh. Reason: " . $status);
        }
    }
    foreach ($plugins as $id => $value) {
        echo "<tr>";
        $curPlugin = new Plugins($id);
        if (file_exists($curPlugin->get_conf_path())) {
            // If this passes the plugin still exists
            $fileExists = fopen($curPlugin->get_filename(), 'r');
            if ($curPlugin->get_enabled()) {
                echo "<td><input type='checkbox' checked name='list[]' value='" . $curPlugin->get_id() . "' />" . $curPlugin->get_name() . "</td>";
            } else {
                echo "<td><input type='checkbox' name='list[]' value='" . $curPlugin->get_id() . "' />" . $curPlugin->get_name() . "</td>";
            }
            echo "<td>" . $curPlugin->get_description() . "</td>";
            echo "<td>" . $curPlugin->get_version() . "</td>";
            $poller_string = "N/A";
            $poller_interval_string = "";
            if ($curPlugin->get_poller()) {
                $poller_string = $curPlugin->get_poller_script();
                $poller_interval_string = $curPlugin->get_poller_interval() . "min";
            }
            echo "<td>{$poller_string}</td>";
            echo "<td>{$poller_interval_string}</td>";
            if ($curPlugin->get_location() != '') {
                print "<td>" . $curPlugin->get_location() . "</td>";
            } else {
                print "<td> <a class='tooltip' title='This should only be the case for poller plugins.<br> \n\t\t\t\t\tAll other plugins should have content.<br> Location is defined in the config.xml file<br> \n\t\t\t\t\tExample: &lt; location&gt;statistics&lt;&#8260;location&gt;'><img src='icons/Info.png' height='16' width='16'>\n\t\t\t\t\tNo Content</a></td>";
            }
            //print "file is -" . $curPlugin->get_filename() ."-<br>";
            if ($fileExists) {
                if (include_once $curPlugin->get_filename()) {
                    $className = $curPlugin->get_class_name();
                    if ($className && $className != '') {
                        $pluginClass = new $className();
                        if (method_exists($pluginClass, 'get_config')) {
                            echo "<td><a name='modal' href='#dialog" . $id . "'>Configure</a></td>";
                        } else {
                            echo "<td> </td>";
                        }
                    } else {
                        echo "<td> </td>";
                    }
                } else {
                    echo "<td> </td>";
                }
            }
            echo "</tr>";
        } else {
            if (!$curPlugin->remove_plugin()) {
                $propertyForm->warning("You widget does not exist, but we failed to remove it from the database. Reason: " . $curPlugin->get_error());
            }
        }
    }
    echo "</tbody>\n\t</table>";
    echo "<input type='submit' name='savePlugins' value='Enable checked plugins for users' style='float:left; clear:left; margin-bottom:5px;' />";
    echo "<input type='button' name='refresh' value='Refresh Plugins' onclick=\"return LoadPage('configurations.php?action=plugins&mode=refreshPlugins', 'settingsInfo')\" style='float:right; margin-bottom:5px;' />";
    echo "</form>";
    foreach ($plugins as $id => $value) {
        $curPlugin = new Plugins($id);
        include_once $curPlugin->get_filename();
        $className = $curPlugin->get_class_name();
        if ($className && $className != '') {
            $pluginClass = new $className();
            if (method_exists($pluginClass, 'get_config')) {
                echo "<div id='modalBox'>\n\t\t\t\t\t<div id='dialog" . $id . "' class='window'>\n\t\t\t\t\t<div style='clear:both;'></div>";
                echo "<a href='#'class='close' /><img src='icons/close.png'></a>";
                echo $pluginClass->get_config($id);
                echo "</div>\n\t\t\t\t\t<div id='mask'></div>\n\t\t\t\t\t</div>";
            }
        }
    }
}
开发者ID:precurse,项目名称:netharbour,代码行数:89,代码来源:configurations.php


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