mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
cleaned up about to use framework->list_templates to support app like templates
This commit is contained in:
parent
e8c4786879
commit
7d19819ba1
@ -108,31 +108,31 @@ class about
|
||||
'appMaintainer' => $info['maintainer'],
|
||||
'appVersion' => $info['version'],
|
||||
'appLicense' => $this->_linkLicense($info['license']),
|
||||
'appDetails' => '<a href="'.$GLOBALS['egw_info']['server']['webserver_url'].'/about.php?app='.$app.'&nonavbar=true" onclick="egw_openWindowCentered2(this.href,this.target,750,410,'."'yes'".'); return false;"><img src="'.$GLOBALS['egw']->common->image('phpgwapi','view.png').'" /></a>'
|
||||
'appDetails' => '<a href="'.$GLOBALS['egw_info']['server']['webserver_url'].'/about.php?app='.$app.'&nonavbar=true" onclick="egw_openWindowCentered2(this.href,this.target,750,410,'."'yes'".'); return false;"><img src="'.common::image('phpgwapi','view.png').'" /></a>'
|
||||
);
|
||||
}
|
||||
|
||||
// get informations about the templates
|
||||
$templates = array();
|
||||
$templates[] = ''; // first empty row for eTemplate
|
||||
foreach($GLOBALS['egw']->common->list_templates() as $template => $templateinfo) {
|
||||
$info = $this->_getParsedTemplateInfo($template);
|
||||
foreach($GLOBALS['egw']->framework->list_templates(true) as $template => $info) {
|
||||
$info = $this->_getParsedTemplateInfo($info);
|
||||
$templates[] = array(
|
||||
'templateImage' => '<img src="'.$info['image'].'" />',
|
||||
'templateName' => $templateinfo['name'],
|
||||
'templateName' => $info['title'],
|
||||
'templateAuthor' => $info['author'],
|
||||
'templateMaintainer'=> $info['maintainer'],
|
||||
'templateVersion' => $info['version'],
|
||||
'templateLicense' => $this->_linkLicense($info['license']),
|
||||
'templateDetails' => '<a href="'.$GLOBALS['egw_info']['server']['webserver_url'].'/about.php?template='.$template.'&nonavbar=true" onclick="egw_openWindowCentered2(this.href,this.target,750,410,'."'yes'".'); return false;"><img src="'.$GLOBALS['egw']->common->image('phpgwapi','view.png').'" /></a>'
|
||||
'templateDetails' => '<a href="'.$GLOBALS['egw_info']['server']['webserver_url'].'/about.php?template='.$template.'&nonavbar=true" onclick="egw_openWindowCentered2(this.href,this.target,750,410,'."'yes'".'); return false;"><img src="'.common::image('phpgwapi','view.png').'" /></a>'
|
||||
);
|
||||
}
|
||||
|
||||
// get informations about installed languages
|
||||
$translations = array();
|
||||
$translations[] = ''; // first empty row for eTemplate
|
||||
$langs = $GLOBALS['egw']->translation->get_installed_langs();
|
||||
foreach($GLOBALS['egw']->translation->get_installed_langs() as $translation => $translationinfo) {
|
||||
$langs = translation::get_installed_langs();
|
||||
foreach(translation::get_installed_langs() as $translation => $translationinfo) {
|
||||
$translations[] = array(
|
||||
'langName' => $translationinfo.' ('.$translation.')'
|
||||
);
|
||||
@ -147,7 +147,7 @@ class about
|
||||
'translations' => $translations
|
||||
);
|
||||
|
||||
$tmpl =& CreateObject('etemplate.etemplate', 'phpgwapi.about.index');
|
||||
$tmpl = new etemplate('phpgwapi.about.index');
|
||||
$tmpl->exec('phpgwapi.about.index', $content);
|
||||
}
|
||||
|
||||
@ -171,7 +171,8 @@ class about
|
||||
$info = $this->_getParsedAppInfo($name);
|
||||
break;
|
||||
case 'template':
|
||||
$info = $this->_getParsedTemplateInfo($name);
|
||||
$templates = $GLOBALS['egw']->framework->list_templates(true);
|
||||
$info = $this->_getParsedTemplateInfo($templates[$name]);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -207,7 +208,7 @@ class about
|
||||
/**
|
||||
* parse template informations from setup.inc.php file
|
||||
*
|
||||
* @param string $template template template name
|
||||
* @param array $info template template info
|
||||
* @return array html formated informations about author(s),
|
||||
* maintainer(s), version, license of the
|
||||
* given application
|
||||
@ -215,33 +216,14 @@ class about
|
||||
* @access private
|
||||
* @since 1.4
|
||||
*/
|
||||
function _getParsedTemplateInfo($template)
|
||||
function _getParsedTemplateInfo($info)
|
||||
{
|
||||
// define the return array
|
||||
$ret = array(
|
||||
'image' => (file_exists($GLOBALS['egw_info']['template'][$template]['icon'])) ? $GLOBALS['egw_info']['template'][$template]['icon'] : $GLOBALS['egw']->common->image('thisdoesnotexist',array('navbar','nonav')),
|
||||
'author' => '',
|
||||
'maintainer' => '',
|
||||
'version' => '',
|
||||
'license' => '',
|
||||
'description' => '',
|
||||
'note' => ''
|
||||
);
|
||||
$info['image'] = file_exists(EGW_SERVER_ROOT.'/'.$info['icon']) ? '/'.$info['icon'] : common::image('thisdoesnotexist',array('navbar','nonav'));
|
||||
$info['author'] = $this->_getHtmlPersonalInfo($info, 'author');
|
||||
$info['maintainer'] = $this->_getHtmlPersonalInfo($info, 'maintainer');
|
||||
|
||||
if (!file_exists(EGW_INCLUDE_ROOT . "/phpgwapi/templates/$template/setup/setup.inc.php")) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
include(EGW_INCLUDE_ROOT . "/phpgwapi/templates/$template/setup/setup.inc.php");
|
||||
|
||||
$ret['author'] = $this->_getHtmlPersonalInfo($GLOBALS['egw_info']['template'][$template], 'author');
|
||||
$ret['maintainer'] = $this->_getHtmlPersonalInfo($GLOBALS['egw_info']['template'][$template], 'maintainer');
|
||||
$ret['version'] = $GLOBALS['egw_info']['template'][$template]['version'];
|
||||
$ret['license'] = $GLOBALS['egw_info']['template'][$template]['license'];
|
||||
$ret['description'] = $GLOBALS['egw_info']['template'][$template]['description'];
|
||||
$ret['note'] = $GLOBALS['egw_info']['template'][$template]['note'];
|
||||
|
||||
return $ret;
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
@ -274,7 +256,7 @@ class about
|
||||
|
||||
// define the return array
|
||||
$ret = array(
|
||||
'image' => $GLOBALS['egw']->common->image(isset($app_info['icon_app'])?$app_info['icon_app']:$app,
|
||||
'image' => common::image(isset($app_info['icon_app'])?$app_info['icon_app']:$app,
|
||||
isset($app_info['icon'])?$app_info['icon']:array('navbar','nonav')),
|
||||
'author' => '',
|
||||
'maintainer' => '',
|
||||
|
@ -198,7 +198,7 @@ abstract class egw_framework
|
||||
protected function _get_footer()
|
||||
{
|
||||
$var = Array(
|
||||
'img_root' => $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/templates/'.$this->template.'/images',
|
||||
'img_root' => $GLOBALS['egw_info']['server']['webserver_url'] . $this->template_dir.'/images',
|
||||
'version' => $GLOBALS['egw_info']['server']['versions']['phpgwapi']
|
||||
);
|
||||
if($GLOBALS['egw_info']['user']['preferences']['common']['show_generation_time'])
|
||||
@ -213,7 +213,7 @@ abstract class egw_framework
|
||||
}
|
||||
$var['page_generation_time'] .= '</span></div>';
|
||||
}
|
||||
$var['powered_by'] = lang('Powered by').' <a href="'.$GLOBALS['egw_info']['server']['webserver_url'].'/about.php">eGroupWare</a> '.lang('version').' '.$GLOBALS['egw_info']['server']['versions']['phpgwapi'];
|
||||
$var['powered_by'] = lang('Powered by').' <a href="'.egw::link('/about.php','','about').'">EGroupware</a> '.lang('version').' '.$GLOBALS['egw_info']['server']['versions']['phpgwapi'];
|
||||
|
||||
return $var;
|
||||
}
|
||||
@ -579,7 +579,7 @@ abstract class egw_framework
|
||||
}
|
||||
if ($GLOBALS['egw_info']['flags']['currentapp'] == 'preferences' || $GLOBALS['egw_info']['flags']['currentapp'] == 'about')
|
||||
{
|
||||
$app = $app_title = 'eGroupWare';
|
||||
$app = $app_title = 'EGroupware';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -810,9 +810,10 @@ abstract class egw_framework
|
||||
/**
|
||||
* List available templates
|
||||
*
|
||||
* @param boolean $full_data=false true: value is array with values for keys 'name', 'title', ...
|
||||
* @returns array alphabetically sorted list of templates
|
||||
*/
|
||||
static function list_templates()
|
||||
static function list_templates($full_data=false)
|
||||
{
|
||||
$list = array();
|
||||
// templates packaged in the api
|
||||
@ -824,11 +825,15 @@ abstract class egw_framework
|
||||
if (file_exists ($f = EGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry . '/setup/setup.inc.php'))
|
||||
{
|
||||
include($f);
|
||||
$list[$entry] = $GLOBALS['egw_info']['template'][$entry]['title'];
|
||||
$list[$entry] = $full_data ? $GLOBALS['egw_info']['template'][$entry] :
|
||||
$GLOBALS['egw_info']['template'][$entry]['title'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$list[$entry] = $entry;
|
||||
$list[$entry] = $full_data ? array(
|
||||
'name' => $entry,
|
||||
'title' => $entry,
|
||||
) : $entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -843,7 +848,8 @@ abstract class egw_framework
|
||||
include($f);
|
||||
if (isset($GLOBALS['egw_info']['template'][$entry]))
|
||||
{
|
||||
$list[$entry] = $GLOBALS['egw_info']['template'][$entry]['title'];
|
||||
$list[$entry] = $full_data ? $GLOBALS['egw_info']['template'][$entry] :
|
||||
$GLOBALS['egw_info']['template'][$entry]['title'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -852,7 +858,6 @@ abstract class egw_framework
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user