예제 #1
0
	/**
	 * 생성자
	 */
	public function __construct() {
		parent::__construct();
		//$class_name = strtolower(substr(get_class($this), 11));
		$class_name = substr(get_class($this), 11);
		$class_name{0} = strtolower($class_name{0});
		$this->id = $class_name;
		$this->plugin_info = wiki_plugin_info($class_name);
	}
예제 #2
0
include_once("_common.php");

$wikiConfig =& wiki_class_load("Config");

$current_using_plugins = $wikiConfig->using_plugins;

$use_plugins = array();
for($i=0; $i<count($wiki_plugin); $i++)
{
	if($wiki_plugin_use[$i]) array_push($use_plugins, $wiki_plugin[$i]);
}

$wikiConfig->update("/using_plugins", $use_plugins);

$unused_plugins = array_diff($current_using_plugins, $use_plugins);
foreach($unused_plugins as $k=>$p) {
	$pi = wiki_plugin_info($p);
	$pi->onUnused();	
}

$wikiJsCss = wiki_class_load('JsCss');
$wikiJsCss->updateJs();
$wikiJsCss->updateCss();

header("location:".$wiki['url']."/adm/plugin.php");


?>


예제 #3
0
 *
 * 위키 관리 : 플러그인 설정 페이지 스크립트
 *
 * @package	narinwiki
 * @subpackage admin
 * @license GPL2 (http://narinwiki.org/license)
 * @author	byfun (http://byfun.com)
 * @filesource
 */

$pageid = "plugin";

include_once("_common.php");
include_once "admin.head.php";

$info = wiki_plugin_info($plugin);
if(!$info) {
	alert("플러그인 로드 오류");
}

$setting = $info->getPluginSetting();

if(!$info->checkSetting($setting)) alert("플러그인 설정 오류");

?>
<style type="text/css">
.txt {
	width: 50%;
	border: 1px solid #ccc;
}
예제 #4
0
/**
 *
 * 위키 플러그인 목록 반환
 *
 * @return array 플러그인 목록 배열
 *               : array("name"=>플러그인명,
 *               		 "info"=>플러그인정보클래스인스턴스,
 *               		 "plugins"=>array("type"=>syntax|action,
 *               						  "instance"=>플러그인클래스인스턴스)
 *                 )
 */
function wiki_plugin_load()
{
	global $wiki;

	include_once WIKI_PATH."/lib/narin.Plugin.class.php";
	include_once WIKI_PATH."/lib/narin.PluginInfo.class.php";
	include_once WIKI_PATH."/lib/narin.SyntaxPlugin.class.php";
	include_once WIKI_PATH."/lib/narin.ActionPlugin.class.php";

	$plugins = array();
	$plugin_dir = WIKI_PATH."/plugins";
	$d = dir($plugin_dir);
	while ($entry = $d->read()) {
		$pluginPath = $plugin_dir ."/". $entry;
		if(is_dir($pluginPath) && substr($entry, 0, 1) != ".") {

			$syntaxFile = $pluginPath ."/syntax.php";
			$actionFile = $pluginPath ."/action.php";
				
			$p = array();

			// syntax plugin
			if(file_exists($syntaxFile)) {
				$realClassName = "NarinSyntax".ucfirst($entry);
				include_once $syntaxFile;
				if(class_exists($realClassName)) {
					$plugin = new $realClassName();
					array_push($p, array("type"=>"syntax", "instance"=>$plugin));
				}
			}

			// action plugin
			if(file_exists($actionFile)) {
				$realClassName = "NarinAction".ucfirst($entry);
				include_once $actionFile;
				if(class_exists($realClassName)) {
					$plugin = new $realClassName();
					array_push($p, array("type"=>"action", "instance"=>$plugin));
				}
			}

			array_push($plugins, array("name"=>$entry, "info"=>wiki_plugin_info($entry), "plugins"=>$p));
		}
	}
	return $plugins;
}