Author: ralfbecker
Date: Wed Apr 27 21:11:41 2016
New Revision: 55900
URL: http://svn.stylite.de/viewvc/egroupware?rev=55900&view=rev
Log:
move common::get_tpl_dir to Api\Framework\Template::get_dir, and replaced some other overlooked methods
Modified:
trunk/egroupware/api/src/Egw/Base.php
trunk/egroupware/api/src/Etemplate/Widget/Select.php
trunk/egroupware/api/src/Etemplate/Widget/Tree.php
trunk/egroupware/api/src/Framework/Template.php
trunk/egroupware/api/src/Html/HtmLawed.php
trunk/egroupware/api/src/Link.php
trunk/phpgwapi/inc/class.common.inc.php
Modified: trunk/egroupware/api/src/Egw/Base.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Egw/Base.php?rev=55900&r1=55899&r2=55900&view=diff
==============================================================================
--- trunk/egroupware/api/src/Egw/Base.php (original)
+++ trunk/egroupware/api/src/Egw/Base.php Wed Apr 27 21:11:41 2016
@@ -109,7 +109,7 @@
case 'framework':
return $this->framework = Api\Framework::factory();
case 'template': // need to be instancated for the current app
- if (!($tpl_dir = common::get_tpl_dir($this->currentapp)))
+ if (!($tpl_dir = Api\Framework\Template::get_dir($this->currentapp)))
{
return null;
}
Modified: trunk/egroupware/api/src/Etemplate/Widget/Select.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Etemplate/Widget/Select.php?rev=55900&r1=55899&r2=55900&view=diff
==============================================================================
--- trunk/egroupware/api/src/Etemplate/Widget/Select.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Select.php Wed Apr 27 21:11:41 2016
@@ -801,11 +801,11 @@
*
* @param int $id
* @param array $acc =null optional values for keys account_(type|lid|lastname|firstname) to not read them again
- * @param int $longnames
- * @param boolean $show_type true: return array with values for keys label and icon, false: only label
+ * @param int $longnames =0
+ * @param boolean $show_type =false true: return array with values for keys label and icon, false: only label
* @return string|array
*/
- private static function accountInfo($id,$acc=null,$longnames=0,$show_type=false)
+ public static function accountInfo($id,$acc=null,$longnames=0,$show_type=false)
{
if (!$id)
{
Modified: trunk/egroupware/api/src/Etemplate/Widget/Tree.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Etemplate/Widget/Tree.php?rev=55900&r1=55899&r2=55900&view=diff
==============================================================================
--- trunk/egroupware/api/src/Etemplate/Widget/Tree.php (original)
+++ trunk/egroupware/api/src/Etemplate/Widget/Tree.php Wed Apr 27 21:11:41 2016
@@ -335,7 +335,7 @@
/**
* Return image relative to trees image-path
*
- * @param string $image url of image, eg. from common::image($image, $app)
+ * @param string $image url of image, eg. from Api\Image::find($image, $app)
* @return string path relative to image-path, to use when returning tree data eg. via json
*/
public static function imagePath($image)
Modified: trunk/egroupware/api/src/Framework/Template.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Framework/Template.php?rev=55900&r1=55899&r2=55900&view=diff
==============================================================================
--- trunk/egroupware/api/src/Framework/Template.php (original)
+++ trunk/egroupware/api/src/Framework/Template.php Wed Apr 27 21:11:41 2016
@@ -559,4 +559,59 @@
}
return False;
}
+
+ /**
+ * get template dir of an application
+ *
+ * @param $appname appication name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp'];
+ * @return string|boolean dir or false if no dir is found
+ */
+ static function get_dir($appname = '')
+ {
+ if (!$appname)
+ {
+ $appname = $GLOBALS['egw_info']['flags']['currentapp'];
+ }
+ if ($appname == 'logout' || $appname == 'login')
+ {
+ $appname = 'phpgwapi';
+ }
+
+ if (!isset($GLOBALS['egw_info']['server']['template_set']) && isset($GLOBALS['egw_info']['user']['preferences']['common']['template_set']))
+ {
+ $GLOBALS['egw_info']['server']['template_set'] = $GLOBALS['egw_info']['user']['preferences']['common']['template_set'];
+ }
+
+ // Setting this for display of template choices in user preferences
+ if ($GLOBALS['egw_info']['server']['template_set'] == 'user_choice')
+ {
+ $GLOBALS['egw_info']['server']['usrtplchoice'] = 'user_choice';
+ }
+
+ if (($GLOBALS['egw_info']['server']['template_set'] == 'user_choice' ||
+ !isset($GLOBALS['egw_info']['server']['template_set'])) &&
+ isset($GLOBALS['egw_info']['user']['preferences']['common']['template_set']))
+ {
+ $GLOBALS['egw_info']['server']['template_set'] = $GLOBALS['egw_info']['user']['preferences']['common']['template_set'];
+ }
+ if (!file_exists(EGW_SERVER_ROOT.'/phpgwapi/templates/'.basename($GLOBALS['egw_info']['server']['template_set']).'/class.'.
+ $GLOBALS['egw_info']['server']['template_set'].'_framework.inc.php') &&
+ !file_exists(EGW_SERVER_ROOT.'/'.basename($GLOBALS['egw_info']['server']['template_set']).'/inc/class.'.
+ $GLOBALS['egw_info']['server']['template_set'].'_framework.inc.php'))
+ {
+ $GLOBALS['egw_info']['server']['template_set'] = 'idots';
+ }
+ $tpldir = EGW_SERVER_ROOT . '/' . $appname . '/templates/' . $GLOBALS['egw_info']['server']['template_set'];
+ $tpldir_default = EGW_SERVER_ROOT . '/' . $appname . '/templates/default';
+
+ if (@is_dir($tpldir))
+ {
+ return $tpldir;
+ }
+ elseif (@is_dir($tpldir_default))
+ {
+ return $tpldir_default;
+ }
+ return False;
+ }
}
Modified: trunk/egroupware/api/src/Html/HtmLawed.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Html/HtmLawed.php?rev=55900&r1=55899&r2=55900&view=diff
==============================================================================
--- trunk/egroupware/api/src/Html/HtmLawed.php (original)
+++ trunk/egroupware/api/src/Html/HtmLawed.php Wed Apr 27 21:11:41 2016
@@ -389,7 +389,7 @@
{
$attribute_array['alt']= $attribute_array['alt'].' [blocked (reason: url length):'.$attribute_array['src'].']';
if (!isset($attribute_array['title'])) $attribute_array['title']=$attribute_array['alt'];
- $attribute_array['src']=common::image('phpgwapi','dialog_error');
+ $attribute_array['src']=Api\Image::find('phpgwapi','dialog_error');
}
if (!preg_match('/^cid:.*/',$attribute_array['src']))
{
@@ -400,7 +400,7 @@
{
$attribute_array['alt']= $attribute_array['alt'].' [blocked external image:'.$attribute_array['src'].']';
if (!isset($attribute_array['title'])) $attribute_array['title']=$attribute_array['alt'];
- $attribute_array['src']=common::image('mail','no-image-shown');
+ $attribute_array['src']=Api\Image::find('mail','no-image-shown');
$attribute_array['border'] = 1;
if ($attribute_array['style'])
{
Modified: trunk/egroupware/api/src/Link.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Link.php?rev=55900&r1=55899&r2=55900&view=diff
==============================================================================
--- trunk/egroupware/api/src/Link.php (original)
+++ trunk/egroupware/api/src/Link.php Wed Apr 27 21:11:41 2016
@@ -145,7 +145,7 @@
'name' => 'Accounts',
'icon' => 'addressbook/accounts',
'query' => 'accounts::link_query',
- 'title' => 'common::grab_owner_name',
+ 'title' => 'EGroupware\\Api\\Accounts::username',
'view' => array('menuaction'=>'addressbook.addressbook_ui.view','ajax'=>'true'),
'view_id' => 'account_id'
),
Modified: trunk/phpgwapi/inc/class.common.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/phpgwapi/inc/class.common.inc.php?rev=55900&r1=55899&r2=55900&view=diff
==============================================================================
--- trunk/phpgwapi/inc/class.common.inc.php (original)
+++ trunk/phpgwapi/inc/class.common.inc.php Wed Apr 27 21:11:41 2016
@@ -489,54 +489,11 @@
*
* @param $appname appication name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp'];
* @return string|boolean dir or false if no dir is found
+ * @deprecated use Api\Framework\Template::get_dir($appname)
*/
static function get_tpl_dir($appname = '')
{
- if (!$appname)
- {
- $appname = $GLOBALS['egw_info']['flags']['currentapp'];
- }
- if ($appname == 'logout' || $appname == 'login')
- {
- $appname = 'phpgwapi';
- }
-
- if (!isset($GLOBALS['egw_info']['server']['template_set']) && isset($GLOBALS['egw_info']['user']['preferences']['common']['template_set']))
- {
- $GLOBALS['egw_info']['server']['template_set'] = $GLOBALS['egw_info']['user']['preferences']['common']['template_set'];
- }
-
- // Setting this for display of template choices in user preferences
- if ($GLOBALS['egw_info']['server']['template_set'] == 'user_choice')
- {
- $GLOBALS['egw_info']['server']['usrtplchoice'] = 'user_choice';
- }
-
- if (($GLOBALS['egw_info']['server']['template_set'] == 'user_choice' ||
- !isset($GLOBALS['egw_info']['server']['template_set'])) &&
- isset($GLOBALS['egw_info']['user']['preferences']['common']['template_set']))
- {
- $GLOBALS['egw_info']['server']['template_set'] = $GLOBALS['egw_info']['user']['preferences']['common']['template_set'];
- }
- if (!file_exists(EGW_SERVER_ROOT.'/phpgwapi/templates/'.basename($GLOBALS['egw_info']['server']['template_set']).'/class.'.
- $GLOBALS['egw_info']['server']['template_set'].'_framework.inc.php') &&
- !file_exists(EGW_SERVER_ROOT.'/'.basename($GLOBALS['egw_info']['server']['template_set']).'/inc/class.'.
- $GLOBALS['egw_info']['server']['template_set'].'_framework.inc.php'))
- {
- $GLOBALS['egw_info']['server']['template_set'] = 'idots';
- }
- $tpldir = EGW_SERVER_ROOT . '/' . $appname . '/templates/' . $GLOBALS['egw_info']['server']['template_set'];
- $tpldir_default = EGW_SERVER_ROOT . '/' . $appname . '/templates/default';
-
- if (@is_dir($tpldir))
- {
- return $tpldir;
- }
- elseif (@is_dir($tpldir_default))
- {
- return $tpldir_default;
- }
- return False;
+ return Api\Framework\Template::get_dir($appname);
}
/**
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.