1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +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 * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * 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$
* *
*/ * $URL$
* $Id$
/**
* e107 Clock display menu plugin
*
* Handles the display of a clock/calendar in a menu
*
* @package e107_plugins
* @subpackage clock
* @version $Id$;
*/ */
$eplug_admin = TRUE; $eplug_admin = TRUE;
require_once('../../class2.php'); require_once('../../class2.php');
if (!getperms('1')) if (!getperms('1'))
@@ -34,8 +23,12 @@ if (!getperms('1'))
} }
require_once(e_ADMIN.'auth.php'); require_once(e_ADMIN.'auth.php');
include_lan(e_PLUGIN.'clock_menu/languages/admin/'.e_LANGUAGE.'.php'); include_lan(e_PLUGIN.'clock_menu/languages/admin/'.e_LANGUAGE.'.php');
require_once(e_HANDLER.'form_handler.php'); require_once(e_HANDLER.'form_handler.php');
require_once(e_HANDLER.'message_handler.php');
$rs = new form; $rs = new form;
$frm = e107::getForm();
$mes = e107::getMessage();
$menu_pref = e107::getConfig('menu')->getPref(''); $menu_pref = e107::getConfig('menu')->getPref('');
if (isset($_POST['update_menu'])) if (isset($_POST['update_menu']))
@@ -61,73 +54,60 @@ if (isset($_POST['update_menu']))
} }
$menuPref->save(false, true, false); $menuPref->save(false, true, false);
} }
$ns->tablerender('', "<div style=\"text-align:center\"><b>".CLOCK_AD_L1.'</b></div>');
} }
$text = "<div style='text-align:center'> $ns->tablerender($caption, $mes->render(). $text);
<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
<table style=\"width:85%\" class=\"fborder\">";
// Title $text = "
$text .= "<tr> <form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L2.": </td> <table class='table adminform'>
<td style=\"width:60%\" class='forumheader3'> <colgroup span='2'>
<input class=\"tbox\" type=\"text\" name=\"clock_caption\" size=\"20\" value=\"".$menu_pref['clock_caption']."\" maxlength=\"100\" /> <col class='col-label' />
</td> <col class='col-control' />
</tr>"; </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>
// Format Time <tr>
$text .= "<tr> <td>".CLOCK_AD_L5.": </td>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L5.": </td> <td>".($menu_pref['clock_format'] == 1 ? $rs->form_checkbox("clock_format", 1, 1) : $rs->form_checkbox("clock_format", 1, 0) )."
<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) )." <span class='field-help'>".CLOCK_AD_L6."</span></td>
<br /><b class='smalltext'>".CLOCK_AD_L6."</b></td> </tr>
</tr>";
// Date Prefix <tr>
$text .= "<tr> <td>".CLOCK_AD_L7.": </td>
<td style=\"width:40%\" class='forumheader3'>".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>
<td style=\"width:60%\" class='forumheader3'> </tr>
<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>";
// Date Suffix <tr>
$text .= "<tr> <td>".CLOCK_AD_L9.": </td>
<td style=\"width:40%\" class='forumheader3'>".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>
<td style=\"width:60%\" class='forumheader3'> </tr>
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>";
$text .= "<tr> <tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L10.": </td> <td>".CLOCK_AD_L10.": </td>
<td style=\"width:60%\" class='forumheader3'> <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>
2<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix2\" size=\"10\" value=\"".$menu_pref['clock_datesuffix2']."\" maxlength=\"50\" /> </tr>
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr> <tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L11.": </td> <td>".CLOCK_AD_L11.": </td>
<td style=\"width:60%\" class='forumheader3'> <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>
3<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix3\" size=\"10\" value=\"".$menu_pref['clock_datesuffix3']."\" maxlength=\"50\" /> </tr>
<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
</tr>";
$text .= "<tr> <tr>
<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L12.": </td> <td>".CLOCK_AD_L12.": </td>
<td style=\"width:60%\" class='forumheader3'> <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>
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> </tr>
</table> </table>
<div class='buttons-bar center'>
".$frm->admin_button('update_menu', LAN_UPDATE, 'update')."
</div>
</form> </form>
</div>"; ";
$ns->tablerender(CLOCK_AD_L4, $text); $ns->tablerender(CLOCK_AD_L4, $text);
require_once(e_ADMIN."footer.php"); require_once(e_ADMIN."footer.php");
?> ?>

View File

@@ -2,21 +2,15 @@
/* /*
* e107 website system * 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 * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * 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_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_L4", "Clock Menu Config");
define("CLOCK_AD_L5", "AM/PM"); 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"); 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");