1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 04:10:38 +02:00

Clock_menu clean-up (#6, #90) - LAN and GUI

This commit is contained in:
Tijn Kuyper
2013-02-07 18:58:42 +01:00
parent 79a99069e6
commit c323ed4d4a
2 changed files with 57 additions and 83 deletions

View File

@@ -2,29 +2,18 @@
/*
* e107 website system
*
* Copyright (C) 2008-2009 e107 Inc (e107.org)
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Plugin Administration - Comment menu
* Plugin Administration - Clock menu
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/clock_menu/config.php,v $
* $Revision$
* $Date$
* $Author$
*
*/
/**
* e107 Clock display menu plugin
*
* Handles the display of a clock/calendar in a menu
*
* @package e107_plugins
* @subpackage clock
* @version $Id$;
* $URL$
* $Id$
*/
$eplug_admin = TRUE;
require_once('../../class2.php');
if (!getperms('1'))
@@ -34,8 +23,12 @@ if (!getperms('1'))
}
require_once(e_ADMIN.'auth.php');
include_lan(e_PLUGIN.'clock_menu/languages/admin/'.e_LANGUAGE.'.php');
require_once(e_HANDLER.'form_handler.php');
require_once(e_HANDLER.'message_handler.php');
$rs = new form;
$frm = e107::getForm();
$mes = e107::getMessage();
$menu_pref = e107::getConfig('menu')->getPref('');
if (isset($_POST['update_menu']))
@@ -61,73 +54,60 @@ if (isset($_POST['update_menu']))
}
$menuPref->save(false, true, false);
}
$ns->tablerender('', "<div style=\"text-align:center\"><b>".CLOCK_AD_L1.'</b></div>');
}
$text = "<div style='text-align:center'>
<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
<table style=\"width:85%\" class=\"fborder\">";
$ns->tablerender($caption, $mes->render(). $text);
$text = "
<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
<table class='table adminform'>
<colgroup span='2'>
<col class='col-label' />
<col class='col-control' />
</colgroup>
<tr>
<td>".CLOCK_AD_L2.": </td>
<td><input class='tbox' type='text' name='clock_caption' size='20' value='".$menu_pref['clock_caption']."' maxlength='100' /> </td>
</tr>
// Title
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L2.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"clock_caption\" size=\"20\" value=\"".$menu_pref['clock_caption']."\" maxlength=\"100\" />
</td>
</tr>";
<tr>
<td>".CLOCK_AD_L5.": </td>
<td>".($menu_pref['clock_format'] == 1 ? $rs->form_checkbox("clock_format", 1, 1) : $rs->form_checkbox("clock_format", 1, 0) )."
<span class='field-help'>".CLOCK_AD_L6."</span></td>
</tr>
<tr>
<td>".CLOCK_AD_L7.": </td>
<td><input class='tbox' type='text' name='clock_dateprefix' size='10' value='".$menu_pref['clock_dateprefix']."' maxlength='50' /><span class='field-help'>".CLOCK_AD_L8."</span></td>
</tr>
// Format Time
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L5.": </td>
<td style=\"width:60%\" class='forumheader3'>".($menu_pref['clock_format'] == 1 ? $rs->form_checkbox("clock_format", 1, 1) : $rs->form_checkbox("clock_format", 1, 0) )."
<br /><b class='smalltext'>".CLOCK_AD_L6."</b></td>
</tr>";
<tr>
<td>".CLOCK_AD_L9.": </td>
<td><input class='tbox' type='text' name='clock_datesuffix1' size='10' value='".$menu_pref['clock_datesuffix1']."' maxlength='50' /><span class='field-help'>".CLOCK_AD_L13."</span></td>
</tr>
// Date Prefix
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L7.": </td>
<td style=\"width:60%\" class='forumheader3'>
<input class=\"tbox\" type=\"text\" name=\"clock_dateprefix\" size=\"10\" value=\"".$menu_pref['clock_dateprefix']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L8."</b></td>
</tr>";
<tr>
<td>".CLOCK_AD_L10.": </td>
<td><input class='tbox' type='text' name='clock_datesuffix2' size='10' value='".$menu_pref['clock_datesuffix2']."' maxlength='50' /><span class='field-help'>".CLOCK_AD_L13."</span></td>
</tr>
// Date Suffix
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L9.": </td>
<td style=\"width:60%\" class='forumheader3'>
1<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix1\" size=\"10\" value=\"".$menu_pref['clock_datesuffix1']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
<tr>
<td>".CLOCK_AD_L11.": </td>
<td><input class='tbox' type='text' name='clock_datesuffix3' size='10' value='".$menu_pref['clock_datesuffix3']."' maxlength='50' /><span class='field-help'>".CLOCK_AD_L13."</span></td>
</tr>
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L10.": </td>
<td style=\"width:60%\" class='forumheader3'>
2<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix2\" size=\"10\" value=\"".$menu_pref['clock_datesuffix2']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L11.": </td>
<td style=\"width:60%\" class='forumheader3'>
3<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix3\" size=\"10\" value=\"".$menu_pref['clock_datesuffix3']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L12.": </td>
<td style=\"width:60%\" class='forumheader3'>
4<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix4\" size=\"10\" value=\"".$menu_pref['clock_datesuffix4']."\" maxlength=\"50\" />
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr style=\"vertical-align:top\">
<td colspan=\"2\" style=\"text-align:center\" class='forumheader'>
<input class=\"button\" type=\"submit\" name=\"update_menu\" value=\"".CLOCK_AD_L3."\" />
</td>
<tr>
<td>".CLOCK_AD_L12.": </td>
<td><input class='tbox' type='text' name='clock_datesuffix4' size='10' value='".$menu_pref['clock_datesuffix4']."' maxlength='50' /><span class='field-help'>".CLOCK_AD_L13."</span></td>
</tr>
</table>
<div class='buttons-bar center'>
".$frm->admin_button('update_menu', LAN_UPDATE, 'update')."
</div>
</form>
</div>";
";
$ns->tablerender(CLOCK_AD_L4, $text);
require_once(e_ADMIN."footer.php");
?>

View File

@@ -2,21 +2,15 @@
/*
* e107 website system
*
* Copyright (C) 2008-2009 e107 Inc (e107.org)
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/clock_menu/languages/admin/English.php,v $
* $Revision$
* $Date$
* $Author$
*/
*/
define("CLOCK_AD_L1", "Clock menu configuration saved");
//define("CLOCK_AD_L1", "Clock menu configuration saved");
define("CLOCK_AD_L2", "Caption");
define("CLOCK_AD_L3", "Update Menu Settings");
//define("CLOCK_AD_L3", "Update Menu Settings");
define("CLOCK_AD_L4", "Clock Menu Config");
define("CLOCK_AD_L5", "AM/PM");
define("CLOCK_AD_L6", "If checked, you will display time with US format (0-12 AM/PM format). Unchecked you will display a 'military' format 0-24 format");