Adding sidebar functionality using sidebar util;adding icons to profile menu;fixing shortcode for install page

This commit is contained in:
Pepijn Over 2014-03-28 17:00:23 +01:00
parent c7a3ba66c1
commit 9e788e0971
20 changed files with 571 additions and 351 deletions

View File

@ -41,7 +41,7 @@ $sm_lang = array(
'no' => 'Nein',
'edit' => 'Bearbeiten',
'insert' => 'Einfügen',
'add_new' => 'Neuen Eintrag erstellen?',
'add_new' => 'Neuen Eintrag erstellen',
'update_available' => 'Ein neues Update ist verf&uuml;gbar auf <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',

View File

@ -41,7 +41,7 @@ $sm_lang = array(
'no' => 'No',
'edit' => 'Edit',
'insert' => 'Insert',
'add_new' => 'Add new?',
'add_new' => 'Add new',
'update_available' => 'A new update is available from <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',

View File

@ -41,7 +41,7 @@ $sm_lang = array(
'no' => 'Nee',
'edit' => 'Wijzig',
'insert' => 'Voeg toe',
'add_new' => 'Voeg toe?',
'add_new' => 'Voeg toe',
'update_available' => 'Een nieuwe update is beschikbaar op <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Terug naar boven',
'go_back' => 'Terug',

View File

@ -41,7 +41,7 @@ $sm_lang = array(
'no' => 'Não',
'edit' => 'Editar',
'insert' => 'Inserir',
'add_new' => 'Adicionar novo?',
'add_new' => 'Adicionar novo',
'update_available' => 'Uma atualização disponível em <a href="http://www.phpservermonitor.org" target="_blank">http://www.phpservermonitor.org</a>.',
'back_to_top' => 'Voltar ao topo',
'go_back' => 'Go back',

View File

@ -80,6 +80,12 @@ abstract class AbstractController implements ControllerInterface {
*/
protected $messages = array();
/**
* Sidebar to add
* @var \psm\Util\Module\Sidebar $sidebar
*/
protected $sidebar;
/**
* Database object
* @var \psm\Service\Database $db
@ -181,6 +187,13 @@ abstract class AbstractController implements ControllerInterface {
if($this->add_menu) {
$tpl_data['html_menu'] = $this->createHTMLMenu();
}
// add sidebar to page?
if($this->sidebar !== null) {
$tpl_data['html_sidebar'] = $this->sidebar->createHTML();
$tpl_data['content_span'] = '9';
} else {
$tpl_data['content_span'] = '12';
}
// add footer to page?
if($this->add_footer) {
$this->tpl->newTemplate('main_footer', 'main.tpl.html');
@ -438,4 +451,14 @@ abstract class AbstractController implements ControllerInterface {
}
return $this;
}
/**
* Add a sidebar to the page
* @param \psm\Util\Module\SidebarInterface $sidebar
* @return \psm\Module\ControllerInterface
*/
public function setSidebar(\psm\Util\Module\SidebarInterface $sidebar) {
$this->sidebar = $sidebar;
return $this;
}
}

View File

@ -77,6 +77,15 @@ class ConfigController extends AbstractController {
*/
protected function executeIndex() {
$this->setTemplateId('config', 'config.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar);
$sidebar->addLink(
'save',
psm_get_lang('system', 'save'),
"javascript:$('#edit_config').submit();",
'ok'
);
$config_db = $this->db->select(
PSM_DB_PREFIX . 'config',

View File

@ -52,20 +52,31 @@ class ServerController extends AbstractServerController {
*/
protected function executeIndex() {
$this->setTemplateId('servers_list', 'servers.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar);
// check if user is admin, in that case we add the buttons
if($this->user->getUserLevel() == PSM_USER_ADMIN) {
// first add buttons at the top
$this->tpl->newTemplate('servers_list_admin_buttons', 'servers.tpl.html');
$this->tpl->addTemplateData($this->getTemplateId(), array(
'html_buttons_admin' => $this->tpl->getTemplate('servers_list_admin_buttons'),
'url_add' => psm_build_url(array('mod' => 'server', 'action' => 'edit'))
));
$sidebar->addLink(
'add_new',
psm_get_lang('system', 'add_new'),
psm_build_url(array('mod' => 'server', 'action' => 'edit')),
'plus'
);
// get the action buttons per server
$this->tpl->newTemplate('servers_list_admin_actions', 'servers.tpl.html');
$html_actions = $this->tpl->getTemplate('servers_list_admin_actions');
} else {
$html_actions = '';
}
$sidebar->addLink(
'update',
psm_get_lang('menu', 'server_update'),
psm_build_url(array('mod' => 'server_update')),
'refresh'
);
// we need an array for our template magic (see below):
$html_actions = array('html_actions' => $html_actions);
@ -114,6 +125,15 @@ class ServerController extends AbstractServerController {
*/
protected function executeEdit() {
$this->setTemplateId('servers_update', 'servers.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar);
$sidebar->addLink(
'go_back',
psm_get_lang('system', 'go_back'),
psm_build_url(array('mod' => 'server')),
'th-list'
);
$server_id = isset($_GET['id']) ? intval($_GET['id']) : 0;

View File

@ -69,6 +69,15 @@ class UserController extends AbstractController {
*/
protected function executeIndex() {
$this->setTemplateId('users_list', 'users.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar);
$sidebar->addLink(
'add_new',
psm_get_lang('system', 'add_new'),
psm_build_url(array('mod' => 'user', 'action' => 'edit')),
'plus'
);
// build label array for the next loop
$servers_labels = array();
@ -105,6 +114,15 @@ class UserController extends AbstractController {
*/
protected function executeEdit() {
$this->setTemplateId('users_update', 'users.tpl.html');
$sidebar = new \psm\Util\Module\Sidebar($this->tpl);
$this->setSidebar($sidebar);
$sidebar->addLink(
'go_back',
psm_get_lang('system', 'go_back'),
psm_build_url(array('mod' => 'user')),
'th-list'
);
$user_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
$fields_prefill = array('name', 'user_name', 'mobile', 'email');

View File

@ -80,22 +80,37 @@ class Template {
/**
* Add data to the template
*
* @param string $id template_id used by add_template()
* @param string $tpl_id template_id used by add_template()
* @param array $data
* @param boolean $use_html if true, $tpl_id is considered to be HTML code and used rather than a template
* @return string new template
*/
public function addTemplateData($id, $data) {
// does the template exist?
if (!isset($this->templates[$id])) {
// file does not exist
trigger_error('Template not found with id: '.$id);
return false;
public function addTemplateData($tpl_id, $data, $use_html = false) {
if($use_html) {
// no template
$source = $tpl_id;
} else {
// does the template exist?
if (!isset($this->templates[$tpl_id])) {
// file does not exist
trigger_error("Template '{$tpl_id}' could not be found", E_USER_WARNING);
return false;
}
$source =& $this->templates[$tpl_id];
}
foreach($data as $key => $value) {
$this->templates[$id] = str_replace('{'.$key.'}', $value, $this->templates[$id]);
if(is_array($value)) {
$subdata = array();
foreach($value as $k => $v) {
$subdata[$key.'_'.$k] = $v;
}
$source = $this->assignTplVar($source, $subdata, true);
} else {
$source = str_replace('{'.$key.'}', $value, $source);
}
}
return $this->templates[$id];
return $source;
}
/**

View File

@ -0,0 +1,122 @@
<?php
/**
* PHP Server Monitor
* Monitor your servers and websites.
*
* This file is part of PHP Server Monitor.
* PHP Server Monitor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PHP Server Monitor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
*
* @package phpservermon
* @author Pepijn Over <pep@neanderthal-technology.com>
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
**/
namespace psm\Util\Module;
use psm\Service\Template;
class Sidebar implements SidebarInterface {
/**
* ID of active item
* @var string $active_id
* @see setActiveItem()
*/
protected $active_id;
/**
* List of all sidebar items
* @var array $items
*/
protected $items = array();
/**
* Template service
* @var \psm\Service\Template $tpl
*/
protected $tpl;
public function __construct(Template $tpl) {
$this->tpl = $tpl;
}
/**
* Set active item
* @param string $id
* @return \psm\Util\Module\Sidebar
*/
public function setActiveItem($id) {
$this->active_id = $id;
return $this;
}
/**
* Add new link to sidebar
* @param string $id
* @param string $label
* @param string $url
* @param string $icon
* @return \psm\Util\Module\Sidebar
*/
public function addLink($id, $label, $url, $icon = null) {
if(!isset($this->items['link'])) {
$this->items['link'] = array();
}
$this->items['link'][$id] = array(
'type' => 'link',
'label' => $label,
'url' => str_replace('"', '\"', $url),
'icon' => $icon,
);
return $this;
}
public function createHTML() {
$tpl_id = 'main_sidebar_container';
$this->tpl->newTemplate($tpl_id, 'main_sidebar.tpl.html');
$types = array('link');
$items = array();
// loop through all types and build their html
foreach($types as $type) {
if(empty($this->items[$type])) {
// no items for this type
continue;
}
// retrieve template for this type once so we can use it in the loop
$tpl_id_type = 'main_sidebar_types_' . $type;
$this->tpl->newTemplate($tpl_id_type, 'main_sidebar.tpl.html');
$html_type = $this->tpl->getTemplate($tpl_id_type);
// build html for each individual item
foreach($this->items[$type] as $id => $item) {
$items[] = array(
'html_item' => $this->tpl->addTemplateData($html_type, $item, true),
'class_active' => ($id === $this->active_id) ? 'active' : '',
);
}
}
if(!empty($items)) {
$this->tpl->addTemplateDataRepeat($tpl_id, 'items', $items);
}
$html = $this->tpl->getTemplate($tpl_id);
return $html;
}
}

View File

@ -0,0 +1,36 @@
<?php
/**
* PHP Server Monitor
* Monitor your servers and websites.
*
* This file is part of PHP Server Monitor.
* PHP Server Monitor is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PHP Server Monitor is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
*
* @package phpservermon
* @author Pepijn Over <pep@neanderthal-technology.com>
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
**/
namespace psm\Util\Module;
interface SidebarInterface {
public function __construct(\psm\Service\Template $tpl);
public function createHTML();
}

View File

@ -1,7 +1,5 @@
<!--%tpl_config-->
{config_update}
<div class="span12">
<form class="form-horizontal well" action="index.php?mod=config&action=save" id="edit_config" method="post">
<form class="form-horizontal well" action="index.php?mod=config&action=save" id="edit_config" method="post">
<ul class="nav nav-tabs">
<li class="active"><a href="#config-general" data-toggle="tab">{label_general}</a></li>
<li><a href="#config-email" data-toggle="tab">{label_settings_email}</a></li>
@ -177,12 +175,5 @@
</fieldset>
</div>
</div>
</form>
</div>
<!--%%tpl_config-->
<!--%tpl_config_update-->
<div class="alert alert-info hide">
Please update!
</div>
<!--%%tpl_config_update-->
</form>
<!--%%tpl_config-->

View File

@ -152,7 +152,7 @@ If no errors have occurred, you are good to go.<br><br></p>
<!--%tpl_install_results-->
<!--%tpl_repeat_resultmsgs-->
<div>
<p class="pull-left"><span class="label label-{shortcode}">{status}</span></p>
<p class="pull-left"><span class="label label-{shortcode}">{shortcode}</span></p>
<p class="offset1">{message}</p>
</div>
<!--%%tpl_repeat_resultmsgs-->

View File

@ -1,23 +1,21 @@
<!--%tpl_log_list-->
<div class="span12">
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#log_status_content" data-toggle="tab">{label_status}</a></li>
<li><a href="#log_email_content" data-toggle="tab">{label_email}</a></li>
<li><a href="#log_sms_content" data-toggle="tab">{label_sms}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="log_status_content">
{content_status}
</div>
<div class="tab-pane" id="log_email_content">
{content_email}
</div>
<div class="tab-pane" id="log_sms_content">
{content_sms}
</div>
</div>
</div>
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#log_status_content" data-toggle="tab">{label_status}</a></li>
<li><a href="#log_email_content" data-toggle="tab">{label_email}</a></li>
<li><a href="#log_sms_content" data-toggle="tab">{label_sms}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="log_status_content">
{content_status}
</div>
<div class="tab-pane" id="log_email_content">
{content_email}
</div>
<div class="tab-pane" id="log_sms_content">
{content_sms}
</div>
</div>
</div>
<!--%%tpl_log_list-->

View File

@ -45,12 +45,12 @@
<!-- container -->
<div class="container-fluid">
<div class="page-header">
<h1>{subtitle}<small>&nbsp;</small></h1>
</div>
<div class="row-fluid">
<div class="span12">
{html_sidebar}
<div class="span{content_span}">
<div id="flashmessage" class="hide">
<!--%tpl_repeat_messages-->
<div class="alert alert-{shortcode}">
@ -60,9 +60,9 @@
<!--%%tpl_repeat_messages-->
{messages}
</div>
{content}
</div>
</div>
<div class="row-fluid">{content}</div>
</div>
{html_footer}
</div>
<!-- /container -->
@ -76,8 +76,8 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{label_usermenu} <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="{url_profile}">{label_profile}</a></li>
<li><a href="{url_logout}">{label_logout}</a></li>
<li><a href="{url_profile}"><i class="icon-cog"></i>&nbsp;{label_profile}</a></li>
<li><a href="{url_logout}"><i class="icon-off"></i>&nbsp;{label_logout}</a></li>
</ul>
</li>
</ul>

View File

@ -0,0 +1,15 @@
<!--%tpl_main_sidebar_container-->
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">{subtitle}</li>
<!--%tpl_repeat_items-->
<li class="{class_active}">{html_item}</li>
<!--%%tpl_repeat_items-->
{items}
</ul>
</div>
</div>
<!--%%tpl_main_sidebar_container-->
<!--%tpl_main_sidebar_types_link--><a href="{url}"><i class="icon-{icon}"></i>&nbsp;{label}</a><!--%%tpl_main_sidebar_types_link-->

View File

@ -1,59 +1,47 @@
<!--%tpl_servers_list-->
<div class="span12">
{html_buttons_admin}
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>&nbsp;</th>
<th>{label_label}</th>
<th>{label_domain}</th>
<th>{label_port}</th>
<th>{label_type}</th>
<th>{label_last_check}</th>
<th>{label_rtime}</th>
<th>{label_last_online}</th>
<th>{label_monitoring}</th>
<th>{label_send_email}</th>
<th>{label_send_sms}</th>
<th>{label_action}</th>
</tr>
</thead>
<tbody>
<!--%tpl_repeat_servers-->
<tr>
<td>
<span class="label label-status-{status}">
<a href="#" title="{error}">{status}</a>
</span>
</td>
<td>{label}</td>
<td>{ip}</td>
<td>{port}</td>
<td>{type}</td>
<td>{last_check}</td>
<td>{rtime} s</td>
<td>{last_online}</td>
<td>{active}</td>
<td>{email}</td>
<td>{sms}</td>
<td>{html_actions}</td>
</tr>
<!--%%tpl_repeat_servers-->
{servers}
</tbody>
</table>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>&nbsp;</th>
<th>{label_label}</th>
<th>{label_domain}</th>
<th>{label_port}</th>
<th>{label_type}</th>
<th>{label_last_check}</th>
<th>{label_rtime}</th>
<th>{label_last_online}</th>
<th>{label_monitoring}</th>
<th>{label_send_email}</th>
<th>{label_send_sms}</th>
<th>{label_action}</th>
</tr>
</thead>
<tbody>
<!--%tpl_repeat_servers-->
<tr>
<td>
<span class="label label-status-{status}">
<a href="#" title="{error}">{status}</a>
</span>
</td>
<td>{label}</td>
<td>{ip}</td>
<td>{port}</td>
<td>{type}</td>
<td>{last_check}</td>
<td>{rtime} s</td>
<td>{last_online}</td>
<td>{active}</td>
<td>{email}</td>
<td>{sms}</td>
<td>{html_actions}</td>
</tr>
<!--%%tpl_repeat_servers-->
{servers}
</tbody>
</table>
<!--%%tpl_servers_list-->
<!--%tpl_servers_list_admin_buttons-->
<div class="top_buutons">
<a class="btn btn-success" href="{url_add}">
<i class="icon-plus icon-white"></i>
{label_add_new}
</a>
</div>
<!--%%tpl_servers_list_admin_buttons-->
<!--%tpl_servers_list_admin_actions-->
<a class="btn btn-small" href="index.php?mod=server&amp;action=edit&amp;id={server_id}" title="{label_edit}">
<i class="icon-pencil"></i>
@ -64,81 +52,79 @@
<!--%%tpl_servers_list_admin_actions-->
<!--%tpl_servers_update-->
<div class="span12">
<form class="form-horizontal well" action="index.php?mod=server&action=save&id={edit_server_id}" method="post">
<fieldset>
<legend>{titlemode}</legend>
<div class="control-group">
<label class="control-label" for="label">{label_label}</label>
<div class="controls">
<input type="text" id="label" name="label" value="{edit_value_label}" maxlength="255" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ip">{label_domain}</label>
<div class="controls">
<input type="text" id="ip" name="ip" value="{edit_value_ip}" maxlength="100" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="type">{label_type}</label>
<div class="controls">
<select id="type" name="type">
<option value="service" {edit_type_selected_service}>{label_service}</option>
<option value="website" {edit_type_selected_website}>{label_website}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="port">{label_port}</label>
<div class="controls">
<input class="input-mini" type="text" id="port" name="port" value="{edit_value_port}" maxlength="5" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="pattern">{label_pattern}</label>
<div class="controls">
<input type="text" id="pattern" name="pattern" value="{edit_value_pattern}" maxlength="255" data-toggle="tooltip" title="{label_pattern_description}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="active">{label_monitoring}</label>
<div class="controls">
<select id="active" name="active">
<option value="yes" {edit_active_selected_yes}>{label_yes}</option>
<option value="no" {edit_active_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_send_email}</label>
<div class="controls">
<select id="email" name="email">
<option value="yes" {edit_email_selected_yes}>{label_yes}</option>
<option value="no" {edit_email_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="sms">{label_send_sms}</label>
<div class="controls">
<select id="sms" name="sms">
<option value="yes" {edit_sms_selected_yes}>{label_yes}</option>
<option value="no" {edit_sms_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="warning_threshold">{label_warning_threshold}</label>
<div class="controls">
<input class="input-mini" type="text" id="warning_threshold" name="warning_threshold" value="{edit_value_warning_threshold}" maxlength="5" data-toggle="tooltip" title="{label_warning_threshold_description}" />
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<a class="btn" href="{url_go_back}" >{label_go_back}</a>
</div>
</fieldset>
</form>
</div>
<form class="form-horizontal well" action="index.php?mod=server&action=save&id={edit_server_id}" method="post">
<fieldset>
<legend>{titlemode}</legend>
<div class="control-group">
<label class="control-label" for="label">{label_label}</label>
<div class="controls">
<input type="text" id="label" name="label" value="{edit_value_label}" maxlength="255" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ip">{label_domain}</label>
<div class="controls">
<input type="text" id="ip" name="ip" value="{edit_value_ip}" maxlength="100" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="type">{label_type}</label>
<div class="controls">
<select id="type" name="type">
<option value="service" {edit_type_selected_service}>{label_service}</option>
<option value="website" {edit_type_selected_website}>{label_website}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="port">{label_port}</label>
<div class="controls">
<input class="input-mini" type="text" id="port" name="port" value="{edit_value_port}" maxlength="5" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="pattern">{label_pattern}</label>
<div class="controls">
<input type="text" id="pattern" name="pattern" value="{edit_value_pattern}" maxlength="255" data-toggle="tooltip" title="{label_pattern_description}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="active">{label_monitoring}</label>
<div class="controls">
<select id="active" name="active">
<option value="yes" {edit_active_selected_yes}>{label_yes}</option>
<option value="no" {edit_active_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_send_email}</label>
<div class="controls">
<select id="email" name="email">
<option value="yes" {edit_email_selected_yes}>{label_yes}</option>
<option value="no" {edit_email_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="sms">{label_send_sms}</label>
<div class="controls">
<select id="sms" name="sms">
<option value="yes" {edit_sms_selected_yes}>{label_yes}</option>
<option value="no" {edit_sms_selected_no}>{label_no}</option>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="warning_threshold">{label_warning_threshold}</label>
<div class="controls">
<input class="input-mini" type="text" id="warning_threshold" name="warning_threshold" value="{edit_value_warning_threshold}" maxlength="5" data-toggle="tooltip" title="{label_warning_threshold_description}" />
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<a class="btn" href="{url_go_back}" >{label_go_back}</a>
</div>
</fieldset>
</form>
<!--%%tpl_servers_update-->

84
src/templates/user/profile.tpl.html Normal file → Executable file
View File

@ -1,51 +1,49 @@
<!--%tpl_user_profile-->
<div class="span12">
<form class="form-horizontal well" action="{form_action}" method="post">
<fieldset>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{name}" maxlength="255" required>
</div>
<form class="form-horizontal well" action="{form_action}" method="post">
<fieldset>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{name}" maxlength="255" required>
</div>
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
<input type="text" id="user_name" name="user_name" value="{user_name}" maxlength="64" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
<input type="text" id="user_name" name="user_name" value="{user_name}" maxlength="64" required>
</div>
<div class="control-group">
<label class="control-label" for="level">{label_level}</label>
<div class="controls"><input type="text" value="{level}" disabled="disabled" /></div>
</div>
<div class="control-group">
<label class="control-label" for="level">{label_level}</label>
<div class="controls"><input type="text" value="{level}" disabled="disabled" /></div>
</div>
<div class="control-group">
<label class="control-label" for="password">{label_password}</label>
<div class="controls">
<input type="password" id="password" name="password" maxlength="255" placeholder="{placeholder_password}" />
</div>
<div class="control-group">
<label class="control-label" for="password">{label_password}</label>
<div class="controls">
<input type="password" id="password" name="password" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="password_repeat">{label_password_repeat}</label>
<div class="controls">
<input type="password" id="password_repeat" name="password_repeat" maxlength="255" placeholder="{placeholder_password}" />
</div>
<div class="control-group">
<label class="control-label" for="password_repeat">{label_password_repeat}</label>
<div class="controls">
<input type="password" id="password_repeat" name="password_repeat" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{mobile}" maxlength="15" />
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{mobile}" maxlength="15" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="email" name="email" value="{email}" maxlength="255" required>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="email" name="email" value="{email}" maxlength="255" required>
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
</div>
</fieldset>
</form>
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
</div>
</fieldset>
</form>
<!--%%tpl_user_profile-->

View File

@ -1,123 +1,113 @@
<!--%tpl_users_list-->
<div class="span12">
<div class="top_buutons">
<a class="btn btn-success" href="index.php?mod=user&action=edit">
<i class="icon-plus icon-white"></i>
{label_add_new}
</a>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{label_name}</th>
<th>{label_user_name}</th>
<th>{label_level}</th>
<th>{label_mobile}</th>
<th>{label_email}</th>
<th>{label_servers}</th>
<th width="75">{label_action}</th>
</tr>
</thead>
<tbody>
<!--%tpl_repeat_users-->
<tr>
<td>{name}</td>
<td>{user_name}</td>
<td>{label_level_{level}}</td>
<td>{mobile}</td>
<td>{email}</td>
<td>{emp_servers}</td>
<td>
<a class="btn btn-small" href="index.php?mod=user&amp;action=edit&amp;id={user_id}" title="{label_edit}">
<i class="icon-pencil"></i>
</a>
<a class="btn btn-small btn-danger" href="javascript:sm_delete('{user_id}', 'user');" title="{label_delete}">
<i class="icon-remove icon-white"></i>
</a>
</td>
</tr>
<!--%%tpl_repeat_users-->
{users}
</tbody>
</table>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{label_name}</th>
<th>{label_user_name}</th>
<th>{label_level}</th>
<th>{label_mobile}</th>
<th>{label_email}</th>
<th>{label_servers}</th>
<th width="75">{label_action}</th>
</tr>
</thead>
<tbody>
<!--%tpl_repeat_users-->
<tr>
<td>{name}</td>
<td>{user_name}</td>
<td>{label_level_{level}}</td>
<td>{mobile}</td>
<td>{email}</td>
<td>{emp_servers}</td>
<td>
<a class="btn btn-small" href="index.php?mod=user&amp;action=edit&amp;id={user_id}" title="{label_edit}">
<i class="icon-pencil"></i>
</a>
<a class="btn btn-small btn-danger" href="javascript:sm_delete('{user_id}', 'user');" title="{label_delete}">
<i class="icon-remove icon-white"></i>
</a>
</td>
</tr>
<!--%%tpl_repeat_users-->
{users}
</tbody>
</table>
<!--%%tpl_users_list-->
<!--%tpl_users_update-->
<div class="span12">
<form class="form-horizontal well" action="index.php?mod=user&amp;action=save&amp;id={edit_user_id}" method="post">
<fieldset>
<legend>{titlemode}</legend>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{edit_value_name}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
<input type="text" id="user_name" name="user_name" value="{edit_value_user_name}" maxlength="64" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="level">{label_level}</label>
<div class="controls">
<select id="level" name="level">
<!--%tpl_repeat_levels-->
<option value="{value}" {selected}>{label}</option>
<!--%%tpl_repeat_levels-->
{levels}
</select>
<p class="help-block">
{label_level_description}
</p>
</div>
<form class="form-horizontal well" action="index.php?mod=user&amp;action=save&amp;id={edit_user_id}" method="post">
<fieldset>
<legend>{titlemode}</legend>
<div class="control-group">
<label class="control-label" for="name">{label_name}</label>
<div class="controls">
<input type="text" id="name" name="name" value="{edit_value_name}" maxlength="255" required>
</div>
<div class="control-group">
<label class="control-label" for="password">{label_password}</label>
<div class="controls">
<input type="password" id="password" name="password" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="password_repeat">{label_password_repeat}</label>
<div class="controls">
<input type="password" id="password_repeat" name="password_repeat" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{edit_value_mobile}" maxlength="15" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="email" name="email" value="{edit_value_email}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="servers[]">{label_servers}</label>
<div class="controls">
<!--%tpl_repeat_servers-->
<label class="checkbox">
<input id="server{server_id}"
type="checkbox"
name='server_id[]'
value='{server_id}' {edit_checked} >
{label}
</label>
<!--%%tpl_repeat_servers-->
{servers}
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn" onclick="history.back();return false;" >{label_go_back}</button>
</div>
</fieldset>
</form>
</div>
</div>
<div class="control-group">
<label class="control-label" for="user_name">{label_user_name}</label>
<div class="controls">
<input type="text" id="user_name" name="user_name" value="{edit_value_user_name}" maxlength="64" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="level">{label_level}</label>
<div class="controls">
<select id="level" name="level">
<!--%tpl_repeat_levels-->
<option value="{value}" {selected}>{label}</option>
<!--%%tpl_repeat_levels-->
{levels}
</select>
<p class="help-block">
{label_level_description}
</p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="password">{label_password}</label>
<div class="controls">
<input type="password" id="password" name="password" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="password_repeat">{label_password_repeat}</label>
<div class="controls">
<input type="password" id="password_repeat" name="password_repeat" maxlength="255" placeholder="{placeholder_password}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{edit_value_mobile}" maxlength="15" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="email" name="email" value="{edit_value_email}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="servers[]">{label_servers}</label>
<div class="controls">
<!--%tpl_repeat_servers-->
<label class="checkbox">
<input id="server{server_id}"
type="checkbox"
name='server_id[]'
value='{server_id}' {edit_checked} >
{label}
</label>
<!--%%tpl_repeat_servers-->
{servers}
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn" onclick="history.back();return false;" >{label_go_back}</button>
</div>
</fieldset>
</form>
<!--%%tpl_users_update-->

View File

@ -11,6 +11,9 @@ body {
padding-left: 0;
padding-right: 0;
}
.sidebar-nav {
padding: 9px 0;
}
body.install{
padding-top:20px;
}
@ -27,10 +30,6 @@ body.install{
color:#FFF;
text-decoration:none;
}
.top_buutons{
text-align:right;
padding:10px 0px 10px 0px;
}
.footer{
margin-top:20px;
border-top:1px solid #EEEEEE;