[Eis-commits] SF.net SVN: eis: [210] trunk/mod
Status: Pre-Alpha
Brought to you by:
baslijnse
|
From: <bas...@us...> - 2007-09-14 11:20:36
|
Revision: 210
http://eis.svn.sourceforge.net/eis/?rev=210&view=rev
Author: baslijnse
Date: 2007-09-14 04:20:31 -0700 (Fri, 14 Sep 2007)
Log Message:
-----------
Added autofocus of username input to Login element, cleaned up javascript functions in widgetService and renamed Logout element to LogoutLink because it reflects the type of element better.
Modified Paths:
--------------
trunk/mod/eis_engine/applications/servermanager.xml
trunk/mod/eis_user/elements/Login.php
trunk/mod/eis_widget/services/MainService.php
Added Paths:
-----------
trunk/mod/eis_user/elements/LogoutLink.php
Removed Paths:
-------------
trunk/mod/eis_user/elements/Logout.php
Modified: trunk/mod/eis_engine/applications/servermanager.xml
===================================================================
--- trunk/mod/eis_engine/applications/servermanager.xml 2007-09-14 09:14:46 UTC (rev 209)
+++ trunk/mod/eis_engine/applications/servermanager.xml 2007-09-14 11:20:31 UTC (rev 210)
@@ -9,7 +9,7 @@
<session_backend>
<module>eis_session</module>
- <service>FileStoreSessionService</service>
+ <service>FileStoreService</service>
</session_backend>
<page_root>
@@ -30,7 +30,7 @@
</element>
<element>
<module>eis_user</module>
- <element>Logout</element>
+ <element>LogoutLink</element>
<area>LOGOUT</area>
<config><name>logout_page</name><value>/login</value></config>
<inherit><depth>100</depth></inherit>
Modified: trunk/mod/eis_user/elements/Login.php
===================================================================
--- trunk/mod/eis_user/elements/Login.php 2007-09-14 09:14:46 UTC (rev 209)
+++ trunk/mod/eis_user/elements/Login.php 2007-09-14 11:20:31 UTC (rev 210)
@@ -56,6 +56,7 @@
print $sWidget->form($form, $this->e->hrefAction('login'), 'loginform');
print $sWidget->jsAttachHandler('loginform','onsubmit','hashPassword');
+ print $sWidget->jsInline('Form.focusFirstElement(\'loginform\');');
} else { //Use a custom template...
require_once("lib/utils/template.lib.php");
Deleted: trunk/mod/eis_user/elements/Logout.php
===================================================================
--- trunk/mod/eis_user/elements/Logout.php 2007-09-14 09:14:46 UTC (rev 209)
+++ trunk/mod/eis_user/elements/Logout.php 2007-09-14 11:20:31 UTC (rev 210)
@@ -1,20 +0,0 @@
-<?php
- class eis_user_Logout extends Element {
-
- function view_default() {
- print '<a href="'.$this->e->hrefAction('logout').'">'.$this->e->getString('eis_user.l.logout').'</a>';
- }
-
- function action_logout($data) {
-
- $this->e->user->logout();
-
- if($this->ec['redirect_logout'] != null) {
- $this->e->redirect($this->e->hrefPage($this->ec['redirect_logout']));
- } else {
- $this->e->redirect($this->e->hrefCurrentPage());
- }
- }
-
- }
-?>
Copied: trunk/mod/eis_user/elements/LogoutLink.php (from rev 208, trunk/mod/eis_user/elements/Logout.php)
===================================================================
--- trunk/mod/eis_user/elements/LogoutLink.php (rev 0)
+++ trunk/mod/eis_user/elements/LogoutLink.php 2007-09-14 11:20:31 UTC (rev 210)
@@ -0,0 +1,20 @@
+<?php
+ class eis_user_LogoutLink extends Element {
+
+ function view_default() {
+ print '<a href="'.$this->e->hrefAction('logout').'">'.$this->e->getString('eis_user.l.logout').'</a>';
+ }
+
+ function action_logout($data) {
+
+ $this->e->user->logout();
+
+ if($this->ec['redirect_logout'] != null) {
+ $this->e->redirect($this->e->hrefPage($this->ec['redirect_logout']));
+ } else {
+ $this->e->redirect($this->e->hrefCurrentPage());
+ }
+ }
+
+ }
+?>
Modified: trunk/mod/eis_widget/services/MainService.php
===================================================================
--- trunk/mod/eis_widget/services/MainService.php 2007-09-14 09:14:46 UTC (rev 209)
+++ trunk/mod/eis_widget/services/MainService.php 2007-09-14 11:20:31 UTC (rev 210)
@@ -867,8 +867,23 @@
}
//JAVASCRIPT GENERATION
-
/**
+ * Loads a separate javascript library
+ *
+ * @param file the file (static resource) that has to be loaded.
+ */
+ function jsLoadLib($file) {
+ $href = $this->e->hrefStatic($file);
+ return '<script type="text/javascript" src="'.$href.'"></script>';
+ }
+ /**
+ * Embeds a piece of inline javascript
+ * @param code the javascript code to include
+ */
+ function jsInline($code) {
+ return '<script type="text/javascript"> '.$code.' </script>';
+ }
+ /**
* Attaches a javascript event handler to html element
* For example jsAttachHandler('mybutton','onclick','doStuff') attaches the 'doStuff'
* Javascript function to the 'onclick' event of the element with id 'mybutton'.
@@ -878,11 +893,10 @@
* @param $handler the javascript function that serves as the event handler
*/
function jsAttachHandler($id, $event, $handler) {
- return '<script type="text/javascript"> $(\''.$id.'\').'.$event.' = '.$handler.'; </script>';
+ return $this->jsInline('$(\''.$id.'\').'.$event.' = '.$handler.';');
}
function jsUpdateSelect($src, $dest, $url) {
- $js = '<script type="text/javascript" >';
- $js .= '$(\'input-'.$src.'\').onchange = function () {';
+ $js = '$(\'input-'.$src.'\').onchange = function () {';
$js .= 'new Ajax.Request(\''.$url.'\',{';
$js .= 'method: \'get\', parameters: { '.$src.': $F(\'input-'.$src.'\') },';
$js .= 'onComplete: function(t) { ';
@@ -890,9 +904,8 @@
$js .= 'var dest = $(\'input-'.$dest.'\'); dest.options.length = 0; var len = 0; ';
$js .= 'opt.each(function(i){ dest.options[len] = new Option(i[1],i[0]); len++; }); ';
$js .= '}});}';
- $js .= '</script>';
- return $js;
+ return $this->jsInline($js);
}
function jsEncodeOptions($options) {
$html = array();
@@ -901,15 +914,6 @@
}
return "[".implode(",",$html)."]";
}
- /**
- * Loads a separate javascript library
- *
- * @param file the file (static resource) that has to be loaded.
- */
- function jsLoadLib($file) {
- $href = $this->e->hrefStatic($file);
- return '<script type="text/javascript" src="'.$href.'"></script>';
- }
/**
*Converts a php array into a javascript array.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|