summaryrefslogtreecommitdiff
path: root/plugins/share
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-16 22:07:37 +0300
committerAndrew Dolgov <[email protected]>2021-02-16 22:07:37 +0300
commit0fc783e2b350b8ac6ff275fd9b201674cbcf2c16 (patch)
treee3b88e90f25d40791acb01e178acded2d0d994a7 /plugins/share
parent89e8176c6912f757f400dd47d3495502db0b7322 (diff)
cleanup markup in some plugins, make nsfw generate dijit widgets
Diffstat (limited to 'plugins/share')
-rw-r--r--plugins/share/init.php52
1 files changed, 23 insertions, 29 deletions
diff --git a/plugins/share/init.php b/plugins/share/init.php
index 42923ed8a..846e1f39c 100644
--- a/plugins/share/init.php
+++ b/plugins/share/init.php
@@ -41,14 +41,14 @@ class Share extends Plugin {
function hook_prefs_tab_section($id) {
if ($id == "prefFeedsPublishedGenerated") {
+ ?>
+ <hr/>
- print "<hr/>";
-
- print "<h2>" . __("You can disable all articles shared by unique URLs here.") . "</h2>";
-
- print "<button class='alt-danger' dojoType='dijit.form.Button' onclick=\"return Plugins.Share.clearKeys()\">".
- __('Unshare all articles')."</button> ";
+ <h2><?= __("You can disable all articles shared by unique URLs here.") ?></h2>
+ <button class='alt-danger' dojoType='dijit.form.Button' onclick="return Plugins.Share.clearKeys()">
+ <?= __('Unshare all articles') ?></button>
+ <?php
}
}
@@ -100,39 +100,33 @@ class Share extends Plugin {
$sth->execute([$uuid, $param, $_SESSION['uid']]);
}
- print "<header>" . __("You can share this article by the following unique URL:") . "</header>";
+ $url_path = htmlspecialchars(get_self_url_prefix() . "/public.php?op=share&key=$uuid");
- $url_path = get_self_url_prefix();
- $url_path .= "/public.php?op=share&key=$uuid";
+ ?>
- print "<section>
- <div class='panel text-center'>
- <a id='gen_article_url' href='$url_path' target='_blank' rel='noopener noreferrer'>$url_path</a>
- </div>
- </section>";
+ <header><?= __("You can share this article by the following unique URL:") ?></header>
- /* if (!label_find_id(__('Shared'), $_SESSION["uid"]))
- label_create(__('Shared'), $_SESSION["uid"]);
- label_add_article($ref_id, __('Shared'), $_SESSION['uid']); */
+ <section>
+ <div class='panel text-center'>
+ <a id='gen_article_url' href="<?= $url_path ?>"
+ target='_blank' rel='noopener noreferrer'><?= $url_path ?></a>
+ </div>
+ </section>
+ <?php
} else {
print "Article not found.";
}
- print "<footer class='text-center'>";
-
- print "<button dojoType='dijit.form.Button' onclick=\"return App.dialogOf(this).unshare()\">".
- __('Unshare article')."</button>";
-
- print "<button dojoType='dijit.form.Button' onclick=\"return App.dialogOf(this).newurl()\">".
- __('Generate new URL')."</button>";
-
- print "<button dojoType='dijit.form.Button' type='submit' class='alt-primary'>".
- __('Close this window')."</button>";
-
- print "</footer>";
+ ?>
+ <footer class='text-center'>
+ <?= \Controls\button_tag(__('Unshare article'), '', ['class' => 'alt-danger', 'onclick' => "App.dialogOf(this).unshare()"]) ?>
+ <?= \Controls\button_tag(__('Generate new URL'), '', ['onclick' => "App.dialogOf(this).newurl()"]) ?>
+ <?= \Controls\submit_tag(__("Close this window")) ?>
+ </footer>
+ <?php
}
function api_version() {