+ db_query($link, "BEGIN");
+
+ /* create Imported feeds category just in case */
+
+ $result = db_query($link, "SELECT id FROM
+ ttrss_feed_categories WHERE title = 'Imported feeds' AND
+ owner_uid = '$owner_uid' LIMIT 1");
+
+ if (db_num_rows($result) == 0) {
+ db_query($link, "INSERT INTO ttrss_feed_categories
+ (title,owner_uid)
+ VALUES ('Imported feeds', '$owner_uid')");
+ }
+
+ db_query($link, "COMMIT");
+
+ /* Handle OPML import by DOMXML/DOMDocument */
+
+ if (function_exists('domxml_open_file')) {
+ print "<ul class='nomarks'>";
+ print "<li>".__("Importing using DOMXML.")."</li>";
+ require_once "opml_domxml.php";
+ opml_import_domxml($link, $owner_uid);
+ print "</ul>";
+ } else if (PHP_VERSION >= 5) {
+ print "<ul class='nomarks'>";
+ print "<li>".__("Importing using DOMDocument.")."</li>";
+ require_once "opml_domdoc.php";
+ opml_import_domdoc($link, $owner_uid);
+ print "</ul>";
+ } else {
+ print_error(__("DOMXML extension is not found. It is required for PHP versions below 5."));
+ }
+
+ print "</div>";
+
+ print "<div align='center'>";
+ print "<button dojoType=\"dijit.form.Button\"
+ onclick=\"dijit.byId('opmlImportDlg').hide()\">".
+ __('Close this window')."</button>";
+ print "</div>";
+
+ print "</div>";
+
+ //return;
+ }
+
+ if ($id == "editPrefProfiles") {
+
+ print "<div dojoType=\"dijit.Toolbar\">";
+
+# TODO: depends on selectTableRows() being broken for this list
+# print "<div dojoType=\"dijit.form.DropDownButton\">".
+# "<span>" . __('Select')."</span>";
+# print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
+# print "<div onclick=\"selectTableRows('prefFeedProfileList', 'all')\"
+# dojoType=\"dijit.MenuItem\">".__('All')."</div>";
+# print "<div onclick=\"selectTableRows('prefFeedProfileList', 'none')\"
+# dojoType=\"dijit.MenuItem\">".__('None')."</div>";
+# print "</div></div>";
+
+# print "<div style='float : right'>";
+ print "<input name=\"newprofile\" dojoType=\"dijit.form.ValidationTextBox\"
+ required=\"1\">
+ <button dojoType=\"dijit.form.Button\"
+ onclick=\"dijit.byId('profileEditDlg').addProfile()\">".
+ __('Create profile')."</button></div>";
+
+# print "</div>";
+
+
+ $result = db_query($link, "SELECT title,id FROM ttrss_settings_profiles
+ WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
+
+ print "<div class=\"prefFeedCatHolder\">";
+
+ print "<form id=\"profile_edit_form\" onsubmit=\"return false\">";