本文整理汇总了PHP中PluginHost类的典型用法代码示例。如果您正苦于以下问题:PHP PluginHost类的具体用法?PHP PluginHost怎么用?PHP PluginHost使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginHost类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Error Log') . "\">";
if (LOG_DESTINATION == "sql") {
$result = $this->dbh->query("SELECT errno, errstr, filename, lineno,\n\t\t\t\tcreated_at, login FROM ttrss_error_log\n\t\t\t\tLEFT JOIN ttrss_users ON (owner_uid = ttrss_users.id)\n\t\t\t\tORDER BY ttrss_error_log.id DESC\n\t\t\t\tLIMIT 100");
print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"updateSystemList()\">" . __('Refresh') . "</button> ";
print " <button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"clearSqlLog()\">" . __('Clear log') . "</button> ";
print "<p><table width=\"100%\" cellspacing=\"10\" class=\"prefErrorLog\">";
print "<tr class=\"title\">\n\t\t\t\t<td width='5%'>" . __("Error") . "</td>\n\t\t\t\t<td>" . __("Filename") . "</td>\n\t\t\t\t<td>" . __("Message") . "</td>\n\t\t\t\t<td width='5%'>" . __("User") . "</td>\n\t\t\t\t<td width='5%'>" . __("Date") . "</td>\n\t\t\t\t</tr>";
while ($line = $this->dbh->fetch_assoc($result)) {
print "<tr class=\"errrow\">";
foreach ($line as $k => $v) {
$line[$k] = htmlspecialchars($v);
}
print "<td class='errno'>" . Logger::$errornames[$line["errno"]] . " (" . $line["errno"] . ")</td>";
print "<td class='filename'>" . $line["filename"] . ":" . $line["lineno"] . "</td>";
print "<td class='errstr'>" . $line["errstr"] . "</td>";
print "<td class='login'>" . $line["login"] . "</td>";
print "<td class='timestamp'>" . make_local_datetime($line["created_at"], false) . "</td>";
print "</tr>";
}
print "</table>";
} else {
print_notice("Please set LOG_DESTINATION to 'sql' in config.php to enable database logging.");
}
print "</div>";
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "hook_prefs_tab", "prefSystem");
print "</div>";
#container
}
示例2: catchall
function catchall($method)
{
$plugin = PluginHost::getInstance()->get_plugin($_REQUEST["plugin"]);
if ($plugin) {
if (method_exists($plugin, $method)) {
$plugin->{$method}();
} else {
print error_json(13);
}
} else {
print error_json(14);
}
}
示例3: catchall
function catchall($method)
{
$plugin = PluginHost::getInstance()->get_plugin($_REQUEST["plugin"]);
if (!$plugin) {
print json_encode(array("error" => "PLUGIN_NOT_FOUND"));
return;
}
if (!method_exists($plugin, $method)) {
print json_encode(array("error" => "METHOD_NOT_FOUND"));
return;
}
$plugin->{$method}();
}
示例4: housekeeping_common
function housekeeping_common($debug)
{
expire_cached_files($debug);
expire_lock_files($debug);
expire_error_log($debug);
$count = update_feedbrowser_cache();
_debug("Feedbrowser updated, {$count} feeds processed.");
purge_orphans(true);
$rc = cleanup_tags(14, 50000);
_debug("Cleaned {$rc} cached tags.");
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_HOUSE_KEEPING, "hook_house_keeping", "");
}
示例5: startup_gettext
require_once "sessions.php";
require_once "functions.php";
require_once "sanity_check.php";
require_once "config.php";
require_once "db.php";
require_once "db-prefs.php";
startup_gettext();
$script_started = microtime(true);
if (!init_plugins()) {
return;
}
if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) {
ob_start("ob_gzhandler");
}
$method = $_REQUEST["op"];
$override = PluginHost::getInstance()->lookup_handler("public", $method);
if ($override) {
$handler = $override;
} else {
$handler = new Handler_Public($_REQUEST);
}
if (implements_interface($handler, "IHandler") && $handler->before($method)) {
if ($method && method_exists($handler, $method)) {
$handler->{$method}();
} else {
if (method_exists($handler, 'index')) {
$handler->index();
}
}
$handler->after();
return;
示例6: api_get_headlines
static function api_get_headlines($feed_id, $limit, $offset, $filter, $is_cat, $show_excerpt, $show_content, $view_mode, $order, $include_attachments, $since_id, $search = "", $include_nested = false, $sanitize_content = true, $force_update = false, $excerpt_length = 100, $check_first_id = false)
{
if ($force_update && $feed_id > 0 && is_numeric($feed_id)) {
// Update the feed if required with some basic flood control
$result = db_query("SELECT cache_images," . SUBSTRING_FOR_DATE . "(last_updated,1,19) AS last_updated\n\t\t\t\t\t\tFROM ttrss_feeds WHERE id = '{$feed_id}'");
if (db_num_rows($result) != 0) {
$last_updated = strtotime(db_fetch_result($result, 0, "last_updated"));
$cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images"));
if (!$cache_images && time() - $last_updated > 120) {
include "rssfuncs.php";
update_rss_feed($feed_id, true, true);
} else {
db_query("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01'\n\t\t\t\t\t\t\tWHERE id = '{$feed_id}'");
}
}
}
/*$qfh_ret = queryFeedHeadlines($feed_id, $limit,
$view_mode, $is_cat, $search, false,
$order, $offset, 0, false, $since_id, $include_nested);*/
//function queryFeedHeadlines($feed, $limit,
// $view_mode, $cat_view, $search, $search_mode,
// $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false,
// $ignore_vfeed_group = false, $override_strategy = false, $override_vfeed = false, $start_ts = false, $check_top_id = false) {
$params = array("feed" => $feed_id, "limit" => $limit, "view_mode" => $view_mode, "cat_view" => $is_cat, "search" => $search, "override_order" => $order, "offset" => $offset, "since_id" => $since_id, "include_children" => $include_nested, "check_first_id" => $check_first_id, "api_request" => true);
$qfh_ret = queryFeedHeadlines($params);
$result = $qfh_ret[0];
$feed_title = $qfh_ret[1];
$first_id = $qfh_ret[6];
$headlines = array();
$headlines_header = array('id' => $feed_id, 'first_id' => $first_id, 'is_cat' => $is_cat);
if (!is_numeric($result)) {
while ($line = db_fetch_assoc($result)) {
$line["content_preview"] = truncate_string(strip_tags($line["content"]), $excerpt_length);
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
$line = $p->hook_query_headlines($line, $excerpt_length, true);
}
$is_updated = $line["last_read"] == "" && ($line["unread"] != "t" && $line["unread"] != "1");
$tags = explode(",", $line["tag_cache"]);
$label_cache = $line["label_cache"];
$labels = false;
if ($label_cache) {
$label_cache = json_decode($label_cache, true);
if ($label_cache) {
if ($label_cache["no-labels"] == 1) {
$labels = array();
} else {
$labels = $label_cache;
}
}
}
if (!is_array($labels)) {
$labels = get_article_labels($line["id"]);
}
//if (!$tags) $tags = get_article_tags($line["id"]);
//if (!$labels) $labels = get_article_labels($line["id"]);
$headline_row = array("id" => (int) $line["id"], "unread" => sql_bool_to_bool($line["unread"]), "marked" => sql_bool_to_bool($line["marked"]), "published" => sql_bool_to_bool($line["published"]), "updated" => (int) strtotime($line["updated"]), "is_updated" => $is_updated, "title" => $line["title"], "link" => $line["link"], "feed_id" => $line["feed_id"], "tags" => $tags);
if ($include_attachments) {
$headline_row['attachments'] = get_article_enclosures($line['id']);
}
if ($show_excerpt) {
$headline_row["excerpt"] = $line["content_preview"];
}
if ($show_content) {
if ($sanitize_content) {
$headline_row["content"] = sanitize($line["content"], sql_bool_to_bool($line['hide_images']), false, $line["site_url"], false, $line["id"]);
} else {
$headline_row["content"] = $line["content"];
}
}
// unify label output to ease parsing
if ($labels["no-labels"] == 1) {
$labels = array();
}
$headline_row["labels"] = $labels;
$headline_row["feed_title"] = $line["feed_title"] ? $line["feed_title"] : $feed_title;
$headline_row["comments_count"] = (int) $line["num_comments"];
$headline_row["comments_link"] = $line["comments"];
$headline_row["always_display_attachments"] = sql_bool_to_bool($line["always_display_enclosures"]);
$headline_row["author"] = $line["author"];
$headline_row["score"] = (int) $line["score"];
$headline_row["note"] = $line["note"];
$headline_row["lang"] = $line["lang"];
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_API) as $p) {
$headline_row = $p->hook_render_article_api(array("headline" => $headline_row));
}
array_push($headlines, $headline_row);
}
} else {
if (is_numeric($result) && $result == -1) {
$headlines_header['first_id_changed'] = true;
}
}
return array($headlines, $headlines_header);
}
示例7: subscribe_to_feed
/**
* @return array (code => Status code, message => error message if available)
*
* 0 - OK, Feed already exists
* 1 - OK, Feed added
* 2 - Invalid URL
* 3 - URL content is HTML, no feeds available
* 4 - URL content is HTML which contains multiple feeds.
* Here you should call extractfeedurls in rpc-backend
* to get all possible feeds.
* 5 - Couldn't download the URL content.
* 6 - Content is an invalid XML.
*/
function subscribe_to_feed($url, $cat_id = 0, $auth_login = '', $auth_pass = '')
{
global $fetch_last_error;
require_once "include/rssfuncs.php";
$url = fix_url($url);
if (!$url || !validate_feed_url($url)) {
return array("code" => 2);
}
$contents = @fetch_file_contents($url, false, $auth_login, $auth_pass);
if (!$contents) {
return array("code" => 5, "message" => $fetch_last_error);
}
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) {
$contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass);
}
if (is_html($contents)) {
$feedUrls = get_feeds_from_html($url, $contents);
if (count($feedUrls) == 0) {
return array("code" => 3);
} else {
if (count($feedUrls) > 1) {
return array("code" => 4, "feeds" => $feedUrls);
}
}
//use feed url as new URL
$url = key($feedUrls);
}
if ($cat_id == "0" || !$cat_id) {
$cat_qpart = "NULL";
} else {
$cat_qpart = "'{$cat_id}'";
}
$result = db_query("SELECT id FROM ttrss_feeds\n\t\t\tWHERE feed_url = '{$url}' AND owner_uid = " . $_SESSION["uid"]);
if (strlen(FEED_CRYPT_KEY) > 0) {
require_once "crypt.php";
$auth_pass = substr(encrypt_string($auth_pass), 0, 250);
$auth_pass_encrypted = 'true';
} else {
$auth_pass_encrypted = 'false';
}
$auth_pass = db_escape_string($auth_pass);
if (db_num_rows($result) == 0) {
$result = db_query("INSERT INTO ttrss_feeds\n\t\t\t\t\t(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)\n\t\t\t\tVALUES ('" . $_SESSION["uid"] . "', '{$url}',\n\t\t\t\t'[Unknown]', {$cat_qpart}, '{$auth_login}', '{$auth_pass}', 0, {$auth_pass_encrypted})");
$result = db_query("SELECT id FROM ttrss_feeds WHERE feed_url = '{$url}'\n\t\t\t\t\tAND owner_uid = " . $_SESSION["uid"]);
$feed_id = db_fetch_result($result, 0, "id");
if ($feed_id) {
set_basic_feed_info($feed_id);
}
return array("code" => 1);
} else {
return array("code" => 0);
}
}
示例8: __
?>
<div id="userConfigTab" dojoType="dijit.layout.ContentPane"
href="backend.php?op=pref-users"
title="<?php
echo __('Users');
?>
"></div>
<div id="systemConfigTab" dojoType="dijit.layout.ContentPane"
href="backend.php?op=pref-system"
title="<?php
echo __('System');
?>
"></div>
<?php
}
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TABS, "hook_prefs_tabs", false);
?>
</div>
<div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
<a class="insensitive" target="_blank" href="http://tt-rss.org/">
Tiny Tiny RSS</a>
<?php
if (!defined('HIDE_VERSION')) {
?>
v<?php
echo VERSION;
?>
<?php
}
?>
示例9: array
$filter["rule"] = array(json_encode(array("reg_exp" => $line["reg_exp"], "feed_id" => $feed_id, "filter_type" => $line["filter_type"])));
$filter["action"] = array(json_encode(array("action_id" => $line["action_id"], "action_param_label" => $line["action_param"], "action_param" => $line["action_param"])));
// Oh god it's full of hacks
$_REQUEST = $filter;
$_SESSION["uid"] = $owner_uid;
$filters = new Pref_Filters($link, $_REQUEST);
$filters->add();
}
}
}
if (in_array("-force-update", $op)) {
_debug("marking all feeds as needing update...");
db_query($link, "UPDATE ttrss_feeds SET last_update_started = '1970-01-01',\n\t\t\t\tlast_updated = '1970-01-01'");
}
if (in_array("-list-plugins", $op)) {
$tmppluginhost = new PluginHost($link);
$tmppluginhost->load_all($tmppluginhost::KIND_ALL);
$enabled = array_map("trim", explode(",", PLUGINS));
echo "List of all available plugins:\n";
foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
$about = $plugin->about();
$status = $about[3] ? "system" : "user";
if (in_array($name, $enabled)) {
$name .= "*";
}
printf("%-50s %-10s v%.2f (by %s)\n%s\n\n", $name, $status, $about[0], $about[2], $about[1]);
}
echo "Plugins marked by * are currently enabled for all users.\n";
}
$pluginhost->run_commands($op);
db_close($link);
示例10: create_published_article
static function create_published_article($title, $url, $content, $labels_str, $owner_uid)
{
$guid = 'SHA1:' . sha1("ttshared:" . $url . $owner_uid);
// include owner_uid to prevent global GUID clash
if (!$content) {
$pluginhost = new PluginHost();
$pluginhost->load_all(PluginHost::KIND_ALL, $owner_uid);
$pluginhost->load_data();
$af_readability = $pluginhost->get_plugin("Af_Readability");
if ($af_readability) {
$enable_share_anything = $pluginhost->get($af_readability, "enable_share_anything");
if ($enable_share_anything) {
$extracted_content = $af_readability->extract_content($url);
if ($extracted_content) {
$content = db_escape_string($extracted_content);
}
}
}
}
$content_hash = sha1($content);
if ($labels_str != "") {
$labels = explode(",", $labels_str);
} else {
$labels = array();
}
$rc = false;
if (!$title) {
$title = $url;
}
if (!$title && !$url) {
return false;
}
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
return false;
}
db_query("BEGIN");
// only check for our user data here, others might have shared this with different content etc
$result = db_query("SELECT id FROM ttrss_entries, ttrss_user_entries WHERE\n\t\t\tguid = '{$guid}' AND ref_id = id AND owner_uid = '{$owner_uid}' LIMIT 1");
if (db_num_rows($result) != 0) {
$ref_id = db_fetch_result($result, 0, "id");
$result = db_query("SELECT int_id FROM ttrss_user_entries WHERE\n\t\t\t\tref_id = '{$ref_id}' AND owner_uid = '{$owner_uid}' LIMIT 1");
if (db_num_rows($result) != 0) {
$int_id = db_fetch_result($result, 0, "int_id");
db_query("UPDATE ttrss_entries SET\n\t\t\t\t\tcontent = '{$content}', content_hash = '{$content_hash}' WHERE id = '{$ref_id}'");
db_query("UPDATE ttrss_user_entries SET published = true,\n\t\t\t\t\t\tlast_published = NOW() WHERE\n\t\t\t\t\t\tint_id = '{$int_id}' AND owner_uid = '{$owner_uid}'");
} else {
db_query("INSERT INTO ttrss_user_entries\n\t\t\t\t\t(ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache,\n\t\t\t\t\t\tlast_read, note, unread, last_published)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('{$ref_id}', '', NULL, NULL, {$owner_uid}, true, '', '', NOW(), '', false, NOW())");
}
if (count($labels) != 0) {
foreach ($labels as $label) {
label_add_article($ref_id, trim($label), $owner_uid);
}
}
$rc = true;
} else {
$result = db_query("INSERT INTO ttrss_entries\n\t\t\t\t(title, guid, link, updated, content, content_hash, date_entered, date_updated)\n\t\t\t\tVALUES\n\t\t\t\t('{$title}', '{$guid}', '{$url}', NOW(), '{$content}', '{$content_hash}', NOW(), NOW())");
$result = db_query("SELECT id FROM ttrss_entries WHERE guid = '{$guid}'");
if (db_num_rows($result) != 0) {
$ref_id = db_fetch_result($result, 0, "id");
db_query("INSERT INTO ttrss_user_entries\n\t\t\t\t\t(ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache,\n\t\t\t\t\t\tlast_read, note, unread, last_published)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('{$ref_id}', '', NULL, NULL, {$owner_uid}, true, '', '', NOW(), '', false, NOW())");
if (count($labels) != 0) {
foreach ($labels as $label) {
label_add_article($ref_id, trim($label), $owner_uid);
}
}
$rc = true;
}
}
db_query("COMMIT");
return $rc;
}
示例11: search
function search()
{
$this->params = explode(":", $this->dbh->escape_string($_REQUEST["param"]), 2);
$active_feed_id = sprintf("%d", $this->params[0]);
$is_cat = $this->params[1] != "false";
print "<div class=\"dlgSec\">" . __('Look for') . "</div>";
print "<div class=\"dlgSecCont\">";
print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\tstyle=\"font-size : 16px; width : 20em;\"\n\t\t\trequired=\"1\" name=\"query\" type=\"search\" value=''>";
print "<hr/><span style='float : right'>" . T_sprintf('in %s', getFeedTitle($active_feed_id, $is_cat)) . "</span>";
print "</div>";
print "<div class=\"dlgButtons\">";
if (count(PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SEARCH)) == 0) {
print "<div style=\"float : left\">\n\t\t\t\t<a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/wiki/SearchSyntax\">" . __("Search syntax") . "</a>\n\t\t\t\t</div>";
}
print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">" . __('Search') . "</button>\n\t\t<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">" . __('Cancel') . "</button>\n\t\t</div>";
}
示例12: index
function index()
{
if (!function_exists('curl_init')) {
print "<div style='padding : 1em'>";
print_error("This functionality requires CURL functions. Please enable CURL in your PHP configuration (you might also want to disable open_basedir in php.ini) and reload this page.");
print "</div>";
}
print "<div id=\"pref-instance-wrap\" dojoType=\"dijit.layout.BorderContainer\" gutters=\"false\">";
print "<div id=\"pref-instance-header\" dojoType=\"dijit.layout.ContentPane\" region=\"top\">";
print "<div id=\"pref-instance-toolbar\" dojoType=\"dijit.Toolbar\">";
$sort = db_escape_string($_REQUEST["sort"]);
if (!$sort || $sort == "undefined") {
$sort = "access_url";
}
print "<div dojoType=\"dijit.form.DropDownButton\">" . "<span>" . __('Select') . "</span>";
print "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
print "<div onclick=\"selectTableRows('prefInstanceList', 'all')\"\n\t\t\tdojoType=\"dijit.MenuItem\">" . __('All') . "</div>";
print "<div onclick=\"selectTableRows('prefInstanceList', 'none')\"\n\t\t\tdojoType=\"dijit.MenuItem\">" . __('None') . "</div>";
print "</div></div>";
print "<button dojoType=\"dijit.form.Button\" onclick=\"addInstance()\">" . __('Link instance') . "</button>";
print "<button dojoType=\"dijit.form.Button\" onclick=\"editSelectedInstance()\">" . __('Edit') . "</button>";
print "<button dojoType=\"dijit.form.Button\" onclick=\"removeSelectedInstances()\">" . __('Remove') . "</button>";
print "</div>";
#toolbar
$result = db_query("SELECT *,\n\t\t\t(SELECT COUNT(*) FROM ttrss_linked_feeds\n\t\t\t\tWHERE instance_id = ttrss_linked_instances.id) AS num_feeds\n\t\t\tFROM ttrss_linked_instances\n\t\t\tORDER BY {$sort}");
print "<p class=\"insensitive\" style='margin-left : 1em;'>" . __("You can connect other instances of Tiny Tiny RSS to this one to share Popular feeds. Link to this instance of Tiny Tiny RSS by using this URL:");
print " <a href=\"#\" onclick=\"alert('" . htmlspecialchars(get_self_url_prefix()) . "')\">(display url)</a>";
print "<p><table width='100%' id='prefInstanceList' class='prefInstanceList' cellspacing='0'>";
print "<tr class=\"title\">\n\t\t\t<td align='center' width=\"5%\"> </td>\n\t\t\t<td width=''><a href=\"#\" onclick=\"updateInstanceList('access_url')\">" . __('Instance URL') . "</a></td>\n\t\t\t<td width='20%'><a href=\"#\" onclick=\"updateInstanceList('access_key')\">" . __('Access key') . "</a></td>\n\t\t\t<td width='10%'><a href=\"#\" onclick=\"updateUsersList('last_connected')\">" . __('Last connected') . "</a></td>\n\t\t\t<td width='10%'><a href=\"#\" onclick=\"updateUsersList('last_status_out')\">" . __('Status') . "</a></td>\n\t\t\t<td width='10%'><a href=\"#\" onclick=\"updateUsersList('num_feeds')\">" . __('Stored feeds') . "</a></td>\n\t\t\t</tr>";
$lnum = 0;
while ($line = db_fetch_assoc($result)) {
$class = $lnum % 2 ? "even" : "odd";
$id = $line['id'];
$this_row_id = "id=\"LIRR-{$id}\"";
$line["last_connected"] = make_local_datetime($line["last_connected"], false);
print "<tr class=\"{$class}\" {$this_row_id}>";
print "<td align='center'><input onclick='toggleSelectRow(this);'\n\t\t\t\ttype=\"checkbox\" id=\"LICHK-{$id}\"></td>";
$onclick = "onclick='editInstance({$id}, event)' title='" . __('Click to edit') . "'";
$access_key = mb_substr($line['access_key'], 0, 4) . '...' . mb_substr($line['access_key'], -4);
print "<td {$onclick}>" . htmlspecialchars($line['access_url']) . "</td>";
print "<td {$onclick}>" . htmlspecialchars($access_key) . "</td>";
print "<td {$onclick}>" . htmlspecialchars($line['last_connected']) . "</td>";
print "<td {$onclick}>" . $this->status_codes[$line['last_status_out']] . "</td>";
print "<td {$onclick}>" . htmlspecialchars($line['num_feeds']) . "</td>";
print "</tr>";
++$lnum;
}
print "</table>";
print "</div>";
#pane
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "hook_prefs_tab", "prefInstances");
print "</div>";
#container
}
示例13: __
</div>
<!-- <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php
echo __('Create label...');
?>
</div>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php
echo __('Create filter...');
?>
</div> -->
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcHKhelp')"><?php
echo __('Keyboard shortcuts help');
?>
</div>
<?php
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ACTION_ITEM) as $p) {
echo $p->hook_action_item();
}
?>
<?php
if (!$_SESSION["hide_logout"]) {
?>
<div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcLogout')"><?php
echo __('Logout');
?>
</div>
<?php
}
?>
</div>
示例14: format_article_enclosures
function format_article_enclosures($id, $always_display_enclosures, $article_content, $hide_images = false)
{
$result = get_article_enclosures($id);
$rv = '';
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FORMAT_ENCLOSURES) as $plugin) {
$retval = $plugin->hook_format_enclosures($rv, $result, $id, $always_display_enclosures, $article_content, $hide_images);
if (is_array($retval)) {
$rv = $retval[0];
$result = $retval[1];
} else {
$rv = $retval;
}
}
if ($rv === '' && !empty($result)) {
$entries_html = array();
$entries = array();
$entries_inline = array();
foreach ($result as $line) {
$url = $line["content_url"];
$ctype = $line["content_type"];
$title = $line["title"];
$width = $line["width"];
$height = $line["height"];
if (!$ctype) {
$ctype = __("unknown type");
}
$filename = substr($url, strrpos($url, "/") + 1);
$player = format_inline_player($url, $ctype);
if ($player) {
array_push($entries_inline, $player);
}
# $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" .
# $filename . " (" . $ctype . ")" . "</a>";
$entry = "<div onclick=\"window.open('" . htmlspecialchars($url) . "')\"\n\t\t\t\t\tdojoType=\"dijit.MenuItem\">{$filename} ({$ctype})</div>";
array_push($entries_html, $entry);
$entry = array();
$entry["type"] = $ctype;
$entry["filename"] = $filename;
$entry["url"] = $url;
$entry["title"] = $title;
$entry["width"] = $width;
$entry["height"] = $height;
array_push($entries, $entry);
}
if ($_SESSION['uid'] && !get_pref("STRIP_IMAGES") && !$_SESSION["bw_limit"]) {
if ($always_display_enclosures || !preg_match("/<img/i", $article_content)) {
foreach ($entries as $entry) {
if (preg_match("/image/", $entry["type"]) || preg_match("/\\.(jpg|png|gif|bmp)/i", $entry["filename"])) {
if (!$hide_images) {
$encsize = '';
if ($entry['height'] > 0) {
$encsize .= ' height="' . intval($entry['width']) . '"';
}
if ($entry['width'] > 0) {
$encsize .= ' width="' . intval($entry['height']) . '"';
}
$rv .= "<p><img\n\t\t\t\t\t\t\t\t\talt=\"" . htmlspecialchars($entry["filename"]) . "\"\n\t\t\t\t\t\t\t\t\tsrc=\"" . htmlspecialchars($entry["url"]) . "\"\n\t\t\t\t\t\t\t\t\t" . $encsize . " /></p>";
} else {
$rv .= "<p><a target=\"_blank\"\n\t\t\t\t\t\t\t\t\thref=\"" . htmlspecialchars($entry["url"]) . "\"\n\t\t\t\t\t\t\t\t\t>" . htmlspecialchars($entry["url"]) . "</a></p>";
}
if ($entry['title']) {
$rv .= "<div class=\"enclosure_title\">{$entry['title']}</div>";
}
}
}
}
}
if (count($entries_inline) > 0) {
$rv .= "<hr clear='both'/>";
foreach ($entries_inline as $entry) {
$rv .= $entry;
}
$rv .= "<hr clear='both'/>";
}
$rv .= "<select class=\"attachments\" onchange=\"openSelectedAttachment(this)\">" . "<option value=''>" . __('Attachments') . "</option>";
foreach ($entries as $entry) {
if ($entry["title"]) {
$title = "— " . truncate_string($entry["title"], 30);
} else {
$title = "";
}
$rv .= "<option value=\"" . htmlspecialchars($entry["url"]) . "\">" . htmlspecialchars($entry["filename"]) . "{$title}</option>";
}
$rv .= "</select>";
}
return $rv;
}
示例15: search
function search()
{
$this->params = explode(":", $this->dbh->escape_string($_REQUEST["param"]), 2);
$active_feed_id = sprintf("%d", $this->params[0]);
$is_cat = $this->params[1] != "false";
print "<div class=\"dlgSec\">" . __('Look for') . "</div>";
print "<div class=\"dlgSecCont\">";
print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\tstyle=\"font-size : 16px; width : 20em;\"\n\t\t\trequired=\"1\" name=\"query\" type=\"search\" value=''>";
print "<hr/>" . __('Limit search to:') . " ";
print "<select name=\"search_mode\" dojoType=\"dijit.form.Select\">\n\t\t\t<option value=\"all_feeds\">" . __('All feeds') . "</option>";
$feed_title = getFeedTitle($active_feed_id);
if (!$is_cat) {
$feed_cat_title = getFeedCatTitle($active_feed_id);
} else {
$feed_cat_title = getCategoryTitle($active_feed_id);
}
if ($active_feed_id && !$is_cat) {
print "<option selected=\"1\" value=\"this_feed\">{$feed_title}</option>";
} else {
print "<option disabled=\"1\" value=\"false\">" . __('This feed') . "</option>";
}
if ($is_cat) {
$cat_preselected = "selected=\"1\"";
}
if (get_pref('ENABLE_FEED_CATS') && ($active_feed_id > 0 || $is_cat)) {
print "<option {$cat_preselected} value=\"this_cat\">{$feed_cat_title}</option>";
} else {
//print "<option disabled>".__('This category')."</option>";
}
print "</select>";
print "</div>";
print "<div class=\"dlgButtons\">";
if (count(PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SEARCH)) == 0) {
print "<div style=\"float : left\">\n\t\t\t\t<a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/wiki/SearchSyntax\">" . __("Search syntax") . "</a>\n\t\t\t\t</div>";
}
print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').execute()\">" . __('Search') . "</button>\n\t\t<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('searchDlg').hide()\">" . __('Cancel') . "</button>\n\t\t</div>";
}