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

pull/41/head
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', 'no' => 'Nein',
'edit' => 'Bearbeiten', 'edit' => 'Bearbeiten',
'insert' => 'Einfügen', '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>.', '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', 'back_to_top' => 'Back to top',
'go_back' => 'Go back', 'go_back' => 'Go back',

View File

@ -41,7 +41,7 @@ $sm_lang = array(
'no' => 'No', 'no' => 'No',
'edit' => 'Edit', 'edit' => 'Edit',
'insert' => 'Insert', '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>.', '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', 'back_to_top' => 'Back to top',
'go_back' => 'Go back', 'go_back' => 'Go back',

View File

@ -41,7 +41,7 @@ $sm_lang = array(
'no' => 'Nee', 'no' => 'Nee',
'edit' => 'Wijzig', 'edit' => 'Wijzig',
'insert' => 'Voeg toe', '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>.', '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', 'back_to_top' => 'Terug naar boven',
'go_back' => 'Terug', 'go_back' => 'Terug',

View File

@ -41,7 +41,7 @@ $sm_lang = array(
'no' => 'Não', 'no' => 'Não',
'edit' => 'Editar', 'edit' => 'Editar',
'insert' => 'Inserir', '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>.', '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', 'back_to_top' => 'Voltar ao topo',
'go_back' => 'Go back', 'go_back' => 'Go back',

View File

@ -80,6 +80,12 @@ abstract class AbstractController implements ControllerInterface {
*/ */
protected $messages = array(); protected $messages = array();
/**
* Sidebar to add
* @var \psm\Util\Module\Sidebar $sidebar
*/
protected $sidebar;
/** /**
* Database object * Database object
* @var \psm\Service\Database $db * @var \psm\Service\Database $db
@ -181,6 +187,13 @@ abstract class AbstractController implements ControllerInterface {
if($this->add_menu) { if($this->add_menu) {
$tpl_data['html_menu'] = $this->createHTMLMenu(); $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? // add footer to page?
if($this->add_footer) { if($this->add_footer) {
$this->tpl->newTemplate('main_footer', 'main.tpl.html'); $this->tpl->newTemplate('main_footer', 'main.tpl.html');
@ -438,4 +451,14 @@ abstract class AbstractController implements ControllerInterface {
} }
return $this; 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() { protected function executeIndex() {
$this->setTemplateId('config', 'config.tpl.html'); $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( $config_db = $this->db->select(
PSM_DB_PREFIX . 'config', PSM_DB_PREFIX . 'config',

View File

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

View File

@ -69,6 +69,15 @@ class UserController extends AbstractController {
*/ */
protected function executeIndex() { protected function executeIndex() {
$this->setTemplateId('users_list', 'users.tpl.html'); $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 // build label array for the next loop
$servers_labels = array(); $servers_labels = array();
@ -105,6 +114,15 @@ class UserController extends AbstractController {
*/ */
protected function executeEdit() { protected function executeEdit() {
$this->setTemplateId('users_update', 'users.tpl.html'); $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; $user_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
$fields_prefill = array('name', 'user_name', 'mobile', 'email'); $fields_prefill = array('name', 'user_name', 'mobile', 'email');

View File

@ -80,22 +80,37 @@ class Template {
/** /**
* Add data to the 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 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 * @return string new template
*/ */
public function addTemplateData($id, $data) { public function addTemplateData($tpl_id, $data, $use_html = false) {
// does the template exist? if($use_html) {
if (!isset($this->templates[$id])) { // no template
// file does not exist $source = $tpl_id;
trigger_error('Template not found with id: '.$id); } else {
return false; // 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) { 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--> <!--%tpl_config-->
{config_update} <form class="form-horizontal well" action="index.php?mod=config&action=save" id="edit_config" method="post">
<div class="span12">
<form class="form-horizontal well" action="index.php?mod=config&action=save" id="edit_config" method="post">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="#config-general" data-toggle="tab">{label_general}</a></li> <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> <li><a href="#config-email" data-toggle="tab">{label_settings_email}</a></li>
@ -177,12 +175,5 @@
</fieldset> </fieldset>
</div> </div>
</div> </div>
</form> </form>
</div> <!--%%tpl_config-->
<!--%%tpl_config-->
<!--%tpl_config_update-->
<div class="alert alert-info hide">
Please update!
</div>
<!--%%tpl_config_update-->

View File

@ -152,7 +152,7 @@ If no errors have occurred, you are good to go.<br><br></p>
<!--%tpl_install_results--> <!--%tpl_install_results-->
<!--%tpl_repeat_resultmsgs--> <!--%tpl_repeat_resultmsgs-->
<div> <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> <p class="offset1">{message}</p>
</div> </div>
<!--%%tpl_repeat_resultmsgs--> <!--%%tpl_repeat_resultmsgs-->

View File

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

View File

@ -45,12 +45,12 @@
<!-- container --> <!-- container -->
<div class="container-fluid"> <div class="container-fluid">
<div class="page-header"> <div class="page-header">
<h1>{subtitle}<small>&nbsp;</small></h1> <h1>{subtitle}<small>&nbsp;</small></h1>
</div> </div>
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> {html_sidebar}
<div class="span{content_span}">
<div id="flashmessage" class="hide"> <div id="flashmessage" class="hide">
<!--%tpl_repeat_messages--> <!--%tpl_repeat_messages-->
<div class="alert alert-{shortcode}"> <div class="alert alert-{shortcode}">
@ -60,9 +60,9 @@
<!--%%tpl_repeat_messages--> <!--%%tpl_repeat_messages-->
{messages} {messages}
</div> </div>
{content}
</div> </div>
</div> </div>
<div class="row-fluid">{content}</div>
{html_footer} {html_footer}
</div> </div>
<!-- /container --> <!-- /container -->
@ -76,8 +76,8 @@
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{label_usermenu} <b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown">{label_usermenu} <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="{url_profile}">{label_profile}</a></li> <li><a href="{url_profile}"><i class="icon-cog"></i>&nbsp;{label_profile}</a></li>
<li><a href="{url_logout}">{label_logout}</a></li> <li><a href="{url_logout}"><i class="icon-off"></i>&nbsp;{label_logout}</a></li>
</ul> </ul>
</li> </li>
</ul> </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--> <!--%tpl_servers_list-->
<div class="span12"> <table class="table table-bordered table-striped">
{html_buttons_admin} <thead>
<table class="table table-bordered table-striped"> <tr>
<thead> <th>&nbsp;</th>
<tr> <th>{label_label}</th>
<th>&nbsp;</th> <th>{label_domain}</th>
<th>{label_label}</th> <th>{label_port}</th>
<th>{label_domain}</th> <th>{label_type}</th>
<th>{label_port}</th> <th>{label_last_check}</th>
<th>{label_type}</th> <th>{label_rtime}</th>
<th>{label_last_check}</th> <th>{label_last_online}</th>
<th>{label_rtime}</th> <th>{label_monitoring}</th>
<th>{label_last_online}</th> <th>{label_send_email}</th>
<th>{label_monitoring}</th> <th>{label_send_sms}</th>
<th>{label_send_email}</th> <th>{label_action}</th>
<th>{label_send_sms}</th> </tr>
<th>{label_action}</th> </thead>
</tr> <tbody>
</thead> <!--%tpl_repeat_servers-->
<tbody> <tr>
<!--%tpl_repeat_servers--> <td>
<tr> <span class="label label-status-{status}">
<td> <a href="#" title="{error}">{status}</a>
<span class="label label-status-{status}"> </span>
<a href="#" title="{error}">{status}</a> </td>
</span> <td>{label}</td>
</td> <td>{ip}</td>
<td>{label}</td> <td>{port}</td>
<td>{ip}</td> <td>{type}</td>
<td>{port}</td> <td>{last_check}</td>
<td>{type}</td> <td>{rtime} s</td>
<td>{last_check}</td> <td>{last_online}</td>
<td>{rtime} s</td> <td>{active}</td>
<td>{last_online}</td> <td>{email}</td>
<td>{active}</td> <td>{sms}</td>
<td>{email}</td> <td>{html_actions}</td>
<td>{sms}</td> </tr>
<td>{html_actions}</td> <!--%%tpl_repeat_servers-->
</tr> {servers}
<!--%%tpl_repeat_servers--> </tbody>
{servers} </table>
</tbody>
</table>
</div>
<!--%%tpl_servers_list--> <!--%%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--> <!--%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}"> <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> <i class="icon-pencil"></i>
@ -64,81 +52,79 @@
<!--%%tpl_servers_list_admin_actions--> <!--%%tpl_servers_list_admin_actions-->
<!--%tpl_servers_update--> <!--%tpl_servers_update-->
<div class="span12"> <form class="form-horizontal well" action="index.php?mod=server&action=save&id={edit_server_id}" method="post">
<form class="form-horizontal well" action="index.php?mod=server&action=save&id={edit_server_id}" method="post"> <fieldset>
<fieldset> <legend>{titlemode}</legend>
<legend>{titlemode}</legend> <div class="control-group">
<div class="control-group"> <label class="control-label" for="label">{label_label}</label>
<label class="control-label" for="label">{label_label}</label> <div class="controls">
<div class="controls"> <input type="text" id="label" name="label" value="{edit_value_label}" maxlength="255" />
<input type="text" id="label" name="label" value="{edit_value_label}" maxlength="255" /> </div>
</div> </div>
</div> <div class="control-group">
<div class="control-group"> <label class="control-label" for="ip">{label_domain}</label>
<label class="control-label" for="ip">{label_domain}</label> <div class="controls">
<div class="controls"> <input type="text" id="ip" name="ip" value="{edit_value_ip}" maxlength="100" />
<input type="text" id="ip" name="ip" value="{edit_value_ip}" maxlength="100" /> </div>
</div> </div>
</div> <div class="control-group">
<div class="control-group"> <label class="control-label" for="type">{label_type}</label>
<label class="control-label" for="type">{label_type}</label> <div class="controls">
<div class="controls"> <select id="type" name="type">
<select id="type" name="type"> <option value="service" {edit_type_selected_service}>{label_service}</option>
<option value="service" {edit_type_selected_service}>{label_service}</option> <option value="website" {edit_type_selected_website}>{label_website}</option>
<option value="website" {edit_type_selected_website}>{label_website}</option> </select>
</select> </div>
</div> </div>
</div> <div class="control-group">
<div class="control-group"> <label class="control-label" for="port">{label_port}</label>
<label class="control-label" for="port">{label_port}</label> <div class="controls">
<div class="controls"> <input class="input-mini" type="text" id="port" name="port" value="{edit_value_port}" maxlength="5" />
<input class="input-mini" type="text" id="port" name="port" value="{edit_value_port}" maxlength="5" /> </div>
</div> </div>
</div> <div class="control-group">
<div class="control-group"> <label class="control-label" for="pattern">{label_pattern}</label>
<label class="control-label" for="pattern">{label_pattern}</label> <div class="controls">
<div class="controls"> <input type="text" id="pattern" name="pattern" value="{edit_value_pattern}" maxlength="255" data-toggle="tooltip" title="{label_pattern_description}" />
<input type="text" id="pattern" name="pattern" value="{edit_value_pattern}" maxlength="255" data-toggle="tooltip" title="{label_pattern_description}" /> </div>
</div> </div>
</div> <div class="control-group">
<div class="control-group"> <label class="control-label" for="active">{label_monitoring}</label>
<label class="control-label" for="active">{label_monitoring}</label> <div class="controls">
<div class="controls"> <select id="active" name="active">
<select id="active" name="active"> <option value="yes" {edit_active_selected_yes}>{label_yes}</option>
<option value="yes" {edit_active_selected_yes}>{label_yes}</option> <option value="no" {edit_active_selected_no}>{label_no}</option>
<option value="no" {edit_active_selected_no}>{label_no}</option> </select>
</select> </div>
</div> </div>
</div> <div class="control-group">
<div class="control-group"> <label class="control-label" for="email">{label_send_email}</label>
<label class="control-label" for="email">{label_send_email}</label> <div class="controls">
<div class="controls"> <select id="email" name="email">
<select id="email" name="email"> <option value="yes" {edit_email_selected_yes}>{label_yes}</option>
<option value="yes" {edit_email_selected_yes}>{label_yes}</option> <option value="no" {edit_email_selected_no}>{label_no}</option>
<option value="no" {edit_email_selected_no}>{label_no}</option> </select>
</select> </div>
</div> </div>
</div> <div class="control-group">
<div class="control-group"> <label class="control-label" for="sms">{label_send_sms}</label>
<label class="control-label" for="sms">{label_send_sms}</label> <div class="controls">
<div class="controls"> <select id="sms" name="sms">
<select id="sms" name="sms"> <option value="yes" {edit_sms_selected_yes}>{label_yes}</option>
<option value="yes" {edit_sms_selected_yes}>{label_yes}</option> <option value="no" {edit_sms_selected_no}>{label_no}</option>
<option value="no" {edit_sms_selected_no}>{label_no}</option> </select>
</select> </div>
</div> </div>
</div> <div class="control-group">
<div class="control-group"> <label class="control-label" for="warning_threshold">{label_warning_threshold}</label>
<label class="control-label" for="warning_threshold">{label_warning_threshold}</label> <div class="controls">
<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}" />
<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>
</div> <div class="form-actions">
<div class="form-actions"> <button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn btn-success" type="submit">{label_save}</button> <a class="btn" href="{url_go_back}" >{label_go_back}</a>
<a class="btn" href="{url_go_back}" >{label_go_back}</a> </div>
</div> </fieldset>
</fieldset> </form>
</form>
</div>
<!--%%tpl_servers_update--> <!--%%tpl_servers_update-->

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

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

View File

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

View File

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