summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ajax/feeddialog.php4
-rw-r--r--ajax/folderdialog.php4
-rw-r--r--ajax/importdialog.php4
-rw-r--r--js/settings.js55
-rw-r--r--opmlparser.php15
-rw-r--r--templates/part.importdialog.php6
-rw-r--r--templates/settings.php10
7 files changed, 73 insertions, 25 deletions
diff --git a/ajax/feeddialog.php b/ajax/feeddialog.php
index c42771c98..b1e41a6ff 100644
--- a/ajax/feeddialog.php
+++ b/ajax/feeddialog.php
@@ -3,5 +3,5 @@
include("populateroot.php");
$output = new OCP\Template("news", "part.addfeed");
-$output -> assign('allfeeds', $allfeeds);
-$output -> printpage(); \ No newline at end of file
+$output->assign('allfeeds', $allfeeds);
+$output->printpage(); \ No newline at end of file
diff --git a/ajax/folderdialog.php b/ajax/folderdialog.php
index 97b679e66..bb1c37cf3 100644
--- a/ajax/folderdialog.php
+++ b/ajax/folderdialog.php
@@ -3,5 +3,5 @@
include("populateroot.php");
$output = new OCP\Template("news", "part.addfolder");
-$output -> assign('allfeeds', $allfeeds);
-$output -> printpage(); \ No newline at end of file
+$output->assign('allfeeds', $allfeeds);
+$output->printpage(); \ No newline at end of file
diff --git a/ajax/importdialog.php b/ajax/importdialog.php
new file mode 100644
index 000000000..c91b5dead
--- /dev/null
+++ b/ajax/importdialog.php
@@ -0,0 +1,4 @@
+<?php
+
+$output = new OCP\Template("news", "part.importdialog");
+$output->printpage(); \ No newline at end of file
diff --git a/js/settings.js b/js/settings.js
index 265f12d6b..28a61dfc3 100644
--- a/js/settings.js
+++ b/js/settings.js
@@ -1,27 +1,46 @@
-News={
- Settings:{
+NewsSettings={
+ UI: {
+ overview:function(dialogtype, dialogfile){
+ if($(dialogtype).dialog('isOpen') == true){
+ $(dialogtype).dialog('moveToTop');
+ }else{
+ $('#dialog_holder').load(OC.filePath('news', 'ajax', dialogfile), function(jsondata){
+ if(jsondata.status != 'error'){
+ $(dialogtype).dialog({
+ dialogClass:'dialog',
+ minWidth: 600,
+ close: function(event, ui) {
+ $(this).dialog('destroy').remove();
+ }
+ }).css('overflow','visible');
+ } else {
+ alert(jsondata.data.message);
+ }
+ });
+ }
+ return false;
+ },
cloudFileSelected:function(path){
-// $.getJSON(OC.filePath('contacts', 'ajax', 'oc_photo.php'),{'path':path,'id':Contacts.UI.Card.id},function(jsondata){
-// if(jsondata.status == 'success'){
-// //alert(jsondata.data.page);
-// Contacts.UI.Card.editPhoto(jsondata.data.id, jsondata.data.tmp)
-// $('#edit_photo_dialog_img').html(jsondata.data.page);
-// }
-// else{
-// OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
-// }
-// });
- }
- }
+// $.getJSON(OC.filePath('contacts', 'ajax', 'oc_photo.php'),{'path':path,'id':Contacts.UI.Card.id},function(jsondata){
+// if(jsondata.status == 'success'){
+// //alert(jsondata.data.page);
+// Contacts.UI.Card.editPhoto(jsondata.data.id, jsondata.data.tmp)
+// $('#edit_photo_dialog_img').html(jsondata.data.page);
+// }
+// else{
+// OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
+// }
+// });
+ }
+ },
}
$(document).ready(function(){
-
+
$('#opml_file').click(function() {
- OC.dialogs.filepicker(t('news', 'Select file'), News.Settings.cloudFileSelected, false, '', true);
+ NewsSettings.UI.overview('#import_dialog', 'importdialog.php');
});
-
-
+ //OC.dialogs.filepicker(t('news', 'Select file'), NewsSettings.cloudFileSelected, false, '', true);
});
diff --git a/opmlparser.php b/opmlparser.php
new file mode 100644
index 000000000..ab0c8beb0
--- /dev/null
+++ b/opmlparser.php
@@ -0,0 +1,15 @@
+<?php
+
+class OPMLParser {
+
+ public $raw;
+ public $data;
+
+ public function __construct($raw) {
+ $this->raw = $raw;
+ $this->data = array();
+ }
+
+
+
+} \ No newline at end of file
diff --git a/templates/part.importdialog.php b/templates/part.importdialog.php
new file mode 100644
index 000000000..921f21aaf
--- /dev/null
+++ b/templates/part.importdialog.php
@@ -0,0 +1,6 @@
+<div id="import_dialog" title="<?php echo $l->t("Import feeds from OPML file"); ?>">
+<table width="100%" style="border: 0;">
+<tr>
+dialog
+</tr>
+</table> \ No newline at end of file
diff --git a/templates/settings.php b/templates/settings.php
index bb82c9754..29cd6f42c 100644
--- a/templates/settings.php
+++ b/templates/settings.php
@@ -1,8 +1,12 @@
<form id="news">
<fieldset class="personalblock">
<strong>News</strong><br />
- <input type="text" name="opml_file" id="opml_file" placeholder="<?php echo $l->t('.opml file');?>" />
- <input type="submit" value="<?php echo $l->t('Import feeds');?>" />
- <br />
+ <dl>
+ <dt>Import</dt>
+ <dd><input type="text" name="opml_file" id="opml_file" placeholder="<?php echo $l->t('.opml file');?>" /><input type="submit" value="<?php echo $l->t('Import feeds');?>" /></dd>
+ <dt>Export</dt>
+ <dd></dd>
+ </dl>
</fieldset>
+ <div id="dialog_holder"></div>
</form>