Questions about Payment Form extension

Menu Item - FORMS LIST

  • Michael Deosdade
  • Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 2 months ago #13571 by Michael Deosdade
Menu Item - FORMS LIST was created by Michael Deosdade
I want to use the FORMS LIST menu option, but i only want to show certain forms, not my entire list. Is this possible?

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #13588 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Menu Item - FORMS LIST
Hi

It is not possible by default. However, if you can edit the code alitle to make it works. The steps are :

1. Open the file components/com_pmform/models/forms.php

2. Find the code below (At the bottom of file) :
Code:
function _buildContentWhere() { $where = array() ; $user = & JFactory::getUser() ; $where[] = ' a.published = 1 ' ; $where[] = ' (a.publish_up = "0000-00-00 00:00:00" OR a.publish_up <= NOW())' ; $where[] = ' (a.publish_down = "0000-00-00 00:00:00" OR a.publish_down >= NOW())' ; if (version_compare(JVERSION, '1.6.0', 'ge')) { $where[] = ' a.access IN ('.implode(',', $user->getAuthorisedViewLevels()).')' ; } else { $aid = $user->get('aid', 0); $where[] = ' a.access <= '.$aid ; } $where = ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' ); return $where; }

3. Change it to :
Code:
function _buildContentWhere() { $where = array() ; $user = & JFactory::getUser() ; $where[] = ' a.published = 1 ' ; $where[] = ' (a.publish_up = "0000-00-00 00:00:00" OR a.publish_up <= NOW())' ; $where[] = ' (a.publish_down = "0000-00-00 00:00:00" OR a.publish_down >= NOW())' ; if (version_compare(JVERSION, '1.6.0', 'ge')) { $where[] = ' a.access IN ('.implode(',', $user->getAuthorisedViewLevels()).')' ; } else { $aid = $user->get('aid', 0); $where[] = ' a.access <= '.$aid ; } $where[] = ' a.id IN (1,2,3,4,5)' ; $where = ( count( $where ) ? ' WHERE '. implode( ' AND ', $where ) : '' ); return $where; }

Please note that I added line of code $where[] = ' a.id IN (1,2,3,4,5)' ; . Just replace 1,2,3,4,5 with IDs of the forms you wants to show (comma separated) and It will work as expected !

Please let me know if you need more help !

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc