2007-12-12 17:29:16 +01:00
|
|
|
<?php
|
|
|
|
$this->includeTemplate($GLOBALS['top_include']);
|
|
|
|
|
|
|
|
$accessPublic = '';
|
|
|
|
$accessShared = '';
|
|
|
|
$accessPrivate = '';
|
|
|
|
switch ($row['bStatus']) {
|
|
|
|
case 0 :
|
|
|
|
$accessPublic = ' selected="selected"';
|
|
|
|
break;
|
|
|
|
case 1 :
|
|
|
|
$accessShared = ' selected="selected"';
|
|
|
|
break;
|
|
|
|
case 2 :
|
|
|
|
$accessPrivate = ' selected="selected"';
|
|
|
|
break;
|
|
|
|
}
|
2008-12-03 10:46:31 +01:00
|
|
|
|
2010-02-08 19:59:05 +01:00
|
|
|
function jsEscTitle($title)
|
|
|
|
{
|
|
|
|
return addcslashes($title, "'");
|
|
|
|
}
|
2011-04-01 08:17:01 +02:00
|
|
|
function jsEscTitleDouble($title)
|
|
|
|
{
|
|
|
|
return addcslashes(addcslashes($title, "'"), "'\\");
|
|
|
|
}
|
2011-03-22 21:08:17 +01:00
|
|
|
|
|
|
|
if (is_array($row['tags'])) {
|
|
|
|
$row['tags'] = implode(', ', $row['tags']);
|
|
|
|
}
|
2011-03-28 19:24:44 +02:00
|
|
|
|
|
|
|
$ajaxUrl = ROOT . 'ajax/'
|
|
|
|
. (
|
|
|
|
($GLOBALS['adminsAreAdvisedTagsFromOtherAdmins'] && $currentUser->isAdmin())
|
|
|
|
? 'getadmintags'
|
|
|
|
: 'getcontacttags'
|
|
|
|
) . '.php';
|
2007-12-12 17:29:16 +01:00
|
|
|
?>
|
|
|
|
<form action="<?php echo $formaction; ?>" method="post">
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th align="left"><?php echo T_('Address'); ?></th>
|
|
|
|
<td><input type="text" id="address" name="address" size="75" maxlength="65535" value="<?php echo filter($row['bAddress'], 'xml'); ?>" onblur="useAddress(this)" /></td>
|
2011-03-17 08:46:15 +01:00
|
|
|
<td>← <?php echo T_('Required'); ?></td>
|
2007-12-12 17:29:16 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th align="left"><?php echo T_('Title'); ?></th>
|
|
|
|
<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>
|
2011-03-17 08:46:15 +01:00
|
|
|
<td>← <?php echo T_('Required'); ?></td>
|
2007-12-12 17:29:16 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2009-01-12 17:40:39 +01:00
|
|
|
<th align="left">
|
|
|
|
<?php echo T_('Description'); ?>
|
|
|
|
<a onclick="var nz = document.getElementById('privateNoteZone'); nz.style.display='';this.style.display='none';"><?php echo T_("Add Note"); ?></a>
|
|
|
|
</th>
|
2009-01-12 14:45:49 +01:00
|
|
|
<td><textarea name="description" id="description" rows="5" cols="63" ><?php echo filter($row['bDescription'], 'xml'); ?></textarea></td>
|
2011-03-17 08:46:15 +01:00
|
|
|
<td>← <?php echo T_('You can use anchors to delimite attributes. for example: [publisher]blah[/publisher] '); ?>
|
2009-01-12 14:45:49 +01:00
|
|
|
<?php if(count($GLOBALS['descriptionAnchors'])>0): ?>
|
|
|
|
<br /><br />
|
|
|
|
<?php echo T_('Suggested anchors: '); ?>
|
|
|
|
<?php foreach($GLOBALS['descriptionAnchors'] as $anchorName => $anchorValue): ?>
|
|
|
|
<?php if(is_numeric($anchorName)) {
|
|
|
|
$anchorName = $anchorValue;
|
|
|
|
$anchorValue = '['.$anchorValue.']'.'[/'.$anchorValue.']';
|
|
|
|
} ?>
|
|
|
|
<span class="anchor" title="<?php echo $anchorValue ?>" onclick="addAnchor('<?php echo $anchorValue ?>', 'description')"><?php echo $anchorName ?></span>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
</td>
|
2007-12-12 17:29:16 +01:00
|
|
|
</tr>
|
2009-01-12 17:40:39 +01:00
|
|
|
<tr id="privateNoteZone" <?php if(strlen($row['bPrivateNote'])==0):?>style="display:none"<?php endif; ?>>
|
|
|
|
<th align="left"><?php echo T_('Private Note'); ?></th>
|
|
|
|
<td><textarea name="privateNote" id="privateNote" rows="1" cols="63" ><?php echo filter($row['bPrivateNote'], 'xml'); ?></textarea></td>
|
2011-03-17 08:46:15 +01:00
|
|
|
<td>← <?php echo T_('Just visible by you and your contacts.'); ?>
|
2009-01-12 17:40:39 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
2007-12-12 17:29:16 +01:00
|
|
|
<tr>
|
|
|
|
<th align="left"><?php echo T_('Tags'); ?></th>
|
2008-11-13 10:49:11 +01:00
|
|
|
<td class="scuttletheme">
|
2011-03-22 21:08:17 +01:00
|
|
|
<input type="text" id="tags" name="tags" size="75" value="<?php echo filter($row['tags'], 'xml'); ?>"/>
|
2010-10-26 18:16:34 +02:00
|
|
|
</td>
|
2011-03-17 08:46:15 +01:00
|
|
|
<td>← <?php echo T_('Comma-separated'); ?></td>
|
2007-12-12 17:29:16 +01:00
|
|
|
</tr>
|
2008-01-09 16:51:35 +01:00
|
|
|
<tr>
|
|
|
|
<th></th>
|
2010-10-26 18:16:34 +02:00
|
|
|
<td align="right"><small><?php echo htmlspecialchars(T_('Note: use ">" to include one tag in another. e.g.: europe>france>paris'))?></small></td>
|
2008-01-09 16:51:35 +01:00
|
|
|
</tr>
|
2008-01-28 15:55:07 +01:00
|
|
|
<tr>
|
|
|
|
<th></th>
|
2010-10-26 18:16:34 +02:00
|
|
|
<td align="right"><small><?php echo T_('Note: use "=" to make synonym two tags. e.g.: france=frenchcountry')?></small></td>
|
2008-01-28 15:55:07 +01:00
|
|
|
</tr>
|
2007-12-12 17:29:16 +01:00
|
|
|
<tr>
|
|
|
|
<th align="left"><?php echo T_('Privacy'); ?></th>
|
|
|
|
<td>
|
|
|
|
<select name="status">
|
|
|
|
<option value="0"<?php echo $accessPublic ?>><?php echo T_('Public'); ?></option>
|
|
|
|
<option value="1"<?php echo $accessShared ?>><?php echo T_('Shared with Watch List'); ?></option>
|
|
|
|
<option value="2"<?php echo $accessPrivate ?>><?php echo T_('Private'); ?></option>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td>
|
|
|
|
<input type="submit" name="submitted" value="<?php echo $btnsubmit; ?>" />
|
2009-02-17 10:36:20 +01:00
|
|
|
<input type="button" name="cancel" value="<?php echo T_('Cancel') ?>" onclick="<?php echo $popup?'window.close();':'javascript: history.go(-1)'; ?>" />
|
2007-12-12 17:29:16 +01:00
|
|
|
<?php
|
2008-11-25 16:57:29 +01:00
|
|
|
if (isset($showdelete) && $showdelete) {
|
2007-12-12 17:29:16 +01:00
|
|
|
?>
|
|
|
|
<input type="submit" name="delete" value="<?php echo T_('Delete Bookmark'); ?>" />
|
|
|
|
<?php
|
|
|
|
}
|
2008-11-25 17:58:56 +01:00
|
|
|
if (isset($showdelete) && $showdelete) {
|
|
|
|
echo ' (<a href="'.createURL('bookmarkcommondescriptionedit', $row['bHash']).'">';
|
|
|
|
echo T_('edit common description').'</a>)';
|
|
|
|
}
|
2011-03-17 08:46:15 +01:00
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
if ($popup) {
|
|
|
|
?>
|
|
|
|
<input type="hidden" name="popup" value="1" />
|
|
|
|
<?php
|
2008-11-25 16:57:29 +01:00
|
|
|
} elseif (isset($referrer)) {
|
2007-12-12 17:29:16 +01:00
|
|
|
?>
|
|
|
|
<input type="hidden" name="referrer" value="<?php echo $referrer; ?>" />
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
<td></td>
|
2010-10-26 18:16:34 +02:00
|
|
|
</tr>
|
|
|
|
</table>
|
2007-12-12 17:29:16 +01:00
|
|
|
</form>
|
|
|
|
|
2011-03-29 07:54:47 +02:00
|
|
|
<link href="<?php echo ROOT ?>js/jquery-ui-1.8.11/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css"/>
|
2011-03-22 18:20:37 +01:00
|
|
|
|
2011-03-29 07:54:47 +02:00
|
|
|
<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.core.js"></script>
|
|
|
|
<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.widget.js"></script>
|
|
|
|
<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.position.js"></script>
|
|
|
|
<script type="text/javascript" src="<?php echo ROOT ?>js/jquery-ui-1.8.11/jquery.ui.autocomplete.js"></script>
|
2010-10-26 18:16:34 +02:00
|
|
|
<script type="text/javascript">
|
2011-03-29 07:57:35 +02:00
|
|
|
//<![CDATA[
|
2010-10-26 18:16:34 +02:00
|
|
|
jQuery(document).ready(function() {
|
2011-03-22 18:20:37 +01:00
|
|
|
function split(val)
|
|
|
|
{
|
2011-03-29 07:57:35 +02:00
|
|
|
return val.split(/[,=><]\s*/);
|
2011-03-22 18:20:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function extractLast(term)
|
|
|
|
{
|
|
|
|
return split(term).pop();
|
|
|
|
}
|
2011-03-28 19:24:44 +02:00
|
|
|
//var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"];
|
2011-03-22 18:20:37 +01:00
|
|
|
|
2010-10-26 18:16:34 +02:00
|
|
|
jQuery("input#tags").autocomplete({
|
2011-03-29 07:54:47 +02:00
|
|
|
autoFocus: true,
|
2011-03-28 19:17:51 +02:00
|
|
|
minLength: 1,
|
2011-03-22 18:20:37 +01:00
|
|
|
|
|
|
|
source: function(request, response) {
|
|
|
|
// delegate back to autocomplete, but extract the last term
|
2011-03-29 08:05:15 +02:00
|
|
|
var term = extractLast(request.term);
|
|
|
|
if (term.length < this.options.minLength) {
|
|
|
|
return;
|
|
|
|
}
|
2011-03-22 18:20:37 +01:00
|
|
|
response(
|
2011-03-28 19:17:51 +02:00
|
|
|
/*
|
2011-03-22 18:20:37 +01:00
|
|
|
$.ui.autocomplete.filter(
|
|
|
|
availableTags, extractLast(request.term)
|
|
|
|
)
|
2011-03-25 19:26:42 +01:00
|
|
|
*/
|
2011-03-28 19:17:51 +02:00
|
|
|
$.getJSON(
|
2011-03-28 19:24:44 +02:00
|
|
|
"<?php echo $ajaxUrl; ?>",
|
2011-03-29 08:05:15 +02:00
|
|
|
{ beginsWith: term },
|
2011-03-28 19:17:51 +02:00
|
|
|
response
|
|
|
|
)
|
2011-03-22 18:20:37 +01:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
focus: function() {
|
|
|
|
// prevent value inserted on focus
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
select: function(event, ui) {
|
|
|
|
var terms = split(this.value);
|
|
|
|
// remove the current input
|
|
|
|
terms.pop();
|
|
|
|
// add the selected item
|
|
|
|
terms.push(ui.item.value);
|
|
|
|
// add placeholder to get the comma-and-space at the end
|
|
|
|
terms.push("");
|
|
|
|
this.value = terms.join(", ");
|
|
|
|
return false;
|
|
|
|
}
|
2010-10-26 18:16:34 +02:00
|
|
|
});
|
|
|
|
});
|
2011-03-29 07:57:35 +02:00
|
|
|
//]]>
|
2010-10-26 18:16:34 +02:00
|
|
|
</script>
|
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
<?php
|
|
|
|
// Dynamic tag selection
|
2011-03-30 19:20:26 +02:00
|
|
|
$this->includeTemplate('dynamictags.inc');
|
2007-12-12 17:29:16 +01:00
|
|
|
|
|
|
|
// Bookmarklets and import links
|
2008-11-25 16:57:29 +01:00
|
|
|
if (empty($_REQUEST['popup']) && (!isset($showdelete) || !$showdelete)) {
|
2007-12-12 17:29:16 +01:00
|
|
|
?>
|
|
|
|
|
|
|
|
<h3><?php echo T_('Bookmarklet'); ?></h3>
|
2011-03-31 19:13:07 +02:00
|
|
|
<p id="bookmarklet"></p>
|
2007-12-12 17:29:16 +01:00
|
|
|
<script type="text/javascript">
|
2010-10-26 18:16:34 +02:00
|
|
|
//<![CDATA[
|
2011-03-31 19:13:07 +02:00
|
|
|
var browser = navigator.appName;
|
|
|
|
jQuery(function($) {
|
|
|
|
if (browser == "Opera") {
|
|
|
|
$('#bookmarklet').append(
|
2010-09-27 22:43:35 +02:00
|
|
|
<?php echo json_encode(
|
|
|
|
sprintf(
|
2011-03-31 19:13:07 +02:00
|
|
|
T_("Click one of the following bookmarklets to add a button you can click whenever you want to add the page you are on to %s") . ':',
|
2010-09-27 22:43:35 +02:00
|
|
|
$GLOBALS['sitename']
|
|
|
|
)
|
2010-10-26 18:16:34 +02:00
|
|
|
); ?>
|
2010-09-27 22:43:35 +02:00
|
|
|
);
|
2011-03-31 19:13:07 +02:00
|
|
|
} else {
|
|
|
|
$('#bookmarklet').append(
|
2010-09-27 22:43:35 +02:00
|
|
|
<?php echo json_encode(
|
|
|
|
sprintf(
|
2011-03-31 19:13:07 +02:00
|
|
|
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") . ':',
|
2010-09-27 22:43:35 +02:00
|
|
|
$GLOBALS['sitename']
|
|
|
|
)
|
|
|
|
);
|
2010-10-26 18:16:34 +02:00
|
|
|
?>
|
2010-09-27 22:43:35 +02:00
|
|
|
);
|
|
|
|
}
|
2011-03-31 19:13:07 +02:00
|
|
|
});
|
2010-10-26 18:16:34 +02:00
|
|
|
//]]>
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
//<![CDATA[
|
2007-12-12 17:29:16 +01:00
|
|
|
var selection = '';
|
|
|
|
if (window.getSelection) {
|
|
|
|
selection = 'window.getSelection()';
|
|
|
|
} else if (document.getSelection) {
|
|
|
|
selection = 'document.getSelection()';
|
|
|
|
} else if (document.selection) {
|
|
|
|
selection = 'document.selection.createRange().text';
|
|
|
|
}
|
2011-03-31 19:13:07 +02:00
|
|
|
if (browser == "Opera") {
|
|
|
|
$('#bookmarklet').append(
|
|
|
|
'<ul>'
|
|
|
|
+ '<li>'
|
2011-04-04 22:07:39 +02:00
|
|
|
+ '<a class="bookmarklet" href="'
|
|
|
|
+ '<?php
|
|
|
|
function fixOperaButtonName($name) {
|
|
|
|
//yes, opera has problems with double quotes in button names
|
|
|
|
return str_replace('"', "''", $name);
|
|
|
|
}
|
|
|
|
$popupLink = 'javascript:'
|
|
|
|
. "location.href='"
|
|
|
|
. createURL('bookmarks', $GLOBALS['user'])
|
|
|
|
. '?action=add'
|
|
|
|
. "&address='+encodeURIComponent(document.location.href)+'"
|
|
|
|
. "&title='+encodeURIComponent(document.title)+'"
|
|
|
|
. "&description='+encodeURIComponent(SELECTION)+'"
|
|
|
|
. "';";
|
|
|
|
$link = 'opera:/button/Go to page,'
|
|
|
|
. '"' . rawurlencode($popupLink) . '"'
|
|
|
|
. ',,"Post to ' . fixOperaButtonName($GLOBALS['sitename']) . '",'
|
|
|
|
. '"Scuttle"';
|
|
|
|
echo jsEscTitle(htmlspecialchars($link));
|
|
|
|
?>'.replace('SELECTION', selection)
|
|
|
|
+ '"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?></a>'
|
2011-03-31 19:13:07 +02:00
|
|
|
+ '</li>'
|
|
|
|
+ '<li>'
|
|
|
|
+ '<a class="bookmarklet" href="opera:/button/Go%20to%20page,%20%22javascript:x=document;a=encodeURIComponent(x.location.href);t=encodeURIComponent(x.title);d=encodeURIComponent('+selection+');open(\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&popup=1&address=\'+a+\'&title=\'+t+\'&description=\'+d,\'<?php echo htmlspecialchars(jsEscTitle($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2);void 0;%22,,%22Post%20to%20<?php echo urlencode($GLOBALS['sitename']); ?>%20(Pop-up)%22,%22Scuttle%22"><?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?></a>'
|
|
|
|
+ '</li>'
|
|
|
|
+ '</ul>'
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$('#bookmarklet').append(
|
|
|
|
'<ul>'
|
|
|
|
+ '<li><a class="bookmarklet" 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&address=\'+a+\'&title=\'+t+\'&description=\'+d;void 0;"><?php echo jsEscTitle(sprintf(T_('Post to %s'), $GLOBALS['sitename'])); ?><\/a><\/li>'
|
|
|
|
+ '<li>'
|
|
|
|
+ '<a class="bookmarklet" href="'
|
|
|
|
+ 'javascript:x=document;'
|
|
|
|
+ 'a=encodeURIComponent(x.location.href);'
|
|
|
|
+ 't=encodeURIComponent(x.title);'
|
|
|
|
+ 'd=encodeURIComponent('+selection+');'
|
|
|
|
+ 'open('
|
2011-04-01 08:17:01 +02:00
|
|
|
+ '\'<?php echo createURL('bookmarks', $GLOBALS['user']); ?>?action=add&popup=1&address=\'+a+\'&title=\'+t+\'&description=\'+d,\'<?php echo htmlspecialchars(jsEscTitleDouble($GLOBALS['sitename'])); ?>\',\'modal=1,status=0,scrollbars=1,toolbar=0,resizable=1,width=790,height=465,left=\'+(screen.width-790)/2+\',top=\'+(screen.height-425)/2'
|
2011-03-31 19:13:07 +02:00
|
|
|
+ ');void 0;">'
|
|
|
|
+ '<?php echo jsEscTitle(sprintf(T_('Post to %s (Pop-up)'), $GLOBALS['sitename'])); ?>'
|
|
|
|
+ '</a>'
|
|
|
|
+ '</li>'
|
|
|
|
+ '</ul>'
|
|
|
|
);
|
|
|
|
}
|
2010-10-26 18:16:34 +02:00
|
|
|
//]]>
|
2007-12-12 17:29:16 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<h3><?php echo T_('Import'); ?></h3>
|
|
|
|
<ul>
|
|
|
|
<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>
|
|
|
|
<li><a href="<?php echo createURL('import'); ?>"><?php echo T_('Import bookmarks from del.icio.us'); ?></a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
2011-03-17 08:46:15 +01:00
|
|
|
$this->includeTemplate($GLOBALS['bottom_include']);
|
2008-01-09 16:51:35 +01:00
|
|
|
?>
|