Skip to content

Commit

Permalink
標準で読み込むスタイルシート(jQueryUIのテーマ、標準スタイルシート)をRenderクラス側で読み込むようにした
Browse files Browse the repository at this point in the history
XHTML Strict動作時にエラーが起きる問題を修正。(テーマのみ)
ログ処理を少し書き直し。
モバイルスキンが動かないので修正。
DNSBLの処理はPEARを用いるようにするため、不要となったDnsBl.phpを削除
Netbeansプロジェクトファイルを追加
barchart、bluffを削除。
  • Loading branch information
logue committed May 19, 2013
1 parent 2e4a180 commit d28df0d
Show file tree
Hide file tree
Showing 27 changed files with 660 additions and 1,256 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
/nbproject/private/
/vendor/
/wiki-data/cache/
4 changes: 4 additions & 0 deletions composer.bat
Expand Up @@ -5,4 +5,8 @@ if not exist "composer.phar" (
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
)

if not exist "composer.lock" (
php composer.phar install
)

php composer.phar %*
5 changes: 5 additions & 0 deletions composer.json
Expand Up @@ -32,6 +32,7 @@
},
"require": {
"php": ">=5.3.3",
"pear-pear/Net_DNSBL" : "1.*",
"aferrandini/phpqrcode": "dev-master",
"zendframework/zendframework": "2.*",
"zendframework/zendoauth": "2.*",
Expand All @@ -45,6 +46,10 @@
"ext-intl" : "for i18n use."
},
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
},
{
"type": "composer",
"url": "https://packages.zendframework.com/"
Expand Down
4 changes: 4 additions & 0 deletions composer.sh
Expand Up @@ -5,4 +5,8 @@ curl -s https://getcomposer.org/installer | php
chmod +x composer.phar
fi

if [ ! -e composer.lock ]; then
php composer.phar install
fi

php composer.phar $*
7 changes: 7 additions & 0 deletions nbproject/project.properties
@@ -0,0 +1,7 @@
include.path=${php.global.include.path}
php.version=PHP_54
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=true
web.root=.
9 changes: 9 additions & 0 deletions nbproject/project.xml
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>pukiwiki</name>
</data>
</configuration>
</project>
2 changes: 1 addition & 1 deletion webroot/js/mobile/mobile.original.js
Expand Up @@ -18,7 +18,7 @@
*/

var pukiwiki = {};
var JQUERY_MOBILE_VER = '1.3.0-beta.1';
var JQUERY_MOBILE_VER = '1.3.1';
//var JQUERY_MOBILE_VER = 'latest';
(function ($, window, document) {
'use strict';
Expand Down
13 changes: 6 additions & 7 deletions webroot/skin/theme/default/default.skin.php
Expand Up @@ -9,13 +9,12 @@
// $Id: default.skin.php,v 1.4.18 2012/05/03 21:35:00 Logue Exp $
//
?>
<!doctype html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head prefix="og: http://ogp.me/ns# fb: http://www.facebook.com/2008/fbml">
<?php echo $this->head; ?>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/<?php echo JQUERY_UI_VER; ?>/themes/redmond/jquery-ui.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo SKIN_URI . 'scripts.css.php?base=' . urlencode(IMAGE_URI) ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo SKIN_URI . THEME_PLUS_NAME . PLUS_THEME . '/'. PLUS_THEME . '.css.php'; ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo SKIN_URI . THEME_PLUS_NAME . PLUS_THEME . '/blue.css'; ?>"id="coloring" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->path; ?>default.css.php" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->path; ?>blue.css" id="coloring" />
<title><?php echo $this->title . ' - ' . $this->site_name; ?></title>
</head>
<body>
Expand All @@ -24,10 +23,10 @@
<header id="header" role="banner">
<?php if (empty($this->headarea)){ ?>
<a href="<?php echo $this->links['top'] ?>"><img id="logo" src="<?php echo $this->conf['logo']['src'] ?>" width="<?php echo $this->conf['logo']['width'] ?>" height="<?php echo $this->conf['logo']['height'] ?>" alt="<?php echo $this->conf['logo']['alt'] ?>" /></a>
<hgroup id="hgroup">
<div id="hgroup">
<h1 id="title"><?php echo $this->title ?></h1>
<?php if (!empty($this->links)) { ?><h2><a href="<?php echo $this->links['reload'] ?>" id="parmalink"><?php echo $this->links['reload'] ?></a></h2><?php } ?>
</hgroup>
</div>
<!-- * Ad space *-->
<?php if ($this->conf['adarea']['header']) echo '<div id="ad" class="noprint">' . $this->conf['adarea']['header'] . '</div>'; ?>
<!-- * End Ad space * -->
Expand Down
8 changes: 2 additions & 6 deletions webroot/skin/theme/mobile/mobile.ini.php
Expand Up @@ -8,16 +8,12 @@

// ------------------------------------------------------------
// Settings (define before here, if you want)
global $_SKIN, $link_tags, $js_tags;

$_SKIN = array(
return array(
'showicon' => true,
// L•\Ž¦—̈æ
'adarea' => <<<EOD
EOD
);

// 読み込むスタイルシート
$link_tags[] = array('rel'=>'stylesheet', 'type'=>'text/css', 'href'=>SKIN_URI.THEME_PLUS_NAME.'mobile/mobile.css.php?base=' . urlencode(IMAGE_URI) );

/* End of file mobile.ini.php */
/* Location: ./webroot/skin/theme/mobile/mobile.ini.php */
54 changes: 21 additions & 33 deletions webroot/skin/theme/mobile/mobile.skin.php
Expand Up @@ -5,85 +5,73 @@
// PukiWiki Adv. Mobile Theme
// Copyright (C)
// 2012 PukiWiki Advance Developer Team

global $pkwk_dtd, $_SKIN, $is_page, $defaultpage, $do_backup, $menubar, $sidebar;

if (!defined('DATA_DIR')) { exit; }
$_SKIN['showicon'] = true;

if ($newtitle != '' && $is_read) {
$title = $newtitle;
}

(bool) $is_dialog = isset($vars['cmd']) ? preg_match('/attach|freeze|unfreeze|diff|new|upload|log|search|backup|list/', $vars['cmd']) : false;

// Output HTML DTD, <html>, and receive content-type
$meta_content_type = (isset($pkwk_dtd)) ? pkwk_output_dtd($pkwk_dtd) : pkwk_output_dtd();
?>
<!doctype html>
<html>
<head>
<?php echo $meta_content_type; ?>
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php echo $pkwk_head; ?>
<title><?php echo $page_title; ?></title>
<?php echo $this->head; ?>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php echo $this->site_name; ?></title>
</head>

<body>
<article data-role="page">
<header data-role="header" role="banner" id="header">
<h1><?php echo $title ?></h1>
<h1><?php echo $this->title ?></h1>
<?php if (!$is_dialog) { ?>
<a href="#Tool" data-icon="gear" class="ui-btn-right" data-rel="popup" data-position-to="window" data-role="button" data-inline="true" data-transition="pop"><?php echo $_LANG['skin']['tool']; ?></a>
<?php if (!empty($_SKIN['adarea'])) echo '<div class="adarea"></div>'; ?>
<a href="#Tool" data-icon="gear" class="ui-btn-right" data-rel="popup" data-position-to="window" data-role="button" data-inline="true" data-transition="pop"><?php echo $this->lang['skin']['tool']; ?></a>
<?php if (!empty($this->conf['adarea'])) echo '<div class="adarea"></div>'; ?>
<?php } ?>
<?php if (arg_check('read') ){ ?>
<nav data-role="navbar">
<ul>
<?php if (exist_plugin_convert('menu') && is_page($menubar)) { ?>
<li><a href="#MenuBar"><?php echo $_LANG['skin']['menu']; ?></a></li>
<?php if (!empty($this->menubar)) { ?>
<li><a href="#MenuBar"><?php echo $this->lang['skin']['menu']; ?></a></li>
<?php } ?>
<?php if (exist_plugin_convert('side') && is_page($sidebar)) { ?>
<li><a href="#SideBar"><?php echo $_LANG['skin']['side']; ?></a></li>
<?php if (!empty($this->sidebar)) { ?>
<li><a href="#SideBar"><?php echo $this->lang['skin']['side']; ?></a></li>
<?php } ?>
</ul>
</nav>
<?php } ?>
</header>

<section role="main" data-role="content" data-theme="c">
<?php echo $body ?>
<?php echo $this->body ?>
</section>

<?php if (arg_check('read') ){ ?>
<?php if (exist_plugin_convert('menu') && is_page($menubar)) { ?>
<?php if (!empty($this->menubar)) { ?>
<aside data-role="panel" id="MenuBar" data-theme="b" data-content-theme="d" data-position="left" data-display="reveal">
<?php echo do_plugin_convert('menu') ?>
<?php echo $this->menubar ?>
</aside>
<?php } ?>
<?php if (exist_plugin_convert('side') && is_page($sidebar)) { ?>
<?php if (!empty($this->sidebar)) { ?>
<aside data-role="panel" id="SideBar" data-theme="b" data-content-theme="d" data-position="right" data-display="reveal">
<?php echo do_plugin_convert('side') ?>
<?php echo $this->sidebar ?>
</aside>
<?php } ?>
<?php } ?>
<aside data-role="popup" id="Tool">
<div data-role="header" data-theme="a" class="ui-corner-top">
<h1><?php echo $_LANG['skin']['tool']; ?></h1>
<h1><?php echo $this->lang['skin']['tool']; ?></h1>
<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
</div>
<div data-role="content" data-theme="d" class="ui-corner-bottom ui-content">
<?php
exist_plugin('navibar');
echo do_plugin_convert('navibar','top,edit,freeze,diff,backup,upload,reload,new,list,search,recent,help,login'); ?>
<?php echo $this->navibar ?>
</div>
</aside>
<footer data-role="footer" role="contentinfo" id="footer">
<h4>Founded by <a href="<?php echo $modifierlink ?>"><?php echo $modifier ?></a></h4>
<h4>Founded by <a href="<?php echo $this->modifierlink ?>"><?php echo $this->modifier ?></a></h4>
<h5 style="text-align:center; clear:both; font-size:87%;"><?php if (!$is_dialog) { ?>Powered by <a href="http://pukiwiki.logue.be/"><?php echo GENERATOR ?></a>. <?php } ?>HTML convert time: <?php echo showtaketime() ?> sec.</h5>
</footer><!-- /footer -->
</article><!-- /page -->


<?php if (!empty($_SKIN['adarea'])) echo '<div id="adarea_content">' . $_SKIN['adarea'] . '</div>'; ?>
<?php echo $pkwk_tags; ?>
<?php echo $this->js; ?>
</body>
</html>
3 changes: 2 additions & 1 deletion wiki-common/lib/PukiWiki/Auth/AuthApi.php
Expand Up @@ -15,6 +15,7 @@
use PukiWiki\Utility;
use PukiWiki\Router;
use Zend\Crypt\BlockCipher;
use PukiWiki\File\LogFactory;

/**
* 外部認証基底クラス
Expand Down Expand Up @@ -110,7 +111,7 @@ public function setSession()

// OpenID認証の場合のみ
if ($this->auth_name != 'openid_verify') {
log_write('login','');
LogFactory::factory('login')->set();
}
}
/**
Expand Down
1 change: 0 additions & 1 deletion wiki-common/lib/PukiWiki/File/AbstractFile.php
Expand Up @@ -20,7 +20,6 @@
use PukiWiki\Utility;
use SplFileInfo;


/**
* ファイルの読み書きを行うクラス
*/
Expand Down
67 changes: 67 additions & 0 deletions wiki-common/lib/PukiWiki/File/Log/GuessLog.php
@@ -0,0 +1,67 @@
<?php
/**
* みなしユーザログファイルクラス
*
* @package PukiWiki\File\Log
* @access public
* @author Logue <logue@hotmail.co.jp>
* @copyright 2013 PukiWiki Advance Developers Team
* @create 2013/05/14
* @license GPL v2 or (at your option) any later version
* @version $Id: GuessLog.php,v 1.0.0 2013/05/14 16:34:00 Logue Exp $
*/
namespace PukiWiki\File\Log;

use PukiWiki\File\LogFile;

/**
* みなしユーザログファイルクラス(Wikiに保存するためGuessLog()->get()は使わないこと。)
*/
class GuessLog extends LogFile{
public function __construct($page = null) {
$this->kind = 'guess_user';
$this->isWiki = true;
parent::__construct(null);
}
/**
* 推測ユーザデータの出力
*/
public function set($data){
// ユーザを推測する
$user = self::guess_user( $data['user'], $data['ntlm'], $data['sig'] );
if (empty($user)) return;

if ($this->has()){
// ログが存在する場合前のデーターを読み込んで重複を確認
$sw = FALSE;

foreach($this->get() as $_src) {
$x = trim($_src);
$field = parent::table2array($x); // PukiWiki 表形式データを配列データに変換
if (count($field) == 0) continue;
if ($field[0] != $data['ua'] ) continue;
if ($field[1] != $data['host']) continue;
if ($field[2] != $user ) continue;
$sw = TRUE;
break;
}
if ($sw) return; // 重複
}
// 追記するデーター
$data = parent::array2table( array( $data['ua'], $data['host'], $user, '' ) );
return parent::set($data);
}
/**
* ユーザを推測する
* @static
*/
private static function guess_user($user,$ntlm,$sig) {
if (!empty($user)) return $user; // 署名ユーザ
if (!empty($ntlm)) return $ntlm; // NTLM認証ユーザ
if (!empty($sig)) return $sig; // 本人の署名
return null;
}
}

/* End of file GuessLog.php */
/* Location: /vendor/PukiWiki/File/Log/GuessLog.php */
4 changes: 2 additions & 2 deletions wiki-common/lib/PukiWiki/File/Log/LoginLog.php
Expand Up @@ -18,10 +18,10 @@
* ログインログファイルクラス
*/
class LoginLog extends LogFile{
function __construct($page) {
function __construct($x) {
$this->kind = 'login';
$this->isWiki = true;
parent::__construct($page);
parent::__construct();
}
}

Expand Down
39 changes: 2 additions & 37 deletions wiki-common/lib/PukiWiki/File/Log/UpdateLog.php
Expand Up @@ -12,7 +12,7 @@
*/
namespace PukiWiki\File\Log;

use PukiWiki\File\File;
use PukiWiki\File\LogFactory;
use PukiWiki\File\LogFile;

/**
Expand All @@ -27,45 +27,10 @@ function __construct($page) {

public function set($data){
if ($this->config['guess_user']['use']){
self::log_put_guess($data);
LogFactory::factory('guess')->set($data);
}
parent::set($data);
}

/*
* 推測ユーザデータの出力
*/
private function log_put_guess($data)
{
// ユーザを推測する
$user = self::guess_user( $data['user'], $data['ntlm'], $data['sig'] );
if (empty($user)) return;

$file = new File($this->dir . 'guess_user.log');

if (!$file->has()) {
// 最初の1件目
$data = self::array2table( array( $data['ua'], $data['host'], $user,null ) );
$file->set($data);
return;
}

$sw = FALSE;

foreach($file->get() as $line) {
$field = self::table2array($line); // PukiWiki 表形式データを配列データに変換
if (count($field) == 0) continue;
if ($field[0] != $data['ua'] ) continue;
if ($field[1] != $data['host']) continue;
if ($field[2] != $user ) continue;
$sw = TRUE;
break;
}
if ($sw) return; // 既に存在
// データの更新
$data = self::array2table( array( $data['ua'], $data['host'], $user, null ) );
$file->set();
}
}

/* End of file UpdateLog.php */
Expand Down

0 comments on commit d28df0d

Please sign in to comment.