Simple History - Version 1.1

Version Description

  • Added the Simple History Extender-module/plugin. With this great addon to Simple History it is very easy for other developers to add their own actions to simple history, including a settings panel to check actions on/off. All work on this module was made by Laurens Offereins (lmoffereins@gmail.com). Super thanks!
  • With the help of Simple History Extender this plugin also tracks changes made in bbPress, Gravity Forms and in Widges. Awesome!
  • Added user email to RSS feed + some other small changed to make it compatible with IFTTT.com. Thanks to phoenixMagoo for the code changes. Fixes http://wordpress.org/support/topic/suggestions-a-couple-of-tweaks-to-the-rss-feed.
  • Added two filters for the RSS feed: simple_history_rss_item_title and simple_history_rss_item_description.
  • Changed the way the plugin directory was determined. Perhaps and hopefully this fixes some problems with multi site and plugin in different locations and stuff like that
  • Style fixes for RTL languages
  • Small fixes here and there, for example changing deprecated WordPress functions to not deprecated
  • Added new filter: simple_history_db_purge_days_interval. Hook it to change default clear interval of 60 days.
Download this release

Release Info

Developer eskapism
Plugin Icon 128x128 Simple History
Version 1.1
Comparing to
See all releases

Code changes from version 1.0.9 to 1.1

index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Simple History
4
  Plugin URI: http://eskapism.se/code-playground/simple-history/
5
  Description: Get a log/history/audit log/version history of the changes made by users in WordPress.
6
- Version: 1.0.9
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
@@ -27,10 +27,24 @@ License: GPL2
27
 
28
  load_plugin_textdomain('simple-history', false, "/simple-history/languages");
29
 
30
- define( "SIMPLE_HISTORY_VERSION", "1.0.9");
31
  define( "SIMPLE_HISTORY_NAME", "Simple History");
32
  // define( "SIMPLE_HISTORY_URL", WP_PLUGIN_URL . '/simple-history/'); // http://playground.ep/wordpress/wp-content/plugins/simple-history/
33
- define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://playground.ep/wordpress/wp-content/plugins/simple-history/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  /**
36
  * Let's begin on a class, since they rule so much more than functions.
@@ -56,6 +70,10 @@ define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://p
56
  $this->view_history_capability = apply_filters("simple_history_view_history_capability", $this->view_history_capability);
57
 
58
  $this->add_types_for_translation();
 
 
 
 
59
  }
60
 
61
  function get_pager_size() {
@@ -84,6 +102,9 @@ define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://p
84
  $dummy = __("comment", "simple-history");
85
  $dummy = __("logged in", "simple-history");
86
  $dummy = __("logged out", "simple-history");
 
 
 
87
  }
88
 
89
  function plugin_action_links($actions, $b, $c, $d) {
@@ -289,8 +310,19 @@ define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://p
289
 
290
  // check for RSS
291
  // don't know if this is the right way to do this, but it seems to work!
292
- if (isset($_GET["simple_history_get_rss"])) {
293
-
 
 
 
 
 
 
 
 
 
 
 
294
  $rss_secret_option = get_option("simple_history_rss_secret");
295
  $rss_secret_get = $_GET["rss_secret"];
296
 
@@ -304,7 +336,7 @@ define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://p
304
  <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
305
  <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
306
  <link><?php echo get_bloginfo("url") ?></link>
307
- <atom:link href="<?php echo $self_link; ?>" rel="self" type="application/rss+xml" />
308
  <?php
309
  $arr_items = simple_history_get_items_array("items=10");
310
  foreach ($arr_items as $one_item) {
@@ -312,6 +344,7 @@ define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://p
312
  $object_name = esc_html($one_item->object_name);
313
  $user = get_user_by("id", $one_item->user_id);
314
  $user_nicename = esc_html(@$user->user_nicename);
 
315
  $description = "";
316
  if ($user_nicename) {
317
  $description .= sprintf(__("By %s", 'simple-history'), $user_nicename);
@@ -321,17 +354,22 @@ define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://p
321
  $description .= sprintf(__("%d occasions", 'simple-history'), sizeof($one_item->occasions));
322
  $description .= "<br />";
323
  }
 
324
 
325
  $item_title = esc_html($object_type) . " \"" . esc_html($object_name) . "\" {$one_item->action}";
326
  $item_title = html_entity_decode($item_title, ENT_COMPAT, "UTF-8");
327
- $item_guid = get_bloginfo("siteurl") . "?simple-history-guid=" . $one_item->id;
 
 
 
328
  ?>
329
  <item>
330
  <title><![CDATA[<?php echo $item_title; ?>]]></title>
331
  <description><![CDATA[<?php echo $description ?>]]></description>
332
- <author><?php echo $user_nicename ?></author>
333
  <pubDate><?php echo date("D, d M Y H:i:s", strtotime($one_item->date)) ?> GMT</pubDate>
334
  <guid isPermaLink="false"><?php echo $item_guid ?></guid>
 
335
  </item>
336
  <?php
337
  }
@@ -346,12 +384,12 @@ define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://p
346
  <channel>
347
  <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
348
  <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
349
- <link><?php echo get_bloginfo("siteurl") ?></link>
350
  <item>
351
  <title><?php _e("Wrong RSS secret", 'simple-history')?></title>
352
  <description><?php _e("Your RSS secret for Simple History RSS feed is wrong. Please see WordPress settings for current link to the RSS feed.", 'simple-history')?></description>
353
  <pubDate><?php echo date("D, d M Y H:i:s", time()) ?> GMT</pubDate>
354
- <guid><?php echo get_bloginfo("siteurl") . "?simple-history-guid=wrong-secret" ?></guid>
355
  </item>
356
  </channel>
357
  </rss>
@@ -359,9 +397,7 @@ define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://p
359
 
360
  }
361
  exit;
362
- }
363
-
364
- }
365
 
366
  function ajax() {
367
 
@@ -561,7 +597,7 @@ function simple_history_settings_field_rss() {
561
  if (isset($_GET["simple_history_rss_update_secret"]) && $_GET["simple_history_rss_update_secret"]) {
562
  $create_new_secret = true;
563
  echo "<div class='simple-history-settings-page-updated'><p>";
564
- _e("Created new secret RSS adress", 'simple-history');
565
  echo "</p></div>";
566
  }
567
 
@@ -891,7 +927,11 @@ function simple_history_purge_db() {
891
 
892
  global $wpdb;
893
  $tableprefix = $wpdb->prefix;
894
- $sql = "DELETE FROM {$tableprefix}simple_history WHERE DATE_ADD(date, INTERVAL 60 DAY) < now()";
 
 
 
 
895
 
896
  if ($do_purge_history) {
897
  $wpdb->query($sql);
@@ -1101,6 +1141,10 @@ function simple_history_print_nav() {
1101
  $link = esc_html(add_query_arg("simple_history_user_to_show", ""));
1102
  $str_users .= "<li $css><a href='$link'>" . __("By all users", 'simple-history') ."</a> | </li>";
1103
  foreach ($arr_users as $user_id => $user_info) {
 
 
 
 
1104
  $link = esc_html(add_query_arg("simple_history_user_to_show", $user_id));
1105
  $css = "";
1106
  if ($user_id == $simple_history_user_to_show) {
@@ -1220,8 +1264,8 @@ function simple_history_get_items_array($args = "") {
1220
  $tableprefix = $wpdb->prefix;
1221
 
1222
  $sql = "SELECT * FROM {$tableprefix}simple_history $where ORDER BY date DESC, id DESC ";
1223
- #sf_d($args);
1224
- #echo "\n$sql\n";
1225
  $rows = $wpdb->get_results($sql);
1226
 
1227
  $loopNum = 0;
@@ -1595,13 +1639,11 @@ function simple_history_print_history($args = null) {
1595
  $output .= "</ul>";
1596
  $output .= "</div>";
1597
  }
1598
-
1599
 
1600
  $output .= "</li>";
1601
 
1602
  $loopNum++;
1603
 
1604
-
1605
  }
1606
 
1607
  // if $loopNum == 0 no items where found for this page
3
  Plugin Name: Simple History
4
  Plugin URI: http://eskapism.se/code-playground/simple-history/
5
  Description: Get a log/history/audit log/version history of the changes made by users in WordPress.
6
+ Version: 1.1
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
27
 
28
  load_plugin_textdomain('simple-history', false, "/simple-history/languages");
29
 
30
+ define( "SIMPLE_HISTORY_VERSION", "1.1");
31
  define( "SIMPLE_HISTORY_NAME", "Simple History");
32
  // define( "SIMPLE_HISTORY_URL", WP_PLUGIN_URL . '/simple-history/'); // http://playground.ep/wordpress/wp-content/plugins/simple-history/
33
+ // define( "SIMPLE_HISTORY_URL", plugins_url() . '/simple-history/'); // http://playground.ep/wordpress/wp-content/plugins/simple-history/
34
+
35
+ // Find the plugin directory URL
36
+ $aa = __FILE__;
37
+ if ( isset( $mu_plugin ) ) {
38
+ $aa = $mu_plugin;
39
+ }
40
+ if ( isset( $network_plugin ) ) {
41
+ $aa = $network_plugin;
42
+ }
43
+ if ( isset( $plugin ) ) {
44
+ $aa = $plugin;
45
+ }
46
+ $plugin_dir_url = plugin_dir_url(basename($aa)) . 'simple-history/';
47
+ define("SIMPLE_HISTORY_URL", $plugin_dir_url);
48
 
49
  /**
50
  * Let's begin on a class, since they rule so much more than functions.
70
  $this->view_history_capability = apply_filters("simple_history_view_history_capability", $this->view_history_capability);
71
 
72
  $this->add_types_for_translation();
73
+
74
+ // Load Extender
75
+ require_once ( dirname(__FILE__) . "/simple-history-extender/simple-history-extender.php" );
76
+
77
  }
78
 
79
  function get_pager_size() {
102
  $dummy = __("comment", "simple-history");
103
  $dummy = __("logged in", "simple-history");
104
  $dummy = __("logged out", "simple-history");
105
+ $dummy = __("added", "simple-history");
106
+ $dummy = __("modified", "simple-history");
107
+ $dummy = __("upgraded it\'s database", "simple-history");
108
  }
109
 
110
  function plugin_action_links($actions, $b, $c, $d) {
310
 
311
  // check for RSS
312
  // don't know if this is the right way to do this, but it seems to work!
313
+ if ( isset($_GET["simple_history_get_rss"]) ) {
314
+
315
+ $this->output_rss();
316
+
317
+ }
318
+
319
+ }
320
+
321
+ /**
322
+ * Output RSS
323
+ */
324
+ function output_rss() {
325
+
326
  $rss_secret_option = get_option("simple_history_rss_secret");
327
  $rss_secret_get = $_GET["rss_secret"];
328
 
336
  <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
337
  <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
338
  <link><?php echo get_bloginfo("url") ?></link>
339
+ <atom:link href="<?php echo $self_link; ?>" rel="self" type="application/atom+xml" />
340
  <?php
341
  $arr_items = simple_history_get_items_array("items=10");
342
  foreach ($arr_items as $one_item) {
344
  $object_name = esc_html($one_item->object_name);
345
  $user = get_user_by("id", $one_item->user_id);
346
  $user_nicename = esc_html(@$user->user_nicename);
347
+ $user_email = esc_html(@$user->user_email);
348
  $description = "";
349
  if ($user_nicename) {
350
  $description .= sprintf(__("By %s", 'simple-history'), $user_nicename);
354
  $description .= sprintf(__("%d occasions", 'simple-history'), sizeof($one_item->occasions));
355
  $description .= "<br />";
356
  }
357
+ $description = apply_filters("simple_history_rss_item_description", $description, $one_item);
358
 
359
  $item_title = esc_html($object_type) . " \"" . esc_html($object_name) . "\" {$one_item->action}";
360
  $item_title = html_entity_decode($item_title, ENT_COMPAT, "UTF-8");
361
+ $item_title = apply_filters("simple_history_rss_item_title", $item_title, $one_item);
362
+
363
+ $item_guid = home_url() . "?simple-history-guid=" . $one_item->id;
364
+
365
  ?>
366
  <item>
367
  <title><![CDATA[<?php echo $item_title; ?>]]></title>
368
  <description><![CDATA[<?php echo $description ?>]]></description>
369
+ <author><?php echo $user_email . ' (' . $user_nicename . ')' ?></author>
370
  <pubDate><?php echo date("D, d M Y H:i:s", strtotime($one_item->date)) ?> GMT</pubDate>
371
  <guid isPermaLink="false"><?php echo $item_guid ?></guid>
372
+ <link><?php echo $item_guid ?></link>
373
  </item>
374
  <?php
375
  }
384
  <channel>
385
  <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
386
  <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
387
+ <link><?php echo home_url() ?></link>
388
  <item>
389
  <title><?php _e("Wrong RSS secret", 'simple-history')?></title>
390
  <description><?php _e("Your RSS secret for Simple History RSS feed is wrong. Please see WordPress settings for current link to the RSS feed.", 'simple-history')?></description>
391
  <pubDate><?php echo date("D, d M Y H:i:s", time()) ?> GMT</pubDate>
392
+ <guid><?php echo home_url() . "?simple-history-guid=wrong-secret" ?></guid>
393
  </item>
394
  </channel>
395
  </rss>
397
 
398
  }
399
  exit;
400
+ } // rss
 
 
401
 
402
  function ajax() {
403
 
597
  if (isset($_GET["simple_history_rss_update_secret"]) && $_GET["simple_history_rss_update_secret"]) {
598
  $create_new_secret = true;
599
  echo "<div class='simple-history-settings-page-updated'><p>";
600
+ _e("Created new secret RSS address", 'simple-history');
601
  echo "</p></div>";
602
  }
603
 
927
 
928
  global $wpdb;
929
  $tableprefix = $wpdb->prefix;
930
+
931
+ $days = 60;
932
+ $days = (int) apply_filters("simple_history_db_purge_days_interval", $days);
933
+
934
+ $sql = "DELETE FROM {$tableprefix}simple_history WHERE DATE_ADD(date, INTERVAL $days DAY) < now()";
935
 
936
  if ($do_purge_history) {
937
  $wpdb->query($sql);
1141
  $link = esc_html(add_query_arg("simple_history_user_to_show", ""));
1142
  $str_users .= "<li $css><a href='$link'>" . __("By all users", 'simple-history') ."</a> | </li>";
1143
  foreach ($arr_users as $user_id => $user_info) {
1144
+
1145
+ $user = new WP_User($user_id);
1146
+ if ( ! $user->exists() ) continue;
1147
+
1148
  $link = esc_html(add_query_arg("simple_history_user_to_show", $user_id));
1149
  $css = "";
1150
  if ($user_id == $simple_history_user_to_show) {
1264
  $tableprefix = $wpdb->prefix;
1265
 
1266
  $sql = "SELECT * FROM {$tableprefix}simple_history $where ORDER BY date DESC, id DESC ";
1267
+ #sf_d($args);
1268
+ #echo "\n$sql\n";
1269
  $rows = $wpdb->get_results($sql);
1270
 
1271
  $loopNum = 0;
1639
  $output .= "</ul>";
1640
  $output .= "</div>";
1641
  }
 
1642
 
1643
  $output .= "</li>";
1644
 
1645
  $loopNum++;
1646
 
 
1647
  }
1648
 
1649
  // if $loopNum == 0 no items where found for this page
languages/simple-history-ar.mo ADDED
Binary file
languages/simple-history-ar.po ADDED
@@ -0,0 +1,410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was generated by WPML
2
+ # WPML is a WordPress plugin that can turn any WordPress or WordPressMU site into a full featured multilingual content management system.
3
+ # http://wpml.org
4
+ msgid ""
5
+ msgstr ""
6
+ "Content-Type: text/plain; charset=utf-8\n"
7
+ "Content-Transfer-Encoding: 8bit\n"
8
+ "Project-Id-Version: \n"
9
+ "POT-Creation-Date: \n"
10
+ "PO-Revision-Date: \n"
11
+ "Last-Translator: Hassan\n"
12
+ "Language-Team: \n"
13
+ "MIME-Version: 1.0\n"
14
+ "X-Generator: Poedit 1.5.5\n"
15
+
16
+ # echo "<br />";
17
+ # _e("This is a secret RSS feed for Simple History. Only share the link with people you trust", 'simple-history');
18
+ # echo "<br />";
19
+ msgid ""
20
+ "This is a secret RSS feed for Simple History. Only share the link with "
21
+ "people you trust"
22
+ msgstr "هذه تغذية RSS سرّية خاصة بالتاريخ. شارك الرابط فقط مع أناس تثق بهم."
23
+
24
+ # echo "<div class='simple-history-settings-page-updated'><p>";
25
+ # _e("Created new secret RSS adress", 'simple-history');
26
+ # echo "</p></div>";
27
+ msgid "Created new secret RSS adress"
28
+ msgstr "تم إنشاء عنوان RSS سرّي جديد"
29
+
30
+ # <?php
31
+ # _e('
32
+ # Please
33
+ msgid ""
34
+ "\n"
35
+ "\t\t\tPlease\n"
36
+ "\t\t\t<a href=\"http://eskapism.se/sida/donate/?"
37
+ "utm_source=wordpress&utm_medium=settingpage&utm_campaign=simplehistory\">\n"
38
+ "\t\t\tdonate\n"
39
+ "\t\t\t</a> to support the development of this plugin and to keep it free.\n"
40
+ "\t\t\tThanks!\n"
41
+ "\t\t\t"
42
+ msgstr ""
43
+ "\n"
44
+ "\t\t\tرجاءً\n"
45
+ "\t\t\t<a href=\"http://eskapism.se/sida/donate/?"
46
+ "utm_source=wordpress&utm_medium=settingpage&utm_campaign=simplehistory\">\n"
47
+ "\t\t\tتبرّع\n"
48
+ "\t\t\t</a> لكي تدعم تطوير هذه الإضافة والإبقاء عليها مجانية\n"
49
+ "\t\t\tThanks!\n"
50
+ "\t\t\t"
51
+
52
+ #
53
+ # _e("Items in the database are automatically removed after 60 days.", 'simple-history');
54
+ # $update_link = add_query_arg("simple_history_clear_log", "1");
55
+ msgid "Items in the database are automatically removed after 60 days."
56
+ msgstr "العناصر في قاعدة البيانات يتم حذفها بصورة تلقائية بعد 60 يوم."
57
+
58
+ # echo "<div class='simple-history-settings-page-updated'><p>";
59
+ # _e("Cleared database", 'simple-history');
60
+ # echo "</p></div>";
61
+ msgid "Cleared database"
62
+ msgstr "نظف قاعدة البيانات"
63
+
64
+ # <input <?php echo $show_as_page ? "checked='checked'" : "" ?> type="checkbox" value="1" name="simple_history_show_as_page" id="simple_history_show_as_page" class="simple_history_show_as_page" />
65
+ # <label for="simple_history_show_as_page"><?php _e("as a page under the dashboard menu", 'simple-history') ?></label>
66
+ #
67
+ msgid "as a page under the dashboard menu"
68
+ msgstr "كصفحة تحت قائمة الرئيسية"
69
+
70
+ # <input <?php echo $show_on_dashboard ? "checked='checked'" : "" ?> type="checkbox" value="1" name="simple_history_show_on_dashboard" id="simple_history_show_on_dashboard" class="simple_history_show_on_dashboard" />
71
+ # <label for="simple_history_show_on_dashboard"><?php _e("on the dashboard", 'simple-history') ?></label>
72
+ #
73
+ msgid "on the dashboard"
74
+ msgstr "في صفحة الأدمين الرئيسية"
75
+
76
+ # <title><?php _e("Wrong RSS secret", 'simple-history')?></title>
77
+ # <description><?php _e("Your RSS secret for Simple History RSS feed is wrong. Please see WordPress settings for current link to the RSS feed.", 'simple-history')?></description>
78
+ # <pubDate><?php echo date("D, d M Y H:i:s", time()) ?> GMT</pubDate>
79
+ msgid ""
80
+ "Your RSS secret for Simple History RSS feed is wrong. Please see WordPress "
81
+ "settings for current link to the RSS feed."
82
+ msgstr ""
83
+ "سر RSS الخاص بالتاريخ المبسّط خاطيء. الرجاء النظر في إعداداات ووردبريس للرابط "
84
+ "الحالي لتغذية الـ RSS."
85
+
86
+ # <item>
87
+ # <title><?php _e("Wrong RSS secret", 'simple-history')?></title>
88
+ # <description><?php _e("Your RSS secret for Simple History RSS feed is wrong. Please see WordPress settings for current link to the RSS feed.", 'simple-history')?></description>
89
+ msgid "Wrong RSS secret"
90
+ msgstr "سر RSS خاطيء"
91
+
92
+ # $no_found = __("No history items found.", 'simple-history');
93
+ # $please_note = __("Please note that Simple History only records things that happen after this plugin have been installed.", 'simple-history');
94
+ # $output .= "<p>$no_found</p>";
95
+ msgid ""
96
+ "Please note that Simple History only records things that happen after this "
97
+ "plugin have been installed."
98
+ msgstr ""
99
+ "الرجاء الانتباه أن هذه الإضافة تقوم بتسجيل الأحداث التي حصلت فقط بعد تنصيب "
100
+ "الإضافة."
101
+
102
+ # } else {
103
+ # $no_found = __("No history items found.", 'simple-history');
104
+ # $please_note = __("Please note that Simple History only records things that happen after this plugin have been installed.", 'simple-history');
105
+ msgid "No history items found."
106
+ msgstr "لم يتم إيجاد عناصر في التاريخ."
107
+
108
+ # $view_rss_link = simple_history_get_rss_address();
109
+ # $str_show = __("Show", 'simple-history');
110
+ # $output .= "</ol>
111
+ msgid "Show"
112
+ msgstr "إظهار"
113
+
114
+ # $loading = "<img src='".site_url("wp-admin/images/loading.gif")."' width=16 height=16>" . $loading;
115
+ # $no_found = __("No matching items found.", 'simple-history');
116
+ # $view_rss = __("RSS feed", 'simple-history');
117
+ msgid "No matching items found."
118
+ msgstr "لم يتم إبجاد عناصر مطابقة."
119
+
120
+ #
121
+ # $loading = __("Loading...", 'simple-history');
122
+ # $loading = "<img src='".site_url("wp-admin/images/loading.gif")."' width=16 height=16>" . $loading;
123
+ msgid "Loading..."
124
+ msgstr "جاري التحميل..."
125
+
126
+ # $show_more .= sprintf('<option value=50 %2$s>%1$s</option>', __("Show 50 more", 'simple-history'), ($args["items"] == 50 ? " selected " : "") );
127
+ # $show_more .= sprintf('<option value=100 %2$s>%1$s</option>', __("Show 100 more", 'simple-history'), ($args["items"] == 100 ? " selected " : "") );
128
+ # $show_more .= "</select>";
129
+ msgid "Show 100 more"
130
+ msgstr "إظهار 100 إضافية"
131
+
132
+ # $show_more .= sprintf('<option value=15 %2$s>%1$s</option>', __("Show 15 more", 'simple-history'), ($args["items"] == 15 ? " selected " : "") );
133
+ # $show_more .= sprintf('<option value=50 %2$s>%1$s</option>', __("Show 50 more", 'simple-history'), ($args["items"] == 50 ? " selected " : "") );
134
+ # $show_more .= sprintf('<option value=100 %2$s>%1$s</option>', __("Show 100 more", 'simple-history'), ($args["items"] == 100 ? " selected " : "") );
135
+ msgid "Show 50 more"
136
+ msgstr "إظهار 50 إضافية"
137
+
138
+ # $show_more .= sprintf('<option value=5 %2$s>%1$s</option>', __("Show 5 more", 'simple-history'), ($args["items"] == 5 ? " selected " : "") );
139
+ # $show_more .= sprintf('<option value=15 %2$s>%1$s</option>', __("Show 15 more", 'simple-history'), ($args["items"] == 15 ? " selected " : "") );
140
+ # $show_more .= sprintf('<option value=50 %2$s>%1$s</option>', __("Show 50 more", 'simple-history'), ($args["items"] == 50 ? " selected " : "") );
141
+ msgid "Show 15 more"
142
+ msgstr "إظهار 15 إضافية"
143
+
144
+ # $show_more = "<select>";
145
+ # $show_more .= sprintf('<option value=5 %2$s>%1$s</option>', __("Show 5 more", 'simple-history'), ($args["items"] == 5 ? " selected " : "") );
146
+ # $show_more .= sprintf('<option value=15 %2$s>%1$s</option>', __("Show 15 more", 'simple-history'), ($args["items"] == 15 ? " selected " : "") );
147
+ msgid "Show 5 more"
148
+ msgstr "إظهار 5 إضافية"
149
+
150
+ # $date_i18n_time = date_i18n(get_option('time_format'), strtotime($one_occasion->date), $gmt=false);
151
+ # $output .= sprintf( __('%s ago (%s at %s)', "simple-history"), human_time_diff(strtotime($one_occasion->date), $now), $date_i18n_date, $date_i18n_time );
152
+ #
153
+ msgid "%s ago (%s at %s)"
154
+ msgstr "قبل %s (%s في %s)"
155
+
156
+ # } else {
157
+ # $many_occasion = sprintf(__("+ %d occasions", 'simple-history'), $num_occasions);
158
+ # $output .= "<a class='simple-history-occasion-show' href='#'>$many_occasion</a>";
159
+ msgid "+ %d occasions"
160
+ msgstr "+ %d حوادث"
161
+
162
+ # if ($num_occasions == 1) {
163
+ # $one_occasion = __("+ 1 occasion", 'simple-history');
164
+ # $output .= "<a class='simple-history-occasion-show' href='#'>$one_occasion</a>";
165
+ msgid "+ 1 occasion"
166
+ msgstr "+ 1 حدث"
167
+
168
+ # $output .= $diff_str;
169
+ # $output .= "<span class='when_detail'>".sprintf(__('%s at %s', 'simple-history'), $date_i18n_date, $date_i18n_time)."</span>";
170
+ # $output .= "</div>";
171
+ msgid "%s at %s"
172
+ msgstr "%s في %s"
173
+
174
+ # $now = strtotime(current_time("mysql"));
175
+ # $diff_str = sprintf( __('<span class="when">%1$s ago</span> by %2$s', "simple-history"), human_time_diff(strtotime($one_row->date), $now), $who );
176
+ # $output .= $diff_str;
177
+ msgid "<span class=\"when\">%1$s ago</span> by %2$s"
178
+ msgstr "<span class=\"when\">قبل %1$s</span> عن طريق %2$s"
179
+
180
+ # case "disabled":
181
+ # $unknown_action = __("disabled", 'simple-history');
182
+ # break;
183
+ msgid "disabled"
184
+ msgstr "تم التعطيل"
185
+
186
+ # case "enabled":
187
+ # $unknown_action = __("enabled", 'simple-history');
188
+ # break;
189
+ msgid "enabled"
190
+ msgstr "تم التفعيل"
191
+
192
+ # case "deactivated":
193
+ # $unknown_action = __("deactivated", 'simple-history');
194
+ # break;
195
+ msgid "deactivated"
196
+ msgstr "تم التعطيل"
197
+
198
+ # case "activated":
199
+ # $unknown_action = __("activated", 'simple-history');
200
+ # break;
201
+ msgid "activated"
202
+ msgstr "تم التنشيط"
203
+
204
+ # } else {
205
+ # $who .= "&lt;" . __("Unknown or deleted user", 'simple-history') ."&gt;";
206
+ # }
207
+ msgid "Unknown or deleted user"
208
+ msgstr "مستخدم غير معروف أو محذوف"
209
+
210
+ # // search
211
+ # $str_search = __("Search", 'simple-history');
212
+ # $search = "<p class='simple-history-filter simple-history-filter-search'>
213
+ msgid "Search"
214
+ msgstr "بحث"
215
+
216
+ # $link = esc_html(add_query_arg("simple_history_type_to_show", ""));
217
+ # $str_types_desc = __("All types", 'simple-history');
218
+ # $str_types .= "<li $css><a data-simple-history-filter-type='' href='$link'>" . esc_html($str_types_desc) . "</a> | </li>";
219
+ msgid "All types"
220
+ msgstr "كل الأنواع"
221
+
222
+ # $update_link = add_query_arg("simple_history_rss_update_secret", "1");
223
+ # printf(__("You can <a href='%s'>generate a new address</a> for the RSS feed. This is useful if you think that the address has fallen into the wrong hands.", 'simple-history'), $update_link);
224
+ # }
225
+ msgid ""
226
+ "You can <a href='%s'>generate a new address</a> for the RSS feed. This is "
227
+ "useful if you think that the address has fallen into the wrong hands."
228
+ msgstr ""
229
+ "بإمكانك <a href='%s'>إنشاء كلمة مرور جديدة</a> لتغذية الـ RSS هذه. هذا "
230
+ "الخيار مفيد إذا كنت تعتقد أن العنوان قد وقع في الأيدي الخاطئة."
231
+
232
+ # $update_link = add_query_arg("simple_history_clear_log", "1");
233
+ # printf(' <a href="%2$s">%1$s</a>', __('Clear it now.', 'simple-history'), $update_link);
234
+ # }
235
+ msgid "Clear it now."
236
+ msgstr "امسحها الآن."
237
+
238
+ # $link = esc_html(add_query_arg("simple_history_user_to_show", ""));
239
+ # $str_users .= "<li $css><a href='$link'>" . __("By all users", 'simple-history') ."</a> | </li>";
240
+ # foreach ($arr_users as $user_id => $user_info) {
241
+ msgid "By all users"
242
+ msgstr "عن طريق جميع الأعضاء"
243
+
244
+ # if ($one_item->occasions) {
245
+ # $description .= sprintf(__("%d occasions", 'simple-history'), sizeof($one_item->occasions));
246
+ # $description .= "<br />";
247
+ msgid "%d occasions"
248
+ msgstr "%d حوادث"
249
+
250
+ # if ($user_nicename) {
251
+ # $description .= sprintf(__("By %s", 'simple-history'), $user_nicename);
252
+ # $description .= "<br />";
253
+ msgid "By %s"
254
+ msgstr "عن طريق %s"
255
+
256
+ # <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
257
+ # <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
258
+ # <link><?php echo get_bloginfo("siteurl") ?></link>
259
+ msgid "WordPress History for %s"
260
+ msgstr "تاريخ ووردبريس ل%s"
261
+
262
+ # <channel>
263
+ # <title><?php printf(__("History for %s", 'simple-history'), get_bloginfo("name")) ?></title>
264
+ # <description><?php printf(__("WordPress History for %s", 'simple-history'), get_bloginfo("name")) ?></description>
265
+ msgid "History for %s"
266
+ msgstr "التاريخ ل%s"
267
+
268
+ # add_settings_field("simple_history_settings_field_2", __("RSS feed", "simple-history"), "simple_history_settings_field_rss", "simple_history_settings_menu_slug", "simple_history_settings_section");
269
+ # add_settings_field("simple_history_settings_field_4", __("Clear log", "simple-history"), "simple_history_settings_field_clear_log", "simple_history_settings_menu_slug", "simple_history_settings_section");
270
+ # add_settings_field("simple_history_settings_field_3", __("Donate", "simple-history"), "simple_history_settings_field_donate", "simple_history_settings_menu_slug", "simple_history_settings_section");
271
+ msgid "Clear log"
272
+ msgstr "مسح السجل"
273
+
274
+ # $no_found = __("No matching items found.", 'simple-history');
275
+ # $view_rss = __("RSS feed", 'simple-history');
276
+ # $view_rss_link = simple_history_get_rss_address();
277
+ msgid "RSS feed"
278
+ msgstr "تغذية RSS"
279
+
280
+ # add_settings_field("simple_history_settings_field_1", __("Show Simple History", "simple-history"), "simple_history_settings_field", "simple_history_settings_menu_slug", "simple_history_settings_section");
281
+ # add_settings_field("simple_history_settings_field_5", __("Number of items per page", "simple-history"), "simple_history_settings_field_number_of_items", "simple_history_settings_menu_slug", "simple_history_settings_section");
282
+ # add_settings_field("simple_history_settings_field_2", __("RSS feed", "simple-history"), "simple_history_settings_field_rss", "simple_history_settings_menu_slug", "simple_history_settings_section");
283
+ msgid "Number of items per page"
284
+ msgstr "عدد العناصر لكل صفحة"
285
+
286
+ #
287
+ # add_settings_field("simple_history_settings_field_1", __("Show Simple History", "simple-history"), "simple_history_settings_field", "simple_history_settings_menu_slug", "simple_history_settings_section");
288
+ # add_settings_field("simple_history_settings_field_5", __("Number of items per page", "simple-history"), "simple_history_settings_field_number_of_items", "simple_history_settings_menu_slug", "simple_history_settings_section");
289
+ msgid "Show Simple History"
290
+ msgstr "إظهار التاريخ المبسط"
291
+
292
+ # <form method="post" action="options.php">
293
+ # <h2><?php _e("Simple History Settings", "simple-history") ?></h2>
294
+ # <?php do_settings_sections("simple_history_settings_menu_slug"); ?>
295
+ msgid "Simple History Settings"
296
+ msgstr "إعدادات التاريخ المبسط"
297
+
298
+ # add_settings_field("simple_history_settings_field_4", __("Clear log", "simple-history"), "simple_history_settings_field_clear_log", "simple_history_settings_menu_slug", "simple_history_settings_section");
299
+ # add_settings_field("simple_history_settings_field_3", __("Donate", "simple-history"), "simple_history_settings_field_donate", "simple_history_settings_menu_slug", "simple_history_settings_section");
300
+ #
301
+ msgid "Donate"
302
+ msgstr "تبرع"
303
+
304
+ # function action_core_updated($wp_version) {
305
+ # simple_history_add("action=updated&object_type=wordpress_core&object_id=wordpress_core&object_name=".sprintf(__('WordPress %1$s', 'simple-history'), $wp_version));
306
+ # }
307
+ msgid "WordPress %1$s"
308
+ msgstr "ووردبريس %1$s"
309
+
310
+ # <div class="wrap">
311
+ # <h2><?php echo __("History", 'simple-history') ?></h2>
312
+ # <?php
313
+ msgid "History"
314
+ msgstr "التاريخ"
315
+
316
+ # $dummy = __("logged in", "simple-history");
317
+ # $dummy = __("logged out", "simple-history");
318
+ # }
319
+ msgid "logged out"
320
+ msgstr "سجّل الخروج"
321
+
322
+ # $dummy = __("comment", "simple-history");
323
+ # $dummy = __("logged in", "simple-history");
324
+ # $dummy = __("logged out", "simple-history");
325
+ msgid "logged in"
326
+ msgstr "سجّل الدخول"
327
+
328
+ # $dummy = __("edited", "simple-history");
329
+ # $dummy = __("comment", "simple-history");
330
+ # $dummy = __("logged in", "simple-history");
331
+ msgid "comment"
332
+ msgstr "تعليق"
333
+
334
+ # $dummy = __("settings page", "simple-history");
335
+ # $dummy = __("edited", "simple-history");
336
+ # $dummy = __("comment", "simple-history");
337
+ msgid "edited"
338
+ msgstr "تم التحرير"
339
+
340
+ # $dummy = __("user", "simple-history");
341
+ # $dummy = __("settings page", "simple-history");
342
+ # $dummy = __("edited", "simple-history");
343
+ msgid "settings page"
344
+ msgstr "صفحة الإعدادات"
345
+
346
+ # $user_out = "";
347
+ # $user_out .= __("user", 'simple-history');
348
+ # $user = get_user_by("id", $object_id);
349
+ msgid "user"
350
+ msgstr "المستخدم"
351
+
352
+ # $attachment_out = "";
353
+ # $attachment_out .= __("attachment", 'simple-history') . " ";
354
+ #
355
+ msgid "attachment"
356
+ msgstr "المرفق"
357
+
358
+ # $dummy = __("updated", "simple-history");
359
+ # $dummy = __("nav_menu_item", "simple-history");
360
+ # $dummy = __("attachment", "simple-history");
361
+ msgid "nav_menu_item"
362
+ msgstr "عنصر القائمة"
363
+
364
+ # $dummy = __("deleted", "simple-history");
365
+ # $dummy = __("updated", "simple-history");
366
+ # $dummy = __("nav_menu_item", "simple-history");
367
+ msgid "updated"
368
+ msgstr "تم التحديث"
369
+
370
+ # $dummy = __("created", "simple-history");
371
+ # $dummy = __("deleted", "simple-history");
372
+ # $dummy = __("updated", "simple-history");
373
+ msgid "deleted"
374
+ msgstr "تم الحذف"
375
+
376
+ # $dummy = __("untrashed", "simple-history");
377
+ # $dummy = __("created", "simple-history");
378
+ # $dummy = __("deleted", "simple-history");
379
+ msgid "created"
380
+ msgstr "تم الإنشاء"
381
+
382
+ # $dummy = __("trashed", "simple-history");
383
+ # $dummy = __("untrashed", "simple-history");
384
+ # $dummy = __("created", "simple-history");
385
+ msgid "untrashed"
386
+ msgstr "تم إلغاء الحذف"
387
+
388
+ # $dummy = __("marked as spam", "simple-history");
389
+ # $dummy = __("trashed", "simple-history");
390
+ # $dummy = __("untrashed", "simple-history");
391
+ msgid "trashed"
392
+ msgstr "تم الحذف"
393
+
394
+ # $dummy = __("unapproved", "simple-history");
395
+ # $dummy = __("marked as spam", "simple-history");
396
+ # $dummy = __("trashed", "simple-history");
397
+ msgid "marked as spam"
398
+ msgstr "تم التعليم كتعليق غير مرغوب فيه"
399
+
400
+ # $dummy = __("approved", "simple-history");
401
+ # $dummy = __("unapproved", "simple-history");
402
+ # $dummy = __("marked as spam", "simple-history");
403
+ msgid "unapproved"
404
+ msgstr "تم إلغاء التصديق"
405
+
406
+ # function add_types_for_translation() {
407
+ # $dummy = __("approved", "simple-history");
408
+ # $dummy = __("unapproved", "simple-history");
409
+ msgid "approved"
410
+ msgstr "تم التصديق"
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Simple History ===
2
- Contributors: eskapism, MarsApril
3
  Donate link: http://eskapism.se/sida/donate/
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin
5
- Requires at least: 3.0
6
- Tested up to: 3.5
7
- Stable tag: 1.0.9
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
@@ -14,12 +14,17 @@ Simple History shows recent changes made within WordPress, directly on your dash
14
 
15
  The plugin works as a log/history/audit log/version history of the most important events that occur in WordPress.
16
 
17
- For example:
18
 
19
- * see what posts and pages that have been created, modified or deleted
20
- * see what attachments have been uploaded, modified or deleted
21
- * see what plugins that have been activated or deactivated
22
- * search through the history/log to find the change/post/article you are looking for
 
 
 
 
 
23
 
24
  There is also a **RSS feed of changes** available, so you can keep track of the changes made
25
  via your favorite RSS reader on your phone, on your iPad, or on your computer.
@@ -38,10 +43,12 @@ _"The site feels very slow since yesterday. Has anyone done anything special? ..
38
  that must be it."_
39
 
40
  #### See it in action
 
41
  See the plugin in action with this short screencast:
42
  [youtube http://www.youtube.com/watch?v=4cu4kooJBzs]
43
 
44
  #### Add your own events to simple history
 
45
  If you are a plugin developer and would like to add your own things/events to Simple History
46
  you can do that by calling the function simple_history_add like this:
47
  `<?php
@@ -66,6 +73,10 @@ if (function_exists("simple_history_add")) {
66
  ?>
67
  `
68
 
 
 
 
 
69
  #### Never clear the history
70
 
71
  By default the items in the history log is cleared automatically afer 60 days.
@@ -88,6 +99,10 @@ This plugin is available in the following languages:
88
  * German
89
  * Simplified Chinese
90
  * Swedish
 
 
 
 
91
 
92
  #### Donation and more plugins
93
  * If you like this plugin don't forget to [donate to support further development](http://eskapism.se/sida/donate/).
@@ -115,8 +130,20 @@ to only use the secret RSS feed to keep track of the changes on you web site/Wor
115
 
116
  3. The RSS feed with changes, as shown in Firefox.
117
 
 
 
118
  == Changelog ==
119
 
 
 
 
 
 
 
 
 
 
 
120
  = 1.0.9 =
121
  - Added French translation
122
 
1
  === Simple History ===
2
+ Contributors: eskapism, MarsApril, offereins
3
  Donate link: http://eskapism.se/sida/donate/
4
  Tags: history, log, changes, changelog, audit, trail, pages, attachments, users, cms, dashboard, admin
5
+ Requires at least: 3.5.1
6
+ Tested up to: 3.5.1
7
+ Stable tag: 1.1
8
 
9
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
10
 
14
 
15
  The plugin works as a log/history/audit log/version history of the most important events that occur in WordPress.
16
 
17
+ Out of the box Simple History has support for:
18
 
19
+ * **Posts and pages - see who added, updated or deleted a post or page
20
+ * **Attachments** - see who added, updated or deleted an attachment
21
+ * **Comments** - see who edited, approved or removed a comment
22
+ * **Widgets** - get info when someone adds, updates or removes a widget in a sidebar
23
+ * **Plugins** - activation and deactivation
24
+ * **User profiles** - info about added, updated or removed users
25
+ * **User logins** - see when a user login & logut
26
+ * **bbPress** - view changes to forums and topics and view user changes
27
+ * **Gravity Forms** - see who created, edited or deleted a form, field, or entry
28
 
29
  There is also a **RSS feed of changes** available, so you can keep track of the changes made
30
  via your favorite RSS reader on your phone, on your iPad, or on your computer.
43
  that must be it."_
44
 
45
  #### See it in action
46
+
47
  See the plugin in action with this short screencast:
48
  [youtube http://www.youtube.com/watch?v=4cu4kooJBzs]
49
 
50
  #### Add your own events to simple history
51
+
52
  If you are a plugin developer and would like to add your own things/events to Simple History
53
  you can do that by calling the function simple_history_add like this:
54
  `<?php
73
  ?>
74
  `
75
 
76
+ #### Add support for your own custom events
77
+
78
+ There's also a simple class that you can extend to add support for custom history items. It's super simple to use! Take a look at `class.simple-history-extend.php` to get started, and then extending Simple_History_Extend and fill the required methods with their events and log messages.
79
+
80
  #### Never clear the history
81
 
82
  By default the items in the history log is cleared automatically afer 60 days.
99
  * German
100
  * Simplified Chinese
101
  * Swedish
102
+ * French
103
+ * Arabic
104
+
105
+ Lots of thanks to the translators!
106
 
107
  #### Donation and more plugins
108
  * If you like this plugin don't forget to [donate to support further development](http://eskapism.se/sida/donate/).
130
 
131
  3. The RSS feed with changes, as shown in Firefox.
132
 
133
+ 4. Widgets can be tracked too!
134
+
135
  == Changelog ==
136
 
137
+ = 1.1 =
138
+ - Added the Simple History Extender-module/plugin. With this great addon to Simple History it is very easy for other developers to add their own actions to simple history, including a settings panel to check actions on/off. All work on this module was made by Laurens Offereins (lmoffereins@gmail.com). Super thanks!
139
+ - With the help of Simple History Extender this plugin also tracks changes made in bbPress, Gravity Forms and in Widges. Awesome!
140
+ - Added user email to RSS feed + some other small changed to make it compatible with IFTTT.com. Thanks to phoenixMagoo for the code changes. Fixes http://wordpress.org/support/topic/suggestions-a-couple-of-tweaks-to-the-rss-feed.
141
+ - Added two filters for the RSS feed: simple_history_rss_item_title and simple_history_rss_item_description.
142
+ - Changed the way the plugin directory was determined. Perhaps and hopefully this fixes some problems with multi site and plugin in different locations and stuff like that
143
+ - Style fixes for RTL languages
144
+ - Small fixes here and there, for example changing deprecated WordPress functions to not deprecated
145
+ - Added new filter: simple_history_db_purge_days_interval. Hook it to change default clear interval of 60 days.
146
+
147
  = 1.0.9 =
148
  - Added French translation
149
 
screenshot-4.png ADDED
Binary file
simple-history-extender/class.simple-history-extend.php ADDED
@@ -0,0 +1,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Simple History Extend Class
5
+ *
6
+ * Use this class to build modules upon.
7
+ *
8
+ * @package Simple History Extender
9
+ * @subpackage Main
10
+ */
11
+
12
+ // Exit if accessed directly
13
+ if ( !defined( 'ABSPATH' ) ) exit;
14
+
15
+ if ( !class_exists( 'Simple_History_Extend' ) ) :
16
+
17
+ /**
18
+ * Plugin class
19
+ */
20
+ class Simple_History_Extend {
21
+
22
+ var $id;
23
+ var $title;
24
+ var $plugin;
25
+ var $description;
26
+
27
+ var $supports; // Events supported
28
+ var $lacks; // Events not supported
29
+
30
+ var $events;
31
+
32
+ var $modules;
33
+
34
+ /**
35
+ * Build this module
36
+ *
37
+ * @param array $args Class arguments. Requires
38
+ * array(
39
+ * 'id' => The module id
40
+ * 'title' => The module title
41
+ * 'plugin' => The plugin basename or False if not a plugin
42
+ * 'description' => Description of the module
43
+ * 'tabs' => The contents of the contextual help tab. Can
44
+ * contain 'supports' array and 'lacks' array
45
+ * );
46
+ * @return void
47
+ */
48
+ function __construct( $args ){
49
+ $this->setup_globals( $args );
50
+ $this->setup_actions();
51
+ }
52
+
53
+ /**
54
+ * Define local class variables
55
+ *
56
+ * @param array $args Class arguments
57
+ * @return void
58
+ */
59
+ function setup_globals( $args ){
60
+
61
+ // Set module params
62
+ $this->id = $args['id'];
63
+ $this->title = $args['title'];
64
+ $this->plugin = isset( $args['plugin'] ) ? $args['plugin'] : false;
65
+ $this->description = isset( $args['description'] )
66
+ ? $args['description']
67
+ : ( $this->plugin
68
+ ? sprintf( __('Log events for the %s plugin.', 'sh-extender'), $this->title )
69
+ : sprintf( __('Log events for %s.', 'sh-extender'), $this->title )
70
+ );
71
+
72
+ // Set module tab contents
73
+ $this->supports = isset( $args['tabs']['supports'] ) ? $args['tabs']['supports'] : $args['tabs'];
74
+ $this->lacks = isset( $args['tabs']['lacks'] ) ? $args['tabs']['lacks'] : array();
75
+
76
+ // Set module events
77
+ $this->events = $this->setup_events();
78
+ }
79
+
80
+ /**
81
+ * Return generic events for setup in $this->events
82
+ *
83
+ * @return array $events
84
+ */
85
+ public function setup_events(){
86
+
87
+ // Setup default events
88
+ $events = array(
89
+ 'new' => __('created', 'sh-extender'),
90
+ 'edit' => __('edited', 'sh-extender'),
91
+ 'delete' => __('deleted', 'sh-extender'),
92
+ 'spam' => __('marked as spam', 'sh-extender'),
93
+ 'unspam' => __('unmarked as spam', 'sh-extender'),
94
+ 'trash' => __('trashed', 'sh-extender'),
95
+ 'untrash' => __('untrashed', 'sh-extender'),
96
+ 'submit' => __('submitted', 'sh-extender')
97
+ );
98
+
99
+ return wp_parse_args( $this->add_events(), $events );
100
+ }
101
+
102
+ /**
103
+ * Register action and filter hooks
104
+ *
105
+ * @return void
106
+ */
107
+ public function setup_actions(){
108
+
109
+ // Bail out if module plugin is not active
110
+ if ( $this->plugin && !is_plugin_active( $this->plugin ) )
111
+ return;
112
+
113
+ // Register settings field and help tab
114
+ add_action( 'admin_init', array( $this, 'settings_field' ) );
115
+ add_filter( 'sh_extender_add_help_tabs', array( $this, 'add_help_tab' ) );
116
+
117
+ // Do we really need to load this every time we create a module?
118
+ $modules = get_option( 'sh_extender_modules' );
119
+
120
+ // Bail out if module is not active
121
+ if ( !isset( $modules[$this->id] ) || !$modules[$this->id]['active'] )
122
+ return;
123
+
124
+ // Register custom log actions
125
+ $this->add_actions();
126
+ }
127
+
128
+ /** Override this function in child class to add custom events to $this->events */
129
+ function add_events(){
130
+ return array();
131
+ }
132
+
133
+ /** Override this function in child class to add log actions */
134
+ function add_actions(){
135
+ }
136
+
137
+ /**
138
+ * Adds the module help tab to the contextual admin help
139
+ *
140
+ * @param array $tabs The tabs already added
141
+ * @return array $tabs The tabs with module tab added
142
+ */
143
+ function add_help_tab( $tabs ){
144
+
145
+ // This module has no tab
146
+ if ( empty( $this->supports ) )
147
+ return $tabs;
148
+
149
+ // Build content string starting with supporting events
150
+ $content = '<p><strong>'. sprintf( __('The %s module logs the following events:', 'sh-extender'), $this->title ) .'</strong></p><p>';
151
+
152
+ // Create supports list
153
+ $content .= '<ul>';
154
+
155
+ // Create supports list items
156
+ foreach ( $this->supports as $item )
157
+ $content .= '<li>'. $item .'</li>';
158
+
159
+ // Close supports list
160
+ $content .= '</ul>';
161
+
162
+ // Add non-supported events if there are any
163
+ if ( !empty( $this->lacks ) ){
164
+
165
+ $content .= '</p><p><strong>'. sprintf( __('The %s module does not support the following events:', 'sh-extender'), $this->title ) .'</strong></p><p>';
166
+
167
+ // Create lacks list
168
+ $content .='<ul>';
169
+
170
+ // Create lacks list items
171
+ foreach ( $this->lacks as $item )
172
+ $content .= '<li>'. $item .'</li>';
173
+
174
+ // Close lacks list
175
+ $content .='</ul>';
176
+ }
177
+
178
+ // Close content string
179
+ $content .= '</p>';
180
+
181
+ // Add module tab to the tabs
182
+ $tabs[] = array(
183
+ 'id' => $this->id,
184
+ 'title' => $this->title,
185
+ 'content' => $content
186
+ );
187
+
188
+ return $tabs;
189
+ }
190
+
191
+ /**
192
+ * Register settings field for this module
193
+ *
194
+ * @return void
195
+ */
196
+ public function settings_field(){
197
+ global $simple_history_extender;
198
+
199
+ add_settings_field(
200
+ $simple_history_extender->modules_name .'['. $this->id .']',
201
+ $this->title,
202
+ array( $this, 'module_field' ),
203
+ $simple_history_extender->page,
204
+ $simple_history_extender->modules_section
205
+ );
206
+ }
207
+
208
+ /**
209
+ * Output settings field for this module
210
+ *
211
+ * @return void
212
+ */
213
+ public function module_field(){
214
+ global $simple_history_extender;
215
+
216
+ echo '<label><input type="checkbox" name="'. $simple_history_extender->modules_name .'['. $this->id .'][active]" value="1" '. checked( isset( $simple_history_extender->modules[$this->id] ) ? $simple_history_extender->modules[$this->id]['active'] : false, true, false ) .' /> ';
217
+ echo '<span class="description">'. $this->description .'</span></label>';
218
+ }
219
+
220
+ /** Helpers ******************************************************/
221
+
222
+ /**
223
+ * Add a custom event to the Simple History plugin
224
+ *
225
+ * Call this function in all modules with $this->extend()
226
+ *
227
+ * @param array $r The event arguments. Shortened for convenience:
228
+ * - action > action
229
+ * - object_type > type
230
+ * - object_subtype > subtype
231
+ * - object_name > name
232
+ * - object_id > id
233
+ * - user_id > user_id
234
+ * @uses simple_history_extend() To add an event to Simple History
235
+ * @return void
236
+ */
237
+ function extend( $r ){
238
+ $args = array(
239
+ 'action' => isset( $r['action'] ) ? $r['action'] : __('updated'),
240
+ 'object_type' => isset( $r['type'] ) ? $r['type'] : null,
241
+ 'object_subtype' => isset( $r['subtype'] ) ? $r['subtype'] : null,
242
+ 'object_name' => isset( $r['name'] ) ? $r['name'] : null,
243
+ 'object_id' => isset( $r['id'] ) ? $r['id'] : null,
244
+ 'user_id' => isset( $r['user_id'] ) ? $r['user_id'] : null
245
+ );
246
+
247
+ // Do the magic
248
+ simple_history_add( $args );
249
+ }
250
+
251
+ /**
252
+ * Extend Simple History shortcut for User type
253
+ *
254
+ * @param int $user_id User ID
255
+ * @param string $action The logged action
256
+ * @return void
257
+ */
258
+ function extend_user( $user_id, $action ){
259
+ $user = get_userdata( $user_id );
260
+
261
+ $this->extend( array(
262
+ 'action' => $action,
263
+ 'type' => __('User'),
264
+ 'name' => apply_filters( 'she_extend_user_name', $user->user_login ),
265
+ 'id' => $user_id
266
+ ) );
267
+ }
268
+
269
+ /**
270
+ * Extend Simple History shortcut for Post type
271
+ *
272
+ * @param int $post_id Post ID
273
+ * @param string $action The logged action
274
+ * @return void
275
+ */
276
+ function extend_post( $post_id, $action ){
277
+ $post_type = get_post_type( $post_id );
278
+ $cpt = get_post_type_object( $post_type );
279
+
280
+ $this->extend( array(
281
+ 'action' => $action,
282
+ 'type' => $cpt->labels->singular_name,
283
+ 'name' => get_the_title( $post_id ), // Previous or changed title?
284
+ 'id' => $post_id
285
+ ) );
286
+ }
287
+ }
288
+
289
+ endif; // class_exists
simple-history-extender/languages/sh-extender-nl_NL.mo ADDED
Binary file
simple-history-extender/languages/sh-extender-nl_NL.po ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Simple History Extender\n"
4
+ "POT-Creation-Date: 2012-11-27 00:32+0100\n"
5
+ "PO-Revision-Date: 2012-11-27 00:33+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: Dutch\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../simple-history-extender.php:161
19
+ msgid "Settings"
20
+ msgstr ""
21
+
22
+ #: ../simple-history-extender.php:183
23
+ #, php-format
24
+ msgid ""
25
+ "The Simple History Extender plugin was deactivated because the Simple "
26
+ "History plugin was not found installed or active.<br/><br/><a href=\"%s"
27
+ "\">Return</a>."
28
+ msgstr ""
29
+ "De Simple History Extender plugin is gedeactiveerd omdat de Simple History "
30
+ "plugin niet gevonden is of niet actief is.<br/><br/><a href=\"%s\">Ga terug</"
31
+ "a>."
32
+
33
+ #: ../simple-history-extender.php:184
34
+ #, php-format
35
+ msgid ""
36
+ "The Simple History Extender plugin was deactivated.<br/><br/><a href=\"%s"
37
+ "\">Return</a>."
38
+ msgstr ""
39
+ "De Simple History Extender plugin is gedeactiveerd.<br/><br/><a href=\"%s"
40
+ "\">Ga terug</a>."
41
+
42
+ #: ../simple-history-extender.php:213
43
+ msgid "Simple History Extender Modules"
44
+ msgstr ""
45
+
46
+ #: ../simple-history-extender.php:223
47
+ msgid ""
48
+ "Activate or deactivate the events you want to log. Read the Help tab if you "
49
+ "want to know which actions are supported and which aren't."
50
+ msgstr ""
51
+ "Activeer of deactiveer de momenten die je wilt registreren. Lees de Help tab "
52
+ "als je wilt weten welke acties worden geregistreerd en welke niet."
53
+
54
+ #: ../simple-history-extender.php:255
55
+ msgid "activated"
56
+ msgstr "geactiveerd"
57
+
58
+ #: ../simple-history-extender.php:255
59
+ msgid "deactivated"
60
+ msgstr "gedeactiveerd"
61
+
62
+ #: ../simple-history-extender.php:256
63
+ msgid "Simple History Extender Module"
64
+ msgstr ""
65
+
66
+ #: ../class.sh-extend.php:68
67
+ #, php-format
68
+ msgid "Log events for the %s plugin."
69
+ msgstr "Registreer momenten voor de %s plugin."
70
+
71
+ #: ../class.sh-extend.php:69
72
+ #, php-format
73
+ msgid "Log events for %s."
74
+ msgstr "Registreer momenten voor %s."
75
+
76
+ #: ../class.sh-extend.php:89
77
+ msgid "created"
78
+ msgstr "aangemaakt"
79
+
80
+ #: ../class.sh-extend.php:90
81
+ msgid "edited"
82
+ msgstr "bewerkt"
83
+
84
+ #: ../class.sh-extend.php:91
85
+ msgid "deleted"
86
+ msgstr "verwijderd"
87
+
88
+ #: ../class.sh-extend.php:92
89
+ msgid "marked as spam"
90
+ msgstr "gemarkeerd als spam"
91
+
92
+ #: ../class.sh-extend.php:93
93
+ msgid "unmarked as spam"
94
+ msgstr "gemarkeerd als geen spam"
95
+
96
+ #: ../class.sh-extend.php:94
97
+ msgid "trashed"
98
+ msgstr "in de prullenbak gegooid"
99
+
100
+ #: ../class.sh-extend.php:95
101
+ msgid "untrashed"
102
+ msgstr "uit de prullenbak gehaald"
103
+
104
+ #: ../class.sh-extend.php:96
105
+ msgid "submitted"
106
+ msgstr "verzonden"
107
+
108
+ #: ../class.sh-extend.php:150
109
+ #, php-format
110
+ msgid "The %s module logs the following events:"
111
+ msgstr "De %s module registreert de volgende acties:"
112
+
113
+ #: ../class.sh-extend.php:165
114
+ #, php-format
115
+ msgid "The %s module does not support the following events:"
116
+ msgstr "De %s module registreert niet deze acties:"
117
+
118
+ #: ../class.sh-extend.php:239
119
+ msgid "updated"
120
+ msgstr "bijgewerkt"
121
+
122
+ #: ../modules/gravityforms.php:28
123
+ msgid "Gravity Forms"
124
+ msgstr ""
125
+
126
+ #: ../modules/gravityforms.php:32
127
+ msgid "Creating, editing and deleting a form."
128
+ msgstr "Aanmaken, bewerken en verwijderen van een formulier."
129
+
130
+ #: ../modules/gravityforms.php:33
131
+ msgid "Deleting a field from an existing form."
132
+ msgstr "Verwijderen van een dataveld van een bestaand formulier."
133
+
134
+ #: ../modules/gravityforms.php:34
135
+ msgid "Submitting, editing and deleting an entry."
136
+ msgstr "Verzenden, bewerken en verwijderen van een ingevuld formulier."
137
+
138
+ #: ../modules/gravityforms.php:35
139
+ msgid "Changing the status of an entry, including read/unread and star/unstar."
140
+ msgstr ""
141
+ "Wijzigen van de status van een reactie, inclusief markeren van lezen/"
142
+ "ongelezen en met ster/zonder ster."
143
+
144
+ #: ../modules/gravityforms.php:38
145
+ msgid "Duplicating a form."
146
+ msgstr "Dupliceren van een formulier."
147
+
148
+ #: ../modules/gravityforms.php:39
149
+ msgid "Setting a form to active/inactive."
150
+ msgstr "Markeren van een formulier als actief/inactief."
151
+
152
+ #: ../modules/gravityforms.php:48
153
+ msgid "starred"
154
+ msgstr "gemarkeerd met een ster"
155
+
156
+ #: ../modules/gravityforms.php:49
157
+ msgid "unstarred"
158
+ msgstr "gemarkeerde ster verwijderd"
159
+
160
+ #: ../modules/gravityforms.php:50
161
+ msgid "marked as read"
162
+ msgstr "gemarkeerd als gelezen"
163
+
164
+ #: ../modules/gravityforms.php:51
165
+ msgid "marked as unread"
166
+ msgstr "gemarkeerd als gelezen"
167
+
168
+ #: ../modules/gravityforms.php:110
169
+ #, php-format
170
+ msgid "from %s"
171
+ msgstr "van %s"
172
+
173
+ #: ../modules/gravityforms.php:112
174
+ msgid "from unknown"
175
+ msgstr "van onbekend"
176
+
177
+ #: ../modules/gravityforms.php:120
178
+ msgid "Form"
179
+ msgstr "Formulier"
180
+
181
+ #: ../modules/gravityforms.php:129
182
+ msgid "Form entry"
183
+ msgstr "Ingevuld formulier"
184
+
185
+ #: ../modules/gravityforms.php:150
186
+ msgid "without entries deleted"
187
+ msgstr "zonder reacties verwijderd"
188
+
189
+ #: ../modules/gravityforms.php:151
190
+ #, php-format
191
+ msgid "with %d entries deleted"
192
+ msgstr "met %d reacties verwijderd"
193
+
194
+ #: ../modules/gravityforms.php:160
195
+ #, php-format
196
+ msgid "field %s deleted"
197
+ msgstr "veld %s verwijderd"
198
+
199
+ #: ../modules/gravityforms.php:201
200
+ msgid "restored"
201
+ msgstr "hersteld"
202
+
203
+ #: ../modules/gravityforms.php:206
204
+ msgid "changed status"
205
+ msgstr "status gewijzigd"
206
+
207
+ #: ../modules/widgets.php:25
208
+ msgid "Widgets"
209
+ msgstr ""
210
+
211
+ #: ../modules/widgets.php:27
212
+ msgid "Log events for the Widgets section of your WP install."
213
+ msgstr "Registreer momenten voor het Widget onderdeel van je WP installatie."
214
+
215
+ #: ../modules/widgets.php:30
216
+ msgid "Adding, updating and deleting widgets in/from a sidebar."
217
+ msgstr "Toevoegen, bijwerken en verwijderen van widgets in/uit een sidebar."
218
+
219
+ #: ../modules/widgets.php:33
220
+ msgid "Moving widgets between sidebars."
221
+ msgstr "Verplaatsen van widgets tussen sidebars."
222
+
223
+ #: ../modules/widgets.php:34
224
+ msgid "Setting a widget to active/inactive."
225
+ msgstr "Markeren van een widget als actief/inactief."
226
+
227
+ #: ../modules/widgets.php:86
228
+ #, php-format
229
+ msgid "removed from sidebar %s"
230
+ msgstr "verwijderd van sidebar %s"
231
+
232
+ #: ../modules/widgets.php:88
233
+ #, php-format
234
+ msgid "updated in sidebar %s"
235
+ msgstr "bijgwerkt in sidebar %s"
236
+
237
+ #: ../modules/widgets.php:90
238
+ #, php-format
239
+ msgid "added to sidebar %s"
240
+ msgstr "toegevoegd aan sidebar %s"
241
+
242
+ #: ../modules/widgets.php:95
243
+ msgid "Widget"
244
+ msgstr ""
245
+
246
+ #: ../modules/bbpress.php:28
247
+ msgid "BBPress"
248
+ msgstr ""
249
+
250
+ #: ../modules/bbpress.php:32
251
+ msgid "Creating, editing and deleting a forum, topic, reply."
252
+ msgstr "Aanmaken, wijzigen en verwijderen van een forum, onderwerp of reactie."
253
+
254
+ #: ../modules/bbpress.php:33
255
+ msgid "Setting the type of a forum to category or forum."
256
+ msgstr "Markeren van een forum als type categorie of type forum."
257
+
258
+ #: ../modules/bbpress.php:34
259
+ msgid "Setting the status of a forum, topic to open or closed."
260
+ msgstr ""
261
+ "Markeren van de status van een forum of onderwerp als open of gesloten."
262
+
263
+ #: ../modules/bbpress.php:35
264
+ msgid "Setting the forum visibility to public, private or hidden."
265
+ msgstr "Markeren van een forum als publiek of privé zichtbaar of verborgen."
266
+
267
+ #: ../modules/bbpress.php:36
268
+ msgid "Trashing and untrashing a forum, topic, reply."
269
+ msgstr ""
270
+ "Verplaatsen van een forum, onderwerp of reactie in en uit de prullenbak."
271
+
272
+ #: ../modules/bbpress.php:37
273
+ msgid "Marking and unmarking a topic, reply as spam."
274
+ msgstr "Markeren van een onderwerp of reactie als spam of geen spam."
275
+
276
+ #: ../modules/bbpress.php:38
277
+ msgid "Marking and unmarking a topic as sticky."
278
+ msgstr "Markeren van een onderwerp als sticky of niet sticky."
279
+
280
+ #: ../modules/bbpress.php:39
281
+ msgid "Merging and splitting a topic."
282
+ msgstr "Samenvoegen en splitsen van een ondewerp."
283
+
284
+ #: ../modules/bbpress.php:40
285
+ msgid "Updating, merging and deleting a topic tag."
286
+ msgstr "Bijwerken, samenvoegen en verwijderen van een onderwerptag."
287
+
288
+ #: ../modules/bbpress.php:41
289
+ msgid "A user (un)favoriting and (un)subscribing to a topic."
290
+ msgstr ""
291
+ "Een gebruiker markeert een onderwerp als favoriet of abonneert zich op een "
292
+ "onderwerp of maakt dit ongedaan."
293
+
294
+ #: ../modules/bbpress.php:42
295
+ msgid "A user saving his/her profile."
296
+ msgstr "Een gebruiker bewerkt zijn/haar profiel."
297
+
298
+ #: ../modules/bbpress.php:53
299
+ msgid "closed"
300
+ msgstr "gesloten"
301
+
302
+ #: ../modules/bbpress.php:54
303
+ msgid "opened"
304
+ msgstr "geopend"
305
+
306
+ #: ../modules/bbpress.php:55
307
+ msgid "marked as sticky"
308
+ msgstr "gemarkeerd als sticky"
309
+
310
+ #: ../modules/bbpress.php:56
311
+ msgid "marked as super sticky"
312
+ msgstr "gemarkeerd als super sticky"
313
+
314
+ #: ../modules/bbpress.php:57
315
+ msgid "unmarked as sticky"
316
+ msgstr "gemarkeerd als niet sticky"
317
+
318
+ #: ../modules/bbpress.php:58
319
+ msgid "set to category type"
320
+ msgstr "gewijzigd naar category type"
321
+
322
+ #: ../modules/bbpress.php:59
323
+ msgid "set to forum type"
324
+ msgstr "gewijzigd naar forum type"
325
+
326
+ #: ../modules/bbpress.php:60
327
+ msgid "set to public"
328
+ msgstr "publiek zichtbaar"
329
+
330
+ #: ../modules/bbpress.php:61
331
+ msgid "set to private"
332
+ msgstr "privé zichtbaar"
333
+
334
+ #: ../modules/bbpress.php:62
335
+ msgid "set to hidden"
336
+ msgstr "verborgen"
337
+
338
+ #: ../modules/bbpress.php:63
339
+ #, php-format
340
+ msgid "in forum %s merged into %s"
341
+ msgstr "in forum %s samengevoegd in onderwerp %s"
342
+
343
+ #: ../modules/bbpress.php:64
344
+ #, php-format
345
+ msgid "in forum %s split from reply %s by %s into %s in forum %s"
346
+ msgstr ""
347
+ "in forum %s gesplitst vanaf reactie %s door %s in onderwerp %s in forum %s"
348
+
349
+ #: ../modules/bbpress.php:131
350
+ msgid "Forum"
351
+ msgstr ""
352
+
353
+ #: ../modules/bbpress.php:141
354
+ msgid "Topic"
355
+ msgstr ""
356
+
357
+ #: ../modules/bbpress.php:150
358
+ msgid "Topic Tag"
359
+ msgstr ""
360
+
361
+ #: ../modules/bbpress.php:161
362
+ #, php-format
363
+ msgid "by %s"
364
+ msgstr "door %s"
365
+
366
+ #: ../modules/bbpress.php:162
367
+ msgid "Reply"
368
+ msgstr ""
369
+
370
+ #: ../modules/bbpress.php:173
371
+ msgid "User"
372
+ msgstr ""
373
+
374
+ #: ../modules/bbpress.php:185
375
+ #, php-format
376
+ msgid "as child of %s"
377
+ msgstr "als subforum van %s"
378
+
379
+ #: ../modules/bbpress.php:246 ../modules/bbpress.php:256
380
+ #, php-format
381
+ msgid "in forum %s"
382
+ msgstr "in forum %s"
383
+
384
+ #: ../modules/bbpress.php:369
385
+ msgid "favorited"
386
+ msgstr "gemarkeerd als favoriet"
387
+
388
+ #: ../modules/bbpress.php:373
389
+ msgid "unfavorited"
390
+ msgstr "niet meer favoriet gemarkeerd"
391
+
392
+ #: ../modules/bbpress.php:377
393
+ msgid "subscribed"
394
+ msgstr "geabonneerd"
395
+
396
+ #: ../modules/bbpress.php:381
397
+ msgid "unsubscribed"
398
+ msgstr "abonnement ongedaan gemaakt"
399
+
400
+ #: ../modules/bbpress.php:385
401
+ msgid "profile updated"
402
+ msgstr "profiel bijgewerkt"
403
+
404
+ #: ../modules/bbpress.php:389
405
+ msgid "registered"
406
+ msgstr "geregistreerd"
407
+
408
+ #: ../modules/bbpress.php:397
409
+ #, php-format
410
+ msgid "changed forum role to %s"
411
+ msgstr "forum rol gewijzigd naar %s"
412
+
413
+ #: ../modules/bbpress.php:397
414
+ msgid "none"
415
+ msgstr "geen"
simple-history-extender/languages/sh-extender.pot ADDED
@@ -0,0 +1,396 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Simple History Extender\n"
4
+ "POT-Creation-Date: 2012-11-26 12:31+0100\n"
5
+ "PO-Revision-Date: 2012-11-26 12:32+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.5.4\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-SearchPath-0: ..\n"
16
+
17
+ #: ../simple-history-extender.php:161
18
+ msgid "Settings"
19
+ msgstr ""
20
+
21
+ #: ../simple-history-extender.php:183
22
+ #, php-format
23
+ msgid ""
24
+ "The Simple History Extender plugin was deactivated because the Simple "
25
+ "History plugin was not found installed or active.<br/><br/><a href=\"%s"
26
+ "\">Return</a>."
27
+ msgstr ""
28
+
29
+ #: ../simple-history-extender.php:184
30
+ #, php-format
31
+ msgid ""
32
+ "The Simple History Extender plugin was deactivated.<br/><br/><a href=\"%s"
33
+ "\">Return</a>."
34
+ msgstr ""
35
+
36
+ #: ../simple-history-extender.php:213
37
+ msgid "Simple History Extender Modules"
38
+ msgstr ""
39
+
40
+ #: ../simple-history-extender.php:223
41
+ msgid ""
42
+ "Activate or deactivate the events you want to log. Read the Help tab if you "
43
+ "want to know which actions are supported and which aren't."
44
+ msgstr ""
45
+
46
+ #: ../simple-history-extender.php:255
47
+ msgid "activated"
48
+ msgstr ""
49
+
50
+ #: ../simple-history-extender.php:255
51
+ msgid "deactivated"
52
+ msgstr ""
53
+
54
+ #: ../simple-history-extender.php:256
55
+ msgid "Simple History Extender Module"
56
+ msgstr ""
57
+
58
+ #: ../class.sh-extend.php:68
59
+ #, php-format
60
+ msgid "Log events for the %s plugin."
61
+ msgstr ""
62
+
63
+ #: ../class.sh-extend.php:69
64
+ #, php-format
65
+ msgid "Log events for %s."
66
+ msgstr ""
67
+
68
+ #: ../class.sh-extend.php:89
69
+ msgid "created"
70
+ msgstr ""
71
+
72
+ #: ../class.sh-extend.php:90
73
+ msgid "edited"
74
+ msgstr ""
75
+
76
+ #: ../class.sh-extend.php:91
77
+ msgid "deleted"
78
+ msgstr ""
79
+
80
+ #: ../class.sh-extend.php:92
81
+ msgid "marked as spam"
82
+ msgstr ""
83
+
84
+ #: ../class.sh-extend.php:93
85
+ msgid "unmarked as spam"
86
+ msgstr ""
87
+
88
+ #: ../class.sh-extend.php:94
89
+ msgid "trashed"
90
+ msgstr ""
91
+
92
+ #: ../class.sh-extend.php:95
93
+ msgid "untrashed"
94
+ msgstr ""
95
+
96
+ #: ../class.sh-extend.php:96
97
+ msgid "submitted"
98
+ msgstr ""
99
+
100
+ #: ../class.sh-extend.php:150
101
+ #, php-format
102
+ msgid "The %s module logs the following events:"
103
+ msgstr ""
104
+
105
+ #: ../class.sh-extend.php:157
106
+ #, php-format
107
+ msgid "The %s module does not support the following events:"
108
+ msgstr ""
109
+
110
+ #: ../class.sh-extend.php:226
111
+ msgid "updated"
112
+ msgstr ""
113
+
114
+ #: ../modules/gravityforms.php:28
115
+ msgid "Gravity Forms"
116
+ msgstr ""
117
+
118
+ #: ../modules/gravityforms.php:32
119
+ msgid "Creating, editing and deleting a form."
120
+ msgstr ""
121
+
122
+ #: ../modules/gravityforms.php:33
123
+ msgid "Deleting a field from an existing form."
124
+ msgstr ""
125
+
126
+ #: ../modules/gravityforms.php:34
127
+ msgid "Submitting, editing and deleting an entry."
128
+ msgstr ""
129
+
130
+ #: ../modules/gravityforms.php:35
131
+ msgid "Changing the status of an entry, including read/unread and star/unstar."
132
+ msgstr ""
133
+
134
+ #: ../modules/gravityforms.php:38
135
+ msgid "Duplicating a form."
136
+ msgstr ""
137
+
138
+ #: ../modules/gravityforms.php:39
139
+ msgid "Setting a form to active/inactive."
140
+ msgstr ""
141
+
142
+ #: ../modules/gravityforms.php:48
143
+ msgid "starred"
144
+ msgstr ""
145
+
146
+ #: ../modules/gravityforms.php:49
147
+ msgid "unstarred"
148
+ msgstr ""
149
+
150
+ #: ../modules/gravityforms.php:50
151
+ msgid "marked as read"
152
+ msgstr ""
153
+
154
+ #: ../modules/gravityforms.php:51
155
+ msgid "marked as unread"
156
+ msgstr ""
157
+
158
+ #: ../modules/gravityforms.php:110
159
+ #, php-format
160
+ msgid "from %s"
161
+ msgstr ""
162
+
163
+ #: ../modules/gravityforms.php:112
164
+ msgid "from unknown"
165
+ msgstr ""
166
+
167
+ #: ../modules/gravityforms.php:120
168
+ msgid "Form"
169
+ msgstr ""
170
+
171
+ #: ../modules/gravityforms.php:129
172
+ msgid "Form entry"
173
+ msgstr ""
174
+
175
+ #: ../modules/gravityforms.php:150
176
+ msgid "without entries deleted"
177
+ msgstr ""
178
+
179
+ #: ../modules/gravityforms.php:151
180
+ #, php-format
181
+ msgid "with %d entries deleted"
182
+ msgstr ""
183
+
184
+ #: ../modules/gravityforms.php:160
185
+ #, php-format
186
+ msgid "field %s deleted"
187
+ msgstr ""
188
+
189
+ #: ../modules/gravityforms.php:201
190
+ msgid "restored"
191
+ msgstr ""
192
+
193
+ #: ../modules/gravityforms.php:206
194
+ msgid "changed status"
195
+ msgstr ""
196
+
197
+ #: ../modules/widgets.php:25
198
+ msgid "Widgets"
199
+ msgstr ""
200
+
201
+ #: ../modules/widgets.php:27
202
+ msgid "Log events for the Widgets section of your WP install."
203
+ msgstr ""
204
+
205
+ #: ../modules/widgets.php:30
206
+ msgid "Adding, updating and deleting widgets in/from a sidebar."
207
+ msgstr ""
208
+
209
+ #: ../modules/widgets.php:33
210
+ msgid "Moving widgets between sidebars."
211
+ msgstr ""
212
+
213
+ #: ../modules/widgets.php:34
214
+ msgid "Setting a widget to active/inactive."
215
+ msgstr ""
216
+
217
+ #: ../modules/widgets.php:86
218
+ #, php-format
219
+ msgid "removed from sidebar %s"
220
+ msgstr ""
221
+
222
+ #: ../modules/widgets.php:88
223
+ #, php-format
224
+ msgid "updated in sidebar %s"
225
+ msgstr ""
226
+
227
+ #: ../modules/widgets.php:90
228
+ #, php-format
229
+ msgid "added to sidebar %s"
230
+ msgstr ""
231
+
232
+ #: ../modules/widgets.php:95
233
+ msgid "Widget"
234
+ msgstr ""
235
+
236
+ #: ../modules/bbpress.php:28
237
+ msgid "BBPress"
238
+ msgstr ""
239
+
240
+ #: ../modules/bbpress.php:32
241
+ msgid "Creating, editing and deleting a forum, topic, reply."
242
+ msgstr ""
243
+
244
+ #: ../modules/bbpress.php:33
245
+ msgid "Setting the type of a forum to category or forum."
246
+ msgstr ""
247
+
248
+ #: ../modules/bbpress.php:34
249
+ msgid "Setting the status of a forum, topic to open or closed."
250
+ msgstr ""
251
+
252
+ #: ../modules/bbpress.php:35
253
+ msgid "Setting the forum visibility to public, private or hidden."
254
+ msgstr ""
255
+
256
+ #: ../modules/bbpress.php:36
257
+ msgid "Trashing and untrashing a forum, topic, reply."
258
+ msgstr ""
259
+
260
+ #: ../modules/bbpress.php:37
261
+ msgid "Marking and unmarking a topic, reply as spam."
262
+ msgstr ""
263
+
264
+ #: ../modules/bbpress.php:38
265
+ msgid "Marking and unmarking a topic as sticky."
266
+ msgstr ""
267
+
268
+ #: ../modules/bbpress.php:39
269
+ msgid "Merging and splitting a topic."
270
+ msgstr ""
271
+
272
+ #: ../modules/bbpress.php:40
273
+ msgid "Updating, merging and deleting a topic tag."
274
+ msgstr ""
275
+
276
+ #: ../modules/bbpress.php:41
277
+ msgid "A user (un)favoriting and (un)subscribing to a topic."
278
+ msgstr ""
279
+
280
+ #: ../modules/bbpress.php:42
281
+ msgid "A user saving his/her profile."
282
+ msgstr ""
283
+
284
+ #: ../modules/bbpress.php:53
285
+ msgid "closed"
286
+ msgstr ""
287
+
288
+ #: ../modules/bbpress.php:54
289
+ msgid "opened"
290
+ msgstr ""
291
+
292
+ #: ../modules/bbpress.php:55
293
+ msgid "marked as sticky"
294
+ msgstr ""
295
+
296
+ #: ../modules/bbpress.php:56
297
+ msgid "marked as super sticky"
298
+ msgstr ""
299
+
300
+ #: ../modules/bbpress.php:57
301
+ msgid "unmarked as sticky"
302
+ msgstr ""
303
+
304
+ #: ../modules/bbpress.php:58
305
+ msgid "set to category type"
306
+ msgstr ""
307
+
308
+ #: ../modules/bbpress.php:59
309
+ msgid "set to forum type"
310
+ msgstr ""
311
+
312
+ #: ../modules/bbpress.php:60
313
+ msgid "set to public"
314
+ msgstr ""
315
+
316
+ #: ../modules/bbpress.php:61
317
+ msgid "set to private"
318
+ msgstr ""
319
+
320
+ #: ../modules/bbpress.php:62
321
+ msgid "set to hidden"
322
+ msgstr ""
323
+
324
+ #: ../modules/bbpress.php:63
325
+ #, php-format
326
+ msgid "in forum %s merged into %s"
327
+ msgstr ""
328
+
329
+ #: ../modules/bbpress.php:64
330
+ #, php-format
331
+ msgid "in forum %s split from reply %s by %s into %s in forum %s"
332
+ msgstr ""
333
+
334
+ #: ../modules/bbpress.php:131
335
+ msgid "Forum"
336
+ msgstr ""
337
+
338
+ #: ../modules/bbpress.php:141
339
+ msgid "Topic"
340
+ msgstr ""
341
+
342
+ #: ../modules/bbpress.php:150
343
+ msgid "Topic Tag"
344
+ msgstr ""
345
+
346
+ #: ../modules/bbpress.php:161
347
+ #, php-format
348
+ msgid "by %s"
349
+ msgstr ""
350
+
351
+ #: ../modules/bbpress.php:162
352
+ msgid "Reply"
353
+ msgstr ""
354
+
355
+ #: ../modules/bbpress.php:173
356
+ msgid "User"
357
+ msgstr ""
358
+
359
+ #: ../modules/bbpress.php:185
360
+ #, php-format
361
+ msgid "as child of %s"
362
+ msgstr ""
363
+
364
+ #: ../modules/bbpress.php:246 ../modules/bbpress.php:256
365
+ #, php-format
366
+ msgid "in forum %s"
367
+ msgstr ""
368
+
369
+ #: ../modules/bbpress.php:369
370
+ msgid "favorited"
371
+ msgstr ""
372
+
373
+ #: ../modules/bbpress.php:373
374
+ msgid "unfavorited"
375
+ msgstr ""
376
+
377
+ #: ../modules/bbpress.php:377
378
+ msgid "subscribed"
379
+ msgstr ""
380
+
381
+ #: ../modules/bbpress.php:381
382
+ msgid "unsubscribed"
383
+ msgstr ""
384
+
385
+ #: ../modules/bbpress.php:385
386
+ msgid "profile updated"
387
+ msgstr ""
388
+
389
+ #: ../modules/bbpress.php:389
390
+ msgid "registered"
391
+ msgstr ""
392
+
393
+ #: ../modules/bbpress.php:397
394
+ #, php-format
395
+ msgid "changed forum role to %s"
396
+ msgstr ""
simple-history-extender/modules/bbpress.php ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Simple History Extender BBPress Class
5
+ *
6
+ * Extend Simple History for BBPress events
7
+ * Version 2.2
8
+ *
9
+ * @since 0.0.2
10
+ *
11
+ * @package Simple History Extender
12
+ * @subpackage Modules
13
+ */
14
+
15
+ // Exit if accessed directly
16
+ if ( !defined( 'ABSPATH' ) ) exit;
17
+
18
+ if ( !class_exists( 'Simple_History_Extend_BBPress' ) ) :
19
+
20
+ /**
21
+ * Plugin class
22
+ */
23
+ class Simple_History_Extend_BBPress extends Simple_History_Extend {
24
+
25
+ function __construct(){
26
+ parent::__construct( array(
27
+ 'id' => 'bbpress',
28
+ 'title' => __('BBPress', 'sh-extender'),
29
+ 'plugin' => 'bbpress/bbpress.php',
30
+ 'tabs' => array(
31
+ 'supports' => array(
32
+ __('Creating, editing and deleting a forum, topic, reply.', 'sh-extender'),
33
+ __('Setting the type of a forum to category or forum.', 'sh-extender'),
34
+ __('Setting the status of a forum, topic to open or closed.', 'sh-extender'),
35
+ __('Setting the forum visibility to public, private or hidden.', 'sh-extender'),
36
+ __('Trashing and untrashing a forum, topic, reply.', 'sh-extender'),
37
+ __('Marking and unmarking a topic, reply as spam.', 'sh-extender'),
38
+ __('Marking and unmarking a topic as sticky.', 'sh-extender'),
39
+ __('Merging and splitting a topic.', 'sh-extender'),
40
+ __('Updating, merging and deleting a topic tag.', 'sh-extender'),
41
+ __('A user (un)favoriting and (un)subscribing to a topic.', 'sh-extender'),
42
+ __('A user saving his/her profile.', 'sh-extender')
43
+ )
44
+ )
45
+ )
46
+ );
47
+ }
48
+
49
+ function add_events(){
50
+
51
+ // Add custom bbPress events text
52
+ $events = array(
53
+ 'close' => __('closed', 'sh-extender'),
54
+ 'open' => __('opened', 'sh-extender'),
55
+ 'stick' => __('marked as sticky', 'sh-extender'),
56
+ 'super-stick' => __('marked as super sticky', 'sh-extender'),
57
+ 'unstick' => __('unmarked as sticky', 'sh-extender'),
58
+ 'categorize' => __('set to category type', 'sh-extender'),
59
+ 'normalize' => __('set to forum type', 'sh-extender'),
60
+ 'publicize' => __('set to public', 'sh-extender'),
61
+ 'privatize' => __('set to private', 'sh-extender'),
62
+ 'hide' => __('set to hidden', 'sh-extender'),
63
+ 'merge' => __('in forum %s merged into %s', 'sh-extender'),
64
+ 'split' => __('in forum %s split from reply %s by %s into %s in forum %s', 'sh-extender')
65
+ );
66
+
67
+ return $events;
68
+ }
69
+
70
+ function add_actions(){
71
+
72
+ // Forum
73
+ add_action( 'bbp_new_forum', array( $this, 'new_forum' ) ); // Covered by Simple History
74
+ add_action( 'bbp_edit_forum', array( $this, 'edit_forum' ) ); // ..
75
+ add_action( 'bbp_closed_forum', array( $this, 'closed_forum' ) );
76
+ add_action( 'bbp_opened_forum', array( $this, 'opened_forum' ) );
77
+ add_action( 'bbp_categorized_forum', array( $this, 'categorized_forum' ) );
78
+ add_action( 'bbp_normalized_forum', array( $this, 'normalized_forum' ) );
79
+ add_action( 'bbp_publicized_forum', array( $this, 'publicized_forum' ) );
80
+ add_action( 'bbp_privatized_forum', array( $this, 'privatized_forum' ) );
81
+ add_action( 'bbp_hid_forum', array( $this, 'hid_forum' ) );
82
+ add_action( 'bbp_deleted_forum', array( $this, 'deleted_forum' ) ); // ..
83
+ add_action( 'bbp_trashed_forum', array( $this, 'trashed_forum' ) ); // ..
84
+ add_action( 'bbp_untrashed_forum', array( $this, 'untrashed_forum' ) ); // ..
85
+
86
+ // Topic
87
+ add_action( 'bbp_new_topic', array( $this, 'new_topic' ), 10, 4 ); // Covered by Simple History
88
+ add_action( 'bbp_edit_topic', array( $this, 'edit_topic' ), 10, 5 ); // ..
89
+ add_action( 'bbp_merged_topic', array( $this, 'merged_topic' ), 10, 3 );
90
+ add_action( 'bbp_post_split_topic', array( $this, 'post_split_topic' ), 10, 3 );
91
+ add_action( 'bbp_closed_topic', array( $this, 'closed_topic' ) );
92
+ add_action( 'bbp_opened_topic', array( $this, 'opened_topic' ) );
93
+ add_action( 'bbp_spammed_topic', array( $this, 'spammed_topic' ) );
94
+ add_action( 'bbp_unspammed_topic', array( $this, 'unspammed_topic' ) );
95
+ add_action( 'bbp_sticked_topic', array( $this, 'sticked_topic' ), 10, 3 );
96
+ add_action( 'bbp_unsticked_topic', array( $this, 'unsticked_topic' ), 10, 2 );
97
+ add_action( 'bbp_deleted_topic', array( $this, 'deleted_topic' ) ); // ..
98
+ add_action( 'bbp_trashed_topic', array( $this, 'trashed_topic' ) ); // ..
99
+ add_action( 'bbp_untrashed_topic', array( $this, 'untrashed_topic' ) ); // ..
100
+
101
+ // Topic Tag
102
+ add_action( 'bbp_update_topic_tag', array( $this, 'update_topic_tag' ), 10, 4 );
103
+ add_action( 'bbp_merge_topic_tag', array( $this, 'merge_topic_tag' ), 10, 3 );
104
+ add_action( 'bbp_delete_topic_tag', array( $this, 'delete_topic_tag' ), 10, 2 );
105
+
106
+ // Reply
107
+ add_action( 'bbp_new_reply', array( $this, 'new_reply' ), 10, 5 ); // Covered by Simple History
108
+ add_action( 'bbp_edit_reply', array( $this, 'edit_reply' ), 10, 6 ); // ..
109
+ add_action( 'bbp_spammed_reply', array( $this, 'spammed_reply' ) );
110
+ add_action( 'bbp_unspammed_reply', array( $this, 'unspammed_reply' ) );
111
+ add_action( 'bbp_deleted_reply', array( $this, 'deleted_reply' ) ); // ..
112
+ add_action( 'bbp_trashed_reply', array( $this, 'trashed_reply' ) ); // ..
113
+ add_action( 'bbp_untrashed_reply', array( $this, 'untrashed_reply' ) ); // ..
114
+
115
+ // User
116
+ add_action( 'bbp_add_user_favorite', array( $this, 'add_user_favorite' ), 10, 2 );
117
+ add_action( 'bbp_remove_user_favorite', array( $this, 'remove_user_favorite' ), 10, 2 );
118
+ add_action( 'bbp_add_user_subscription', array( $this, 'add_user_subscription' ), 10, 2 );
119
+ add_action( 'bbp_remove_user_subscription', array( $this, 'remove_user_subscription' ), 10, 2 );
120
+ // add_action( 'bbp_profile_update', array( $this, 'profile_update' ), 10, 2 ); // Covered by Simple History
121
+ // add_action( 'bbp_user_register', array( $this, 'user_register' ) ); // ..
122
+ add_filter( 'bbp_set_user_role', array( $this, 'set_user_role' ), 10, 3 );
123
+
124
+ }
125
+
126
+ /** Helpers ******************************************************/
127
+
128
+ function extend_forum( $forum_id, $action ){
129
+ $this->extend( array(
130
+ 'action' => $action,
131
+ 'type' => __('Forum', 'bbpress'),
132
+ 'name' => bbp_get_forum_title( $forum_id ),
133
+ 'id' => $forum_id
134
+ ) );
135
+ }
136
+
137
+ // @todo Author can be anonymous
138
+ function extend_topic( $topic_id, $action, $user_id = null ){
139
+ $this->extend( array(
140
+ 'action' => $action,
141
+ 'type' => __('Topic', 'bbpress'),
142
+ 'name' => bbp_get_topic_title( $topic_id ),
143
+ 'id' => $topic_id
144
+ ) );
145
+ }
146
+
147
+ function extend_topic_tag( $tag_id, $action, $tag ){
148
+ $this->extend( array(
149
+ 'action' => $action,
150
+ 'type' => __('Topic Tag', 'bbpress'),
151
+ 'name' => bbp_get_topic_tag_name( $tag ),
152
+ 'id' => $tag_id
153
+ ) );
154
+ }
155
+
156
+ // @todo Author can be anonymous
157
+ function extend_reply( $reply_id, $action, $user_id ){
158
+ $user = get_userdata( $user_id );
159
+
160
+ $this->extend( array(
161
+ 'action' => sprintf( __('by %s', 'sh-extender'), $user->user_login ) .' '. $action,
162
+ 'type' => __('Reply', 'bbpress'),
163
+ 'name' => bbp_get_reply_title( $reply_id ),
164
+ 'id' => $reply_id
165
+ ) );
166
+ }
167
+
168
+ /** Forum ********************************************************/
169
+
170
+ public function new_forum( $forum_args ){
171
+ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
172
+ return;
173
+
174
+ $child = 0 != $forum_args['post_parent'] ? ' '. sprintf( __('as child of %s'), bbp_get_forum_title( $forum_args['post_parent'] ) ) : '';
175
+ $this->extend_forum( $forum_args['forum_id'], $this->events['new'] . $child );
176
+ }
177
+
178
+ public function edit_forum( $forum_args ){
179
+ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
180
+ return;
181
+
182
+ $this->extend_forum( $forum_args['forum_id'], $this->events['edit'] );
183
+ }
184
+
185
+ public function closed_forum( $forum_id ){
186
+ $this->extend_forum( $forum_id, $this->events['close'] );
187
+ }
188
+
189
+ public function opened_forum( $forum_id ){
190
+ $this->extend_forum( $forum_id, $this->events['open'] );
191
+ }
192
+
193
+ public function categorized_forum( $forum_id ){
194
+ $this->extend_forum( $forum_id, $this->events['categorize'] );
195
+ }
196
+
197
+ public function normalized_forum( $forum_id ){
198
+ $this->extend_forum( $forum_id, $this->events['normalize'] );
199
+ }
200
+
201
+ public function publicized_forum( $forum_id ){
202
+ if ( bbp_get_forum_visibility( $forum_id ) == 'public' )
203
+ $this->extend_forum( $forum_id, $this->events['publicize'] );
204
+ }
205
+
206
+ public function privatized_forum( $forum_id ){
207
+ if ( bbp_get_forum_visibility( $forum_id ) == 'private' )
208
+ $this->extend_forum( $forum_id, $this->events['privatize'] );
209
+ }
210
+
211
+ public function hid_forum( $forum_id ){
212
+ $this->extend_forum( $forum_id, $this->events['hide'] );
213
+ }
214
+
215
+ public function deleted_forum( $forum_id ){
216
+ $this->extend_forum( $forum_id, $this->events['delete'] );
217
+ }
218
+
219
+ public function trashed_forum( $forum_id ){
220
+ $this->extend_forum( $forum_id, $this->events['trash'] );
221
+ }
222
+
223
+ public function untrashed_forum( $forum_id ){
224
+ $this->extend_forum( $forum_id, $this->events['untrash'] );
225
+ }
226
+
227
+ /** Topic ********************************************************/
228
+
229
+ public function new_topic( $topic_id, $forum_id, $anonymous_data, $topic_author ){
230
+ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
231
+ return;
232
+
233
+ $this->extend_topic(
234
+ $topic_id,
235
+ $this->events['new'] .' '. sprintf( __('in forum %s', 'sh-extender'), bbp_get_forum_title( $forum_id ) )
236
+ );
237
+ }
238
+
239
+ public function edit_topic( $topic_id, $forum_id, $anonymous_data, $topic_author, $is_edit ){
240
+ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
241
+ return;
242
+
243
+ $this->extend_topic(
244
+ $topic_id,
245
+ $this->events['edit'] .' '. sprintf( __('in forum %s', 'sh-extender'), bbp_get_forum_title( $forum_id ) )
246
+ );
247
+ }
248
+
249
+ public function merged_topic( $destination_topic_id, $source_topic_id, $source_parent_id ){
250
+ $this->extend_topic(
251
+ $source_topic_id,
252
+ sprintf( $this->events['merge'], bbp_get_forum_title( $source_parent_id ), bbp_get_topic_title( $destination_topic_id ) )
253
+ );
254
+ }
255
+
256
+ public function post_split_topic( $from_reply_id, $source_topic_id, $destination_topic_id ){
257
+ $this->extend_topic(
258
+ $source_topic_id,
259
+ sprintf( $this->events['split'], bbp_get_reply_title( $from_reply_id ), bbp_get_topic_title( $destination_topic_id ) )
260
+ );
261
+ }
262
+
263
+ public function closed_topic( $topic_id ){
264
+ $this->extend_topic( $topic_id, $this->events['close'] );
265
+ }
266
+
267
+ public function opened_topic( $topic_id ){
268
+ $this->extend_topic( $topic_id, $this->events['open'] );
269
+ }
270
+
271
+ public function spammed_topic( $topic_id ){
272
+ $this->extend_topic( $topic_id, $this->events['spam'] );
273
+ }
274
+
275
+ public function unspammed_topic( $topic_id ){
276
+ $this->extend_topic( $topic_id, $this->events['unspam'] );
277
+ }
278
+
279
+ public function sticked_topic( $topic_id, $super, $success ){
280
+ if ( $success ){
281
+ if ( $super )
282
+ $this->extend_topic( $topic_id, $this->events['super-stick'] );
283
+ else
284
+ $this->extend_topic( $topic_id, $this->events['stick'] );
285
+ }
286
+ }
287
+
288
+ public function unsticked_topic( $topic_id, $success ){
289
+ if ( $success )
290
+ $this->extend_topic( $topic_id, $this->events['unstick'] );
291
+ }
292
+
293
+ public function deleted_topic( $topic_id ){
294
+ $this->extend_topic( $topic_id, $this->events['delete'] );
295
+ }
296
+
297
+ public function trashed_topic( $topic_id ){
298
+ $this->extend_topic( $topic_id, $this->events['trash'] );
299
+ }
300
+
301
+ public function untrashed_topic( $topic_id ){
302
+ $this->extend_topic( $topic_id, $this->events['untrash'] );
303
+ }
304
+
305
+ /** Topic Tags ***************************************************/
306
+
307
+ public function update_topic_tag( $tag_id, $tag, $name, $slug ){
308
+ $this->extend_topic_tag( $tag_id, $this->events['edit'], $tag );
309
+ }
310
+
311
+ public function merge_topic_tag( $tag_id, $to_tag, $tag ){
312
+ $this->extend_topic_tag( $tag_id, sprintf( $this->events['merge'], bbp_get_topic_tag_name( $to_tag ) ), $tag );
313
+ }
314
+
315
+ public function delete_topic_tag( $tag_id, $tag ){
316
+ $this->extend_topic_tag( $tag_id, $this->events['delete'], $tag );
317
+ }
318
+
319
+ /** Reply ********************************************************/
320
+
321
+ public function new_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author ){
322
+ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
323
+ return;
324
+
325
+ $this->extend_reply( $reply_id, $this->events['new'], $reply_author );
326
+ }
327
+
328
+ public function edit_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author, $is_edit ){
329
+ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
330
+ return;
331
+
332
+ $this->extend_reply( $reply_id, $this->events['edit'], $reply_author );
333
+ }
334
+
335
+ public function spammed_reply( $reply_id ){
336
+ $this->extend_reply( $reply_id, $this->events['spam'], $reply_author );
337
+ }
338
+
339
+ public function unspammed_reply( $reply_id ){
340
+ $this->extend_reply( $reply_id, $this->events['unspam'], $reply_author );
341
+ }
342
+
343
+ public function deleted_reply( $reply_id ){
344
+ $this->extend_reply( $reply_id, $this->events['delete'], $reply_author );
345
+ }
346
+
347
+ public function trashed_reply( $reply_id ){
348
+ $this->extend_reply( $reply_id, $this->events['trash'], $reply_author );
349
+ }
350
+
351
+ public function untrashed_reply( $reply_id ){
352
+ $this->extend_reply( $reply_id, $this->events['untrash'], $reply_author );
353
+ }
354
+
355
+ /** User *********************************************************/
356
+
357
+ public function add_user_favorite( $user_id, $topic_id ){
358
+ $this->extend_topic( $topic_id, __('favorited', 'sh-extender') );
359
+ }
360
+
361
+ public function remove_user_favorite( $user_id, $topic_id ){
362
+ $this->extend_topic( $topic_id, __('unfavorited', 'sh-extender') );
363
+ }
364
+
365
+ public function add_user_subscription( $user_id, $topic_id ){
366
+ $this->extend_topic( $topic_id, __('subscribed', 'sh-extender') );
367
+ }
368
+
369
+ public function remove_user_subscription( $user_id, $topic_id ){
370
+ $this->extend_topic( $topic_id, __('unsubscribed', 'sh-extender') );
371
+ }
372
+
373
+ public function profile_update( $user_id, $old_user_data ){
374
+ $this->extend_user( $user_id, __('profile updated', 'sh-extender') );
375
+ }
376
+
377
+ public function user_register( $user_id ){
378
+ $this->extend_user( $user_id, __('registered', 'sh-extender') );
379
+ }
380
+
381
+ /**
382
+ * @todo Removing ones role does somehow not trigger bbp_set_user_role action
383
+ * while it actually has to.
384
+ */
385
+ public function set_user_role( $new_role, $user_id, $user ){
386
+
387
+ // Only log if a new role was actually assigned
388
+ if ( false !== $new_role ){
389
+ $bbp_roles = bbp_get_dynamic_roles();
390
+ $this->extend_user( $user_id, sprintf( __('changed forum role to %s', 'sh-extender'), !empty( $new_role ) ? translate_user_role( $bbp_roles[$new_role]['name'] ) : __('none') ) );
391
+ }
392
+
393
+ return $new_role;
394
+ }
395
+
396
+ }
397
+
398
+ new Simple_History_Extend_BBPress();
399
+
400
+ endif; // class_exists
simple-history-extender/modules/gravityforms.php ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Simple History Extender Gravity Forms Class
5
+ *
6
+ * Extend Simple History for Gravity Forms events
7
+ * Version 1.6.9
8
+ *
9
+ * @since 0.0.1
10
+ *
11
+ * @package Simple History Extender
12
+ * @subpackage Modules
13
+ */
14
+
15
+ // Exit if accessed directly
16
+ if ( !defined( 'ABSPATH' ) ) exit;
17
+
18
+ if ( !class_exists( 'Simple_History_Extend_GravityForms' ) ) :
19
+
20
+ /**
21
+ * Plugin class
22
+ */
23
+ class Simple_History_Extend_GravityForms extends Simple_History_Extend {
24
+
25
+ function __construct(){
26
+ parent::__construct( array(
27
+ 'id' => 'gravityforms',
28
+ 'title' => __('Gravity Forms', 'sh-extender'),
29
+ 'plugin' => 'gravityforms/gravityforms.php',
30
+ 'tabs' => array(
31
+ 'supports' => array(
32
+ __('Creating, editing and deleting a form.', 'sh-extender'),
33
+ __('Deleting a field from an existing form.', 'sh-extender'),
34
+ __('Submitting, editing and deleting an entry.', 'sh-extender'),
35
+ __('Changing the status of an entry, including read/unread and star/unstar.', 'sh-extender')
36
+ ),
37
+ 'lacks' => array(
38
+ __('Duplicating a form.', 'sh-extender'),
39
+ __('Setting a form to active/inactive.', 'sh-extender')
40
+ )
41
+ )
42
+ )
43
+ );
44
+ }
45
+
46
+ function add_events(){
47
+ $events = array(
48
+ 'star' => __('starred', 'sh-extender'),
49
+ 'unstar' => __('unstarred', 'sh-extender'),
50
+ 'read' => __('marked as read', 'sh-extender'),
51
+ 'unread' => __('marked as unread', 'sh-extender'),
52
+ );
53
+
54
+ return $events;
55
+ }
56
+
57
+ function add_actions(){
58
+
59
+ // Form & Fields create/update/delete
60
+ add_action( 'gform_after_save_form', array( $this, 'after_save_form' ), 10, 2 );
61
+ add_action( 'gform_before_delete_form', array( $this, 'before_delete_form' ), 10, 1 );
62
+ add_action( 'gform_before_delete_field', array( $this, 'before_delete_field' ), 10, 2 );
63
+
64
+ /**
65
+ * NOTE: Setting form active/inactive not loggable without
66
+ * proper hook at RGFormsModel::update_form_active()
67
+ */
68
+
69
+ // Entries create/update/delete
70
+ add_action( 'gform_after_submission', array( $this, 'after_submission' ), 10, 2 );
71
+ add_action( 'gform_after_update_entry', array( $this, 'after_update_entry' ), 10, 2 );
72
+ add_action( 'gform_delete_lead', array( $this, 'delete_entry' ), 10, 1 );
73
+ add_action( 'gform_update_status', array( $this, 'update_status' ), 10, 3 );
74
+ add_action( 'gform_update_is_starred', array( $this, 'update_is_starred' ), 10, 3 );
75
+ add_action( 'gform_update_is_read', array( $this, 'update_is_read' ), 10, 3 );
76
+ }
77
+
78
+ /** Helpers ******************************************************/
79
+
80
+ function get_form( $id ){
81
+ return RGFormsModel::get_form_meta( $id );
82
+ }
83
+
84
+ function get_entry( $id ){
85
+ return RGFormsModel::get_lead( $id );
86
+ }
87
+
88
+ function get_field( $form_id, $id ){
89
+ $form = $this->get_form( $form_id );
90
+ return RGFormsModel::get_field( $form, $id );
91
+ }
92
+
93
+ function form_title( $form_id ){
94
+ $form = $this->get_form( $form_id );
95
+ return $form['title'];
96
+ }
97
+
98
+ function entry_form_title( $entry_id ){
99
+ $entry = $this->get_entry( $entry_id );
100
+ $form = $this->get_form( $entry['form_id'] );
101
+ return $form['title'];
102
+ }
103
+
104
+ function created_by( $entry_id, $trailing_space = true ){
105
+ $entry = $this->get_entry( $entry_id );
106
+ $user_id = $entry['created_by'];
107
+
108
+ if ( !is_null( $user_id ) ){
109
+ $user = get_userdata( $user_id );
110
+ $from = sprintf( __('from %s', 'sh-extender'), $user->user_login );
111
+ } else
112
+ $from = __('from unknown', 'sh-extender');
113
+
114
+ return $from . ( $trailing_space ? ' ' : '' );
115
+ }
116
+
117
+ function extend_form( $form_id, $action ){
118
+ $this->extend( array(
119
+ 'action' => $action,
120
+ 'type' => __('Form', 'sh-extender'),
121
+ 'name' => $this->form_title( $form_id ),
122
+ 'id' => $form_id
123
+ ) );
124
+ }
125
+
126
+ function extend_entry( $entry_id, $action, $created_by = true ){
127
+ $this->extend( array(
128
+ 'action' => $created_by ? $this->created_by( $entry_id ) . $action : $action,
129
+ 'type' => __('Form entry', 'sh-extender'),
130
+ 'name' => $this->entry_form_title( $entry_id ),
131
+ 'id' => $entry_id
132
+ ) );
133
+ }
134
+
135
+ /** Form & Fields create/update/delete ***************************/
136
+
137
+ /**
138
+ * @todo Get it working for creating form duplicate
139
+ */
140
+ function after_save_form( $form, $is_new ){
141
+ $this->extend_form( $form['id'], $is_new ? $this->events['new'] : $this->events['edit'] );
142
+ }
143
+
144
+ function before_delete_form( $form_id ){
145
+ $entries = RGFormsModel::get_lead_count( $form_id, '' );
146
+
147
+ $this->extend_form(
148
+ $form_id,
149
+ 0 == $entries
150
+ ? __('without entries deleted', 'sh-extender')
151
+ : sprintf( __('with %d entries deleted', 'sh-extender'), $entries )
152
+ );
153
+ }
154
+
155
+ function before_delete_field( $form_id, $field_id ){
156
+ $field = $this->get_field( $form_id, $field_id );
157
+
158
+ $this->extend_form(
159
+ $form_id,
160
+ sprintf( __('field %s deleted', 'sh-extender'), $field['label'] .' (ID: '. $field_id .')' )
161
+ );
162
+ }
163
+
164
+ /** Entries create/update/delete *********************************/
165
+
166
+ function after_submission( $entry, $form ){
167
+ $this->extend_entry( $entry['id'], $this->events['submit'], false );
168
+ }
169
+
170
+ function after_update_entry( $form, $entry_id ){
171
+ $this->extend_entry( $entry_id, $this->events['edit'] );
172
+ }
173
+
174
+ function delete_entry( $entry_id ){
175
+ $this->extend_entry( $entry_id, $this->events['delete'] );
176
+ }
177
+
178
+ function update_status( $entry_id, $new_value, $old_value ){
179
+ if ( $old_value !== $new_value ){
180
+
181
+ switch ( $new_value ){
182
+ case 'spam':
183
+ $action = $this->events['spam'];
184
+ break;
185
+
186
+ case 'trash':
187
+ $action = $this->events['trash'];
188
+ break;
189
+
190
+ case 'active':
191
+ switch ( $old_value ){
192
+ case 'trash' :
193
+ $action = $this->events['untrash'];
194
+ break;
195
+
196
+ case 'spam' :
197
+ $action = $this->events['unspam'];
198
+ break;
199
+
200
+ default :
201
+ $action = __('restored', 'sh-extender');
202
+ }
203
+ break;
204
+
205
+ default:
206
+ $action = __('changed status', 'sh-extender');
207
+ }
208
+
209
+ $this->extend_entry( $entry_id, $action );
210
+ }
211
+ }
212
+
213
+ function update_is_starred( $entry_id, $new_value, $old_value ){
214
+ $this->extend_entry( $entry_id, 1 == $new_value ? $this->events['star'] : $this->events['unstar'] );
215
+ }
216
+
217
+ function update_is_read( $entry_id, $new_value, $old_value ){
218
+ $this->extend_entry( $entry_id, 1 == $new_value ? $this->events['read'] : $this->events['unread'] );
219
+ }
220
+
221
+ }
222
+
223
+ new Simple_History_Extend_GravityForms();
224
+
225
+ endif; // class_exists
simple-history-extender/modules/widgets.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Simple History Extender Widgets Class
5
+ *
6
+ * @since 0.0.1
7
+ *
8
+ * @package Simple History Extender
9
+ * @subpackage Modules
10
+ */
11
+
12
+ // Exit if accessed directly
13
+ if ( !defined( 'ABSPATH' ) ) exit;
14
+
15
+ if ( !class_exists( 'Simple_History_Extend_Widgets' ) ) :
16
+
17
+ /**
18
+ * Plugin class
19
+ */
20
+ class Simple_History_Extend_Widgets extends Simple_History_Extend {
21
+
22
+ function __construct(){
23
+ parent::__construct( array(
24
+ 'id' => 'widgets',
25
+ 'title' => __('Widgets', 'sh-extender'),
26
+ 'plugin' => false,
27
+ 'description' => __('Log events for the Widgets section of your WP install.', 'sh-extender'),
28
+ 'tabs' => array(
29
+ 'supports' => array(
30
+ __('Adding, updating and deleting widgets in/from a sidebar.', 'sh-extender'),
31
+ ),
32
+ 'lacks' => array(
33
+ __('Moving widgets between sidebars.', 'sh-extender'),
34
+ __('Setting a widget to active/inactive.', 'sh-extender')
35
+ )
36
+ )
37
+ )
38
+ );
39
+ }
40
+
41
+ function add_actions(){
42
+
43
+ // Widget create/update/remove
44
+ add_action( 'sidebar_admin_setup', array( $this, 'widgets_setup' ), 10 );
45
+
46
+ /**
47
+ * NOTE: Need to find hook for activate/deactivate widgets
48
+ */
49
+ }
50
+
51
+ /** Widgets ******************************************************/
52
+
53
+ /**
54
+ * Log event where widget is added, updated or removed in/from sidebar
55
+ *
56
+ * @return void
57
+ */
58
+ public function widgets_setup(){
59
+ global $wp_registered_widgets, $wp_registered_sidebars;
60
+
61
+ // We need all these variables
62
+ if ( !isset( $_POST['id_base'] ) && !isset( $_POST['widget-id'] ) && !isset( $_POST['sidebar'] ) )
63
+ return;
64
+
65
+ /**
66
+ * Get the number of the main widget reference in the widget list.
67
+ * It's allways one smaller (-1) than our current new widget instance.
68
+ */
69
+ $number = absint( substr( $_POST['widget-id'], strlen( $_POST['id_base'] ) + 1 ) ) - 1;
70
+ $title = false;
71
+
72
+ // Find the widget name from the list of available widgets
73
+ foreach ( $wp_registered_widgets as $widget ){
74
+ if ( $_POST['id_base'] .'-'. $number == $widget['id'] ){
75
+ $title = esc_html( strip_tags( $widget['name'] ) );
76
+ break;
77
+ }
78
+ }
79
+
80
+ // Fetch widget name from previous save
81
+ if ( !$title )
82
+ $title = esc_html( strip_tags( $wp_registered_widgets[$_POST['widget-id']]['name'] ) );
83
+
84
+ // Define the action
85
+ if ( isset( $_POST['delete_widget'] ) )
86
+ $action = __('removed from sidebar %s', 'sh-extender');
87
+ elseif ( isset( $wp_registered_widgets[$_POST['widget-id']] ) )
88
+ $action = __('updated in sidebar %s', 'sh-extender');
89
+ else
90
+ $action = __('added to sidebar %s', 'sh-extender');
91
+
92
+ // Extend SH
93
+ $this->extend( array(
94
+ 'action' => sprintf( $action, $wp_registered_sidebars[$_POST['sidebar']]['name'] ),
95
+ 'type' => __('Widget'),
96
+ 'name' => $title,
97
+ 'id' => $_POST['widget-id']
98
+ ) );
99
+ }
100
+ }
101
+
102
+ new Simple_History_Extend_Widgets();
103
+
104
+ endif; // class_exists
simple-history-extender/simple-history-extender.php ADDED
@@ -0,0 +1,303 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Plugin Name: Simple History Extender
5
+ * Description: Extend the Simple History plugin with more events to log.
6
+ * Version: 0.0.3
7
+ * Author: Laurens Offereins
8
+ * Author URI: http://www.offereinspictures.nl
9
+ */
10
+
11
+ // Exit if accessed directly
12
+ if ( !defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( !class_exists( 'SimpleHistoryExtender' ) ) :
15
+
16
+ /**
17
+ * Plugin class
18
+ */
19
+ class SimpleHistoryExtender {
20
+
21
+ public $file;
22
+ public $basename;
23
+ public $sh_plugin;
24
+ public $domain;
25
+ public $page;
26
+ public $sh_pagenow;
27
+ public $opt_group;
28
+ public $plugin_dir;
29
+
30
+ public $modules_dir;
31
+ public $modules_name;
32
+ public $modules_section;
33
+ public $modules;
34
+
35
+ /**
36
+ * Build this class
37
+ */
38
+ public function __construct(){
39
+ $this->setup_globals();
40
+ $this->setup_actions();
41
+ }
42
+
43
+ /**
44
+ * Define local class variables
45
+ *
46
+ * @return void
47
+ */
48
+ public function setup_globals(){
49
+ $this->file = __FILE__;
50
+ $this->basename = plugin_basename( $this->file );
51
+ $this->sh_plugin = 'simple-history/index.php';
52
+ $this->domain = 'sh-extender';
53
+ $this->page = 'simple_history_settings_menu_slug';
54
+ $this->sh_pagenow = 'settings_page_'. $this->page;
55
+ $this->opt_group = 'simple_history_settings_group';
56
+ $this->plugin_dir = plugin_dir_path( $this->file );
57
+
58
+ $this->modules_dir = $this->plugin_dir .'modules/';
59
+ $this->modules_name = 'sh_extender_modules';
60
+ $this->modules_section = 'sh-extender-modules';
61
+ $this->modules = get_option( $this->modules_name );
62
+ }
63
+
64
+ /**
65
+ * Register action and filter hooks
66
+ *
67
+ * @return void
68
+ */
69
+ public function setup_actions(){
70
+
71
+ // Plugin
72
+ add_action( 'activate_'. $this->basename, array( $this, 'on_activate' ) );
73
+ add_action( 'deactivate_'. $this->basename, array( $this, 'on_deactivate' ) );
74
+ add_action( 'uninstall_'. $this->basename, array( $this, 'on_uninstall' ) );
75
+ add_action( 'plugins_loaded', array( $this, 'textdomain' ) );
76
+ add_filter( 'plugin_action_links', array( $this, 'action_links' ), 10, 2 );
77
+ add_action( 'deactivate_'. $this->sh_plugin, array( $this, 'on_deactivate_sh' ) );
78
+
79
+ // Admin
80
+ add_action( 'init', array( $this, 'load_modules' ) );
81
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
82
+ add_action( 'load-'. $this->sh_pagenow, array( $this, 'add_help_tabs' ) );
83
+ }
84
+
85
+ /** Plugin *******************************************************/
86
+
87
+ /**
88
+ * Act on plugin activation
89
+ *
90
+ * @return void
91
+ */
92
+ public function on_activate(){
93
+
94
+ // Cancel activation if Simple History is not active
95
+ if ( !is_plugin_active( $this->sh_plugin ) ){
96
+ $this->deactivate_plugin( true );
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Act on plugin deactivation
102
+ *
103
+ * @return void
104
+ */
105
+ public function on_deactivate(){
106
+ // Do stuff
107
+ }
108
+
109
+ /**
110
+ * Act on plugin uninstallation
111
+ *
112
+ * @return void
113
+ */
114
+ public function on_uninstall(){
115
+
116
+ // Remove option from DB
117
+ delete_option( $this->modules_name );
118
+ }
119
+
120
+ /**
121
+ * Load the translation files
122
+ *
123
+ * @return void
124
+ */
125
+ public function textdomain(){
126
+ load_plugin_textdomain( $this->domain, false, dirname( $this->basename ) . '/languages/' );
127
+ }
128
+
129
+ /**
130
+ * Add plugin action links to the plugin row actions
131
+ *
132
+ * @param array $links The current plugin row actions
133
+ * @param string $file The plugin file basename
134
+ */
135
+ public function action_links( $links, $file ) {
136
+
137
+ // Create settings link for this plugin only
138
+ if ( $this->basename == $file )
139
+ $links[] = '<a href="' . add_query_arg( 'page', $this->page, 'options-general.php' ) . '">'. __('Settings') .'</a>';
140
+
141
+ return $links;
142
+ }
143
+
144
+ /**
145
+ * Deactivate this plugin and maybe display error message
146
+ *
147
+ * @param boolean $die Whether this function should execute wp_die()
148
+ * @param integer $message The message ID of the message to display
149
+ * @uses deactivate_plugins()
150
+ * @return void
151
+ */
152
+ public function deactivate_plugin( $die = false, $message = 0 ){
153
+
154
+ // Deactivate this plugin
155
+ deactivate_plugins( $this->basename );
156
+
157
+ // Redirect user and present die message
158
+ if ( $die ){
159
+
160
+ // Default messages
161
+ $messages = array(
162
+ 0 => __('The Simple History Extender plugin was deactivated because the Simple History plugin was not found installed or active.', 'sh-extender'),
163
+ 1 => __('The Simple History Extender plugin was deactivated.', 'sh-extender')
164
+ );
165
+
166
+ wp_die( sprintf(
167
+ '<p>'. $messages[$message] .'</p><p><a href="%s">'. __('Return') .'</a></p>',
168
+ // Remove previous messages
169
+ remove_query_arg( array( 'activate', 'deactivate', 'error' ), wp_get_referer() )
170
+ ) );
171
+ exit;
172
+ }
173
+ }
174
+
175
+ /**
176
+ * Do plugin deactivation on Simple History deactivation
177
+ *
178
+ * Deactivates this plugin silently without feedback
179
+ *
180
+ * @link http://wordpress.stackexchange.com/questions/27850/deactivate-plugin-upon-deactivation-of-another-plugin/56924#56924
181
+ */
182
+ public function on_deactivate_sh(){
183
+ if ( is_plugin_active( $this->basename ) )
184
+ add_action( 'update_option_active_plugins', array( $this, 'deactivate_plugin' ) );
185
+ }
186
+
187
+ /** Admin ********************************************************/
188
+
189
+ /**
190
+ * Load the module files
191
+ *
192
+ * Require files later then 'plugins_loaded' action for
193
+ * the module translation strings to be processed.
194
+ *
195
+ * @uses do_action() To call 'she_load_modules' for custom modules
196
+ *
197
+ * @return void
198
+ */
199
+ public function load_modules(){
200
+
201
+ // Make is_plugin_active() available
202
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
203
+
204
+ // Load Extend class which the modules depend upon
205
+ require( $this->plugin_dir . 'class.simple-history-extend.php' );
206
+
207
+ // Load modules from directory
208
+ foreach ( scandir( $this->modules_dir ) as $file ){
209
+ if ( 'php' == pathinfo( $file, PATHINFO_EXTENSION ) && file_exists( $this->modules_dir . $file ) )
210
+ require( $this->modules_dir . $file );
211
+ }
212
+
213
+ // Hook for loading custom modules
214
+ do_action( 'she_load_modules' );
215
+ }
216
+
217
+ /**
218
+ * Add module settings to the Simple History admin page
219
+ *
220
+ * Creates an extra settings section for our modules and registers
221
+ * all modules in one option in the DB.
222
+ *
223
+ * @return void
224
+ */
225
+ public function register_settings(){
226
+ add_settings_section( $this->modules_section, __('Simple History Extender Modules', 'sh-extender'), array( $this, 'modules_settings_intro' ), $this->page );
227
+ register_setting( $this->opt_group, $this->modules_name, array( $this, 'modules_settings_sanitize' ) );
228
+ }
229
+
230
+ /**
231
+ * Output settings section information text
232
+ *
233
+ * @return void
234
+ */
235
+ public function modules_settings_intro(){
236
+ echo '<p>'. __( 'Activate or deactivate the events you want to log. Read the Help tab if you want to know which actions are supported and which aren\'t.', 'sh-extender') .'</p>';
237
+ }
238
+
239
+ /**
240
+ * Sanitize input values before saving settings to DB
241
+ *
242
+ * Additionally logs which modules are (de)activated.
243
+ *
244
+ * @param array $input The input values
245
+ * @return array $retval The sanitized values
246
+ */
247
+ public function modules_settings_sanitize( $input ){
248
+ global $wp_settings_fields;
249
+
250
+ $old = get_option( $this->modules_name, array() );
251
+ $retval = array();
252
+
253
+ // Sanitize input
254
+ if ( ! is_array($input) ) $input = array();
255
+ foreach ( $input as $module => $args )
256
+ $retval[$module]['active'] = isset( $args['active'] ) ? true : false;
257
+
258
+ // Log module (de)activation
259
+ foreach ( $wp_settings_fields[$this->page][$this->modules_section] as $id => $field ){
260
+
261
+ // Strip module name from {settings_field_name[module_name]}
262
+ $module = substr( $id, strpos( $id, '[' ) + 1, -1 );
263
+
264
+ // Make sure not set modules are set to false
265
+ if ( !isset( $retval[$module] ) )
266
+ $retval[$module]['active'] = false;
267
+
268
+ // Only log on change
269
+ if ( ( !isset( $old[$module] ) && $retval[$module]['active'] )
270
+ || ( isset( $old[$module] ) && $old[$module]['active'] !== $retval[$module]['active'] )
271
+ ){
272
+
273
+ Simple_History_Extend::extend( array(
274
+ 'action' => $retval[$module]['active'] ? __('activated', 'sh-extender') : __('deactivated', 'sh-extender'),
275
+ 'type' => __('Simple History Extender Module', 'sh-extender'),
276
+ 'name' => $field['title'],
277
+ 'id' => $module
278
+ ) );
279
+ }
280
+ }
281
+
282
+ return $retval;
283
+ }
284
+
285
+ /**
286
+ * Add module help tabs to the admin page contextual help
287
+ *
288
+ * @uses apply_filters() To call sh_extender_add_help_tabs where
289
+ * modules can add their unique help tab
290
+ * @uses WP_Screen::add_help_tab()
291
+ */
292
+ public function add_help_tabs(){
293
+ $tabs = apply_filters( 'sh_extender_add_help_tabs', array() );
294
+
295
+ // Loop over all tabs and add them to the screen
296
+ foreach ( $tabs as $tab )
297
+ get_current_screen()->add_help_tab( $tab );
298
+ }
299
+ }
300
+
301
+ $GLOBALS['simple_history_extender'] = new SimpleHistoryExtender();
302
+
303
+ endif; // class_exists
styles.css CHANGED
@@ -183,6 +183,12 @@ ul.simple-history-occasions li {
183
  right: 0;
184
  bottom: -3px;
185
  }
 
 
 
 
 
 
186
  .simple-history-rss-feed-page span {
187
  float: left;
188
  }
@@ -203,3 +209,8 @@ ul.simple-history-occasions li {
203
  .simple-history-tablenav .tablenav-pages {
204
  float: none;
205
  }
 
 
 
 
 
183
  right: 0;
184
  bottom: -3px;
185
  }
186
+
187
+ .rtl .simple-history-rss-feed-page {
188
+ right: auto;
189
+ left: 0;
190
+ }
191
+
192
  .simple-history-rss-feed-page span {
193
  float: left;
194
  }
209
  .simple-history-tablenav .tablenav-pages {
210
  float: none;
211
  }
212
+
213
+ .simple-history-tablenav .displaying-num {
214
+ display: inline-block;
215
+ }
216
+