Commit fd9ef2e5 authored by tbrehm's avatar tbrehm

Added atom feed widget to the left column of the dashboard.

parent 927aa38d
......@@ -27,3 +27,6 @@ webftp_url=
[domains]
use_domain_module=n
new_domain_html=Please contact our support to create a new domain for you.
[misc]
dashboard_atom_url=http://www.ispconfig.org/atom
This diff is collapsed.
......@@ -34,4 +34,5 @@ $wb['top_menu_billing'] = 'Billing';
$wb['top_menu_domain'] = 'Domains';
$wb['top_menu_dashboard'] = 'Home';
$wb['toolsarea_head_txt'] = 'Tools';
$wb['latest_news_txt'] = 'Latest news';
?>
......@@ -212,5 +212,25 @@ $form["tabs"]['domains'] = array (
)
);
$form["tabs"]['misc'] = array (
'title' => "Misc",
'width' => 70,
'template' => "templates/system_config_misc_edit.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'dashboard_atom_url' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => 'http://www.ispconfig.org/atom',
'value' => ''
),
##################################
# ENDE Datatable fields
##################################
)
);
?>
\ No newline at end of file
<?php
$wb['warning'] = 'Edit these values carefully! Do not remove the prefixes on a systems with more then one client.';
$wb['dbname_prefix_txt'] = 'Database name prefix';
$wb['dbuser_prefix_txt'] = 'Database user prefix';
$wb['shelluser_prefix_txt'] = 'Shell user prefix';
$wb['webdavuser_prefix_txt'] = 'Webdav user prefix';
$wb['ftpuser_prefix_txt'] = 'FTP user prefix';
$wb['dbname_prefix_error_regex'] = 'Char not allowed in database name prefix.';
$wb['dbuser_prefix_error_regex'] = 'Char not allowed in database user prefix.';
$wb['ftpuser_prefix_error_regex'] = 'Char not allowed in ftp user prefix.';
$wb['shelluser_prefix_error_regex'] = 'Char not allowed in shell user prefix.';
$wb['webdavuser_prefix_error_regex'] = 'Char not allowed in webdav user prefix.';
$wb['dblist_phpmyadmin_link_txt'] = 'Link to phpmyadmin in DB list';
$wb['mailboxlist_webmail_link_txt'] = 'Link to webmail in Mailbox list';
$wb['webmail_url_txt'] = 'Webmail URL';
$wb['phpmyadmin_url_txt'] = 'PHPMyAdmin URL';
$wb['use_domain_module_txt'] = 'Use the domain-module to add new domains';
$wb['use_domain_module_hint'] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They can not free edit the domain-field.You have to re-login after changing this value, to make the changes visible.';
$wb['new_domain_txt'] = 'HTML to create a new domain';
$wb['webftp_url_txt'] = 'WebFTP URL';
<?php
$wb["dashboard_atom_url_txt"] = 'Dashboard atom feed URL';
$wb["warning"] = 'Edit these values carefully! Do not remove the prefixes on a systems with more then one client.';
$wb["dbname_prefix_txt"] = 'Database name prefix';
$wb["dbuser_prefix_txt"] = 'Database user prefix';
$wb["shelluser_prefix_txt"] = 'Shell user prefix';
$wb["webdavuser_prefix_txt"] = 'Webdav user prefix';
$wb["ftpuser_prefix_txt"] = 'FTP user prefix';
$wb["dbname_prefix_error_regex"] = 'Char not allowed in database name prefix.';
$wb["dbuser_prefix_error_regex"] = 'Char not allowed in database user prefix.';
$wb["ftpuser_prefix_error_regex"] = 'Char not allowed in ftp user prefix.';
$wb["shelluser_prefix_error_regex"] = 'Char not allowed in shell user prefix.';
$wb["webdavuser_prefix_error_regex"] = 'Char not allowed in webdav user prefix.';
$wb["dblist_phpmyadmin_link_txt"] = 'Link to phpmyadmin in DB list';
$wb["mailboxlist_webmail_link_txt"] = 'Link to webmail in Mailbox list';
$wb["webmail_url_txt"] = 'Webmail URL';
$wb["phpmyadmin_url_txt"] = 'PHPMyAdmin URL';
$wb["use_domain_module_txt"] = 'Use the domain-module to add new domains';
$wb["use_domain_module_hint"] = 'If you use this module, your customers can only select one of the domains the admin creates for them. They can not free edit the domain-field.You have to re-login after changing this value, to make the changes visible.';
$wb["new_domain_txt"] = 'HTML to create a new domain';
$wb["webftp_url_txt"] = 'WebFTP URL';
?>
\ No newline at end of file
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_system_config">
<div class="pnl_formsarea">
<fieldset class="inlineLabels"><legend>Misc</legend>
<div class="ctrlHolder">
<label for="dashboard_atom_url">{tmpl_var name='dashboard_atom_url_txt'}</label>
<input name="dashboard_atom_url" id="dashboard_atom_url" value="{tmpl_var name='dashboard_atom_url'}" size="" maxlength="" type="text" class="textInput" />
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','admin/system_config_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('admin/server_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
<?php
/*
Copyright (c) 2010 Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
$app->uses('simplepie');
$app->tpl->newTemplate('dashboard/templates/custom_menu.htm');
$app->uses('getconf');
$misc_config = $app->getconf->get_global_config('misc');
//* We want to show the news only to the admin user
if($misc_config['dashboard_atom_url'] != '') {
if(!isset($_SESSION['s']['rss_news'])) {
$app->simplepie->set_feed_url('http://www.ispconfig.org/atom');
$app->simplepie->enable_cache(false);
$app->simplepie->init();
$items = $app->simplepie->get_items();
$rows = array();
foreach ($items as $item)
{
$rows[] = array('title' => $item->get_title(),
'link' => $item->get_link(),
'content' => $item->get_content(),
'date' => $item->get_date('Y-m-d')
);
}
$_SESSION['s']['rss_news'] = $rows;
} else {
$rows = $_SESSION['s']['rss_news'];
}
$app->tpl->setVar('latest_news_txt',$app->lng('latest_news_txt'));
}
$app->tpl->setLoop('news',$rows);
?>
\ No newline at end of file
......@@ -43,4 +43,6 @@ $module['tab_width'] = '';
// 'open' => 1,
// 'items' => $items);
?>
\ No newline at end of file
<ul id="submenu">
<li class="title"><a>{tmpl_var name='latest_news_txt'}</a></li>
<tmpl_loop name="news">
<li><a href="{tmpl_var name="link"}" target="_blank" style="margin-top:8px;padding-bottom:5px;"><b>{tmpl_var name="date"}</b><br />
{tmpl_var name="title"}</a>
</li>
</tmpl_loop>
</ul>
\ No newline at end of file
......@@ -80,28 +80,33 @@ if(isset($_GET['nav']) && $_GET['nav'] == 'top') {
//** Side Naviation
if(isset($_GET['nav']) && $_GET['nav'] == 'side') {
$app->tpl->newTemplate('sidenav.tpl.htm');
//* translating module navigation
$nav_translated = array();
if(isset($_SESSION['s']['module']['nav']) && is_array($_SESSION['s']['module']['nav'])) {
foreach($_SESSION['s']['module']['nav'] as $nav) {
$tmp_items = array();
foreach($nav['items'] as $item) {
$item['title'] = $app->lng($item['title']);
$tmp_items[] = $item;
if(is_file($_SESSION['s']['module']['name'].'/lib/custom_menu.inc.php')) {
include_once($_SESSION['s']['module']['name'].'/lib/custom_menu.inc.php');
} else {
$app->tpl->newTemplate('sidenav.tpl.htm');
//* translating module navigation
$nav_translated = array();
if(isset($_SESSION['s']['module']['nav']) && is_array($_SESSION['s']['module']['nav'])) {
foreach($_SESSION['s']['module']['nav'] as $nav) {
$tmp_items = array();
foreach($nav['items'] as $item) {
$item['title'] = $app->lng($item['title']);
$tmp_items[] = $item;
}
$nav['title'] = $app->lng($nav['title']);
$nav['startpage'] = $nav['items'][0]['link'];
$nav['items'] = $tmp_items;
$nav_translated[] = $nav;
}
$nav['title'] = $app->lng($nav['title']);
$nav['startpage'] = $nav['items'][0]['link'];
$nav['items'] = $tmp_items;
$nav_translated[] = $nav;
} else {
$nav_translated = null;
}
} else {
$nav_translated = null;
$app->tpl->setLoop('nav_left',$nav_translated);
}
$app->tpl->setLoop('nav_left',$nav_translated);
}
$app->tpl_defaults();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment