------------------------------------------------------------
revno: 956
committer: Jakub Jankiewicz <[email protected]>
branch nick: aikiframework
timestamp: Sun 2011-12-11 21:53:28 +0100
message:
  Fix autofiled->autofield typo
modified:
  src/libs/Forms.php
  src/libs/membership.php
  src/libs/message.php
  src/libs/widgets.php


--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk

Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to 
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'src/libs/Forms.php'
--- src/libs/Forms.php	2011-11-08 13:42:45 +0000
+++ src/libs/Forms.php	2011-12-11 20:53:28 +0000
@@ -495,7 +495,7 @@
 
 
 
-					case "autofiled":
+					case "autofield":
 						switch ($intwalker[2]){
 							case "publishdate":
 								$form .= ("<label for=\"$intwalker[0]\">$intwalker[1]</label><input type=\"text\"" .

=== modified file 'src/libs/membership.php'
--- src/libs/membership.php	2011-12-09 22:53:49 +0000
+++ src/libs/membership.php	2011-12-11 20:53:28 +0000
@@ -346,14 +346,14 @@
 	 * @return	string
 	 *
 	 * @todo	good to remove the html if possible.
-	 * @todo	rename this function to newPassword
 	 * @todo	check to make sure that the returned string is being output
-	 *		with a message class.
+	 *		    with a message class.
 	 */
-	public function NewPassword($key) {
+	public function newPassword($key) {
 		global $db, $aiki, $config;
 
 		$is_user = $db->get_var("SELECT userid, username FROM aiki_users WHERE randkey = '$key'");
+		
 		if ($is_user) {
 			$form = '
 <div id="form_container">
@@ -417,9 +417,8 @@
 	 * @return	string
 	 *
 	 * @todo	really the view should be separated out from this function
-	 * @todo	Change this to resetPassword
 	 */
-	public function ResetPassword($username, $email, $emailfrom, $subject, $message) {
+	public function resetPassword($username, $email, $emailfrom, $subject, $message) {
 		global $db, $aiki, $config;
 
 		if ( !$username and !$email ) {
@@ -461,8 +460,11 @@
 			"<a href='".$config['url']."secure?key=".$randkey."'>".
 			$config['url']."secure?key=".$randkey."</a>";
 
-			mail($email,$subject,$message,$headers);
-			return $aiki->message->ok( __("An email has been sent to your address. Please follow the link to reset your password."), NULL, false);
+			if (mail($email, $subject, $message, $headers)) {
+				return $aiki->message->ok( __("An email has been sent to your address. Please follow the link to reset your password."), NULL, false);
+			} else {
+				return $aiki->message->error( __("Sorry, but we have some problem with sending an email."), NULL, false);
+			}
 
 		}
 

=== modified file 'src/libs/message.php'
--- src/libs/message.php	2011-11-08 13:42:45 +0000
+++ src/libs/message.php	2011-12-11 20:53:28 +0000
@@ -323,6 +323,7 @@
 	 * @param	string	$default	default class name
 	 * @param	array	$attribs	the attributes array
 	 * @return	string
+	 * @TODO change name to addClass
 	 */
 	private function Addclass($default, &$attribs) {
 		return $default . 

=== modified file 'src/libs/widgets.php'
--- src/libs/widgets.php	2011-12-08 08:52:20 +0000
+++ src/libs/widgets.php	2011-12-11 20:53:28 +0000
@@ -425,11 +425,12 @@
 		} else {				
 			$selects = explode("|OR|", $widget->normal_select);
 			foreach ($selects as $select) {								
-				$widget->normal_select= $select;
+				$widget->normal_select = $select;
+				$records_num = $this->records_num($widget->normal_select);
 				
-				$records_num = $this->records_num($widget->normal_select);  				
 				// pagination change normal_select adding limit.
 				$pagination = $this->pagination($widget, $records_num);
+				
 				$widget_select = $db->get_results($widget->normal_select);
 				if ($widget_select) {
 					break;
@@ -627,9 +628,11 @@
 
 	private function pagination($widget, $records_num) {
 		global $db, $aiki;
+		
 		if (!$widget->records_in_page) {
 			return false;
 		}
+		
 		$pagesgroup = 10;
 		$group_pages = false;
 
@@ -1251,11 +1254,11 @@
 		if (!preg_match('/^select(.*) from /Usi', $sql, $select)){
 			return false;
 		}
-						   
+		
 		if (stripos($sql, " GROUP BY ") || stripos($sql, " LIMIT")) {
 			// with GROUP or LIMIT clausule must do a query 
 			$db->get_results($sql);
-			$records_num= $db->num_rows;			
+			$records_num = $db->num_rows;			
 		} else {
 			// try made a substituion of all select field with count(*)
 			
@@ -1266,10 +1269,9 @@
 				$mysql_count = ' count(*) ';
 			}
 			$new_sql = preg_replace(
-				"/^select.* from /Usi",
+				"/^select.*? from /Usi",
 				"SELECT $mysql_count FROM ",
 				$sql);
-			
 			// if there is a unique 'ORDER BY', try remove it.	
 			if ( substr_count($new_sql, "ORDER BY") == 1 ){	
 				$new_sql = preg_replace(

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to