From c2ca54385f5322a12cabeed4e9d4394aecb3972e Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 10 Jun 2013 22:09:51 -0400 Subject: [PATCH] minors cleanup --- assets/css/app.css | 10 ++++------ locales/fr_FR/translations.php | 3 +-- model.php | 12 ++++++------ schema.php | 4 +++- templates/config.php | 3 +-- vendor/PicoTools/Helper.php | 6 +++--- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/assets/css/app.css b/assets/css/app.css index e5fc5d3..e9646f8 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -135,12 +135,8 @@ label { display: block; } -.inline-label { - display: inline; -} - -input { - -webkit-appearance: none; +input[type="checkbox"] { + border: 1px solid #ccc; } input[type="email"], @@ -154,6 +150,7 @@ input[type="text"] { font-size: 99%; margin-bottom: 10px; margin-top: 5px; + -webkit-appearance: none; } input[type="email"]:focus, @@ -252,6 +249,7 @@ textarea.form-error { /* buttons */ .btn { + -webkit-appearance: none; display: inline-block; color: #333; border: 1px solid #ccc; diff --git a/locales/fr_FR/translations.php b/locales/fr_FR/translations.php index b8d990c..e3abc4d 100644 --- a/locales/fr_FR/translations.php +++ b/locales/fr_FR/translations.php @@ -1,8 +1,7 @@ - 'Ne pas récupérer le contenu des articles (et supprimer ce contenu pour les articles précédents', + 'Do not fetch the content of articles' => 'Ne pas récupérer le contenu des articles', 'Remove automatically read items' => 'Supprimer automatiquement les éléments lus', 'Never' => 'Jamais', 'After %d day' => 'Après %d jour', diff --git a/model.php b/model.php index da83e29..0e277bc 100644 --- a/model.php +++ b/model.php @@ -405,7 +405,7 @@ function autoflush() function update_items($feed_id, array $items) { - $nocontent = (bool)\PicoTools\singleton('db')->table('config')->findOneColumn('nocontent'); + $nocontent = (bool) \PicoTools\singleton('db')->table('config')->findOneColumn('nocontent'); $items_in_feed = array(); $db = \PicoTools\singleton('db'); @@ -419,7 +419,6 @@ function update_items($feed_id, array $items) // Insert only new item if ($db->table('items')->eq('id', $item->id)->count() !== 1) { - $content = $nocontent ? '' : $item->content; $db->table('items')->save(array( 'id' => $item->id, @@ -427,7 +426,7 @@ function update_items($feed_id, array $items) 'url' => $item->url, 'updated' => $item->updated, 'author' => $item->author, - 'content' => $content, + 'content' => $nocontent ? '' : $item->content, 'status' => 'unread', 'feed_id' => $feed_id )); @@ -553,9 +552,10 @@ function save_config(array $values) \PicoTools\Translator\load($values['language']); - // if the user does not want content of feeds, remote it in previous ones - if ((bool)$values['nocontent']) { - \PicoTools\singleton('db')->table('items')->update(array('content'=>'')); + // If the user does not want content of feeds, remove it in previous ones + if ((bool) $values['nocontent']) { + + \PicoTools\singleton('db')->table('items')->update(array('content' => '')); } return \PicoTools\singleton('db')->table('config')->update($values); diff --git a/schema.php b/schema.php index 6636f5b..5c3409a 100644 --- a/schema.php +++ b/schema.php @@ -2,11 +2,13 @@ namespace Schema; + function version_7($pdo) { - $pdo->exec('ALTER TABLE config ADD COLUMN nocontent INTEGER'); + $pdo->exec('ALTER TABLE config ADD COLUMN nocontent INTEGER DEFAULT 0'); } + function version_6($pdo) { $pdo->exec('ALTER TABLE config ADD COLUMN autoflush INTEGER DEFAULT 0'); diff --git a/templates/config.php b/templates/config.php index 47b7c45..b9527dc 100644 --- a/templates/config.php +++ b/templates/config.php @@ -19,8 +19,7 @@
- -
+
diff --git a/vendor/PicoTools/Helper.php b/vendor/PicoTools/Helper.php index 767e15d..69528dc 100644 --- a/vendor/PicoTools/Helper.php +++ b/vendor/PicoTools/Helper.php @@ -182,10 +182,10 @@ function form_radio($name, $label, $value, $selected = false, $class = '') return ''; } -function form_checkbox($name, $values, $class = '' ) + +function form_checkbox($name, $label, $value, $checked = false, $class = '') { - $checkedstr = (bool)$values[$name] ? 'checked' : ''; - return ''; + return ''; }