[Slashdotjp-dev 432] CVS update: slashjp/plugins/Console

Back to archive index

Tatsuki SUGIURA sugi****@users*****
2006年 7月 12日 (水) 20:41:46 JST


Index: slashjp/plugins/Console/Console.pm
diff -u /dev/null slashjp/plugins/Console/Console.pm:1.1
--- /dev/null	Wed Jul 12 20:41:46 2006
+++ slashjp/plugins/Console/Console.pm	Wed Jul 12 20:41:46 2006
@@ -0,0 +1,50 @@
+# This code is a part of Slash, and is released under the GPL.
+# Copyright 1997-2005 by Open Source Technology Group. See README
+# and COPYING for more information, or see http://slashcode.com/.
+# $Id: Console.pm,v 1.1 2006/07/12 11:41:46 sugi Exp $
+
+package Slash::Console;
+
+=head1 NAME
+
+Slash::Console - Perl extension for Console
+
+
+=head1 SYNOPSIS
+
+	use Slash::Console;
+
+
+=head1 DESCRIPTION
+
+LONG DESCRIPTION.
+
+
+=head1 EXPORTED FUNCTIONS
+
+=cut
+
+use strict;
+use DBIx::Password;
+use Slash;
+use Slash::Display;
+use Slash::Utility;
+
+use base 'Slash::DB::Utility';
+use base 'Slash::DB::MySQL';
+use vars qw($VERSION);
+
+($VERSION) = ' $Revision: 1.1 $ ' =~ /\$Revision:\s+([^\s]+)/;
+
+1;
+
+__END__
+
+
+=head1 SEE ALSO
+
+Slash(3).
+
+=head1 VERSION
+
+$Id: Console.pm,v 1.1 2006/07/12 11:41:46 sugi Exp $
Index: slashjp/plugins/Console/MANIFEST
diff -u /dev/null slashjp/plugins/Console/MANIFEST:1.1
--- /dev/null	Wed Jul 12 20:41:46 2006
+++ slashjp/plugins/Console/MANIFEST	Wed Jul 12 20:41:46 2006
@@ -0,0 +1,4 @@
+Makefile.PL
+MANIFEST
+Console.pm
+console.pl
Index: slashjp/plugins/Console/Makefile.PL
diff -u /dev/null slashjp/plugins/Console/Makefile.PL:1.1
--- /dev/null	Wed Jul 12 20:41:46 2006
+++ slashjp/plugins/Console/Makefile.PL	Wed Jul 12 20:41:46 2006
@@ -0,0 +1,8 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    'NAME'	=> 'Slash::Console',
+    'VERSION_FROM' => 'Console.pm', # finds $VERSION
+    'PM'	=> { 'Console.pm' => '$(INST_LIBDIR)/Console.pm' },
+);
Index: slashjp/plugins/Console/PLUGIN
diff -u /dev/null slashjp/plugins/Console/PLUGIN:1.1
--- /dev/null	Wed Jul 12 20:41:46 2006
+++ slashjp/plugins/Console/PLUGIN	Wed Jul 12 20:41:46 2006
@@ -0,0 +1,5 @@
+# $Id: PLUGIN,v 1.1 2006/07/12 11:41:46 sugi Exp $
+name=Console
+description="Console"
+htdocs=console.pl
+template=templates/display;console;default
Index: slashjp/plugins/Console/console.pl
diff -u /dev/null slashjp/plugins/Console/console.pl:1.1
--- /dev/null	Wed Jul 12 20:41:46 2006
+++ slashjp/plugins/Console/console.pl	Wed Jul 12 20:41:46 2006
@@ -0,0 +1,76 @@
+#!/usr/bin/perl
+# This code is a part of Slash, and is released under the GPL.
+# Copyright 1997-2005 by Open Source Technology Group. See README
+# and COPYING for more information, or see http://slashcode.com/.
+# $Id: console.pl,v 1.1 2006/07/12 11:41:46 sugi Exp $
+
+use strict;
+use warnings;
+
+use Slash 2.003;	# require Slash 2.3.x
+use Slash::Constants qw(:web);
+use Slash::Display;
+use Slash::Utility;
+use Slash::XML;
+use vars qw($VERSION);
+
+($VERSION) = ' $Revision: 1.1 $ ' =~ /\$Revision:\s+([^\s]+)/;
+
+
+sub main {
+	my $slashdb   = getCurrentDB();
+	my $constants = getCurrentStatic();
+	my $user      = getCurrentUser();
+	my $form      = getCurrentForm();
+	my $gSkin     = getCurrentSkin();
+
+	if (! $user->{is_admin}) {
+		redirect("$gSkin->{rootdir}/");
+		return;
+	}
+
+	my %ops = (
+		display		=> \&display,
+		default		=> \&display
+	);
+
+	my $op = $form->{op};
+	if (!$op || !exists $ops{$op} || !$ops{$op}[ALLOWED]) {
+		$op = 'default';
+	}
+
+	header('Console', '', { admin => 1 }) or return;
+
+	$ops{$op}->($slashdb, $constants, $user, $form, $gSkin);
+
+	footer();
+}
+
+
+sub display {
+	my($slashdb, $constants, $user, $form, $gSkin) = @_;
+	my $remarks   = getObject('Slash::Remarks');
+	my $remarkstext = $remarks->displayRemarksTable({ max => 10, print_whole => 1 });
+
+	my $admindb 	= getObject('Slash::Admin');
+	my $storyadmin 	= $admindb->showStoryAdminBox("", { updater => 1 });
+	my $slashdbox 	= $admindb->showSlashdBox({ updater => 1});
+	my $perfbox	= $admindb->showPerformanceBox({ updater => 1});
+	my $authorbox	= $admindb->showAuthorActivityBox({updater => 1});
+
+
+	slashDisplay('display', {
+		remarks 	=> $remarkstext,
+		storyadmin 	=> $storyadmin,
+		slashdbox 	=> $slashdbox,
+		perfbox		=> $perfbox,
+		authorbox	=> $authorbox
+	});
+
+}
+
+
+createEnvironment();
+main();
+
+1;


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