Code Duplication    Length = 10-11 lines in 2 locations

Ubiquity/controllers/crud/CRUDController.php 2 locations

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