[xoops-cvslog 2749] CVS update: xoops2jp/html/modules/base/kernel

Back to archive index

Minahito minah****@users*****
2006年 4月 11日 (火) 18:14:59 JST


Index: xoops2jp/html/modules/base/kernel/handler.php
diff -u xoops2jp/html/modules/base/kernel/handler.php:1.1.2.12 xoops2jp/html/modules/base/kernel/handler.php:1.1.2.13
--- xoops2jp/html/modules/base/kernel/handler.php:1.1.2.12	Tue Apr 11 14:29:23 2006
+++ xoops2jp/html/modules/base/kernel/handler.php	Tue Apr 11 18:14:58 2006
@@ -63,8 +63,12 @@
 				$sql .= " WHERE ".$where;
 			}
 			
+			$sorts = array();
+			foreach ($criteria->getSorts() as $sort) {
+				$sorts[] = $sort['sort'] . ' ' . $sort['order'];
+			}
 			if ($criteria->getSort() != '') {
-				$sql .= " ORDER BY " . $criteria->getSort() . ' ' . $criteria->getOrder();
+				$sql .= " ORDER BY " . implode(',', $sorts);
 			}
 			
 			$limit=$criteria->getLimit();
@@ -270,11 +274,23 @@
 				// Render
 				//
 				$name = $criteria->getName();
-				$value = null;
+				$value = $criteria->getValue();
 				switch ($obj->mVars[$name]['data_type']) {
+					case XOBJ_DTYPE_BOOL:
+						$value = $value ? "1" : "0";
+						break;
+					
+					case XOBJ_DTYPE_INT:
+						$value = intval($value);
+						break;
+					
+					case XOBJ_DTYPE_FLOAT:
+						$value = floatval($value);
+						break;
+					
 					case XOBJ_DTYPE_STRING:
 					case XOBJ_DTYPE_TEXT:
-						$value = $this->db->quoteString($criteria->getValue());
+						$value = $this->db->quoteString($value);
 						break;
 						
 					default:


xoops-cvslog メーリングリストの案内
Back to archive index