[Amportal-devel] GUI Hooks

All,

I’ve been thinking over the past few weeks about gui hooks and the
complete lack of a working framework in this area that we currently have.

Tier_1 was showing me some code he’s done over the weekend that forced me
to think about harder / quicker about it :slight_smile:

I’ve tried a few things over the w/e and finally settled on one idea I
kinda like. I’ve started doing some code to try and show the ‘concept’ of
my idea and I’ve attached some files to this email.

I hope there is enough there so you can ‘get’ what I’m trying to do here,
basically I’ve tried to come up with a solution that will allow any module
to hook into any part of any other module / core’s config page, under any
section.

A good example of why this is required is the voicemail. At the moment
we’ve got nearly all the voicemail (gui) functionality coded into the
extensions and users pages (yes it’s duplicated as well!). So if somebody
didn’t want voicemail for any reason the only thing we can do right now is
put some horrible code in there to detect if the voicemail module is
installed. However using my proposed solution the voicemail module would
just add it’s html elements into the ‘users’ and ‘extensions’ components
(as i’ve called it) and the relevant HTML would be generated as part of
those pages, if Voicemail is enabled/installed.

The code attached does work, however it is by no means complete. For a
start I’ve not done anything around the processing of the $_REQUEST object
or anything yet and all that is still done in the page.users.php file,
once I’m done that will also be hooked into the class. Also the
Javascript bits just don’t work as I’ve had a bit of a re-think in that
area so got some re-coding to do on that.

So long as I don’t receive any major objections to this idea, I’ll
continue coding this during this coming week and hopefully have something
that can be commited to HEAD by the end of next weekend.

Any questions, just email me or I should be around on IRC at some point
during the week.

There are half a dozen reason I can think of now why this is a good idea…

  • Standard template for the gui
  • Less changes needed if we decide to change the gui in a major way.
  • Easier/faster development for non core developers to add modules.
  • Standard form validation
  • Modules can add gui elements to any other modules config page

Mark
(wozto1s)


Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

Post generated using Mail2Forum (http://www.mail2forum.com)

Thanks for the feedback, the page.users.php is still work in progress,
I’ve only changed it enough to show my idea really, I’m thinking that once
this is fully implemented for standard type config pages the amount of
actual HTML required should actually be zero as the functions.inc.php file
will have a standard function (e.g. core_pageinit or something like that)
that will call the relevent $comp->addguielement methods for the content
of that page, if you see what I mean.

I will have to make changes to the config.php file to accomodate all this,
so we could look at doing the global connection as part of that. Probably
best for me to get this fully implemented on my system and then commit it
to HEAD once it’s working along side the current method as the last thing
we want to do is have to go back and retrospectivly start re-write all the
config pages. Once it’s in HEAD you should be able to look into
implementing your bits.

I am planning on spending as much time as possible on this during this
week so I’m hoping to have this ‘working’ by Friday/Saturday this week.

Mark

[quote] Hi,

I have been looking for this idea for a long time. There are parts of
freePBX wich just do not scale up, and we (Xorcom) as a distributor of
software, sometimes need to add. For example, some hooks on the main
page to show the status of the system (is asterisk running? no? do to
the hardware detection page). This has been implemented as a ugly patch
in AMP. I am hoping for a better solution in freePBX. You solution is
making us closer to this goal.

The components.page.php looks great, real neat code.
The page.users.php is still a nice mess, but I am sure you are working on.

One this that gets me mad is the endless connections freePBX has to the
manager interface:
//make sure we can connect to Asterisk Manager
checkAstMan();
This code creates a new connection, and hangs it. I would like refactor
the code, to have a global connection to the manager (on header.php) and
changing the checkAstMan() call to simpley checking if that connection
$astManager is not null - this would mean we could not connect to the
manager.

[email protected] wrote:

[quote]All,

I’ve been thinking over the past few weeks about gui hooks and the
complete lack of a working framework in this area that we currently have.

Tier_1 was showing me some code he’s done over the weekend that forced me
to think about harder / quicker about it :slight_smile:

I’ve tried a few things over the w/e and finally settled on one idea I
kinda like. I’ve started doing some code to try and show the 'concept’
of
my idea and I’ve attached some files to this email.

I hope there is enough there so you can ‘get’ what I’m trying to do here,
basically I’ve tried to come up with a solution that will allow any
module
to hook into any part of any other module / core’s config page, under any
section.

A good example of why this is required is the voicemail. At the moment
we’ve got nearly all the voicemail (gui) functionality coded into the
extensions and users pages (yes it’s duplicated as well!). So if
somebody
didn’t want voicemail for any reason the only thing we can do right now
is
put some horrible code in there to detect if the voicemail module is
installed. However using my proposed solution the voicemail module would
just add it’s html elements into the ‘users’ and ‘extensions’ components
(as i’ve called it) and the relevant HTML would be generated as part of
those pages, if Voicemail is enabled/installed.

The code attached does work, however it is by no means complete. For a
start I’ve not done anything around the processing of the $_REQUEST
object
or anything yet and all that is still done in the page.users.php file,
once I’m done that will also be hooked into the class. Also the
Javascript bits just don’t work as I’ve had a bit of a re-think in that
area so got some re-coding to do on that.

So long as I don’t receive any major objections to this idea, I’ll
continue coding this during this coming week and hopefully have something
that can be commited to HEAD by the end of next weekend.

Any questions, just email me or I should be around on IRC at some point
during the week.

There are half a dozen reason I can think of now why this is a good
idea…

  • Standard template for the gui
  • Less changes needed if we decide to change the gui in a major way.
  • Easier/faster development for non core developers to add modules.
  • Standard form validation
  • Modules can add gui elements to any other modules config page

Mark
(wozto1s)



Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

[/quote]


Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

[/quote]


Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

Post generated using Mail2Forum (http://www.mail2forum.com)

All,

I’ve started a page on the wiki for my current ideas on this, I’ll keep
updating this as I’m progressing. Please feel free to add your own
thoughts and ideas.

http://www.freepbx.org/wiki/ConfigPageCodingFramework

Mark

[quote] Hi,

I have been looking for this idea for a long time. There are parts of
freePBX wich just do not scale up, and we (Xorcom) as a distributor of
software, sometimes need to add. For example, some hooks on the main
page to show the status of the system (is asterisk running? no? do to
the hardware detection page). This has been implemented as a ugly patch
in AMP. I am hoping for a better solution in freePBX. You solution is
making us closer to this goal.

The components.page.php looks great, real neat code.
The page.users.php is still a nice mess, but I am sure you are working on.

One this that gets me mad is the endless connections freePBX has to the
manager interface:
//make sure we can connect to Asterisk Manager
checkAstMan();
This code creates a new connection, and hangs it. I would like refactor
the code, to have a global connection to the manager (on header.php) and
changing the checkAstMan() call to simpley checking if that connection
$astManager is not null - this would mean we could not connect to the
manager.

[email protected] wrote:

[quote]All,

I’ve been thinking over the past few weeks about gui hooks and the
complete lack of a working framework in this area that we currently have.

Tier_1 was showing me some code he’s done over the weekend that forced me
to think about harder / quicker about it :slight_smile:

I’ve tried a few things over the w/e and finally settled on one idea I
kinda like. I’ve started doing some code to try and show the 'concept’
of
my idea and I’ve attached some files to this email.

I hope there is enough there so you can ‘get’ what I’m trying to do here,
basically I’ve tried to come up with a solution that will allow any
module
to hook into any part of any other module / core’s config page, under any
section.

A good example of why this is required is the voicemail. At the moment
we’ve got nearly all the voicemail (gui) functionality coded into the
extensions and users pages (yes it’s duplicated as well!). So if
somebody
didn’t want voicemail for any reason the only thing we can do right now
is
put some horrible code in there to detect if the voicemail module is
installed. However using my proposed solution the voicemail module would
just add it’s html elements into the ‘users’ and ‘extensions’ components
(as i’ve called it) and the relevant HTML would be generated as part of
those pages, if Voicemail is enabled/installed.

The code attached does work, however it is by no means complete. For a
start I’ve not done anything around the processing of the $_REQUEST
object
or anything yet and all that is still done in the page.users.php file,
once I’m done that will also be hooked into the class. Also the
Javascript bits just don’t work as I’ve had a bit of a re-think in that
area so got some re-coding to do on that.

So long as I don’t receive any major objections to this idea, I’ll
continue coding this during this coming week and hopefully have something
that can be commited to HEAD by the end of next weekend.

Any questions, just email me or I should be around on IRC at some point
during the week.

There are half a dozen reason I can think of now why this is a good
idea…

  • Standard template for the gui
  • Less changes needed if we decide to change the gui in a major way.
  • Easier/faster development for non core developers to add modules.
  • Standard form validation
  • Modules can add gui elements to any other modules config page

Mark
(wozto1s)



Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

[/quote]


Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

[/quote]


Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

Post generated using Mail2Forum (http://www.mail2forum.com)

Hi,

I have been looking for this idea for a long time. There are parts of
freePBX wich just do not scale up, and we (Xorcom) as a distributor of
software, sometimes need to add. For example, some hooks on the main
page to show the status of the system (is asterisk running? no? do to
the hardware detection page). This has been implemented as a ugly patch
in AMP. I am hoping for a better solution in freePBX. You solution is
making us closer to this goal.

The components.page.php looks great, real neat code.
The page.users.php is still a nice mess, but I am sure you are working on.

One this that gets me mad is the endless connections freePBX has to the
manager interface:
//make sure we can connect to Asterisk Manager
checkAstMan();
This code creates a new connection, and hangs it. I would like refactor
the code, to have a global connection to the manager (on header.php) and
changing the checkAstMan() call to simpley checking if that connection
$astManager is not null - this would mean we could not connect to the
manager.

[email protected] wrote:

[quote]All,

I’ve been thinking over the past few weeks about gui hooks and the
complete lack of a working framework in this area that we currently have.

Tier_1 was showing me some code he’s done over the weekend that forced me
to think about harder / quicker about it :slight_smile:

I’ve tried a few things over the w/e and finally settled on one idea I
kinda like. I’ve started doing some code to try and show the ‘concept’ of
my idea and I’ve attached some files to this email.

I hope there is enough there so you can ‘get’ what I’m trying to do here,
basically I’ve tried to come up with a solution that will allow any module
to hook into any part of any other module / core’s config page, under any
section.

A good example of why this is required is the voicemail. At the moment
we’ve got nearly all the voicemail (gui) functionality coded into the
extensions and users pages (yes it’s duplicated as well!). So if somebody
didn’t want voicemail for any reason the only thing we can do right now is
put some horrible code in there to detect if the voicemail module is
installed. However using my proposed solution the voicemail module would
just add it’s html elements into the ‘users’ and ‘extensions’ components
(as i’ve called it) and the relevant HTML would be generated as part of
those pages, if Voicemail is enabled/installed.

The code attached does work, however it is by no means complete. For a
start I’ve not done anything around the processing of the $_REQUEST object
or anything yet and all that is still done in the page.users.php file,
once I’m done that will also be hooked into the class. Also the
Javascript bits just don’t work as I’ve had a bit of a re-think in that
area so got some re-coding to do on that.

So long as I don’t receive any major objections to this idea, I’ll
continue coding this during this coming week and hopefully have something
that can be commited to HEAD by the end of next weekend.

Any questions, just email me or I should be around on IRC at some point
during the week.

There are half a dozen reason I can think of now why this is a good idea…

  • Standard template for the gui
  • Less changes needed if we decide to change the gui in a major way.
  • Easier/faster development for non core developers to add modules.
  • Standard form validation
  • Modules can add gui elements to any other modules config page

Mark
(wozto1s)



Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

[/quote]


Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

Post generated using Mail2Forum (http://www.mail2forum.com)

Hi,

I was just wondering what the current status of the gui hooks. The reason for this is that I too need to change some of the functionality of the frontend in particular – relating to increasing the complexity of the user access/permissions –

Since I am a n00b I was wondering if there was a rule of thumb for me to go about understanding how the GUI actually works. The API documentation is a bit sparse dot dot dot

Hi all,

Work totally got in the way again of me finishing what I started on this
I’m afraid :frowning: Fingers crossed thou, that is all over and done with now
and should be able to get back on this from Weds this week.

Did anybody else look at it btw? I’ve not had chance to review the SVN
commits yet, will do before Weds thou.

Mark
(wozto1s)

[quote] Hi,

I was just wondering what the current status of the gui hooks. The reason
for this is that I too need to change some of the functionality of the
frontend in particular – relating to increasing the complexity of the
user access/permissions –

Since I am a n00b I was wondering if there was a rule of thumb for me to
go about understanding how the GUI actually works. The API documentation
is a bit sparse dot dot dot


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys – and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

[/quote]


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


Amportal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amportal-devel

Post generated using Mail2Forum (http://www.mail2forum.com)