Română (România)English (United Kingdom)



 
The support for all extensions was moved to jVitals.com.

Please post there the new questions or suggestions you have with them.

This forum was set to be read-only so the information in it is still available.

If you use aiContactSafe, please post a rating and a review at the Joomla! Extensions Directory.

You can now also join aiContactSafe Fan Club on Joomla! People
http://people.joomla.org/groups/viewgroup/813-aiContactSafe+Fan+Club.html

integration in third party component

integration in third party component

Hi,

I like your component and its feature richness. I am planning to integrate acicontact into another component, com_properties for contact and recommendition forms.
I only want to have some simple forms containing name, eamil, text (html stripped out) and captcha.
Formfields should be prefilled with some values of com_properties.
Can you give me some quick hint where to get started with this?

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

You can just use the plugin aiContactSafeForm ( you can install it from the control panel of aiContactSafe ) to place the contact form with predefined values in any page that executes the content plugins of Joomla.
Or you can look into the way the plugin is working to implement something similar in the other component.
Let me know if you have problems with this. It should be fairly easy to do.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

Hi Alex,

thanks for your fast respond.
Do I understand that my component needs to include something like this in some document to load the contactform?

Code:

 {aicontactsafeform pf=1}

Do I need to trigger

Code:

onPrepareContent

for this to work?

I also need Integration in SOBI2 and I've seen that your component natively support SOBI2 Form Fields. Is it possible to add a form in the Detail or VCard View this way? Do I still benefit from aiContactSafe filtering/captcha facility?

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"tekknokrat":6pbhprjl wrote:


Do I understand that my component needs to include something like this in some document to load the contactform?

Code:

 {aicontactsafeform pf=1}

Yes. Or you can take a look what code is generating the plugin aiContactSafeForm and add that code yourself.

"tekknokrat":6pbhprjl wrote:


Do I need to trigger

Code:

onPrepareContent

for this to work?

Only if you use the code "{aicontactsafeform pf=1}". If you add the tags generated by the plugin ( as I suggested above ) you don't need to trigger this.

"tekknokrat":6pbhprjl wrote:


I also need Integration in SOBI2 and I've seen that your component natively support SOBI2 Form Fields. Is it possible to add a form in the Detail or VCard View this way?

That fact that aiContactSafe supports some SOBI2 fields have nothing to do with the way the form can be intagrated in SOBI2. You can use the same procedure as above ( either the plugin and trigger onPrepareContent or adding the form generated by the plugin in SOBI's template ).

"tekknokrat":6pbhprjl wrote:


Do I still benefit from aiContactSafe filtering/captcha facility?

Yes.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

I want to insert a form in the sobi template. Can I enter in the field SOBI2 only the entry's name which is inserted into the form?
ex:
name entry: House 10

in detail House 10 i want a form with in field sobi2 only "house 10" (not all entries).
How can i do it ?

flanders
useravatar
Offline
3 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

Sorry, I'm not sure what you mean.
There are no parameters to alter the way the sobi entries are presented for selection.
You need to modify the php code of aiContactSafe to do that.
If you have specific requests I could implement them for you but I can't do it for free. Sorry.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

Hi,

integration of the plugin in sobi2 works fine. Thanks!

I noticed for the plugin aicontactsafelink that when I remove some fields from the form for my template with aiContactSafe (pre)generated contents they were not neccessary to make the form work. Can you explain for what these fields are used internally?

- name="bc64c513d3d26ae2689c669be32adabb"
- name="aiContactSafeCall_3_213759588"
- name="dt"

Can I make the contact form to *only* send messages to the contact of e.g. the custom field aics_recipient ? So that no messages are sent to the global joomla address?

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"flanders":fp379msi wrote:

I want to insert a form in the sobi template. Can I enter in the field SOBI2 only the entry's name which is inserted into the form?
ex:
name entry: House 10

in detail House 10 i want a form with in field sobi2 only "house 10" (not all entries).
How can i do it ?

Hi flanders,

when using the plugin aicontactform you can use the parameters to prefill the content. You can also add content to hidden, or r/o fields

I use something like this for my sobi template:

Code:


  $contactForm->text = '{aicontactsafeform '|aics_articletitle=' . $fieldsObjects['field_contact_link']->data . ' (' . $fieldsObjects['field_contact_person']->data . ')'
             . '|aics_recipient=' . $fieldsObjects['field_email'] 
                     . '|aics_name=' . $contact['name']
                     . '|aics_email=' . $contact['email']
                     . '|aics_subject=' . $contact['subject']
                     . '|aics_message=' . $contact['message']                                     
                     . '|pf=3}';

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"tekknokrat":6dxygbb5 wrote:


integration of the plugin in sobi2 works fine. Thanks!

Happy to hear that.

"tekknokrat":6dxygbb5 wrote:


I noticed for the plugin aicontactsafelink that when I remove some fields from the form for my template with aiContactSafe (pre)generated contents they were not neccessary to make the form work. Can you explain for what these fields are used internally?

I need the entire tag to identify what it is doing, not only the name.

"tekknokrat":6dxygbb5 wrote:


- name="bc64c513d3d26ae2689c669be32adabb"

I'm guessing this is the token generated by Joomla to make sure the information in the form is not set from an outside script.

"tekknokrat":6dxygbb5 wrote:


- name="aiContactSafeCall_3_213759588"

This seams to be the name of the form.

"tekknokrat":6dxygbb5 wrote:


- name="dt"

This tells the contact form that has to read something from _POST.

"tekknokrat":6dxygbb5 wrote:


Can I make the contact form to *only* send messages to the contact of e.g. the custom field aics_recipient ? So that no messages are sent to the global joomla address?

Yes. Make sure you deactivate the field "Always send to this email address" in the profile and set "aics_recipient" to be an Email field type and activate "Send message" parameter on it.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

Hi Alex,

It seems I have an issue with email addresses at all.
I have tested with hidden email and now also with the email field itself.
The content that is inserted by the plugin by default is:

Diese E-Mail-Adresse ist gegen Spambots geschützt! Sie müssen JavaScript aktivieren, damit Sie sie sehen können.       

That means:

This e-mail address is being protected from spambots! You need JavaScript enabled to view it.

Is this a option within aiContactSafe to obfuscate email or some other content plugin I have to look for?

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"tekknokrat":hj6r7hs4 wrote:


Is this a option within aiContactSafe to obfuscate email or some other content plugin I have to look for?

I'm guessing you've added that email in an article or some other content on which the content plugins are runned on and yes, there is a plugin in Joomla that is doing that.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

Ok, i've got the plugin cloakplugin and disabled it. Although I see security concerns for other article contents. Is there another way to trigger your plugin without loading plugin content?

My code currently looks:

Code:

 JPluginHelper::importPlugin( 'content' );  
$contactForm->text = '{aicontactsafelink text=' . $fieldsObjects['field_contact_link']->label
                       . '|aics_articletitle=' . $fieldsObjects['field_contact_link']->data . ' (' .     $fieldsObjects['field_contact_person']->data . ')'
                      . '|aics_recipient=' . $fieldsObjects['field_email']->data 
                     . '|aics_subject=' . $cfContent['subject']
                     . '|aics_message=' . $cfContent['message']                                     
                     . '|pf=3}';

        $dispatcher = & JDispatcher::getInstance();
          $params = new JParameter('');
          /*
          * Remember to enable the plugin
          */
          $dispatcher->trigger('onPrepareContent', array($contactForm, $params, $index));

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"tekknokrat":2qe1s8kk wrote:

Ok, i've got the plugin cloakplugin and disabled it. Although I see security concerns for other article contents.

You right. This is a bad idea. I didn't suggested using it.

"tekknokrat":2qe1s8kk wrote:

Is there another way to trigger your plugin without loading plugin content?

I see you have the emails in the database. Why not use the "SOBI2 Entries" type aiContactSafe is offering?

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"Alex":1ny9i004 wrote:

"tekknokrat":1ny9i004 wrote:

Ok, i've got the plugin cloakplugin and disabled it. Although I see security concerns for other article contents.

You right. This is a bad idea. I didn't suggested using it.

"tekknokrat":1ny9i004 wrote:

Is there another way to trigger your plugin without loading plugin content?

I see you have the emails in the database. Why not use the "SOBI2 Entries" type aiContactSafe is offering?

Regarding the sobi entries the description in field manager states:

# "SOBI2 Entries"
- the list of entries in SOBI2 from which the sender can choose the destination of his message

I want to use the sobi email entry hidden in the formular.

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"tekknokrat":2v8hkwfj wrote:

I want to use the sobi email entry hidden in the formular.

Of course the emails are hidden. smile
I suggest testing it and let me know what you think.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"Alex":3pvq32hp wrote:

"tekknokrat":3pvq32hp wrote:


Do I understand that my component needs to include something like this in some document to load the contactform?

"tekknokrat":3pvq32hp wrote:


Do I need to trigger

Code:

onPrepareContent

for this to work?

Only if you use the code "{aicontactsafeform pf=1}". If you add the tags generated by the plugin ( as I suggested above ) you don't need to trigger this.

"tekknokrat":3pvq32hp wrote:


I also need Integration in SOBI2 and I've seen that your component natively support SOBI2 Form Fields. Is it possible to add a form in the Detail or VCard View this way?

That fact that aiContactSafe supports some SOBI2 fields have nothing to do with the way the form can be intagrated in SOBI2. You can use the same procedure as above ( either the plugin and trigger onPrepareContent or adding the form generated by the plugin in SOBI's template ).

"tekknokrat":3pvq32hp wrote:


Do I still benefit from aiContactSafe filtering/captcha facility?

Yes.

Regarding the statement you made...

... adding the form generated by the plugin in SOBI's template

I played a little with integrating the form directly in my template. Adding the token was no problem with Joomla's API.
It was possible to open the contact form but I did not get any predefined values there. I assume it is because some of the form name needs to be generated by aiContactSafe itself.

The form I created looked like this:

Code:

                        <form name="aiContactSafeCall" id="aiContactSafeCall" action="index.php?option=com_aicontactsafe&sTask=message&task=message&pf=3" method="post">
                            <a class="button" href="index.php?option=com_aicontactsafe&sTask=message&task=message&pf=3" onclick="document.aiContactSafeCall.submit();return false;">
                                <span><?php echo $fieldsObjects['field_contact_link']->label . ' (' . $fieldsObjects['field_contact_person']->data . ')'; ?></span>
                            </a>
                            <input type="hidden" name="dt" id="dt" value="1" />
                            <input type="hidden" name="back_button" id="back_button" value="1" />
                            <input type="hidden" name="lang" id="lang" value="de" />
                            <input type="hidden" name="return_to" id="return_to" value="index.php?option=com_sobi2lang=<?php echo $lang->tag; ?>" />
                            <input type="hidden" name="aics_recipient" id="aics_recipient" value="<?php echo $fieldsObjects['field_email']->data; ?>" />
                            <input type="hidden" name="aics_subject" id="aics_subject" value="<?php echo $cfContent['subject']; ?>" />
                            <input type="hidden" name="aics_message" id="aics_message" value="<?php echo $cfContent['message']; ?>" />
                            <input type="hidden" name="pf" id="pf" value="3" />
                            <input type="hidden" name="action" id="action" value="index.php?option=com_aicontactsafe&sTask=message&task=message&pf=3" />
                            <?php echo JHTML&#58;&#58;_( 'form.token' ); ?>                       
                        </form>

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"Alex":132b4v8m wrote:

"tekknokrat":132b4v8m wrote:

I want to use the sobi email entry hidden in the formular.

Of course the emails are hidden. smile
I suggest testing it and let me know what you think.

Sorry,
my expression. I don't want a selectable recipient box. i only need a hidden input field for recipient email.

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"tekknokrat":3d9r8epe wrote:

Sorry,
my expression. I don't want a selectable recipient box. i only need a hidden input field for recipient email.

So hide it with CSS. Why complicate things?

And I'm sorry but I can't test your form. If you use exactly the form generated by aiContactSafeLink should work.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"Alex":sfdy2hrb wrote:

"tekknokrat":sfdy2hrb wrote:

Sorry,
my expression. I don't want a selectable recipient box. i only need a hidden input field for recipient email.

So hide it with CSS. Why complicate things?

And I'm sorry but I can't test your form. If you use exactly the form generated by aiContactSafeLink should work.

I did a test with it and it give me a selection box where the recipient can be selected. The first selected entry is the sobi listing entry the form was submitted from.
So if it works that way I could use it as an alternative for the recipient hidden field, you're right. Otherwise I still need to add subject and text and phone number on own my own so there's not more effort with assigning the $fieldsObjects['field_emai'] data.

Regarding the form I can live with the plugin now that I got the CSS of my contact link customised to my needs.
Thanks for your fast responses on that. Do you think an aiContactSafe Sobi-Plugin would make sense?

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"tekknokrat":rd3i6ouq wrote:


I did a test with it and it give me a selection box where the recipient can be selected. The first selected entry is the sobi listing entry the form was submitted from.
So if it works that way I could use it as an alternative for the recipient hidden field, you're right. Otherwise I still need to add subject and text and phone number on own my own so there's not more effort with assigning the $fieldsObjects['field_emai'] data.

You could also add "display:none;" into the CSS for that field. I didn't test it but the form should be correctly submitted and the user will not be able to modify the selected value.

"tekknokrat":rd3i6ouq wrote:


Regarding the form I can live with the plugin now that I got the CSS of my contact link customised to my needs.
Thanks for your fast responses on that.

Happy to help. smile

"tekknokrat":rd3i6ouq wrote:


Do you think an aiContactSafe Sobi-Plugin would make sense?

Interesting idea. Didn't thought about it. I'll add it in my to-do list, but I'm not sure when I'll start working on it.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

Hi Alex,

again a small question regarding the plugin integration.
Is it possible to prefill the redirect url for the aicontactsafeformplugin? If not it would be great to make the redirect_url for the profile a aicontact safe field so that it can be used via plugin parameter. What do you think about that?
The same would be great for the contact information text. So these are fields which can be customised via backend by a joomla admin or prefilled via plugin. Hope you understand what I mean...

Regarding the captcha. I have installed the multipurpose captcha so that we now can use math captcha. Works fine only a small issue is that the
translation of the text "Security question" did not worked. The language file I created is called language/es-ES/es-ES.plg_content_captcha.ini with content "SECURITY QUESTION=Si resolver el problema de aritmética siguiente" . Do you have any idea why it does not accept the translation?

EDIT: Just another small issue. The language of the form, generated by the plugin, is correct only for all non-javascript stuff. E.g the word counter beneath the message is another language and also the native captcha. Last one was a reason for me to try with content_captcha. Any idea?

Best,
Gunnar

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

Hello,

"tekknokrat":6yffn6s1 wrote:


Is it possible to prefill the redirect url for the aicontactsafeformplugin?

Yes. You can use the parameter "return_to=http://www.google.ro/firefox" in the plugin code.

"tekknokrat":6yffn6s1 wrote:


The same would be great for the contact information text.

Sorry, this is not possible, but you can use separator fields for this.

"tekknokrat":6yffn6s1 wrote:


Regarding the captcha. I have installed the multipurpose captcha so that we now can use math captcha. Works fine only a small issue is that the
translation of the text "Security question" did not worked. The language file I created is called language/es-ES/es-ES.plg_content_captcha.ini with content "SECURITY QUESTION=Si resolver el problema de aritmética siguiente" . Do you have any idea why it does not accept the translation?

The English file for that plugin is this "en-GB.captcha.ini". I know it doesn't respect the Joomla standard but it's not my work so there's nothing I can do about it.

"tekknokrat":6yffn6s1 wrote:


EDIT: Just another small issue. The language of the form, generated by the plugin, is correct only for all non-javascript stuff. E.g the word counter beneath the message is another language and also the native captcha. Last one was a reason for me to try with content_captcha. Any idea?

Make sure you installed all the language files of aiContactSafe. You can check this with the button from the control panel of aiContactSafe ( Check language files ).
You can see the form working correctly ( even with the plugin ) here:
<!-- m --><a class="postlink" href="http://ai.algis.ro/">http://ai.algis.ro/</a><!-- m -->

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"Alex":3ggnzouw wrote:

Hello,

"tekknokrat":3ggnzouw wrote:


Is it possible to prefill the redirect url for the aicontactsafeformplugin?

Yes. You can use the parameter "return_to=http://www.google.ro/firefox" in the plugin code.

Works great, thanks!

"Alex":3ggnzouw wrote:


The English file for that plugin is this "en-GB.captcha.ini". I know it doesn't respect the Joomla standard but it's not my work so there's nothing I can do about it.

Seems it tooks the language file from the component. I just added the line in de-DE.com_aicontactsafe.ini:

Code:

SECURITY QUESTION=Lösen Sie die Matheaufgabe.

and it works.

Is it possible to load the captcha plugins language from within your component/plugin? Perhaps not because of it's non-compatible naming...


Regarding these entries in language file:

Code:


MAXIMUM CHARACTERS EXCEEDED=Maximale Anzahl Zeichen erreicht.
MAXIMUM CHARACTERS EXCEEDED !=Maximum characters exceeded !

Are both of them used?

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"tekknokrat":1vw2ti4a wrote:


Seems it tooks the language file from the component. I just added the line in de-DE.com_aicontactsafe.ini:

Code:

SECURITY QUESTION=Lösen Sie die Matheaufgabe.

and it works.

It's better to use their language file, in my opinion.

"tekknokrat":1vw2ti4a wrote:


Is it possible to load the captcha plugins language from within your component/plugin? Perhaps not because of it's non-compatible naming...

Yes, but I don't think it's a good idea. You can use this php code:

Code:

$language =& JFactory&#58;&#58;getLanguage();
$language->load('captcha');

"tekknokrat":1vw2ti4a wrote:


Regarding these entries in language file:

Code:


MAXIMUM CHARACTERS EXCEEDED=Maximale Anzahl Zeichen erreicht.
MAXIMUM CHARACTERS EXCEEDED !=Maximum characters exceeded !

Are both of them used?

Sorry don't know exactly. Please don't make go search for this. smile
Please refer to the English language file to see the current text used.

Alex Dobrin
useravatar
Offline
5886 Posts
User info in posts
Administrator has disabled public posting

Re: integration in third party component

"Alex":141tgkoz wrote:

"tekknokrat":141tgkoz wrote:


Seems it tooks the language file from the component. I just added the line in de-DE.com_aicontactsafe.ini:

Code:

SECURITY QUESTION=Lösen Sie die Matheaufgabe.

and it works.
It's better to use their language file, in my opinion.

Translation issue where caused by sh404 & Joomfish. Now they are resolved and I can put translation also in plg_content_captcha.ini .

Gunnar Thielebein
useravatar
Offline
15 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
2281
Total Polls:
0
Total Posts:
10380
Dormant:
User Info:
 
Total Users:
60165
Newest User:
Piobbipsy
Members Online:
0
Guests Online:
47

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked