diff options
author | Andrew Dolgov <[email protected]> | 2011-03-04 17:53:02 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-03-04 17:53:02 +0300 |
commit | cfad9259a6feacfa8194b1312770ae6db1ecce50 (patch) | |
tree | 8880d54026cabee2e7a48c7ab38ef42db0fd0ab8 /mobile/functions.php | |
parent | a3ef7d106a9ee3c1be5e11f5f080508742162deb (diff) |
mobile: allow showing category content inline (closes #315)
Diffstat (limited to 'mobile/functions.php')
-rw-r--r-- | mobile/functions.php | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/mobile/functions.php b/mobile/functions.php index 7f5dd5c6f..68530cf8f 100644 --- a/mobile/functions.php +++ b/mobile/functions.php @@ -100,9 +100,9 @@ } - function render_category($link, $cat_id) { + function render_category($link, $cat_id, $offset) { $owner_uid = $_SESSION["uid"]; - + if ($cat_id >= 0) { if ($cat_id != 0) { @@ -227,10 +227,11 @@ function render_categories_list($link) { $owner_uid = $_SESSION["uid"]; - + + $cat_browse = mobile_get_pref($link, "BROWSE_CATS"); + print '<ul id="home" title="'.__('Home').'" selected="true" myBackLabel="'.__('Logout').'" myBackHref="logout.php" myBackTarget="_self">'; - // print "<li><a href='#searchForm'>Search...</a></li>"; @@ -244,7 +245,10 @@ $class = 'oldItem'; } - print "<li class='$class'><a href='cat.php?id=$id'>$title</a></li>"; + if ($cat_browse) + print "<li class='$class'><a href='cat.php?id=$id'>$title</a></li>"; + else + print "<li class='$class'><a href='feed.php?id=$id&is_cat=true'>$title</a></li>"; } $result = db_query($link, "SELECT @@ -273,8 +277,13 @@ } if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) { - print "<li class='$class'><a href='cat.php?id=$id'>" . - $line["title"] . "</a></li>"; + + if ($cat_browse) + print "<li class='$class'><a href='cat.php?id=$id'>" . + $line["title"] . "</a></li>"; + else + print "<li class='$class'><a href='feed.php?id=$id&is_cat=true'>". + $line["title"] . "</a></li>"; } } } @@ -304,12 +313,12 @@ print "</ul>"; } - function render_headlines_list($link, $feed_id, $cat_id, $offset, $search) { + function render_headlines_list($link, $feed_id, $cat_id, $offset, $search, + $is_cat = false) { $feed_id = $feed_id; $limit = 15; $filter = ''; - $is_cat = false; $view_mode = 'adaptive'; if ($search) { |