Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 10:15 PM

in-portal

Index: trunk/kernel/units/help/help_tag_processor.php
===================================================================
--- trunk/kernel/units/help/help_tag_processor.php (revision 1937)
+++ trunk/kernel/units/help/help_tag_processor.php (revision 1938)
@@ -1,80 +1,88 @@
<?php
class HelpTagProcessor extends kDBTagProcessor
{
function SectionTitle($params)
{
$rets = explode('.', $this->Application->GetVar('h_prefix') );
$this->Prefix = $rets[0];
$this->Special = isset($rets[1]) ? $rets[1] : '';
//$this->Prefix = $this->Application->GetVar('h_prefix');
$title_preset_name = $this->Application->GetVar('h_title_preset');
$title_presets = $this->Application->getUnitOption($this->Prefix,'TitlePresets');
$format = $title_presets[$title_preset_name]['format'];
$format = preg_replace('/[ ]*( ([\'"]{1}) | ([\(]{1}) ) \#.*\# (?(2) \1 | \) )[ ]*/Ux', ' ', $format);
$title_presets[$title_preset_name]['format'] = $format;
$this->Application->setUnitOption($this->Prefix,'TitlePresets',$title_presets);
$params['title_preset'] = $title_preset_name;
$ret = parent::SectionTitle($params);
return $ret;
}
function ShowHelp($params)
{
$module = $this->Application->GetVar('h_module');
$title_preset = $this->Application->GetVar('h_title_preset');
$sql = 'SELECT Path FROM '.TABLE_PREFIX.'Modules WHERE LOWER(Name)='.$this->Conn->qstr( strtolower($module) );
$module_path = $this->Conn->GetOne($sql);
$help_file = FULL_PATH.'/'.$module_path.'module_help/'.$title_preset.'.txt';
if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_EDIT_HELP') )
{
global $debugger;
$ret = 'Help file: <b>'.$debugger->getLocalFile($help_file).'</b><hr>';
}
else
{
$ret = '';
}
$help_data = file_exists($help_file) ? file_get_contents($help_file) : false;
if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_HELP') )
{
$this->Application->Factory->includeClassFile('FCKeditor');
$oFCKeditor = new FCKeditor('HelpContent');
$oFCKeditor->BasePath = $this->Application->BaseURL('/'.ADMIN_DIR.'/editor/cmseditor');
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = '300';
$oFCKeditor->ToolbarSet = 'Advanced';
$oFCKeditor->Value = $help_data;
$oFCKeditor->Config = Array(
'UserFilesPath' => DOC_ROOT.BASE_PATH.'kernel/user_files',
'ProjectPath' => $this->Application->ConfigValue('Site_Path'),
'CustomConfigurationsPath' => rtrim( $this->Application->BaseURL('/'.ADMIN_DIR.'/editor/inp_fckconfig.js'), '/'),
);
$ret .= $oFCKeditor->CreateHtml();
}
else
{
$ret .= $help_data ? $help_data : $this->Application->Phrase('la_section_help_file_missing');
}
return $ret;
}
+
+ function GetIcon($params)
+ {
+ $icon_var = getArrayValue($params,'var_name');
+ $icon = $this->Application->GetVar($icon_var);
+ if(!$icon) $icon = getArrayValue($params,'default_icon');
+ return $icon;
+ }
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/help/help_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/kernel/admin_templates/help.tpl
===================================================================
--- trunk/kernel/admin_templates/help.tpl (revision 1937)
+++ trunk/kernel/admin_templates/help.tpl (revision 1938)
@@ -1,62 +1,62 @@
<inp2:m_set nobody="yes"/>
<inp2:m_include t="incs/header"/>
<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
<!-- section header: begin -->
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr class="section_header_bg">
<td valign="top" class="admintitle" align="left">
- <img width="46" height="46" src="img/icons/<inp2:m_get name="h_icon"/>.gif" align="absmiddle" title="<inp2:m_phrase name="la_Help"/>">&nbsp;<inp2:m_phrase name="la_Help"/><br>
+ <img width="46" height="46" src="img/icons/<inp2:h_GetIcon var_name="h_icon" default_icon="icon46_help"/>.gif" align="absmiddle" title="<inp2:m_phrase name="la_Help"/>">&nbsp;<inp2:m_phrase name="la_Help"/><br>
<img src="img/spacer.gif" width="1" height="4"><br>
</td>
</tr>
</table>
<!-- section header: end -->
<!-- blue_bar: begin -->
<table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="100%" height="30">
<tr>
<td class="header_left_bg" nowrap width="80%" valign="middle">
<span class="tablenav_link"><inp2:h_SectionTitle/></span>
</td>
<td align="right" class="tablenav" width="20%" valign="middle">
</td>
</tr>
</table>
<!-- blue_bar: end -->
<inp2:m_if check="m_ConstOn" name="DBG_HELP">
<!-- ToolBar --->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save"/>', function() {
submit_event('h','OnSaveHelp');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel"/>', function() {
window.close();
}
) );
a_toolbar.Render();
</script>
</td>
</tr>
</tbody>
</table>
</inp2:m_if>
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td class="help_box">
<inp2:h_ShowHelp/>
</td>
</tr>
</tbody>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: trunk/kernel/admin_templates/help.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property
Index: trunk/core/units/help/help_tag_processor.php
===================================================================
--- trunk/core/units/help/help_tag_processor.php (revision 1937)
+++ trunk/core/units/help/help_tag_processor.php (revision 1938)
@@ -1,80 +1,88 @@
<?php
class HelpTagProcessor extends kDBTagProcessor
{
function SectionTitle($params)
{
$rets = explode('.', $this->Application->GetVar('h_prefix') );
$this->Prefix = $rets[0];
$this->Special = isset($rets[1]) ? $rets[1] : '';
//$this->Prefix = $this->Application->GetVar('h_prefix');
$title_preset_name = $this->Application->GetVar('h_title_preset');
$title_presets = $this->Application->getUnitOption($this->Prefix,'TitlePresets');
$format = $title_presets[$title_preset_name]['format'];
$format = preg_replace('/[ ]*( ([\'"]{1}) | ([\(]{1}) ) \#.*\# (?(2) \1 | \) )[ ]*/Ux', ' ', $format);
$title_presets[$title_preset_name]['format'] = $format;
$this->Application->setUnitOption($this->Prefix,'TitlePresets',$title_presets);
$params['title_preset'] = $title_preset_name;
$ret = parent::SectionTitle($params);
return $ret;
}
function ShowHelp($params)
{
$module = $this->Application->GetVar('h_module');
$title_preset = $this->Application->GetVar('h_title_preset');
$sql = 'SELECT Path FROM '.TABLE_PREFIX.'Modules WHERE LOWER(Name)='.$this->Conn->qstr( strtolower($module) );
$module_path = $this->Conn->GetOne($sql);
$help_file = FULL_PATH.'/'.$module_path.'module_help/'.$title_preset.'.txt';
if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_EDIT_HELP') )
{
global $debugger;
$ret = 'Help file: <b>'.$debugger->getLocalFile($help_file).'</b><hr>';
}
else
{
$ret = '';
}
$help_data = file_exists($help_file) ? file_get_contents($help_file) : false;
if( $this->Application->isDebugMode() && dbg_ConstOn('DBG_HELP') )
{
$this->Application->Factory->includeClassFile('FCKeditor');
$oFCKeditor = new FCKeditor('HelpContent');
$oFCKeditor->BasePath = $this->Application->BaseURL('/'.ADMIN_DIR.'/editor/cmseditor');
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = '300';
$oFCKeditor->ToolbarSet = 'Advanced';
$oFCKeditor->Value = $help_data;
$oFCKeditor->Config = Array(
'UserFilesPath' => DOC_ROOT.BASE_PATH.'kernel/user_files',
'ProjectPath' => $this->Application->ConfigValue('Site_Path'),
'CustomConfigurationsPath' => rtrim( $this->Application->BaseURL('/'.ADMIN_DIR.'/editor/inp_fckconfig.js'), '/'),
);
$ret .= $oFCKeditor->CreateHtml();
}
else
{
$ret .= $help_data ? $help_data : $this->Application->Phrase('la_section_help_file_missing');
}
return $ret;
}
+
+ function GetIcon($params)
+ {
+ $icon_var = getArrayValue($params,'var_name');
+ $icon = $this->Application->GetVar($icon_var);
+ if(!$icon) $icon = getArrayValue($params,'default_icon');
+ return $icon;
+ }
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/help/help_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3
\ No newline at end of property
+1.4
\ No newline at end of property

Event Timeline