function formSubmit($value = null, $options = array())
 {
     if (inPlaceEditing()) {
         $innerText = $value;
         if (preg_match('/^\\s*(<a\\s*[^>]*>[^<]*<\\/a>)\\s*\\[(.*)\\]$/', $value, $matches)) {
             $innerText = $matches[2];
             $value = $matches[1];
         } else {
             if (preg_match('/^\\s*(<a\\s*[^>]*>([^<]*)<\\/a>)\\s*$/', $value, $matches)) {
                 $innerText = $matches[2];
                 $value = $matches[1];
             }
         }
         if ($innerText !== $value) {
             return "[{$value}]" . Form::submit($innerText, $options);
         }
     }
     return Form::submit($value, $options);
 }
 function formSubmit($value = null, $options = array())
 {
     if (inPlaceEditing()) {
         $innerText = preg_match('/^\\s*<a\\s*[^>]*>([^<]*)<\\/a>\\s*$/', $value, $matches) ? $matches[1] : $value;
         if ($innerText !== $value) {
             return Form::submit($innerText, $options) . "[{$value}]";
         }
     }
     return Form::submit($value, $options);
 }
 public function getToggleInPlaceEdit()
 {
     inPlaceEditing(!inPlaceEditing());
     if (\App::runningUnitTests()) {
         return \Redirect::to('/');
     }
     return !is_null(\Request::header('referer')) ? \Redirect::back() : \Redirect::to('/');
 }