当前位置: 首页>>代码示例>>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;未经允许,请勿转载。