<commit_before><?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

$section = 'galleries';
require_once ('tiki-setup.php');
include_once ("lib/imagegals/imagegallib.php");
include_once ('lib/stats/statslib.php');

$access->check_feature('feature_galleries');

if ($prefs['feature_categories'] == 'y') {
	global $categlib;
	if (!is_object($categlib)) {
		include_once ('lib/categories/categlib.php');
	}
}

if ($_REQUEST["galleryId"] == 0 && $tiki_p_admin_galleries != 'y') {
	$smarty->assign('errortype', 401);
	$smarty->assign('msg', tra("Permission denied you cannot access this gallery"));
	$smarty->display("error.tpl");
	die;
}
if (!isset($_REQUEST["galleryId"])) {
	$smarty->assign('msg', tra("No gallery indicated"));
	$smarty->display("error.tpl");
	die;
}
$smarty->assign('individual', 'n');

$tikilib->get_perm_object( $_REQUEST['galleryId'], 'image gallery' );

$access->check_permission('tiki_p_view_image_gallery');

$auto_query_args = array(
	'offset',
	'galleryId',
	'sort_mode',
	'find'
);
if (!isset($_REQUEST["galleryId"])) {
	$_REQUEST["galleryId"] = 0;
}
if ($_REQUEST["galleryId"] != 0) {
	// To browse the gallery the user has to be admin, the owner or the gallery has to be public
	$gal_info = $imagegallib->get_gallery($_REQUEST["galleryId"]);
} else {
	$gal_info["galleryId"] = 0;
	$gal_info["user"] = 'admin';
	$gal_info["name"] = tra('System');
	$gal_info["public"] = 'y';
	$gal_info["description"] = tra('System Gallery');
	$gal_info['showname'] = 'y';
	$gal_info['showimageid'] = 'n';
	$gal_info['showcategories'] = 'n';
	$gal_info['showdescription'] = 'n';
	$gal_info['showcreated'] = 'n';
	$gal_info['showuser'] = 'n';
	$gal_info['showhits'] = 'y';
	$gal_info['showxysize'] = 'y';
	$gal_info['showfilesize'] = 'n';
	$gal_info['showfilename'] = 'n';
	$gal_info['defaultscale'] = 'o';
}
$smarty->assign_by_ref('owner', $gal_info["user"]);
$smarty->assign_by_ref('public', $gal_info["public"]);
$smarty->assign_by_ref('galleryId', $_REQUEST["galleryId"]);
$smarty->assign_by_ref('showname', $gal_info['showname']);
$smarty->assign_by_ref('showimageid', $gal_info['showimageid']);
$smarty->assign_by_ref('showcategories', $gal_info['showcategories']);
$smarty->assign_by_ref('showdescription', $gal_info['showdescription']);
$smarty->assign_by_ref('showcreated', $gal_info['showcreated']);
$smarty->assign_by_ref('showuser', $gal_info['showuser']);
$smarty->assign_by_ref('showhits', $gal_info['showhits']);
$smarty->assign_by_ref('showxysize', $gal_info['showxysize']);
$smarty->assign_by_ref('showfilesize', $gal_info['showfilesize']);
$smarty->assign_by_ref('showfilename', $gal_info['showfilename']);
if ($prefs['preset_galleries_info'] == 'y' && $prefs['scaleSizeGalleries'] > 0) {
	$gal_info['defaultscale'] = $prefs['scaleSizeGalleries'];
}
$smarty->assign_by_ref('defaultscale', $gal_info['defaultscale']);
$imagegallib->add_gallery_hit($_REQUEST["galleryId"]);
if (isset($_REQUEST["remove"])) {
	check_ticket('browse-gallery');
	// To remove an image the user must be the owner or admin
	if (($tiki_p_admin_galleries != 'y') && (!$user || $user != $gal_info["user"])) {
		$smarty->assign('errortype', 401);
		$smarty->assign('msg', tra("Permission denied you cannot remove images from this gallery"));
		$smarty->display("error.tpl");
		die;
	}
	$access->check_authenticity();
	$imagegallib->remove_image($_REQUEST["remove"], $user);
}
if (isset($_REQUEST["rebuild"])) {
	check_ticket('browse-gallery');
	// To rebuild thumbnails the user must be the owner or admin
	if (($tiki_p_admin_galleries != 'y') && (!$user || $user != $gal_info["user"])) {
		$smarty->assign('errortype', 401);
		$smarty->assign('msg', tra("Permission denied you cannot rebuild thumbnails in this gallery"));
		$smarty->display("error.tpl");
		die;
	}
	$smarty->assign('advice', 'You must clear your browser cache.'); //get_strings tra('You must clear your browser cache.');
	$imagegallib->rebuild_thumbnails($_REQUEST["rebuild"]);
}
if (isset($_REQUEST["rotateright"])) {
	check_ticket('browse-gallery');
	// To rotate an image the user must be the owner or admin
	if (($tiki_p_admin_galleries != 'y') && (!$user || $user != $gal_info["user"])) {
		$smarty->assign('errortype', 401);
		$smarty->assign('msg', tra("Permission denied you cannot rotate images in this gallery"));
		$smarty->display("error.tpl");
		die;
	}
	$imagegallib->rotate_right_image($_REQUEST["rotateright"]);
}<commit_msg>[MOD] not translate message 'You must clear your browser cache.'<commit_after><?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

$section = 'galleries';
require_once ('tiki-setup.php');
include_once ("lib/imagegals/imagegallib.php");
include_once ('lib/stats/statslib.php');

$access->check_feature('feature_galleries');

if ($prefs['feature_categories'] == 'y') {
	global $categlib;
	if (!is_object($categlib)) {
		include_once ('lib/categories/categlib.php');
	}
}

if ($_REQUEST["galleryId"] == 0 && $tiki_p_admin_galleries != 'y') {
	$smarty->assign('errortype', 401);
	$smarty->assign('msg', tra("Permission denied you cannot access this gallery"));
	$smarty->display("error.tpl");
	die;
}
if (!isset($_REQUEST["galleryId"])) {
	$smarty->assign('msg', tra("No gallery indicated"));
	$smarty->display("error.tpl");
	die;
}
$smarty->assign('individual', 'n');

$tikilib->get_perm_object( $_REQUEST['galleryId'], 'image gallery' );

$access->check_permission('tiki_p_view_image_gallery');

$auto_query_args = array(
	'offset',
	'galleryId',
	'sort_mode',
	'find'
);
if (!isset($_REQUEST["galleryId"])) {
	$_REQUEST["galleryId"] = 0;
}
if ($_REQUEST["galleryId"] != 0) {
	// To browse the gallery the user has to be admin, the owner or the gallery has to be public
	$gal_info = $imagegallib->get_gallery($_REQUEST["galleryId"]);
} else {
	$gal_info["galleryId"] = 0;
	$gal_info["user"] = 'admin';
	$gal_info["name"] = tra('System');
	$gal_info["public"] = 'y';
	$gal_info["description"] = tra('System Gallery');
	$gal_info['showname'] = 'y';
	$gal_info['showimageid'] = 'n';
	$gal_info['showcategories'] = 'n';
	$gal_info['showdescription'] = 'n';
	$gal_info['showcreated'] = 'n';
	$gal_info['showuser'] = 'n';
	$gal_info['showhits'] = 'y';
	$gal_info['showxysize'] = 'y';
	$gal_info['showfilesize'] = 'n';
	$gal_info['showfilename'] = 'n';
	$gal_info['defaultscale'] = 'o';
}
$smarty->assign_by_ref('owner', $gal_info["user"]);
$smarty->assign_by_ref('public', $gal_info["public"]);
$smarty->assign_by_ref('galleryId', $_REQUEST["galleryId"]);
$smarty->assign_by_ref('showname', $gal_info['showname']);
$smarty->assign_by_ref('showimageid', $gal_info['showimageid']);
$smarty->assign_by_ref('showcategories', $gal_info['showcategories']);
$smarty->assign_by_ref('showdescription', $gal_info['showdescription']);
$smarty->assign_by_ref('showcreated', $gal_info['showcreated']);
$smarty->assign_by_ref('showuser', $gal_info['showuser']);
$smarty->assign_by_ref('showhits', $gal_info['showhits']);
$smarty->assign_by_ref('showxysize', $gal_info['showxysize']);
$smarty->assign_by_ref('showfilesize', $gal_info['showfilesize']);
$smarty->assign_by_ref('showfilename', $gal_info['showfilename']);
if ($prefs['preset_galleries_info'] == 'y' && $prefs['scaleSizeGalleries'] > 0) {
	$gal_info['defaultscale'] = $prefs['scaleSizeGalleries'];
}
$smarty->assign_by_ref('defaultscale', $gal_info['defaultscale']);
$imagegallib->add_gallery_hit($_REQUEST["galleryId"]);
if (isset($_REQUEST["remove"])) {
	check_ticket('browse-gallery');
	// To remove an image the user must be the owner or admin
	if (($tiki_p_admin_galleries != 'y') && (!$user || $user != $gal_info["user"])) {
		$smarty->assign('errortype', 401);
		$smarty->assign('msg', tra("Permission denied you cannot remove images from this gallery"));
		$smarty->display("error.tpl");
		die;
	}
	$access->check_authenticity();
	$imagegallib->remove_image($_REQUEST["remove"], $user);
}
if (isset($_REQUEST["rebuild"])) {
	check_ticket('browse-gallery');
	// To rebuild thumbnails the user must be the owner or admin
	if (($tiki_p_admin_galleries != 'y') && (!$user || $user != $gal_info["user"])) {
		$smarty->assign('errortype', 401);
		$smarty->assign('msg', tra("Permission denied you cannot rebuild thumbnails in this gallery"));
		$smarty->display("error.tpl");
		die;
	}
	$smarty->assign('advice', tra('You must clear your browser cache.')); //get_strings tra('You must clear your browser cache.');
	$imagegallib->rebuild_thumbnails($_REQUEST["rebuild"]);
}
if (isset($_REQUEST["rotateright"])) {
	check_ticket('browse-gallery');
	// To rotate an image the user must be the owner or admin
	if (($tiki_p_admin_galleries != 'y') && (!$user || $user != $gal_info["user"])) {
		$smarty->assign('errortype', 401);
		$smarty->assign('msg', tra("Permission denied you cannot rotate images in this gallery"));
		$smarty->display("error.tpl");
		die;
	}
	$imagegallib->rotate_right_image($_REQUEST["rotateright"]);
}
{'fraction_non_alphanumeric': 0.2067741935483871, 'fraction_numerical': 0.005376344086021506, 'mean_word_length': 7.123144104803494, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3914779', 'n_tokens_mistral': 3432, 'n_tokens_neox': 3260, 'n_words': 645}