Skip to content

Commit

Permalink
refs #514 : upstream from 1.9 tree to 2.0 tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Apr 6, 2012
1 parent 4aa4574 commit 0ae5fb2
Show file tree
Hide file tree
Showing 23 changed files with 314 additions and 419 deletions.
2 changes: 1 addition & 1 deletion framework/alias/UTF8.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

if(!class_exists('UTF8')) {
class UTF8 extends Utils_Unicode:: {
class UTF8 extends Utils_Unicode {
}
}
?>
31 changes: 3 additions & 28 deletions interface/i/archive/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,8 @@
$listWithPaging = getEntryListWithPagingByPeriod($blogid, $period, $suri['page'], $blog['entriesOnList']);
$list = array('title' => getPeriodLabel($period), 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']);
$paging = $listWithPaging[1];
?>
<ul data-role="listview" class="posts" id="archive_<?php echo $suri['page'];?>" title="<?php echo getPeriodLabel($period);?>" selected="false">
<?php
$itemsView = '<li class="group ui-bar ui-bar-e">'.CRLF;
$itemsView .= ' <span class="left">' . getPeriodLabel($period) . ' ('.$list['count'].')</span>'.CRLF;
$itemsView .= ' <span class="right">Page <span class="now_page">' . $paging['page'] . '</span> / '.$paging['pages'].'</span>'.CRLF;
$itemsView .= '</li>'.CRLF;
foreach ($list['items'] as $item) {
$author = User::getName($item['userid']);
if($imageName = printIphoneAttachmentExtract(printIphoneEntryContent($blogid, $item['userid'], $item['id']))){
$imageSrc = printIphoneImageResizer($blogid, $imageName, 28);
}else{
$imageSrc = $context->getProperty('service.path') . '/resources/style/iphone/image/noPostThumb.png';
}
$itemsView .= '<li class="post_item">'.CRLF;
$itemsView .= ' <span class="image"><img src="' . $imageSrc . '" width="28" height="28" /></span>'.CRLF;
$itemsView .= ' <a href="' . $context->getProperty('uri.blog') . '/entry/' . $item['id'] . '" class="link">'.CRLF;
$itemsView .= ' <div class="post">'.CRLF;
$itemsView .= ' <span class="title">' . fireEvent('ViewListTitle', htmlspecialchars($item['title'])) . '</span>'.CRLF;
$itemsView .= ' <span class="description">' . Timestamp::format5($item['published']) . ', ' ._text('댓글'). '(' . ($item['comments'] > 0 ? $item['comments'] : 0) . ')' . '</span>'.CRLF;
$itemsView .= ' </div>'.CRLF;
$itemsView .= ' </a>'.CRLF;
$itemsView .= '</li>'.CRLF;
}
$itemsView .= '</ul>'.CRLF;
print $itemsView;
print printMobileListNavigation($paging,'archive/',$period);
printMobileHTMLFooter();
print printMobileEntryListView($list['items'],'archive_'.$suri['page'],getPeriodLabel($period),$paging, $list['count']);
print printMobileListNavigation($paging,'archive/'.$period);
printMobileHTMLFooter();
}
?>
45 changes: 4 additions & 41 deletions interface/i/category/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,16 @@
define('__TEXTCUBE_IPHONE__', true);
require ROOT . '/library/preprocessor.php';
requireView('iphoneView');

printMobileHTMLHeader();
printMobileHTMLMenu('','list');
$category = $suri['id'];
if(isset($category)) {
$blog['entriesOnList'] = 8;
if(!$listWithPaging = getEntryListWithPagingByCategory($blogid, $category, $suri['page'], $blog['entriesOnList']))
$listWithPaging = array(array(), array('total' => 0));
$list = array('title' => (empty($suri['value']) ? getCategoryLabelById($blogid, 0) : $suri['value']), 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']);
$paging = $listWithPaging[1];
?>
<ul class="posts" id="category_<?php echo $suri['page'];?>" title="<?php echo ($category == 0 ? _text('모든 카테고리') : ucwords(getCategoryNameById($blogid, $category)));?>" selected="false">
<?php
$itemsView = '<li class="group">'.CRLF;
$itemsView .= ' <span class="left">' . ($category == 0 ? _text('모든 카테고리') : ucwords(getCategoryNameById($blogid, $category))) . ' ('.$list['count'].')</span>'.CRLF;
$itemsView .= ' <span class="right">Page <span class="now_page">' . $paging['page'] . '</span> / '.$paging['pages'].'</span>'.CRLF;
$itemsView .= '</li>'.CRLF;
foreach ($list['items'] as $item) {
$author = User::getName($item['userid']);
if($imageName = printMobileAttachmentExtract(printMobileEntryContent($blogid, $item['userid'], $item['id']))){
$imageSrc = printMobileImageResizer($blogid, $imageName, 28);
}else{
$imageSrc = $context->getProperty('service.path') . '/resources/style/iphone/image/noPostThumb.png';
}
$itemsView .= '<li class="post_item">'.CRLF;
$itemsView .= ' <span class="image"><img src="' . $imageSrc . '" width="28" height="28" /></span>'.CRLF;
$itemsView .= ' <a href="' . $context->getProperty('uri.blog') . '/entry/' . $item['id'] . '" class="link">'.CRLF;
$itemsView .= ' <div class="post">'.CRLF;
$itemsView .= ' <span class="title">' . fireEvent('ViewListTitle', htmlspecialchars($item['title'])) . '</span>'.CRLF;
$itemsView .= ' <span class="description">' . Timestamp::format5($item['published']) . ', ' . 'Comments(' . ($item['comments'] > 0 ? $item['comments'] : 0) . ')' . '</span>'.CRLF;
$itemsView .= ' </div>'.CRLF;
$itemsView .= ' </a>'.CRLF;
$itemsView .= '</li>'.CRLF;
}

$itemsView .= '<li class="pagination">'.CRLF;
if(isset($paging['prev'])){
$itemsView .= '<a href="' .$context->getProperty('uri.blog') . '/category/' . $category . '?page=' . $paging['prev'] . '" class="previous">'._textf('%1 페이지',$paging['prev']) . '</a>'.CRLF;
}
if (isset($paging['next'])) {
$itemsView .= '<a href="' .$context->getProperty('uri.blog') . '/category/' . $category . '?page=' . $paging['next'] . '" class="next">'._textf('%1 페이지',$paging['next']) . '</a>'.CRLF;
}
if ($suri['page'] > 1 && $suri['page'] != $paging['pages']) {
$itemsView .= '<strong>' . $suri['page'] . '</strong>'.CRLF;
}
$itemsView .= '</li>'.CRLF;
print $itemsView;
?>
</ul>
<?php
print printMobileEntryListView($list['items'],'category_'.$suri['page'],($category == 0 ? _text('모든 카테고리') : ucwords(getCategoryNameById($blogid, $category))),$paging, $list['count']);
print printMobileListNavigation($paging,'category/' . $category);
}
?>
31 changes: 15 additions & 16 deletions interface/i/comment/add/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
define('__TEXTCUBE_IPHONE__', true);
require ROOT . '/library/preprocessor.php';
requireView('iphoneView');

requireStrictRoute();
$entryId = $suri['id'];
$IV = array(
'GET' => array(
'POST' => array(
"name_$entryId" => array('string', 'default' => null),
"password_$entryId" => array('string', 'default' => ''),
"secret_$entryId" => array('string', 'default' => null),
Expand All @@ -19,19 +18,19 @@
);
if(!Validator::validate($IV))
Respond::NotFoundPage();
if (!doesHaveOwnership() && empty($_GET["name_$entryId"])) {
printMobileErrorPage(_text('Comment write error.'), _text('Please enter your name.'), $context->getProperty('uri.blog')."/comment/$entryId");
} else if (!doesHaveOwnership() && empty($_GET["comment_$entryId"])) {
printMobileErrorPage(_text('Comment write error.'), _text('Please enter content.'), $context->getProperty('uri.blog')."/comment/$entryId");
if (!doesHaveOwnership() && empty($_POST["name_$entryId"])) {
printMobileErrorPage(_text('댓글 작성 오류.'), _text('이름을 입력해 주세요.'), "$blogURL/comment/$entryId");
} else if (!doesHaveOwnership() && empty($_POST["comment_$entryId"])) {
printMobileErrorPage(_text('댓글 작성 오류.'), _text('내용을 입력해 주세요.'), "$blogURL/comment/$entryId");
} else {
$comment = array();
$comment['entry'] = $entryId;
$comment['parent'] = null;
$comment['name'] = empty($_GET["name_$entryId"]) ? '' : $_GET["name_$entryId"];
$comment['password'] = empty($_GET["password_$entryId"]) ? '' : $_GET["password_$entryId"];
$comment['homepage'] = empty($_GET["homepage_$entryId"]) || ($_GET["homepage_$entryId"] == 'http://') ? '' : $_GET["homepage_$entryId"];
$comment['secret'] = empty($_GET["secret_$entryId"]) ? 0 : 1;
$comment['comment'] = $_GET["comment_$entryId"];
$comment['name'] = empty($_POST["name_$entryId"]) ? '' : $_POST["name_$entryId"];
$comment['password'] = empty($_POST["password_$entryId"]) ? '' : $_POST["password_$entryId"];
$comment['homepage'] = empty($_POST["homepage_$entryId"]) || ($_POST["homepage_$entryId"] == 'http://') ? '' : $_POST["homepage_$entryId"];
$comment['secret'] = empty($_POST["secret_$entryId"]) ? 0 : 1;
$comment['comment'] = $_POST["comment_$entryId"];
$comment['ip'] = $_SERVER['REMOTE_ADDR'];
$result = addComment($blogid, $comment);
if (in_array($result, array('ip', 'name', 'homepage', 'comment', 'openidonly', 'etc'))) {
Expand All @@ -40,13 +39,13 @@
} else {
$blockMessage = _textf('Blocked %1', $result);
}
printMobileErrorPage(_text('Comment write blocked.'), $blockMessage, "$context->getProperty('uri.blog')/comment/$entryId");
printMobileErrorPage(_text('댓글 작성이 차단되었습니다.'), $blockMessage, "$blogURL/comment/$entryId");
} else if ($result === false) {
printMobileErrorPage(_text('Comment write error.'), _text('Cannot write comment.'), "$context->getProperty('uri.blog')/comment/$entryId");
printMobileErrorPage(_text('댓글 작성 오류.'), _text('댓글을 작성할 수 없었습니다.'), "$blogURL/comment/$entryId");
} else {
setcookie('guestName', $comment['name'], time() + 2592000, $context->getProperty('uri.blog'));
setcookie('guestHomepage', $comment['homepage'], time() + 2592000, $context->getProperty('uri.blog'));
printMobileSimpleMessage(_text('Comment registered.'), _text('Go to comments page'), $context->getProperty('uri.blog')."/comment/$entryId");
setcookie('guestName', $comment['name'], time() + 2592000, $blogURL);
setcookie('guestHomepage', $comment['homepage'], time() + 2592000, $blogURL);
printMobileSimpleMessage(_text('댓글이 등록되었습니다.'), _text('댓글 페이지로 이동'), "$blogURL/comment/$entryId");
}
}
?>
30 changes: 15 additions & 15 deletions interface/i/comment/comment/add/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
requireStrictRoute();
$replyId = $suri['id'];
$IV = array(
'GET' => array(
'POST' => array(
"name_$replyId" => array('string', 'default' => null),
"password_$replyId" => array('string', 'default' => ''),
"secret_$replyId" => array('string', 'default' => null),
Expand All @@ -19,19 +19,19 @@
if(!Validator::validate($IV))
Respond::NotFoundPage();
list($entryId) = getCommentAttributes($blogid, $replyId, 'entry');
if (!doesHaveOwnership() && empty($_GET["name_$replyId"])) {
printMobileErrorPage(_text('댓글 작성 오류.'), _text('이름을 입력해 주세요.'), $context->getProperty('uri.blog')."/comment/comment/$replyId");
} else if (!doesHaveOwnership() && empty($_GET["comment_$replyId"])) {
printMobileErrorPage(_text('댓글 작성 오류.'), _text('내용을 입력해 주세요.'), $context->getProperty('uri.blog')."/comment/comment/$replyId");
if (!doesHaveOwnership() && empty($_POST["name_$replyId"])) {
printMobileErrorPage(_text('댓글 작성 오류.'), _text('이름을 입력해 주세요.'), "$blogURL/comment/comment/$replyId");
} else if (!doesHaveOwnership() && empty($_POST["comment_$replyId"])) {
printMobileErrorPage(_text('댓글 작성 오류.'), _text('내용을 입력해 주세요.'), "$blogURL/comment/comment/$replyId");
} else {
$comment = array();
$comment['entry'] = $entryId;
$comment['parent'] = $replyId;
$comment['name'] = empty($_GET["name_$replyId"]) ? '' : $_GET["name_$replyId"];
$comment['password'] = empty($_GET["password_$replyId"]) ? '' : $_GET["password_$replyId"];
$comment['homepage'] = empty($_GET["homepage_$replyId"]) || ($_GET["homepage_$replyId"] == 'http://') ? '' : $_GET["homepage_$replyId"];
$comment['secret'] = empty($_GET["secret_$replyId"]) ? 0 : 1;
$comment['comment'] = $_GET["comment_$replyId"];
$comment['name'] = empty($_POST["name_$replyId"]) ? '' : $_POST["name_$replyId"];
$comment['password'] = empty($_POST["password_$replyId"]) ? '' : $_POST["password_$replyId"];
$comment['homepage'] = empty($_POST["homepage_$replyId"]) || ($_POST["homepage_$replyId"] == 'http://') ? '' : $_POST["homepage_$replyId"];
$comment['secret'] = empty($_POST["secret_$replyId"]) ? 0 : 1;
$comment['comment'] = $_POST["comment_$replyId"];
$comment['ip'] = $_SERVER['REMOTE_ADDR'];
$result = addComment($blogid, $comment);
if (in_array($result, array('ip', 'name', 'homepage', 'comment', 'openidonly', 'etc'))) {
Expand All @@ -40,13 +40,13 @@
} else {
$blockMessage = _textf('%1 은 차단되었습니다.', $result);
}
printMobileErrorPage(_text('댓글 작성이 차단되었습니다.'), $blockMessage, $context->getProperty('uri.blog')."/comment/$entryId");
printMobileErrorPage(_text('댓글 작성이 차단되었습니다.'), $blockMessage, "$blogURL/comment/$entryId");
} else if ($result === false) {
printMobileErrorPage(_text('댓글 작성 오류.'), _text('댓글을 작성할 수 없었습니다.'), $context->getProperty('uri.blog')."/comment/$entryId");
printMobileErrorPage(_text('댓글 작성 오류.'), _text('댓글을 작성할 수 없었습니다.'), "$blogURL/comment/$entryId");
} else {
setcookie('guestName', $comment['name'], time() + 2592000, $context->getProperty('uri.blog'));
setcookie('guestHomepage', $comment['homepage'], time() + 2592000, $context->getProperty('uri.blog'));
printMobileSimpleMessage(_text('댓글이 등록되었습니다.'), _text('댓글 페이지로 이동'), $context->getProperty('uri.blog')."/comment/$entryId");
setcookie('guestName', $comment['name'], time() + 2592000, $blogURL);
setcookie('guestHomepage', $comment['homepage'], time() + 2592000, $blogURL);
printMobileSimpleMessage(_text('댓글이 등록되었습니다.'), _text('댓글 페이지로 이동'), "$blogURL/comment/$entryId");
}
}
?>
22 changes: 6 additions & 16 deletions interface/i/comment/delete/action/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
define('__TEXTCUBE_IPHONE__', true);
if(empty($suri['id'])) {
$IV = array(
'GET' => array(
'POST' => array(
'replyId' => array('id'),
'password' => array('string', 'mandatory' => false)
)
Expand All @@ -16,29 +16,19 @@
requireStrictRoute();

if(empty($suri['id'])) {
list($entryId) = getCommentAttributes($blogid, $_GET['replyId'], 'entry');
if (deleteComment($blogid, $_GET['replyId'], $entryId, isset($_GET['password']) ? $_GET['password'] : '') === false) {
printMobileErrorPage(_text('Comment delete error.'), _text('Incorrect Password.'), $context->getProperty('uri.blog')."/comment/delete/{$_GET['replyId']}");
list($entryId) = getCommentAttributes($blogid, $_POST['replyId'], 'entry');
if (deleteComment($blogid, $_POST['replyId'], $entryId, isset($_POST['password']) ? $_POST['password'] : '') === false) {
printMobileErrorPage(_text('댓글을 삭제하지 못했습니다'), _text('비밀번호가 맞지 않습니다.'), "$blogURL/comment/delete/{$_POST['replyId']}");
exit();
}
} else {
list($entryId) = getCommentAttributes($blogid, $suri['id'], 'entry');
if (deleteComment($blogid, $suri['id'], $entryId, '') === false) {
printMobileErrorPage(_t('Comment delete error'), _t('Administrator access only.'), $context->getProperty('uri.blog')."/comment/delete/{$suri['id']}");
printMobileErrorPage(_t('댓글을 삭제하지 못했습니다'), _t('관리자 권한이 필요합니다.'), "$blogURL/comment/delete/{$suri['id']}");
exit();
}
}
list($entries, $paging) = getEntryWithPaging($blogid, $entryId);
$entry = $entries ? $entries[0] : null;
printMobileSimpleMessage(_text('댓글이 삭제되었습니다.'), _text('댓글 페이지로 이동'), "$blogURL/comment/$entryId");
?>
<div id="commentDeleted" title="Deleted" class="panel">
<div class="content">
<?php echo _t('Comment deleted.');?>
</div>
<a href="<?php echo $context->getProperty('uri.blog')."/comment/$entryId";?>" class="whiteButton margin-top10">Go to comments page</a>
<fieldset class="margin-top10">
<?php
printMobileNavigation($entry);
?>
</fieldset>
</div>
23 changes: 13 additions & 10 deletions interface/i/comment/delete/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,36 @@
require ROOT . '/library/preprocessor.php';
requireView('iphoneView');
list($entryId) = getCommentAttributes($blogid, $suri['id'], 'entry');
printMobileHTMLHeader();
printMobileHTMLMenu('','comment');
?>

<div id="comment_<?php echo $entryId."_".$suri['id'];?>" title="Delete <?php echo $suri['id'];?>" class="panel">
<?php
if (doesHaveOwnership()) {
?>
<h2 class="title"><?php echo _text('Delete comment?');?></h2>
<h3 class="title"><?php echo _text('삭제하시겠습니까?');?></h3>
<div class="content">
<a class="whiteButton" href="<?php echo $context->getProperty('uri.blog');?>/comment/delete/action/<?php echo $suri['id'];?>"><?php echo _text('Yes');?></a>
<a class="whiteButton margin-top10" href="<?php echo $context->getProperty('uri.blog');?>/comment/<?php echo $entryId;?>"><?php echo _text('No');?></a>
<a data-role="button" data-theme="b" href="<?php echo $blogURL;?>/comment/delete/action/<?php echo $suri['id'];?>"><?php echo _text('');?></a>
<a data-role="button" data-theme="b" href="<?php echo $blogURL;?>/comment/<?php echo $entryId;?>"><?php echo _text('아니오');?></a>
</div>
<?php
} else {
?>
<h2 class="title"><?php echo _text('Please enter Password.');?></h2>
<h3 class="title"><?php echo _text('작성시 입력한 비밀번호를 입력하세요');?></h3>
<div class="content">
<form method="get" action="<?php echo $context->getProperty('uri.blog');?>/comment/delete/action" class="dialog">
<form method="post" action="<?php echo $blogURL;?>/comment/delete/action" class="dialog">
<input type="hidden" name="replyId" value="<?php echo $suri['id'];?>" />
<fieldset>
<label for="password"><?php echo _text('Password:');?></label>
<input type="password" name="password" id="password" />
<a href="#" class="whiteButton margin-top10" type="submit"><?php echo _text('Delete Comment');?></a>
<a href="<?php echo $context->getProperty('uri.blog');?>/comment/<?php echo $entryId;?>" class="whiteButton"><?php echo _text('Go to comments page');?></a>
<fieldset data-role="fieldcontain" class="ui-hide-label">
<label for="password"><?php echo _text('비밀번호');?></label>
<input type="password" name="password" id="password" placeholder="<?php echo _text('비밀번호');?>" />
<button data-role="button" data-theme="b" class="whiteButton margin-top10" type="submit"><?php echo _text('댓글 삭제');?></button>
<a href="<?php echo $blogURL;?>/comment/<?php echo $entryId;?>" data-role="button" class="whiteButton"><?php echo _text('댓글 페이지로 이동');?></a>
</fieldset>
</form>
</div>
<?php
}
printMobileHTMLFooter();
?>
</div>
5 changes: 1 addition & 4 deletions interface/i/comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
<div id="comment_<?php echo $entry['id']."_".time();?>" title="<?php echo _text('댓글');?> : <?php echo htmlspecialchars($entry['title']);?>" selected="false">
<?php
printMobileCommentView($entry['id']);
?>
<fieldset class="navi margin-top10">
<?php
printMobileNavigation($entry, false, true);
?>
</fieldset>
Expand All @@ -31,7 +28,7 @@
?>
<div id="comment_<?php echo time();?>" title="<?php echo _text('최근 댓글');?>" selected="false">
<?php
printMobileRecentCommentView($page);
list($comments, $paging) = printMobileRecentCommentView($page);
printMobileNavigation($entry, false, false, $paging, 'comment');
?>
</div>
Expand Down
Loading

0 comments on commit 0ae5fb2

Please sign in to comment.