public function delete() { // Hooks titania::$hook->call_hook_ref(array(__CLASS__, __FUNCTION__), $this); // Delete the queue item $queue = $this->get_queue(); if ($queue !== false) { $queue->delete(); } // Delete the attachment $attachment = new titania_attachment(TITANIA_CONTRIB); $attachment->attachment_id = $this->attachment_id; $attachment->load(); $attachment->delete(); // Delete translations // $translations = new titania_attachment(TITANIA_TRANSLATION, $this->revision_id); // $attachment->delete_all(); // Self-destruct parent::delete(); }
/*$allowed_branches = get_allowed_phpbb_branches(); foreach ($phpbb_versions as $version => $name) { if (!isset($allowed_branches[substr($version, 0, 2)])) { continue; } $template->assign_block_vars('phpbb_versions', array( 'VERSION' => $name, 'S_SELECTED' => (in_array($name, $revision_phpbb_versions)) ? true : false, )); }*/ // Display the main page if ($display_main || sizeof($error)) { if (sizeof($error)) { if ($revision_attachment !== false) { $revision_attachment->delete(); } if ($revision !== false) { $revision->delete(); } } $revision_attachment = new titania_attachment(TITANIA_CONTRIB, titania::$contrib->contrib_id); phpbb::$template->assign_vars(array('REVISION_NAME' => utf8_normalize_nfc(request_var('revision_name', '', true)), 'REVISION_VERSION' => utf8_normalize_nfc(request_var('revision_version', '', true)), 'REVISION_LICENSE' => utf8_normalize_nfc(request_var('revision_license', '', true)), 'REVISION_CUSTOM_LICENSE' => utf8_normalize_nfc(request_var('revision_custom_license', '', true)), 'QUEUE_ALLOW_REPACK' => request_var('queue_allow_repack', 0), 'NEXT_STEP' => 1, 'S_CUSTOM_LICENSE' => utf8_normalize_nfc(request_var('revision_license', '', true)) == phpbb::$user->lang['CUSTOM_LICENSE'] ? true : false, 'S_ALLOW_CUSTOM_LICENSE' => titania_types::$types[titania::$contrib->contrib_type]->license_allow_custom ? true : false)); // Assign separately so we can output some data first phpbb::$template->assign_var('REVISION_UPLOADER', $revision_attachment->parse_uploader('posting/attachments/revisions.html')); } add_form_key('postform'); titania::page_header(titania::$contrib->contrib_name . ' - ' . phpbb::$user->lang['NEW_REVISION']); titania::page_footer(true, 'contributions/contribution_revision.html');