diff --git a/e107_plugins/list_new/admin_list_config.php b/e107_plugins/list_new/admin_list_config.php
index 93edd0c30..2cb14338a 100644
--- a/e107_plugins/list_new/admin_list_config.php
+++ b/e107_plugins/list_new/admin_list_config.php
@@ -11,15 +11,19 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/admin_list_config.php,v $
-| $Revision: 1.4 $
-| $Date: 2008-11-20 20:35:24 $
+| $Revision: 1.5 $
+| $Date: 2008-12-11 22:38:06 $
| $Author: e107steved $
+---------------------------------------------------------------+
*/
//include and require several classes
require_once("../../class2.php");
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
+if(!getperms("1") || !plugInstalled('list_new'))
+{
+ header("location:".e_BASE."index.php");
+ exit ;
+}
require_once(e_ADMIN."auth.php");
require_once(e_HANDLER."form_handler.php");
$rs = new form;
@@ -30,34 +34,42 @@ require_once($listplugindir."list_class.php");
$rc = new listclass;
//get language file
-$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
-include(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
+@include_lan($listplugindir."languages/".e_LANGUAGE.".php");
//get all sections to use (and reload if new e_list.php files are added)
$rc -> getSections();
//update preferences in database
-if(isset($_POST['update_menu'])){
- while(list($key, $value) = each($_POST)){
- if($value != LIST_ADMIN_2){ $list_pref[$tp->toDB($key)] = $tp->toDB($value); }
+if(isset($_POST['update_menu']))
+{
+ $list_pref = $rc -> getListPrefs(); // Get the preferences so we've got a reference for changes
+ $temp = array();
+ while(list($key, $value) = each($_POST))
+ {
+ if($value != LIST_ADMIN_2){ $temp[$tp->toDB($key)] = $tp->toDB($value); }
}
- $tmp = $eArrayStorage->WriteArray($list_pref);
- $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='list' ");
-
- $message = LIST_ADMIN_3;
+ if ($admin_log->logArrayDiffs($temp, $list_pref, 'LISTNEW_01'))
+ {
+ $tmp = $eArrayStorage->WriteArray($list_pref);
+ $sql -> db_Update("core", "e107_value='{$tmp}' WHERE e107_name='list' ");
+ $message = LIST_ADMIN_3;
+ }
+ else
+ {
+ $message = LIST_ADMIN_LAN_41;
+ }
}
//check preferences from database
$list_pref = $rc -> getListPrefs();
-//$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*');
-//$iconlist = $fl->get_files($listplugindir."images/", "", $rejectlist);
$iconlist = $fl->get_files($listplugindir."images/");
//render message if set
-if(isset($message)){
+if(isset($message))
+{
$ns -> tablerender("", "
".$message."
");
}
diff --git a/e107_plugins/list_new/languages/English.php b/e107_plugins/list_new/languages/English.php
index 20dfd1fa3..828b09ec6 100644
--- a/e107_plugins/list_new/languages/English.php
+++ b/e107_plugins/list_new/languages/English.php
@@ -11,138 +11,13 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/languages/English.php,v $
-| $Revision: 1.4 $
-| $Date: 2008-12-08 07:57:21 $
-| $Author: lisa_ $
+| $Revision: 1.5 $
+| $Date: 2008-12-11 22:38:06 $
+| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
if (!defined("PAGE_NAME")) { define("PAGE_NAME", "List New Items"); }
-
-define("LIST_PLUGIN_1", "List");
-define("LIST_PLUGIN_2", "This plugin allows you to view a list of recent additions in all e107 categories. You can either view the list with data since your last visit, or view a general latest additions list. Besides the page a menu is also present. Every section is configurable in the admin area.");
-define("LIST_PLUGIN_3", "Configure Main Menu");
-define("LIST_PLUGIN_4", "The List_new plugin is now ready to be used.");
-define("LIST_PLUGIN_5", "list");
-define("LIST_PLUGIN_6", "This plugin is not installed.");
-
-define("LIST_ADMIN_1", "recent");
-define("LIST_ADMIN_2", "update settings");
-define("LIST_ADMIN_3", "settings updated");
-define("LIST_ADMIN_4", "section");
-define("LIST_ADMIN_5", "menu");
-define("LIST_ADMIN_6", "page");
-define("LIST_ADMIN_7", "enabled");
-define("LIST_ADMIN_8", "disabled");
-define("LIST_ADMIN_9", "open");
-define("LIST_ADMIN_10", "closed");
-define("LIST_ADMIN_11", "update");
-define("LIST_ADMIN_12", "choose");
-define("LIST_ADMIN_13", "Welcome to the Recent page of ".SITENAME." ! This page shows, for the most common sections of this site, a list of the most recent additions in these sections.");
-define("LIST_ADMIN_14", "recent additions");
-define("LIST_ADMIN_15", "new since your last visit");
-define("LIST_ADMIN_16", "Welcome to the New page of ".SITENAME." ! This page shows, for the most common sections of this site, a list of the additions in these sections since your last visit.");
-
-define("LIST_ADMIN_SECT_1", "sections");
-define("LIST_ADMIN_SECT_2", "choose which sections to show");
-define("LIST_ADMIN_SECT_3", "");
-
-define("LIST_ADMIN_SECT_4", "display style");
-define("LIST_ADMIN_SECT_5", "choose which sections are opened by default");
-define("LIST_ADMIN_SECT_6", "");
-
-define("LIST_ADMIN_SECT_7", "author");
-define("LIST_ADMIN_SECT_8", "choose if the author should be displayed");
-define("LIST_ADMIN_SECT_9", "");
-
-define("LIST_ADMIN_SECT_10", "category");
-define("LIST_ADMIN_SECT_11", "choose if the category should be displayed");
-define("LIST_ADMIN_SECT_12", "");
-
-define("LIST_ADMIN_SECT_13", "date");
-define("LIST_ADMIN_SECT_14", "choose if the date should be displayed");
-define("LIST_ADMIN_SECT_15", "");
-
-define("LIST_ADMIN_SECT_16", "amount items");
-define("LIST_ADMIN_SECT_17", "choose how many items should be displayed for each section");
-define("LIST_ADMIN_SECT_18", "");
-
-define("LIST_ADMIN_SECT_19", "order items");
-define("LIST_ADMIN_SECT_20", "choose the order in which sections should be displayed");
-define("LIST_ADMIN_SECT_21", "");
-
-define("LIST_ADMIN_SECT_22", "icon");
-define("LIST_ADMIN_SECT_23", "choose an icon for each section");
-define("LIST_ADMIN_SECT_24", "");
-
-define("LIST_ADMIN_SECT_25", "caption");
-define("LIST_ADMIN_SECT_26", "define a caption for each section");
-define("LIST_ADMIN_SECT_27", "");
-
-define("LIST_ADMIN_OPT_1", "general");
-define("LIST_ADMIN_OPT_2", "recent page");
-define("LIST_ADMIN_OPT_3", "recent menu");
-define("LIST_ADMIN_OPT_4", "new page");
-define("LIST_ADMIN_OPT_5", "new menu");
-define("LIST_ADMIN_OPT_6", "options");
-
-define("LIST_ADMIN_MENU_2", "icon : default");
-define("LIST_ADMIN_MENU_3", "use default theme bullet if no icon is present or if icon:use is disabled");
-define("LIST_ADMIN_MENU_4", "");
-
-define("LIST_ADMIN_LAN_2", "caption");
-define("LIST_ADMIN_LAN_3", "define a caption");
-define("LIST_ADMIN_LAN_4", "");
-
-define("LIST_ADMIN_LAN_5", "icon : use");
-define("LIST_ADMIN_LAN_6", "use icon from each section");
-define("LIST_ADMIN_LAN_7", "");
-
-define("LIST_ADMIN_LAN_8", "characters");
-define("LIST_ADMIN_LAN_9", "choose how many characters of the heading will be shown");
-define("LIST_ADMIN_LAN_10", "leave blank to show full heading");
-
-define("LIST_ADMIN_LAN_11", "postfix");
-define("LIST_ADMIN_LAN_12", "choose a postfix if the heading is larger then the given amount of characters");
-define("LIST_ADMIN_LAN_13", "leave blank to show no postfix");
-
-define("LIST_ADMIN_LAN_14", "date");
-define("LIST_ADMIN_LAN_15", "choose a date style");
-define("LIST_ADMIN_LAN_16", "For more information on date formats see the strftime function page at php.net");
-
-define("LIST_ADMIN_LAN_17", "today date");
-define("LIST_ADMIN_LAN_18", "choose a date style if the date is today");
-define("LIST_ADMIN_LAN_19", "For more information on date formats see the strftime function page at php.net");
-
-define("LIST_ADMIN_LAN_20", "columns");
-define("LIST_ADMIN_LAN_21", "choose an amount of columns");
-define("LIST_ADMIN_LAN_22", "define how many columns you want to use. the number you specify will separate the page into an equal amount of columns");
-
-define("LIST_ADMIN_LAN_23", "welcome text");
-define("LIST_ADMIN_LAN_24", "define a welcome text that will be rendered at the top of the page");
-define("LIST_ADMIN_LAN_25", "");
-
-define("LIST_ADMIN_LAN_26", "show empty");
-define("LIST_ADMIN_LAN_27", "define if a message needs to be shown when sections have no results ");
-define("LIST_ADMIN_LAN_28", "");
-
-define("LIST_ADMIN_LAN_29", "icon : default");
-define("LIST_ADMIN_LAN_30", "use default theme bullet if no icon is present or if icon:use is disabled");
-define("LIST_ADMIN_LAN_31", "");
-
-define("LIST_ADMIN_LAN_32", "timelapse:days");
-define("LIST_ADMIN_LAN_33", "maximum of days users can look back");
-define("LIST_ADMIN_LAN_34", "");
-define("LIST_ADMIN_LAN_35", "days");
-
-define("LIST_ADMIN_LAN_36", "timelapse");
-define("LIST_ADMIN_LAN_37", "display a select box with number of days to look back?");
-define("LIST_ADMIN_LAN_38", "");
-
-define("LIST_ADMIN_LAN_39", "open if records exist");
-define("LIST_ADMIN_LAN_40", "should sections that contain records be opened by default?");
-define("LIST_ADMIN_LAN_41", "");
-
define("LIST_MENU_1", "recent additions");
define("LIST_MENU_2", "by");
define("LIST_MENU_3", "on");
diff --git a/e107_plugins/list_new/languages/English_admin_list_new.php b/e107_plugins/list_new/languages/English_admin_list_new.php
new file mode 100644
index 000000000..bed51acf9
--- /dev/null
+++ b/e107_plugins/list_new/languages/English_admin_list_new.php
@@ -0,0 +1,152 @@
+strftime function page at php.net");
+
+define("LIST_ADMIN_LAN_17", "today date");
+define("LIST_ADMIN_LAN_18", "choose a date style if the date is today");
+define("LIST_ADMIN_LAN_19", "For more information on date formats see the strftime function page at php.net");
+
+define("LIST_ADMIN_LAN_20", "columns");
+define("LIST_ADMIN_LAN_21", "choose an amount of columns");
+define("LIST_ADMIN_LAN_22", "define how many columns you want to use. the number you specify will separate the page into an equal amount of columns");
+
+define("LIST_ADMIN_LAN_23", "welcome text");
+define("LIST_ADMIN_LAN_24", "define a welcome text that will be rendered at the top of the page");
+define("LIST_ADMIN_LAN_25", "");
+
+define("LIST_ADMIN_LAN_26", "show empty");
+define("LIST_ADMIN_LAN_27", "define if a message needs to be shown when sections have no results ");
+define("LIST_ADMIN_LAN_28", "");
+
+define("LIST_ADMIN_LAN_29", "icon : default");
+define("LIST_ADMIN_LAN_30", "use default theme bullet if no icon is present or if icon:use is disabled");
+define("LIST_ADMIN_LAN_31", "");
+
+define("LIST_ADMIN_LAN_32", "timelapse:days");
+define("LIST_ADMIN_LAN_33", "maximum of days users can look back");
+define("LIST_ADMIN_LAN_34", "");
+define("LIST_ADMIN_LAN_35", "days");
+
+define("LIST_ADMIN_LAN_36", "timelapse");
+define("LIST_ADMIN_LAN_37", "display a select box with number of days to look back?");
+define("LIST_ADMIN_LAN_38", "");
+
+define("LIST_ADMIN_LAN_39", "open if records exist");
+define("LIST_ADMIN_LAN_40", "should sections that contain records be opened by default?");
+define("LIST_ADMIN_LAN_41", 'Nothing changed - not updated');
+
+// Admin log messages
+//-------------------
+define('LAN_AL_LISTNEW_01', 'List New preferences updated');
+define('LAN_AL_LISTNEW_02', '');
+
+
+?>
\ No newline at end of file
diff --git a/e107_plugins/list_new/list.php b/e107_plugins/list_new/list.php
index f610482ce..f2b160c88 100644
--- a/e107_plugins/list_new/list.php
+++ b/e107_plugins/list_new/list.php
@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list.php,v $
-| $Revision: 1.1.1.1 $
-| $Date: 2006-12-02 04:35:26 $
-| $Author: mcfly_e107 $
+| $Revision: 1.2 $
+| $Date: 2008-12-11 22:38:06 $
+| $Author: e107steved $
+---------------------------------------------------------------+
*/
require_once("../../class2.php");
@@ -22,10 +22,9 @@ $listplugindir = e_PLUGIN."list_new/";
$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
-if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
- require_once(HEADERF);
- $ns -> tablerender("", LIST_PLUGIN_6);
- require_once(FOOTERF);
+if (!plugInstalled('list_new'))
+{
+ header("Location: ".e_BASE."index.php");
exit;
}
require_once($listplugindir."list_shortcodes.php");
@@ -43,15 +42,20 @@ require_once(HEADERF);
global $tp;
// check query
-if(e_QUERY){
+if(e_QUERY)
+{
$qs = explode(".", e_QUERY);
- if($qs[0] == "new"){
+ if($qs[0] == "new")
+ {
$mode = $qs[0];
}
}
-if(isset($mode) && $mode == "new"){
+if(isset($mode) && $mode == "new")
+{
$mode = "new_page";
-}else{
+}
+else
+{
$mode = "recent_page"; //default to 'page'
}
diff --git a/e107_plugins/list_new/list_new_menu.php b/e107_plugins/list_new/list_new_menu.php
index 6ec4985f3..24ad04129 100644
--- a/e107_plugins/list_new/list_new_menu.php
+++ b/e107_plugins/list_new/list_new_menu.php
@@ -11,15 +11,16 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_new_menu.php,v $
-| $Revision: 1.1.1.1 $
-| $Date: 2006-12-02 04:35:26 $
-| $Author: mcfly_e107 $
+| $Revision: 1.2 $
+| $Date: 2008-12-11 22:38:06 $
+| $Author: e107steved $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
-if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
+if (!plugInstalled('list_new'))
+{
return;
}
diff --git a/e107_plugins/list_new/list_recent_menu.php b/e107_plugins/list_new/list_recent_menu.php
index 88bf2be58..12378191c 100644
--- a/e107_plugins/list_new/list_recent_menu.php
+++ b/e107_plugins/list_new/list_recent_menu.php
@@ -11,16 +11,18 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_recent_menu.php,v $
-| $Revision: 1.2 $
-| $Date: 2007-08-08 19:34:34 $
+| $Revision: 1.3 $
+| $Date: 2008-12-11 22:38:06 $
| $Author: e107steved $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
-if (!isset($pref['plug_installed']['list_new'])) return;
-
+if (!plugInstalled('list_new'))
+{
+ return;
+}
global $sysprefs, $tp, $eArrayStorage;
diff --git a/e107_plugins/list_new/plugin.php b/e107_plugins/list_new/plugin.php
deleted file mode 100644
index 2608306aa..000000000
--- a/e107_plugins/list_new/plugin.php
+++ /dev/null
@@ -1,76 +0,0 @@
-
\ No newline at end of file
diff --git a/e107_plugins/list_new/plugin.xml b/e107_plugins/list_new/plugin.xml
new file mode 100644
index 000000000..67abbc518
--- /dev/null
+++ b/e107_plugins/list_new/plugin.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ LIST_PLUGIN_2
+ e107v0.7+
+ list_new
+
+ Copyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt)
+
+ admin_list_config.php
+ icon/list_32.png
+ icon/list_16.png
+ LIST_PLUGIN_3
+ LIST_PLUGIN_4
+
+
+
+
+
\ No newline at end of file