]> projects.mako.cc - scuttle/blob - templates/editbookmark.tpl.php
initial patch to cause scuttle to work with PHP 8.2
[scuttle] / templates / editbookmark.tpl.php
1 <?php
2 $this->includeTemplate($GLOBALS['top_include']);
3
4 $accessPublic = '';
5 $accessShared = '';
6 $accessPrivate = '';
7
8 if (isset($row['bStatus'])) {
9     switch ($row['bStatus']) {
10         case 0 :
11             $accessPublic = ' selected="selected"';
12             break;
13         case 1 :
14             $accessShared = ' selected="selected"';
15             break;
16         case 2 :
17             $accessPrivate = ' selected="selected"';
18             break;
19     }
20 }
21 ?>
22
23 <form action="<?php echo $formaction; ?>" method="post">
24 <table>
25 <tr>
26     <th align="left"><?php echo T_('Address'); ?></th>
27     <td><input type="text" id="address" name="address" size="75" maxlength="65535" value="<?php echo filter($row['bAddress'], 'xml'); ?>" onblur="useAddress(this)" /></td>
28     <td>&larr; <?php echo T_('Required'); ?></td>
29 </tr>
30 <tr>
31     <th align="left"><?php echo T_('Title'); ?></th>
32     <td><input type="text" id="titleField" name="title" size="75" maxlength="255" value="<?php echo filter($row['bTitle'], 'xml'); ?>" onkeypress="this.style.backgroundImage = 'none';" /></td>
33     <td>&larr; <?php echo T_('Required'); ?></td>
34 </tr>
35 <tr>
36     <th align="left"><?php echo T_('Description'); ?></th>
37     <td><textarea name="description" cols="74" rows="5" maxlength="1000"><?php echo filter($row['bDescription'], 'xml'); ?></textarea></td>
38     <td></td>
39 </tr>
40 <tr>
41     <th align="left"><?php echo T_('Tags'); ?></th>
42     <td><input type="text" id="tags" name="tags" size="75" value="<?php if (isset($row['tags'])) { echo filter(implode(', ', $row['tags']), 'xml'); }?>" /></td>
43     <td>&larr; <?php echo T_('Comma-separated'); ?></td>
44 </tr>
45 <tr>
46     <th align="left"><?php echo T_('Privacy'); ?></th>
47     <td>
48         <select name="status">
49             <option value="0"<?php echo $accessPublic ?>><?php echo T_('Public'); ?></option>
50             <option value="1"<?php echo $accessShared ?>><?php echo T_('Shared with Watch List'); ?></option>
51             <option value="2"<?php echo $accessPrivate ?>><?php echo T_('Private'); ?></option>
52         </select>
53     </td>
54     <td></td>
55 </tr>
56 <tr>
57     <td></td>
58     <td>
59         <input type="submit" name="submitted" value="<?php echo $btnsubmit; ?>" />
60         <?php if (isset($showdelete) && $showdelete): ?>
61           <input type="submit" name="delete" value="<?php echo T_('Delete Bookmark'); ?>" />
62         <?php endif; ?>
63         <?php if ($popup): ?>
64           <input type="hidden" name="popup" value="1" />
65         <?php elseif (isset($referrer) && $referrer): ?>
66           <input type="hidden" name="referrer" value="<?php echo $referrer; ?>" />
67         <?php endif; ?>
68     </td>
69     <td></td>
70 </tr>
71 </table>
72 </form>
73 <script type="text/javascript">
74 $(function() {
75   $("#tags").focus();
76 });
77 </script>
78
79 <?php
80 // Dynamic tag selection
81 $this->includeTemplate('dynamictags.inc');
82
83 // Bookmarklets and import links
84 if (empty($_REQUEST['popup']) && (!isset($showdelete) || !$showdelete)) {
85 ?>
86
87 <h3><?php echo T_('Bookmarklet'); ?></h3>
88 <p><?php echo sprintf(T_("Drag one of the following bookmarklets to your browser's bookmarks and click it whenever you want to add the page you are on to %s"), $GLOBALS['sitename']); ?>:</p>
89
90 <script type="text/javascript">
91 var selection = '';
92 if (window.getSelection) {
93     selection = 'window.getSelection()';
94 } else if (document.getSelection) {
95     selection = 'document.getSelection()';
96 } else if (document.selection) {
97     selection = 'document.selection.createRange().text';
98 }
99 document.write('<ul>');
100 document.write('<li><a href="javascript:x=document;a=encodeURIComponent(x.location.href);t=encodeURIComponent(x.title);d=encodeURIComponent('+selection+');location.href=\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&amp;address=\'+a+\'&amp;title=\'+t+\'&amp;description=\'+d;void 0;"><?php echo sprintf(T_('Post to %s'), $GLOBALS['sitename']); ?><\/a><\/li>');
101 document.write('<li><a href="javascript:x=document;a=encodeURIComponent(x.location.href);t=encodeURIComponent(x.title);d=encodeURIComponent('+selection+');open(\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&amp;popup=1&amp;address=\'+a+\'&amp;title=\'+t+\'&amp;description=\'+d,\'<?php echo $GLOBALS['sitename']; ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=730,height=465,left=\'+(screen.width-730)/2+\',top=\'+(screen.height-425)/2);void 0;"><?php echo sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename']); ?><\/a><\/li>');
102 document.write('<\/ul>');
103 </script>
104
105 <h3><?php echo T_('Import'); ?></h3>
106 <ul>
107     <li><a href="<?php echo createURL('importNetscape'); ?>"><?php echo T_('Import bookmarks from bookmark file'); ?></a> (<?php echo T_('Internet Explorer, Mozilla Firefox and Netscape'); ?>)</li>
108     <li><a href="<?php echo createURL('import'); ?>"><?php echo T_('Import bookmarks from del.icio.us'); ?></a></li>
109 </ul>
110
111 <?php
112 }
113 $this->includeTemplate($GLOBALS['bottom_include']); 
114 ?>

Benjamin Mako Hill || Want to submit a patch?