- Posts: 26
COMMUNITY FORUM
[Hack] hide options for front-enduser article form
- spock
-
Topic Author
- Offline
- Junior Member
based in Joomla default user groups
Ideas for integrate on K2 user GRoups?
comment please, this is my 1º participattion in this community
sorry for my english
download from
www.ruizmasa.com/centro-de-ayuda.html
Please Log in or Create an account to join the conversation.
- FeSys
-
- Offline
- Elite Member
- Posts: 262
I love you.... Superior work, been asking for it in the community long time.
May I Ask you how to hide Tabs too according to users level or Category selection?
Thank you for sharing...Keep cool ideas please.
BTW: you have clean nice beautiful website.
Please Log in or Create an account to join the conversation.
- spock
-
Topic Author
- Offline
- Junior Member
- Posts: 26
hidden apps tabs is identical process
change in config.xml
<param menu="hide" name="showImageTab" .....<param menu="hide" name="showImageGalleryTab" ....<param menu="hide" name="showVideoTab" .... <param menu="hide" name="showExtraFieldsTab" ..... <param menu="hide" name="showAttachmentsTab" .....
can follow this little tutorial in Spanish remember to hide for joomla user level need to include this syntax in xml (in sample is yes/no)
<param menu="hide" name="showXXXXXXXX" type="list" default="18" label="showXXXXX" description=""> <option value="26">none</option> <option value="25">Super Administrator</option> <option value="24">Administrator</option> <option value="23">Manager</option> <option value="21">Publisher</option> <option value="20">Editor</option> <option value="19">Author</option> <option value="18">Registered</option> <option value="1">all</option> </param>
sorry 4 my english
Please Log in or Create an account to join the conversation.
- spock
-
Topic Author
- Offline
- Junior Member
- Posts: 26
Complete sample for image tab
in config.xml change
<param menu="hide" name="showImageTab" type="radio" default="1" label="Image tab on edit form" description=""> <option value="0">Hide</option> <option value="1">Show</option> </param>
for
<param menu="hide" name="showImageTab" type="list" default="18" label="Image tab on edit form" description=""> <option value="26">none</option> <option value="25">Super Administrator</option> <option value="24">Administrator</option> <option value="23">Manager</option> <option value="21">Publisher</option> <option value="20">Editor</option> <option value="19">Author</option> <option value="18">Registered</option> <option value="1">all</option> </param>
in from.php change (example for image tab)
<?php if ($this->params->get('showImageTab')): ?><li id="tabImage"><a href="#"><?php echo JText::_('Image'); ?></a></li><?php endif; ?>
for
<?php if ($access > ($this->params->get('showImageTab')-1)){ ?>
<li id="tabImage"><a href="#"><?php echo JText::_('Image'); ?></a></li>
<?php } ?>
and other tabs identical process
remenber maintain the same form field names in this sample showImageTab
Please Log in or Create an account to join the conversation.
- FeSys
-
- Offline
- Elite Member
- Posts: 262
That's sound good for me.. I appreciate your replay.
Keep good and flexible idea please
Please Log in or Create an account to join the conversation.
- juju
-
- Offline
- Premium Member
- Posts: 119
Please Log in or Create an account to join the conversation.
- juju
-
- Offline
- Premium Member
- Posts: 119
Parse error: syntax error, unexpected $end in C:\Users\Administrateur - TIC\xampp\htdocs\site_temp\components\com_k2\views\item\tmpl\form.php on line 882
I don't find the problem, could you help me ?
Please Log in or Create an account to join the conversation.
- spock
-
Topic Author
- Offline
- Junior Member
- Posts: 26
Please Log in or Create an account to join the conversation.
- juju
-
- Offline
- Premium Member
- Posts: 119
Please Log in or Create an account to join the conversation.
- spock
-
Topic Author
- Offline
- Junior Member
- Posts: 26
Please Log in or Create an account to join the conversation.
- juju
-
- Offline
- Premium Member
- Posts: 119
Parse error: syntax error, unexpected $end in C:\Users\Administrateur - TIC\xampp\htdocs\site_temp\components\com_k2\views\item\tmpl\form.php on line 882
I have the last version of K2 : 2.4.1, I just put your form.php file and your config.xml file, that's all;
I'll put you a link to a test website this afternoon ;)
Please Log in or Create an account to join the conversation.
- spock
-
Topic Author
- Offline
- Junior Member
- Posts: 26
Please Log in or Create an account to join the conversation.
- juju
-
- Offline
- Premium Member
- Posts: 119
Finally, I modify manually the file form.php, without choice in admin parameters...
Thx ;)
Please Log in or Create an account to join the conversation.
- lili
-
- Offline
- New Member
- Posts: 14
I don't understand how this hack works. Do I need to do something else than overwrite form.php and config.xml? Please help! Thank you!
Please Log in or Create an account to join the conversation.
- lili
-
- Offline
- New Member
- Posts: 14
But nothing happens. I actually don't understand excatly how this hack works. Normally, after using the hack, when you go on a user group, you have the choice of front-editing? For me, nothing has changed. I have tried several time, but it fails.
The form PHP to change, is it the one in admistrator/component/com k2, or only in website component/com k2?
Here what I have change in the code:
Config (in administrator)
<param menu="hide" name="showImageGalleryTab" type="radio" default="1" label="Image gallery tab on edit form" description=""> <option value="0">Hide</option> <option value="1">Show</option> </param>
To
<param menu="hide" name="showImageGalleryTab" type="list" default="18" label="Image gallery tab on edit form" description=""><option value="26">none</option> <option value="25">Super Administrator</option> <option value="24">Administrator</option> <option value="23">Manager</option> <option value="21">Publisher</option> <option value="20">Editor</option> <option value="19">Author</option> <option value="18">Registered</option> <option value="1">all</option> </param>
And form (not in administrator, directly in component):
<?php if ($this->params->get('showImageGalleryTab')): ?> <li id="tabImageGallery"><a href="#"><?php echo JText::_('Image Gallery'); ?></a></li> <?php endif; ?>
To
<?php if ($access >($this->params->get('showImageGalleryTab')-1)): ?> <li id="tabImageGallery"><a href="#"><?php echo JText::_('Image Gallery'); ?></a></li> <?php endif; ?>
Thank you for the help, please!
Please Log in or Create an account to join the conversation.