function testPaginationView()
 {
     // 10 elementi, 10 per pagina (una sola pagina, quindi paginatore e' vuoto)
     $p = new Pagination(10, 10, 1);
     $view = new ViewBuilder("pagination/default.html", array('current_page' => 1, 'pages' => array(array('page' => 1, 'link' => '1'))));
     $this->assertTrue("" == $p->getNavigator("default.html", "#PAGE#"));
     // 11 elementi, 10 per pagina (pagina 1)
     $p = new Pagination(11, 10, 1);
     $view = new ViewBuilder("pagination/default.html", array('current_page' => 1, 'pages' => array(array('page' => 1, 'link' => '1'), array('page' => 2, 'link' => '2'))));
     $this->assertTrue($view->render() == $p->getNavigator("default.html", "#PAGE#"));
     // 11 elementi, 10 per pagina (pagina 2)
     $p = new Pagination(11, 10, 2);
     $view = new ViewBuilder("pagination/default.html", array('current_page' => 2, 'pages' => array(array('page' => 1, 'link' => '1'), array('page' => 2, 'link' => '2'))));
     $this->assertTrue($view->render() == $p->getNavigator("default.html", "#PAGE#"));
 }
Example #2
0
">
			<span class="bubble pull-right" style="margin-left: 0.5em; margin-top: 0.5em;"><?php 
    echo $topic['replies'];
    ?>
</span> <?php 
    echo $topic->getName();
    ?>
<br>
			<div class="subtitle"><?php 
    echo $topic['user'];
    ?>
 - <?php 
    echo $topic->getFormattedDate();
    ?>
</div>
			</a>
		</li>
<?php 
}
?>
		</ul>
	</div> <!-- forum-discussion-list -->
	<?php 
$pag = new Pagination($topics_count, Forum::TOPICS_PER_PAGE, $_GET['p']);
echo $pag->getNavigator("default.html", "/p/forum/" . $_GET['id'] . "-#PAGE#/");
?>
</div> <!-- view-forum-container -->


<?php 
require_once ROOT_PATH . "footer.php";
Example #3
0
        $order_by = MessageService::SUBJECT;
        $order_type = "DESC";
        break;
    default:
        $order_by = MessageService::DATE;
        $order_type = "DESC";
        break;
}
//Creo il MessageService e prendo i messaggi
$ms = new MessageService($currentUser['id']);
$messages = $ms->getFolder($folder, $page, $order_type, $order_by);
//Array contenente i dati del json
$array = array();
//Creo i dati della paginazione
$pag = new Pagination($ms->getFolderCountMessages($folder), MessageService::MESSAGE_FOR_PAGE, $page);
$array['pagination'] = $pag->getNavigator("default.html", "javascript:Messages.goToPage(#PAGE#);");
$array['messages'] = array();
foreach ($messages as $m) {
    $date = DateUtils::GetNice($m['date_tm']);
    $q = DB::FindOne("SELECT user FROM users WHERE id = " . $m[$to_field] . " LIMIT 1");
    $to_from = $m->isMultiple() && $folder == MessageService::SENT ? 'Tutti i membri' : $q['user'];
    $delete_restore = '';
    if ($folder == MessageService::INBOX) {
        $delete_restore = 'C';
    } else {
        if ($folder == MessageService::DELETED) {
            $delete_restore = 'R';
        }
    }
    $array['messages'][] = array("date" => $date, "to_from" => $to_from, "delete_restore" => $delete_restore, "id" => $m['id'], "subject" => $m->getRaw('subject'), "viewed" => $m['viewed'] == 1, "important" => $m['important'] == 1);
}
Example #4
0
	},

	ShowReplyForm: function(){
		$("#frm-forum-reply").show();	
		$("#btn-forum-reply").hide();

		FormBuilder.GetField("frm-forum-reply", "message").focusToEnd();

		$("body").scrollTo("#frm-forum-reply", {duration: 500});
	}
};	

$(function(){
<?php 
if ($topic['locked']) {
    ?>
	// Se il topic e' bloccato, non permettere agli utenti di rispondere e quotare
	$(".btn-quote, #btn-forum-reply").addClass("disabled");
<?php 
}
?>
});
</script>

<?php 
$pag = new Pagination($posts_count, Forum::POSTS_PER_PAGE, $_GET['p']);
echo $pag->getNavigator("default.html", $topic->getUrl("#PAGE#"));
?>

<?php 
require_once ROOT_PATH . "footer.php";