本文整理汇总了PHP中EntryManager::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP EntryManager::delete方法的具体用法?PHP EntryManager::delete怎么用?PHP EntryManager::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntryManager
的用法示例。
在下文中一共展示了EntryManager::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete($section_id)
{
$query = "SELECT `id`, `sortorder` FROM tbl_sections WHERE `id` = '{$section_id}'";
$details = Symphony::Database()->fetchRow(0, $query);
## Delete all the entries
include_once TOOLKIT . '/class.entrymanager.php';
$entryManager = new EntryManager($this->_Parent);
$entries = Symphony::Database()->fetchCol('id', "SELECT `id` FROM `tbl_entries` WHERE `section_id` = '{$section_id}'");
$entryManager->delete($entries);
## Delete all the fields
$fieldManager = new FieldManager($this->_Parent);
$fields = Symphony::Database()->fetchCol('id', "SELECT `id` FROM `tbl_fields` WHERE `parent_section` = '{$section_id}'");
if (is_array($fields) && !empty($fields)) {
foreach ($fields as $field_id) {
$fieldManager->delete($field_id);
}
}
## Delete the section
Symphony::Database()->delete('tbl_sections', " `id` = '{$section_id}'");
## Update the sort orders
Symphony::Database()->query("UPDATE tbl_sections SET `sortorder` = (`sortorder` - 1) WHERE `sortorder` > '" . $details['sortorder'] . "'");
## Delete the section associations
Symphony::Database()->delete('tbl_sections_association', " `parent_section_id` = '{$section_id}'");
return true;
}
示例2: __deleteMembers
private function __deleteMembers($role_id)
{
$sql = "SELECT `entry_id` FROM `tbl_entries_data_" . $this->_driver->roleField() . "` WHERE `role_id` = {$role_id}";
$members = Administration::Database()->fetchCol('entry_id', $sql);
###
# Delegate: Delete
# Description: Prior to deletion of entries. Array of Entries is provided.
# The array can be manipulated
Administration::instance()->ExtensionManager->notifyMembers('Delete', '/publish/', array('entry_id' => &$checked));
$entryManager = new EntryManager($this->_Parent);
$entryManager->delete($members);
}
示例3: delete
public static function delete()
{
$entry = EntryManager::fetch(self::$_entry_id);
if (!$entry) {
REST_API::sendError('Entry not found.', 404);
} else {
EntryManager::delete(self::$_entry_id);
$response = new XMLElement('response', NULL, array('id' => self::$_entry_id, 'result' => 'success', 'type' => 'deleted'));
$response->appendChild(new XMLElement('message', 'Entry deleted successfully.'));
REST_API::sendOutput($response);
}
}
示例4: delete
/**
* Deletes a Section by Section ID, removing all entries, fields, the
* Section and any Section Associations in that order
*
* @param integer $section_id
* The ID of the Section to delete
* @throws DatabaseException
* @throws Exception
* @return boolean
* Returns true when completed
*/
public static function delete($section_id)
{
$details = Symphony::Database()->fetchRow(0, sprintf("\n SELECT `sortorder` FROM tbl_sections WHERE `id` = %d", $section_id));
// Delete all the entries
include_once TOOLKIT . '/class.entrymanager.php';
$entries = Symphony::Database()->fetchCol('id', "SELECT `id` FROM `tbl_entries` WHERE `section_id` = '{$section_id}'");
EntryManager::delete($entries);
// Delete all the fields
$fields = FieldManager::fetch(null, $section_id);
if (is_array($fields) && !empty($fields)) {
foreach ($fields as $field) {
FieldManager::delete($field->get('id'));
}
}
// Delete the section
Symphony::Database()->delete('tbl_sections', sprintf("\n `id` = %d", $section_id));
// Update the sort orders
Symphony::Database()->query(sprintf("\n UPDATE tbl_sections\n SET `sortorder` = (`sortorder` - 1)\n WHERE `sortorder` > %d", $details['sortorder']));
// Delete the section associations
Symphony::Database()->delete('tbl_sections_association', sprintf("\n `parent_section_id` = %d", $section_id));
return true;
}
示例5: intval
function __actionEdit()
{
$entry_id = intval($this->_context['entry_id']);
if (@array_key_exists('save', $_POST['action']) || @array_key_exists("done", $_POST['action'])) {
$entryManager = new EntryManager($this->_Parent);
if (!($ret = $entryManager->fetch($entry_id))) {
$this->_Parent->customError(E_USER_ERROR, __('Unknown Entry'), __('The entry you are looking for could not be found.'), false, true);
}
$entry = $ret[0];
$sectionManager = new SectionManager($this->_Parent);
$section = $sectionManager->fetch($entry->get('section_id'));
$post = General::getPostData();
$fields = $post['fields'];
if (__ENTRY_FIELD_ERROR__ == $entry->checkPostData($fields, $this->_errors)) {
$this->pageAlert(__('Some errors were encountered while attempting to save.'), Alert::ERROR);
} elseif (__ENTRY_OK__ != $entry->setDataFromPost($fields, $error)) {
$this->pageAlert($error['message'], Alert::ERROR);
} else {
###
# Delegate: EntryPreEdit
# Description: Just prior to editing of an Entry.
$this->_Parent->ExtensionManager->notifyMembers('EntryPreEdit', '/publish/edit/', array('section' => $section, 'entry' => &$entry, 'fields' => $fields));
if (!$entry->commit()) {
define_safe('__SYM_DB_INSERT_FAILED__', true);
$this->pageAlert(NULL, Alert::ERROR);
} else {
###
# Delegate: EntryPostEdit
# Description: Editing an entry. Entry object is provided.
$this->_Parent->ExtensionManager->notifyMembers('EntryPostEdit', '/publish/edit/', array('section' => $section, 'entry' => $entry, 'fields' => $fields));
$prepopulate_field_id = $prepopulate_value = NULL;
if (isset($_POST['prepopulate'])) {
$prepopulate_field_id = array_shift(array_keys($_POST['prepopulate']));
$prepopulate_value = stripslashes(rawurldecode(array_shift($_POST['prepopulate'])));
}
//redirect(URL . '/symphony/publish/' . $this->_context['section_handle'] . '/edit/' . $entry_id . '/saved/');
redirect(sprintf('%s/symphony/publish/%s/edit/%d/saved%s/', URL, $this->_context['section_handle'], $entry->get('id'), !is_null($prepopulate_field_id) ? ":{$prepopulate_field_id}:{$prepopulate_value}" : NULL));
}
}
} elseif (@array_key_exists('delete', $_POST['action']) && is_numeric($entry_id)) {
###
# Delegate: Delete
# Description: Prior to deleting an entry. Entry ID is provided, as an array to remain compatible with other Delete delegate call
Administration::instance()->ExtensionManager->notifyMembers('Delete', '/publish/', array('entry_id' => $entry_id));
$entryManager = new EntryManager($this->_Parent);
$entryManager->delete($entry_id);
redirect(URL . '/symphony/publish/' . $this->_context['section_handle'] . '/');
}
}
示例6: intval
function __actionEdit()
{
$entry_id = intval($this->_context['entry_id']);
if (@array_key_exists('save', $_POST['action']) || @array_key_exists("done", $_POST['action'])) {
$entryManager = new EntryManager($this->_Parent);
if (!($ret = $entryManager->fetch($entry_id))) {
$this->_Parent->customError(E_USER_ERROR, __('Unknown Entry'), __('The entry you are looking for could not be found.'), false, true);
}
$entry = $ret[0];
$sectionManager = new SectionManager($this->_Parent);
$section = $sectionManager->fetch($entry->get('section_id'));
$fields = $_POST['fields'];
## Combine FILES and POST arrays, indexed by their custom field handles
if (isset($_FILES['fields'])) {
$filedata = General::processFilePostData($_FILES['fields']);
foreach ($filedata as $handle => $data) {
if (!isset($fields[$handle])) {
$fields[$handle] = $data;
} elseif (isset($data['error']) && $data['error'] == 4) {
$fields['handle'] = NULL;
} else {
foreach ($data as $ii => $d) {
if (isset($d['error']) && $d['error'] == 4) {
$fields[$handle][$ii] = NULL;
} elseif (is_array($d) && !empty($d)) {
foreach ($d as $key => $val) {
$fields[$handle][$ii][$key] = $val;
}
}
}
}
}
}
if (__ENTRY_FIELD_ERROR__ == $entry->checkPostData($fields, $this->_errors)) {
$this->pageAlert(__('Some errors were encountered while attempting to save.'), Alert::ERROR);
} elseif (__ENTRY_OK__ != $entry->setDataFromPost($fields, $error)) {
$this->pageAlert($error['message'], Alert::ERROR);
} else {
###
# Delegate: EntryPreEdit
# Description: Just prior to editing of an Entry.
$this->_Parent->ExtensionManager->notifyMembers('EntryPreEdit', '/publish/edit/', array('section' => $section, 'entry' => &$entry, 'fields' => $fields));
if (!$entry->commit()) {
define_safe('__SYM_DB_INSERT_FAILED__', true);
$this->pageAlert(NULL, Alert::ERROR);
} else {
###
# Delegate: EntryPostEdit
# Description: Editing an entry. Entry object is provided.
$this->_Parent->ExtensionManager->notifyMembers('EntryPostEdit', '/publish/edit/', array('section' => $section, 'entry' => $entry, 'fields' => $fields));
redirect(URL . '/symphony/publish/' . $this->_context['section_handle'] . '/edit/' . $entry_id . '/saved/');
}
}
} elseif (@array_key_exists('delete', $_POST['action']) && is_numeric($entry_id)) {
## TODO: Fix Me
###
# Delegate: Delete
# Description: Prior to deleting an entry. Entry ID is provided.
##$ExtensionManager->notifyMembers('Delete', getCurrentPage(), array('entry_id' => $entry_id));
$entryManager = new EntryManager($this->_Parent);
$entryManager->delete($entry_id);
redirect(URL . '/symphony/publish/' . $this->_context['section_handle'] . '/');
}
}
示例7: view
/**
*
* Builds the content view
*/
public function view()
{
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->_Result['status'] = Page::HTTP_STATUS_BAD_REQUEST;
$this->_Result['error'] = __('This page accepts posts only');
$this->setHttpStatus($this->_Result['status']);
return;
}
// _context[0] => entry id to delete
// _context[1] => fieldId
// _context[2] => current entry id (parent of entry id to delete)
if (!is_array($this->_context) || empty($this->_context)) {
$this->_Result['error'] = __('Parameters not found');
return;
} else {
if (count($this->_context) < self::NUMBER_OF_URL_PARAMETERS) {
$this->_Result['error'] = __('Not enough parameters');
return;
} else {
if (count($this->_context) > self::NUMBER_OF_URL_PARAMETERS) {
$this->_Result['error'] = __('Too many parameters');
return;
}
}
}
// Validate to delete entry ID
$rawToDeleteEntryId = MySQL::cleanValue($this->_context[0]);
$toDeleteEntryId = General::intval($rawToDeleteEntryId);
if ($toDeleteEntryId < 1) {
$this->_Result['error'] = __('No entry no found');
return;
}
// Validate parent field exists
$parentFieldId = General::intval(MySQL::cleanValue($this->_context[1]));
if ($parentFieldId < 1) {
$this->_Result['error'] = __('Parent id not valid');
return;
}
$parentField = FieldManager::fetch($parentFieldId);
if (!$parentField || empty($parentField)) {
$this->_Result['error'] = __('Parent field not found');
return;
}
// Validate parent entry ID
$rawEntryId = MySQL::cleanValue($this->_context[2]);
$entryId = General::intval($rawEntryId);
if ($entryId < 1) {
$this->_Result['error'] = sprintf(__('Parent entry id `%s` not valid'), $rawEntryId);
return;
}
// Validate parent entry exists
$entry = EntryManager::fetch($entryId);
if ($entry == null || count($entry) != 1) {
$this->_Result['error'] = __('Parent entry not found');
return;
}
if (is_array($entry)) {
$entry = $entry[0];
}
if ($entry->get('section_id') != $parentField->get('parent_section')) {
$this->_Result['error'] = __('Field and entry do not belong together');
return;
}
// Validate to delete entry exists
$toDeleteEntry = EntryManager::fetch($toDeleteEntryId);
if ($toDeleteEntry == null || count($toDeleteEntry) != 1) {
$this->_Result['error'] = __('Entry not found');
return;
}
if (is_array($toDeleteEntry)) {
$toDeleteEntry = $toDeleteEntry[0];
}
// Validate entry is not linked anywhere else
if (!isset($_REQUEST['no-assoc'])) {
//$toDeleteSection = SectionManager::fetch($toDeleteEntry->get('section_id'));
//$toDeleteAssoc = $toDeleteSection->fetchChildAssociations(false);
$toDeleteAssoc = SectionManager::fetchChildAssociations($toDeleteEntry->get('section_id'), false);
//var_dump($toDeleteAssoc);die;
// TODO: find if the toDeleteEntry is linked or not.
if (count($toDeleteAssoc) > 1) {
$this->_Result['assoc'] = true;
$this->_Result['error'] = __('Entry might be link elsewhere. Do you want to continue?');
return;
}
}
// Delete the entry
if (!EntryManager::delete($toDeleteEntryId)) {
$this->_Result['error'] = __('Could not delete the entry');
return;
}
$this->_Result['entry-id'] = $entryId;
$this->_Result['ok'] = true;
}
示例8: __actionEdit
public function __actionEdit()
{
$entry_id = intval($this->_context['entry_id']);
if (@array_key_exists('save', $_POST['action']) || @array_key_exists("done", $_POST['action'])) {
if (!($ret = EntryManager::fetch($entry_id))) {
Administration::instance()->customError(__('Unknown Entry'), __('The entry you are looking for could not be found.'));
}
$entry = $ret[0];
$section = SectionManager::fetch($entry->get('section_id'));
$post = General::getPostData();
$fields = $post['fields'];
// Initial checks to see if the Entry is ok
if (__ENTRY_FIELD_ERROR__ == $entry->checkPostData($fields, $this->_errors)) {
$this->pageAlert(__('Some errors were encountered while attempting to save.'), Alert::ERROR);
} else {
if (__ENTRY_OK__ != $entry->setDataFromPost($fields, $errors)) {
foreach ($errors as $field_id => $message) {
$this->pageAlert($message, Alert::ERROR);
}
} else {
/**
* Just prior to editing of an Entry.
*
* @delegate EntryPreEdit
* @param string $context
* '/publish/edit/'
* @param Section $section
* @param Entry $entry
* @param array $fields
*/
Symphony::ExtensionManager()->notifyMembers('EntryPreEdit', '/publish/edit/', array('section' => $section, 'entry' => &$entry, 'fields' => $fields));
// Check to see if the dancing was premature
if (!$entry->commit()) {
define_safe('__SYM_DB_INSERT_FAILED__', true);
$this->pageAlert(NULL, Alert::ERROR);
} else {
/**
* Just after the editing of an Entry
*
* @delegate EntryPostEdit
* @param string $context
* '/publish/edit/'
* @param Section $section
* @param Entry $entry
* @param array $fields
*/
Symphony::ExtensionManager()->notifyMembers('EntryPostEdit', '/publish/edit/', array('section' => $section, 'entry' => $entry, 'fields' => $fields));
$prepopulate_querystring = '';
if (isset($_POST['prepopulate'])) {
foreach ($_POST['prepopulate'] as $field_id => $value) {
$prepopulate_querystring .= sprintf("prepopulate[%s]=%s&", $field_id, $value);
}
$prepopulate_querystring = trim($prepopulate_querystring, '&');
}
redirect(sprintf('%s/publish/%s/edit/%d/saved/%s', SYMPHONY_URL, $this->_context['section_handle'], $entry->get('id'), !empty($prepopulate_querystring) ? "?" . $prepopulate_querystring : NULL));
}
}
}
} else {
if (@array_key_exists('delete', $_POST['action']) && is_numeric($entry_id)) {
/**
* Prior to deletion of entries. An array of Entry ID's is provided which
* can be manipulated. This delegate was renamed from `Delete` to `EntryPreDelete`
* in Symphony 2.3.
*
* @delegate EntryPreDelete
* @param string $context
* '/publish/'
* @param array $entry_id
* An array of Entry ID's passed by reference
*/
$checked = array($entry_id);
Symphony::ExtensionManager()->notifyMembers('EntryPreDelete', '/publish/', array('entry_id' => &$checked));
EntryManager::delete($checked);
/**
* After the deletion of entries, this delegate provides an array of Entry ID's
* that were deleted.
*
* @since Symphony 2.3
* @delegate EntryPostDelete
* @param string $context
* '/publish/'
* @param array $entry_id
* An array of Entry ID's that were deleted.
*/
Symphony::ExtensionManager()->notifyMembers('EntryPostDelete', '/publish/', array('entry_id' => $checked));
redirect(SYMPHONY_URL . '/publish/' . $this->_context['section_handle'] . '/');
}
}
}
示例9: __actionEdit
public function __actionEdit()
{
$entry_id = intval($this->_context['entry_id']);
if (@array_key_exists('save', $_POST['action']) || @array_key_exists("done", $_POST['action'])) {
$entryManager = new EntryManager($this->_Parent);
if (!($ret = $entryManager->fetch($entry_id))) {
Administration::instance()->customError(__('Unknown Entry'), __('The entry you are looking for could not be found.'));
}
$entry = $ret[0];
$sectionManager = new SectionManager($this->_Parent);
$section = $sectionManager->fetch($entry->get('section_id'));
$post = General::getPostData();
$fields = $post['fields'];
if (__ENTRY_FIELD_ERROR__ == $entry->checkPostData($fields, $this->_errors)) {
$this->pageAlert(__('Some errors were encountered while attempting to save.'), Alert::ERROR);
} elseif (__ENTRY_OK__ != $entry->setDataFromPost($fields, $error)) {
$this->pageAlert($error['message'], Alert::ERROR);
} else {
/**
* Just prior to editing of an Entry.
*
* @delegate EntryPreEdit
* @param string $context
* '/publish/edit/'
* @param Section $section
* @param Entry $entry
* @param array $fields
*/
Symphony::ExtensionManager()->notifyMembers('EntryPreEdit', '/publish/edit/', array('section' => $section, 'entry' => &$entry, 'fields' => $fields));
if (!$entry->commit()) {
define_safe('__SYM_DB_INSERT_FAILED__', true);
$this->pageAlert(NULL, Alert::ERROR);
} else {
/**
* Just after the editing of an Entry
*
* @delegate EntryPostEdit
* @param string $context
* '/publish/edit/'
* @param Section $section
* @param Entry $entry
* @param array $fields
*/
Symphony::ExtensionManager()->notifyMembers('EntryPostEdit', '/publish/edit/', array('section' => $section, 'entry' => $entry, 'fields' => $fields));
$prepopulate_field_id = $prepopulate_value = NULL;
if (isset($_POST['prepopulate'])) {
$prepopulate_field_id = array_shift(array_keys($_POST['prepopulate']));
$prepopulate_value = stripslashes(rawurldecode(array_shift($_POST['prepopulate'])));
}
redirect(sprintf('%s/publish/%s/edit/%d/saved%s/', SYMPHONY_URL, $this->_context['section_handle'], $entry->get('id'), !is_null($prepopulate_field_id) ? ":{$prepopulate_field_id}:{$prepopulate_value}" : NULL));
}
}
} elseif (@array_key_exists('delete', $_POST['action']) && is_numeric($entry_id)) {
/**
* Prior to deletion of entries. Array of Entry ID's is provided.
* The array can be manipulated
*
* @delegate Delete
* @param string $context
* '/publish/'
* @param array $checked
* An array of Entry ID's passed by reference
*/
Symphony::ExtensionManager()->notifyMembers('Delete', '/publish/', array('entry_id' => $entry_id));
$entryManager = new EntryManager($this->_Parent);
$entryManager->delete($entry_id);
redirect(SYMPHONY_URL . '/publish/' . $this->_context['section_handle'] . '/');
}
}
示例10: delete
/**
* Will delete the Role given a `$role_id`. Should `$purge_members`
* be passed, this function will remove all Members associated with
* this role as well
*
* @param integer $role_id
* @param boolean $purge_members
* @return boolean
*/
public function delete($role_id, $purge_members = false)
{
Symphony::Database()->delete("`tbl_members_roles_forbidden_pages`", " `role_id` = " . $role_id);
Symphony::Database()->delete("`tbl_members_roles_event_permissions`", " `role_id` = " . $role_id);
Symphony::Database()->delete("`tbl_members_roles`", " `id` = " . $role_id);
if ($purge_members) {
$members = Symphony::Database()->fetchCol('entry_id', sprintf("SELECT `entry_id` FROM `tbl_entries_data_%d` WHERE `role_id` = %d", extension_Members::getField('role')->get('id'), $role_id));
/**
* Prior to deletion of entries. Array of Entry ID's is provided.
* The array can be manipulated
*
* @delegate Delete
* @param string $context
* '/publish/'
* @param array $checked
* An array of Entry ID's passed by reference
*/
Symphony::ExtensionManager()->notifyMembers('Delete', '/publish/', array('entry_id' => &$checked));
$entryManager = new EntryManager(Symphony::Engine());
$entryManager->delete($members);
}
return true;
}
示例11: rollbackTransaction
public function rollbackTransaction()
{
// Don't delete if there are no errors
if (!$this->rollback) {
return;
}
include_once TOOLKIT . '/class.entrymanager.php';
$entryManager = new EntryManager($this->_Parent);
$entryManager->delete($this->created_entries);
}
示例12: __actionIndex
public function __actionIndex()
{
$checked = is_array($_POST['items']) ? array_keys($_POST['items']) : null;
if (is_array($checked) && !empty($checked)) {
if ($_POST['with-selected'] == 'delete') {
/**
* Just prior to calling the Section Manager's delete function
*
* @delegate SectionPreDelete
* @since Symphony 2.2
* @param string $context
* '/blueprints/sections/'
* @param array $section_ids
* An array of Section ID's passed by reference
*/
Symphony::ExtensionManager()->notifyMembers('SectionPreDelete', '/blueprints/sections/', array('section_ids' => &$checked));
$sectionManager = new SectionManager($this->_Parent);
foreach ($checked as $section_id) {
$sectionManager->delete($section_id);
}
redirect(SYMPHONY_URL . '/blueprints/sections/');
} else {
if ($_POST['with-selected'] == 'delete-entries') {
$entryManager = new EntryManager($this->_Parent);
foreach ($checked as $section_id) {
$entries = $entryManager->fetch(NULL, $section_id, NULL, NULL, NULL, NULL, false, false, null, false);
$entry_ids = array();
foreach ($entries as $entry) {
$entry_ids[] = $entry['id'];
}
/**
* Prior to deletion of entries.
*
* @delegate Delete
* @param string $context
* '/publish/'
* @param array $entry_id
* An array of Entry ID's that are about to be deleted, passed by reference
*/
Symphony::ExtensionManager()->notifyMembers('Delete', '/publish/', array('entry_id' => &$entry_ids));
$entryManager->delete($entry_ids, $section_id);
}
redirect(SYMPHONY_URL . '/blueprints/sections/');
} else {
if (preg_match('/^set-navigation-group-/', $_POST['with-selected'])) {
$sectionManager = new SectionManager($this->_Parent);
$navigation_group = preg_replace('/^set-navigation-group-/', null, $_POST['with-selected']);
foreach ($checked as $section_id) {
$sectionManager->edit($section_id, array('navigation_group' => urldecode($navigation_group)));
}
redirect(SYMPHONY_URL . '/blueprints/sections/');
}
}
}
}
}
示例13: intval
}
$change_handle = $Admin->getConfigVar("allow_primary_field_handles_to_change", "symphony");
$change_handle = intval($change_handle);
$change_handle = $change_handle == 1 ? true : false;
$retval = $entryManager->edit($entry_id, $data['custom'], $newPublishTimestamp, 'real', $change_handle);
if (!$retval) {
define("__SYM_DB_INSERT_FAILED__", true);
} else {
$Admin->flush_cache(array("entries", "authors"));
###
# Delegate: Edit
# Description: Editing an entry. Section and Entry ID are provided.
$CampfireManager->notifyMembers('Edit', CURRENTPAGE, array('section_id' => $section_id, 'entry_id' => $entry_id));
if (@array_key_exists("save", $_POST['action'])) {
General::redirect($Admin->getCurrentPageURL() . "&_sid={$section_id}&id={$entry_id}&_f=saved");
}
General::redirect(URL . "/symphony/?page=/publish/section/&_sid={$section_id}");
}
}
}
if (@array_key_exists("delete", $_POST['action'])) {
###
# Delegate: Delete
# Description: Prior to deleting an entry. Both Section and Entry ID are provided.
$CampfireManager->notifyMembers('Delete', CURRENTPAGE, array('section_id' => $_REQUEST['_sid'], 'entry_id' => $_REQUEST['id']));
include_once TOOLKIT . "/class.entrymanager.php";
$entryManager = new EntryManager($Admin);
$entryManager->delete($_REQUEST['id']);
$Admin->flush_cache(array("entries", "authors", "comments"));
General::redirect(URL . "/symphony/?page=/publish/section/&_f=complete&_sid=" . $_REQUEST['_sid']);
}
示例14: switch
<?php
/***
*
* Symphony web publishing system
*
* Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
*
* @version 1.7
* @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
*
***/
if (isset($_POST['action']['apply'])) {
$checked = @array_keys($_POST['items']);
if (!empty($checked) && is_array($checked)) {
switch ($_POST["with-selected"]) {
case 'delete':
###
# Delegate: Delete
# Description: Prior to deletion of entries. Section ID and Array of Entries is provided.
# The array can be manipulated
$CampfireManager->notifyMembers('Delete', CURRENTPAGE, array('section_id' => $_REQUEST['_sid'], 'entry_id' => &$checked));
include_once TOOLKIT . "/class.entrymanager.php";
$entryManager = new EntryManager($Admin);
$entryManager->delete($checked);
$Admin->flush_cache(array("entries", "authors", "comments"));
General::redirect($Admin->getCurrentPageURL() . "&_sid=" . $_REQUEST['_sid'] . "&_f=complete");
}
}
}
示例15: rollback
/**
* Rollback whatever entries have been created
*
* @param $sections
*/
private function rollback($sections)
{
$to_delete = array();
foreach ($sections as $handle => $section) {
foreach ($section['entries'] as $entry) {
if ($entry['action'] === SE_Permissions::ACTION_CREATE) {
$id = $entry['entry']->get('id');
if (is_numeric($id)) {
$to_delete[] = $id;
}
}
}
}
if (!empty($to_delete)) {
include_once TOOLKIT . '/class.entrymanager.php';
EntryManager::delete($to_delete);
}
}