Hi era again,
in the meantime I like this hack very much,
everything works already on my 'live' - site and my users use it frequently
there's only one remaining thing:
if you use the normal single upload,
the chosen category always falls back on the first category
after the user has uploaded one picture.
I mean if the user uploads one picture, the page loads again to tell that the upload was successfully,
and during this reload of the page, the chosen (sub-)category switches back to the main (first) category.
How can we overcome this ?
I thought the form variable 'categoryparent' is submitted somewhere with the 'post' method (?)
(from the <form> out of 'default_upload.php' ?)
So maybe we can read it out with a JRequest::getVar('categoryparent')
and put it as a default into the drop-down list (wich is generated by the method '$model->PGSelectList') ?
I tried something like this by modifying the 'view.html.php'
original:
Code: Select all
} elseif ($tmpl['operation'] == '') {
$tmpl['CategoryTree'] = $model->PGSelectList(0, 'categoryparent', 0);
$tmpl['catgoriesTree'] = $model->PGShowTree($SrtRows, 0);
$tmpl['catgoriesJS'] = $model->GetCategoriesInJS($SrtRows);
}
modified:
Code: Select all
} elseif ($tmpl['operation'] == '') {
$default = JRequest::getVar('categoryparent', 0, 'post', 'int');
$tmpl['CategoryTree'] = $model->PGSelectList($default, 'categoryparent', 0);
$tmpl['catgoriesTree'] = $model->PGShowTree($SrtRows, 0);
$tmpl['catgoriesJS'] = $model->GetCategoriesInJS($SrtRows);
}
but this didn't worked out...
Do you have any idea era ?