diff --git a/e107_admin/image.php b/e107_admin/image.php index 279bac38d..504d94fb9 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -371,6 +371,13 @@ class media_admin_ui extends e_admin_ui 'im_width' => array('title'=> "Avatar Width", 'type'=>'text', 'data'=>'int', 'writeParms'=>'help=Avatar images will be constrained to these dimensions (in pixels)'), //TODO LAN 'im_height' => array('title'=> "Avatar Height", 'type'=>'text', 'data'=>'int', 'writeParms'=>'help=Avatar images will be constrained to these dimensions (in pixels)'), 'resize_dimensions' => array('title'=> "Resize Dimensions", 'type'=>'method', 'data'=>'str'), + + 'watermark_activate' => array('title'=> 'Watermark Activation', 'type' => 'text', 'data' => 'str', 'help'=>'All images with a width or height greater than this value will be given a watermark during resizing.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')), + 'watermark_text' => array('title'=> 'Watermark Text', 'type' => 'text', 'data' => 'str', 'help'=>'Optional Watermark Text'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')), + 'watermark_font' => array('title'=> 'Watermark Font', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Optional Watermark Font. Upload more .ttf fonts to the /fonts folder in your theme directory.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')), + 'watermark_size' => array('title'=> 'Watermark Size', 'type' => 'text', 'data' => 'int', 'help'=>'Optional Watermark Font'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')), + 'watermark_pos' => array('title'=> 'Watermark Position', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Watermark Position'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')), + 'watermark_opacity' => array('title'=> 'Watermark Opacity', 'type' => 'text', 'data' => 'int', 'help'=>'Enter a number between 1 and 100'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')), ); @@ -455,6 +462,45 @@ class media_admin_ui extends e_admin_ui $this->cats[$cat] = $row['media_cat_title']; } asort($this->cats); + + $pref = e107::getPref(); + $tp = e107::getParser(); + $fl = e107::getFile(); + $path = e_THEME.$pref['sitetheme']."/fonts/"; + + $fDir = $fl->get_files(e_THEME.$pref['sitetheme']."/fonts/",".ttf",'',2); + $fonts = array(0=>'None'); + foreach($fDir as $f) + { + $id = $tp->createConstants($f['path'].$f['fname'],'rel'); + $fonts[$id] = $f['fname']; + } + + + $this->prefs['watermark_font']['writeParms'] = $fonts; + $this->prefs['watermark_font']['readParms'] = $fonts; + + $wm_pos = array( + 'BR' => "Bottom Right", + 'BL' => "Bottom Left", + 'TR' => "Top Right", + 'TL' => "Top Left", + 'C' => "Center", + 'R' => "Right", + 'L' => "Left", + 'T' => "Top", + 'B' => "Bottom", + '*' => "Tile" + ); + + $this->prefs['watermark_pos']['writeParms'] = $wm_pos; + $this->prefs['watermark_pos']['readParms'] = $wm_pos; + + //FIXME TODO - clear thumbnail cache when prefs are saved/updated. + // e107::getCache()->clearAll('image'); + + + if(varset($_POST['batch_import_selected'])) diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 0e50ab852..9f75a56ab 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -280,6 +280,12 @@ $text .= "