You are here

function empty_page_save_callback in Empty Page 7

Save an Empty Page callback.

Parameters

object $callback:

Return value

int $cid

1 call to empty_page_save_callback()
empty_page_callbacks_form_submit in ./empty_page.admin.inc
Form submit handler for adding / editing an Empty Page callback.

File

./empty_page.module, line 154
Empty Page module A simple empty page solution. Assists in creating empty menu callbacks, mostly used for pages that only consist of blocks.

Code

function empty_page_save_callback($callback) {
  if (property_exists($callback, 'cid')) {
    db_update('empty_page')
      ->fields(array(
      'path' => $callback->path,
      'page_title' => $callback->page_title,
      'changed' => REQUEST_TIME,
    ))
      ->condition('cid', $callback->cid)
      ->execute();
    $ret = $callback->cid;
  }
  else {
    $id = db_insert('empty_page')
      ->fields(array(
      'path' => $callback->path,
      'page_title' => $callback->page_title,
      'created' => REQUEST_TIME,
      'changed' => REQUEST_TIME,
    ))
      ->execute();
    $ret = $id;
  }
  return $ret;
}