Code Duplication    Length = 10-11 lines in 2 locations

Ubiquity/controllers/crud/CRUDController.php 2 locations

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