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


PHP Plugins::get_class_name方法代码示例

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


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

示例1: displayPluginContent

function displayPluginContent()
{
    $curPlugin = new Plugins($_GET['pluginID']);
    if (file_exists($curPlugin->get_filename())) {
        include_once $curPlugin->get_filename();
        $className = $curPlugin->get_class_name();
        $pluginClass = new $className();
        return $pluginClass->get_content();
    } else {
        return "The file does not exist.";
    }
    /*$phpFile = $curPlugin->get_filename();
    	$fh = fopen($phpFile, 'r');
    	$data = fread($fh, filesize($phpFile));
    	fclose($fh);
    	
    	if (!preg_match("/echo/i", $data) && !preg_match("/print/i", $data) )
    	{
    		if (class_exists($className))
    		{
    			$pluginClass = new $className();
    		}
    		else {return "Your class, \"".$className."\", taken from the database does not exist in your php file.";}
    		
    		if(method_exists($pluginClass, 'get_content')) {
    		
    			if($pluginClass->get_content() !='')
    			{
    				return $pluginClass->get_content();
    			}
    		}
    		else{return "No Content to retrieve";}
    	}
    	else {return "You cannot echo or print your content out, you must return a value";}*/
}
开发者ID:precurse,项目名称:netharbour,代码行数:35,代码来源:pluginTemplate.php

示例2: checkPlugin

echo "<div id='controlBar'>";
foreach ($allTabs as $link => $tName) {
    echo "<ul>";
    echo "<a href='" . $link . "'>";
    if (preg_match("/" . $link . "/", $_SERVER['REQUEST_URI'])) {
        echo "<li id='active'>";
    } else {
        echo "<li>";
    }
    echo "<font class='topMenu' icon='" . strtolower($tName) . "'>" . $tName . "</font>";
    $name = checkPlugin(strtolower($tName));
    if (!empty($name)) {
        echo "<ul>";
        foreach ($name as $id => $value) {
            $curPlugin = new Plugins($id);
            $className = $curPlugin->get_class_name();
            echo "<a href='pluginTemplate.php?tab=" . $link . "&pluginID=" . $id . "&className=" . $className . "'><li class='topMenuItem'><font class='subTopMenu' icon='plugIcon" . $id . "'>" . $value . "</font></li></a>";
        }
        echo "</ul>";
    }
    echo "</li></a>\n\t\t\t  </ul>";
}
echo "</div>";
?>

</div>


<?php 
function checkPlugin($location)
{
开发者ID:precurse,项目名称:netharbour,代码行数:31,代码来源:controlBar.php

示例3: updatePluginConfig

function updatePluginConfig()
{
    global $tool, $propertyForm;
    if (!isset($_POST['id'])) {
        echo "The configuration must contain the hidden input type, 'id' with values {$id}. <input type='hidden' name='id' value=\".{$id}.\"></input>";
        return false;
    } else {
        $curPlugin = new Plugins($_POST['id']);
        include_once $curPlugin->get_filename();
        $className = $curPlugin->get_class_name();
        $pluginClass = new $className();
        $postValues = $_POST;
        $values = array();
        foreach ($postValues as $id => $value) {
            $pos = strpos($id, "Plugin_");
            if ($pos === 0) {
                $values = $postValues;
            }
        }
        if ($pluginClass->update_config($values)) {
            $status = "success";
            echo "<script language='javascript'>LoadPage(\"configurations.php?action=plugins&mode=edit&update=" . $status . "\", 'settingsInfo');</script>";
        } else {
            $propertyForm->error("Warning: Failed to update plugins. Reason: plugin update is not returning a true value");
        }
    }
}
开发者ID:precurse,项目名称:netharbour,代码行数:27,代码来源:configurations.php


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