1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Frontpage (admin area) - LAN (#6) and code clean-up

This commit is contained in:
Tijn Kuyper
2013-02-25 18:33:00 +01:00
parent e69dad5c85
commit 0e01bbb032
3 changed files with 20 additions and 22 deletions

View File

@@ -8,10 +8,8 @@
* *
* Administration Area - Front page * Administration Area - Front page
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/frontpage.php,v $ * $URL$
* $Revision$ * $Id$
* $Date$
* $Author$
* *
*/ */
@@ -36,7 +34,7 @@ $e_sub_cat = 'frontpage';
require_once ('auth.php'); require_once ('auth.php');
require_once (e_HANDLER.'form_handler.php'); require_once (e_HANDLER.'form_handler.php');
require_once (e_HANDLER.'message_handler.php'); require_once (e_HANDLER.'message_handler.php');
$emessage = &eMessage::getInstance(); $mes = e107::getMessage();
require_once (e_HANDLER.'userclass_class.php'); require_once (e_HANDLER.'userclass_class.php');
@@ -275,7 +273,7 @@ if(isset($_POST['fp_save_new']))
} }
else else
{ // Someone playing games { // Someone playing games
$emessage->add('Software error', E_MESSAGE_ERROR); $mes->addError('Software error'); // TODO LAN
} }
} }
@@ -311,7 +309,6 @@ if($fp_update_prefs)
$corePrefs->set('frontpage', $fp_list); $corePrefs->set('frontpage', $fp_list);
$corePrefs->set('frontpage_force', $fp_force); $corePrefs->set('frontpage_force', $fp_force);
$result = $corePrefs->save(FALSE, TRUE); $result = $corePrefs->save(FALSE, TRUE);
$emessage->add(FRTLAN_1, E_MESSAGE_SUCCESS);
} }
@@ -325,17 +322,17 @@ if(isset($_POST['fp_add_new']))
{ {
$text = $fp->edit_rule(array('order' => 0, 'class' => e_UC_PUBLIC, 'page' => 'news.php', 'force' => FALSE)); // Display edit form as well $text = $fp->edit_rule(array('order' => 0, 'class' => e_UC_PUBLIC, 'page' => 'news.php', 'force' => FALSE)); // Display edit form as well
$text .= $fp->select_class($fp_settings, FALSE); $text .= $fp->select_class($fp_settings, FALSE);
$e107->ns->tablerender(FRTLAN_PAGE_TITLE." - ".FRTLAN_42, $text); $ns->tablerender(FRTLAN_PAGE_TITLE." - ".FRTLAN_42, $text);
} }
elseif(isset($_POST['fp_edit_rule'])) elseif(isset($_POST['fp_edit_rule']))
{ {
$text = $fp->edit_rule($fp_settings[key($_POST['fp_edit_rule'])]); // Display edit form as well $text = $fp->edit_rule($fp_settings[key($_POST['fp_edit_rule'])]); // Display edit form as well
$text .= $fp->select_class($fp_settings, FALSE); $text .= $fp->select_class($fp_settings, FALSE);
$e107->ns->tablerender(FRTLAN_PAGE_TITLE." - ".FRTLAN_46, $text); $ns->tablerender(FRTLAN_PAGE_TITLE." - ".FRTLAN_46, $text);
} }
else else
{ // Just show existing rules { // Just show existing rules
$e107->ns->tablerender(FRTLAN_PAGE_TITLE." - ".FRTLAN_13, $emessage->render().$fp->select_class($fp_settings, TRUE)); $ns->tablerender(FRTLAN_PAGE_TITLE." - ".FRTLAN_13, $mes->render().$fp->select_class($fp_settings, TRUE));
} }
@@ -379,7 +376,7 @@ class frontpage
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th class='first'>".FRTLAN_40."</th> <th class='first'>".LAN_ORDER."</th>
<th>".FRTLAN_53."</th> <th>".FRTLAN_53."</th>
<th>".FRTLAN_49."</th> <th>".FRTLAN_49."</th>
<th>".FRTLAN_35."</th> <th>".FRTLAN_35."</th>
@@ -401,7 +398,7 @@ class frontpage
<input class='image' type='image' src='".ADMIN_UP_ICON_PATH."' title='".FRTLAN_47."' value='".$order."' name='fp_inc".$order."' /> <input class='image' type='image' src='".ADMIN_UP_ICON_PATH."' title='".FRTLAN_47."' value='".$order."' name='fp_inc".$order."' />
<input class='image' type='image' src='".ADMIN_DOWN_ICON_PATH."' title='".FRTLAN_48."' value='".$order."' name='fp_dec".$order."' /> <input class='image' type='image' src='".ADMIN_DOWN_ICON_PATH."' title='".FRTLAN_48."' value='".$order."' name='fp_dec".$order."' />
<input class='image edit' type='image' title='".LAN_EDIT."' name='fp_edit_rule[".$order."]' src='".ADMIN_EDIT_ICON_PATH."' /> <input class='image edit' type='image' title='".LAN_EDIT."' name='fp_edit_rule[".$order."]' src='".ADMIN_EDIT_ICON_PATH."' />
<input class='image delete' type='image' title='".LAN_DELETE."' data-confirm='".FRTLAN_55."' name='fp_delete_rule[".$order."]' src='".ADMIN_DELETE_ICON_PATH."' /> <input class='image delete' type='image' title='".LAN_DELETE."' data-confirm='". LAN_CONFDELETE."' name='fp_delete_rule[".$order."]' src='".ADMIN_DELETE_ICON_PATH."' />
</td> </td>
</tr>"; </tr>";
} }
@@ -507,7 +504,7 @@ class frontpage
<div class='buttons-bar center'> <div class='buttons-bar center'>
".$this->frm->hidden('fp_order', $rule_info['order'])." ".$this->frm->hidden('fp_order', $rule_info['order'])."
".FRTLAN_43.e107::getUserClass()->uc_dropdown('class', $rule_info['class'], 'public,guest,member,admin,main,classes')." ".FRTLAN_43.e107::getUserClass()->uc_dropdown('class', $rule_info['class'], 'public,guest,member,admin,main,classes')."
".$this->frm->admin_button('fp_save_new', FRTLAN_12, 'update')." ".$this->frm->admin_button('fp_save_new', LAN_UPDATE, 'update')."
".$this->frm->admin_button('fp_cancel', LAN_CANCEL, 'cancel')." ".$this->frm->admin_button('fp_cancel', LAN_CANCEL, 'cancel')."
</div> </div>
</fieldset> </fieldset>
@@ -551,7 +548,7 @@ class frontpage
if(strlen($path)) if(strlen($path))
return FRTLAN_51.":".$path; // 'Other' return FRTLAN_51.":".$path; // 'Other'
else else
return FRTLAN_52; // 'None' return LAN_NONE; // 'None'
} }
@@ -671,7 +668,7 @@ function headerjs()
$ret = " $ret = "
<script type='text/javascript'> <script type='text/javascript'>
//add required core lan - delete confirm message //add required core lan - delete confirm message
(".e_jshelper::toString(FRTLAN_54).").addModLan('core', 'delete_confirm'); (".e_jshelper::toString(LAN_JSCONFIRM).").addModLan('core', 'delete_confirm');
</script> </script>
<script type='text/javascript' src='".e_JS."core/admin.js'></script> <script type='text/javascript' src='".e_JS."core/admin.js'></script>
"; ";

View File

@@ -334,6 +334,7 @@ define("LAN_KEYWORDS","Keywords");
define("LAN_IMAGE","Image"); define("LAN_IMAGE","Image");
define("LAN_TEMPLATE","Template"); define("LAN_TEMPLATE","Template");
define("LAN_TYPE", "Type"); define("LAN_TYPE", "Type");
define("LAN_NONE", "None");
define("LAN_CATEGORIES", "Categories"); define("LAN_CATEGORIES", "Categories");
define("LAN_DEMO_FORBIDDEN", "Changes on this page are not possible in demo mode."); define("LAN_DEMO_FORBIDDEN", "Changes on this page are not possible in demo mode.");

View File

@@ -8,8 +8,8 @@
*/ */
define("FRTLAN_1", "Front Page settings updated."); //define("FRTLAN_1", "Front Page settings updated.");
define("FRTLAN_12", "Update Front Page Settings"); //define("FRTLAN_12", "Update Front Page Settings");
define("FRTLAN_13", "Current Front Page Settings"); define("FRTLAN_13", "Current Front Page Settings");
define("FRTLAN_15", "Other (enter url):"); define("FRTLAN_15", "Other (enter url):");
@@ -24,23 +24,23 @@ define('FRTLAN_35', 'Post-login page');
//define('FRTLAN_39', 'If no rule matches, news.php is set as the home page'); //define('FRTLAN_39', 'If no rule matches, news.php is set as the home page');
//define('FRTLAN_41', 'The user is sent to the specified &quot;Post-login page&quot; (if specified) immediately following a login'); //define('FRTLAN_41', 'The user is sent to the specified &quot;Post-login page&quot; (if specified) immediately following a login');
*/ */
define('FRTLAN_40', 'Order'); //define('FRTLAN_40', 'Order');
define('FRTLAN_42', 'Add new rule'); define('FRTLAN_42', 'Add new rule');
define('FRTLAN_43', 'Class: '); define('FRTLAN_43', 'Class: ');
// define('FRTLAN_44', 'Go to this page after login'); // define('FRTLAN_44', 'Go to this page after login');
define('FRTLAN_45', 'Values not changed'); //define('FRTLAN_45', 'Values not changed');
define('FRTLAN_46', 'Edit existing rule'); define('FRTLAN_46', 'Edit existing rule');
define('FRTLAN_47', 'Move up'); define('FRTLAN_47', 'Move up');
define('FRTLAN_48', 'Move down'); define('FRTLAN_48', 'Move down');
define('FRTLAN_49', 'Home Page'); define('FRTLAN_49', 'Home Page');
define('FRTLAN_50', '(To disable, select &quot;Other&quot; with a blank URL)'); define('FRTLAN_50', '(To disable, select &quot;Other&quot; with a blank URL)');
define('FRTLAN_51', 'Other'); define('FRTLAN_51', 'Other');
define('FRTLAN_52', 'None'); //define('FRTLAN_52', 'None');
define('FRTLAN_53', 'User Class'); define('FRTLAN_53', 'User Class');
// 2.0 // 2.0
define('FRTLAN_PAGE_TITLE', 'Front Page'); define('FRTLAN_PAGE_TITLE', 'Front Page');
define('FRTLAN_54', 'Are you sure?'); //define('FRTLAN_54', 'Are you sure?');
define('FRTLAN_55', 'Confirm delete rule?'); //define('FRTLAN_55', 'Confirm delete rule?');
?> ?>