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.

Modules Development

Postby papagel » Tue Jun 10, 2008 9:27 am

In the latest version of eFront we have made some serious effort to improve the modules infrastructure.

Everyone that is interested in reading the module manual can check it online and download it directly from the following URL:
http://www.scribd.com/doc/3202161/eFront-modules-manual

You may as well check all eFront documents on the Scribd group we have created at:
http://www.scribd.com/groups/view/10289 ... umentation

** Check our current modules pages for the latest version of modules. This F.A.Q is deprecated **
I also enclose a simple yet working F.A.Q module that you may use on your system.
Attachments
module_faq(2).zip
(12.98 KiB) Downloaded 792 times
eFront- eLearning and Skill Development Solution for Companies and Educational Institutes
User avatar
papagel
 
Posts: 1568
Joined: Wed Oct 03, 2007 5:07 pm

Re: Modules Development

Postby heshaosha » Sat Aug 02, 2008 1:12 am

i download the module file named module_faq(2).zip you provided
but when i try to install it with administrator role, i just got this message
"The module could not be installed. Please make sure that there are no modules with the same name already installed"
i never installed a module named module_faq before.exactly,i never installed any module before.

i go to the /efront/www/modules , there is already a file called module_faq(2).zip .
so i deleted it and try to install the module again.
this time i was confused,because i got the same message
"The module could not be installed. Please make sure that there are no modules with the same name already installed"


Is any problem with my database?
so i log in the phpmyadmin use root,and go to the table called modules in efront database ,but the table is empty.
and i found i can't insert any row in this table.
Is this a bug, or an oddity of my own system?

PS:my eFront version is 3.5.0 build 2580
heshaosha
 
Posts: 2
Joined: Sat Aug 02, 2008 12:16 am

Re: Modules Development

Postby papagel » Sat Aug 02, 2008 6:12 am

Hello,

I have just downloaded and installed the module without problems.

Did you upgrade from a previews installation or this is a completely new eFront installation?

Also, do you work on Windows or Linux?

My best guess is that the module cannot get properly unzipped due to lack of zip or not appropriate priviladges on directory.

But still the message you get is strage...
eFront- eLearning and Skill Development Solution for Companies and Educational Institutes
User avatar
papagel
 
Posts: 1568
Joined: Wed Oct 03, 2007 5:07 pm

Re: Modules Development

Postby heshaosha » Thu Aug 07, 2008 1:06 am

Thanks!
but finally i solved this problem.
there is a missing field when the eFront system insert data to the table named modules.

open the file www\administrator.php
and insert one row after row 282
Code: Select all
'name'    => $className,

like this
row 281 $fields = array('className' => $className,
row 282 'db_file' => $database_file,
row 283 'name' => $className,
row 284 'active' => 1,
row 285 'title' => (string)$xml -> title,
row 286 'author' => (string)$xml -> author,
row 287 'version' => (string)$xml -> version,
row 288 'description' => (string)$xml -> description,
row 289 'position' => $module_folder,
row 290 'permissions' => implode(",", $module -> getPermittedRoles()));

and then ,i install the module_faq module whth no error messages.
this may be a particular case,
but whatever,I hope that it would be usefull for others
heshaosha
 
Posts: 2
Joined: Sat Aug 02, 2008 12:16 am

Re: Modules Development

Postby baltas » Wed Aug 13, 2008 9:58 am

Thanks for your solution.

The problem had to do with MySQL mode, which I guess that in your case was set to "Strict" or a mode that requires all fields without default values (like the 'name' one) to be explicitly defined during a record insertion. This is why we couldn't reproduce your error. Now, that all values are defined, no problems should be encountered regardless of the MySQL mode set.

As for the message: "The module could not be installed. Please make sure that there are no modules with the same name already installed", it was a result from the hypothesis that, if the insertion fails, then a record with the same primary key (i.e. 'className') would exist in the "Modules" table, or in other words that a module "with the same name would already be installed".

Anyhow, the message has been changed to indicate that something (in general) went wrong during database insertion (perhaps also from a wrongly defined module.xml manifest).
baltas
 
Posts: 46
Joined: Mon Aug 11, 2008 12:50 pm

Re: Modules Development

Postby lcsendmail » Sun Aug 24, 2008 8:06 am

the function getLessonCenterLinkInfo() didn't work.
-------------------------------------------------------------------
public function getCenterLinkInfo() {
return array('title' => 'FAQ',
'image' => $this -> moduleBaseDir . 'images/image30.gif',
'link' => $this -> moduleBaseUrl);
}
User avatar
lcsendmail
 
Posts: 21
Joined: Sat Aug 23, 2008 5:23 am
Location: China

Re: Modules Development

Postby baltas » Sun Aug 24, 2008 2:19 pm

Just to clarify a point to avoid any confusion:

getCenterLinkInfo() and getLessonCenterLinkInfo() are two different functions. The getCenterLinkInfo() refers to the central control panel appearing on the administrator page, while the getLessonCenterLinkInfo() to the main page of each lesson (the one appearing when you click on a lesson name as a professor or student).

The piece of code given:
public function getCenterLinkInfo() {
return array('title' => 'FAQ',
'image' => $this -> moduleBaseDir . 'images/image30.gif',
'link' => $this -> moduleBaseUrl);
}

displays the image30.gif icon on the administrator control panel which would link to the main FAQ page. To display such a link on the main lesson page you could use the following function:

public function getLessonCenterLinkInfo() {
$currentUser = $this -> getCurrentUser();
if ($currentUser -> getType() == "professor") {
return array('title' => 'FAQ',
'image' => 'images/32x32/unknown.png',
'link' => $this -> moduleBaseUrl);
}
}

I hope this can be of some help to you. Please let us know if you find any other problems
baltas
 
Posts: 46
Joined: Mon Aug 11, 2008 12:50 pm

Re: Modules Development

Postby y.sulistya » Thu Dec 02, 2010 2:53 am

hi,

is it possible to build a module for a custom user type? for example we created a user type named 'Academic' which basic user type as administrator. thanks before.
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 periklis » Thu Dec 02, 2010 6:57 am

you mean you would want it to appear only to this type? I believe you can achieve this by checking inside the module for the current user type and if it's different, then not display anything
Periklis Venakis
eFront- eLearning and Skill Development Solution for Companies and Educational Institutes
Consider our wide range of added-value services to get things running smoothly on your eLearning environment
periklis
 
Posts: 4371
Joined: Thu Oct 04, 2007 10:54 am

Re: Modules Development

Postby y.sulistya » Thu Dec 02, 2010 7:33 am

periklis wrote:you mean you would want it to appear only to this type? I believe you can achieve this by checking inside the module for the current user type and if it's different, then not display anything

yeah, that's right we can define a module to one/more user type(s) (administrator, professor or student). in this case i want to build a module to specific custom user type like 'academic' for example. so, 'academic' is the only user to have accesses this module. similiar like below?
Code: Select all
public function getPermittedRoles() {
    return array("administrator");
}

public function getSidebarLinkInfo () {
        $currentUser = $this -> getCurrentUser();
      
        if ($currentUser -> getType() == "academic") {
            $link_academic_module = array (
         ......
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

Next

Return to Modules

Who is online

Users browsing this forum: No registered users and 3 guests

cron