@@ -14,11 +14,11 @@ public function init()
1414
1515 public function browseAction ()
1616 {
17- if (!$ this ->_hasParam ('sort_field ' )) {
17+ if (!$ this ->_hasParam ('sort_field ' )) {
1818 $ this ->_setParam ('sort_field ' , 'added ' );
1919 }
2020
21- if (!$ this ->_hasParam ('sort_dir ' )) {
21+ if (!$ this ->_hasParam ('sort_dir ' )) {
2222 $ this ->_setParam ('sort_dir ' , 'd ' );
2323 }
2424 parent ::browseAction ();
@@ -27,11 +27,11 @@ public function browseAction()
2727 public function batchDeleteAction ()
2828 {
2929 $ ids = $ _POST ['ids ' ];
30- foreach ($ ids as $ id ) {
30+ foreach ($ ids as $ id ) {
3131 $ record = $ this ->_helper ->db ->findById ($ id );
3232 $ record ->delete ();
3333 }
34- $ response = array ('status ' => 'ok ' );
34+ $ response = array ('status ' => 'ok ' );
3535 $ this ->_helper ->json ($ response );
3636 }
3737
@@ -41,19 +41,19 @@ public function addAction()
4141 $ module = isset ($ _POST ['module ' ]) ? Inflector::camelize ($ _POST ['module ' ]) : '' ;
4242 $ destArray = array (
4343 'module ' => $ module ,
44- 'controller ' => strtolower (Inflector::pluralize ($ _POST ['record_type ' ])),
44+ 'controller ' => strtolower (Inflector::pluralize ($ _POST ['record_type ' ])),
4545 'action ' => 'show ' ,
4646 'id ' => $ _POST ['record_id ' ]
4747 );
4848
4949 $ comment = new Comment ();
50- if ($ user = current_user ()) {
50+ if ($ user = current_user ()) {
5151 $ comment ->user_id = $ user ->id ;
5252 }
5353 $ comment ->flagged = 0 ;
5454 $ form = $ this ->_getForm ();
5555 $ valid = $ form ->isValid ($ this ->getRequest ()->getPost ());
56- if (!$ valid ) {
56+ if (!$ valid ) {
5757 $ destination .= "#comment-form " ;
5858 $ commentSession = new Zend_Session_Namespace ('commenting ' );
5959 $ commentSession ->post = serialize ($ _POST );
@@ -67,7 +67,7 @@ public function addAction()
6767 $ reqAppPublicComment = (bool ) get_option ('commenting_require_public_moderation ' );
6868 $ requiresApproval = $ requiresApproval || (!is_object (current_user ()) && $ reqAppPublicComment );
6969 //end Daniel Lind contribution
70- if ($ requiresApproval ) {
70+ if ($ requiresApproval ) {
7171 $ this ->_helper ->flashMessenger (__ ("Your comment is awaiting moderation " ), 'success ' );
7272 }
7373
@@ -91,11 +91,11 @@ public function updateSpamAction()
9191 $ table = $ this ->_helper ->db ->getTable ();
9292 $ wordPressAPIKey = get_option ('commenting_wpapi_key ' );
9393 $ ak = new Zend_Service_Akismet ($ wordPressAPIKey , WEB_ROOT );
94- $ response = array ('errors ' => array ());
95- foreach ($ commentIds as $ commentId ) {
94+ $ response = array ('errors ' => array ());
95+ foreach ($ commentIds as $ commentId ) {
9696 $ comment = $ table ->find ($ commentId );
9797 $ data = $ comment ->getAkismetData ();
98- if ($ spam ) {
98+ if ($ spam ) {
9999 $ submitMethod = 'submitSpam ' ;
100100 } else {
101101 $ submitMethod = 'submitHam ' ;
@@ -108,7 +108,7 @@ public function updateSpamAction()
108108 $ response ['status ' ] = 'ok ' ;
109109 } catch (Exception $ e ){
110110 $ response ['status ' ] = 'fail ' ;
111- $ response ['errors ' ][] = array ('id ' => $ comment ->id );
111+ $ response ['errors ' ][] = array ('id ' => $ comment ->id );
112112 $ response ['message ' ] = $ e ->getMessage ();
113113 _log ($ e );
114114 }
@@ -122,32 +122,32 @@ public function updateApprovedAction()
122122 $ commentIds = $ _POST ['ids ' ];
123123 $ status = $ _POST ['approved ' ];
124124 $ table = $ this ->_helper ->db ->getTable ();
125- if (! $ commentIds ) {
125+ if (! $ commentIds ) {
126126 return ;
127127 }
128- foreach ($ commentIds as $ commentId ) {
128+ foreach ($ commentIds as $ commentId ) {
129129 $ comment = $ table ->find ($ commentId );
130130 $ comment ->approved = $ status ;
131131 //if approved, it isn't spam
132- if ( ( $ status == 1 ) && ($ comment ->is_spam == 1 ) ) {
132+ if (( $ status == 1 ) && ($ comment ->is_spam == 1 )) {
133133 $ comment ->is_spam = 0 ;
134134 $ ak = new Zend_Service_Akismet ($ wordPressAPIKey , WEB_ROOT );
135135 $ data = $ comment ->getAkismetData ();
136136 try {
137137 $ ak ->submitHam ($ data );
138- $ response = array ('status ' => 'ok ' );
138+ $ response = array ('status ' => 'ok ' );
139139 $ comment ->save ();
140140 } catch (Exception $ e ) {
141141 _log ($ e ->getMessage ());
142- $ response = array ('status ' => 'fail ' , 'message ' => $ e ->getMessage ());
142+ $ response = array ('status ' => 'fail ' , 'message ' => $ e ->getMessage ());
143143 }
144144
145145 } else {
146146 try {
147147 $ comment ->save ();
148- $ response = array ('status ' => 'ok ' );
148+ $ response = array ('status ' => 'ok ' );
149149 } catch (Exception $ e ) {
150- $ response = array ('status ' => 'fail ' , 'message ' => $ e ->getMessage ());
150+ $ response = array ('status ' => 'fail ' , 'message ' => $ e ->getMessage ());
151151 _log ($ e ->getMessage ());
152152 }
153153 }
@@ -162,21 +162,21 @@ public function updateFlaggedAction()
162162 $ commentIds = $ _POST ['ids ' ];
163163 $ flagged = $ _POST ['flagged ' ];
164164
165- if ($ commentIds ) {
166- foreach ($ commentIds as $ id ) {
165+ if ($ commentIds ) {
166+ foreach ($ commentIds as $ id ) {
167167 $ comment = $ this ->_helper ->db ->getTable ('Comment ' )->find ($ id );
168168 $ comment ->flagged = $ flagged ;
169169 $ comment ->save ();
170170 }
171171 } else {
172- $ response = array ('status ' => 'empty ' , 'message ' => 'No Comments Found ' );
172+ $ response = array ('status ' => 'empty ' , 'message ' => 'No Comments Found ' );
173173 }
174- if ($ flagged ) {
174+ if ($ flagged ) {
175175 $ action = 'flagged ' ;
176176 } else {
177177 $ action = 'unflagged ' ;
178178 }
179- $ response = array ('status ' => 'ok ' , 'action ' => $ action , 'ids ' => $ commentIds );
179+ $ response = array ('status ' => 'ok ' , 'action ' => $ action , 'ids ' => $ commentIds );
180180 $ this ->_helper ->json ($ response );
181181 }
182182
@@ -187,7 +187,7 @@ public function flagAction()
187187 $ comment ->flagged = true ;
188188 $ comment ->save ();
189189 $ this ->emailFlagged ($ comment );
190- $ response = array ('status ' => 'ok ' , 'id ' => $ commentId , 'action ' => 'flagged ' );
190+ $ response = array ('status ' => 'ok ' , 'id ' => $ commentId , 'action ' => 'flagged ' );
191191 $ this ->_helper ->json ($ response );
192192 }
193193
@@ -197,7 +197,7 @@ public function unflagAction()
197197 $ comment = $ this ->_helper ->db ->getTable ('Comment ' )->find ($ commentId );
198198 $ comment ->flagged = 0 ;
199199 $ comment ->save ();
200- $ response = array ('status ' => 'ok ' , 'id ' => $ commentId , 'action ' => 'unflagged ' );
200+ $ response = array ('status ' => 'ok ' , 'id ' => $ commentId , 'action ' => 'unflagged ' );
201201 $ this ->_helper ->json ($ response );
202202 }
203203
0 commit comments