diff options
| author | 2014-08-09 00:23:22 +0200 | |
|---|---|---|
| committer | 2014-08-09 00:23:22 +0200 | |
| commit | d007b22beb701b78968db420c3be6336ee98a350 (patch) | |
| tree | 6dbb310943f00cba86f3d3cea44d19036e0b193b /app | |
| parent | fda8eba4d147a7624f64c03001df1d317804c0d4 (diff) | |
Change view import/export if no zip extension
Show a select with only one choice is there is no zip extension on
the server.
Fix typo.
See https://github.com/marienfressinaud/FreshRSS/issues/494
Diffstat (limited to 'app')
| -rw-r--r-- | app/Controllers/importExportController.php | 12 | ||||
| -rw-r--r-- | app/views/importExport/index.phtml | 27 |
2 files changed, 24 insertions, 15 deletions
diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index ba4ca4eb0..2b3353d93 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -329,11 +329,13 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { foreach ($export_feeds as $feed_id) { $feed = $this->feedDAO->searchById($feed_id); - $filename = 'feed_' . $feed->category() . '_' - . $feed->id() . '.json'; - $export_files[$filename] = $this->generateArticles( - 'feed', $feed - ); + if ($feed) { + $filename = 'feed_' . $feed->category() . '_' + . $feed->id() . '.json'; + $export_files[$filename] = $this->generateArticles( + 'feed', $feed + ); + } } $nb_files = count($export_files); diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml index 309058959..d7df1619d 100644 --- a/app/views/importExport/index.phtml +++ b/app/views/importExport/index.phtml @@ -1,12 +1,12 @@ -<?php $this->partial ('aside_feed'); ?> +<?php $this->partial('aside_feed'); ?> <div class="post "> - <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> + <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a> <form method="post" action="<?php echo _url('importExport', 'import'); ?>" enctype="multipart/form-data"> - <legend><?php echo Minz_Translate::t ('import'); ?></legend> + <legend><?php echo _t('import'); ?></legend> <div class="form-group"> - <label class="group-name" for="file"><?php echo Minz_Translate::t ('file_to_import'); ?></label> + <label class="group-name" for="file"><?php echo _t('file_to_import'); ?></label> <div class="group-controls"> <input type="file" name="file" id="file" /> </div> @@ -14,27 +14,34 @@ <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('import'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('import'); ?></button> </div> </div> </form> <?php if (count($this->feeds) > 0) { ?> <form method="post" action="<?php echo _url('importExport', 'export'); ?>"> - <legend><?php echo Minz_Translate::t ('export'); ?></legend> + <legend><?php echo _t('export'); ?></legend> <div class="form-group"> <div class="group-controls"> <label class="checkbox" for="export_opml"> <input type="checkbox" name="export_opml" id="export_opml" value="1" checked="checked" /> - <?php echo Minz_Translate::t ('export_opml'); ?> + <?php echo _t('export_opml'); ?> </label> <label class="checkbox" for="export_starred"> <input type="checkbox" name="export_starred" id="export_starred" value="1" checked="checked" /> - <?php echo Minz_Translate::t ('export_starred'); ?> + <?php echo _t('export_starred'); ?> </label> - <select name="export_feeds[]" size="<?php echo min(10, count($this->feeds)); ?>" multiple="multiple"> + <?php + $select_args = ''; + if (extension_loaded('zip')) { + $select_args = ' size="<?php echo min(10, count($this->feeds)); ?>" multiple="multiple"'; + } + ?> + <select name="export_feeds[]"<?php echo $select_arg; ?>> + <?php echo extension_loaded('zip')? '': '<option value="lolol"></option>'; ?> <?php foreach ($this->feeds as $feed) { ?> <option value="<?php echo $feed->id(); ?>"><?php echo $feed->name(); ?></option> <?php } ?> @@ -44,7 +51,7 @@ <div class="form-group form-actions"> <div class="group-controls"> - <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('export'); ?></button> + <button type="submit" class="btn btn-important"><?php echo _t('export'); ?></button> </div> </div> </form> |
