當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Link::delete方法代碼示例

本文整理匯總了PHP中Link::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Link::delete方法的具體用法?PHP Link::delete怎麽用?PHP Link::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Link的用法示例。


在下文中一共展示了Link::delete方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: deleteLink

 public function deleteLink(Link $link)
 {
     /** @var myModel $this */
     $link->delete();
     if (property_exists($this, 'linkCount')) {
         $this->decreaseCount('linkCount');
     }
     return $this;
 }
開發者ID:huoybb,項目名稱:standard,代碼行數:9,代碼來源:LinkableTrait.php

示例2: GETPOST

        }
        $linkid = GETPOST('linkid', 'int');
        // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
        if ($urlfile) {
            $ret = dol_delete_file($file, 0, 0, 0, $object);
            if ($ret) {
                setEventMessage($langs->trans("FileWasRemoved", $urlfile));
            } else {
                setEventMessage($langs->trans("ErrorFailToDeleteFile", $urlfile), 'errors');
            }
        } elseif ($linkid) {
            require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
            $link = new Link($db);
            $link->id = $linkid;
            $link->fetch();
            $res = $link->delete($user);
            $langs->load('link');
            if ($res) {
                setEventMessage($langs->trans("LinkRemoved", $link->label));
            } else {
                setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
            }
        }
        header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (!empty($withproject) ? '&withproject=1' : ''));
        exit;
    }
} elseif ($action == 'confirm_updateline' && GETPOST('save') && GETPOST('link', 'alpha')) {
    require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
    $langs->load('link');
    $link = new Link($db);
    $link->id = GETPOST('linkid', 'int');
開發者ID:LionSystemsSolutions,項目名稱:El-Canelo-ERP,代碼行數:31,代碼來源:document_actions_pre_headers.tpl.php

示例3: elseif

            ?>
" />
                       </p>
                       <p>
                            <label for="descripcion">Descripción</label>
                            <textarea id="descripcion" name="descripcion"><?php 
            echo $link->getDescription();
            ?>
</textarea>
                       </p>
                       <input type="hidden" name="accion" value="doedit" />
                       <input type="submit" value="Guardar">
	               </form>
	            <?php 
        } elseif ($_GET['accion'] == 'delete') {
            $link->delete();
            header("Location: index.php");
        }
    } else {
        ?>
            	<form action="#" method="post">
            		<p>
            			<label for="enlace">Enlace: </label>
            			<input id="enlace" type="text" name="enlace">
            		</p>
            		<p>
            			<label for="descripcion">Descripción</label>
            			<textarea id="descripcion" name="descripcion"></textarea>
            		</p>
            
            		<input type="submit" name="accion" value="Crear">
開發者ID:jesusgm,項目名稱:urlshortener,代碼行數:31,代碼來源:controller.link.php

示例4: Link

*/
include '../inc/includes.php';
Session::checkRight("link", READ);
if (empty($_GET["id"])) {
    $_GET["id"] = "";
}
$link = new Link();
if (isset($_POST["add"])) {
    $link->check(-1, CREATE);
    $newID = $link->add($_POST);
    Event::log($newID, "links", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
    Html::redirect(Toolbox::getItemTypeFormURL('Link') . "?id=" . $newID);
} else {
    if (isset($_POST["purge"])) {
        $link->check($_POST["id"], PURGE);
        $link->delete($_POST, 1);
        Event::log($_POST["id"], "links", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
        $link->redirectToList();
    } else {
        if (isset($_POST["update"])) {
            $link->check($_POST["id"], UPDATE);
            $link->update($_POST);
            Event::log($_POST["id"], "links", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
            Html::back();
        } else {
            Html::header(Link::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "config", "link");
            $link->display(array('id' => $_GET["id"]));
            Html::footer();
        }
    }
}
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:31,代碼來源:link.form.php

示例5: Link

*/
include '../inc/includes.php';
Session::checkRight("link", "r");
if (empty($_GET["id"])) {
    $_GET["id"] = "";
}
$link = new Link();
if (isset($_POST["add"])) {
    $link->check(-1, 'w');
    $newID = $link->add($_POST);
    Event::log($newID, "links", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
    Html::redirect(Toolbox::getItemTypeFormURL('Link') . "?id=" . $newID);
} else {
    if (isset($_POST["delete"])) {
        $link->check($_POST["id"], 'd');
        $link->delete($_POST);
        Event::log($_POST["id"], "links", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
        $link->redirectToList();
    } else {
        if (isset($_POST["update"])) {
            $link->check($_POST["id"], 'w');
            $link->update($_POST);
            Event::log($_POST["id"], "links", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
            Html::back();
        } else {
            Html::header(Link::getTypeName(2), $_SERVER['PHP_SELF'], "config", "link");
            $link->showForm($_GET["id"]);
            Html::footer();
        }
    }
}
開發者ID:geldarr,項目名稱:hack-space,代碼行數:31,代碼來源:link.form.php


注:本文中的Link::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。