Esempio n. 1
0
 public function action_index()
 {
     $page = $this->get_query('page', 1);
     $number_of_news = 10;
     if ($page == 1) {
         $top_news = Model_News::top_news();
         $number_of_news = $number_of_news - count($top_news);
     }
     $news_list = Model_News::fetch_public_news($page, $number_of_news);
     if (isset($top_news)) {
         $news_list = array_merge($top_news, $news_list);
     }
     $total_news = Model_News::number_of_public_news();
     $this->template_data['total'] = ceil($total_news / $number_of_news);
     $this->template_data['title'] = e::get_website_name();
     $this->template_data['news_list'] = $news_list;
 }
Esempio n. 2
0
echo $title;
?>
</title>
    <?php 
echo View::factory('block/meta');
?>
</head>
<body>
<div class="navbar navbar-inverse" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <a class="navbar-brand" href="<?php 
e::home();
?>
"><?php 
echo e::get_website_name();
?>
</a>
            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<?php 
if (OJ::is_backend()) {
    echo View::factory('block/backend_nav');
} else {
    echo View::factory('block/frontend_nav');
Esempio n. 3
0
<?php

if (Request::$current->query('page') == 1) {
    ?>
<div class="welcome readability">
    <h3><?php 
    echo __("index.welcome_to_:name", array(':name' => e::get_website_name()));
    ?>
</h3>
    <p><?php 
    echo __("index.any_problem");
    ?>
</p>
</div>
<?php 
}
?>
<div class="row index">
    <div class="news">
        <?php 
/* @var Model_News[] $news_list */
foreach ($news_list as $news) {
    ?>
        <div class="news-item">
            <h4><a href="<?php 
    e::url("/news/{$news->news_id}");
    ?>
"><?php 
    echo $news->title;
    ?>
</a><?php 
Esempio n. 4
0
 public function test_site_name()
 {
     $this->assertSame('HUSTOJ', e::get_website_name());
 }