You are here

function _sbp_paths_edit in Search by Page 6

Same name and namespace in other branches
  1. 7 sbp_paths.module \_sbp_paths_edit()

Edits or adds new path.

1 string reference to '_sbp_paths_edit'
sbp_paths_menu in ./sbp_paths.module
Implementation of hook_menu().

File

./sbp_paths.module, line 307
Module file for Search by Page Paths, a sub-module for Search by Page.

Code

function _sbp_paths_edit($environment, $pid = 0) {
  if ($pid) {
    $values = db_fetch_array(db_query('SELECT * FROM {sbpp_path} p WHERE p.pid = %d', $pid));
    $values['languages'] = @unserialize($values['languages']);
    if (!$values['languages']) {
      $values['languages'] = array();
    }
    return drupal_get_form('sbp_paths_edit_form', $values);
  }
  else {
    return drupal_get_form('sbp_paths_edit_form', array(
      'environment' => $environment,
    ));
  }
}