diff options
| author | 2013-06-15 19:42:02 +0200 | |
|---|---|---|
| committer | 2013-06-15 19:42:02 +0200 | |
| commit | d3078fb726639eed478a2a449b0a9043af04a756 (patch) | |
| tree | d0a848273d0f2ba7ec5908341539ffef055f8368 /app/views | |
| parent | 4bda1d75aec180ee3845f74991f99a99ef2ae062 (diff) | |
Mise en place de la structure pour les différentes vues
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/helpers/global_view.phtml | 5 | ||||
| -rw-r--r-- | app/views/helpers/normal_view.phtml | 114 | ||||
| -rw-r--r-- | app/views/helpers/reader_view.phtml | 5 | ||||
| -rwxr-xr-x | app/views/helpers/rss_view.phtml (renamed from app/views/helpers/rss.phtml) | 0 | ||||
| -rw-r--r-- | app/views/index/index.phtml | 128 |
5 files changed, 131 insertions, 121 deletions
diff --git a/app/views/helpers/global_view.phtml b/app/views/helpers/global_view.phtml new file mode 100644 index 000000000..b666fe620 --- /dev/null +++ b/app/views/helpers/global_view.phtml @@ -0,0 +1,5 @@ +<?php +$this->partial ('nav_menu'); +?> + +Non implémenté
\ No newline at end of file diff --git a/app/views/helpers/normal_view.phtml b/app/views/helpers/normal_view.phtml new file mode 100644 index 000000000..515084047 --- /dev/null +++ b/app/views/helpers/normal_view.phtml @@ -0,0 +1,114 @@ +<?php + +$this->partial ('aside_flux'); +$this->partial ('nav_menu'); + +if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { + $items = $this->entryPaginator->items (); +?> + +<div id="stream"> + <?php + $display_today = true; + $display_yesterday = true; + $display_others = true; + ?> + <?php foreach ($items as $item) { ?> + + <?php if ($display_today && $item->isDay (Days::TODAY)) { ?> + <div class="day"><?php echo Translate::t ('today'); ?> - <?php echo timestamptodate (time (), false); ?></div> + <?php $display_today = false; } ?> + <?php if ($display_yesterday && $item->isDay (Days::YESTERDAY)) { ?> + <div class="day"><?php echo Translate::t ('yesterday'); ?> - <?php echo timestamptodate (time () - 86400, false); ?></div> + <?php $display_yesterday = false; } ?> + <?php if ($display_others && $item->isDay (Days::BEFORE_YESTERDAY)) { ?> + <div class="day"><?php echo Translate::t ('before_yesterday'); ?></div> + <?php $display_others = false; } ?> + + <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> + <ul class="horizontal-list flux_header"> + <?php if (!login_is_conf ($this->conf) || is_logged ()) { ?> + <li class="item manage"> + <?php if (!$item->isRead ()) { ?> + <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 1); ?>"> </a> + <?php } else { ?> + <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 0); ?>"> </a> + <?php } ?> + + <?php if (!$item->isFavorite ()) { ?> + <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 1); ?>"> </a> + <?php } else { ?> + <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 0); ?>"> </a> + <?php } ?> + </li> + <?php } ?> + <?php $feed = $item->feed (true); ?> + <li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" /> <span><?php echo $feed->name (); ?></span></a></li> + <li class="item title"><?php echo $item->title (); ?></li> + <li class="item date"><?php echo $item->date (); ?></li> + <li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"> </a></li> + </ul> + + <div class="flux_content"> + <div class="content"> + <h1 class="title"><?php echo $item->title (); ?></h1> + <?php $author = $item->author (); ?> + <?php echo $author != '' ? '<div class="author">' . Translate::t ('by_author', $author) . '</div>' : ''; ?> + <?php + if($this->conf->lazyload() == 'yes') { + echo lazyimg($item->content ()); + } else { + echo $item->content(); + } + ?> + </div> + + <ul class="horizontal-list bottom"> + <li class="item"> + <div class="dropdown"> + <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> + <i class="icon i_share"></i> <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"><?php echo Translate::t ('share'); ?></a> + + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> + + <li class="item"><a href="mailto:?subject=<?php echo $item->title (); ?>&body=J'ai trouvé cet article intéressant, tu peux le lire à cette adresse : <?php echo urlencode($item->link ()); ?>"><?php echo Translate::t ('by_email'); ?></a></li> + <?php + $shaarli = $this->conf->urlShaarli (); + if ($shaarli) { + ?> + <li class="item"><a target="_blank" href="<?php echo $shaarli . '?post=' . urlencode($item->link ()) . '&title=' . urlencode ($item->title ()) . '&source=bookmarklet'; ?>"><?php echo Translate::t ('on_shaarli'); ?></a></li> + <?php } ?> + </ul> + </div> + </li> + <?php $tags = $item->tags(); ?> + <?php if(!empty($tags)) { ?> + <li class="item"> + <div class="dropdown"> + <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div> + <i class="icon i_tag"></i> <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php echo Translate::t ('related_tags'); ?></a> + + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> + + <?php foreach($tags as $tag) { ?> + <li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li> + <?php } ?> + </ul> + </div> + </li> + <?php } ?> + </ul> + </div> + </div> + <?php } ?> + + <?php $this->entryPaginator->render ('pagination.phtml', 'next'); ?> +</div> + +<?php } else { ?> +<div class="alert alert-warn"> + <span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span> +</div> +<?php } ?>
\ No newline at end of file diff --git a/app/views/helpers/reader_view.phtml b/app/views/helpers/reader_view.phtml new file mode 100644 index 000000000..b666fe620 --- /dev/null +++ b/app/views/helpers/reader_view.phtml @@ -0,0 +1,5 @@ +<?php +$this->partial ('nav_menu'); +?> + +Non implémenté
\ No newline at end of file diff --git a/app/views/helpers/rss.phtml b/app/views/helpers/rss_view.phtml index 83de6de2e..83de6de2e 100755 --- a/app/views/helpers/rss.phtml +++ b/app/views/helpers/rss_view.phtml diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml index 30df591eb..46ff33b3a 100644 --- a/app/views/index/index.phtml +++ b/app/views/index/index.phtml @@ -1,127 +1,13 @@ <?php -function lazyimg($content) { - return preg_replace( - '/<img([^<]+)src=([\'"])([^"\']*)([\'"])([^<]*)>/i', - '<img$1src="' . Url::display('/data/grey.gif') . '" data-original="$3"$5>', - $content - ); -} $output = Request::param ('output', 'normal'); if ($output == 'rss') { - $this->renderHelper ('rss'); + $this->renderHelper ('rss_view'); +} elseif($output == 'reader') { + $this->renderHelper ('reader_view'); +} elseif($output == 'global') { + $this->renderHelper ('global_view'); } else { - $this->partial ('aside_flux'); - $this->partial ('nav_menu'); - - if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { - $items = $this->entryPaginator->items (); -?> - -<div id="stream"> - <?php - $display_today = true; - $display_yesterday = true; - $display_others = true; - ?> - <?php foreach ($items as $item) { ?> - - <?php if ($display_today && $item->isDay (Days::TODAY)) { ?> - <div class="day"><?php echo Translate::t ('today'); ?> - <?php echo timestamptodate (time (), false); ?></div> - <?php $display_today = false; } ?> - <?php if ($display_yesterday && $item->isDay (Days::YESTERDAY)) { ?> - <div class="day"><?php echo Translate::t ('yesterday'); ?> - <?php echo timestamptodate (time () - 86400, false); ?></div> - <?php $display_yesterday = false; } ?> - <?php if ($display_others && $item->isDay (Days::BEFORE_YESTERDAY)) { ?> - <div class="day"><?php echo Translate::t ('before_yesterday'); ?></div> - <?php $display_others = false; } ?> - - <div class="flux<?php echo !$item->isRead () ? ' not_read' : ''; ?><?php echo $item->isFavorite () ? ' favorite' : ''; ?>" id="flux_<?php echo $item->id (); ?>"> - <ul class="horizontal-list flux_header"> - <?php if (!login_is_conf ($this->conf) || is_logged ()) { ?> - <li class="item manage"> - <?php if (!$item->isRead ()) { ?> - <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 1); ?>"> </a> - <?php } else { ?> - <a class="read" href="<?php echo _url ('entry', 'read', 'id', $item->id (), 'is_read', 0); ?>"> </a> - <?php } ?> - - <?php if (!$item->isFavorite ()) { ?> - <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 1); ?>"> </a> - <?php } else { ?> - <a class="bookmark" href="<?php echo _url ('entry', 'bookmark', 'id', $item->id (), 'is_favorite', 0); ?>"> </a> - <?php } ?> - </li> - <?php } ?> - <?php $feed = $item->feed (true); ?> - <li class="item website"><a href="<?php echo _url ('index', 'index', 'get', 'f_' . $feed->id ()); ?>"><img class="favicon" src="<?php echo $feed->favicon (); ?>" alt="" /> <span><?php echo $feed->name (); ?></span></a></li> - <li class="item title"><?php echo $item->title (); ?></li> - <li class="item date"><?php echo $item->date (); ?></li> - <li class="item link"><a target="_blank" href="<?php echo $item->link (); ?>"> </a></li> - </ul> - - <div class="flux_content"> - <div class="content"> - <h1 class="title"><?php echo $item->title (); ?></h1> - <?php $author = $item->author (); ?> - <?php echo $author != '' ? '<div class="author">' . Translate::t ('by_author', $author) . '</div>' : ''; ?> - <?php - if($this->conf->lazyload() == 'yes') { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> - </div> - - <ul class="horizontal-list bottom"> - <li class="item"> - <div class="dropdown"> - <div id="dropdown-share-<?php echo $item->id ();?>" class="dropdown-target"></div> - <i class="icon i_share"></i> <a class="dropdown-toggle" href="#dropdown-share-<?php echo $item->id ();?>"><?php echo Translate::t ('share'); ?></a> - - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> - - <li class="item"><a href="mailto:?subject=<?php echo $item->title (); ?>&body=J'ai trouvé cet article intéressant, tu peux le lire à cette adresse : <?php echo urlencode($item->link ()); ?>"><?php echo Translate::t ('by_email'); ?></a></li> - <?php - $shaarli = $this->conf->urlShaarli (); - if ($shaarli) { - ?> - <li class="item"><a target="_blank" href="<?php echo $shaarli . '?post=' . urlencode($item->link ()) . '&title=' . urlencode ($item->title ()) . '&source=bookmarklet'; ?>"><?php echo Translate::t ('on_shaarli'); ?></a></li> - <?php } ?> - </ul> - </div> - </li> - <?php $tags = $item->tags(); ?> - <?php if(!empty($tags)) { ?> - <li class="item"> - <div class="dropdown"> - <div id="dropdown-tags-<?php echo $item->id ();?>" class="dropdown-target"></div> - <i class="icon i_tag"></i> <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $item->id ();?>"><?php echo Translate::t ('related_tags'); ?></a> - - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close"><i class="icon i_close"></i></a></li> - - <?php foreach($tags as $tag) { ?> - <li class="item"><a href="<?php echo _url ('index', 'index', 'search', urlencode ('#' . $tag)); ?>"><?php echo $tag; ?></a></li> - <?php } ?> - </ul> - </div> - </li> - <?php } ?> - </ul> - </div> - </div> - <?php } ?> - - <?php $this->entryPaginator->render ('pagination.phtml', 'next'); ?> -</div> - - <?php } else { ?> -<div class="alert alert-warn"> - <span class="alert-head"><?php echo Translate::t ('no_feed_to_display'); ?></span> -</div> - <?php } ?> -<?php } ?> + $this->renderHelper ('normal_view'); +}
\ No newline at end of file |
