[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [11971] API: reference resources in backend from fron
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [11971] API: reference resources in backend from frontend |
Date: |
Wed, 14 May 2014 12:46:26 +0000 |
Revision: 11971
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11971
Author: sigurdne
Date: 2014-05-14 12:46:26 +0000 (Wed, 14 May 2014)
Log Message:
-----------
API: reference resources in backend from frontend
Modified Paths:
--------------
trunk/phpgwapi/inc/class.phpgw.inc.php
trunk/phpgwapi/inc/class.sessions.inc.php
trunk/phpgwapi/inc/functions.inc.php
trunk/phpgwapi/templates/base/datatable_common.xsl
Modified: trunk/phpgwapi/inc/class.phpgw.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.phpgw.inc.php 2014-05-13 13:48:03 UTC (rev
11970)
+++ trunk/phpgwapi/inc/class.phpgw.inc.php 2014-05-14 12:46:26 UTC (rev
11971)
@@ -178,12 +178,13 @@
* @param array $extravars Extra params to be passed to
the url
* @param boolean $redirect is the resultant link being used in
a header('Location:' ... redirect?
* @param boolean $external is the resultant link being used as
external access (i.e url in emails..)
+ * @param boolean $force_backend if the resultant link is being
used to reference resources in the api
* @return string The full url after processing
* @see session->link()
*/
- public function link($url = '', $extravars = array(), $redirect
= false, $external = false)
+ public function link($url = '', $extravars = array(), $redirect
= false, $external = false, $force_backend = false)
{
- return $this->session->link($url, $extravars,
$redirect, $external);
+ return $this->session->link($url, $extravars,
$redirect, $external, $force_backend);
}
/**
Modified: trunk/phpgwapi/inc/class.sessions.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.sessions.inc.php 2014-05-13 13:48:03 UTC (rev
11970)
+++ trunk/phpgwapi/inc/class.sessions.inc.php 2014-05-14 12:46:26 UTC (rev
11971)
@@ -536,17 +536,20 @@
* @param array $extravars query string arguements
* @param boolean $redirect is this for a redirect link ?
* @param boolean $external is the resultant link being used as
external access (i.e url in emails..)
+ * @param boolean $force_backend if the resultant link is being
used to reference resources in the api
*
* @return string generated url
*/
- public function link($url, $extravars = array(),
$redirect=false, $external = false)
+ public function link($url, $extravars = array(),
$redirect=false, $external = false, $force_backend = false)
{
+ if(!$force_backend)
+ {
+ $custom_frontend =
isset($GLOBALS['phpgw_info']['flags']['custom_frontend']) &&
$GLOBALS['phpgw_info']['flags']['custom_frontend'] ?
$GLOBALS['phpgw_info']['flags']['custom_frontend'] : '';
- $custom_frontend =
isset($GLOBALS['phpgw_info']['flags']['custom_frontend']) &&
$GLOBALS['phpgw_info']['flags']['custom_frontend'] ?
$GLOBALS['phpgw_info']['flags']['custom_frontend'] : '';
-
- if($custom_frontend && substr($url, 0, 4) != 'http')
- {
- $url = '/' . $custom_frontend . '/' .
ltrim($url, '/');
+ if($custom_frontend && substr($url, 0, 4) !=
'http')
+ {
+ $url = '/' . $custom_frontend . '/' .
ltrim($url, '/');
+ }
}
//W3C Compliant in markup
Modified: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php 2014-05-13 13:48:03 UTC (rev
11970)
+++ trunk/phpgwapi/inc/functions.inc.php 2014-05-14 12:46:26 UTC (rev
11971)
@@ -113,9 +113,12 @@
* Get global phpgw_link from XSLT templates
* @param string $path on the format 'index.php'
* @param string $params on the format 'param1:value1,param2:value2'
+ * @param boolean $redirect want '&';rather than '&';
+ * @param boolean $external is the resultant link being used as
external access (i.e url in emails..)
+ * @param boolean $force_backend if the resultant link is being used to
reference resources in the api
* @return string containing url
*/
- function get_phpgw_link($path, $params)
+ function get_phpgw_link($path, $params, $redirect = true, $external =
false, $force_backend = false)
{
$path = '/' . ltrim($path, '/');
$link_data = array();
@@ -130,7 +133,7 @@
}
}
- $ret = $GLOBALS['phpgw']->link($path, $link_data, true);//true:
want '&';rather than '&';
+ $ret = $GLOBALS['phpgw']->link($path, $link_data, $redirect,
$external, $force_backend);//redirect: want '&';rather than '&';
return $ret;
}
Modified: trunk/phpgwapi/templates/base/datatable_common.xsl
===================================================================
--- trunk/phpgwapi/templates/base/datatable_common.xsl 2014-05-13 13:48:03 UTC
(rev 11970)
+++ trunk/phpgwapi/templates/base/datatable_common.xsl 2014-05-14 12:46:26 UTC
(rev 11971)
@@ -35,7 +35,7 @@
<xsl:template name="datatable" xmlns:php="http://php.net/xsl">
<iframe id="yui-history-iframe"
src="phpgwapi/js/yahoo/history/assets/blank.html">
<xsl:attribute name="src">
- <xsl:value-of select="php:function('get_phpgw_link',
'/phpgwapi/js/yahoo/history/assets/blank.html')" />
+ <xsl:value-of select="php:function('get_phpgw_link',
'/phpgwapi/js/yahoo/history/assets/blank.html',0, 0, 1, 1)" />
</xsl:attribute>
</iframe>
<input id="yui-history-field" type="hidden"/>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [11971] API: reference resources in backend from frontend,
Sigurd Nes <=