Code Duplication    Length = 10-11 lines in 2 locations

Ubiquity/controllers/crud/CRUDController.php 2 locations

@@ 104-113 (lines=10) @@
101
	 * @param string $modal Accept "no" or "modal" for a modal dialog
102
	 * @param string $ids the primary value(s)
103
	 */
104
	public function edit($modal="no", $ids="") {
105
		if(URequest::isAjax()){
106
			$instance=$this->getModelInstance($ids);
107
			$instance->_new=false;
108
			$this->_edit($instance, $modal);
109
		}else{
110
			$this->jquery->execAtLast("$('._edit[data-ajax={$ids}]').trigger('click');");
111
			$this->index();
112
		}
113
	}
114
	/**
115
	 * Adds a new instance and edits it
116
	 * @param string $modal Accept "no" or "modal" for a modal dialog
@@ 118-128 (lines=11) @@
115
	 * Adds a new instance and edits it
116
	 * @param string $modal Accept "no" or "modal" for a modal dialog
117
	 */
118
	public function newModel($modal="no") {
119
		if(URequest::isAjax()){
120
			$model=$this->model;
121
			$instance=new $model();
122
			$instance->_new=true;
123
			$this->_edit($instance, $modal);
124
		}else{
125
			$this->jquery->execAtLast("$('.ui.button._new').trigger('click');");
126
			$this->index();
127
		}
128
	}
129
	
130
	/**
131
	 * Displays an instance