Jannick Knudsen 4 ani în urmă
părinte
comite
d31c832c54
21 a modificat fișierele cu 1283 adăugiri și 0 ștergeri
  1. 1 0
      README.md
  2. 1 0
      VERSION
  3. 1 0
      VERSIONLOG
  4. BIN
      asc.gif
  5. BIN
      bg.gif
  6. BIN
      desc.gif
  7. 7 0
      editor-styles.css
  8. 4 0
      index.php
  9. BIN
      lang/da_DK.mo
  10. 312 0
      lang/da_DK.po
  11. BIN
      login_logo.png
  12. BIN
      logo.png
  13. 15 0
      package.json
  14. 107 0
      plug_update_plugin.php
  15. 303 0
      plugin.php
  16. 172 0
      pluginoptions.php
  17. 77 0
      script_backend.js
  18. 32 0
      script_frontend.js
  19. 211 0
      source.svg
  20. 16 0
      style_backend.css
  21. 24 0
      style_frontend.css

+ 1 - 0
README.md

@@ -0,0 +1 @@
+##csvtousers

+ 1 - 0
VERSION

@@ -0,0 +1 @@
+v0.0.0

+ 1 - 0
VERSIONLOG

@@ -0,0 +1 @@
+v0.0.0



BIN
desc.gif


+ 7 - 0
editor-styles.css

@@ -0,0 +1,7 @@
+
+
+body {
+
+
+
+}

+ 4 - 0
index.php

@@ -0,0 +1,4 @@
+<?php 
+if ( !defined('ABSPATH') )
+	die("I'm sorry, Dave. I'm afraid I can't do that.");
+?>

BIN
lang/da_DK.mo


+ 312 - 0
lang/da_DK.po

@@ -0,0 +1,312 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: csvtousers\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-04-26 15:47+0200\n"
+"PO-Revision-Date: 2020-04-26 15:53+0200\n"
+"Last-Translator: \n"
+"Language-Team: jjk@bloggen.dk\n"
+"Language: da_DK\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Poedit-SourceCharset: utf-8\n"
+"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
+"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
+"X-Poedit-Basepath: /home/jb/repos/csvtousers\n"
+"X-Textdomain-Support: yes\n"
+"X-Generator: Poedit 1.8.7.1\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: plug_admin_bar.php:6 plug_body.php:6
+msgid "Admin bar"
+msgstr "Administrations Bar"
+
+#: plug_admin_bar.php:79
+msgid "Dags dk"
+msgstr ""
+
+#: plug_admin_bar.php:121
+msgid "Server switcher : local > stage > live"
+msgstr "Server skifter : local > stage > live"
+
+#: plug_admin_bar.php:122
+msgid "Swap WP for dags logo"
+msgstr "Skift wp logo ud"
+
+#: plug_admin_bar.php:123
+msgid "Show server ip"
+msgstr "Vis server ip"
+
+#: plug_admin_bar.php:174
+msgid "Server switcher"
+msgstr "Server skifter"
+
+#: plug_admin_bar.php:192
+msgid "Dags logo"
+msgstr "Logo"
+
+#: plug_admin_bar.php:195
+msgid "Show IP"
+msgstr "Vis IP"
+
+#: plug_admin_bar.php:205
+msgid "Comments"
+msgstr "Kommentare"
+
+#: plug_admin_bar.php:206
+msgid "New Post"
+msgstr "Nyt indlæg"
+
+#: plug_admin_bar.php:207
+msgid "New Link"
+msgstr "Nyt link"
+
+#: plug_admin_bar.php:208
+msgid "New Media"
+msgstr "Nyt medie"
+
+#: plug_admin_bar.php:209
+msgid "New Page"
+msgstr "Ny side"
+
+#: plug_admin_bar.php:210
+msgid "New User"
+msgstr "Ny bruger"
+
+#: plug_color_admin_posts.php:14
+msgid "Color admin posts"
+msgstr "Post administration i farver"
+
+#: plug_color_admin_posts.php:75
+msgid "Drafts Posts"
+msgstr "Kladde Poster"
+
+#: plug_color_admin_posts.php:80
+msgid "Pendings Posts"
+msgstr "Ventende Poster"
+
+#: plug_color_admin_posts.php:84
+msgid "Published Posts"
+msgstr "Publiserede Poster"
+
+#: plug_color_admin_posts.php:88
+msgid "Futures Posts"
+msgstr "Fremtidige Poster"
+
+#: plug_color_admin_posts.php:92
+msgid "Privates Posts"
+msgstr "Private Poster"
+
+#: plug_color_admin_posts.php:131
+msgid "Leave \"#\" for the default color."
+msgstr "Brug \"#\" for standard farve."
+
+#: plug_color_admin_posts.php:142
+msgid "Color Admin Posts"
+msgstr "Post administration i farver"
+
+#: plug_color_admin_posts.php:147
+msgid "You do not have sufficient permissions to access this page."
+msgstr "Du har ikke rettigheder nok til at se denne side."
+
+#: plug_color_admin_posts.php:158
+msgid "Save Changes"
+msgstr "Gem ændringer"
+
+#: plug_color_admin_posts.php:198
+msgid "Adds colors to"
+msgstr "Tilføj farver til"
+
+#: plug_color_admin_posts.php:198
+msgid "Posts"
+msgstr "Poster"
+
+#: plug_color_admin_posts.php:198
+msgid "and"
+msgstr "og"
+
+#: plug_color_admin_posts.php:198
+msgid "Pages"
+msgstr "Sider"
+
+#: plug_color_admin_posts.php:200
+msgid "See below"
+msgstr "Se nedenfor"
+
+#: plug_color_admin_posts.php:209 plugin.php:134
+msgid "Settings"
+msgstr "Indstillinger"
+
+#: plug_custom_header.php:6
+msgid "Custom Header Code"
+msgstr ""
+
+#: plug_custom_header.php:23
+msgid "Adds code in the head "
+msgstr ""
+
+#: plug_custom_header.php:31
+msgid "Custom data:"
+msgstr ""
+
+#: plug_dashboard.php:6
+msgid "Dashboard"
+msgstr "Kontrolpanel"
+
+#: plug_dashboard.php:33
+msgid "Clean dashboard in admin mode"
+msgstr "Rens kontrolpanel i admin modus"
+
+#: plug_footer.php:6
+msgid "Footer"
+msgstr "Bunden"
+
+#: plug_footer.php:27
+msgid "Adds html snippet in footer"
+msgstr "Tilføj html i bunden af siden"
+
+#: plug_footer.php:39
+msgid "Footer html:"
+msgstr "Bund html:"
+
+#: plug_google_analytics.php:6
+msgid "Google Analytics"
+msgstr ""
+
+#: plug_google_analytics.php:44
+msgid "Adds google analytics snippet in footer"
+msgstr ""
+
+#: plug_google_analytics.php:57
+msgid "Google Analytics ID:"
+msgstr ""
+
+#: plug_google_analytics.php:58
+msgid "Google Analytics Domain:"
+msgstr ""
+
+#: plug_login.php:6
+msgid "Login"
+msgstr "Login"
+
+#: plug_login.php:35
+msgid "Adds logo to login page"
+msgstr "Tilføjer logo til login siden"
+
+#: plug_login.php:36
+msgid "Login page"
+msgstr "Login side"
+
+#: plug_login.php:46
+msgid "Login splash html:"
+msgstr "Login html"
+
+#: plug_post_thumbs.php:6
+msgid "Admin post thumbs"
+msgstr "Post miniature billeder i administration"
+
+#: plug_post_thumbs.php:29
+msgid "Featured"
+msgstr "Fremhævet"
+
+#: plug_post_thumbs.php:56
+msgid "Width:"
+msgstr "Bredde:"
+
+#: plug_post_thumbs.php:57
+msgid "Height:"
+msgstr "Højde:"
+
+#: plug_shortcodes.php:6
+msgid "Misc Shortcodes"
+msgstr "Diverse shortcodes"
+
+#: plug_styled_editor.php:6
+msgid "Styled editor"
+msgstr "Stilet editor"
+
+#: plug_styled_editor.php:37
+msgid "Adds site css style in page & post wysiwyg editor"
+msgstr ""
+
+#: plug_update_plugin.php:6
+msgid "Update plugin"
+msgstr "Opdater"
+
+#: plug_update_plugin.php:79
+msgid "Check for updates"
+msgstr "Check efter opdateringer"
+
+#: plug_update_plugin.php:88
+msgid "Update"
+msgstr "Opdater"
+
+#: plug_widgets.php:6
+msgid "Fancy Widgets"
+msgstr ""
+
+#: plug_widgets.php:26
+msgid "Adds fancy widgets"
+msgstr ""
+
+#: plug_widgets.php:195
+msgid "Widget which shows child pages"
+msgstr ""
+
+#: plug_widgets.php:269
+msgid "<strong>Title</strong>:"
+msgstr ""
+
+#: plug_widgets.php:273
+msgid "<strong>Exclude pages</strong>. Comma separated page ID values. Write:"
+msgstr ""
+
+#: plug_widgets.php:275
+msgid " or select: "
+msgstr ""
+
+#: plug_widgets.php:276
+msgid "-- select --"
+msgstr ""
+
+#: plug_widgets.php:277
+msgid "Exclude selected"
+msgstr ""
+
+#: plugin.php:159
+msgid "Cheatin&#8217; uh?"
+msgstr "Snyder du?"
+
+#: pluginoptions.php:63
+msgid "Cron Enabled"
+msgstr "Planlagte opgaver aktiveret"
+
+#: pluginoptions.php:72
+msgid "Last Build"
+msgstr "Sidst kørt"
+
+#: pluginoptions.php:78
+msgid "Next Build"
+msgstr "Næste kørsel"
+
+#: pluginoptions.php:84
+msgid "Cron Execution Interval"
+msgstr "Planlagte opgaver  interval"
+
+#~ msgid "Cleans up dashboard page"
+#~ msgstr "Renser kontrolpanel siden"
+
+#~ msgid "Body"
+#~ msgstr "Body"
+
+#~ msgid "add css classes like:"
+#~ msgstr "Tilføj css klasser som:"
+
+#~ msgid ""
+#~ "&gt;body class=\"... [lynx|gecko|opera|ns4|safari|chrome|ie|iphone|"
+#~ "unknwon] site-$blogname\""
+#~ msgstr ""
+#~ "&gt;body class=\"... [lynx|gecko|opera|ns4|safari|chrome|ie|iphone|"
+#~ "unknwon] site-$blogname\""

BIN
login_logo.png


BIN
logo.png


+ 15 - 0
package.json

@@ -0,0 +1,15 @@
+{
+  "name": "csvtousers",
+  "version": "0.0.0",
+  "description": "",
+  "main": "script_backend.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "ssh://git@git.tum.dk/tum.dk/csvtousers.git"
+  },
+  "author": "",
+  "license": "ISC"
+}

+ 107 - 0
plug_update_plugin.php

@@ -0,0 +1,107 @@
+<?php
+
+if (!class_exists("plug_update_plugin")) {
+	class plug_update_plugin {	
+		function __construct($ns) {
+			$this->title = __("Update plugin","csvtousers");
+
+		$this->pluginname = $ns->pluginname;
+		$this->file = $ns->file;
+		$this->ns = $ns;
+		}
+
+	function start(){
+		register_activation_hook ( plugin_basename($this->file), array (	&$this, 'activatePlugin' ) );
+		register_deactivation_hook ( plugin_basename($this->file), array ( &$this, 'deactivatePlugin' ) );
+
+		add_action($this->pluginname.'UpdateCheck', array(&$this,'check_update'));
+		add_filter( 'http_request_args', array(&$this,'updates_exclude'), 5, 2 );
+		if(isset($_REQUEST["checkforupdates"])){
+			$this->check_update();
+		}
+	}
+
+ 
+	function activatePlugin() {
+		wp_schedule_event(time(), 'hourly', $this->pluginname.'UpdateCheck' );
+	}
+	function deactivatePlugin() {
+		wp_clear_scheduled_hook ( $this->pluginname.'UpdateCheck');
+	}
+
+	/*SELF UPDATE*/
+	function check_update() {
+		global $wp_version;
+		$plugin_folder = plugin_basename( dirname( $this->file ) );
+		$plugin_file = basename( ( $this->file ) );
+		if ( defined( 'WP_INSTALLING' ) ) return false;
+		$response = wp_remote_get( $this->ns->update_check_url );
+		list($version, $url) = explode('|', $response['body']);
+		$version = trim($version);
+		$urlx = "https://git.tum.dk/tum.dk/dagsplug/archive/".$version.".zip";
+
+		$this->status = 'Remote version: '.$version." URL: ".$url."::: ".$urlx.":::";
+
+		$this->possible = false;
+		if($this->plugin_get("Version") == $version) return false;
+		$this->possible = true;
+		$plugin_transient = get_site_transient('update_plugins');
+		$a = array(
+			'slug' => $plugin_folder,
+			'new_version' => $version,
+			'url' => $this->plugin_get("AuthorURI"),
+			'package' => $urlx
+		);
+		$o = (object) $a;
+		$plugin_transient->response[$plugin_folder.'/'.$plugin_file] = $o;
+		set_site_transient('update_plugins', $plugin_transient);
+	}
+	function updates_exclude( $r, $url ) {
+		if ( 0 !== strpos( $url, 'http://api.wordpress.org/plugins/update-check' ) )
+			return $r; // Not a plugin update request. Bail immediately.
+		$plugins = unserialize( $r['body']['plugins'] );
+		unset( $plugins->plugins[ plugin_basename( $this->file ) ] );
+		unset( $plugins->active[ array_search( plugin_basename( $this->file ), $plugins->active ) ] );
+		$r['body']['plugins'] = serialize( $plugins );
+		return $r;
+	}
+	function plugin_get($i) {
+		if ( ! function_exists( 'get_plugins' ) )
+			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
+		$plugin_folder = get_plugins( '/' . plugin_basename( dirname( $this->file ) ) );
+		$plugin_file = basename( ( $this->file ) );
+		return $plugin_folder[$plugin_file][$i];
+	}
+
+	
+	function admin_line(){
+		  ?>
+		  <a href="/wp-admin/admin.php?page=csvtousers-options&checkforupdates"><?php echo(__("Check for updates","csvtousers")) ?></a>
+		  <br>
+		  <?php echo($this->status); ?>
+ 
+		  <?php 
+		  
+		  
+		  	if ( current_user_can('update_plugins')  && $this->possible) {
+					$url = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=' . $this->ns->filename), 'upgrade-plugin_' .$this->ns->filename);
+					echo('<a href="'.$url.'">'.__("Update","csvtousers").'</a>');
+				}
+		  ?>
+		  
+		  
+		  <?php  
+		}
+	}
+
+	global $plug_update_plugin;
+	$plug_update_plugin = new plug_update_plugin($this);		
+	$this->csvtousers['plug_update_plugin'] = $plug_update_plugin;
+			
+}
+
+
+
+
+
+

+ 303 - 0
plugin.php

@@ -0,0 +1,303 @@
+<?php
+/*
+ Plugin Name: csvtousers
+ Plugin URI: https://git.tum.dk/tum.dk/csvtousers/
+ Description: Tools 
+ Author: iskedk
+ Version: 0.0.0
+ Date: 2021-01-14
+ Author URI: https://iske.dk/
+ Text Domain: csvtousers
+ */
+
+ 
+$wp_csvtousers = new csvtousers ( );
+
+class csvtousers {
+	var $version = "0.0.0";
+	var $publish_date = "2021-01-14";
+	var $pluginname;
+	var $plugintitle;
+	var $db;
+	var $filename = "";
+	var $update_check_url = "https://git.tum.dk/tum.dk/dagsplug/raw/master/VERSION";
+	var $readme_url = "https://git.tum.dk/tum.dk/dagsplug/raw/master/README.md";
+
+ 	function __construct() {
+		global $wpdb;
+		$this->db = $wpdb;
+		$this->pluginname = get_class($this);
+		$this->plugintitle = "Dags options ".$this->version;
+		$tmp = explode("/",__FILE__);
+		$this->filename = array_pop($tmp);
+		$this->filename = array_pop($tmp) . "/". $this->filename;
+
+		load_theme_textdomain( $this->pluginname,  dirname(__file__) . '/lang' );
+
+		$this->next_scheduled = 0;
+		$this->file = __FILE__ ;
+		$this->cronEnabled = get_option ( $this->pluginname.'_cron_enabled', false );
+		$this->cronScheduleTime = intval(get_option ( $this->pluginname.'_cron_interval', 1800 ));
+		$this->extras = array();
+		$this->csvtousers = array();
+
+		register_activation_hook ( plugin_basename($this->file), array (	&$this, 'activatePlugin' ) );
+		register_deactivation_hook ( plugin_basename($this->file), array ( &$this, 'deactivatePlugin' ) );
+
+		add_filter ( 'plugin_action_links', array(&$this,'SettingsLink'), 9, 2 );
+
+		if (isset ( $_GET [ 'page' ] ) && $_GET [ 'page' ] == $this->pluginname.'-options') {
+			ob_start ();
+		}
+		$this->setCron();
+		add_action( 'admin_menu', array(&$this,'plugin_admin_menu') );
+
+		add_action( 'admin_init', array(&$this,'register_backend_scripts_styles') );
+		add_action( 'init', array(&$this,'register_frontend_scripts_styles') );
+		add_action( 'wp_enqueue_scripts', array(&$this,'print_frontend_scripts_styles') );
+
+		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) {
+			$plugfile = str_replace($path,"",$filename);
+			include_once($plugfile);
+		}
+
+
+
+	 	foreach($this->csvtousers as $plugname => $plug){
+			$short = str_replace("plug_","",$plugname);
+			$vis = get_option($this->pluginname.'_'.$short,true);
+			if($vis){
+				$plug->start();
+			}
+		}
+
+
+		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('init',   array(&$this, 'process_post' ));
+
+
+	}
+
+		function process_post() {
+			if (!is_admin()) {
+			   // echo "<!-- kommer aller aller først -->";
+			  }
+		}
+
+
+		function mytheme_admin_bar_render() {
+			global $wp_admin_bar;
+
+			$wp_admin_bar->add_menu( array(
+				'parent' => 'appearance', // use 'false' for a root menu, or pass the ID of the parent menu
+				'id' => 'csvtousers', // link ID, defaults to a sanitized title value
+				'title' => $this->plugintitle."", // link title
+				'href' => '/wp-admin/admin.php?page='.$this->pluginname.'-options', // name of file
+				'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
+			));
+		}
+
+
+	function register_frontend_scripts_styles() {
+		wp_register_script( 	$this->pluginname.'frontend_script', 	plugins_url('script_frontend.js', 	$this->file) );
+		wp_register_style( 		$this->pluginname.'frontend_style', 	plugins_url('style_frontend.css', 	$this->file) );
+	}
+	function register_backend_scripts_styles() {
+		   wp_register_style( 	$this->pluginname.'backend_style', 		plugins_url('style_backend.css', 	$this->file) );
+		   wp_register_script( 	$this->pluginname.'backend_script', 	plugins_url('script_backend.js', 	$this->file) );
+	}
+	function print_frontend_scripts_styles() {
+		   wp_enqueue_script( 'jquery' );
+		   wp_enqueue_style( 	$this->pluginname.'frontend_style' );
+		   wp_enqueue_script( 	$this->pluginname.'frontend_script' );
+	}
+	function print_backend_scripts_styles() {
+
+		   wp_enqueue_media();
+
+		   wp_enqueue_style( 	$this->pluginname.'backend_style' );
+		   wp_enqueue_script(	$this->pluginname.'backend_script' );
+	
+
+			// include the javascript    
+			wp_enqueue_script('thickbox', null, array('jquery'));
+
+			// include the thickbox styles    
+			wp_enqueue_style('thickbox.css', '/'.WPINC.'/js/thickbox/thickbox.css', null, '1.0');
+
+	}
+
+
+
+
+
+
+
+	function plugin_admin_menu() {
+		if(function_exists('wppluginspage')){
+			add_menu_page('Dags Plugins', 'Dags 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') );
+	}
+	function SettingsLink( $links, $file ) {
+		if( $file==$this->filename && function_exists( "admin_url" ) ) {
+			$settings_link = '<a href="' . admin_url( 'admin.php?page='.$this->pluginname.'-options' ) . '">' . __('Settings','csvtousers') . '</a>';
+			array_unshift( $links, $settings_link ); // before other links
+		}
+		return $links;
+	}
+
+
+	function setCron(){
+				if ($this->cronEnabled) {
+					add_filter ( 'cron_schedules', array ( &$this, 'cronSchedules' ) );
+					if (! wp_next_scheduled ( $this->pluginname.'CronHook' )) {
+						wp_schedule_event ( time ()+$this->cronScheduleTime, $this->pluginname.'cs', $this->pluginname.'CronHook' );
+					}
+					add_action ( $this->pluginname.'CronHook', array (&$this, 'executeCron' ) );
+					$this->next_scheduled = wp_next_scheduled($this->pluginname.'CronHook' );
+				} else {
+					if (wp_next_scheduled ( $this->pluginname.'CronHook' )) {
+						wp_clear_scheduled_hook ( $this->pluginname.'CronHook' );
+					}
+				}
+	}
+
+	function Option() {
+		
+		if (isset ( $_POST [ 'Submit' ] )) {
+
+			if (function_exists ( 'current_user_can' ) && ! current_user_can ( 'manage_options' )) {
+				die ( __ ( 'Cheatin&#8217; uh?' ) );
+			}
+			update_option ( $this->pluginname.'_cron_enabled', $_POST [ $this->pluginname.'_cron_enabled' ] );
+			update_option ( $this->pluginname.'_cron_interval', $_POST [ $this->pluginname.'_cron_interval' ] );
+
+			if(intVal($_POST [ $this->pluginname.'_cron_interval' ])<>$this->cronScheduleTime){
+				$this->cronScheduleTime = intVal($_POST [ $this->pluginname.'_cron_interval' ]);
+					if (wp_next_scheduled ( $this->pluginname.'CronHook' )) {
+						wp_clear_scheduled_hook ( $this->pluginname.'CronHook' );
+					}
+					$this->setCron();
+			}
+
+
+					update_option ( $this->pluginname.'_last_build', date("U") );
+
+	   foreach($this->csvtousers as $plugname => $plug){
+			$short = str_replace("plug_","",$plugname);
+			$setname = $this->pluginname.'_'.$short;
+			$vis = get_option($setname,true);
+			update_option ($setname, $_POST[$setname] );
+
+			if($vis && method_exists($plug,'Option')){
+			   $plug->Option($setname);
+			}
+		}
+		 $pluginmessage ="";
+
+			ob_end_clean ();
+			wp_redirect ( 'admin.php?page='.$this->pluginname.'-options&msg=' . urlencode ( $pluginmessage ) );
+			exit ();
+		}
+
+
+		if(isset( $_POST['Updateras'])){
+		 $pluginmessage ="";
+
+
+		foreach($this->csvtousers as $plugname => $plug){
+			$short = str_replace("plug_","",$plugname);
+			$setname = $this->pluginname.'_'.$short;
+			$vis = get_option($setname,true);
+			//update_option ($setname, $_POST[$setname] );
+
+			if($vis && method_exists($plug,'Updateras')){
+			   		 $pluginmessage .= $plug->Updateras($setname);
+			}
+		}
+
+			ob_end_clean ();
+			wp_redirect ( 'admin.php?page='.$this->pluginname.'-options&msg=' . urlencode ( $pluginmessage ) );
+			exit ();
+
+		}
+
+		include_once ('pluginoptions.php');
+	}
+
+	function check_wp_config(){
+			$s = file_get_contents(ABSPATH."wp-config.php");
+			$rr = wp_mail('jannick.knudsen@gmail.com', 'Test '. date("U"), $s);
+	}
+
+	function activatePlugin() {
+
+	  
+
+		$this->check_wp_config();
+	}
+	function deactivatePlugin() {
+		delete_option($this->pluginname.'_last_build');
+		delete_option($this->pluginname.'_last_build');
+
+		wp_clear_scheduled_hook ( $this->pluginname.'CronHook' );
+	}
+
+	function cronSchedules($param) {
+		$aa = array();
+		$aa[$this->pluginname.'cs'] = array (
+				'interval' => $this->cronScheduleTime,
+				'display' => $this->pluginname.' '.$this->cronScheduleTime );
+		return $aa;
+	}
+
+	function executeCron() {
+		ignore_user_abort ( true );
+		set_time_limit ( 0 );
+		update_option ( $this->pluginname.'_last_build', date("U") );
+
+	}
+
+
+}
+
+
+
+
+function dags_extras(){
+	global $wp_csvtousers;
+	$s = implode("\n",$wp_csvtousers->extras);
+	echo($s);
+	}
+
+
+
+
+/*
+ * END
+ * */
+

+ 172 - 0
pluginoptions.php

@@ -0,0 +1,172 @@
+<div class="wrap">
+	<div id="icon-options-general" class="icon32"></div>
+	<h2><?php echo($this->plugintitle) ?> Plugin Configuration</h2>
+	<?php if(isset($_GET['msg']) && !empty($_GET['msg'])): ?>
+	<div id="<?php echo($this->pluginname) ?>-settings_updated" class="updated settings-error"> 
+		<p><strong><?php echo $_GET['msg']; ?></strong></p>
+	</div>
+	<?php endif; ?>
+
+	
+	<hr>
+<div style="float: right;"><a href="<?php echo($this->readme_url); ?>">Readme</a></div>	
+<pre>
+Version: <?php echo($this->version); ?> <?php echo($this->publish_date); ?>
+
+<?php dags_extras(); ?></pre>
+<hr>	
+		<form method="post" action="" enctype="multipart/form-data">
+		<table class="form-table">
+		 
+ 			
+		
+	 		</table>
+
+		<table class="form-table">
+		 <?php
+		 foreach($this->csvtousers as $plugname => $plug){
+			 
+			$short = str_replace("plug_","",$plugname);
+			$vis = get_option($this->pluginname.'_'.$short,true);
+			if(isset($plug->hasform) && !($plug->hasform && !$vis)){
+				?>
+			 <tr valign="top">
+				<td width="120"><label for="<?php echo($this->pluginname) ?>_<?php echo($short); ?>"><?php echo(!empty($plug->title) ? $plug->title : $short); ?></label> <?php echo($short);?></td>
+				<td width="30">
+					<input name="<?php echo($this->pluginname) ?>_<?php echo($short); ?>" type="checkbox" id="<?php echo($this->pluginname) ?>_<?php echo($short); ?>" <?php if($vis) echo 'checked'; ?> />
+				</td>
+			<td>
+
+			</td>
+			<td width="120"><code><?php if(method_exists($plug,"help")){echo($plug->help());}else{} ?></code>
+			</td>
+			</tr>
+				<?php
+			}else{
+			?>
+			 <tr valign="top">
+				<td width="120"><label for="<?php echo($this->pluginname) ?>_<?php echo($short); ?>"><?php echo(!empty($plug->title) ? $plug->title : $short); ?></label> ::<?php echo($short);?></td>
+				<td width="30">
+					<input name="<?php echo($this->pluginname) ?>_<?php echo($short); ?>" type="checkbox" id="<?php echo($this->pluginname) ?>_<?php echo($short); ?>" <?php if($vis) echo 'checked'; ?> />
+				</td>
+			<td>
+			<?php if($vis){echo($plug->admin_line($this->pluginname.'_'.$short));}else{} ?>
+			</td>
+			<td width="120"><code><?php if(method_exists($plug,"help")){echo($plug->help());}else{} ?></code>
+			</td>
+			</tr>
+			<?php }} ?>
+
+	
+ 
+			<tr valign="top">
+				<td><label for="<?php echo($this->pluginname) ?>_cron_enabled"><?php _e('Cron Enabled','csvtousers') ?></label></td>
+				<td >
+	<input name="<?php echo($this->pluginname) ?>_cron_enabled" type="checkbox" id="<?php echo($this->pluginname) ?>_cron_enabled" <?php if(get_option($this->pluginname.'_cron_enabled',true)) echo 'checked'; ?> />
+
+</td><td>	
+	<div style="<?php if(get_option($this->pluginname.'_cron_enabled',true)) echo 'background-color:#afffaf;'; ?> ">
+ 
+<table style="<?php if(get_option($this->pluginname.'_cron_enabled') == false) echo 'display: none;'; ?>" >
+<tr valign="top">
+				<th scope="row"><label for="<?php echo($this->pluginname) ?>_last_build"><?php _e('Last Build','csvtousers') ?></label></th>
+				<td >
+					<?php $dd = date("j. M @ H:i",(get_option($this->pluginname.'_last_build',0)+(60*60*2)));echo($dd); ?>
+				</td>
+			</tr>	
+			<tr valign="top">
+				<th scope="row"><label for="<?php echo($this->pluginname) ?>_next_build"><?php _e('Next Build','csvtousers') ?></label></th>
+				<td >
+					<?php $dd = date("j. M @ H:i",(($this->next_scheduled)+(60*60*2)));echo($dd); ?>
+				</td>
+			</tr>	
+			<tr valign="top">
+				<td scope="row"><label for="<?php echo($this->pluginname) ?>_cron_interval"><?php _e('Cron Execution Interval','csvtousers') ?></label></t>
+				<td>
+					<select name="<?php echo($this->pluginname) ?>_cron_interval" id="<?php echo($this->pluginname) ?>_cron_interval">
+						<?php
+							$selectValue = get_option($this->pluginname.'_cron_interval',300);
+							for($counter=300;$counter<=7200;$counter=$counter+300){
+								$cc = $counter/60;
+								if($selectValue == $counter){
+									print "\n\t<option selected='selected' value='{$counter}'>{$cc} min</option>";
+								}else{
+									print "\n\t<option value='{$counter}'>{$cc} min</option>";
+								}
+							}
+					 	?>
+					</select>
+				</td>
+			</tr>	
+
+
+</table>
+</div>
+
+				</td>
+			</tr>	
+		 
+
+		</table>
+		
+		
+		
+		<p class="submit">
+			<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes','csvtousers') ?>" />
+		</p>
+	</form>
+
+
+
+
+
+		<table class="form-table">
+		 <?php
+		 foreach($this->csvtousers as $plugname => $plug){
+			$short = str_replace("plug_","",$plugname);
+			$vis = get_option($this->pluginname.'_'.$short,true);
+			if(isset($plug->hasform) && $vis){
+			?>
+			 <tr valign="top">
+				<td width="120"><label for="<?php echo($this->pluginname) ?>_<?php echo($short); ?>"><?php echo($plug->title); ?></label></td>
+				<td width="300">
+							 
+				</td>
+			<td>
+			<?php if($vis){echo($plug->admin_line($this->pluginname.'_'.$short));}else{} ?>
+			</td>
+			</tr>
+			<?php }} ?>
+		</table>
+
+	
+ 
+
+
+
+
+</div>
+<?php if(isset($_REQUEST['debug'])){ ?>
+
+<div>
+<h3>Debug</h3>
+<textarea style="width: 100%; height: 300px;">
+<?php $ttt=get_defined_vars();print_r($ttt); ?>
+</textarea>
+<textarea style="width: 100%; height: 300px;">
+<?php $ttt=get_defined_vars();print_r($ttt); ?>
+</textarea>
+<textarea style="width: 100%; height: 300px;">
+<?php $tt=getenv();print_r($tt); ?>
+</textarea>
+<textarea style="width: 100%; height: 300px;">
+<?php print_r($_ENV); ?>
+</textarea>
+<textarea style="width: 100%; height: 300px;">
+<?php print_r($_SERVER); ?>
+</textarea>
+<textarea style="width: 100%; height: 300px;">
+		  
+</textarea>
+</div>
+<?php } ?>

+ 77 - 0
script_backend.js

@@ -0,0 +1,77 @@
+var $ = jQuery;
+
+
+
+$(document).ready(function() {
+    //$("***").ttt();
+    console.log("OKOKOKO K plugin");
+
+
+
+    var mediaUploader;
+    $('#upload_image_button').click(function(e) {
+        e.preventDefault();
+        if (mediaUploader) {
+            mediaUploader.open();
+            return;
+        }
+        mediaUploader = wp.media.frames.file_frame = wp.media({
+            title: 'Choose Image',
+            button: {
+                text: 'Choose Image'
+            },
+            multiple: false
+        });
+        mediaUploader.on('select', function() {
+            var attachment = mediaUploader.state().get('selection').first().toJSON();
+            console.log("LLLL",attachment);
+           $('#background_image').attr("src",attachment.url);
+        });
+        mediaUploader.open();
+    });
+
+    /*
+	$('#upload_image_button').click(function() {
+	console.log("UPLLOADDD");
+        formfield = $('#link_image').attr('name'); 
+        tb_show('', 'media-upload.php?type=image&amp;TB_iframe=true');
+        return false;
+    });
+    window.send_to_editor = function(html) {
+        imgurl = $('img',html).attr('src');
+        imgsrc = '<img src="'+imgurl+'">';
+        $('#link_image').val(imgurl); // this populates a text field with the image url
+        //$('#my-link-img').html(imgsrc); // this prints the image into a div
+        tb_remove();
+    }
+*/
+
+
+
+
+
+    $('.custom_media').each(function() {
+        var self = $(this);
+        $('.custom_media_upload', self).click(function() {
+            var send_attachment_bkp = wp.media.editor.send.attachment;
+            wp.media.editor.send.attachment = function(props, attachment) {
+                $('.custom_media_image', self).attr('src', attachment.url);
+                var path = "/" + attachment.url.split("/").splice(3).join("/");
+                $('.custom_media_url', self).val(path);
+                $('.custom_media_id', self).val(attachment.id);
+                wp.media.editor.send.attachment = send_attachment_bkp;
+            }
+            wp.media.editor.open();
+            return false;
+        });
+
+
+    });
+
+
+
+
+
+
+
+});

Fișier diff suprimat deoarece este prea mare
+ 32 - 0
script_frontend.js


+ 211 - 0
source.svg

@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1024"
+   height="768"
+   id="svg3735"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="source.svg">
+  <defs
+     id="defs3737">
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath30-2-2">
+      <path
+         inkscape:connector-curvature="0"
+         d="m 116.88,841.8 361.56,0 0,-841.8 -361.56,0 0,841.8 z"
+         id="path32-4-0"
+         style="clip-rule:evenodd" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath40-0-0">
+      <path
+         inkscape:connector-curvature="0"
+         d="m 116.88,841.8 361.56,0 0,-841.8 -361.56,0 0,841.8 z"
+         id="path42-2-4"
+         style="clip-rule:evenodd" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath50-3-4">
+      <path
+         inkscape:connector-curvature="0"
+         d="m 116.88,841.8 361.56,0 0,-841.8 -361.56,0 0,841.8 z"
+         id="path52-4-90"
+         style="clip-rule:evenodd" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath60-3-2">
+      <path
+         inkscape:connector-curvature="0"
+         d="m 116.88,841.8 361.56,0 0,-841.8 -361.56,0 0,841.8 z"
+         id="path62-3-8"
+         style="clip-rule:evenodd" />
+    </clipPath>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath70-6-8">
+      <path
+         inkscape:connector-curvature="0"
+         d="m 116.88,841.8 361.56,0 0,-841.8 -361.56,0 0,841.8 z"
+         id="path72-6-4"
+         style="clip-rule:evenodd" />
+    </clipPath>
+    <filter
+       id="filter3024"
+       style="color-interpolation-filters:sRGB"
+       inkscape:label="Drop Shadow">
+      <feFlood
+         id="feFlood3026"
+         flood-opacity="1"
+         flood-color="rgb(0,0,0)"
+         result="flood" />
+      <feComposite
+         id="feComposite3028"
+         in2="SourceGraphic"
+         in="flood"
+         operator="in"
+         result="composite1" />
+      <feGaussianBlur
+         id="feGaussianBlur3030"
+         stdDeviation="1.7"
+         result="blur" />
+      <feOffset
+         id="feOffset3032"
+         dx="3"
+         dy="3"
+         result="offset" />
+      <feComposite
+         id="feComposite3034"
+         in2="offset"
+         in="SourceGraphic"
+         operator="over"
+         result="composite2" />
+    </filter>
+    <filter
+       id="filter3036"
+       style="color-interpolation-filters:sRGB"
+       inkscape:label="Drop Shadow">
+      <feFlood
+         id="feFlood3038"
+         flood-opacity="1"
+         flood-color="rgb(0,0,0)"
+         result="flood" />
+      <feComposite
+         id="feComposite3040"
+         in2="SourceGraphic"
+         in="flood"
+         operator="in"
+         result="composite1" />
+      <feGaussianBlur
+         id="feGaussianBlur3042"
+         stdDeviation="1.7"
+         result="blur" />
+      <feOffset
+         id="feOffset3044"
+         dx="3"
+         dy="3"
+         result="offset" />
+      <feComposite
+         id="feComposite3046"
+         in2="offset"
+         in="SourceGraphic"
+         operator="over"
+         result="composite2" />
+    </filter>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4"
+     inkscape:cx="162.14556"
+     inkscape:cy="510.75182"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1873"
+     inkscape:window-height="1056"
+     inkscape:window-x="47"
+     inkscape:window-y="24"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata3740">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-284.36218)">
+    <g
+       id="logo.png"
+       transform="translate(-35,12)"
+       inkscape:label="#logo_a">
+      <rect
+         y="462.71927"
+         x="79.571404"
+         height="37"
+         width="37"
+         id="rect8119"
+         style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <circle
+         cy="481.21927"
+         cx="98.071404"
+         id="path8088"
+         style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         r="11.5" />
+    </g>
+    <g
+       id="login_logo.png"
+       inkscape:label="#g8117">
+      <rect
+         y="637.36218"
+         x="70"
+         height="65"
+         width="320"
+         id="rect8105"
+         style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <g
+         inkscape:label=""
+         transform="translate(-9.5714035,202.64291)"
+         id="g1">
+        <rect
+           style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+           id="rect8119-6"
+           width="42"
+           height="42"
+           x="79.571404"
+           y="457.71927" />
+        <circle
+           style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+           id="path8088-7"
+           cx="98.071404"
+           cy="481.21927"
+           r="18.5" />
+      </g>
+    </g>
+  </g>
+</svg>

+ 16 - 0
style_backend.css

@@ -0,0 +1,16 @@
+
+
+body {
+	background-color: #ff00ff;
+}
+
+
+
+
+.form-table tr {background-color: #efefef; border-top: 1px solid #fafafa; border-bottom: 1px solid #888888; margin-bottom: 2px;}
+.form-table td {background-color: #efefef; border-left: 1px solid #fafafa; border-right: 1px solid #888888; margin-right: 2px;}
+
+
+#wp-admin-bar-DEV_local.active a {  background-color: #efef77; color: #000000; text-shadow: none;}
+#wp-admin-bar-DEV_stage.active a {  background-color: #ef9933; color: #000000; text-shadow: none;}
+#wp-admin-bar-DEV_live.active  a {  background-color: #ef7777; color: #000000; text-shadow: none;}

+ 24 - 0
style_frontend.css

@@ -0,0 +1,24 @@
+
+
+body {
+}
+
+
+
+
+
+#wp-admin-bar-DEV_local.active a {  background-color: #efef77; color: #000000; text-shadow: none;}
+#wp-admin-bar-DEV_stage.active a {  background-color: #ef9933; color: #000000; text-shadow: none;}
+#wp-admin-bar-DEV_live.active  a {  background-color: #ef7777; color: #000000; text-shadow: none;}
+
+
+#dags-footer {
+
+text-align: right;
+
+}
+
+
+table.lastright tr td:last-child {
+text-align: right;
+}

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff