[Slashdotjp-dev 1156] [683] * Add vars "modreasons_disabled" to insert "disabled => 1" for getReasons()

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 7月 5日 (土) 13:13:03 JST


Revision: 683
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=683
Author:   tach
Date:     2008-07-05 13:13:03 +0900 (Sat, 05 Jul 2008)

Log Message:
-----------
* Add vars "modreasons_disabled" to insert "disabled => 1" for getReasons()

Modified Paths:
--------------
    slashjp/branches/2.5.0.192/debian/changelog
    slashjp/branches/2.5.0.192/plugins/Moderation/Moderation.pm
    slashjp/branches/2.5.0.192/sql/mysql/defaults.sql


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/debian/changelog
===================================================================
--- slashjp/branches/2.5.0.192/debian/changelog	2008-07-01 06:36:20 UTC (rev 682)
+++ slashjp/branches/2.5.0.192/debian/changelog	2008-07-05 04:13:03 UTC (rev 683)
@@ -1,3 +1,9 @@
+slash (2.5.0.192-15) unstable; urgency=low
+
+  * Add vars "modreasons_disabled" to insert "disabled => 1" for getReasons()
+
+ -- Taku YASUI <tach****@osdn*****>  Sat,  5 Jul 2008 04:11:24 +0000
+
 slash (2.5.0.192-14) unstable; urgency=low
 
   * Fix to change commentsort for mobile mode from 5 to 4

Modified: slashjp/branches/2.5.0.192/plugins/Moderation/Moderation.pm
===================================================================
--- slashjp/branches/2.5.0.192/plugins/Moderation/Moderation.pm	2008-07-01 06:36:20 UTC (rev 682)
+++ slashjp/branches/2.5.0.192/plugins/Moderation/Moderation.pm	2008-07-05 04:13:03 UTC (rev 683)
@@ -41,9 +41,16 @@
 sub getReasons {
 	my($self) = @_;
 	my $table_cache = "_reasons_cache";
-	$self->{$table_cache} ||= $self->sqlSelectAllHashref(
+	return {( %{$self->{$table_cache}} )} if ($self->{$table_cache});
+
+	$self->{$table_cache} = $self->sqlSelectAllHashref(
 		"id", "*", "modreasons"
 	);
+	my $mrd = getCurrentStatic('modreasons_disabled') || '';
+	foreach my $d (split(/,/, $mrd)) {
+		$d = int($d);
+		$self->{$table_cache}{$d}{disabled} = 1;
+	}
 	return {( %{$self->{$table_cache}} )};
 }
 

Modified: slashjp/branches/2.5.0.192/sql/mysql/defaults.sql
===================================================================
--- slashjp/branches/2.5.0.192/sql/mysql/defaults.sql	2008-07-01 06:36:20 UTC (rev 682)
+++ slashjp/branches/2.5.0.192/sql/mysql/defaults.sql	2008-07-05 04:13:03 UTC (rev 683)
@@ -1153,6 +1153,7 @@
 INSERT IGNORE INTO vars (name, value, description) VALUES ('mobile_commentmode','flat','comment mode for mobile mode');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('enable_template_evalperl','0','Add "EVAL_PERL" to Template option to be able to use "PERL" and "RAWPERL" directives');
 INSERT IGNORE INTO vars (name, value, description) VALUES ('related_cid_disabled','0','If set, then disable inserting cid to related story list');
+INSERT IGNORE INTO vars (name, value, description) VALUES ('modreasons_disabled','','Comma separated "modreasons.id"s disable to select when moderation');
 UPDATE vars SET value='text/html; charset=UTF-8' WHERE name='content_type_webpage';
 UPDATE vars SET value='0' WHERE name='draconian_charset';
 UPDATE vars SET value='UTF-8' WHERE name='rdfencoding';


Slashdotjp-dev メーリングリストの案内
Back to archive index