Hello "Jan", It again Arthur, from the same country

).
I want that you have added one more solution in the following version Phoca Gallery, and mark is -
[Improvement]
Display selected categories
What it is necessary to do ?!:
1) File www\administrator\components\com_phocagallery\config.xml
Code: Select all
<param name="show_categories" type="phocatextarea" rows="2" cols="26" default="" label="Show Categories" description="Show Categories DESC" />
warning - It is impossible to fill fields in common (Hide categories and Show categories )
"I can't block one field in the administrative panel when fill another" - But it is not compulsory!
2) www\components\com_phocagallery\views\categories\view.html.php
Add after 50 line
Code: Select all
$showCatArray = explode( ';', trim( $params->get( 'show_categories', '' ) ) );
Add on 131 line new condition:
Code: Select all
// Set only selected category ID
//"!empty$showCatArray[0]" - Because "!empty$hideCatArray" - I consider it is not correct .
if (!empty($showCatArray[0]) && is_array($showCatArray)) {
$unSetHCA = 0;
foreach ($showCatArray as $valueHCA) {
if((int)trim($valueHCA) == $items[$key]->id) {
$unSetHCA = 0;
$unSet = 0;
break;
} else {
$unSetHCA = 1;
$unSet = 1;
}
}
if ($unSetHCA == 1) {
unset($items[$key]);
continue;
}
}
3) Edit Lang. file :
To add at the very bottom
Code: Select all
SHOW CATEGORIES=Show Categories
SHOW CATEGORIES DESC=Set categories (categories id), which will be displayed in the categories tree, other categories will be hidden (in Categories View). Separate each id with semicolon (;)