1 | <?php |
---|
2 | /** |
---|
3 | * @package Dotclear |
---|
4 | * @subpackage Backend |
---|
5 | * |
---|
6 | * @copyright Olivier Meunier & Association Dotclear |
---|
7 | * @copyright GPL-2.0-only |
---|
8 | */ |
---|
9 | |
---|
10 | require dirname(__FILE__) . '/../inc/admin/prepend.php'; |
---|
11 | |
---|
12 | dcPage::check('usage,contentadmin'); |
---|
13 | |
---|
14 | $href = !empty($_GET['href']) ? $_GET['href'] : ''; |
---|
15 | $hreflang = !empty($_GET['hreflang']) ? $_GET['hreflang'] : ''; |
---|
16 | $title = !empty($_GET['title']) ? $_GET['title'] : ''; |
---|
17 | $plugin_id = !empty($_GET['plugin_id']) ? html::sanitizeURL($_GET['plugin_id']) : ''; |
---|
18 | |
---|
19 | dcPage::openPopup(__('Add a link'), dcPage::jsLoad('js/_popup_link.js') . $core->callBehavior('adminPopupLink', $plugin_id)); |
---|
20 | |
---|
21 | echo '<h2 class="page-title">' . __('Add a link') . '</h2>'; |
---|
22 | |
---|
23 | # Languages combo |
---|
24 | $rs = $core->blog->getLangs(['order' => 'asc']); |
---|
25 | $lang_combo = dcAdminCombos::getLangsCombo($rs, true); |
---|
26 | |
---|
27 | echo |
---|
28 | '<form id="link-insert-form" action="#" method="get">' . |
---|
29 | '<p><label class="required" for="href"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Link URL:') . '</label> ' . |
---|
30 | form::field('href', 35, 512, [ |
---|
31 | 'default' => html::escapeHTML($href), |
---|
32 | 'extra_html' => 'required placeholder="' . __('URL') . '"' |
---|
33 | ]) . |
---|
34 | '</p>' . |
---|
35 | '<p><label for="title">' . __('Link title:') . '</label> ' . |
---|
36 | form::field('title', 35, 512, html::escapeHTML($title)) . '</p>' . |
---|
37 | '<p><label for="hreflang">' . __('Link language:') . '</label> ' . |
---|
38 | form::combo('hreflang', $lang_combo, $hreflang) . |
---|
39 | '</p>' . |
---|
40 | |
---|
41 | '</form>' . |
---|
42 | |
---|
43 | '<p><button type="button" class="reset" id="link-insert-cancel">' . __('Cancel') . '</button> - ' . |
---|
44 | '<button type="button" id="link-insert-ok"><strong>' . __('Insert') . '</strong></button></p>' . "\n"; |
---|
45 | |
---|
46 | dcPage::closePopup(); |
---|