+ // TRANS: Button text for action to save a new bookmark.
+ $this->out->submit('bookmark-submit', _m('BUTTON', 'Save'), 'submit', 'submit');
+ }
+
+ function scaleImage($width, $height)
+ {
+ $maxwidth = common_config('attachments', 'thumb_width');
+ $maxheight = common_config('attachments', 'thumb_height');
+
+ if ($width > $height && $width > $maxwidth) {
+ $height = (int) ((((float)$maxwidth)/(float)($width))*(float)$height);
+ $width = $maxwidth;
+ } else if ($height > $maxheight) {
+ $width = (int) ((((float)$maxheight)/(float)($height))*(float)$width);
+ $height = $maxheight;
+ }
+
+ return array($width, $height);