how to jandle page reloading

4 views
Skip to first unread message

kaspars

unread,
Jan 11, 2009, 6:10:12 PM1/11/09
to Skeletonz CMS
Hi!

I begun to experiment with Skeletonz a week ago, and i like it.
Thanks, this is a nice product!

I would like to ask your help in the following question. How to handle
page reloading?

I have a plugin, which structure looks like this:
==========================================================================
.....
class RegGood(GenericPlugin):
...........
def __init__(self):
self.controller = Controller()
getFormatManager().registerMLPlugin('reg_good', self.handler)

..............

def handler(self, args, edit_mode, page_id):
if args.has_key('data') and args.has_key('reg_good'):
................
main_page=render("site_plugins/reg_good/view/main.tmpl", args)
return False, main_page

class Controller(Singleton):
......................
@amiweb.expose
def show(self, reg_nr, rec_type, error=None, formvars={}):
..................
x=render("site_plugins/reg_good/view/show.tmpl", ns)
return x

..............
@amiweb.expose
@amiweb.customHandler
def register(self, path_info, formvars):
......................
ns = {
'header': self.template.getHeader(),
'footer': self.template.getFooter()
}
return render("site_plugins/reg_good/view/done.tmpl", ns)
==========================================================================
E.g., i have main page, which contains data from database and is
loaded, when i choose tab from the main menu.
When i want to add a record, i press button [Add], function
Controller.show() is called, and i can input record attributes. Then i
press button [Save], form action is executed and "done" screen appears
(actually, i copied it from Register form plugin :) ).
I press button [Close], and return in the main page.
The problem is that data in the main page is not updated, i.e.,
RegGood.handler() function is not fired. Could You advice, how to
handle the page reload event?

Thanks in advance!
Kaspars

amix

unread,
Jan 12, 2009, 4:19:33 PM1/12/09
to skel...@googlegroups.com
Generally, the other Skeletonz plugin update site data via JavaScript.

You can reload the page thought in following manner:
<a href="#" onclick="top.location.reload()">Close and reload</a>

Regards,
amix

2009/1/12 kaspars <k_o...@inbox.lv>:

kaspars omuls

unread,
Jan 18, 2009, 7:35:54 AM1/18/09
to skel...@googlegroups.com
Hi!

Could You advice me, how to resolve the following problem.

See image1.jpg in the attachment.
There is shown, how the page looks like, if i am logged on as admin
I want this page is to be similar (data is retrieved from db depending on username) for other logged-on users, only [Edit contents] [Properties] [Edit mode] box must be hidden.

Therefore, i set page property "Can be edited by:" = admin
But, the result is as in image1.jpg. I.e., when i log on as 'kaspars' (the "normal" user), application accepts username and password, but somehow does not change the state.

Log in the output, when i logging on as 'kaspars':
127.0.0.1 - - [18/Jan/2009:14:28:38 +0300] "GET /users/setLogin?username=kaspars
&password=parole HTTP/1.1" 200 -
127.0.0.1 - - [18/Jan/2009:14:28:38 +0300] "GET /siteedit/Pied%C4%81v%C4%81t%C4%
81s_preces/ HTTP/1.1" 200 -

I.e., in general, what i need is to hide ([Edit contents] [Properties] [Edit mode]) for main users. I the setting "Can be edited by:" = admin is the correct action, then could You advice, how to detect, why the plugin is not parsed, and Skeletonz don't log me on.

Thanks!

Kaspars
image1.jpg
image2.jpg

kaspars omuls

unread,
Jan 18, 2009, 11:05:44 AM1/18/09
to skel...@googlegroups.com
I reinstalled skeletonz and the problem dissapeared. may be i broked something while experimented with it.

Kaspars
Reply all
Reply to author
Forward
0 new messages