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

Benjamin Mako Hill || Want to submit a patch?