@@ -54,7 +54,7 @@ |
||
| 54 | 54 | while ($line = $sth->fetch()) { |
| 55 | 55 | |
| 56 | 56 | if (!$subject) { |
| 57 | - $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); |
|
| 57 | + $subject = __("[Forwarded]")." ".htmlspecialchars($line["title"]); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); |
@@ -1,96 +1,96 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | class MailTo extends Plugin { |
| 3 | - private $host; |
|
| 3 | + private $host; |
|
| 4 | 4 | |
| 5 | - public function about() { |
|
| 6 | - return array(1.0, |
|
| 7 | - "Share article via email (using mailto: links, invoking your mail client)", |
|
| 8 | - "fox"); |
|
| 9 | - } |
|
| 5 | + public function about() { |
|
| 6 | + return array(1.0, |
|
| 7 | + "Share article via email (using mailto: links, invoking your mail client)", |
|
| 8 | + "fox"); |
|
| 9 | + } |
|
| 10 | 10 | |
| 11 | - public function init($host) { |
|
| 12 | - $this->host = $host; |
|
| 11 | + public function init($host) { |
|
| 12 | + $this->host = $host; |
|
| 13 | 13 | |
| 14 | - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); |
|
| 15 | - } |
|
| 14 | + $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function get_js() { |
|
| 18 | - return file_get_contents(dirname(__FILE__)."/init.js"); |
|
| 19 | - } |
|
| 17 | + public function get_js() { |
|
| 18 | + return file_get_contents(dirname(__FILE__)."/init.js"); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - public function hook_article_button($line) { |
|
| 22 | - return "<i class='material-icons' style=\"cursor : pointer\" |
|
| 21 | + public function hook_article_button($line) { |
|
| 22 | + return "<i class='material-icons' style=\"cursor : pointer\" |
|
| 23 | 23 | onclick=\"Plugins.Mailto.send(".$line["id"].")\" |
| 24 | 24 | title='".__('Forward by email')."'>mail_outline</i>"; |
| 25 | - } |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - public function emailArticle() { |
|
| 27 | + public function emailArticle() { |
|
| 28 | 28 | |
| 29 | - $ids = explode(",", $_REQUEST['param']); |
|
| 30 | - $ids_qmarks = arr_qmarks($ids); |
|
| 29 | + $ids = explode(",", $_REQUEST['param']); |
|
| 30 | + $ids_qmarks = arr_qmarks($ids); |
|
| 31 | 31 | |
| 32 | - require_once "lib/MiniTemplator.class.php"; |
|
| 32 | + require_once "lib/MiniTemplator.class.php"; |
|
| 33 | 33 | |
| 34 | - $tpl = new MiniTemplator; |
|
| 34 | + $tpl = new MiniTemplator; |
|
| 35 | 35 | |
| 36 | - $tpl->readTemplateFromFile("templates/email_article_template.txt"); |
|
| 36 | + $tpl->readTemplateFromFile("templates/email_article_template.txt"); |
|
| 37 | 37 | |
| 38 | - $tpl->setVariable('USER_NAME', $_SESSION["name"], true); |
|
| 39 | - //$tpl->setVariable('USER_EMAIL', $user_email, true); |
|
| 40 | - $tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"], true); |
|
| 38 | + $tpl->setVariable('USER_NAME', $_SESSION["name"], true); |
|
| 39 | + //$tpl->setVariable('USER_EMAIL', $user_email, true); |
|
| 40 | + $tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"], true); |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | - $sth = $this->pdo->prepare("SELECT DISTINCT link, content, title |
|
| 43 | + $sth = $this->pdo->prepare("SELECT DISTINCT link, content, title |
|
| 44 | 44 | FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND |
| 45 | 45 | id IN ($ids_qmarks) AND owner_uid = ?"); |
| 46 | - $sth->execute(array_merge($ids, [$_SESSION['uid']])); |
|
| 46 | + $sth->execute(array_merge($ids, [$_SESSION['uid']])); |
|
| 47 | 47 | |
| 48 | - if (count($ids) > 1) { |
|
| 49 | - $subject = __("[Forwarded]")." ".__("Multiple articles"); |
|
| 50 | - } else { |
|
| 51 | - $subject = ""; |
|
| 52 | - } |
|
| 48 | + if (count($ids) > 1) { |
|
| 49 | + $subject = __("[Forwarded]")." ".__("Multiple articles"); |
|
| 50 | + } else { |
|
| 51 | + $subject = ""; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - while ($line = $sth->fetch()) { |
|
| 54 | + while ($line = $sth->fetch()) { |
|
| 55 | 55 | |
| 56 | - if (!$subject) { |
|
| 57 | - $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); |
|
| 58 | - } |
|
| 56 | + if (!$subject) { |
|
| 57 | + $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); |
|
| 61 | - $tpl->setVariable('ARTICLE_URL', strip_tags($line["link"])); |
|
| 60 | + $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); |
|
| 61 | + $tpl->setVariable('ARTICLE_URL', strip_tags($line["link"])); |
|
| 62 | 62 | |
| 63 | - $tpl->addBlock('article'); |
|
| 64 | - } |
|
| 63 | + $tpl->addBlock('article'); |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - $tpl->addBlock('email'); |
|
| 66 | + $tpl->addBlock('email'); |
|
| 67 | 67 | |
| 68 | - $content = ""; |
|
| 69 | - $tpl->generateOutputToString($content); |
|
| 68 | + $content = ""; |
|
| 69 | + $tpl->generateOutputToString($content); |
|
| 70 | 70 | |
| 71 | - $mailto_link = htmlspecialchars("mailto:?subject=".rawurlencode($subject). |
|
| 72 | - "&body=".rawurlencode($content)); |
|
| 71 | + $mailto_link = htmlspecialchars("mailto:?subject=".rawurlencode($subject). |
|
| 72 | + "&body=".rawurlencode($content)); |
|
| 73 | 73 | |
| 74 | - print __("Clicking the following link to invoke your mail client:"); |
|
| 74 | + print __("Clicking the following link to invoke your mail client:"); |
|
| 75 | 75 | |
| 76 | - print "<div class='panel text-center'>"; |
|
| 77 | - print "<a target=\"_blank\" href=\"$mailto_link\">". |
|
| 78 | - __("Forward selected article(s) by email.")."</a>"; |
|
| 79 | - print "</div>"; |
|
| 76 | + print "<div class='panel text-center'>"; |
|
| 77 | + print "<a target=\"_blank\" href=\"$mailto_link\">". |
|
| 78 | + __("Forward selected article(s) by email.")."</a>"; |
|
| 79 | + print "</div>"; |
|
| 80 | 80 | |
| 81 | - print __("You should be able to edit the message before sending in your mail client."); |
|
| 81 | + print __("You should be able to edit the message before sending in your mail client."); |
|
| 82 | 82 | |
| 83 | - print "<p>"; |
|
| 83 | + print "<p>"; |
|
| 84 | 84 | |
| 85 | - print "<footer class='text-center'>"; |
|
| 86 | - print "<button dojoType='dijit.form.Button' onclick=\"dijit.byId('emailArticleDlg').hide()\">".__('Close this dialog')."</button>"; |
|
| 87 | - print "</footer>"; |
|
| 85 | + print "<footer class='text-center'>"; |
|
| 86 | + print "<button dojoType='dijit.form.Button' onclick=\"dijit.byId('emailArticleDlg').hide()\">".__('Close this dialog')."</button>"; |
|
| 87 | + print "</footer>"; |
|
| 88 | 88 | |
| 89 | - //return; |
|
| 90 | - } |
|
| 89 | + //return; |
|
| 90 | + } |
|
| 91 | 91 | |
| 92 | - public function api_version() { |
|
| 93 | - return 2; |
|
| 94 | - } |
|
| 92 | + public function api_version() { |
|
| 93 | + return 2; |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | 96 | } |
@@ -25,19 +25,19 @@ |
||
| 25 | 25 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | - $QR_BASEDIR = dirname(__FILE__).DIRECTORY_SEPARATOR; |
|
| 28 | + $QR_BASEDIR = dirname(__FILE__).DIRECTORY_SEPARATOR; |
|
| 29 | 29 | |
| 30 | - // Required libs |
|
| 30 | + // Required libs |
|
| 31 | 31 | |
| 32 | - include $QR_BASEDIR."qrconst.php"; |
|
| 33 | - include $QR_BASEDIR."qrconfig.php"; |
|
| 34 | - include $QR_BASEDIR."qrtools.php"; |
|
| 35 | - include $QR_BASEDIR."qrspec.php"; |
|
| 36 | - include $QR_BASEDIR."qrimage.php"; |
|
| 37 | - include $QR_BASEDIR."qrinput.php"; |
|
| 38 | - include $QR_BASEDIR."qrbitstream.php"; |
|
| 39 | - include $QR_BASEDIR."qrsplit.php"; |
|
| 40 | - include $QR_BASEDIR."qrrscode.php"; |
|
| 41 | - include $QR_BASEDIR."qrmask.php"; |
|
| 42 | - include $QR_BASEDIR."qrencode.php"; |
|
| 32 | + include $QR_BASEDIR."qrconst.php"; |
|
| 33 | + include $QR_BASEDIR."qrconfig.php"; |
|
| 34 | + include $QR_BASEDIR."qrtools.php"; |
|
| 35 | + include $QR_BASEDIR."qrspec.php"; |
|
| 36 | + include $QR_BASEDIR."qrimage.php"; |
|
| 37 | + include $QR_BASEDIR."qrinput.php"; |
|
| 38 | + include $QR_BASEDIR."qrbitstream.php"; |
|
| 39 | + include $QR_BASEDIR."qrsplit.php"; |
|
| 40 | + include $QR_BASEDIR."qrrscode.php"; |
|
| 41 | + include $QR_BASEDIR."qrmask.php"; |
|
| 42 | + include $QR_BASEDIR."qrencode.php"; |
|
| 43 | 43 | |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $outputCode .= "\n\n".$anotherCode."\n\n"; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $versionDataEx = explode("\n", file_get_contents($versionFile));
|
|
| 62 | + $versionDataEx = explode("\n", file_get_contents($versionFile));
|
|
| 63 | 63 | |
| 64 | 64 | $outputContents = file_get_contents($headerFile); |
| 65 | 65 | $outputContents .= "\n\n/*\n * Version: ".trim($versionDataEx[0])."\n * Build: ".trim($versionDataEx[1])."\n */\n\n"; |
@@ -33,4 +33,4 @@ |
||
| 33 | 33 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | - |
|
| 37 | 36 | \ No newline at end of file |
| 37 | + |
|
| 38 | 38 | \ No newline at end of file |
@@ -335,10 +335,10 @@ |
||
| 335 | 335 | |
| 336 | 336 | // Version information pattern ----------------------------------------- |
| 337 | 337 | |
| 338 | - // Version information pattern (BCH coded). |
|
| 338 | + // Version information pattern (BCH coded). |
|
| 339 | 339 | // See Table 1 in Appendix D (pp.68) of JIS X0510:2004. |
| 340 | 340 | |
| 341 | - // size: [QRSPEC_VERSION_MAX - 6] |
|
| 341 | + // size: [QRSPEC_VERSION_MAX - 6] |
|
| 342 | 342 | |
| 343 | 343 | public static $versionPattern = array( |
| 344 | 344 | 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, |
@@ -25,17 +25,17 @@ |
||
| 25 | 25 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | - define('N1', 3);
|
|
| 29 | - define('N2', 3);
|
|
| 30 | - define('N3', 40);
|
|
| 31 | - define('N4', 10);
|
|
| 28 | + define('N1', 3);
|
|
| 29 | + define('N2', 3);
|
|
| 30 | + define('N3', 40);
|
|
| 31 | + define('N4', 10);
|
|
| 32 | 32 | |
| 33 | - class QRmask {
|
|
| 33 | + class QRmask {
|
|
| 34 | 34 | |
| 35 | - public $runLength = array(); |
|
| 35 | + public $runLength = array(); |
|
| 36 | 36 | |
| 37 | - //---------------------------------------------------------------------- |
|
| 38 | - public function __construct() |
|
| 37 | + //---------------------------------------------------------------------- |
|
| 38 | + public function __construct() |
|
| 39 | 39 | {
|
| 40 | 40 | $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0); |
| 41 | 41 | } |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | abstract class FeedItem { |
| 3 | - abstract function get_id(); |
|
| 4 | - abstract function get_date(); |
|
| 5 | - abstract function get_link(); |
|
| 6 | - abstract function get_title(); |
|
| 7 | - abstract function get_description(); |
|
| 8 | - abstract function get_content(); |
|
| 9 | - abstract function get_comments_url(); |
|
| 10 | - abstract function get_comments_count(); |
|
| 11 | - abstract function get_categories(); |
|
| 12 | - abstract function get_enclosures(); |
|
| 13 | - abstract function get_author(); |
|
| 14 | - abstract function get_language(); |
|
| 3 | + abstract function get_id(); |
|
| 4 | + abstract function get_date(); |
|
| 5 | + abstract function get_link(); |
|
| 6 | + abstract function get_title(); |
|
| 7 | + abstract function get_description(); |
|
| 8 | + abstract function get_content(); |
|
| 9 | + abstract function get_comments_url(); |
|
| 10 | + abstract function get_comments_count(); |
|
| 11 | + abstract function get_categories(); |
|
| 12 | + abstract function get_enclosures(); |
|
| 13 | + abstract function get_author(); |
|
| 14 | + abstract function get_language(); |
|
| 15 | 15 | } |
| 16 | 16 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | interface IHandler { |
| 3 | - public function csrf_ignore($method); |
|
| 4 | - public function before($method); |
|
| 5 | - public function after(); |
|
| 3 | + public function csrf_ignore($method); |
|
| 4 | + public function before($method); |
|
| 5 | + public function after(); |
|
| 6 | 6 | } |
@@ -2,59 +2,59 @@ |
||
| 2 | 2 | |
| 3 | 3 | abstract class Plugin { |
| 4 | 4 | |
| 5 | - const API_VERSION_COMPAT = 1; |
|
| 5 | + const API_VERSION_COMPAT = 1; |
|
| 6 | 6 | |
| 7 | - /** |
|
| 8 | - * @var PDO |
|
| 9 | - */ |
|
| 10 | - protected $pdo; |
|
| 7 | + /** |
|
| 8 | + * @var PDO |
|
| 9 | + */ |
|
| 10 | + protected $pdo; |
|
| 11 | 11 | |
| 12 | - abstract function init(PluginHost $host); |
|
| 12 | + abstract function init(PluginHost $host); |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * @return array(version, name, description, author, false) |
|
| 16 | - */ |
|
| 17 | - abstract function about(); |
|
| 14 | + /** |
|
| 15 | + * @return array(version, name, description, author, false) |
|
| 16 | + */ |
|
| 17 | + abstract function about(); |
|
| 18 | 18 | |
| 19 | - public function __construct() { |
|
| 20 | - $this->pdo = Db::pdo(); |
|
| 21 | - } |
|
| 19 | + public function __construct() { |
|
| 20 | + $this->pdo = Db::pdo(); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - public function flags() { |
|
| 24 | - /* associative array, possible keys: |
|
| 23 | + public function flags() { |
|
| 24 | + /* associative array, possible keys: |
|
| 25 | 25 | needs_curl = boolean |
| 26 | 26 | */ |
| 27 | - return array(); |
|
| 28 | - } |
|
| 27 | + return array(); |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - public function is_public_method() { |
|
| 31 | - return false; |
|
| 32 | - } |
|
| 30 | + public function is_public_method() { |
|
| 31 | + return false; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - public function get_js() { |
|
| 35 | - return ""; |
|
| 36 | - } |
|
| 34 | + public function get_js() { |
|
| 35 | + return ""; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - public function get_prefs_js() { |
|
| 39 | - return ""; |
|
| 40 | - } |
|
| 38 | + public function get_prefs_js() { |
|
| 39 | + return ""; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - public function api_version() { |
|
| 43 | - return Plugin::API_VERSION_COMPAT; |
|
| 44 | - } |
|
| 42 | + public function api_version() { |
|
| 43 | + return Plugin::API_VERSION_COMPAT; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public function __($msgid) { |
|
| 47 | - return _dgettext(PluginHost::object_to_domain($this), $msgid); |
|
| 48 | - } |
|
| 46 | + public function __($msgid) { |
|
| 47 | + return _dgettext(PluginHost::object_to_domain($this), $msgid); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - public function _ngettext($singular, $plural, $number) { |
|
| 51 | - return _dngettext(PluginHost::object_to_domain($this), $singular, $plural, $number); |
|
| 52 | - } |
|
| 50 | + public function _ngettext($singular, $plural, $number) { |
|
| 51 | + return _dngettext(PluginHost::object_to_domain($this), $singular, $plural, $number); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - public function T_sprintf() { |
|
| 55 | - $args = func_get_args(); |
|
| 56 | - $msgid = array_shift($args); |
|
| 54 | + public function T_sprintf() { |
|
| 55 | + $args = func_get_args(); |
|
| 56 | + $msgid = array_shift($args); |
|
| 57 | 57 | |
| 58 | - return vsprintf($this->__($msgid), $args); |
|
| 59 | - } |
|
| 58 | + return vsprintf($this->__($msgid), $args); |
|
| 59 | + } |
|
| 60 | 60 | } |