304ede6466701d46da4fc023882414da650ec644
[scuttle] / templates / editbookmark.tpl.php
1 <?php
2 $this->includeTemplate($GLOBALS['top_include']);
3
4 $accessPublic = '';
5 $accessShared = '';
6 $accessPrivate = '';
7 switch ($row['bStatus']) {
8     case 0 :
9         $accessPublic = ' selected="selected"';
10         break;
11     case 1 :
12         $accessShared = ' selected="selected"';
13         break;
14     case 2 :
15         $accessPrivate = ' selected="selected"';
16         break;
17 }
18 ?>
19
20 <form action="<?php echo $formaction; ?>" method="post">
21 <table>
22 <tr>
23     <th align="left"><?php echo T_('Address'); ?></th>
24     <td><input type="text" id="address" name="address" size="75" maxlength="65535" value="<?php echo filter($row['bAddress'], 'xml'); ?>" onblur="useAddress(this)" /></td>
25     <td>&larr; <?php echo T_('Required'); ?></td>
26 </tr>
27 <tr>
28     <th align="left"><?php echo T_('Title'); ?></th>
29     <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>
30     <td>&larr; <?php echo T_('Required'); ?></td>
31 </tr>
32 <tr>
33     <th align="left"><?php echo T_('Description'); ?></th>
34     <td><textarea name="description" cols="74" rows="5" maxlength="1000"><?php echo filter($row['bDescription'], 'xml'); ?></textarea></td>
35     <td></td>
36 </tr>
37 <tr>
38     <th align="left"><?php echo T_('Tags'); ?></th>
39     <td><input class="autocomplete" type="text" id="tags" name="tags" size="75" value="<?php echo filter(implode(', ', $row['tags']), 'xml'); ?>" /></td>
40     <td>&larr; <?php echo T_('Comma-separated'); ?></td>
41 </tr>
42 <tr>
43     <th align="left"><?php echo T_('Privacy'); ?></th>
44     <td>
45         <select name="status">
46             <option value="0"<?php echo $accessPublic ?>><?php echo T_('Public'); ?></option>
47             <option value="1"<?php echo $accessShared ?>><?php echo T_('Shared with Watch List'); ?></option>
48             <option value="2"<?php echo $accessPrivate ?>><?php echo T_('Private'); ?></option>
49         </select>
50     </td>
51     <td></td>
52 </tr>
53 <tr>
54     <td></td>
55     <td>
56         <input type="submit" name="submitted" value="<?php echo $btnsubmit; ?>" />
57         <?php if ($showdelete): ?>
58           <input type="submit" name="delete" value="<?php echo T_('Delete Bookmark'); ?>" />
59         <?php endif; ?>
60         <?php if ($popup): ?>
61           <input type="hidden" name="popup" value="1" />
62         <?php elseif ($referrer): ?>
63           <input type="hidden" name="referrer" value="<?php echo $referrer; ?>" />
64         <?php endif; ?>
65     </td>
66     <td></td>
67 </tr>
68 </table>
69 </form>
70 <script type="text/javascript">
71 $(function() {
72   $("#address").focus();
73 });
74 </script>
75
76 <?php
77 // Dynamic tag selection
78 $this->includeTemplate('dynamictags.inc');
79
80 // Bookmarklets and import links
81 if (empty($_REQUEST['popup']) && !$showdelete) {
82 ?>
83
84 <h3><?php echo T_('Bookmarklet'); ?></h3>
85 <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>
86
87 <script type="text/javascript">
88 var selection = '';
89 if (window.getSelection) {
90     selection = 'window.getSelection()';
91 } else if (document.getSelection) {
92     selection = 'document.getSelection()';
93 } else if (document.selection) {
94     selection = 'document.selection.createRange().text';
95 }
96 document.write('<ul>');
97 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>');
98 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>');
99 document.write('<\/ul>');
100 </script>
101
102 <h3><?php echo T_('Import'); ?></h3>
103 <ul>
104     <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>
105     <li><a href="<?php echo createURL('import'); ?>"><?php echo T_('Import bookmarks from del.icio.us'); ?></a></li>
106 </ul>
107
108 <?php
109 }
110 $this->includeTemplate($GLOBALS['bottom_include']); 
111 ?>

Benjamin Mako Hill || Want to submit a patch?