Skip to content

Commit

Permalink
Addgin author only filter for cat list bouton
Browse files Browse the repository at this point in the history
  • Loading branch information
micker committed Oct 5, 2020
1 parent f0cc7df commit f134b05
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions language/en-GB/en-GB.mod_flexiadmin.ini
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,6 @@ FLEXI_ADMIN_BLANK="New page"
FLEXIA_ADMIN_DISPLAY_LINE_DESC=""
FLEXI_ADMIN_PRIVACY="Privacy Tools"
FLEXI_ADMIN_LOGS="User logs"

FLEXI_ADMIN_DISPLAY_AUTHOR_ONLY="Display author item only"
FLEXI_ADMIN_DISPLAY_AUTHOR_ONLY_DESC="Set yes to list only user connected items"
2 changes: 2 additions & 0 deletions language/fr-FR/fr-FR.mod_flexiadmin.ini
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,5 @@ FLEXI_ADMIN_ICONLINK_ICONSINDEX="%s - %s sur %s icônes"
FLEXI_ADMIN_ICONLINK_SEARCHTEXT="Recherche"
FLEXI_ADMIN_PRIVACY="Outil confidencialité"
FLEXI_ADMIN_LOGS="Logs utilisateurs"
FLEXI_ADMIN_DISPLAY_AUTHOR_ONLY="Auteur seulement"
FLEXI_ADMIN_DISPLAY_AUTHOR_ONLY_DESC="Affiche seulement les contenus de l'utilisateur connecté"
5 changes: 5 additions & 0 deletions models/forms/addcatbutton.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
multiple="false"
hide_default="true"
hide_none="true" />
<field name="displayauthoronly" label="FLEXI_ADMIN_DISPLAY_AUTHOR_ONLY" description="FLEXI_ADMIN_DISPLAY_AUTHOR_ONLY_DESC" type="radio" default="0" class="btn-group btn-group-yesno">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

<field name="button_lang"
type="contentlanguage"
label="FLEXI_ADMIN_LANG"
Expand Down
15 changes: 12 additions & 3 deletions tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@
$hiddebuttonprivacy = $params->get('hiddebuttonprivacy' , '1');
$hiddebuttonlogs = $params->get('hiddebuttonlogs' , '1');

//freetab
$freenametab = $params->get('freenametab', 'FLEXI_ADMIN_FREE_TAB_NAME' );
$displayauthoronly = $params->get('displayauthoronly' , '0');

$user = JFactory::getUser();

//freetab
$freenametab = $params->get('freenametab', 'FLEXI_ADMIN_FREE_TAB_NAME' );


jimport( 'joomla.application.component.controller' );
// Check if component is installed
Expand Down Expand Up @@ -178,7 +180,14 @@
<?php endforeach; ?>
<?php $list_catbuttons = $params->get('add_cat_button');
foreach( $list_catbuttons as $list_catbuttons_idx => $cat_button ) :?>
<a href="index.php?option=com_flexicontent&view=items&filter_cats=<?php echo $cat_button->filtercatids; ?>&filter_lang=<?php echo $cat_button->button_lang; ?>&filter_type=<?php echo $cat_button->button_type;?>" >

<?php if ($cat_button->displayauthoronly == 1){
$filter_byauthor ='&amp;filter_author='.$user->id;
} else {
$filter_byauthor='';
}
?>
<a href="index.php?option=com_flexicontent&view=items&filter_cats=<?php echo $cat_button->filtercatids; ?>&filter_lang=<?php echo $cat_button->button_lang; ?><?php echo $filter_byauthor; ?>&filter_type=<?php echo $cat_button->button_type;?>" >
<button type="button" class="btn btn-default btn-lg itemlist">
<i class="fa <?php echo $cat_button->iconbutton; ?> <?php echo $iconsize; ?> "></i><br/>
<?php echo JText::_($cat_button->namecatfilter); ?>
Expand Down

0 comments on commit f134b05

Please sign in to comment.