mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Images Administration - work in progress
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/image.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/image.php,v $
|
||||||
| $Revision: 1.8 $
|
| $Revision: 1.9 $
|
||||||
| $Date: 2008-12-09 15:19:02 $
|
| $Date: 2008-12-09 17:49:59 $
|
||||||
| $Author: secretr $
|
| $Author: secretr $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -136,6 +136,10 @@ if (isset($_POST['show_avatars']))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$text = "
|
||||||
|
<form method='post' action='".e_SELF."' id='form-show-avatars'>
|
||||||
|
";
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
while (list($key, $image_name) = each($dirlist))
|
while (list($key, $image_name) = each($dirlist))
|
||||||
{
|
{
|
||||||
@@ -156,7 +160,7 @@ if (isset($_POST['show_avatars']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
//File info
|
//File info
|
||||||
$users = "<a class='e-tooltip' href='#' alt='".IMALAN_66.": {$image_name}' title='".IMALAN_66.": {$image_name}'><img src='".e_IMAGE_ABS."admin_images/docs_16.png' /></a> ".$users;
|
$users = "<a class='e-tooltip' href='#' title='".IMALAN_66.": {$image_name}'><img src='".e_IMAGE_ABS."admin_images/docs_16.png' alt='".IMALAN_66.": {$image_name}' /></a> ".$users;
|
||||||
|
|
||||||
// Control over the image size (design)
|
// Control over the image size (design)
|
||||||
$image_size = getimagesize(e_FILE."public/avatars/".$image_name);
|
$image_size = getimagesize(e_FILE."public/avatars/".$image_name);
|
||||||
@@ -165,21 +169,21 @@ if (isset($_POST['show_avatars']))
|
|||||||
$img_src = "<label for='image-action-{$count}' title='".IMALAN_56."'><img src='".e_FILE_ABS."public/avatars/{$image_name}' alt='{$image_name}' /></label>";
|
$img_src = "<label for='image-action-{$count}' title='".IMALAN_56."'><img src='".e_FILE_ABS."public/avatars/{$image_name}' alt='{$image_name}' /></label>";
|
||||||
if ($image_size[0] > $pref['im_width'] || $image_size[1] > $pref['im_height'])
|
if ($image_size[0] > $pref['im_width'] || $image_size[1] > $pref['im_height'])
|
||||||
{
|
{
|
||||||
$img_src = "<a class='image-preview' href='".e_FILE_ABS."public/avatars/{$image_name}'>".IMALAN_57."</a>";
|
$img_src = "<a class='image-preview' href='".e_FILE_ABS."public/avatars/".rawurlencode($image_name)."'>".IMALAN_57."</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
<div class='image-box f-left center' style='width: ".(intval($pref['im_width'])+40)."px; height: ".(intval($pref['im_height'])+100)."px;'>
|
<div class='image-box f-left center' style='width: ".(intval($pref['im_width'])+40)."px; height: ".(intval($pref['im_height'])+100)."px;'>
|
||||||
<div class='spacer'>
|
<div class='spacer'>
|
||||||
<form method='post' action='".e_SELF."'>
|
|
||||||
<div class='image-users'>{$users}</div>
|
<div class='image-users'>{$users}</div>
|
||||||
<div class='image-preview'>{$img_src}</div>
|
<div class='image-preview'>{$img_src}</div>
|
||||||
<div class='image-delete'>
|
<div class='image-delete options'>
|
||||||
<input type='checkbox' class='checkbox' id='image-action-{$count}' name='filename[]' value='{$image_name}' />
|
<input type='checkbox' class='checkbox' id='image-action-{$count}' name='multiaction[]' value='{$image_name}' />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
";
|
";
|
||||||
|
|
||||||
$count++;
|
$count++;
|
||||||
@@ -188,15 +192,15 @@ if (isset($_POST['show_avatars']))
|
|||||||
//FIXME add multi delete for better user experience (not working yet), make check/uncheck-all work
|
//FIXME add multi delete for better user experience (not working yet), make check/uncheck-all work
|
||||||
$text .= "
|
$text .= "
|
||||||
<div class='spacer clear'>
|
<div class='spacer clear'>
|
||||||
<form method='post' action='".e_SELF."'>
|
|
||||||
<div class='buttons-bar'>
|
<div class='buttons-bar'>
|
||||||
<button class='delete' type='submit' name='deleteall'><span>".IMALAN_25."</span></button>
|
<button class='delete' type='submit' name='deleteall'><span>".IMALAN_25."</span></button>
|
||||||
<button class='delete' type='submit' name='delete_multi'><span>".IMALAN_58."</span></button>
|
<button class='delete' type='submit' name='delete_multi'><span>".IMALAN_58."</span></button>
|
||||||
<button class='action' type='button' name='check_all'><span>".IMALAN_59."</span></button>
|
<button class='action' type='button' name='check_all'><span>".IMALAN_59."</span></button>
|
||||||
<button class='action' type='button' name='uncheck_all'><span>".IMALAN_60."</span></button>
|
<button class='action' type='button' name='uncheck_all'><span>".IMALAN_60."</span></button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>";
|
";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,7 +299,7 @@ if (isset($_POST['check_avatar_sizes']))
|
|||||||
$text .= "
|
$text .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td class='options center'>
|
<td class='options center'>
|
||||||
<input class='checkbox' type='checkbox' name='avdelete[]' id='avdelete-{$user_id}' value='{$user_id}' />
|
<input class='checkbox' type='checkbox' name='multiaction[]' id='avdelete-{$user_id}' value='{$user_id}' />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label for='avdelete-{$user_id}' title='".IMALAN_56."'>".IMALAN_51."</label><a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>
|
<label for='avdelete-{$user_id}' title='".IMALAN_56."'>".IMALAN_51."</label><a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>
|
||||||
@@ -324,7 +328,7 @@ if (isset($_POST['check_avatar_sizes']))
|
|||||||
<div class='buttons-bar'>
|
<div class='buttons-bar'>
|
||||||
<button class='action' type='button' name='check_all'><span>".IMALAN_59."</span></button>
|
<button class='action' type='button' name='check_all'><span>".IMALAN_59."</span></button>
|
||||||
<button class='action' type='button' name='uncheck_all'><span>".IMALAN_60."</span></button>
|
<button class='action' type='button' name='uncheck_all'><span>".IMALAN_60."</span></button>
|
||||||
<button class='delete' type='submit' name='delete'><span>".IMALAN_58."</span></button>
|
<button class='delete' type='submit' name='avdelete_multi'><span>".IMALAN_58."</span></button>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
@@ -439,7 +443,7 @@ $text = "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class='label'>".IMALAN_3."<br/><em>".IMALAN_54." {$gd_version}</em></td>
|
<td class='label'>".IMALAN_3."<div class='label-note'>".IMALAN_54." {$gd_version}</div></td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<select name='resize_method' class='tbox'>". ($pref['resize_method'] == "gd1" ? "<option selected='selected'>gd1</option>" : "<option>gd1</option>"). ($pref['resize_method'] == "gd2" ? "<option selected='selected'>gd2</option>" : "<option>gd2</option>"). ($pref['resize_method'] == "ImageMagick" ? "<option selected='selected'>ImageMagick</option>" : "<option>ImageMagick</option>")."
|
<select name='resize_method' class='tbox'>". ($pref['resize_method'] == "gd1" ? "<option selected='selected'>gd1</option>" : "<option>gd1</option>"). ($pref['resize_method'] == "gd2" ? "<option selected='selected'>gd2</option>" : "<option>gd2</option>"). ($pref['resize_method'] == "ImageMagick" ? "<option selected='selected'>ImageMagick</option>" : "<option>ImageMagick</option>")."
|
||||||
</select>
|
</select>
|
||||||
@@ -448,7 +452,7 @@ $text = "
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class='label'>".IMALAN_5."<div class='label-note'>{$IM_NOTE}</em></td>
|
<td class='label'>".IMALAN_5."<div class='label-note'>{$IM_NOTE}</div></td>
|
||||||
<td class='control'>
|
<td class='control'>
|
||||||
<input class='tbox input-text' type='text' name='im_path' size='40' value=\"".$pref['im_path']."\" maxlength='200' />
|
<input class='tbox input-text' type='text' name='im_path' size='40' value=\"".$pref['im_path']."\" maxlength='200' />
|
||||||
<div class='smalltext field-help'>".IMALAN_6."</div>
|
<div class='smalltext field-help'>".IMALAN_6."</div>
|
||||||
@@ -487,6 +491,74 @@ $ns->tablerender(IMALAN_7, $text);
|
|||||||
|
|
||||||
|
|
||||||
require_once("footer.php");
|
require_once("footer.php");
|
||||||
|
|
||||||
|
function headerjs()
|
||||||
|
{
|
||||||
|
require_once(e_HANDLER.'js_helper.php');
|
||||||
|
$ret = "
|
||||||
|
<script type='text/javascript'>
|
||||||
|
//add required core lan
|
||||||
|
(".e_jshelper::toString(IMALAN_67).").addModLan('core', 'delete_confirm');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin Image JS Handler
|
||||||
|
*/
|
||||||
|
var eCoreImage = {
|
||||||
|
|
||||||
|
init: function() {
|
||||||
|
this.tCheckEventHandler = this.tCheckHandler.bindAsEventListener(this);
|
||||||
|
this.allCheckEventHandler = this.allCheckHandler.bindAsEventListener(this);
|
||||||
|
this.allUnCheckEventHandler = this.allUnCheckHandler.bindAsEventListener(this);
|
||||||
|
|
||||||
|
\$\$('.options').invoke('observe', 'click', this.tCheckEventHandler);
|
||||||
|
\$\$('button.action[name=check_all]').invoke('observe', 'click', this.allCheckEventHandler);
|
||||||
|
\$\$('button.action[name=uncheck_all]').invoke('observe', 'click', this.allUnCheckHandler);
|
||||||
|
\$\$('button.delete').invoke('observe', 'click', function(e){ if( !e107Helper.confirm(e107.getModLan('delete_confirm')) ) e.stop(); });
|
||||||
|
},
|
||||||
|
|
||||||
|
tCheckHandler: function(event) {
|
||||||
|
//do nothing if checkbox or its label is clicked
|
||||||
|
if(event.element().nodeName.toLowerCase() == 'input') return;
|
||||||
|
//stop event
|
||||||
|
event.stop();
|
||||||
|
//td element
|
||||||
|
var element = event.findElement('td'), check = null;
|
||||||
|
if(element) {
|
||||||
|
check = element.select('input.checkbox'); //search for checkbox
|
||||||
|
}
|
||||||
|
//toggle checked property
|
||||||
|
if(check && check[0]) {
|
||||||
|
\$(check[0]).checked = !(\$(check[0]).checked);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
allCheckHandler: function(event) {
|
||||||
|
event.stop();
|
||||||
|
var form = event.element().up('form');
|
||||||
|
if(form) {
|
||||||
|
form.toggleChecked(true, 'name^=multiaction');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
allUnCheckHandler: function(event) {
|
||||||
|
event.stop();
|
||||||
|
var form = event.element().up('form');
|
||||||
|
if(form) {
|
||||||
|
form.toggleChecked(false, 'name^=multiaction');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Observe e107:loaded
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
e107.runOnLoad(eCoreImage.init.bind(eCoreImage), document, true);
|
||||||
|
</script>
|
||||||
|
";
|
||||||
|
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
XXX - remove this odd thing?!
|
XXX - remove this odd thing?!
|
||||||
|
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
| e107 website system - Language File.
|
| e107 website system - Language File.
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_image.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_image.php,v $
|
||||||
| $Revision: 1.5 $
|
| $Revision: 1.6 $
|
||||||
| $Date: 2008-12-09 15:19:03 $
|
| $Date: 2008-12-09 17:49:59 $
|
||||||
| $Author: secretr $
|
| $Author: secretr $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -42,7 +42,7 @@ define("IMALAN_30", "Everyone (public)");
|
|||||||
define("IMALAN_31", "Guests only");
|
define("IMALAN_31", "Guests only");
|
||||||
define("IMALAN_32", "Members only");
|
define("IMALAN_32", "Members only");
|
||||||
define("IMALAN_33", "Admin only");
|
define("IMALAN_33", "Admin only");
|
||||||
define("IMALAN_34", "Enable Sleight");
|
define("IMALAN_34", "Enable PNG Fix");
|
||||||
define("IMALAN_35", "Fixes transparent PNG-24's with alpha transparency in IE 5 / 6 (Applies Sitewide)");
|
define("IMALAN_35", "Fixes transparent PNG-24's with alpha transparency in IE 5 / 6 (Applies Sitewide)");
|
||||||
|
|
||||||
define("IMALAN_36", "Validate avatar size and access");
|
define("IMALAN_36", "Validate avatar size and access");
|
||||||
@@ -75,7 +75,7 @@ define('IMALAN_57', 'Image too big - click to enlarge');
|
|||||||
define('IMALAN_58', 'Delete checked');
|
define('IMALAN_58', 'Delete checked');
|
||||||
define('IMALAN_59', 'Check All');
|
define('IMALAN_59', 'Check All');
|
||||||
define('IMALAN_60', 'Uncheck All');
|
define('IMALAN_60', 'Uncheck All');
|
||||||
define('IMALAN_66', 'Filename');
|
|
||||||
|
|
||||||
//avatar check
|
//avatar check
|
||||||
define('IMALAN_61', 'Options');
|
define('IMALAN_61', 'Options');
|
||||||
@@ -84,10 +84,7 @@ define('IMALAN_63', 'URL');
|
|||||||
define('IMALAN_64', 'User');
|
define('IMALAN_64', 'User');
|
||||||
define('IMALAN_65', 'Nothing found');
|
define('IMALAN_65', 'Nothing found');
|
||||||
|
|
||||||
/*
|
define('IMALAN_66', 'Filename');
|
||||||
define('IMALAN_60', '');
|
define('IMALAN_67', 'Are you\' sure?');
|
||||||
define('IMALAN_60', '');
|
|
||||||
define('IMALAN_60', '');
|
|
||||||
define('IMALAN_60', '');
|
|
||||||
*/
|
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user