feature deleted: code for categories link was too complicated for such a
simple fature. Replaced by static association. Links are not persistent anymore. modification removed: #image_category.is_storage replaced by #images.storage_category_id as in branche 1.5.. git-svn-id: http://piwigo.org/svn/trunk@1121 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
f33fdc91b2
commit
d8c15ddf65
15 changed files with 329 additions and 761 deletions
|
|
@ -114,104 +114,50 @@ else if (isset($_POST['submitAdd']))
|
||||||
array_push($page['infos'], $output_create['info']);
|
array_push($page['infos'], $output_create['info']);
|
||||||
|
|
||||||
// Link the new category to the current category
|
// Link the new category to the current category
|
||||||
$query = '
|
associate_categories_to_categories(
|
||||||
INSERT
|
array($_GET['cat_id']),
|
||||||
INTO '.CATEGORIES_LINK_TABLE.'
|
array($output_create['id'])
|
||||||
(source, destination)
|
);
|
||||||
VALUES
|
|
||||||
('.$_GET['cat_id'].', '.$output_create['id'].')
|
|
||||||
;';
|
|
||||||
pwg_query($query);
|
|
||||||
|
|
||||||
check_links(array($output_create['id']));
|
// information
|
||||||
update_category(array($output_create['id']));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (isset($_POST['destination_trueify'])
|
|
||||||
and isset($_POST['destination_false'])
|
|
||||||
and count($_POST['destination_false']))
|
|
||||||
{
|
|
||||||
$datas = array();
|
|
||||||
|
|
||||||
foreach ($_POST['destination_false'] as $category_id)
|
|
||||||
{
|
|
||||||
array_push(
|
array_push(
|
||||||
$datas,
|
$page['infos'],
|
||||||
array(
|
sprintf(
|
||||||
'source' => $_GET['cat_id'],
|
l10n('Category elements associated to the following categories: %s'),
|
||||||
'destination' => $category_id,
|
'<ul><li>'
|
||||||
|
.get_cat_display_name_from_id($output_create['id'])
|
||||||
|
.'</li></ul>'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
mass_inserts(
|
else if (isset($_POST['submitDestinations'])
|
||||||
CATEGORIES_LINK_TABLE,
|
and isset($_POST['destinations'])
|
||||||
array('source', 'destination'),
|
and count($_POST['destinations']) > 0)
|
||||||
$datas
|
{
|
||||||
|
associate_categories_to_categories(
|
||||||
|
array($_GET['cat_id']),
|
||||||
|
$_POST['destinations']
|
||||||
);
|
);
|
||||||
|
|
||||||
check_links($_POST['destination_false']);
|
$category_names = array();
|
||||||
update_category(
|
foreach ($_POST['destinations'] as $category_id)
|
||||||
$_POST['destination_false'],
|
|
||||||
true // recursive update
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (isset($_POST['destination_falsify'])
|
|
||||||
and isset($_POST['destination_true'])
|
|
||||||
and count($_POST['destination_true']))
|
|
||||||
{
|
|
||||||
foreach ($_POST['destination_true'] as $destination)
|
|
||||||
{
|
|
||||||
delete_sources($destination, array($_GET['cat_id']));
|
|
||||||
}
|
|
||||||
|
|
||||||
update_category(
|
|
||||||
$_POST['destination_true'],
|
|
||||||
true // recursive update
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (isset($_POST['source_trueify'])
|
|
||||||
and isset($_POST['source_false'])
|
|
||||||
and count($_POST['source_false']))
|
|
||||||
{
|
|
||||||
$datas = array();
|
|
||||||
|
|
||||||
foreach ($_POST['source_false'] as $category_id)
|
|
||||||
{
|
{
|
||||||
array_push(
|
array_push(
|
||||||
$datas,
|
$category_names,
|
||||||
array(
|
get_cat_display_name_from_id($category_id)
|
||||||
'source' => $category_id,
|
);
|
||||||
'destination' => $_GET['cat_id'],
|
}
|
||||||
|
|
||||||
|
array_push(
|
||||||
|
$page['infos'],
|
||||||
|
sprintf(
|
||||||
|
l10n('Category elements associated to the following categories: %s'),
|
||||||
|
'<ul><li>'.implode('</li><li>', $category_names).'</li></ul>'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
mass_inserts(
|
|
||||||
CATEGORIES_LINK_TABLE,
|
|
||||||
array('source', 'destination'),
|
|
||||||
$datas
|
|
||||||
);
|
|
||||||
|
|
||||||
check_links(array($_GET['cat_id']));
|
|
||||||
update_category(
|
|
||||||
array($_GET['cat_id']),
|
|
||||||
true // recursive update
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (isset($_POST['source_falsify'])
|
|
||||||
and isset($_POST['source_true'])
|
|
||||||
and count($_POST['source_true']))
|
|
||||||
{
|
|
||||||
delete_sources($_GET['cat_id'], $_POST['source_true']);
|
|
||||||
|
|
||||||
update_category(
|
|
||||||
array($_GET['cat_id']),
|
|
||||||
true // recursive update
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$query = '
|
$query = '
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM '.CATEGORIES_TABLE.'
|
FROM '.CATEGORIES_TABLE.'
|
||||||
|
|
@ -381,7 +327,7 @@ SELECT tn_ext,path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$category['is_virtual']) //!empty($category['dir']))
|
if (!$category['is_virtual'])
|
||||||
{
|
{
|
||||||
$template->assign_block_vars(
|
$template->assign_block_vars(
|
||||||
'storage',
|
'storage',
|
||||||
|
|
@ -469,47 +415,17 @@ display_select_cat_wrapper(
|
||||||
|
|
||||||
// destination categories
|
// destination categories
|
||||||
$query = '
|
$query = '
|
||||||
SELECT DISTINCT id, name, uppercats, global_rank
|
SELECT id,name,uppercats,global_rank
|
||||||
FROM '.CATEGORIES_TABLE.'
|
FROM '.CATEGORIES_TABLE.'
|
||||||
INNER JOIN '.CATEGORIES_LINK_TABLE.' ON destination = id
|
WHERE id != '.$category['id'].'
|
||||||
WHERE source = '.$_GET['cat_id'].'
|
|
||||||
;';
|
;';
|
||||||
display_select_cat_wrapper($query, array(), 'destination_option_true');
|
|
||||||
|
|
||||||
// non destination categories
|
display_select_cat_wrapper(
|
||||||
$destinations = array_merge(
|
$query,
|
||||||
array($_GET['cat_id']),
|
array(),
|
||||||
array_from_query($query, 'id')
|
'category_option_destination'
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = '
|
|
||||||
SELECT DISTINCT id, name, uppercats, global_rank
|
|
||||||
FROM '.CATEGORIES_TABLE.'
|
|
||||||
WHERE id NOT IN ('.implode(',', $destinations).')
|
|
||||||
;';
|
|
||||||
display_select_cat_wrapper($query, array(), 'destination_option_false');
|
|
||||||
|
|
||||||
// source categories
|
|
||||||
$query = '
|
|
||||||
SELECT DISTINCT id, name, uppercats, global_rank
|
|
||||||
FROM '.CATEGORIES_TABLE.'
|
|
||||||
INNER JOIN '.CATEGORIES_LINK_TABLE.' ON source = id
|
|
||||||
WHERE destination = '.$_GET['cat_id'].'
|
|
||||||
;';
|
|
||||||
display_select_cat_wrapper($query, array(), 'source_option_true');
|
|
||||||
|
|
||||||
// non source categories
|
|
||||||
$sources = array_merge(
|
|
||||||
array($_GET['cat_id']),
|
|
||||||
array_from_query($query, 'id')
|
|
||||||
);
|
|
||||||
|
|
||||||
$query = '
|
|
||||||
SELECT DISTINCT id, name, uppercats, global_rank
|
|
||||||
FROM '.CATEGORIES_TABLE.'
|
|
||||||
WHERE id NOT IN ('.implode(',', $sources).')
|
|
||||||
;';
|
|
||||||
display_select_cat_wrapper($query, array(), 'source_option_false');
|
|
||||||
|
|
||||||
//----------------------------------------------------------- sending html code
|
//----------------------------------------------------------- sending html code
|
||||||
$template->assign_var_from_handle('ADMIN_CONTENT', 'categories');
|
$template->assign_var_from_handle('ADMIN_CONTENT', 'categories');
|
||||||
|
|
|
||||||
|
|
@ -95,80 +95,35 @@ DELETE
|
||||||
|
|
||||||
if ($_POST['associate'] != 0 and count($collection) > 0)
|
if ($_POST['associate'] != 0 and count($collection) > 0)
|
||||||
{
|
{
|
||||||
$datas = array();
|
associate_images_to_categories(
|
||||||
|
$collection,
|
||||||
$query = '
|
array($_POST['associate'])
|
||||||
SELECT image_id
|
|
||||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
|
||||||
WHERE category_id = '.$_POST['associate'].'
|
|
||||||
;';
|
|
||||||
$associated = array_from_query($query, 'image_id');
|
|
||||||
|
|
||||||
$associable = array_diff($collection, $associated);
|
|
||||||
|
|
||||||
if (count($associable) != 0)
|
|
||||||
{
|
|
||||||
foreach ($associable as $item)
|
|
||||||
{
|
|
||||||
array_push(
|
|
||||||
$datas,
|
|
||||||
array(
|
|
||||||
'category_id' => $_POST['associate'],
|
|
||||||
'image_id' => $item
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
mass_inserts(
|
|
||||||
IMAGE_CATEGORY_TABLE,
|
|
||||||
array('image_id', 'category_id'),
|
|
||||||
$datas
|
|
||||||
);
|
|
||||||
|
|
||||||
check_links();
|
|
||||||
update_category(array($_POST['associate']));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($_POST['dissociate'] != 0 and count($collection) > 0)
|
if ($_POST['dissociate'] != 0 and count($collection) > 0)
|
||||||
{
|
{
|
||||||
// First, we must identify which elements in the collection are really
|
// physical links must not be broken, so we must first retrieve image_id
|
||||||
// virtually associated with the category
|
// which create virtual links with the category to "dissociate from".
|
||||||
$query = '
|
$query = '
|
||||||
SELECT image_id
|
SELECT id
|
||||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||||
|
INNER JOIN '.IMAGES_TABLE.' ON image_id = id
|
||||||
WHERE category_id = '.$_POST['dissociate'].'
|
WHERE category_id = '.$_POST['dissociate'].'
|
||||||
AND image_id IN ('.implode(',', $collection).')
|
AND id IN ('.implode(',', $collection).')
|
||||||
AND is_storage = \'false\'
|
AND category_id != storage_category_id
|
||||||
;';
|
;';
|
||||||
$associated_images = array_from_query($query, 'image_id');
|
$dissociables = array_from_query($query, 'id');
|
||||||
|
|
||||||
// If the same element is associated to a source and its destinations,
|
|
||||||
// dissociating the element with the source implies dissociating the
|
|
||||||
// element fwith the destination.
|
|
||||||
$destinations_of = get_destinations($_POST['dissociate']);
|
|
||||||
|
|
||||||
$associated_categories = array_merge(
|
|
||||||
array($_POST['dissociate']),
|
|
||||||
$destinations_of[ $_POST['dissociate'] ]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Eventually, deletion of associations
|
|
||||||
$query = '
|
$query = '
|
||||||
DELETE
|
DELETE
|
||||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||||
WHERE category_id IN ('.implode(',', $associated_categories).'
|
WHERE category_id = '.$_POST['dissociate'].'
|
||||||
AND image_id IN ('.implode(',', $associated_images).')
|
AND image_id IN ('.implode(',', $dissociables).')
|
||||||
';
|
';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
|
|
||||||
// check source/destination links. If category C has for sources A and
|
update_category($_POST['dissociate']);
|
||||||
// B, if picture 1 was associated to A and B, the previous code lines
|
|
||||||
// have deleted the link between C and 1, while it should be kept due to
|
|
||||||
// B. Who said "complicated"?
|
|
||||||
check_links();
|
|
||||||
|
|
||||||
update_category($associated_categories);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
|
|
@ -318,7 +273,7 @@ SELECT DISTINCT(category_id) AS id, c.name, uppercats, global_rank
|
||||||
WHERE ic.image_id IN ('.implode(',', $page['cat_elements_id']).')
|
WHERE ic.image_id IN ('.implode(',', $page['cat_elements_id']).')
|
||||||
AND ic.category_id = c.id
|
AND ic.category_id = c.id
|
||||||
AND ic.image_id = i.id
|
AND ic.image_id = i.id
|
||||||
AND ic.is_storage = \'false\'
|
AND ic.category_id != i.storage_category_id
|
||||||
;';
|
;';
|
||||||
display_select_cat_wrapper($query, array(), $blockname, true);
|
display_select_cat_wrapper($query, array(), $blockname, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -152,22 +152,16 @@ function delete_categories($ids)
|
||||||
|
|
||||||
// destruction of all the related elements
|
// destruction of all the related elements
|
||||||
$query = '
|
$query = '
|
||||||
SELECT image_id
|
SELECT id
|
||||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
FROM '.IMAGES_TABLE.'
|
||||||
WHERE is_storage = \'true\'
|
WHERE storage_category_id IN (
|
||||||
AND category_id IN ('.
|
'.wordwrap(implode(', ', $ids), 80, "\n").')
|
||||||
wordwrap(
|
|
||||||
implode(', ', $ids),
|
|
||||||
80,
|
|
||||||
"\n"
|
|
||||||
).
|
|
||||||
')
|
|
||||||
;';
|
;';
|
||||||
$result = pwg_query($query);
|
$result = pwg_query($query);
|
||||||
$element_ids = array();
|
$element_ids = array();
|
||||||
while ($row = mysql_fetch_array($result))
|
while ($row = mysql_fetch_array($result))
|
||||||
{
|
{
|
||||||
array_push($element_ids, $row['image_id']);
|
array_push($element_ids, $row['id']);
|
||||||
}
|
}
|
||||||
delete_elements($element_ids);
|
delete_elements($element_ids);
|
||||||
|
|
||||||
|
|
@ -194,37 +188,6 @@ DELETE FROM '.GROUP_ACCESS_TABLE.'
|
||||||
;';
|
;';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
|
|
||||||
// source/destination links deletion
|
|
||||||
$query = '
|
|
||||||
SELECT destination, source
|
|
||||||
FROM '.CATEGORIES_LINK_TABLE.'
|
|
||||||
WHERE source IN ('.implode(',', $ids).')
|
|
||||||
OR destination IN ('.implode(',', $ids).')
|
|
||||||
;';
|
|
||||||
$result = pwg_query($query);
|
|
||||||
|
|
||||||
$sources_of = array();
|
|
||||||
|
|
||||||
while ($row = mysql_fetch_array($result))
|
|
||||||
{
|
|
||||||
if (!isset($sources_of[ $row['destination'] ]))
|
|
||||||
{
|
|
||||||
$sources_of[ $row['destination'] ] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
array_push(
|
|
||||||
$sources_of[ $row['destination'] ],
|
|
||||||
$row['source']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($sources_of as $destination => $sources)
|
|
||||||
{
|
|
||||||
delete_sources($destination, $sources);
|
|
||||||
}
|
|
||||||
|
|
||||||
update_category();
|
|
||||||
|
|
||||||
// destruction of the category
|
// destruction of the category
|
||||||
$query = '
|
$query = '
|
||||||
DELETE FROM '.CATEGORIES_TABLE.'
|
DELETE FROM '.CATEGORIES_TABLE.'
|
||||||
|
|
@ -441,8 +404,7 @@ SELECT id
|
||||||
SELECT category_id,
|
SELECT category_id,
|
||||||
COUNT(image_id) AS nb_images,
|
COUNT(image_id) AS nb_images,
|
||||||
MAX(date_available) AS date_last
|
MAX(date_available) AS date_last
|
||||||
FROM '.IMAGES_TABLE.'
|
FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
|
||||||
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id
|
|
||||||
WHERE category_id IN ('.wordwrap(implode(', ', $cat_ids), 80, "\n").')
|
WHERE category_id IN ('.wordwrap(implode(', ', $cat_ids), 80, "\n").')
|
||||||
GROUP BY category_id
|
GROUP BY category_id
|
||||||
;';
|
;';
|
||||||
|
|
@ -466,23 +428,12 @@ SELECT category_id,
|
||||||
// is returned but the update must be done !
|
// is returned but the update must be done !
|
||||||
foreach (array_diff($cat_ids, $query_ids) as $id)
|
foreach (array_diff($cat_ids, $query_ids) as $id)
|
||||||
{
|
{
|
||||||
array_push(
|
array_push($datas, array('id' => $id, 'nb_images' => 0));
|
||||||
$datas,
|
|
||||||
array(
|
|
||||||
'id' => $id,
|
|
||||||
'nb_images' => 0,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mass_updates(
|
$fields = array('primary' => array('id'),
|
||||||
CATEGORIES_TABLE,
|
'update' => array('date_last', 'nb_images'));
|
||||||
array(
|
mass_updates(CATEGORIES_TABLE, $fields, $datas);
|
||||||
'primary' => array('id'),
|
|
||||||
'update' => array('date_last', 'nb_images')
|
|
||||||
),
|
|
||||||
$datas
|
|
||||||
);
|
|
||||||
|
|
||||||
// representative pictures
|
// representative pictures
|
||||||
if (count($cat_ids) > 0)
|
if (count($cat_ids) > 0)
|
||||||
|
|
@ -1357,42 +1308,19 @@ SELECT id, id_uppercat
|
||||||
*/
|
*/
|
||||||
function update_path()
|
function update_path()
|
||||||
{
|
{
|
||||||
$images_of = array();
|
|
||||||
|
|
||||||
$query = '
|
$query = '
|
||||||
SELECT category_id, image_id
|
SELECT DISTINCT(storage_category_id)
|
||||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
FROM '.IMAGES_TABLE.'
|
||||||
WHERE is_storage = \'true\'
|
|
||||||
;';
|
;';
|
||||||
$result = pwg_query($query);
|
$cat_ids = array_from_query($query, 'storage_category_id');
|
||||||
while ($row = mysql_fetch_array($result))
|
$fulldirs = get_fulldirs($cat_ids);
|
||||||
{
|
|
||||||
if (!isset($images_of[ $row['category_id'] ]))
|
|
||||||
{
|
|
||||||
$images_of[ $row['category_id'] ] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
array_push(
|
foreach ($cat_ids as $cat_id)
|
||||||
$images_of[ $row['category_id'] ],
|
|
||||||
$row['image_id']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$fulldirs = get_fulldirs(
|
|
||||||
array_keys($images_of)
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($images_of as $cat_id => $image_ids)
|
|
||||||
{
|
{
|
||||||
$query = '
|
$query = '
|
||||||
UPDATE '.IMAGES_TABLE.'
|
UPDATE '.IMAGES_TABLE.'
|
||||||
SET path = CONCAT(\''.$fulldirs[$cat_id].'\',\'/\',file)
|
SET path = CONCAT(\''.$fulldirs[$cat_id].'\',\'/\',file)
|
||||||
WHERE id IN ('.
|
WHERE storage_category_id = '.$cat_id.'
|
||||||
wordwrap(
|
|
||||||
implode(', ', $image_ids),
|
|
||||||
80,
|
|
||||||
"\n").
|
|
||||||
')
|
|
||||||
;';
|
;';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
}
|
}
|
||||||
|
|
@ -1612,371 +1540,6 @@ DELETE FROM '.$table.'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns all destinations of a list of source categories. This function
|
|
||||||
* solves transitivity.
|
|
||||||
*
|
|
||||||
* @param mixed array of category ids, empty for all categories
|
|
||||||
*/
|
|
||||||
function get_destinations($categories = 'all')
|
|
||||||
{
|
|
||||||
$query = '
|
|
||||||
SELECT source, destination
|
|
||||||
FROM '.CATEGORIES_LINK_TABLE.'
|
|
||||||
';
|
|
||||||
$result = pwg_query($query);
|
|
||||||
|
|
||||||
$destinations_of = array();
|
|
||||||
|
|
||||||
while ($row = mysql_fetch_array($result))
|
|
||||||
{
|
|
||||||
if (!isset($destinations_of[ $row['source'] ]))
|
|
||||||
{
|
|
||||||
$destinations_of[ $row['source'] ] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
array_push(
|
|
||||||
$destinations_of[ $row['source'] ],
|
|
||||||
$row['destination']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// transitivity resolution: if " => " means "source of", if A=>B=>C
|
|
||||||
// implies A=>B and A=>C. So A has 2 destinations: B and C.
|
|
||||||
do
|
|
||||||
{
|
|
||||||
// let's suppose we only need a single turn
|
|
||||||
$need_new_turn = false;
|
|
||||||
|
|
||||||
foreach ($destinations_of as $source => $destinations)
|
|
||||||
{
|
|
||||||
foreach ($destinations as $destination)
|
|
||||||
{
|
|
||||||
// does the current destination has destinations itself?
|
|
||||||
if (isset($destinations_of[$destination]))
|
|
||||||
{
|
|
||||||
// are there destinations of current destination not already among
|
|
||||||
// destinations of the current source? (advise: take a piece of
|
|
||||||
// paper and draw a schema). The source itself must not be counted
|
|
||||||
// as a destination, thus avoiding cyclic links.
|
|
||||||
$missing_destinations = array_diff(
|
|
||||||
$destinations_of[$destination],
|
|
||||||
$destinations,
|
|
||||||
array($source) // no cyclic link
|
|
||||||
);
|
|
||||||
|
|
||||||
if (count($missing_destinations) > 0)
|
|
||||||
{
|
|
||||||
$destinations_of[$source] = array_unique(
|
|
||||||
array_merge(
|
|
||||||
$destinations,
|
|
||||||
$missing_destinations
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// a category has a least one new destination, we have to check
|
|
||||||
// one more time that it doesn't generate more destinations
|
|
||||||
$need_new_turn = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while ($need_new_turn);
|
|
||||||
|
|
||||||
if (is_array($categories))
|
|
||||||
{
|
|
||||||
$filtered_destinations_of = array();
|
|
||||||
|
|
||||||
// Even if there is no destinations for the requested categories, we
|
|
||||||
// return empty arrays
|
|
||||||
foreach ($categories as $category)
|
|
||||||
{
|
|
||||||
$filtered_destinations_of[$category] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($destinations_of as $source => $destinations)
|
|
||||||
{
|
|
||||||
if (in_array($source, $categories))
|
|
||||||
{
|
|
||||||
$filtered_destinations_of[$source] = $destinations;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $filtered_destinations_of;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return $destinations_of;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns all sources of a list of destination categories. This function
|
|
||||||
* solves transitivity.
|
|
||||||
*
|
|
||||||
* @param mixed array of category ids, empty for all categories
|
|
||||||
*/
|
|
||||||
function get_sources($categories = 'all')
|
|
||||||
{
|
|
||||||
$destinations_of = get_destinations();
|
|
||||||
|
|
||||||
$sources_of = array();
|
|
||||||
|
|
||||||
foreach ($destinations_of as $source => $destinations)
|
|
||||||
{
|
|
||||||
foreach ($destinations as $destination)
|
|
||||||
{
|
|
||||||
if (!isset($sources_of[$destination]))
|
|
||||||
{
|
|
||||||
$sources_of[$destination] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
array_push($sources_of[$destination], $source);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// eventually, filter
|
|
||||||
if (is_array($categories))
|
|
||||||
{
|
|
||||||
$filtered_sources_of = array();
|
|
||||||
|
|
||||||
// Even if there is no sources for the requested categories, we return
|
|
||||||
// empty arrays
|
|
||||||
foreach ($categories as $category)
|
|
||||||
{
|
|
||||||
$filtered_sources_of[$category] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($sources_of as $destination => $sources)
|
|
||||||
{
|
|
||||||
if (in_array($destination, $categories))
|
|
||||||
{
|
|
||||||
$filtered_sources_of[$destination] = $sources;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $filtered_sources_of;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return $sources_of;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks categories links are respected for a given list of destinations.
|
|
||||||
*
|
|
||||||
* Checking categories links means that each destination must be associated
|
|
||||||
* to the images of its sources.
|
|
||||||
*
|
|
||||||
* @param mixed source category ids
|
|
||||||
*/
|
|
||||||
function check_links($destinations = 'all')
|
|
||||||
{
|
|
||||||
$sources_of = get_sources($destinations);
|
|
||||||
|
|
||||||
if (empty($sources_of))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// we need to search images of all sources and destinations
|
|
||||||
$images_of = array();
|
|
||||||
|
|
||||||
foreach ($sources_of as $destination => $sources)
|
|
||||||
{
|
|
||||||
$images_of[$destination] = array();
|
|
||||||
|
|
||||||
foreach ($sources as $source)
|
|
||||||
{
|
|
||||||
$images_of[$source] = array();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = '
|
|
||||||
SELECT image_id, category_id
|
|
||||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
|
||||||
WHERE category_id IN ('.
|
|
||||||
implode(',', array_keys($images_of)).
|
|
||||||
')
|
|
||||||
;';
|
|
||||||
$result = pwg_query($query);
|
|
||||||
|
|
||||||
while ($row = mysql_fetch_array($result))
|
|
||||||
{
|
|
||||||
array_push(
|
|
||||||
$images_of[ $row['category_id'] ],
|
|
||||||
$row['image_id']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$inserts = array();
|
|
||||||
|
|
||||||
foreach ($sources_of as $destination => $sources)
|
|
||||||
{
|
|
||||||
// merge all images from the sources of this destination
|
|
||||||
$sources_images = array();
|
|
||||||
|
|
||||||
foreach ($sources as $source)
|
|
||||||
{
|
|
||||||
$sources_images = array_merge(
|
|
||||||
$sources_images,
|
|
||||||
$images_of[$source]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$sources_images = array_unique($sources_images);
|
|
||||||
|
|
||||||
// are there images among the sources that are not linked to the
|
|
||||||
// destination?
|
|
||||||
$missing_images = array_diff(
|
|
||||||
$sources_images,
|
|
||||||
$images_of[$destination]
|
|
||||||
);
|
|
||||||
|
|
||||||
// if we find missing images (missing links in reality), we prepare the
|
|
||||||
// final mass_inserts
|
|
||||||
if (count($missing_images) > 0)
|
|
||||||
{
|
|
||||||
foreach ($missing_images as $missing_image)
|
|
||||||
{
|
|
||||||
array_push(
|
|
||||||
$inserts,
|
|
||||||
array(
|
|
||||||
'category_id' => $destination,
|
|
||||||
'image_id' => $missing_image,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($inserts) > 0)
|
|
||||||
{
|
|
||||||
mass_inserts(
|
|
||||||
IMAGE_CATEGORY_TABLE,
|
|
||||||
array_keys($inserts[0]),
|
|
||||||
$inserts
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Based on categories links, delete image_category links on destinations.
|
|
||||||
*
|
|
||||||
* The rule is the following: if an image belong to the category and to the
|
|
||||||
* source, we suppose it comes from the source. If the source/destination
|
|
||||||
* link is broken, we delete the image/category link if the only origin of
|
|
||||||
* the link was the broken categories link.
|
|
||||||
*
|
|
||||||
* Example: "=>" means "source of". Between brackets the associated images.
|
|
||||||
*
|
|
||||||
* A (1,2,9) => \
|
|
||||||
* |=> C (1,2,3,4,5,9) => D (1,2,3,4,5,6,9)
|
|
||||||
* B (3,4,9) => /
|
|
||||||
*
|
|
||||||
* In category C, we suppose (1,2) come from A, (3,4) from B, 9 from A or B
|
|
||||||
* and 5 was manually added. In category D, 6 was added manually.
|
|
||||||
*
|
|
||||||
* If we break A=>C, C and D loose (1,2) but not 9 because it can come from
|
|
||||||
* B. If we break C=>D, D loose (3,4,5,9) but not 6 because it was
|
|
||||||
* associated manually to 9.
|
|
||||||
*
|
|
||||||
* Warning: only virtual links can be removed, physical links are protected.
|
|
||||||
*
|
|
||||||
* @param int destination
|
|
||||||
* @param array sources
|
|
||||||
*/
|
|
||||||
function delete_sources($destination, $sources)
|
|
||||||
{
|
|
||||||
// if no sources to unlink, we stop with OK status
|
|
||||||
if (count($sources) == 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = '
|
|
||||||
DELETE
|
|
||||||
FROM '.CATEGORIES_LINK_TABLE.'
|
|
||||||
WHERE destination = '.$destination.'
|
|
||||||
AND source IN ('.implode(',', $sources).')
|
|
||||||
;';
|
|
||||||
pwg_query($query);
|
|
||||||
|
|
||||||
// The strategy is the following:
|
|
||||||
//
|
|
||||||
// * first we brutally delete the image/category associations on
|
|
||||||
// destinations categories for all images belonging to sources.
|
|
||||||
//
|
|
||||||
// * then we check_links on destinations to rebuild missing image/category
|
|
||||||
// associations.
|
|
||||||
|
|
||||||
// what are the images associated to the sources to unlink
|
|
||||||
$query = '
|
|
||||||
SELECT image_id
|
|
||||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
|
||||||
WHERE category_id IN ('.
|
|
||||||
implode(',', $sources).
|
|
||||||
')
|
|
||||||
;';
|
|
||||||
$sources_images = array_unique(
|
|
||||||
array_from_query($query, 'image_id')
|
|
||||||
);
|
|
||||||
|
|
||||||
if (count($sources_images) == 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// retrieve all direct and indirect destinations of the current
|
|
||||||
// destination
|
|
||||||
$destinations_of = get_destinations(array($destination));
|
|
||||||
|
|
||||||
$destinations = array_merge(
|
|
||||||
array($destination),
|
|
||||||
$destinations_of[$destination]
|
|
||||||
);
|
|
||||||
|
|
||||||
// unlink sources images from destinations
|
|
||||||
$query = '
|
|
||||||
DELETE
|
|
||||||
FROM '.IMAGE_CATEGORY_TABLE.'
|
|
||||||
WHERE category_id IN ('.implode(',', $destinations).')
|
|
||||||
AND image_id IN ('.implode(',', $sources_images).')
|
|
||||||
AND is_storage = \'false\'
|
|
||||||
;';
|
|
||||||
pwg_query($query);
|
|
||||||
|
|
||||||
// if the representative thumbnail of destinations was a picture from
|
|
||||||
// $sources_images, we request a new random representant
|
|
||||||
$query = '
|
|
||||||
SELECT id, representative_picture_id
|
|
||||||
FROM '.CATEGORIES_TABLE.'
|
|
||||||
WHERE id IN ('.implode(',', $destinations).')
|
|
||||||
;';
|
|
||||||
$result = pwg_query($query);
|
|
||||||
|
|
||||||
$request_random = array();
|
|
||||||
|
|
||||||
while ($row = mysql_fetch_array($result))
|
|
||||||
{
|
|
||||||
if (isset($row['representative_picture_id']))
|
|
||||||
{
|
|
||||||
if (in_array($row['representative_picture_id'], $sources_images))
|
|
||||||
{
|
|
||||||
array_push($request_random, $row['id']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
set_random_representant($request_random);
|
|
||||||
|
|
||||||
// eventually, we check_links to rebuild missing associations
|
|
||||||
check_links($destinations);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a virtual category
|
* create a virtual category
|
||||||
*
|
*
|
||||||
|
|
@ -2299,4 +1862,78 @@ function do_maintenance_all_tables()
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Associate a list of images to a list of categories.
|
||||||
|
*
|
||||||
|
* The function will not duplicate links
|
||||||
|
*
|
||||||
|
* @param array images
|
||||||
|
* @param array categories
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function associate_images_to_categories($images, $categories)
|
||||||
|
{
|
||||||
|
if (count($images) == 0
|
||||||
|
or count($categories) == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = '
|
||||||
|
DELETE
|
||||||
|
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||||
|
WHERE image_id IN ('.implode(',', $images).')
|
||||||
|
AND category_id IN ('.implode(',', $categories).')
|
||||||
|
;';
|
||||||
|
pwg_query($query);
|
||||||
|
|
||||||
|
$inserts = array();
|
||||||
|
foreach ($categories as $category_id)
|
||||||
|
{
|
||||||
|
foreach ($images as $image_id)
|
||||||
|
{
|
||||||
|
array_push(
|
||||||
|
$inserts,
|
||||||
|
array(
|
||||||
|
'image_id' => $image_id,
|
||||||
|
'category_id' => $category_id,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mass_inserts(
|
||||||
|
IMAGE_CATEGORY_TABLE,
|
||||||
|
array_keys($inserts[0]),
|
||||||
|
$inserts
|
||||||
|
);
|
||||||
|
|
||||||
|
update_category($categories);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Associate images associated to a list of source categories to a list of
|
||||||
|
* destination categories.
|
||||||
|
*
|
||||||
|
* @param array sources
|
||||||
|
* @param array destinations
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function associate_categories_to_categories($sources, $destinations)
|
||||||
|
{
|
||||||
|
if (count($sources) == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = '
|
||||||
|
SELECT image_id
|
||||||
|
FROM '.IMAGE_CATEGORY_TABLE.'
|
||||||
|
WHERE category_id IN ('.implode(',', $sources).')
|
||||||
|
;';
|
||||||
|
$images = array_from_query($query, 'image_id');
|
||||||
|
|
||||||
|
associate_images_to_categories($images, $destinations);
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -246,9 +246,7 @@ SELECT id
|
||||||
$query = '
|
$query = '
|
||||||
SELECT id, path
|
SELECT id, path
|
||||||
FROM '.IMAGES_TABLE.'
|
FROM '.IMAGES_TABLE.'
|
||||||
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON image_id = id
|
WHERE storage_category_id IN ('.implode(',', $cat_ids).')';
|
||||||
WHERE is_storage = \'true\'
|
|
||||||
AND category_id IN ('.implode(',', $cat_ids).')';
|
|
||||||
if ($only_new)
|
if ($only_new)
|
||||||
{
|
{
|
||||||
$query.= '
|
$query.= '
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ switch ($action)
|
||||||
{
|
{
|
||||||
case 'categories' :
|
case 'categories' :
|
||||||
{
|
{
|
||||||
check_links();
|
|
||||||
update_uppercats();
|
update_uppercats();
|
||||||
update_category('all');
|
update_category('all');
|
||||||
ordering();
|
ordering();
|
||||||
|
|
|
||||||
|
|
@ -121,56 +121,23 @@ if (isset($_POST['associate'])
|
||||||
and isset($_POST['cat_dissociated'])
|
and isset($_POST['cat_dissociated'])
|
||||||
and count($_POST['cat_dissociated']) > 0)
|
and count($_POST['cat_dissociated']) > 0)
|
||||||
{
|
{
|
||||||
$datas = array();
|
associate_images_to_categories(
|
||||||
|
array($_GET['image_id']),
|
||||||
foreach ($_POST['cat_dissociated'] as $category_id)
|
$_POST['cat_dissociated']
|
||||||
{
|
|
||||||
array_push(
|
|
||||||
$datas,
|
|
||||||
array(
|
|
||||||
'image_id' => $_GET['image_id'],
|
|
||||||
'category_id' => $category_id
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
mass_inserts(
|
|
||||||
IMAGE_CATEGORY_TABLE,
|
|
||||||
array('image_id', 'category_id'),
|
|
||||||
$datas
|
|
||||||
);
|
|
||||||
|
|
||||||
check_links();
|
|
||||||
update_category($_POST['cat_dissociated']);
|
|
||||||
}
|
|
||||||
// dissociate the element from categories (but not from its storage category)
|
// dissociate the element from categories (but not from its storage category)
|
||||||
if (isset($_POST['dissociate'])
|
if (isset($_POST['dissociate'])
|
||||||
and isset($_POST['cat_associated'])
|
and isset($_POST['cat_associated'])
|
||||||
and count($_POST['cat_associated']) > 0)
|
and count($_POST['cat_associated']) > 0)
|
||||||
{
|
{
|
||||||
$associated_categories = $_POST['cat_associated'];
|
|
||||||
|
|
||||||
// If the same element is associated to a source and its destinations,
|
|
||||||
// dissociating the element with the source implies dissociating the
|
|
||||||
// element fwith the destination.
|
|
||||||
$destinations_of = get_destinations($_POST['cat_associated']);
|
|
||||||
foreach ($destinations_of as $source => $destinations)
|
|
||||||
{
|
|
||||||
$associated_categories = array_merge(
|
|
||||||
$associated_categories,
|
|
||||||
$destinations
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = '
|
$query = '
|
||||||
DELETE FROM '.IMAGE_CATEGORY_TABLE.'
|
DELETE FROM '.IMAGE_CATEGORY_TABLE.'
|
||||||
WHERE image_id = '.$_GET['image_id'].'
|
WHERE image_id = '.$_GET['image_id'].'
|
||||||
AND category_id IN ('.implode(',', $associated_categories).')
|
AND category_id IN ('.implode(',', $_POST['cat_associated']).')
|
||||||
AND is_storage = \'false\'
|
|
||||||
';
|
';
|
||||||
pwg_query($query);
|
pwg_query($query);
|
||||||
|
|
||||||
check_links();
|
|
||||||
update_category($_POST['cat_associated']);
|
update_category($_POST['cat_associated']);
|
||||||
}
|
}
|
||||||
// elect the element to represent the given categories
|
// elect the element to represent the given categories
|
||||||
|
|
@ -201,13 +168,11 @@ if (isset($_POST['dismiss'])
|
||||||
$query = '
|
$query = '
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM '.IMAGES_TABLE.'
|
FROM '.IMAGES_TABLE.'
|
||||||
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON image_id = id
|
|
||||||
WHERE id = '.$_GET['image_id'].'
|
WHERE id = '.$_GET['image_id'].'
|
||||||
AND is_storage = \'true\'
|
|
||||||
;';
|
;';
|
||||||
$row = mysql_fetch_array(pwg_query($query));
|
$row = mysql_fetch_array(pwg_query($query));
|
||||||
|
|
||||||
$storage_category_id = $row['category_id'];
|
$storage_category_id = $row['storage_category_id'];
|
||||||
$image_file = $row['file'];
|
$image_file = $row['file'];
|
||||||
|
|
||||||
// tags
|
// tags
|
||||||
|
|
@ -396,7 +361,7 @@ SELECT id,name,uppercats,global_rank
|
||||||
FROM '.CATEGORIES_TABLE.'
|
FROM '.CATEGORIES_TABLE.'
|
||||||
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = category_id
|
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id = category_id
|
||||||
WHERE image_id = '.$_GET['image_id'].'
|
WHERE image_id = '.$_GET['image_id'].'
|
||||||
AND is_storage = \'false\'
|
AND id != '.$storage_category_id.'
|
||||||
;';
|
;';
|
||||||
display_select_cat_wrapper($query, array(), 'associated_option');
|
display_select_cat_wrapper($query, array(), 'associated_option');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,16 +182,14 @@ SELECT i.id,
|
||||||
i.file,
|
i.file,
|
||||||
i.tn_ext,
|
i.tn_ext,
|
||||||
i.average_rate,
|
i.average_rate,
|
||||||
|
i.storage_category_id,
|
||||||
MAX(r.date) AS recently_rated,
|
MAX(r.date) AS recently_rated,
|
||||||
COUNT(r.rate) AS nb_rates,
|
COUNT(r.rate) AS nb_rates,
|
||||||
SUM(r.rate) AS sum_rates,
|
SUM(r.rate) AS sum_rates,
|
||||||
ROUND(STD(r.rate),2) AS std_rates,
|
ROUND(STD(r.rate),2) AS std_rates
|
||||||
ic.category_id AS storage_category_id
|
|
||||||
FROM '.RATE_TABLE.' AS r
|
FROM '.RATE_TABLE.' AS r
|
||||||
LEFT JOIN '.IMAGES_TABLE.' AS i ON r.element_id = i.id
|
LEFT JOIN '.IMAGES_TABLE.' AS i ON r.element_id = i.id
|
||||||
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON ic.image_id = i.id
|
|
||||||
WHERE 1 = 1 ' . $display_filter . '
|
WHERE 1 = 1 ' . $display_filter . '
|
||||||
AND ic.is_storage = \'true\'
|
|
||||||
GROUP BY r.element_id
|
GROUP BY r.element_id
|
||||||
ORDER BY ' . $available_order_by[$order_by_index][1] .'
|
ORDER BY ' . $available_order_by[$order_by_index][1] .'
|
||||||
LIMIT '.$start.','.$elements_per_page.'
|
LIMIT '.$start.','.$elements_per_page.'
|
||||||
|
|
|
||||||
|
|
@ -368,15 +368,12 @@ if (isset($_POST['submit']) and $_POST['sync'] == 'files'
|
||||||
$query = '
|
$query = '
|
||||||
SELECT id, path
|
SELECT id, path
|
||||||
FROM '.IMAGES_TABLE.'
|
FROM '.IMAGES_TABLE.'
|
||||||
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON image_id = id
|
WHERE storage_category_id IN ('
|
||||||
WHERE is_storage = \'true\'
|
.wordwrap(
|
||||||
AND category_id IN ('.
|
|
||||||
wordwrap(
|
|
||||||
implode(', ', $cat_ids),
|
implode(', ', $cat_ids),
|
||||||
80,
|
80,
|
||||||
"\n"
|
"\n"
|
||||||
).
|
).')
|
||||||
')
|
|
||||||
;';
|
;';
|
||||||
$result = pwg_query($query);
|
$result = pwg_query($query);
|
||||||
while ($row = mysql_fetch_array($result))
|
while ($row = mysql_fetch_array($result))
|
||||||
|
|
@ -458,6 +455,7 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
|
||||||
? $fs[$path]['has_high']
|
? $fs[$path]['has_high']
|
||||||
: null,
|
: null,
|
||||||
'path' => $path,
|
'path' => $path,
|
||||||
|
'storage_category_id' => $db_fulldirs[$dirname],
|
||||||
);
|
);
|
||||||
|
|
||||||
array_push(
|
array_push(
|
||||||
|
|
@ -469,8 +467,7 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
|
||||||
$insert_links,
|
$insert_links,
|
||||||
array(
|
array(
|
||||||
'image_id' => $insert{'id'},
|
'image_id' => $insert{'id'},
|
||||||
'category_id' => $db_fulldirs[$dirname],
|
'category_id' => $insert['storage_category_id'],
|
||||||
'is_storage' => 'true',
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
array_push(
|
array_push(
|
||||||
|
|
@ -508,6 +505,7 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
|
||||||
'representative_ext' => isset($fs[$path]['representative_ext'])
|
'representative_ext' => isset($fs[$path]['representative_ext'])
|
||||||
? $fs[$path]['representative_ext']
|
? $fs[$path]['representative_ext']
|
||||||
: null,
|
: null,
|
||||||
|
'storage_category_id' => $db_fulldirs[$dirname],
|
||||||
);
|
);
|
||||||
|
|
||||||
array_push(
|
array_push(
|
||||||
|
|
@ -519,8 +517,7 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
|
||||||
$insert_links,
|
$insert_links,
|
||||||
array(
|
array(
|
||||||
'image_id' => $insert{'id'},
|
'image_id' => $insert{'id'},
|
||||||
'category_id' => $db_fulldirs[$dirname],
|
'category_id' => $insert['storage_category_id'],
|
||||||
'is_storage' => 'true',
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -552,7 +549,7 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_element_id
|
||||||
mass_inserts(
|
mass_inserts(
|
||||||
IMAGE_CATEGORY_TABLE,
|
IMAGE_CATEGORY_TABLE,
|
||||||
array(
|
array(
|
||||||
'image_id','category_id', 'is_storage',
|
'image_id','category_id',
|
||||||
),
|
),
|
||||||
$insert_links
|
$insert_links
|
||||||
);
|
);
|
||||||
|
|
@ -609,9 +606,7 @@ SELECT id,file,storage_category_id,infos
|
||||||
$query = '
|
$query = '
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM '.IMAGES_TABLE.'
|
FROM '.IMAGES_TABLE.'
|
||||||
INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON image_id = id
|
WHERE storage_category_id = '.$row['storage_category_id'].'
|
||||||
WHERE is_storage = \'true\'
|
|
||||||
AND category_id = '.$row['storage_category_id'].'
|
|
||||||
AND file = \''.$row['file'].'\'
|
AND file = \''.$row['file'].'\'
|
||||||
;';
|
;';
|
||||||
list($data['id']) = mysql_fetch_array(pwg_query($query));
|
list($data['id']) = mysql_fetch_array(pwg_query($query));
|
||||||
|
|
@ -658,11 +653,6 @@ if (isset($_POST['submit'])
|
||||||
|
|
||||||
if (!$simulate)
|
if (!$simulate)
|
||||||
{
|
{
|
||||||
$start = get_moment();
|
|
||||||
check_links('all');
|
|
||||||
echo '<!-- check_links(all) : ';
|
|
||||||
echo get_elapsed_time($start,get_moment());
|
|
||||||
echo ' -->'."\n";
|
|
||||||
$start = get_moment();
|
$start = get_moment();
|
||||||
update_category('all');
|
update_category('all');
|
||||||
echo '<!-- update_category(all) : ';
|
echo '<!-- update_category(all) : ';
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@ define('CADDIE_TABLE', $prefixeTable.'caddie');
|
||||||
define('UPGRADE_TABLE', $prefixeTable.'upgrade');
|
define('UPGRADE_TABLE', $prefixeTable.'upgrade');
|
||||||
define('SEARCH_TABLE', $prefixeTable.'search');
|
define('SEARCH_TABLE', $prefixeTable.'search');
|
||||||
define('USER_MAIL_NOTIFICATION_TABLE', $prefixeTable.'user_mail_notification');
|
define('USER_MAIL_NOTIFICATION_TABLE', $prefixeTable.'user_mail_notification');
|
||||||
define('CATEGORIES_LINK_TABLE', $prefixeTable.'categories_link');
|
|
||||||
define('TAGS_TABLE', $prefixeTable.'tags');
|
define('TAGS_TABLE', $prefixeTable.'tags');
|
||||||
define('IMAGE_TAG_TABLE', $prefixeTable.'image_tag');
|
define('IMAGE_TAG_TABLE', $prefixeTable.'image_tag');
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
91
install/db/20-database.php
Normal file
91
install/db/20-database.php
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
<?php
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
|
// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | branch : BSF (Best So Far)
|
||||||
|
// | file : $RCSfile$
|
||||||
|
// | last update : $Date: 2005-09-21 00:04:57 +0200 (mer, 21 sep 2005) $
|
||||||
|
// | last modifier : $Author: plg $
|
||||||
|
// | revision : $Revision: 870 $
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | This program is free software; you can redistribute it and/or modify |
|
||||||
|
// | it under the terms of the GNU General Public License as published by |
|
||||||
|
// | the Free Software Foundation |
|
||||||
|
// | |
|
||||||
|
// | This program is distributed in the hope that it will be useful, but |
|
||||||
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||||
|
// | General Public License for more details. |
|
||||||
|
// | |
|
||||||
|
// | You should have received a copy of the GNU General Public License |
|
||||||
|
// | along with this program; if not, write to the Free Software |
|
||||||
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
||||||
|
// | USA. |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
if (!defined('PHPWG_ROOT_PATH'))
|
||||||
|
{
|
||||||
|
die('Hacking attempt!');
|
||||||
|
}
|
||||||
|
|
||||||
|
$upgrade_description =
|
||||||
|
'#image_category.is_storage replaced by #image.storage_category_id';
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | New column |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
$query = '
|
||||||
|
ALTER TABLE '.PREFIX_TABLE.'images
|
||||||
|
ADD storage_category_id smallint(5) unsigned default NULL
|
||||||
|
;';
|
||||||
|
pwg_query($query);
|
||||||
|
|
||||||
|
$query = '
|
||||||
|
SELECT category_id, image_id
|
||||||
|
FROM '.PREFIX_TABLE.'image_category
|
||||||
|
WHERE is_storage = \'true\'
|
||||||
|
;';
|
||||||
|
$result = pwg_query($query);
|
||||||
|
|
||||||
|
$datas = array();
|
||||||
|
while ($row = mysql_fetch_array($result))
|
||||||
|
{
|
||||||
|
array_push(
|
||||||
|
$datas,
|
||||||
|
array(
|
||||||
|
'id' => $row['image_id'],
|
||||||
|
'storage_category_id' => $row['category_id'],
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
mass_updates(
|
||||||
|
PREFIX_TABLE.'images',
|
||||||
|
array(
|
||||||
|
'primary' => array('id'),
|
||||||
|
'update' => array('storage_category_id'),
|
||||||
|
),
|
||||||
|
$datas
|
||||||
|
);
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | Delete obsolete column |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
$query = '
|
||||||
|
ALTER TABLE '.PREFIX_TABLE.'image_category DROP COLUMN is_storage
|
||||||
|
;';
|
||||||
|
pwg_query($query);
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | End notification |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
echo
|
||||||
|
"\n"
|
||||||
|
.'Column '.PREFIX_TABLE.'image_category'
|
||||||
|
.' replaced by '.PREFIX_TABLE.'images.storage_category_id'."\n"
|
||||||
|
;
|
||||||
|
?>
|
||||||
52
install/db/21-database.php
Normal file
52
install/db/21-database.php
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
<?php
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
|
// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | branch : BSF (Best So Far)
|
||||||
|
// | file : $RCSfile$
|
||||||
|
// | last update : $Date: 2005-09-21 00:04:57 +0200 (mer, 21 sep 2005) $
|
||||||
|
// | last modifier : $Author: plg $
|
||||||
|
// | revision : $Revision: 870 $
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | This program is free software; you can redistribute it and/or modify |
|
||||||
|
// | it under the terms of the GNU General Public License as published by |
|
||||||
|
// | the Free Software Foundation |
|
||||||
|
// | |
|
||||||
|
// | This program is distributed in the hope that it will be useful, but |
|
||||||
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||||
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
||||||
|
// | General Public License for more details. |
|
||||||
|
// | |
|
||||||
|
// | You should have received a copy of the GNU General Public License |
|
||||||
|
// | along with this program; if not, write to the Free Software |
|
||||||
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
||||||
|
// | USA. |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
if (!defined('PHPWG_ROOT_PATH'))
|
||||||
|
{
|
||||||
|
die('Hacking attempt!');
|
||||||
|
}
|
||||||
|
|
||||||
|
$upgrade_description = 'drop table #categories_link';
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | New column |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
$query = '
|
||||||
|
DROP TABLE '.PREFIX_TABLE.'categories_link
|
||||||
|
;';
|
||||||
|
pwg_query($query);
|
||||||
|
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
// | End notification |
|
||||||
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
echo
|
||||||
|
"\n"
|
||||||
|
.'Table '.PREFIX_TABLE.'categories_link dropped'."\n"
|
||||||
|
;
|
||||||
|
?>
|
||||||
|
|
@ -41,17 +41,6 @@ CREATE TABLE `phpwebgallery_categories` (
|
||||||
KEY `categories_i2` (`id_uppercat`)
|
KEY `categories_i2` (`id_uppercat`)
|
||||||
) TYPE=MyISAM;
|
) TYPE=MyISAM;
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `phpwebgallery_categories_link`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `phpwebgallery_categories_link`;
|
|
||||||
CREATE TABLE `phpwebgallery_categories_link` (
|
|
||||||
`source` smallint(5) unsigned NOT NULL default '0',
|
|
||||||
`destination` smallint(5) unsigned NOT NULL default '0',
|
|
||||||
PRIMARY KEY (`source`,`destination`)
|
|
||||||
) TYPE=MyISAM;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `phpwebgallery_comments`
|
-- Table structure for table `phpwebgallery_comments`
|
||||||
--
|
--
|
||||||
|
|
@ -138,7 +127,6 @@ DROP TABLE IF EXISTS `phpwebgallery_image_category`;
|
||||||
CREATE TABLE `phpwebgallery_image_category` (
|
CREATE TABLE `phpwebgallery_image_category` (
|
||||||
`image_id` mediumint(8) unsigned NOT NULL default '0',
|
`image_id` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`category_id` smallint(5) unsigned NOT NULL default '0',
|
`category_id` smallint(5) unsigned NOT NULL default '0',
|
||||||
`is_storage` enum('true','false') default 'false',
|
|
||||||
PRIMARY KEY (`image_id`,`category_id`),
|
PRIMARY KEY (`image_id`,`category_id`),
|
||||||
KEY `image_category_i1` (`image_id`),
|
KEY `image_category_i1` (`image_id`),
|
||||||
KEY `image_category_i2` (`category_id`)
|
KEY `image_category_i2` (`category_id`)
|
||||||
|
|
@ -178,6 +166,7 @@ CREATE TABLE `phpwebgallery_images` (
|
||||||
`average_rate` float(5,2) unsigned default NULL,
|
`average_rate` float(5,2) unsigned default NULL,
|
||||||
`has_high` enum('true') default NULL,
|
`has_high` enum('true') default NULL,
|
||||||
`path` varchar(255) NOT NULL default '',
|
`path` varchar(255) NOT NULL default '',
|
||||||
|
`storage_category_id` smallint(5) unsigned default NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `images_i2` (`date_available`),
|
KEY `images_i2` (`date_available`),
|
||||||
KEY `images_i3` (`average_rate`),
|
KEY `images_i3` (`average_rate`),
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ $lang['Caddie'] = 'Caddie';
|
||||||
$lang['Categories authorized thanks to group associations'] = 'Categories authorized thanks to group associations';
|
$lang['Categories authorized thanks to group associations'] = 'Categories authorized thanks to group associations';
|
||||||
$lang['Categories manual order was saved'] = 'Categories manual order was saved';
|
$lang['Categories manual order was saved'] = 'Categories manual order was saved';
|
||||||
$lang['Categories ordered alphanumerically'] = 'Categories ordered alphanumerically';
|
$lang['Categories ordered alphanumerically'] = 'Categories ordered alphanumerically';
|
||||||
|
$lang['Category elements associated to the following categories: %s'] = 'Category elements associated to the following categories: %s';
|
||||||
$lang['Check for upgrade failed for unknown reasons.'] = 'Check for upgrade failed for unknown reasons.';
|
$lang['Check for upgrade failed for unknown reasons.'] = 'Check for upgrade failed for unknown reasons.';
|
||||||
$lang['Check for upgrade'] = 'Check for upgrade';
|
$lang['Check for upgrade'] = 'Check for upgrade';
|
||||||
$lang['Comments for all'] = 'Comments for all';
|
$lang['Comments for all'] = 'Comments for all';
|
||||||
|
|
@ -90,6 +91,8 @@ $lang['History'] = 'History';
|
||||||
$lang['Informations'] = 'Informations';
|
$lang['Informations'] = 'Informations';
|
||||||
$lang['Interface theme'] = 'Interface theme';
|
$lang['Interface theme'] = 'Interface theme';
|
||||||
$lang['Language'] = 'Language';
|
$lang['Language'] = 'Language';
|
||||||
|
$lang['Link all category elements to a new category'] = 'Link all category elements to a new category';
|
||||||
|
$lang['Link all category elements to some existing categories'] = 'Link all category elements to some existing categories';
|
||||||
$lang['Linked categories'] = 'Linked categories';
|
$lang['Linked categories'] = 'Linked categories';
|
||||||
$lang['Lock gallery'] = 'Lock gallery';
|
$lang['Lock gallery'] = 'Lock gallery';
|
||||||
$lang['Maintenance'] = 'Maintenance';
|
$lang['Maintenance'] = 'Maintenance';
|
||||||
|
|
@ -164,6 +167,7 @@ $lang['Validate'] = 'Validate';
|
||||||
$lang['Validation'] = 'Validation';
|
$lang['Validation'] = 'Validation';
|
||||||
$lang['Virtual categories movement'] = 'Virtual categories movement';
|
$lang['Virtual categories movement'] = 'Virtual categories movement';
|
||||||
$lang['Virtual categories to move'] = 'Virtual categories to move';
|
$lang['Virtual categories to move'] = 'Virtual categories to move';
|
||||||
|
$lang['Virtual category name'] = 'Virtual category name';
|
||||||
$lang['Webmaster cannot be deleted'] = 'Webmaster cannot be deleted';
|
$lang['Webmaster cannot be deleted'] = 'Webmaster cannot be deleted';
|
||||||
$lang['Yes'] = 'Yes';
|
$lang['Yes'] = 'Yes';
|
||||||
$lang['You are running on development sources, no check possible.'] = 'You are running on development sources, no check possible.';
|
$lang['You are running on development sources, no check possible.'] = 'You are running on development sources, no check possible.';
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ $lang['Caddie'] = 'Panier';
|
||||||
$lang['Categories authorized thanks to group associations'] = 'Catégories accessibles grâce à l\'appartenance aux groupes';
|
$lang['Categories authorized thanks to group associations'] = 'Catégories accessibles grâce à l\'appartenance aux groupes';
|
||||||
$lang['Categories manual order was saved'] = 'L\'ordre manuel des catégories a été sauvegardé';
|
$lang['Categories manual order was saved'] = 'L\'ordre manuel des catégories a été sauvegardé';
|
||||||
$lang['Categories ordered alphanumerically'] = 'Catégories ordonnées alphabético-numériquement';
|
$lang['Categories ordered alphanumerically'] = 'Catégories ordonnées alphabético-numériquement';
|
||||||
|
$lang['Category elements associated to the following categories: %s'] = 'Les éléments de la catégorie ont été associés aux catégories suivantes : %s';
|
||||||
$lang['Check for upgrade failed for unknown reasons.'] = 'La vérification de la dernière version sur le serveur a échouée pour une raison inconnue.';
|
$lang['Check for upgrade failed for unknown reasons.'] = 'La vérification de la dernière version sur le serveur a échouée pour une raison inconnue.';
|
||||||
$lang['Check for upgrade'] = 'Dernière version ?';
|
$lang['Check for upgrade'] = 'Dernière version ?';
|
||||||
$lang['Comments for all'] = 'Commentaires utilisateur pour tous';
|
$lang['Comments for all'] = 'Commentaires utilisateur pour tous';
|
||||||
|
|
@ -91,6 +92,8 @@ $lang['History'] = 'Historique';
|
||||||
$lang['Informations'] = 'Informations';
|
$lang['Informations'] = 'Informations';
|
||||||
$lang['Interface theme'] = 'Theme de l\'interface';
|
$lang['Interface theme'] = 'Theme de l\'interface';
|
||||||
$lang['Language'] = 'Langue';
|
$lang['Language'] = 'Langue';
|
||||||
|
$lang['Link all category elements to a new category'] = 'Associer tous les éléments de la catégorie à une nouvelle catégorie';
|
||||||
|
$lang['Link all category elements to some existing categories'] = 'Associer tous les éléments de la catégorie à des catégories existantes';
|
||||||
$lang['Linked categories'] = 'Catégories associées';
|
$lang['Linked categories'] = 'Catégories associées';
|
||||||
$lang['Lock gallery'] = 'Verrouiller la galerie';
|
$lang['Lock gallery'] = 'Verrouiller la galerie';
|
||||||
$lang['Maintenance'] = 'Maintenance';
|
$lang['Maintenance'] = 'Maintenance';
|
||||||
|
|
@ -165,6 +168,7 @@ $lang['Validate'] = 'Valider';
|
||||||
$lang['Validation'] = 'Validation';
|
$lang['Validation'] = 'Validation';
|
||||||
$lang['Virtual categories movement'] = 'Déplacement de catégories virtuelles';
|
$lang['Virtual categories movement'] = 'Déplacement de catégories virtuelles';
|
||||||
$lang['Virtual categories to move'] = 'Catégories virtuelles à déplacer';
|
$lang['Virtual categories to move'] = 'Catégories virtuelles à déplacer';
|
||||||
|
$lang['Virtual category name'] = 'Nom de la catégorie virtuelle';
|
||||||
$lang['Webmaster cannot be deleted'] = 'Le webmestre ne peut pas être supprimé';
|
$lang['Webmaster cannot be deleted'] = 'Le webmestre ne peut pas être supprimé';
|
||||||
$lang['Yes'] = 'Oui';
|
$lang['Yes'] = 'Oui';
|
||||||
$lang['You are running on development sources, no check possible.'] = 'Vous travaillez avec les sources de développement, impossible de vérifier la dernière version.';
|
$lang['You are running on development sources, no check possible.'] = 'Vous travaillez avec les sources de développement, impossible de vérifier la dernière version.';
|
||||||
|
|
|
||||||
|
|
@ -140,16 +140,16 @@
|
||||||
<form action="{F_ACTION}" method="POST" id="links">
|
<form action="{F_ACTION}" method="POST" id="links">
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{lang:Create a destination category}</legend>
|
<legend>{lang:Link all category elements to a new category}</legend>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{lang:virtual category name}</td>
|
<td>{lang:Virtual category name}</td>
|
||||||
<td><input type="text" name="virtual_name"></td>
|
<td><input type="text" name="virtual_name"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{lang:parent category}</td>
|
<td>{lang:Parent category}</td>
|
||||||
<td>
|
<td>
|
||||||
<select class="categoryList" name="parent">
|
<select class="categoryList" name="parent">
|
||||||
<!-- BEGIN category_option_parent -->
|
<!-- BEGIN category_option_parent -->
|
||||||
|
|
@ -160,7 +160,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p style="text-align:center;">
|
<p>
|
||||||
<input type="submit" value="{lang:Submit}" name="submitAdd" {TAG_INPUT_ENABLED}/>
|
<input type="submit" value="{lang:Submit}" name="submitAdd" {TAG_INPUT_ENABLED}/>
|
||||||
<input type="reset" value="{lang:Reset}" name="reset" />
|
<input type="reset" value="{lang:Reset}" name="reset" />
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -168,55 +168,26 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{lang:Source/destination links}</legend>
|
<legend>{lang:Link all category elements to some existing categories}</legend>
|
||||||
|
|
||||||
<table class="doubleSelect">
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>{lang:Categories}</td>
|
||||||
<td>
|
<td>
|
||||||
<h3>{lang:Destination categories}</h3>
|
<select class="categoryList" name="destinations[]" multiple="multiple" size="5">
|
||||||
<select class="categoryList" name="destination_true[]" multiple="multiple" size="30">
|
<!-- BEGIN category_option_destination -->
|
||||||
<!-- BEGIN destination_option_true -->
|
<option {category_option_destination.SELECTED} value="{category_option_destination.VALUE}">{category_option_destination.OPTION}</option>
|
||||||
<option {destination_option_true.SELECTED} value="{destination_option_true.VALUE}">{destination_option_true.OPTION}</option>
|
<!-- END category_option_destination -->
|
||||||
<!-- END destination_option_true -->
|
|
||||||
</select>
|
</select>
|
||||||
<p><input type="submit" value="»" name="destination_falsify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
<h3>{lang:Non destination categories}</h3>
|
|
||||||
<select class="categoryList" name="destination_false[]" multiple="multiple" size="30">
|
|
||||||
<!-- BEGIN destination_option_false -->
|
|
||||||
<option {destination_option_false.SELECTED} value="{destination_option_false.VALUE}">{destination_option_false.OPTION}</option>
|
|
||||||
<!-- END destination_option_false -->
|
|
||||||
</select>
|
|
||||||
<p><input type="submit" value="«" name="destination_trueify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table class="doubleSelect">
|
<p>
|
||||||
<tr>
|
<input type="submit" value="{lang:Submit}" name="submitDestinations" {TAG_INPUT_ENABLED}/>
|
||||||
<td>
|
<input type="reset" value="{lang:Reset}" name="reset" />
|
||||||
<h3>{lang:Source categories}</h3>
|
</p>
|
||||||
<select class="categoryList" name="source_true[]" multiple="multiple" size="30">
|
|
||||||
<!-- BEGIN source_option_true -->
|
|
||||||
<option {source_option_true.SELECTED} value="{source_option_true.VALUE}">{source_option_true.OPTION}</option>
|
|
||||||
<!-- END source_option_true -->
|
|
||||||
</select>
|
|
||||||
<p><input type="submit" value="»" name="source_falsify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
<h3>{lang:Non source categories}</h3>
|
|
||||||
<select class="categoryList" name="source_false[]" multiple="multiple" size="30">
|
|
||||||
<!-- BEGIN source_option_false -->
|
|
||||||
<option {source_option_false.SELECTED} value="{source_option_false.VALUE}">{source_option_false.OPTION}</option>
|
|
||||||
<!-- END source_option_false -->
|
|
||||||
</select>
|
|
||||||
<p><input type="submit" value="«" name="source_trueify" style="font-size:15px;" {TAG_INPUT_ENABLED}/></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue