default links moved to initextevent

git-svn-id: file:///home/shish/svn/shimmie2/trunk@408 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-08-01 16:19:25 +00:00
parent 3641010de1
commit 0c1ccb73ca
2 changed files with 11 additions and 7 deletions

View file

@ -94,22 +94,22 @@ class Image {
public function get_image_link() {
global $config;
return $this->parse_link_template($config->get_string('image_ilink', '$base/image/$id.$ext'));
return $this->parse_link_template($config->get_string('image_ilink'));
}
public function get_short_link() {
global $config;
return $this->parse_link_template($config->get_string('image_slink', ''));
return $this->parse_link_template($config->get_string('image_slink'));
}
public function get_thumb_link() {
global $config;
return $this->parse_link_template($config->get_string('image_tlink', '$base/thumb/$id.jpg'));
return $this->parse_link_template($config->get_string('image_tlink'));
}
public function get_tooltip() {
global $config;
return $this->parse_link_template($config->get_string('image_tip', '$tags // $size // $filesize'), "html_escape");
return $this->parse_link_template($config->get_string('image_tip'), "html_escape");
}
public function get_image_filename() {

View file

@ -12,6 +12,10 @@ class ImageIO extends Extension {
$config->set_default_int('thumb_height', 192);
$config->set_default_int('thumb_quality', 75);
$config->set_default_int('thumb_mem_limit', '8MB');
$config->set_default_string('image_ilink', '$base/image/$id.$ext');
$config->set_default_string('image_tlink', '$base/thumb/$id.jpg');
$config->set_default_string('image_tip', '$tags // $size // $filesize');
}
if(is_a($event, 'PageRequestEvent')) {
@ -41,9 +45,9 @@ class ImageIO extends Extension {
if(is_a($event, 'SetupBuildingEvent')) {
$sb = new SetupBlock("Image Options");
$sb->position = 30;
$sb->add_text_option("image_ilink", "Image link ");
$sb->add_text_option("image_tlink", "<br>Thumbnail link ");
$sb->add_text_option("image_tip", "<br>Image tooltip ");
$sb->add_text_option("image_ilink", "Image link: ");
$sb->add_text_option("image_tlink", "<br>Thumbnail link: ");
$sb->add_text_option("image_tip", "<br>Image tooltip: ");
$event->panel->add_block($sb);
$thumbers = array();