Skip to content

Commit

Permalink
refs #1604 : recurrent pagination to the view function.
Browse files Browse the repository at this point in the history
  • Loading branch information
inureyes committed Feb 24, 2012
1 parent 2b739d6 commit a5db90b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
26 changes: 1 addition & 25 deletions interface/i/entry/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,8 @@
$itemsView .= '</li>'.CRLF;
}
$itemsView .= '</ul>'.CRLF;

$script = '';
$itemsView .= '<div data-role="navbar" data-theme="c">'.CRLF;
$itemsView .= '<ul>'.CRLF;
if(isset($paging['prev'])){
$itemsView .= '<li><a data-role="button" data-theme="d" data-icon="arrow-l" href="' .$context->getProperty('uri.blog') . '/entry?page=' . $paging['prev'] . '" class="previous">'._textf('%1 페이지',$paging['prev']) . '</a></li>'.CRLF;
$script .= '$("#blog_posts_'.$suri['page'].'").swiperight(function() {$.mobile.changePage("'.$context->getProperty('uri.blog').'/entry?page='.$paging['prev'].'",{reverse: true});});';
}
/*if ($suri['page'] > 1 && $suri['page'] != $paging['pages']) {
$itemsView .= '<li>'._textf('%1 페이지',$suri['page']) . '</li>'.CRLF;
}*/
if (isset($paging['next'])) {
$itemsView .= '<li><a data-role="button" data-theme="d" data-icon="arrow-r" href="' .$context->getProperty('uri.blog') . '/entry?page=' . $paging['next'] . '" class="next">'._textf('%1 페이지',$paging['next']) . '</a></li>'.CRLF;
$script .= '$("#blog_posts_'.$suri['page'].'").swipeleft(function() {$.mobile.changePage("'.$context->getProperty('uri.blog').'/entry?page='.$paging['next'].'");});';
}

$itemsView .= '</ul>'.CRLF;
$itemsView .= '</div>'.CRLF;

print $itemsView;
?>
</ul>
<?php
if (!empty($script)) {
print '<script>'.CRLF.$script.CRLF.'</script>';
}
print printMobileListNavigation($paging,'entry');
} else {
if(!empty($suri['id'])) {
list($entries, $paging) = getEntryWithPaging($blogid, $suri['id']);
Expand Down
23 changes: 23 additions & 0 deletions library/view/iphoneView.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,29 @@ function printMobileRemoteImageFilename($filename) {
return $filename;
}

function printMobileListNavigation($paging,$postfix) {
$script = '';
$itemsView .= '<div data-role="navbar" data-theme="c">'.CRLF;
$itemsView .= '<ul>'.CRLF;
if(isset($paging['prev'])){
$itemsView .= '<li><a data-role="button" data-theme="d" data-icon="arrow-l" href="' .$context->getProperty('uri.blog') . '/'.$postfix.'?page=' . $paging['prev'] . '" class="previous">'._textf('%1 페이지',$paging['prev']) . '</a></li>'.CRLF;
$script .= '$("#blog_posts_'.$suri['page'].'").swiperight(function() {$.mobile.changePage("'.$context->getProperty('uri.blog').'/'.$postfix.'?page='.$paging['prev'].'",{reverse: true});});';
}
/*if ($suri['page'] > 1 && $suri['page'] != $paging['pages']) {
$itemsView .= '<li>'._textf('%1 페이지',$suri['page']) . '</li>'.CRLF;
}*/
if (isset($paging['next'])) {
$itemsView .= '<li><a data-role="button" data-theme="d" data-icon="arrow-r" href="' .$context->getProperty('uri.blog') . '/'.$postfix.'?page=' . $paging['next'] . '" class="next">'._textf('%1 페이지',$paging['next']) . '</a></li>'.CRLF;
$script .= '$("#blog_posts_'.$suri['page'].'").swipeleft(function() {$.mobile.changePage("'.$context->getProperty('uri.blog').'/'.$postfix.'?page='.$paging['next'].'");});';
}
$itemsView .= '</ul>'.CRLF;
$itemsView .= '</div>'.CRLF;
if (!empty($script)) {
$itemsView .= '<script>'.CRLF.$script.CRLF.'</script>';
}
return $itemsView;
}

function printMobileNavigation($entry, $jumpToComment = true, $jumpToTrackback = true, $paging = null, $mode = 'entry') {
$context = Model_Context::getInstance();
global $suri, $blogURL;
Expand Down

0 comments on commit a5db90b

Please sign in to comment.