|
@@ -4,15 +4,20 @@
|
|
|
Plugin URI: https://git.tum.dk/tum.dk/dagsplug/
|
|
|
Description: Tools
|
|
|
Author: iskedk
|
|
|
- Version: 0.0.27
|
|
|
- Date: Fri Jan 31 2014 13:19:21 GMT+0100 (CET)
|
|
|
+ Version: 0.0.28
|
|
|
+ Date: 2021-01-14
|
|
|
Author URI: https://iske.dk/
|
|
|
Text Domain: dagsopt
|
|
|
*/
|
|
|
|
|
|
+function wppluginspage() {
|
|
|
+ include_once("wpplugins.php");
|
|
|
+}
|
|
|
+
|
|
|
$wp_dagsopt = new dagsopt ( );
|
|
|
+
|
|
|
class dagsopt {
|
|
|
- var $version = "0.0.27";
|
|
|
+ var $version = "0.0.28";
|
|
|
var $publish_date = "2021-01-14";
|
|
|
var $pluginname;
|
|
|
var $plugintitle;
|
|
@@ -56,6 +61,12 @@ class dagsopt {
|
|
|
|
|
|
add_action( 'admin_enqueue_scripts', array(&$this, 'print_backend_scripts_styles' ));
|
|
|
|
|
|
+ $upload = wp_upload_dir();
|
|
|
+ $upload_dir = $upload['basedir'];
|
|
|
+ $upload_dir = $upload_dir . '/assets';
|
|
|
+ if (! is_dir($upload_dir)) {
|
|
|
+ mkdir( $upload_dir, 0700 );
|
|
|
+ }
|
|
|
|
|
|
$path = dirname($this->file)."/";
|
|
|
foreach (glob($path."plug_*.php") as $filename) {
|
|
@@ -74,11 +85,12 @@ class dagsopt {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+ if(!function_exists('wp_get_current_user')) {
|
|
|
+ include(ABSPATH . "wp-includes/pluggable.php");
|
|
|
+ }
|
|
|
|
|
|
if ( current_user_can( 'manage_options' ) ) {
|
|
|
- add_action( 'wp_before_admin_bar_render', array(&$this, 'mytheme_admin_bar_render' ) );
|
|
|
-
|
|
|
+ add_action( 'wp_before_admin_bar_render', array(&$this, 'mytheme_admin_bar_render' ) );
|
|
|
}
|
|
|
|
|
|
|
|
@@ -89,7 +101,7 @@ class dagsopt {
|
|
|
|
|
|
function process_post() {
|
|
|
if (!is_admin()) {
|
|
|
- echo "<!-- kommer aller aller først -->";
|
|
|
+ // echo "<!-- kommer aller aller først -->";
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -143,8 +155,8 @@ class dagsopt {
|
|
|
|
|
|
|
|
|
function plugin_admin_menu() {
|
|
|
- if(function_exists("wppluginspage")){
|
|
|
- add_menu_page('WP Plugins Page', 'WP Plugins', 'manage_options', 'wpplugins', wppluginspage,"");
|
|
|
+ if(function_exists('wppluginspage')){
|
|
|
+ add_menu_page('WP Plugins Page', 'WP Plugins', 'manage_options', 'wpplugins', "wppluginspage","");
|
|
|
}
|
|
|
$page = add_submenu_page ( 'wpplugins', __ ( $this->plugintitle ), __ ( $this->plugintitle ), 'manage_options', $this->pluginname.'-options', array ( &$this,'Option' ) );
|
|
|
add_action( 'admin_print_styles-' . $page, array(&$this,'print_backend_scripts_styles') );
|
|
@@ -174,12 +186,9 @@ class dagsopt {
|
|
|
}
|
|
|
|
|
|
function Option() {
|
|
|
- if(isset($_FILES)){
|
|
|
- print_r($_FILES);
|
|
|
- echo("OOOOOK");
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
if (isset ( $_POST [ 'Submit' ] )) {
|
|
|
+
|
|
|
if (function_exists ( 'current_user_can' ) && ! current_user_can ( 'manage_options' )) {
|
|
|
die ( __ ( 'Cheatin’ uh?' ) );
|
|
|
}
|
|
@@ -194,6 +203,7 @@ class dagsopt {
|
|
|
$this->setCron();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
update_option ( $this->pluginname.'_last_build', date("U") );
|
|
|
|
|
|
foreach($this->dagsopt as $plugname => $plug){
|
|
@@ -207,6 +217,8 @@ class dagsopt {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ $pluginmessage ="";
|
|
|
+
|
|
|
ob_end_clean ();
|
|
|
wp_redirect ( 'admin.php?page='.$this->pluginname.'-options&msg=' . urlencode ( $pluginmessage ) );
|
|
|
exit ();
|
|
@@ -221,6 +233,9 @@ class dagsopt {
|
|
|
}
|
|
|
|
|
|
function activatePlugin() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
$this->check_wp_config();
|
|
|
}
|
|
|
function deactivatePlugin() {
|
|
@@ -244,9 +259,7 @@ class dagsopt {
|
|
|
|
|
|
|
|
|
}
|
|
|
-function wppluginspage() {
|
|
|
- include_once("wpplugins.php");
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
|
|
|
|