";
if ($id == "importOpml") {
print "
".__('OPML Import')." ";
print "";
$owner_uid = $_SESSION["uid"];
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 "";
print "".__("Importing using DOMXML.")." ";
require_once "opml_domxml.php";
opml_import_domxml($link, $owner_uid);
print " ";
} else if (PHP_VERSION >= 5) {
print "";
print "".__("Importing using DOMDocument.")." ";
require_once "opml_domdoc.php";
opml_import_domdoc($link, $owner_uid);
print " ";
} else {
print_error(__("DOMXML extension is not found. It is required for PHP versions below 5."));
}
print "";
print "";
print "".
__('Close this window')." ";
print "
";
print "";
print "";
print "]]> ";
//return;
}
if ($id == "editPrefProfiles") {
print "".__('Settings Profiles')." ";
print "
".
__('Create profile')." ";
print "";
$result = db_query($link, "SELECT title,id FROM ttrss_settings_profiles
WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
print __('Select:')."
".__('All')." ,
".__('None')." ";
print "
";
print "";
print "]]> ";
//return;
}
if ($id == "pubOPMLUrl") {
print "".__('Public OPML URL')." ";
print "";
print "$url_path ";
print "";
print "";
print "".
__('Generate new URL')." ";
print "".
__('Close this window')." ";
print "
";
print "]]> ";
//return;
}
if ($id == "explainError") {
print "".__('Notice')." ";
print "";
if ($param == 1) {
print __("Update daemon is enabled in configuration, but daemon process is not running, which prevents all feeds from updating. Please start the daemon process or contact instance owner.");
$stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp");
print "" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);
}
if ($param == 2) {
$msg = check_for_update($link);
if (!$msg) {
print __("You are running the latest version of Tiny Tiny RSS. The fact that you are seeing this dialog is probably a bug.");
} else {
print $msg;
}
}
if ($param == 3) {
print __("Update daemon is taking too long to perform a feed update. This could indicate a problem like crash or a hang. Please check the daemon process or contact instance owner.");
$stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp");
print "
" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);
}
print "";
print "
";
print "";
print "
";
print "]]> ";
//return;
}
if ($id == "quickAddFeed") {
print " ";
print " ";
print "".__("Feed")."
";
print "";
print " ";
print " ";
if (get_pref($link, 'ENABLE_FEED_CATS')) {
print __('Place in category:') . " ";
print_feed_cat_select($link, "cat", false, 'dojoType="dijit.form.Select"');
}
print "
";
print '
' . __('Available feeds') . '
'.
'
'.
'
';
print "";
print "
".
__('This feed requires authentication.')."
";
print "";
print "
".__('Subscribe')."
".__('More feeds')."
".__('Cancel')."
";
//return;
}
if ($id == "feedBrowser") {
$browser_search = db_escape_string($_REQUEST["search"]);
# print "";
print "
".__('Search')."
".__('Cancel')."
";
print "]]>";
//return;
}
if ($id == "quickAddFilter") {
$active_feed_id = db_escape_string($_REQUEST["param"]);
print " ";
print " ";
print " ";
$result = db_query($link, "SELECT id,description
FROM ttrss_filter_types ORDER BY description");
$filter_types = array();
while ($line = db_fetch_assoc($result)) {
//array_push($filter_types, $line["description"]);
$filter_types[$line["id"]] = __($line["description"]);
}
print "".__("Match")."
";
print "";
print "";
$filter_params = array(
"before" => __("before"),
"after" => __("after"));
print_select_hash("filter_date_modifier", "before",
$filter_params, 'dojoType="dijit.form.Select"');
print " ";
print " ";
print "";
print " ".
__('Check it')." ";
print " ";
print " " . __("on field") . " ";
print_select_hash("filter_type", 1, $filter_types,
'onchange="filterDlgCheckType(this)" dojoType="dijit.form.Select"');
print " ";
print __("in") . " ";
print_feed_select($link, "feed_id", $active_feed_id,
'dojoType="dijit.form.FilteringSelect"');
print "
";
print "".__("Perform Action")."
";
print "";
print "";
$result = db_query($link, "SELECT id,description FROM ttrss_filter_actions
ORDER BY name");
while ($line = db_fetch_assoc($result)) {
printf("%s ", $line["id"], __($line["description"]));
}
print " ";
print "";
print " " . __("with parameters:") . " ";
print " ";
print_label_select($link, "action_param_label", $action_param,
'id="filterDlg_actionParamLabel" dojoType="dijit.form.Select"');
print " ";
print " "; // tiny layout hack
print "
";
print "".__("Options")."
";
print "";
print "
".__('Enabled')." ";
print "
".__('Inverse match')." ";
print "
";
print "";
print "".
__('Create')." ";
print "".
__('Cancel')." ";
print "
";
//return;
}
if ($id == "feedUpdateErrors") {
print "".__('Update Errors')." ";
print "";
while ($line = db_fetch_assoc($result)) {
print "" . $line["title"] . " (" . $line["feed_url"] . "): " .
"" . $line["last_error"] . " ";
}
print "";
print "";
print "
".
__('Close this window')." ";
print "]]>";
//return;
}
if ($id == "editArticleTags") {
print "
".__('Edit Tags')." ";
print "
";
print __("Tags for this article (separated by commas):")." ";
$tags = get_article_tags($link, $param);
$tags_str = join(", ", $tags);
print "";
print "";
print "";
print "
".__('Save')." ";
print "
".__('Cancel')." ";
print "]]>";
//return;
}
if ($id == "printTagCloud") {
print "
".__('Tag Cloud')." ";
print "
".__('more tags')."): ";
print "";
printTagCloud($link);
print "
";
print "";
print "".
__('Close this window')." ";
print "
";
print "]]> ";
//return;
}
if ($id == "emailArticle") {
print "
".__('Forward article by email')." ";
print "
";
$secretkey = sha1(uniqid(rand(), true));
$_SESSION['email_secretkey'] = $secretkey;
print " ";
print " ";
print " ";
$result = db_query($link, "SELECT email, full_name FROM ttrss_users WHERE
id = " . $_SESSION["uid"]);
$user_email = htmlspecialchars(db_fetch_result($result, 0, "email"));
$user_name = htmlspecialchars(db_fetch_result($result, 0, "full_name"));
if (!$user_name) $user_name = $_SESSION['name'];
$_SESSION['email_replyto'] = $user_email;
$_SESSION['email_fromname'] = $user_name;
require_once "lib/MiniTemplator.class.php";
$tpl = new MiniTemplator;
$tpl_t = new MiniTemplator;
$tpl->readTemplateFromFile("templates/email_article_template.txt");
$tpl->setVariable('USER_NAME', $_SESSION["name"]);
$tpl->setVariable('USER_EMAIL', $user_email);
$tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"]);
// $tpl->addBlock('header');
$result = db_query($link, "SELECT link, content, title
FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND
id IN ($param) AND owner_uid = " . $_SESSION["uid"]);
if (db_num_rows($result) > 1) {
$subject = __("[Forwarded]") . " " . __("Multiple articles");
}
while ($line = db_fetch_assoc($result)) {
if (!$subject)
$subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]);
$tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"]));
$tpl->setVariable('ARTICLE_URL', strip_tags($line["link"]));
$tpl->addBlock('article');
}
$tpl->addBlock('email');
$content = "";
$tpl->generateOutputToString($content);
print "";
print "";
print "";
print "";
print "";
print "".
__('Generate new URL')." ";
print "".
__('Close this window')." ";
print "
";
print "]]> ";
//return;
}
print "";
}
?>