From 8f75cc48c9eaf4314261cc7a145886a7d2ed248e Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Mon, 30 Apr 2012 05:47:21 +0000 Subject: [PATCH] * rename checkAll() instead of selectAll() and add selectReverse(). --- lib/front/front.class.php | 61 ++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/lib/front/front.class.php b/lib/front/front.class.php index 285a6d02af..de052a8f73 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -220,19 +220,19 @@ class html } /** - * Create tags like "" + * Create tags like "" * * @param string $name the name of the button tag. * @param string $value the value of the button tag. - * @param string $scope the scope of checkall. + * @param string $scope the scope of select all. * @param string $attrib other attribs. * @return string */ - static public function checkAll($name, $value, $scope = "", $attrib = "") + static public function selectAll($name, $value, $scope = "", $attrib = "") { $string = << -function checkAll(scope) +function selectAll(scope) { if(scope) { @@ -253,18 +253,65 @@ function checkAll(scope) EOT; if($scope) { - $string .= "" + * + @param string $name the name of the button tag. + * @param string $value the value of the button tag. + * @param string $scope the scope of select reverse. + * @param string $attrib other attribs. + * @return string + */ + static public function selectReverse($name, $value, $scope = "", $attrib = "") + { + $string = << +function selectReverse(scope) +{ + if(scope) + { + $('#' + scope + ' input').each(function() + { + $(this).attr("checked", false) + }); + } + else + { + $('input').each(function() + { + $(this).attr("checked", false) + }); + } +} + +EOT; + if($scope) + { + $string .= "" *