<?php

class BookmarksController extends AppBackendController {

	var $name = 'Bookmarks';

	function form($url = null) {

		# Save
		if (!empty($this->request->data)) {
			$this->request->data[$this->modelClass]['url'] = str_replace('|', '/', $url);
			$this->request->data[$this->modelClass]['administrator_id'] = $this->Auth->user('id');
			parent::form();
			return;
		}

		# Show proper form
		if (isset($url) && is_numeric($url)) {
			parent::form($url);
		} else {
			parent::form();
			$this->request->data[$this->modelClass]['url'] = str_replace('|', '/', $url);
		}
	}
}
