Completed
Push — master ( d33ddf...2b9d0a )
by Mike
02:20
created
abstracts/view.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @subpackage Test Content
11 11
  * @author     Old Town Media
12 12
  */
13
-abstract class View{
13
+abstract class View {
14 14
 
15 15
 	/**
16 16
 	 * title
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 	 *
45 45
 	 * @see tab, view
46 46
 	 */
47
-	public function register_view(){
47
+	public function register_view() {
48 48
 
49
-		add_action( 'tc-admin-tabs', array( $this, 'tab' ), $this->priority );
50
-		add_action( 'tc-admin-sections', array( $this, 'view' ), $this->priority );
49
+		add_action('tc-admin-tabs', array($this, 'tab'), $this->priority);
50
+		add_action('tc-admin-sections', array($this, 'view'), $this->priority);
51 51
 
52 52
 	}
53 53
 
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 * Each view has a tab and tab navigation - this function compiles our
59 59
 	 * navigation tab. Rarely extended.
60 60
 	 */
61
-	public function tab(){
61
+	public function tab() {
62 62
 		$html = "";
63 63
 
64
-		$html .= "<a class='nav-tab' data-type='".sanitize_title( $this->title )."' href='javascript:void(0)'>";
64
+		$html .= "<a class='nav-tab' data-type='".sanitize_title($this->title)."' href='javascript:void(0)'>";
65 65
 			$html .= $this->title;
66 66
 		$html .= "</a>";
67 67
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @see actions_section, options_section
80 80
 	 */
81
-	public function view(){
81
+	public function view() {
82 82
 		$html = '';
83 83
 
84
-		$html .= "<section class='test-content-tab' data-type='".sanitize_title( $this->title )."'>";
84
+		$html .= "<section class='test-content-tab' data-type='".sanitize_title($this->title)."'>";
85 85
 			$html .= $this->actions_section();
86 86
 			$html .= $this->options_section();
87 87
 		$html .= "</section>";
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 *
99 99
 	 * @return string HTML content.
100 100
 	 */
101
-	protected function actions_section(){
101
+	protected function actions_section() {
102 102
 		$html = '';
103 103
 		return $html;
104 104
 	}
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 	 * @param string $html Existing HTML content.
116 116
 	 * @return string HTML section content.
117 117
 	 */
118
-	protected function options_section( $html = '' ){
118
+	protected function options_section($html = '') {
119 119
 		$html .= "<hr>";
120 120
 
121 121
 		$html .= "<div class='test-data-cpt'>";
122 122
 			$html .= "<h3>";
123
-				$html .= "<span class='label'>".__( 'Quantity', 'otm-test-content' )."</span>";
124
-				$html .= "<input type='number' value='0' class='quantity-adjustment' for='".$this->type."' placeholder='".__( '', 'otm-test-content' )."'> ";
123
+				$html .= "<span class='label'>".__('Quantity', 'otm-test-content')."</span>";
124
+				$html .= "<input type='number' value='0' class='quantity-adjustment' for='".$this->type."' placeholder='".__('', 'otm-test-content')."'> ";
125 125
 			$html .= "</h3>";
126 126
 		$html .= "</div>";
127 127
 
@@ -139,22 +139,22 @@  discard block
 block discarded – undo
139 139
 	 * @param string $text Text to display in the button.
140 140
 	 * @return string HTML.
141 141
 	 */
142
-	protected function build_button( $action, $slug, $text ){
142
+	protected function build_button($action, $slug, $text) {
143 143
 		$html = $dashicon = '';
144 144
 
145
-		if ( $action == 'create' ){
145
+		if ($action == 'create') {
146 146
 			$dashicon = 'dashicons-plus';
147
-		} elseif ( $action == 'delete' ){
147
+		} elseif ($action == 'delete') {
148 148
 			$dashicon = 'dashicons-trash';
149 149
 		}
150 150
 
151 151
 		$html .= "<a href='javascript:void(0);' ";
152
-			$html .= " data-type='" . $this->type . "'";
153
-			$html .= " data-slug='" . $slug . "'";
154
-			$html .= " data-todo='" . $action . "'";
152
+			$html .= " data-type='".$this->type."'";
153
+			$html .= " data-slug='".$slug."'";
154
+			$html .= " data-todo='".$action."'";
155 155
 			$html .= " class='button-primary handle-test-data'";
156 156
 		$html .= "/>";
157
-			$html .= "<span class='dashicons " . $dashicon . "'></span>";
157
+			$html .= "<span class='dashicons ".$dashicon."'></span>";
158 158
 			$html .= $text;
159 159
 		$html .= "</a>";
160 160
 
Please login to merge, or discard this patch.