- def supply_default
- self.repeat = 0
- self.x = 0
- self.y = 0
- end
-
- def overwrite
- end
-
- def visible? roles
- if MagicNumber['run_mode'] == 0
- return false unless guest_role_check(roles)
- else
- return false unless reader_role_check(roles)
- end
- return true if self.panel.own?(roles)
- self.panel.visible? roles
- end
-
- def opt_div_style full_url, spot = nil, opacity = 20
- o = (spot and spot != self) ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
- "position: absolute; width:#{self.panel.width}px; height:#{self.panel.height}px; top: 0px; left: 0px; z-index:#{self.z}; background-image: url(#{full_url}); background-repeat: #{self.repeat_text}; background-position: #{self.x}px, #{self.y}px; #{o}"
- end
-
- def tmb_opt_img_tag
- tw, th = PettanImager.thumbnail_size(self.picture.width, self.picture.height)
- {:src => self.picture.url, :width => tw, :height => th, :alt => self.caption}
- end
-
- def repeat_text
- @@repeat_texts[self.repeat]
- end
-
- def self.default_page_size
- 25
- end
-
- def self.max_page_size
- 100
- end
-
- def self.page prm = nil
- page = prm.to_i
- page = 1 if page < 1
- page