|
From: <ix...@us...> - 2001-12-19 05:26:52
|
ixjonez 01/12/18 21:26:51
Modified: lib/LiveFrame Tag: 8Ì `¶@h¶@h¶@øª à x¶@x¶@È´ È´
@° @°
¶@¶@¶@¶@ ¶@ ¶@¨¶@¨¶@°¶@°¶@¸¶@¸¶@@x
@x
ȶ@ȶ@ж@ж@ض@ض@à¶@à¶@è¶@è¶@ð¶@ð¶@ø¶@ø¶@
/tmp/cvs-serv7384/commons/lib/LiveFrame/Gallery.pm
No tag Gallery.pm
Log:
work in process: add the ability to create a gallery on disk
Revision Changes Path
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
No revision
1.2 +20 -9 commons/lib/LiveFrame/Gallery.pm
Index: /tmp/cvs-serv7384/commons/lib/LiveFrame/Gallery.pm
===================================================================
RCS file: /cvsroot/liveframe/commons/lib/LiveFrame/Gallery.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /tmp/cvs-serv7384/commons/lib/LiveFrame/Gallery.pm 2001/12/02 09:47:03 1.1
+++ /tmp/cvs-serv7384/commons/lib/LiveFrame/Gallery.pm 2001/12/19 05:26:51 1.2
@@ -3,17 +3,19 @@
package LiveFrame::Gallery;
use strict;
+use File::Spec ();
use LiveFrame::PhotoDir ();
@LiveFrame::Gallery::ISA = 'LiveFrame::PhotoDir';
sub new {
- my $type = shift;
+ my ($type, $site, $dir) = @_;
my $class = ref($type) || $type;
- my $self = $class->SUPER::new(@_);
+ my $self = $class->SUPER::new(File::Spec->catdir($site->path(), $dir));
$self->{description} = undef;
+ $self->{site} = $site;
$self->{title} = undef;
$self->{url} = undef;
$self->{visibility} = undef;
@@ -43,26 +45,35 @@
## public methods
+sub create {
+ my ($self, $pos, $perms) = @_;
+
+ $self->SUPER::create($perms);
+ $self->{site}->add_gallery($pos);
+
+ return 1;
+}
+
sub hidden {
- my $self = shift;
- return ! defined $self->{visibility};
+ my ($self) = @_;
+ return ! $self->{visibility};
}
sub hide {
- my $self = shift;
- $self->{visibility} = undef;
+ my ($self) = @_;
+ $self->{visibility} = 0;
return 1;
}
sub show {
- my $self = shift;
+ my ($self) = @_;
$self->{visibility} = 1;
return 1;
}
sub shown {
- my $self = shift;
- return defined $self->{visibility};
+ my ($self) = @_;
+ return $self->{visibility} || undef;
}
1;
No revision
No revision
1.2 +20 -9 commons/lib/LiveFrame/Gallery.pm
Index: Gallery.pm
===================================================================
RCS file: /cvsroot/liveframe/commons/lib/LiveFrame/Gallery.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Gallery.pm 2001/12/02 09:47:03 1.1
+++ Gallery.pm 2001/12/19 05:26:51 1.2
@@ -3,17 +3,19 @@
package LiveFrame::Gallery;
use strict;
+use File::Spec ();
use LiveFrame::PhotoDir ();
@LiveFrame::Gallery::ISA = 'LiveFrame::PhotoDir';
sub new {
- my $type = shift;
+ my ($type, $site, $dir) = @_;
my $class = ref($type) || $type;
- my $self = $class->SUPER::new(@_);
+ my $self = $class->SUPER::new(File::Spec->catdir($site->path(), $dir));
$self->{description} = undef;
+ $self->{site} = $site;
$self->{title} = undef;
$self->{url} = undef;
$self->{visibility} = undef;
@@ -43,26 +45,35 @@
## public methods
+sub create {
+ my ($self, $pos, $perms) = @_;
+
+ $self->SUPER::create($perms);
+ $self->{site}->add_gallery($pos);
+
+ return 1;
+}
+
sub hidden {
- my $self = shift;
- return ! defined $self->{visibility};
+ my ($self) = @_;
+ return ! $self->{visibility};
}
sub hide {
- my $self = shift;
- $self->{visibility} = undef;
+ my ($self) = @_;
+ $self->{visibility} = 0;
return 1;
}
sub show {
- my $self = shift;
+ my ($self) = @_;
$self->{visibility} = 1;
return 1;
}
sub shown {
- my $self = shift;
- return defined $self->{visibility};
+ my ($self) = @_;
+ return $self->{visibility} || undef;
}
1;
|