| @@ 83-110 (lines=28) @@ | ||
| 80 | { |
|
| 81 | $formHasErrors = (is_array($this->_errors) && !empty($this->_errors)); |
|
| 82 | ||
| 83 | if ($formHasErrors) { |
|
| 84 | $this->pageAlert( |
|
| 85 | __('An error occurred while processing this form. See below for details.'), |
|
| 86 | Alert::ERROR |
|
| 87 | ); |
|
| 88 | ||
| 89 | // These alerts are only valid if the form doesn't have errors |
|
| 90 | } elseif (isset($this->_context['flag'])) { |
|
| 91 | $time = Widget::Time(); |
|
| 92 | ||
| 93 | switch ($this->_context['flag']) { |
|
| 94 | case 'saved': |
|
| 95 | $message = __('Data Source updated at %s.', array($time->generate())); |
|
| 96 | break; |
|
| 97 | case 'created': |
|
| 98 | $message = __('Data Source created at %s.', array($time->generate())); |
|
| 99 | } |
|
| 100 | ||
| 101 | $this->pageAlert( |
|
| 102 | $message |
|
| 103 | . ' <a href="' . SYMPHONY_URL . '/blueprints/datasources/new/" accesskey="c">' |
|
| 104 | . __('Create another?') |
|
| 105 | . '</a> <a href="' . SYMPHONY_URL . '/blueprints/datasources/" accesskey="a">' |
|
| 106 | . __('View all Data Sources') |
|
| 107 | . '</a>', |
|
| 108 | Alert::SUCCESS |
|
| 109 | ); |
|
| 110 | } |
|
| 111 | ||
| 112 | $providers = Symphony::ExtensionManager()->getProvidersOf(iProvider::DATASOURCE); |
|
| 113 | $isEditing = $this->_context['action'] === 'edit'; |
|
| @@ 33-60 (lines=28) @@ | ||
| 30 | { |
|
| 31 | $formHasErrors = (is_array($this->_errors) && !empty($this->_errors)); |
|
| 32 | ||
| 33 | if ($formHasErrors) { |
|
| 34 | $this->pageAlert( |
|
| 35 | __('An error occurred while processing this form. See below for details.'), |
|
| 36 | Alert::ERROR |
|
| 37 | ); |
|
| 38 | ||
| 39 | // These alerts are only valid if the form doesn't have errors |
|
| 40 | } elseif (isset($this->_context['flag'])) { |
|
| 41 | $time = Widget::Time(); |
|
| 42 | ||
| 43 | switch ($this->_context['flag']) { |
|
| 44 | case 'saved': |
|
| 45 | $message = __('Event updated at %s.', array($time->generate())); |
|
| 46 | break; |
|
| 47 | case 'created': |
|
| 48 | $message = __('Event created at %s.', array($time->generate())); |
|
| 49 | } |
|
| 50 | ||
| 51 | $this->pageAlert( |
|
| 52 | $message |
|
| 53 | . ' <a href="' . SYMPHONY_URL . '/blueprints/events/new/" accesskey="c">' |
|
| 54 | . __('Create another?') |
|
| 55 | . '</a> <a href="' . SYMPHONY_URL . '/blueprints/events/" accesskey="a">' |
|
| 56 | . __('View all Events') |
|
| 57 | . '</a>', |
|
| 58 | Alert::SUCCESS |
|
| 59 | ); |
|
| 60 | } |
|
| 61 | ||
| 62 | $isEditing = ($readonly ? true : false); |
|
| 63 | $fields = array("name" => null, "filters" => null); |
|
| @@ 427-454 (lines=28) @@ | ||
| 424 | ||
| 425 | $formHasErrors = (is_array($this->_errors) && !empty($this->_errors)); |
|
| 426 | ||
| 427 | if ($formHasErrors) { |
|
| 428 | $this->pageAlert( |
|
| 429 | __('An error occurred while processing this form. See below for details.'), |
|
| 430 | Alert::ERROR |
|
| 431 | ); |
|
| 432 | ||
| 433 | // These alerts are only valid if the form doesn't have errors |
|
| 434 | } elseif (isset($this->_context['flag'])) { |
|
| 435 | $time = Widget::Time(); |
|
| 436 | ||
| 437 | switch ($this->_context['flag']) { |
|
| 438 | case 'saved': |
|
| 439 | $message = __('Section updated at %s.', array($time->generate())); |
|
| 440 | break; |
|
| 441 | case 'created': |
|
| 442 | $message = __('Section created at %s.', array($time->generate())); |
|
| 443 | } |
|
| 444 | ||
| 445 | $this->pageAlert( |
|
| 446 | $message |
|
| 447 | . ' <a href="' . SYMPHONY_URL . '/blueprints/sections/new/" accesskey="c">' |
|
| 448 | . __('Create another?') |
|
| 449 | . '</a> <a href="' . SYMPHONY_URL . '/blueprints/sections/" accesskey="a">' |
|
| 450 | . __('View all Sections') |
|
| 451 | . '</a>', |
|
| 452 | Alert::SUCCESS |
|
| 453 | ); |
|
| 454 | } |
|
| 455 | ||
| 456 | if (isset($_POST['fields'])) { |
|
| 457 | $fields = array(); |
|