| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: api.admin.inc,v 1.6.2.6 2009/10/15 05:52:59 drumm Exp $ |
| 3 |
|
|
| 4 |
function api_page_admin_form() { |
function api_page_admin_form() { |
| 5 |
$branches = api_get_branches(); |
$branches = api_get_branches(); |
| 198 |
} |
} |
| 199 |
|
|
| 200 |
function api_branch_delete_form_submit($form, &$form_state) { |
function api_branch_delete_form_submit($form, &$form_state) { |
| 201 |
$result = db_query("SELECT did FROM {api_documentation} WHERE branch_name = '%s'", $form['#branch']->branch_name); |
$result = db_query("SELECT did FROM {api_documentation} WHERE branch_id = %d", $form['#branch']->branch_id); |
| 202 |
$dids = array(); |
$dids = array(); |
| 203 |
while($did = db_fetch_object($result)) { |
while($did = db_fetch_object($result)) { |
| 204 |
$dids[] = $did->did; |
$dids[] = $did->did; |
| 207 |
$placeholders = db_placeholders($dids); |
$placeholders = db_placeholders($dids); |
| 208 |
db_query("DELETE FROM {api_file} WHERE did IN (". $placeholders .")", $dids); |
db_query("DELETE FROM {api_file} WHERE did IN (". $placeholders .")", $dids); |
| 209 |
db_query("DELETE FROM {api_function} WHERE did IN (". $placeholders .")", $dids); |
db_query("DELETE FROM {api_function} WHERE did IN (". $placeholders .")", $dids); |
|
db_query("DELETE FROM {api_reference_storage} WHERE from_did IN (". $placeholders .") OR to_did IN (". $placeholders .")", array_merge($dids, $dids)); |
|
|
db_query("DELETE FROM {api_documentation} WHERE did IN (". $placeholders .")", $dids); |
|
| 210 |
} |
} |
| 211 |
|
db_query("DELETE FROM {api_reference_storage} WHERE branch_id = %d", $form['#branch']->branch_id); |
| 212 |
|
db_query("DELETE FROM {api_documentation} WHERE branch_id = %d", $form['#branch']->branch_id); |
| 213 |
db_query("DELETE FROM {api_branch} WHERE branch_id = '%s'", $form['#branch']->branch_id); |
db_query("DELETE FROM {api_branch} WHERE branch_id = '%s'", $form['#branch']->branch_id); |
| 214 |
|
|
| 215 |
if (variable_get('api_default_branch', NULL) == $form['#branch']->branch_id) { |
if (variable_get('api_default_branch', NULL) == $form['#branch']->branch_id) { |
| 243 |
include_once(drupal_get_path('module', 'api') .'/parser.inc'); |
include_once(drupal_get_path('module', 'api') .'/parser.inc'); |
| 244 |
variable_set('api_php_funcsummary', $form_state['values']['api_php_funcsummary']); |
variable_set('api_php_funcsummary', $form_state['values']['api_php_funcsummary']); |
| 245 |
variable_set('api_php_funcpath', $form_state['values']['api_php_funcpath']); |
variable_set('api_php_funcpath', $form_state['values']['api_php_funcpath']); |
| 246 |
|
//todo |
| 247 |
db_query("DELETE FROM {api_documentation} WHERE branch_name = 'php'"); |
db_query("DELETE FROM {api_documentation} WHERE branch_name = 'php'"); |
| 248 |
api_parse_php_manual($form_state['values']['api_php_funcsummary']); |
api_parse_php_manual($form_state['values']['api_php_funcsummary']); |
| 249 |
drupal_set_message(t('Manual pages scanned.')); |
drupal_set_message(t('Manual pages scanned.')); |