コード例 #1
0
ファイル: on_write.php プロジェクト: J2paper/narinwiki
 * @package	narinwiki
 * @subpackage event
 * @license GPL2 (http://narinwiki.org/license)
 * @author	byfun (http://byfun.com)
 * @filesource
 */
 
if (!defined('_GNUBOARD_')) exit;

list($subject, $wr_doc) = wiki_doc_from_write($doc, $wr_id);

if(!$write['is_owner'] && !$is_wiki_admin) $return_array['is_file'] = false;

$title_msg = "문서 편집";
if(!$w) {
	$title_msg = "새 문서";
	$wikiNS =& wiki_class_load("Namespace");
	$folder = $wikiNS->get($folder);
	$tpl = $folder['tpl'];
	$source = array("/@DOCNAME@/", "/@FOLDER@/", "/@USER@/", "/@NAME@/", "/@NICK@/", "/@MAIL@/", "/@DATE@/");
	$target = array($docname, $folder['ns'], $member['mb_id'], $member['mb_name'], $member['mb_nick'], $member['mb_email'], date("Y-m-d h:i:s"));	
	$content = preg_replace($source, $target, $tpl);
	$return_array['content'] = $content;
}

$return_array['title_msg'] = $title_msg;
$return_array['subject'] = wiki_input_value($subject);
$return_array['wr_doc'] = wiki_input_value($wr_doc);

?>
コード例 #2
0
	/**
	 *
	 * variable 문법 분석
	 *
	 * @param array $matches
	 * @return string 변환된 결과
	 */
	protected function parse_variable($matches)
	{
		$loc = wiki_input_value($this->folder);
		$path = WIKI_PATH;

		foreach ($this->variableParsers as $id => $p)
		{
			$regex = "^".$p['start_regx']."(.*?)".$p['end_regx']."$";
			if (preg_match("/$regex/i", $matches[2], $m))
			{
				if(method_exists($p['klass'], $p['func'])) {
					return $p['klass']->$p['func']($m, array("lines"=>&$this->output, "parser"=>&$this, "view"=>&$this->view, "plugins"=>&$this->plugins) );
				}
			}
		}

		return $matches[0];
	}
コード例 #3
0
ファイル: narin.syntax.php プロジェクト: J2paper/narinwiki
	/**
	 *
	 * 새문서 만들기 폼 출력
	 *
	 * FORMAT : {{NEWPAGE}}
	 *
	 * @param array $matches 매칭 결과
	 * @param array $params {@link NarinParser} 에서 전달하는 파라미터
	 * @return string 새문서 만들기 폼
	 */
	public function wiki_newpage($matches, $params)
	{
		if($matches[3]) {
			$loc = wiki_input_value($matches[3]);
		} else $loc = wiki_input_value($this->folder);

		if($matches[6]) parse_str(str_replace("&", "&", $matches[6]));
		$btn_txt = ($title ? $title : "문서만들기");
		$path = $this->wiki['url'];
		return <<<EOF
		
				<div class="wiki_newpage clear" style="$style">				
				<form action="$path/narin.php" method="get" class="wiki_form">				
				<input type="hidden" name="loc" value="$loc"/>				
				<span class="form_label">$label</span>
				<input type="text" name="doc" class="txt" size="20"/>
				<span class="button"><input type="submit" value="$btn_txt"></span>				
				</form>    	
				</div>
				
EOF;
	}
コード例 #4
0
	/**
	 *
	 * 트리 배열로 트리 HTML 생성
	 *
	 * @param array $tree _build_tree 에서 만들어지 트리 배열
	 * @param string $prefix prefix 로 사용할 부모 폴더 경로
	 * @param string $current 현재 폴더 경로
	 * @return string 트리 HTML
	 */
	function _build_list($tree, $prefix = '', $current = '') {
		$url = $this->wiki['url'].'/media.php?bo_table='.$this->wiki['bo_table'].'&loc=';
		$ul = '';
		foreach ($tree as $key => $value) {
			$li = '';
			$folder = $prefix.$key;
			if(preg_match("/^".preg_quote($folder, "/")."/", $current)) $class = ' class="open"';
			else $class = '';
			$link = $url . '' . urlencode($folder);
			if (is_array($value)) {
				$li .= '<li'.$class.'><span class="folder"><a href="'.$link.'" code="'.wiki_input_value($folder).'">'.$key.'</a></span>';
				$sub = $this->_build_list($value, "$prefix$key/", $current);
				if($sub) $li .= $sub;
				$ul .= $li.'</li>';
			} else {
				if($class != '') $closed = " leaf";
				else $closed = " leaf leaf_folder";
				$ul .= '<li'.$class.'><span class="folder '.$closed.'"><a href="'.$link.'" code="'.wiki_input_value($folder).'">'.$key.'</a></span></li>';
			}
		}
		return strlen($ul) ? sprintf('<ul>%s</ul>', $ul) : '';
	}
コード例 #5
0
ファイル: nowiki.php プロジェクト: J2paper/narinwiki
<tr>
	<td>
		<input type="checkbox" name="chk[]" class="chk" value="<?php 
echo $idx;
?>
"/>
	</td>
	<td<?php 
echo $style;
?>
>
		<input type="text" name="wr_subject[<?php 
echo $idx;
?>
]" value="<?php 
echo wiki_input_value($wr['wr_subject']);
?>
" style="width:100%;" <?php 
echo $name_error;
?>
/>
		<input type="hidden" name="wr_id[<?php 
echo $idx;
?>
]" value="<?php 
echo $wr[wr_id];
?>
"/>
	</td>	
	<td style="padding-left:5px">
		<select name="wr_folder[<?php 
コード例 #6
0
ファイル: search.skin.php プロジェクト: J2paper/narinwiki
<div id="search_head" class="clear">
	
	<div id="search_title">
		위키 검색	
	</div>
	
	<form action="<?php 
echo $wiki['url'];
?>
/search.php" onsubmit="return wiki_search(this);" method="get" class="wiki_form">
	<input type="hidden" name="bo_table" value="<?php 
echo $bo_table;
?>
"/>
	<input type="text" class="search_text txt" name="stx" size="20" value="<?php 
echo wiki_input_value(stripcslashes($stx));
?>
"/>
	<span class="button purple"><input type="submit" value="검색"></span>
	</form>		
		
</div>

<div id="search_list">
<? for($i=0; $i<count($list); $i++) {
		$bg = $i%2 ? 0 : 1;
?>
	<div class="bg<?php 
echo $bg;
?>
">
コード例 #7
0
ファイル: narin.wiki.lib.php プロジェクト: J2paper/narinwiki
/**
 *
 * 팬시 URL 생성
 *
 * $args 의 두번째 파라미터로 넘어오는 연관배열을 / 로 구분하여 URL 생성
 *
 * $args = array('read', array('doc'=>'테스트문서')) 면
 * $wiki['url'].'/read/테스트문서' 반환
 *
 * $args = array('read', array('doc'=>'테스트문서', 'hid'=100)) 면
 * $wiki['url'].'/read/테스트문서?hid=100' 반환
 *
 * $args = array('search', array('stx'=>'위키', 'page'=>'')) 면
 * $wiki['url'].'/search/위키?page=' 반환 (이 경우는 pageing url 생성할 때 사용)
 *
 */
function wiki_fancy_url($args)
{
	global $wiki, $is_wiki_admin;
	//print_r2($args);
	// 파라미터가 없는 경우... 첫 페이지로
	if(empty($args)) return $wiki['url'] ;

	// 경로 설정
	$mode = array_shift($args);

	$rest = '';
	$params = array_shift($args);

	if(!is_array($params)) {		
		return $wiki['url'].'/'.$mode;
	}

	// URL 경로 설정
	$first = array_shift($params);

	// 해쉬 분리
	list($url_path, $hash) = explode('#', $first);
	if($hash) $hash = '#'.$hash;

	// URL 경로 설정
	$rest = '/'.preg_replace('/^\//', '', $url_path);

	// 쿼리 스트링 생성
	$qarr = array();
	foreach($params as $k=>$v) {
		array_push($qarr, $k .'='.urlencode($v));
	}
	if(!empty($qarr)) $qury_string = '?'.implode('&', $qarr);
	else $qury_string = '';
		
	// 기본 URL
	$goto_url = preg_replace('/\/$/', '', $wiki['url'].'/'.$mode. str_replace(' ', '+', $rest.$qury_string).$hash);
	
	return wiki_input_value($goto_url);
}
コード例 #8
0
	
	<tr>		
		<th scope="row">폴더명 변경</th>
		<td>
			<? if($ns['ns'] == "/") { ?>
			<input type="hidden" name="wiki_loc" value="<?php 
echo wiki_input_value($ns['ns']);
?>
"/>
			<?php 
echo $ns['ns'];
?>
 &nbsp; (최상위 폴더는 변경할 수 없습니다)
			<? } else { ?>
			<input type="text" name="wiki_loc" value="<?php 
echo wiki_input_value($ns['ns']);
?>
" size="50" class="tx"/>
			<? } ?>
		</td>
	</tr>
	
	<tr>
		<td></td>
		<td>
			<span class="button red"><input type="submit" value="  완 료  "/>
		</td>
	</tr>
	
	</table>
	</div>
コード例 #9
0
ファイル: nodoc.skin.php プロジェクト: J2paper/narinwiki
 * @license GPL2 (http://narinwiki.org/license)
 * @author	byfun (http://byfun.com)
 * @filesource
 */
 
if (!defined('_GNUBOARD_')) exit;

?>
<h1><?php 
echo $docname;
?>
</h1>
이 문서는 아직 만들어지지 않았습니다.
<div class="wikiToolbar">
	<span class="button"><a href="javascript:history.go(-1);">뒤로</a></span>
	<span class="button green"><a href="<?php 
echo wiki_url();
?>
">시작페이지</a></span>
	<span class="button red"><a href="<?php 
echo $wiki['g4_url'];
?>
/bbs/write.php?bo_table=<?php 
echo $bo_table;
?>
&doc=<?php 
echo wiki_input_value($doc);
?>
">페이지 만들기</a></span>
</div>
コード例 #10
0
ファイル: folder.skin.php プロジェクト: J2paper/narinwiki
<div id="wiki_contents">

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td id="wiki_folder_navi"><?php 
echo $tree;
?>
</td><td valign="top">
	
	<div id="wiki_folder_contents">
		<form name="frmflist" method="post">
		<input type="hidden" name="bo_table" value="<?php 
echo $bo_table;
?>
">
		<input type="hidden" name="folder" value="<?php 
echo wiki_input_value($folder['loc']);
?>
">
		<input type="hidden" name="move_to_folder">

		<table id="folder_list" cellspacing="0" cellpadding="0" border="0">
		<colgroup>
			<col width="20px"> <!-- checkbox -->
			<col>
			<col width="70px"> <!-- mb_id -->
			<col width="50px"> <!-- hit -->
			<col width="80px"> <!-- date -->
		</colgroup>
		<thead>
			<th>
				<? if($is_wiki_admin) { ?>