本文整理汇总了PHP中Bookmark::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Bookmark::fetch方法的具体用法?PHP Bookmark::fetch怎么用?PHP Bookmark::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bookmark
的用法示例。
在下文中一共展示了Bookmark::fetch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Bookmark
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel">';
print '</td></tr>';
print '</table>';
print '</form>';
}
if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
{
/*
* Fact bookmark mode or visually edition
*/
$bookmark=new Bookmark($db);
$bookmark->fetch($_GET["id"]);
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
if ($_GET["action"] == 'edit')
{
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$bookmark->id.'">';
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/fiche.php?id='.$bookmark->id.'">';
}
print '<table class="border" width="100%">';
示例2: GETPOST
if ($action == 'add' || $action == 'addproduct' || $action == 'update') {
if ($action == 'update') {
$invertedaction = 'edit';
} else {
$invertedaction = 'create';
}
$error = 0;
if (GETPOST("cancel")) {
if (empty($backtopage)) {
$backtopage = GETPOST("urlsource") ? GETPOST("urlsource") : (!empty($url) ? $url : DOL_URL_ROOT . '/bookmarks/list.php');
}
header("Location: " . $backtopage);
exit;
}
if ($action == 'update') {
$bookmark->fetch($_POST["id"]);
}
// Check if null because user not admin can't set an user and send empty value here.
if (!empty($userid)) {
$bookmark->fk_user = $userid;
}
$bookmark->title = $title;
$bookmark->url = $url;
$bookmark->target = $target;
$bookmark->position = $position;
if (!$title) {
$error++;
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("BookmarkTitle")), null, 'errors');
}
if (!$url) {
$error++;
示例3: Bookmark
print '<input class="flat" name="position" size="5" value="' . (isset($_POST["position"]) ? $_POST["position"] : $bookmark->position) . '">';
print '</td><td class="hideonsmartphone"> </td></tr>';
print '</table><br>';
print '<div align="center">';
print '<input type="submit" class="button" value="' . $langs->trans("CreateBookmark") . '" name="create"> ';
print '<input type="submit" class="button" value="' . $langs->trans("Cancel") . '" name="cancel">';
print '</div>';
print '</form>';
dol_fiche_end();
}
if ($id > 0 && !preg_match('/^add/i', $action)) {
/*
* Fact bookmark mode or visually edition
*/
$bookmark = new Bookmark($db);
$bookmark->fetch($id);
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), 0, 'bookmark');
if ($action == 'edit') {
print '<form name="edit" method="POST" action="' . $_SERVER["PHP_SELF"] . '" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="' . $bookmark->id . '">';
print '<input type="hidden" name="urlsource" value="' . DOL_URL_ROOT . '/bookmarks/fiche.php?id=' . $bookmark->id . '">';
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
}
print '<table class="border" width="100%">';
print '<tr><td width="25%">' . $langs->trans("Ref") . '</td><td>' . $bookmark->ref . '</td></tr>';
print '<tr><td>' . $langs->trans("BookmarkTitle") . '</td><td>';
if ($action == 'edit') {
print '<input class="flat" name="title" size="30" value="' . (isset($_POST["title"]) ? $_POST["title"] : $bookmark->title) . '">';
} else {