summaryrefslogtreecommitdiff
path: root/mobile
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-03-04 17:53:02 +0300
committerAndrew Dolgov <[email protected]>2011-03-04 17:53:02 +0300
commitcfad9259a6feacfa8194b1312770ae6db1ecce50 (patch)
tree8880d54026cabee2e7a48c7ab38ef42db0fd0ab8 /mobile
parenta3ef7d106a9ee3c1be5e11f5f080508742162deb (diff)
mobile: allow showing category content inline (closes #315)
Diffstat (limited to 'mobile')
-rw-r--r--mobile/feed.php3
-rw-r--r--mobile/functions.php27
-rw-r--r--mobile/mobile.css6
-rw-r--r--mobile/mobile.js1
-rw-r--r--mobile/prefs.php6
5 files changed, 33 insertions, 10 deletions
diff --git a/mobile/feed.php b/mobile/feed.php
index 966e1b440..bd5804cca 100644
--- a/mobile/feed.php
+++ b/mobile/feed.php
@@ -24,7 +24,8 @@
$cat_id = db_escape_string($_REQUEST["cat"]);
$offset = (int) db_escape_string($_REQUEST["skip"]);
$search = db_escape_string($_REQUEST["search"]);
+ $is_cat = (bool) db_escape_string($_REQUEST["is_cat"]);
- render_headlines_list($link, $feed_id, $cat_id, $offset, $search);
+ render_headlines_list($link, $feed_id, $cat_id, $offset, $search, $is_cat);
?>
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) {
diff --git a/mobile/mobile.css b/mobile/mobile.css
index bbf286b07..8068e3d38 100644
--- a/mobile/mobile.css
+++ b/mobile/mobile.css
@@ -30,3 +30,9 @@ div.nav .button.right {
ul li a.read {
color: #666666;
}
+
+ul li span.browse {
+ color : #909090;
+ text-align : right;
+ float : right;
+}
diff --git a/mobile/mobile.js b/mobile/mobile.js
index 57908bc08..6b5736193 100644
--- a/mobile/mobile.js
+++ b/mobile/mobile.js
@@ -140,3 +140,4 @@ function showRestOfFeed(feed_id) {
iui.showPage($("home"), true);
}
}
+
diff --git a/mobile/prefs.php b/mobile/prefs.php
index 08d6d1b55..e3ccd7db9 100644
--- a/mobile/prefs.php
+++ b/mobile/prefs.php
@@ -32,6 +32,12 @@
</div>
<div class="row">
+ <label><?php echo __('Browse categories like folders') ?></label>
+ <div class="toggle" id="BROWSE_CATS" onclick="setPref(this)" toggled="<?php echo mobile_pref_toggled($link, "BROWSE_CATS") ?>"><span class="thumb"></span><span class="toggleOn"><?php echo __('ON') ?></span><span class="toggleOff"><?php echo __('OFF') ?></span></div>
+</div>
+
+
+<div class="row">
<label><?php echo __('Show images in posts') ?></label>
<div class="toggle" id="SHOW_IMAGES" onclick="setPref(this)" toggled="<?php echo mobile_pref_toggled($link, "SHOW_IMAGES") ?>"><span class="thumb"></span><span class="toggleOn"><?php echo __('ON') ?></span><span class="toggleOff"><?php echo __('OFF') ?></span></div>
</div>