Skip to content

Commit

Permalink
set page header for bclean in setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kyob committed Dec 14, 2015
1 parent e7a2171 commit 2e8b3b8
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 73 deletions.
2 changes: 2 additions & 0 deletions userpanel/lib/locale/pl/strings.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@
$_LANG['Authentication type:'] = 'Rodzaj uwierzytelniania:';
$_LANG['Userpanel authentication type'] = 'Rodzaj uwierzytelniania używany przez Userpanel';

$_LANG['Page header'] = 'Nagłówek strony';

?>
8 changes: 7 additions & 1 deletion userpanel/lib/setup_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function module_setup()
{
global $SMARTY, $DB, $USERPANEL, $layout, $LMS;
$layout['pagetitle'] = trans('Userpanel Configuration');
$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header', ''));
$SMARTY->assign('stylelist', getdir(USERPANEL_DIR . DIRECTORY_SEPARATOR . 'style', '^[a-z0-9]*$'));
$SMARTY->assign('style', ConfigHelper::getConfig('userpanel.style', 'default'));
$SMARTY->assign('hint', ConfigHelper::getConfig('userpanel.hint', 'modern'));
Expand Down Expand Up @@ -90,7 +91,12 @@ function module_submit_setup()
else
$DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES('userpanel', 'reminder_mail_body', ?)", array($_POST['reminder_mail_body']));

if ($DB->GetOne("SELECT 1 FROM uiconfig WHERE section = 'userpanel' AND var = 'reminder_sms_body'"))
if ($DB->GetOne("SELECT 1 FROM uiconfig WHERE section = 'userpanel' AND var = 'page_header'"))
$DB->Execute("UPDATE uiconfig SET value = ? WHERE section = 'userpanel' AND var = 'page_header'", array($_POST['page_header']));
else
$DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES('userpanel', 'page_header', ?)", array($_POST['page_header']));

if ($DB->GetOne("SELECT 1 FROM uiconfig WHERE section = 'userpanel' AND var = 'page_headerreminder_sms_body'"))
$DB->Execute("UPDATE uiconfig SET value = ? WHERE section = 'userpanel' AND var = 'reminder_sms_body'", array($_POST['reminder_sms_body']));
else
$DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES('userpanel', 'reminder_sms_body', ?)", array($_POST['reminder_sms_body']));
Expand Down
1 change: 1 addition & 0 deletions userpanel/modules/finances/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
}
}

$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header'));
$SMARTY->assign('userinfo', $userinfo);
$SMARTY->assign('balancelist', $balance);
$SMARTY->assign('assignments', $assignments);
Expand Down
2 changes: 2 additions & 0 deletions userpanel/modules/help/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ function module_main()
}
$solution = get_solution($problem);
$questions = get_questions($problem);

$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header'));
$SMARTY->assign('solution', $solution);
$SMARTY->assign('questions', $questions);
$SMARTY->display('module:help.html');
Expand Down
1 change: 1 addition & 0 deletions userpanel/modules/helpdesk/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ function module_main()
$helpdesklist[$idx]['lastmod'] = $LMS->DB->GetOne('SELECT MAX(createtime) FROM rtmessages WHERE ticketid = ?',
array($key['id']));

$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header'));
$queues = $LMS->DB->GetAll('SELECT id, name FROM rtqueues WHERE id IN (' . str_replace(';', ',', ConfigHelper::getConfig('userpanel.queues')) . ')');
$SMARTY->assign('queues', $queues);
$SMARTY->assign('helpdesklist', $helpdesklist);
Expand Down
1 change: 1 addition & 0 deletions userpanel/modules/info/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function module_main()
$fields_changed = $LMS->DB->GetRow('SELECT id FROM up_info_changes WHERE customerid = ?',
array($SESSION->id));

$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header'));
$SMARTY->assign('userinfo',$userinfo);
$SMARTY->assign('usernodes',$usernodes);
//$SMARTY->assign('balancelist',$balancelist);
Expand Down
1 change: 1 addition & 0 deletions userpanel/modules/modules/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
function module_main()
{
global $SMARTY;
$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header'));
$SMARTY->display('module:modules.html');
}

Expand Down
2 changes: 1 addition & 1 deletion userpanel/modules/notices/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function module_main()
$DB->Execute('UPDATE messageitems SET status = 2, lastdate = ?NOW? WHERE id = ?', array($confirm_urgent));
header('Location: ?m=notices');
}

$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header'));
$SMARTY->display('module:notices.html');
}

Expand Down
2 changes: 2 additions & 0 deletions userpanel/modules/stats/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function module_setup()
{
global $SMARTY,$LMS;
$SMARTY->assign('owner_stats', ConfigHelper::getConfig('userpanel.owner_stats'));

$SMARTY->display('module:stats:setup.html');
}

Expand Down Expand Up @@ -203,6 +204,7 @@ function module_main()

$layout['pagetitle'] = trans('Network Statistics');

$SMARTY->assign('page_header', ConfigHelper::getConfig('userpanel.page_header'));
$SMARTY->assign('bar', $bar ? $bar : 'month');
$SMARTY->display('module:stats.html');
}
Expand Down
2 changes: 1 addition & 1 deletion userpanel/style/bclean/body.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="row">
<div class="col-md-12">
<br/><h1>Alfa-System <small class="text-muted">{trans('Virtual Customer Service')}</small></h1>
<br/><h1>{$page_header} <small class="text-muted">{trans('Virtual Customer Service')}</small></h1>
</div>
</div>
{if $modules}
Expand Down
2 changes: 1 addition & 1 deletion userpanel/style/bclean/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="style/bclean/vendor/twbs/bootstrap/dist/css/bootstrap.min.css">
<!-- <link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css" integrity="sha384-XXXXXXXX" crossorigin="anonymous"> -->
<meta http-equiv="refresh" content="{ConfigHelper::getConfig('phpui.timeout')+5}">
<title>{trans("Virtual Customer Service")}</title>
<title>{$page_header} {trans("Virtual Customer Service")}</title>
<script src="style/default/common.js"></script>
</head>
<body>
Expand Down
151 changes: 82 additions & 69 deletions userpanel/templates/setup.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,82 @@
<!--// $Id$ //-->
<H1>{$layout.pagetitle}</H1>
<FORM NAME="config" METHOD="POST" ACTION="?m=userpanel&f=submit_setup">
<TABLE cellpadding="3" width="100%" class="lmsbox">
<THEAD>
<TR>
<TD colspan="2" class="bold">
{trans("Basic Configuration:")}
</TD>
</TR>
</THEAD>
<TBODY>
<TR>
<TD style="width: 1%;" class="text-left nobr">
{trans("Userpanel style:")}
</TD>
<TD style="width: 99%;">
<SELECT name="style" SIZE="1" {tip text="Userpanel design style"}>
{foreach from=$stylelist item=styleitem}
<OPTION value="{$styleitem}"{if ($styleitem == $style) || ($styleitem=="default" && $style == "")} selected{/if}>{$styleitem}</OPTION>
{/foreach}
</SELECT>
</TD>
</TR>
<TR>
<TD style="width: %1;" class="nobr">
{trans("Hint style:")}
</TD>
<TD style="width: 99%;">
<SELECT name="hint" SIZE="1" {tip text="Userpanel hints style. Chose modern for animated assistant, classic for tips in LMS style, or none to disable hints displaying"}>
<OPTION value="modern"{if $hint == 'modern'} SELECTED{/if}>{trans("modern")}</OPTION>
<OPTION value="classic"{if $hint == 'classic'} SELECTED{/if}>{trans("classic")}</OPTION>
<OPTION value="none"{if $hint == 'none'} SELECTED{/if}>{trans("none")}</OPTION>
</SELECT>
</TD>
</TR>
<TR>
<TD style="width: 1%;" class="nobr">
<label for="hide_nodes_modules">{trans("Disabling modules:")}</label>
</TD>
<TD style="width: 99%;">
<INPUT class="box light" type="checkbox" name="hide_nodes_modules" id="hide_nodes_modules" value="1"{if $hide_nodes_modules} checked{/if} {tip text="Hiding some modules useless when customer hasn't got any nodes"}>
</TD>
</TR>
<TR>
<TD style="width: 1%;" class="nobr">
<label for="reminder_mail_sender">{trans("Reminder mail sender:")}</label>
</TD>
<TD style="width: 99%;">
<INPUT type="text" size="50" name="reminder_mail_sender" id="reminder_mail_sender" value="{$reminder_mail_sender}" {tip text="Enter reminder mail sender"}>
</TD>
</TR>
<TR>
<TD style="width: 1%;" class="nobr">
<label for="reminder_mail_subject">{trans("Reminder mail subject:")}</label>
</TD>
<TD style="width: 99%;">
<INPUT type="text" size="50" name="reminder_mail_subject" id="reminder_mail_subject" value="{$reminder_mail_subject}" {tip text="Enter reminder mail subject"}>
</TD>
</TR>
<TR>
<TD style="width: 1%;" class="nobr">
<label for="reminder_mail_body">{trans("Reminder mail body:")}</label>
</TD>
<TD style="width: 99%;">
<TEXTAREA name="reminder_mail_body" id="reminder_mail_body" cols="60" rows="7" {tip text="Enter reminder mail body"}>{$reminder_mail_body}</TEXTAREA>
<TABLE cellpadding="3" width="100%" class="lmsbox">
<THEAD>
<TR>
<TD colspan="2" class="bold">
{trans("Basic Configuration:")}
</TD>
</TR>
</THEAD>
<TBODY>
<!-- remove condition if $page_header will be implemented in all themes -->
{if $style=='bclean'}
<TR>
<TD style="width: 1%;" class="nobr">
<label for="page_header">{trans("Page header")}:</label>
</TD>
<TD style="width: 99%;">
<INPUT type="text" size="50" name="page_header" id="page_header" value="{$page_header}">
</TD>
</TR>
{else}
<INPUT type="hidden" name="page_header" id="page_header" value="{$page_header}">
{/if}
<TR>
<TD style="width: 1%;" class="text-left nobr">
{trans("Userpanel style:")}
</TD>
<TD style="width: 99%;">
<SELECT name="style" SIZE="1" {tip text="Userpanel design style"}>
{foreach from=$stylelist item=styleitem}
<OPTION value="{$styleitem}"{if ($styleitem == $style) || ($styleitem=="default" && $style == "")} selected{/if}>{$styleitem}</OPTION>
{/foreach}
</SELECT>
</TD>
</TR>
<TR>
<TD style="width: %1;" class="nobr">
{trans("Hint style:")}
</TD>
<TD style="width: 99%;">
<SELECT name="hint" SIZE="1" {tip text="Userpanel hints style. Chose modern for animated assistant, classic for tips in LMS style, or none to disable hints displaying"}>
<OPTION value="modern"{if $hint == 'modern'} SELECTED{/if}>{trans("modern")}</OPTION>
<OPTION value="classic"{if $hint == 'classic'} SELECTED{/if}>{trans("classic")}</OPTION>
<OPTION value="none"{if $hint == 'none'} SELECTED{/if}>{trans("none")}</OPTION>
</SELECT>
</TD>
</TR>
<TR>
<TD style="width: 1%;" class="nobr">
<label for="hide_nodes_modules">{trans("Disabling modules:")}</label>
</TD>
<TD style="width: 99%;">
<INPUT class="box light" type="checkbox" name="hide_nodes_modules" id="hide_nodes_modules" value="1"{if $hide_nodes_modules} checked{/if} {tip text="Hiding some modules useless when customer hasn't got any nodes"}>
</TD>
</TR>
<TR>
<TD style="width: 1%;" class="nobr">
<label for="reminder_mail_sender">{trans("Reminder mail sender:")}</label>
</TD>
<TD style="width: 99%;">
<INPUT type="text" size="50" name="reminder_mail_sender" id="reminder_mail_sender" value="{$reminder_mail_sender}" {tip text="Enter reminder mail sender"}>
</TD>
</TR>
<TR>
<TD style="width: 1%;" class="nobr">
<label for="reminder_mail_subject">{trans("Reminder mail subject:")}</label>
</TD>
<TD style="width: 99%;">
<INPUT type="text" size="50" name="reminder_mail_subject" id="reminder_mail_subject" value="{$reminder_mail_subject}" {tip text="Enter reminder mail subject"}>
</TD>
</TR>
<TR>
<TD style="width: 1%;" class="nobr">
<label for="reminder_mail_body">{trans("Reminder mail body:")}</label>
</TD>
<TD style="width: 99%;">
<TEXTAREA name="reminder_mail_body" id="reminder_mail_body" cols="60" rows="7" {tip text="Enter reminder mail body"}>{$reminder_mail_body}</TEXTAREA>
</TD>
</TR>
<TR>
Expand Down Expand Up @@ -108,22 +121,22 @@ <H1>{$layout.pagetitle}</H1>
{cycle values="light,lucid" print=false}
{foreach from=$menu item=menuitem}
<TR class="{if !in_array($menuitem.module, $enabled_modules)}blend {/if}{cycle}" onmouseover="addClass(this, 'highlight')" onmouseout="removeClass(this, 'highlight')">
<td class="fleft" onClick="return self.location.href='?m=userpanel&module={$menuitem.module}';">
<td class="fleft" onClick="return self.location.href = '?m=userpanel&module={$menuitem.module}';">
{$menuitem.module}
</td>
<td onClick="return self.location.href='?m=userpanel&module={$menuitem.module}';">
<td onClick="return self.location.href = '?m=userpanel&module={$menuitem.module}';">
{$menuitem.name}
</td>
<td onClick="return self.location.href='?m=userpanel&module={$menuitem.module}';" align="center">
<td onClick="return self.location.href = '?m=userpanel&module={$menuitem.module}';" align="center">
{$menuitem.prio}
</td>
<td onClick="return self.location.href='?m=userpanel&module={$menuitem.module}';" align="center">
<td onClick="return self.location.href = '?m=userpanel&module={$menuitem.module}';" align="center">
{if $menuitem.dbver>0}{$menuitem.dbver}{else}{trans("-")}{/if}
</td>
<td onClick="return self.location.href='?m=userpanel&module={$menuitem.module}';">
<td onClick="return self.location.href = '?m=userpanel&module={$menuitem.module}';">
{t}{$menuitem.tip}{/t}
</td>
<td onClick="return self.location.href='?m=userpanel&module={$menuitem.module}';">
<td onClick="return self.location.href = '?m=userpanel&module={$menuitem.module}';">
{t}{$menuitem.description}{/t}
</td>
<td class="fright text-center">
Expand Down

0 comments on commit 2e8b3b8

Please sign in to comment.