Modules Development

Discussion about eFront modules. You may suggest new modules here or post issues with current ones. This forum also offers suggestions and best practices for module developers.

Re: Modules Development

Postby Charles Mead » Tue Mar 13, 2012 3:44 pm

Hi, Currently developing a module for the eFront Enterprise platform, and I would like to make a link for my module on the 'Tools' menu to the right of the 'Professor' and 'Student' pages, however I cannot get any link to show up at all. My code is as follows, please advise.

Code: Select all

public function getSidebarLinkInfo() {
      
   $currentUser = $this -> getCurrentUser(); // professors should see a link in the lessons menu
      
      if ($currentUser -> getType() == "professor") {
         
         $moduleLinkProfessor = array( 'id' => "MyModule123",
                                'title' => "Module Link",
                                'image' => $this -> moduleBaseLink . 'images/logo.jpg',
                                'eFrontExtensions' => '0',
                                'link' => $this -> moduleBaseUrl
                              );
         
         return array('tools' => array($moduleLinkProfessor));
         
      }elseif($currentUser -> getType() == "student"){
      
         $moduleLinkStudent = array( 'id' => "MyModule123",
                              'title' => "Module Link",
                              'image' => $this -> moduleBaseLink . 'images/logo.jpg',
                              'eFrontExtensions' => '0',
                              'link' => $this -> moduleBaseUrl
                           );
         
         return array('tools' => array($moduleLinkStudent));
      
      }
      
   }



No Links show on either of the 'Tools' menu's // am I looking at the right place? my URL bar shows :

http://...../www/professor.php?ctg=control_panel

and the same for student. am I right in thinking the toolbar on the right side of this page is the place where this would show, because thats where I want it! Why is it not working?!

Thanks in advance.
Charles Mead
 
Posts: 5
Joined: Tue Mar 13, 2012 2:24 pm

Re: Modules Development

Postby y.sulistya » Tue Mar 13, 2012 3:54 pm

Hello,
Do you want to show this module in the Tools sidebar menu? Is it so, try this:
Code: Select all
return array('tools' => array('Module Link');
Blessings & Peace,
Yudi Sulistya

---
Database administrator & programmer at Faculty of Psychology • Airlangga University
Programmer at Cyber Campus • Airlangga University
Need personal help? contact me : yudi.sulistya[at]gmail.com
User avatar
y.sulistya
 
Posts: 717
Joined: Mon Apr 13, 2009 12:02 pm
Location: Surabaya, Indonesia

Re: Modules Development

Postby Charles Mead » Tue Mar 13, 2012 4:04 pm

I'm sorry, i must not understand fully. what will that do? apart from missing a ')' from the end of the array, there is no link information in there, and its pretty much EXACTLY what i am returning already and it is not working... I really don't understand.
Charles Mead
 
Posts: 5
Joined: Tue Mar 13, 2012 2:24 pm

Re: Modules Development

Postby y.sulistya » Tue Mar 13, 2012 4:17 pm

I'm sorry, there is a worng code I write before, try this:
Code: Select all
return array('tools' => array('Module Link'));

Note: Module Link is the name of your module.
Blessings & Peace,
Yudi Sulistya

---
Database administrator & programmer at Faculty of Psychology • Airlangga University
Programmer at Cyber Campus • Airlangga University
Need personal help? contact me : yudi.sulistya[at]gmail.com
User avatar
y.sulistya
 
Posts: 717
Joined: Mon Apr 13, 2009 12:02 pm
Location: Surabaya, Indonesia

Re: Modules Development

Postby Charles Mead » Tue Mar 13, 2012 4:20 pm

Again.... what will that do? I am already returning like that with my module link array and it is not working. Please read my code and see where i have put

Code: Select all
return array('tools' => array($moduleLinkStudent)); 


Is that any different (except my variable holds the link information) than what you have just written there?!
Charles Mead
 
Posts: 5
Joined: Tue Mar 13, 2012 2:24 pm

Re: Modules Development

Postby y.sulistya » Tue Mar 13, 2012 4:25 pm

Code: Select all
public function getSidebarLinkInfo() {
     
   $currentUser = $this -> getCurrentUser(); // professors should see a link in the lessons menu
     
      if ($currentUser -> getType() == "professor") {
         
         $moduleLinkProfessor = array( 'id' => "MyModule123",
                                'title' => "Module Link",
                                'image' => $this -> moduleBaseLink . 'images/logo.jpg',
                                'eFrontExtensions' => '0',
                                'link' => $this -> moduleBaseUrl
                              );
         
         return array('tools' => $moduleLinkProfessor);
         
      }elseif($currentUser -> getType() == "student"){
     
         $moduleLinkStudent = array( 'id' => "MyModule123",
                              'title' => "Module Link",
                              'image' => $this -> moduleBaseLink . 'images/logo.jpg',
                              'eFrontExtensions' => '0',
                              'link' => $this -> moduleBaseUrl
                           );
         
         return array('tools' => $moduleLinkStudent);
     
      }
     
   }
Blessings & Peace,
Yudi Sulistya

---
Database administrator & programmer at Faculty of Psychology • Airlangga University
Programmer at Cyber Campus • Airlangga University
Need personal help? contact me : yudi.sulistya[at]gmail.com
User avatar
y.sulistya
 
Posts: 717
Joined: Mon Apr 13, 2009 12:02 pm
Location: Surabaya, Indonesia

Re: Modules Development

Postby Charles Mead » Tue Mar 13, 2012 4:35 pm

Doesnt work either. if you look on the module tutorial page here : http://wiki.efrontlearning.net/How_to_build_a_module about 3/4 of the way down the page it shows that my method is correct (or should be) but that doesnt work either.

Strange thing is, it works for the getCentreLinkInfo() function and the link happily shows up in the administrator section under 'Modules' area... but this function just doesn't.

Please somebody help!!
Charles Mead
 
Posts: 5
Joined: Tue Mar 13, 2012 2:24 pm

Re: Modules Development

Postby y.sulistya » Tue Mar 13, 2012 5:00 pm

How about this?
Code: Select all
public function getSidebarLinkInfo() {
     
   $currentUser = $this -> getCurrentUser(); // professors should see a link in the lessons menu
     
      if ($currentUser -> getType() == "professor") {
         
         $moduleLinkProfessor = array( 'id' => "MyModule123",
                                'title' => "Module Link",
                                'image' => $this -> moduleBaseLink . 'images/logo.jpg',
                                'eFrontExtensions' => '1',
                                'link' => $this -> moduleBaseUrl
                              );
         
         return array('tools' => array($moduleLinkProfessor));
         
      } elseif ($currentUser -> getType() == "student") {
     
         $moduleLinkStudent = array( 'id' => "MyModule123",
                              'title' => "Module Link",
                              'image' => $this -> moduleBaseLink . 'images/logo.jpg',
                              'eFrontExtensions' => '1',
                              'link' => $this -> moduleBaseUrl
                           );
         
         return array('tools' => array($moduleLinkStudent));
      }     
}
Blessings & Peace,
Yudi Sulistya

---
Database administrator & programmer at Faculty of Psychology • Airlangga University
Programmer at Cyber Campus • Airlangga University
Need personal help? contact me : yudi.sulistya[at]gmail.com
User avatar
y.sulistya
 
Posts: 717
Joined: Mon Apr 13, 2009 12:02 pm
Location: Surabaya, Indonesia

Re: Modules Development

Postby Charles Mead » Tue Mar 13, 2012 5:08 pm

Tried and no success - the eFrontExtensions variable is for images - with this enabled you arn't supposed to define a format for the image in the 'image' reference... and it works off either .png or .gif , i.e. it will look for both depending on the users browser and display the most appropriate image.

As i am using .jpg this should be flagged off. it is really frustrating me now. Might be a bug with my eFront version build?! I am running on : eFront (version 3.6.10) • Enterprise Edition
Charles Mead
 
Posts: 5
Joined: Tue Mar 13, 2012 2:24 pm

Re: Modules Development

Postby y.sulistya » Tue Mar 13, 2012 5:26 pm

Charles Mead wrote:Tried and no success - the eFrontExtensions variable is for images - with this enabled you arn't supposed to define a format for the image in the 'image' reference... and it works off either .png or .gif , i.e. it will look for both depending on the users browser and display the most appropriate image.

As i am using .jpg this should be flagged off. it is really frustrating me now. Might be a bug with my eFront version build?! I am running on : eFront (version 3.6.10) • Enterprise Edition


Hi,
It would be better if you contacting the eFront support team for this as you have a commercial edition of eFront to help you.
Blessings & Peace,
Yudi Sulistya

---
Database administrator & programmer at Faculty of Psychology • Airlangga University
Programmer at Cyber Campus • Airlangga University
Need personal help? contact me : yudi.sulistya[at]gmail.com
User avatar
y.sulistya
 
Posts: 717
Joined: Mon Apr 13, 2009 12:02 pm
Location: Surabaya, Indonesia

PreviousNext

Return to Modules

Who is online

Users browsing this forum: No registered users and 4 guests