[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] hrm inc/class.menu.inc.php inc/class.sarissa_te...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] hrm inc/class.menu.inc.php inc/class.sarissa_te... |
Date: |
Tue, 22 Aug 2006 08:37:24 +0000 |
CVSROOT: /sources/phpgroupware
Module name: hrm
Changes by: Sigurd Nes <sigurdne> 06/08/22 08:37:24
Modified files:
inc : class.menu.inc.php
Added files:
inc : class.sarissa_test.inc.php
templates/base : sarissa_test.xsl
Log message:
Added test for ajax
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/hrm/inc/class.menu.inc.php?cvsroot=phpgroupware&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/hrm/inc/class.sarissa_test.inc.php?cvsroot=phpgroupware&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/hrm/templates/base/sarissa_test.xsl?cvsroot=phpgroupware&rev=1.1
Patches:
Index: inc/class.menu.inc.php
===================================================================
RCS file: /sources/phpgroupware/hrm/inc/class.menu.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- inc/class.menu.inc.php 30 Nov 2005 17:07:22 -0000 1.5
+++ inc/class.menu.inc.php 22 Aug 2006 08:37:24 -0000 1.6
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package hrm
* @subpackage core
- * @version $Id: class.menu.inc.php,v 1.5 2005/11/30 17:07:22 sigurdne
Exp $
+ * @version $Id: class.menu.inc.php,v 1.6 2006/08/22 08:37:24 sigurdne
Exp $
*/
/**
@@ -64,6 +64,19 @@
$menu['module'][$i]['statustext'] =
lang('Place');
$i++;
+ if ($GLOBALS['phpgw']->acl->check('run',
PHPGW_ACL_READ, 'admin'))
+ {
+ if($sub=='ajax' )
+ {
+ $menu['module'][$i]['this']=True;
+ }
+
+ $menu['module'][$i]['link']
=
$GLOBALS['phpgw']->link('/index.php','menuaction='.$currentapp.'.sarissa_test.index');
+ $menu['module'][$i]['name']
= lang('Ajax');
+ $menu['module'][$i]['statustext'] =
lang('Ajax');
+ $i++;
+ }
+
$j=0;
if ($sub == 'job')
{
Index: inc/class.sarissa_test.inc.php
===================================================================
RCS file: inc/class.sarissa_test.inc.php
diff -N inc/class.sarissa_test.inc.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ inc/class.sarissa_test.inc.php 22 Aug 2006 08:37:24 -0000 1.1
@@ -0,0 +1,92 @@
+<?php
+ /**
+ * phpGroupWare - HRM: a human resource competence management system.
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package hrm
+ * @subpackage user
+ * @version $Id: class.sarissa_test.inc.php,v 1.1 2006/08/22 08:37:24
sigurdne Exp $
+ */
+
+ /**
+ * Description
+ * @package hrm
+ */
+
+ class sarissa_test
+ {
+ var $currentapp;
+
+ var $public_functions = array
+ (
+ 'index' => True,
+ 'sarissa_test' => true,
+ 'airport' => true,
+ 'HelloWorld' => true,
+ 'HelloWorldParams' => true,
+ 'HelloWorldArray' => true
+ );
+
+ function sarissa_test()
+ {
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+ $this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ $this->menu =
CreateObject($this->currentapp.'.menu');
+ $this->menu->sub = 'ajax';
+ }
+
+
+ function index()
+ {
+ $links = $this->menu->links();
+
+ if(!is_object($GLOBALS['phpgw']->js))
+ {
+ $GLOBALS['phpgw']->js =
createObject('phpgwapi.javascript');
+ }
+
+ $GLOBALS['phpgw']->js->validate_file('json', 'json');
+ $GLOBALS['phpgw']->js->validate_file('sarissa',
'sarissa');
+ $GLOBALS['phpgw']->js->validate_file('expandable',
'expandable');
+ $GLOBALS['phpgw']->js->validate_file('ajax',
'prajax_util','hrm');
+ $GLOBALS['phpgw']->js->validate_file('ajax',
'sarissa_test','hrm');
+
+
$GLOBALS['phpgw']->xslttpl->add_file(array('sarissa_test','menu'));
+
+ $data = array
+ (
+ 'links' => $links,
+ );
+
+ $appname = 'HRM';
+ $function_msg = 'Test SARISSA';
+
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+
+ }
+
+ function HelloWorld()
+ {
+ return "Hello World! " . date("Y/m/d H:i:s");
+ }
+
+ function HelloWorldParams()
+ {
+ $firstname = get_var('firstname',array('GET'));
+ $lastname = get_var('lastname',array('GET'));
+
+ return "Hello, " . $firstname . " " . $lastname;
+ }
+
+ function HelloWorldArray()
+ {
+ $name = get_var('name',array('GET'));
+ $name = execMethod('phpgwapi.Services_JSON.decode',
stripslashes(urldecode($name)));
+ $value = array("Hello", $name[0], $name[1]);
+ return $value;
+ }
+ }
Index: templates/base/sarissa_test.xsl
===================================================================
RCS file: templates/base/sarissa_test.xsl
diff -N templates/base/sarissa_test.xsl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ templates/base/sarissa_test.xsl 22 Aug 2006 08:37:24 -0000 1.1
@@ -0,0 +1,38 @@
+<!-- $Id: sarissa_test.xsl,v 1.1 2006/08/22 08:37:24 sigurdne Exp $ -->
+
+ <xsl:template name="app_data">
+ <xsl:apply-templates select="list"/>
+ </xsl:template>
+
+ <xsl:template match="list">
+ <xsl:call-template name="menu"/>
+ <div style="width: 100%; height: 65px; background-color:
#EEEEEE; font-family: Arial, Helvetica, Sans-Serif; font-size: 9pt;">
+ This example demonstrates a simple Hello World example
+ </div>
+
+ <form name="frmForm">
+ <h1>Hello World</h1>
+ <input type="button" value="Simple Hello World"
onClick="HelloWorld();"></input>
+ <input type="button" value="Parameters Hello World"
onClick="HelloWorldParams(prompt('Firstname:'), prompt('Lastname:'));"></input>
+ <input type="button" value="Array Hello World"
onClick="HelloWorldArray( new Array( prompt('Firstname:'), prompt('Lastname:')
));"></input>
+ </form>
+
+
+ <div id="sitemgr_site_nnv">
+ <div id="sitemgr_site_nnv_folder_list">
+ <ul class="folder_list expandable">
+ <li><a
href="javascript:getFolder('/home');" class="folder_name">/home</a>
+ <ul>
+ <li>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <div id="sitemgr_site_nnv_file_list">
+ </div>
+ </div>
+
+
+ </xsl:template>
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] hrm inc/class.menu.inc.php inc/class.sarissa_te...,
Sigurd Nes <=