本文整理汇总了PHP中CApplication::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CApplication::delete方法的具体用法?PHP CApplication::delete怎么用?PHP CApplication::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApplication
的用法示例。
在下文中一共展示了CApplication::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
unset($_REQUEST['form']);
unset($_REQUEST['applicationid']);
}
} else {
if ($_REQUEST['go'] == 'delete') {
/* group operations */
$go_result = true;
$applications = get_request('applications', array());
DBstart();
$sql = 'SELECT a.applicationid, a.name, a.hostid ' . ' FROM applications a' . ' WHERE ' . DBin_node('a.applicationid') . ' AND ' . DBcondition('a.applicationid', $applications);
$db_applications = DBselect($sql);
while ($db_app = DBfetch($db_applications)) {
if (!isset($applications[$db_app['applicationid']])) {
continue;
}
$go_result &= (bool) CApplication::delete($db_app['applicationid']);
if ($go_result) {
$host = get_host_by_hostid($db_app['hostid']);
add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_APPLICATION, 'Application [' . $db_app['name'] . '] from host [' . $host['host'] . ']');
}
}
$go_result = DBend($go_result);
show_messages($go_result, S_APPLICATION_DELETED, S_CANNOT_DELETE_APPLICATION);
} else {
if (str_in_array($_REQUEST['go'], array('activate', 'disable'))) {
/* group operations */
$go_result = true;
$applications = get_request('applications', array());
DBstart();
foreach ($applications as $id => $appid) {
$sql = 'SELECT ia.itemid,i.hostid,i.key_' . ' FROM items_applications ia ' . ' LEFT JOIN items i ON ia.itemid=i.itemid ' . ' WHERE ia.applicationid=' . $appid . ' AND i.hostid=' . $_REQUEST['hostid'] . ' AND i.type<>9' . ' AND ' . DBin_node('ia.applicationid');