当前位置: 首页>>代码示例>>PHP>>正文


PHP Bookmark::update方法代码示例

本文整理汇总了PHP中Bookmark::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Bookmark::update方法的具体用法?PHP Bookmark::update怎么用?PHP Bookmark::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bookmark的用法示例。


在下文中一共展示了Bookmark::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Bookmark

    $_GET["url"] = "";
}
if (!isset($_GET["action"])) {
    $_GET["action"] = "";
}
$bookmark = new Bookmark();
if (isset($_POST["add"])) {
    $bookmark->check(-1, CREATE, $_POST);
    $bookmark->add($_POST);
} else {
    if (isset($_POST["update"])) {
        $bookmark->check($_POST["id"], UPDATE);
        // Right to update the bookmark
        $bookmark->check(-1, CREATE, $_POST);
        // Right when entity change
        $bookmark->update($_POST);
        $_GET["action"] = "";
    } else {
        if ($_GET["action"] == "edit" && isset($_GET['mark_default']) && isset($_GET["id"])) {
            $bookmark->check($_GET["id"], READ);
            if ($_GET["mark_default"] > 0) {
                $bookmark->mark_default($_GET["id"]);
            } else {
                if ($_GET["mark_default"] == 0) {
                    $bookmark->unmark_default($_GET["id"]);
                }
            }
            $_GET["action"] = "";
        } else {
            if ($_GET["action"] == "load" && isset($_GET["id"]) && $_GET["id"] > 0) {
                $bookmark->check($_GET["id"], READ);
开发者ID:btry,项目名称:glpi,代码行数:31,代码来源:bookmark.php

示例2: setEventMessages

 $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++;
     setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("UrlOrLink")), null, 'errors');
 }
 if (!$error) {
     $bookmark->favicon = 'none';
     if ($action == 'update') {
         $res = $bookmark->update();
     } else {
         $res = $bookmark->create();
     }
     if ($res > 0) {
         if (empty($backtopage)) {
             $backtopage = GETPOST("urlsource") ? GETPOST("urlsource") : DOL_URL_ROOT . '/bookmarks/list.php';
         }
         header("Location: " . $backtopage);
         exit;
     } else {
         if ($bookmark->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
             $langs->load("errors");
             setEventMessages($langs->transnoentities("WarningBookmarkAlreadyExists"), null, 'warnings');
         } else {
             setEventMessages($bookmark->error, $bookmark->errors, 'errors');
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:card.php

示例3: createbookmark

 /**
  * createBookmark
  * Creates or updates a bookmark.
  * Takes the file id and position with optional comment in parameters.
  * Not supported.
  */
 public static function createbookmark($input)
 {
     self::check_version($input, "1.9.0");
     $id = self::check_parameter($input, 'id');
     $position = self::check_parameter($input, 'position');
     $comment = $input['comment'];
     $type = Subsonic_XML_Data::getAmpacheType($id);
     if (!empty($type)) {
         $bookmark = new Bookmark(Subsonic_XML_Data::getAmpacheId($id), $type);
         if ($bookmark->id) {
             $bookmark->update($position);
         } else {
             Bookmark::create(array('object_id' => Subsonic_XML_Data::getAmpacheId($id), 'object_type' => $type, 'comment' => $comment, 'position' => $position));
         }
         $r = Subsonic_XML_Data::createSuccessResponse();
     } else {
         $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_DATA_NOTFOUND);
     }
     self::apiOutput($input, $r);
 }
开发者ID:bl00m,项目名称:ampache,代码行数:26,代码来源:subsonic_api.class.php

示例4: Bookmark

    $bookmark=new Bookmark($db);
    if ($action == 'update') $bookmark->fetch($_POST["id"]);
    $bookmark->fk_user=$userid;
    $bookmark->title=$title;
    $bookmark->url=$url;
    $bookmark->target=$target;
    $bookmark->position=$position;

    if (! $title) $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle"));
    if (! $url)   $mesg.=($mesg?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink"));

    if (! $mesg)
    {
        $bookmark->favicon='none';

        if ($action == 'update') $res=$bookmark->update();
        else $res=$bookmark->create();

        if ($res > 0)
        {
			$urlsource=! empty($_REQUEST["urlsource"])?urldecode($_REQUEST["urlsource"]):DOL_URL_ROOT.'/bookmarks/liste.php';
            header("Location: ".$urlsource);
            exit;
        }
        else
        {
        	if ($bookmark->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
        	{
        		$langs->load("errors");
            	$mesg='<div class="warning">'.$langs->trans("WarningBookmarkAlreadyExists").'</div>';
        	}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:31,代码来源:fiche.php


注:本文中的Bookmark::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。