From ea9aa8eb3aef95aba0881f99d112e45ef6bfe319 Mon Sep 17 00:00:00 2001 From: Noud de Brouwer Date: Tue, 18 Dec 2012 19:25:12 +0000 Subject: [PATCH] coding standards Coding Standards. --- app/Controller/EventsController.php | 6 +- app/View/Attributes/event.ctp | 214 +++++++++++++------------- app/View/Attributes/index.ctp | 53 +++---- app/View/Elements/actions_menu.ctp | 21 ++- app/View/Events/export.ctp | 8 +- app/View/Events/index.ctp | 76 +++++---- app/View/Events/view.ctp | 229 ++++++++++++++++------------ app/View/Servers/index.ctp | 17 ++- app/View/Servers/pull.ctp | 18 ++- app/View/Servers/push.ctp | 18 ++- app/View/Users/admin_view.ctp | 34 +++-- app/View/Users/memberslist.ctp | 12 +- app/View/Users/view.ctp | 16 +- app/View/Whitelists/admin_index.ctp | 5 +- 14 files changed, 399 insertions(+), 328 deletions(-) mode change 100644 => 100755 app/View/Users/memberslist.ctp mode change 100644 => 100755 app/View/Whitelists/admin_index.ctp diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index fdcab46c9..844b12ff7 100755 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -998,9 +998,11 @@ class EventsController extends AppController { * @param unknown_type $message The custom message that will be appended to the email. * @param unknown_type $all, true: send to org, false: send to person. * - * @return True if success, False if error + * @codingStandardsIgnoreStart + * @throws UnauthorizedException as well. + * @codingStandardsIgnoreEnd * - * @throws NotFoundException,UnauthorizedException // TODO Exception + * @return True if success, False if error */ private function __sendContactEmail($id, $message, $all) { // fetch the event diff --git a/app/View/Attributes/event.ctp b/app/View/Attributes/event.ctp index 72545c1d3..ee174acc2 100755 --- a/app/View/Attributes/event.ctp +++ b/app/View/Attributes/event.ctp @@ -1,17 +1,17 @@
-
- +
  • Form->postLink('Publish Event', array('controller' => 'events', 'action' => 'alert', $event['Event']['id']), null, 'Are you sure this event is complete and everyone should be informed?'); echo $this->Form->postLink('Publish (no email)', array('controller' => 'events', 'action' => 'publish', $event['Event']['id']), null, 'Publish but do NOT send alert email? Only for minor changes!'); - ?>
- -
  • Not published
- - - + ?> +
  • Not published
+
  • Html->link(__('Contact reporter', true), array('controller' => 'events', 'action' => 'contact', $event['Event']['id'])); ?>
@@ -23,8 +23,8 @@
  -
- +
Org
@@ -34,8 +34,8 @@
  -
- +
Date
@@ -45,14 +45,14 @@
  -
- +
Distribution
  -
- + - + +
  • Not published
+ + +
  • Html->link(__('Contact reporter', true), array('action' => 'contact', $event['Event']['id'])); ?>
-Html->image('orgs/' . h($event['Event']['org']) . '.png', array('alt' => h($event['Event']['org']),'width' => '48','hight' => '48', 'style' => 'float:right;')); ?> - + Html->image('orgs/' . h($event['Event']['org']) . '.png', array('alt' => h($event['Event']['org']),'width' => '48','hight' => '48', 'style' => 'float:right;')); ?> +

Event

ID
@@ -64,14 +66,16 @@ if ($isAdmin || $mayPublish) {   - +
Email
 
- +
Date
@@ -87,21 +91,26 @@ if ($isAdmin || $mayPublish) {  
- - + +
Distribution
 
- +
Private
 
- - + +
diff --git a/app/View/Users/view.ctp b/app/View/Users/view.ctp index 371e2811e..404cb9706 100755 --- a/app/View/Users/view.ctp +++ b/app/View/Users/view.ctp @@ -48,11 +48,11 @@
"+nl2br(h($user['User']['gpgkey']))+""; - }else{ - echo "N/A"; - } +if (h($user['User']['gpgkey']) != 0) { + echo "" + nl2br(h($user['User']['gpgkey'])) + ""; +} else { + echo "N/A"; +} ?>  
@@ -60,10 +60,12 @@
\ No newline at end of file diff --git a/app/View/Whitelists/admin_index.ctp b/app/View/Whitelists/admin_index.ctp old mode 100644 new mode 100755 index 7a38159e2..885d6653a --- a/app/View/Whitelists/admin_index.ctp +++ b/app/View/Whitelists/admin_index.ctp @@ -7,7 +7,7 @@ +foreach ($whitelists as $whitelist): ?>     @@ -16,7 +16,8 @@ Form->postLink(__('Delete'), array('admin' => true, 'action' => 'delete', $whitelist['Whitelist']['id']), null, __('Are you sure you want to delete # %s?', $whitelist['Whitelist']['id'])); ?> - +