| @@ 87-96 (lines=10) @@ | ||
| 84 | * @param string $modal Accept "no" or "modal" for a modal dialog |
|
| 85 | * @param string $ids the primary value(s) |
|
| 86 | */ |
|
| 87 | public function edit($modal="no", $ids="") { |
|
| 88 | if(URequest::isAjax()){ |
|
| 89 | $instance=$this->getModelInstance($ids); |
|
| 90 | $instance->_new=false; |
|
| 91 | $this->_edit($instance, $modal); |
|
| 92 | }else{ |
|
| 93 | $this->jquery->execAtLast("$('._edit[data-ajax={$ids}]').trigger('click');"); |
|
| 94 | $this->index(); |
|
| 95 | } |
|
| 96 | } |
|
| 97 | /** |
|
| 98 | * Adds a new instance and edits it |
|
| 99 | * @param string $modal Accept "no" or "modal" for a modal dialog |
|
| @@ 101-111 (lines=11) @@ | ||
| 98 | * Adds a new instance and edits it |
|
| 99 | * @param string $modal Accept "no" or "modal" for a modal dialog |
|
| 100 | */ |
|
| 101 | public function newModel($modal="no") { |
|
| 102 | if(URequest::isAjax()){ |
|
| 103 | $model=$this->model; |
|
| 104 | $instance=new $model(); |
|
| 105 | $instance->_new=true; |
|
| 106 | $this->_edit($instance, $modal); |
|
| 107 | }else{ |
|
| 108 | $this->jquery->execAtLast("$('.ui.button._new').trigger('click');"); |
|
| 109 | $this->index(); |
|
| 110 | } |
|
| 111 | } |
|
| 112 | ||
| 113 | /** |
|
| 114 | * Displays an instance |
|