Jannick Knudsen há 5 anos atrás
commit
f52b046756

+ 1 - 0
README.md

@@ -0,0 +1 @@
+##dagsplug

BIN
asc.gif


BIN
bg.gif


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


+ 211 - 0
lang/da_DK.po

@@ -0,0 +1,211 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: dagsopt\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-10-15 11:03+0100\n"
+"PO-Revision-Date: 2012-10-15 11:03+0100\n"
+"Last-Translator: \n"
+"Language-Team:  <jjk@bloggen.dk>\n"
+"Language: \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: /data/iskedk/WPPLUGINS/dagsplug/dagsplug\n"
+"X-Textdomain-Support: yes\n"
+"X-Poedit-Language: Danish\n"
+"X-Poedit-Country: DENMARK\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: 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:"
+
+#: pluginoptions.php:62
+msgid "Cron Enabled"
+msgstr "Planlagte opgaver aktiveret"
+
+#: pluginoptions.php:71
+msgid "Last Build"
+msgstr "Sidst kørt"
+
+#: pluginoptions.php:77
+msgid "Next Build"
+msgstr "Næste kørsel"
+
+#: pluginoptions.php:83
+msgid "Cron Execution Interval"
+msgstr "Planlagte opgaver  interval"
+
+#: plug_footer.php:6
+msgid "Footer"
+msgstr "Bunden"
+
+#: plug_footer.php:30
+msgid "Adds html snippet in footer"
+msgstr "Tilføj fin Dagsdk logo i bunden"
+
+#: plug_footer.php:42
+msgid "Footer html:"
+msgstr "Bund html:"
+
+#: plug_styled_editor.php:6
+msgid "Styled editor"
+msgstr "Stilet editor"
+
+#: plug_update_plugin.php:6
+msgid "Update plugin"
+msgstr "Opdater"
+
+#: plug_update_plugin.php:75
+msgid "Check for updates"
+msgstr "Check efter opdateringer"
+
+#: plug_update_plugin.php:84
+msgid "Update"
+msgstr "Opdater"
+
+#: 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_dashboard.php:6
+msgid "Dashboard"
+msgstr "Kontrolpanel"
+
+#: plug_dashboard.php:29
+msgid "Cleans up dashboard page"
+msgstr "Renser kontrolpanel siden"
+
+#: plug_body.php:6
+msgid "Body"
+msgstr "Body"
+
+#: plug_body.php:32
+msgid "add css classes like:"
+msgstr "Tilføj css klasser som:"
+
+#: plug_body.php:33
+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\""
+
+#: plugin.php:111
+#: plug_color_admin_posts.php:209
+msgid "Settings"
+msgstr "Indstillinger"
+
+#: plugin.php:136
+msgid "Cheatin&#8217; uh?"
+msgstr "Snyder du?"
+
+#: 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_admin_bar.php:6
+msgid "Admin bar"
+msgstr "Administrations Bar"
+
+
+
+#: plug_admin_bar.php:74
+msgid "Server switcher : local > stage > live"
+msgstr "Server skifter : local > stage > live"
+
+
+
+#: plug_admin_bar.php:76
+msgid "Show server ip"
+msgstr "Vis server ip"
+
+#: plug_admin_bar.php:101
+msgid "Server switcher"
+msgstr "Server skifter"
+
+
+#: plug_admin_bar.php:122
+msgid "Show IP"
+msgstr "Vis IP"
+

BIN
login_logo.png


BIN
logo.png


+ 172 - 0
logos.svg

@@ -0,0 +1,172 @@
+<?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="744.09448819"
+   height="1052.3622047"
+   id="svg3735"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="logos.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"
+         clip-rule="evenodd"
+         id="path32-4-0" />
+    </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"
+         clip-rule="evenodd"
+         id="path42-2-4" />
+    </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"
+         clip-rule="evenodd"
+         id="path52-4-90" />
+    </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"
+         clip-rule="evenodd"
+         id="path62-3-8" />
+    </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"
+         clip-rule="evenodd"
+         id="path72-6-4" />
+    </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"
+         in="composite"
+         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"
+         in="composite"
+         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="1.4"
+     inkscape:cx="171.6831"
+     inkscape:cy="746.81633"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1873"
+     inkscape:window-height="1056"
+     inkscape:window-x="1327"
+     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 />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <rect
+       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="rect8119"
+       width="47.857143"
+       height="45.714287"
+       x="43.57143"
+       y="52.362179" />
+  </g>
+</svg>

+ 249 - 0
plug_admin_bar.php

@@ -0,0 +1,249 @@
+<?php
+
+if (!class_exists("plug_admin_bar")) {
+	class plug_admin_bar {
+		function plug_admin_bar($ns) {
+			$this->title = __("Admin bar","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+		}
+		function start(){
+			add_action( 'admin_bar_menu'		, array(&$this,'bu_admin_link_first'), 1 );
+			add_action( 'admin_bar_menu'		, array(&$this,'bu_admin_link_last'), 200 );
+			if(get_option( $this->pluginname."_admin_bar".'_remove_comments' ,false)){
+				add_action( 'wp_before_admin_bar_render'		, array(&$this,'bu_admin_link_remove_comments'), 210 );
+			}
+			if(!function_exists('wp_get_current_user')) {
+				include(ABSPATH . "wp-includes/pluggable.php"); 
+			}
+			//	remove_submenu_page('index.php','update-core.php');
+			$current_user =    wp_get_current_user();
+			if( current_user_can( 'manage_options' ) && $current_user->user_login == "admin") {
+					add_action( 'admin_menu'		, array(&$this,'setup_menus'), 220 );
+			} else {
+				add_action( 'admin_menu'		, array(&$this,'remove_menus'), 220 );
+				add_action( 'wp_before_admin_bar_render'		, array(&$this,'remove_menus2'), 210 );
+			}
+		}
+
+		function remove_menus2() {
+			global $wp_admin_bar;
+				if(get_option( $this->pluginname."_admin_bar".'_remove_new-post' ,false)){
+					$wp_admin_bar->remove_menu("new-post");
+				}
+				if(get_option( $this->pluginname."_admin_bar".'_remove_new-link' ,false)){
+					$wp_admin_bar->remove_menu("new-link");
+				}
+				if(get_option( $this->pluginname."_admin_bar".'_remove_new-page' ,false)){
+					$wp_admin_bar->remove_menu("new-page");
+				}
+				if(get_option( $this->pluginname."_admin_bar".'_remove_new-media' ,false)){
+					$wp_admin_bar->remove_menu("new-media");
+				}
+				if(get_option( $this->pluginname."_admin_bar".'_remove_new-user' ,false)){
+					$wp_admin_bar->remove_menu("new-user");
+				}
+		}
+
+		function setup_menus () {
+			global $menu;
+				$this->gmenu = $menu;
+		}
+		function remove_menus () {
+			global $menu;
+				$this->setup_menus();
+				$rr = array();
+				foreach($this->gmenu as $id => $mm){
+					if(get_option($this->pluginname."_admin_bar".'_remove_'.$mm[5],false)){
+						array_push($rr,$mm[5]);
+					}
+				}
+				foreach($menu as $id => $menupoint){
+					if(isset($menupoint[5]) && in_array($menupoint[5],$rr)){
+						unset($menu[$id]);
+					}
+				}
+				remove_submenu_page('index.php','update-core.php'); 
+				remove_submenu_page('themes.php','update'); 
+				remove_submenu_page('themes.php','checkupdate'); 
+				remove_submenu_page('themes.php','custom-header'); 
+				remove_submenu_page('themes.php','custom-background'); 
+				remove_submenu_page('themes.php','theme-editor.php'); 
+				remove_submenu_page('themes.php','themes.php'); 
+				//add_submenu_page( 'themes.php', "Customize", "Customize", "", "customize.php", "");
+		}
+		function bu_admin_link_first() {
+			global $wp_admin_bar;
+			if(get_option( $this->pluginname."_admin_bar".'_dags_logo' ,true)){
+				$wp_admin_bar->add_menu( array('id' => 'dags-logo',	'title' => '<img src="/wp-content/plugins/dagsplug/logo.png" style="margin-top: 4px;">',	'href'  => 'https://dags.dk/' , 'meta'  => array('title' => __('Dags dk','dagsopt'), ),	) );
+			}
+		}
+		function bu_admin_link_remove_comments() {
+			global $wp_admin_bar;
+			$wp_admin_bar->remove_menu('comments');
+		}
+	
+	
+		function bu_admin_link_last() {
+			global $wp_admin_bar;
+			if(get_option( $this->pluginname."_admin_bar".'_dags_logo' ,true)){
+				$wp_admin_bar->remove_node("wp-logo");
+			}
+			if(get_option( $this->pluginname."_admin_bar".'_show_ip' ,true)){
+				$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'IP', 'title' => 'IP: '.$_SERVER['SERVER_ADDR'], 'href' => admin_url( 'admin.php?page='.$this->pluginname.'-options' )  ) );
+			}
+			if ( current_user_can( 'manage_options' ) && get_option( $this->pluginname."_admin_bar_live_url" )) {
+
+				if(get_option( $this->pluginname."_admin_bar".'_show_switcher' ,true)){
+					if($_SERVER['HTTP_HOST']==get_option( $this->pluginname."_admin_bar_live_url" )){
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_live', 'title' => get_option( $this->pluginname."_admin_bar_live_title" ), 'href' => get_option( $this->pluginname."_admin_bar_live_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> 'active')  ) );
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_stage', 'title' =>  get_option( $this->pluginname."_admin_bar_stage_title" ), 'href' => get_option( $this->pluginname."_admin_bar_stage_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> '')  ) );
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_local', 'title' => get_option( $this->pluginname."_admin_bar_local_title" ), 'href' => get_option( $this->pluginname."_admin_bar_local_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> '')  ) );
+					}else if($_SERVER['HTTP_HOST']==get_option( $this->pluginname."_admin_bar_stage_url" )){
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_live', 'title' => get_option( $this->pluginname."_admin_bar_live_title" ), 'href' => get_option( $this->pluginname."_admin_bar_live_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> '')  ) );
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_stage', 'title' => get_option( $this->pluginname."_admin_bar_stage_title" ), 'href' => get_option( $this->pluginname."_admin_bar_stage_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> 'active')  ) );
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_local', 'title' => get_option( $this->pluginname."_admin_bar_local_title" ), 'href' => get_option( $this->pluginname."_admin_bar_local_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> '')  ) );
+					}else{
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_live', 'title' => get_option( $this->pluginname."_admin_bar_live_title" ), 'href' => get_option( $this->pluginname."_admin_bar_live_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> '')  ) );
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_stage', 'title' => get_option( $this->pluginname."_admin_bar_stage_title" ), 'href' => get_option( $this->pluginname."_admin_bar_stage_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> '')  ) );
+						$wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'DEV_local', 'title' => get_option( $this->pluginname."_admin_bar_local_title" ), 'href' => get_option( $this->pluginname."_admin_bar_local_url" ).$_SERVER['REQUEST_URI'], 'meta'=>array('class'=> 'active')  ) );
+					}
+				}
+
+			} else {
+
+			}
+		}
+
+		function help(){
+			?>
+			<?php echo(__("Server switcher : local > stage > live","dagsopt")) ?><br>
+			<?php echo(__("Swap WP for dags logo","dagsopt")) ?><br>
+			<?php echo(__("Show server ip","dagsopt")) ?><br>
+
+		<?php
+		}
+
+			function Option($pre){
+				update_option ( $pre.'_show_switcher', $_POST [ $pre.'_show_switcher' ] );
+				if(!empty($_POST [ $pre.'_live_url' ])){
+					update_option ( $pre.'_live_url', $_POST [ $pre.'_live_url' ] );
+				}
+				if(!empty($_POST [ $pre.'_live_title' ])){
+					update_option ( $pre.'_live_title', $_POST [ $pre.'_live_title' ] );
+				}
+				if(!empty($_POST [ $pre.'_stage_url' ])){
+					update_option ( $pre.'_stage_url', $_POST [ $pre.'_stage_url' ] );
+				}
+				if(!empty($_POST [ $pre.'_stage_title' ])){
+					update_option ( $pre.'_stage_title', $_POST [ $pre.'_stage_title' ] );
+				}
+				if(!empty($_POST [ $pre.'_local_url' ])){
+					update_option ( $pre.'_local_url', $_POST [ $pre.'_local_url' ] );
+				}
+				if(!empty($_POST [ $pre.'_local_title' ])){
+					update_option ( $pre.'_local_title', $_POST [ $pre.'_local_title' ] );
+				}
+
+				update_option ( $pre.'_dags_logo', $_POST [ $pre.'_dags_logo' ] );
+				update_option ( $pre.'_show_ip', $_POST [ $pre.'_show_ip' ] );
+
+				update_option ( $pre.'_remove_comments', $_POST [ $pre.'_remove_comments' ] );
+
+				update_option ( $pre.'_remove_new-post', $_POST [ $pre.'_remove_new-post' ] );
+				update_option ( $pre.'_remove_new-link', $_POST [ $pre.'_remove_new-link' ] );
+				update_option ( $pre.'_remove_new-media', $_POST [ $pre.'_remove_new-media' ] );
+				update_option ( $pre.'_remove_new-page', $_POST [ $pre.'_remove_new-page' ] );
+				update_option ( $pre.'_remove_new-user', $_POST [ $pre.'_remove_new-user' ] );
+
+
+				
+
+				foreach($this->gmenu as $id => $mm){
+						update_option ( $pre.'_remove_'.$mm[5], $_POST [ $pre.'_remove_'.$mm[5] ] );
+				}
+
+
+			}
+
+
+		 	function admin_line($pre){
+				?>
+				<table>
+				<tr><td ><?php echo(__("Server switcher","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_show_switcher' ); ?>" type="checkbox" id="<?php echo( $pre.'_show_switcher' ); ?>" <?php if(get_option( $pre.'_show_switcher' ,true)) echo 'checked'; ?> />
+
+				<?php if(get_option( $pre.'_show_switcher' ,true)){
+					?>
+						<table>
+							<tr><td ><input type="text" name="<?php echo( $pre.'_live_title' ); ?>" value="<?php echo( get_option( $pre.'_live_title','live' ) ); ?>"></td><td><input type="text" name="<?php echo( $pre.'_live_url' ); ?>" value="<?php echo( get_option( $pre.'_live_url' ) ); ?>"></td></tr>
+							<tr><td><input type="text" name="<?php echo( $pre.'_stage_title' ); ?>" value="<?php echo( get_option( $pre.'_stage_title','stage' ) ); ?>"></td><td><input type="text" name="<?php echo( $pre.'_stage_url' ); ?>" value="<?php echo( get_option( $pre.'_stage_url' ) ); ?>"></td></tr>
+							<tr><td><input type="text" name="<?php echo( $pre.'_local_title' ); ?>" value="<?php echo( get_option( $pre.'_local_title','local' ) ); ?>"></td><td><input type="text" name="<?php echo( $pre.'_local_url' ); ?>" value="<?php echo( get_option( $pre.'_local_url' ) ); ?>"></td></tr>
+
+
+						</table>
+					<?php
+					} ?>
+
+				</td></tr>
+
+
+
+				<tr><td ><?php echo(__("Dags logo","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_dags_logo' ); ?>" type="checkbox" id="<?php echo( $pre.'_dags_logo' ); ?>" <?php if(get_option( $pre.'_dags_logo' ,true)) echo 'checked'; ?> /></td></tr>
+
+
+				<tr><td ><?php echo(__("Show IP","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_show_ip' ); ?>" type="checkbox" id="<?php echo( $pre.'_show_ip' ); ?>" <?php if(get_option( $pre.'_show_ip' ,true)) echo 'checked'; ?> /></td></tr>
+
+
+
+<tr><td colspan="2"><a href="javascript:$('#dags_tools_menus').toggle();">Remove Menus</a></td></tr>
+<tr><td ></td><td>
+
+<table id="dags_tools_menus" style="display: none;">
+<tr><td colspan="2">Remove Admin Top Bar</td></tr>
+
+				<tr><td ><?php echo(__("Comments","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_remove_comments' ); ?>" type="checkbox" id="<?php echo( $pre.'_remove_comments' ); ?>" <?php if(get_option( $pre.'_remove_comments' ,false)) echo 'checked'; ?> /></td></tr>
+				<tr><td ><?php echo(__("New Post","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_remove_new-post' ); ?>" type="checkbox" id="<?php echo( $pre.'_remove_new-post' ); ?>" <?php if(get_option( $pre.'_remove_new-post' ,false)) echo 'checked'; ?> /></td></tr>
+				<tr><td ><?php echo(__("New Link","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_remove_new-link' ); ?>" type="checkbox" id="<?php echo( $pre.'_remove_new-link' ); ?>" <?php if(get_option( $pre.'_remove_new-link' ,false)) echo 'checked'; ?> /></td></tr>
+				<tr><td ><?php echo(__("New Media","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_remove_new-media' ); ?>" type="checkbox" id="<?php echo( $pre.'_remove_new-media' ); ?>" <?php if(get_option( $pre.'_remove_new-media' ,false)) echo 'checked'; ?> /></td></tr>
+				<tr><td ><?php echo(__("New Page","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_remove_new-page' ); ?>" type="checkbox" id="<?php echo( $pre.'_remove_new-page' ); ?>" <?php if(get_option( $pre.'_remove_new-page' ,false)) echo 'checked'; ?> /></td></tr>
+				<tr><td ><?php echo(__("New User","dagsopt")) ?></td><td><input name="<?php echo( $pre.'_remove_new-user' ); ?>" type="checkbox" id="<?php echo( $pre.'_remove_new-user' ); ?>" <?php if(get_option( $pre.'_remove_new-user' ,false)) echo 'checked'; ?> /></td></tr>
+
+
+<tr><td colspan="2">Remove Admin Mode Bar</td></tr>
+	
+	<?php
+				foreach($this->gmenu as $id => $mm){
+					if(strstr($mm[2],"separator")){
+						continue;
+						}
+				?>
+				<tr><td ><?php echo($mm[0]) ?> </td><td><input name="<?php echo( $pre.'_remove_'.$mm[5] ); ?>" type="checkbox" id="<?php echo( $pre.'_remove_'.$mm[5] ); ?>" <?php if(get_option( $pre.'_remove_'.$mm[5] ,false)) echo 'checked'; ?> /> <?php echo($mm[5]); ?></td></tr>
+					
+
+<?php					
+					}
+					
+					?>
+
+
+</table>
+</td></tr>
+				</table>
+
+		  <?php
+		}
+
+	}
+
+	global $plug_admin_bar;
+	$plug_admin_bar = new plug_admin_bar($this);
+		$this->dagsopt['plug_admin_bar'] = $plug_admin_bar;
+
+}
+
+
+
+
+
+

+ 59 - 0
plug_body.php

@@ -0,0 +1,59 @@
+<?php
+
+if (!class_exists("plug_body")) {
+	class plug_body {	
+		function plug_body($ns) {
+			$this->title = __("Admin bar","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+
+		}
+		function start() {
+			add_filter('body_class', array(&$this,'extended_body_class') );
+		}
+
+		function extended_body_class($classes) {
+			global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
+			global $blogname;
+
+			if($is_lynx) $classes[] = 'lynx';
+			elseif($is_gecko) $classes[] = 'gecko';
+			elseif($is_opera) $classes[] = 'opera';
+			elseif($is_NS4) $classes[] = 'ns4';
+			elseif($is_safari) $classes[] = 'safari';
+			elseif($is_chrome) $classes[] = 'chrome';
+			elseif($is_IE) $classes[] = 'ie';
+			elseif($is_iphone) $classes[] = 'iphone';
+			else $classes[] = 'unknown';
+			
+			$classes[] = "site-".$blogname;
+			
+			return $classes;
+		}
+			function help(){
+				?>
+				add css classes like:
+				&gt;body class="... [lynx|gecko|opera|ns4|safari|chrome|ie|iphone|unknwon] site-$blogname"	
+				
+			<?php		
+			}
+	 
+	 
+	 	 	function admin_line(){
+		  ?>
+ 		  <?php  
+		}	
+	}
+
+	global $plug_body;
+	$plug_body = new plug_body($this);		
+			$this->dagsopt['plug_body'] = $plug_body;
+			
+}
+
+
+
+
+
+

+ 235 - 0
plug_color_admin_posts.php

@@ -0,0 +1,235 @@
+<?php
+
+
+
+
+
+if (!class_exists("plug_color_admin_posts")) {
+	class plug_color_admin_posts {	
+		private $options = array(); // Set $options in array
+		private $settings = array(); // Set $setting in array
+		var $hasform = true;
+		var $startet = false;
+		function plug_color_admin_posts() {
+			$this->title = __("Color admin posts","dagsopt");
+		}
+		function start(){
+			$this->startet = true;
+			add_action('admin_menu', array(&$this,'add_submenu'));
+			add_action('admin_init', array(&$this,'settings_api_init'));
+			$this->options = get_option('color_admin_posts');
+			add_action('admin_print_styles-edit.php', array(&$this,'load_color'));
+			add_action('admin_head', array(&$this,'load_farbtastic'));
+			if(!is_array(get_option('color_admin_posts'))) {$this->activate();}
+
+			
+			}
+		function activate() {
+			$options = array(
+				'color_draft' => '#FFFF99',
+				'color_pending' => '#87C5D6',
+				'color_published' => '#',
+				'color_future' => '#CCFF99',
+				'color_private' => '#FFCC99'
+			);
+			add_option('color_admin_posts', $options);
+		}
+		function deactivate() {
+			delete_option('color_admin_posts');
+		}
+		function load_color() {
+			$options = $this->options;
+			?>
+			<style>
+				.status-draft {
+					background-color: <?php echo$options['color_draft']; ?> !important;
+				}
+				
+				.status-future {
+					background-color: <?php echo$options['color_future']; ?> !important;
+				}
+				
+				.status-publish {
+					background-color: <?php echo$options['color_published']; ?> !important;
+				}
+				
+				.status-pending {
+					background-color: <?php echo$options['color_pending']; ?> !important;
+				}
+				
+				.status-private {
+					background-color: <?php echo$options['color_private']; ?> !important;
+				}
+			</style>
+			<?php
+		}
+		function load_farbtastic() {
+			global $current_screen;
+	// 		if($current_screen->id == 'appearance_page_color-admin-post') {
+				wp_enqueue_style('farbtastic');
+				wp_enqueue_script('farbtastic');
+	// 		}
+		}
+		function get_color_admin_post_settings() {
+			$this->settings['color_draft'] = array(
+				'title' => __('Drafts Posts', 'dagsopt')
+			);
+
+			$this->settings['color_pending'] = array(
+				'section' => 'general',
+				'title' => __('Pendings Posts', 'dagsopt')
+			);
+
+			$this->settings['color_published'] = array(
+				'title' => __('Published Posts', 'dagsopt')
+			);
+
+			$this->settings['color_future'] = array(
+				'title' => __('Futures Posts', 'dagsopt')
+			);
+
+			$this->settings['color_private'] = array(
+				'title' => __('Privates Posts', 'dagsopt')
+			);
+		}
+		function create_settings($args = array()) {
+			extract($args);
+			$field_args = array(
+				'id' => $id,
+				'label_for' => $id
+			);
+			add_settings_field($id, $title, array(
+				$this,
+				'display_settings'
+			), __FILE__, 'general', $field_args);
+		}
+		public function display_settings($args = array()) {
+			extract($args);
+			$options = $this->options;
+			echo '<input class="regular-text" type="text" maxlength="7" id="' . $id . '" name="color_admin_posts[' . $id . ']" value="' . esc_attr($options[$id]) . '" />
+				  <br /><span class="description">' . $desc . '</span>
+				  <div id="farbtastic-' . $id . '" class="farbtastic"></div>';
+		}
+		function settings_api_init() {
+			register_setting('color_admin_posts', 'color_admin_posts', array(
+				&$this,
+				'validate_settings'
+			));
+			add_settings_section('general', '', array(
+				&$this,
+				'general_section_callback'
+			), __FILE__);
+			// Get the configuration of fields
+			$this->get_color_admin_post_settings();
+			// Generate fields
+			foreach($this->settings as $id => $setting) {
+				$setting['id'] = $id;
+				$this->create_settings($setting);
+			}
+		}
+		function general_section_callback() {
+			echo '<p>' . __('Leave "#" for the default color.', 'dagsopt') . '</p>';
+		}
+		function validate_settings($input) {
+			$input['color_draft'] = (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $input['color_draft'])) ? $input['color_draft'] : '#';
+			$input['color_pending'] = (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $input['color_pending'])) ? $input['color_pending'] : '#';
+			$input['color_published'] = (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $input['color_published'])) ? $input['color_published'] : '#';
+			$input['color_future'] = (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $input['color_future'])) ? $input['color_future'] : '#';
+			$input['color_private'] = (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $input['color_private'])) ? $input['color_private'] : '#';
+			return $input;
+		}
+		function add_submenu() {
+			$page = 	add_submenu_page ( 'xwpplugins', __ (  "Color Admin Posts" ), __ ( "Color Admin Posts" ), 'edit_theme_options', 'color-admin-post', array ( &$this,'display_page' ) );
+		}
+		function display_page() {
+			// Check if user can access to the plugin
+			if(!current_user_can('administrator')) {
+				wp_die(__('You do not have sufficient permissions to access this page.', 'dagsopt'));
+			}
+			?>
+			<div class="wrap">
+				<div id="icon-options-general" class="icon32"></div>
+				<h2>Color Admin Posts</h2>
+				
+				<form id="form-color-admin-posts" method="post" action="options.php">
+					<?php
+					settings_fields('color_admin_posts');
+					do_settings_sections(__FILE__);
+					submit_button(__('Save Changes', 'dagsopt'));
+					?>
+				</form>
+				
+			</div>
+
+			<script type="text/javascript">
+				jQuery(function(){
+					jQuery(document).ready(function() {
+						jQuery('.regular-text').each(function() {
+							jQuery('#farbtastic-'+this.id).hide();
+							jQuery('#farbtastic-'+this.id).farbtastic(this);
+							jQuery(this).click(function(){
+								jQuery('#farbtastic-'+this.id).fadeIn();
+							});
+
+							jQuery(this).keyup(function() {
+								if( jQuery(this).val() == '' ) {
+									jQuery(this).val('#');
+								}
+							});
+						});
+
+						jQuery(document).mousedown(function() {
+							jQuery('.farbtastic').each(function() {
+								var display = jQuery('#'+this.id).css('display');
+								if ( display == 'block' ) {
+									jQuery('#'+this.id).fadeOut();
+								}
+							});
+						});
+					});
+				});
+			</script>
+			<?php
+		}
+
+
+	function help(){
+				?>
+				<?php echo(__("Adds colors to","dagsopt")) ?> <a href="/wp-admin/edit.php"><?php echo(__("Posts","dagsopt")) ?></a> <?php echo(__("and","dagsopt")) ?> <a href="/wp-admin/edit.php?post_type=page"><?php echo(__("Pages","dagsopt")) ?></a><br>
+
+				<?php echo($this->startet ? __('See below','dagsopt') : '');?>
+				
+			<?php		
+			}
+			
+			
+		function admin_line(){
+			
+		  ?>
+ 						<a href="/wp-admin/admin.php?page=color-admin-post"><?php echo(__("Settings","dagsopt")) ?></a>
+<?php
+$this->display_page();
+?>
+ 		  <?php  
+		  
+		}
+		
+		
+		
+		}
+	// Start this plugin once all other plugins are fully loaded
+
+
+
+
+	global $plug_color_admin_posts;
+	$plug_color_admin_posts = new plug_color_admin_posts();		
+		$this->dagsopt['plug_color_admin_posts'] = $plug_color_admin_posts;
+			
+}
+
+
+
+
+
+

+ 46 - 0
plug_custom_header.php

@@ -0,0 +1,46 @@
+<?php
+
+if (!class_exists("plug_custom_header")) {
+	class plug_custom_header {	
+		function plug_custom_header($ns) {
+			$this->title = __("Custom Header Code","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+			}
+		function start() {
+			add_action('wp_head',array(&$this,'header'),1);
+		}
+
+		function header() {
+			if(get_option($this->pluginname."_custom_header") == "on"){
+				$data = get_option($this->pluginname."_custom_header_data");
+					echo(	stripcslashes($data)	);
+				};
+		}
+		function help(){
+			?>
+			<?php echo(__("Adds code in the head ","dagsopt")) ?>
+		<?php		
+		}
+	 	function Option($pre){
+			update_option ( $pre.'_data', $_POST [ $pre.'_data' ] );
+ 		}
+	 	function admin_line($pre){
+		  ?>
+		  <?php echo(__("Custom data:","dagsopt")) ?><br><textarea name="<?php echo( $pre.'_data' ); ?>"><?php echo(stripcslashes(get_option($pre."_data"))); ?></textarea> <br>
+		  <?php  
+		}	
+	}
+
+	global $plug_custom_header;
+	$plug_custom_header = new plug_custom_header($this);		
+			$this->dagsopt['plug_custom_header'] = $plug_custom_header;
+			
+}
+
+
+
+
+
+

+ 66 - 0
plug_dashboard.php

@@ -0,0 +1,66 @@
+<?php
+
+if (!class_exists("plug_dashboard")) {
+	class plug_dashboard {	
+		function plug_dashboard($ns) {
+			$this->title = __("Dashboard","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+		}
+		function start(){
+			add_action( 'wp_dashboard_setup'	, array(&$this,'remove_dashboard_widgets'), 113 );
+			}
+	 
+		function remove_dashboard_widgets() {
+			remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
+			remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
+			remove_meta_box( 'dashboard_browser_nag', 'dashboard', 'normal' );
+			remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
+			remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
+			remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
+			remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
+		} 
+	
+		function Option($pre){
+			//update_option ( $pre.'_width', $_POST [ $pre.'_width' ] );
+			
+			
+ 		}
+ 		
+ 		function help(){
+				?>
+				<?php echo(__("Clean dashboard in admin mode","dagsopt")) ?><br>
+
+			<?php
+			}
+			
+ 
+	 	function admin_line($pre){
+		  ?>
+			
+
+		  <?php  
+		}	
+			
+	}
+
+/*
+function example_dashboard_widget_function() {
+	echo "Hello World, I'm a great Dashboard Widget";
+} 
+function example_add_dashboard_widgets() {
+	wp_add_dashboard_widget('example_dashboard_widget', 'Example Dashboard Widget', 'example_dashboard_widget_function');	
+} 
+add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );
+*/
+
+	global $plug_dashboard;
+	$plug_dashboard = new plug_dashboard($this);		
+	$this->dagsopt['plug_dashboard'] = $plug_dashboard;
+				
+}
+
+
+
+

+ 56 - 0
plug_footer.php

@@ -0,0 +1,56 @@
+<?php
+
+if (!class_exists("plug_footer")) {
+	class plug_footer {	
+		function plug_footer($ns) {
+			$this->title = __("Footer","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+			}
+		function start() {
+
+			add_action('wp_footer',array(&$this,'footer'),100);
+			
+
+
+		}
+
+		function footer() {
+			echo '<div id="dags-footer" class="container"><div class="row"><div class="pull-right">'.stripcslashes(get_option($this->pluginname."_footer_footer_html")).'</div></div></div>';
+		}
+ 
+
+
+			function help(){
+				?>
+				<?php echo(__("Adds html snippet in footer","dagsopt")) ?>
+				
+				
+			<?php		
+			}
+	 
+	 	function Option($pre){
+			update_option ( $pre.'_footer_html', $_POST [ $pre.'_footer_html' ] );
+ 		}
+ 
+	 	function admin_line($pre){
+		  ?>
+		  <?php echo(__("Footer html:","dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo( $pre.'_footer_html' ); ?>"><?php echo(stripcslashes(get_option($pre."_footer_html"))); ?></textarea>
+		  <?php  
+		}	
+		
+	 	 
+	}
+
+	global $plug_footer;
+	$plug_footer = new plug_footer($this);		
+			$this->dagsopt['plug_footer'] = $plug_footer;
+			
+}
+
+
+
+
+
+

+ 75 - 0
plug_google_analytics.php

@@ -0,0 +1,75 @@
+<?php
+
+if (!class_exists("plug_google_analytics")) {
+	class plug_google_analytics {	
+		function plug_google_analytics($ns) {
+			$this->title = __("Google Analytics","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+			}
+		function start() {
+
+			add_action('wp_footer',array(&$this,'footer'),100);
+			
+
+
+		}
+
+		function footer() {
+			$id = get_option($this->pluginname."_google_analytics_id");
+			if(!empty($id)){
+			?>
+		 <script type="text/javascript">
+		  var _gaq = _gaq || [];
+		  _gaq.push(['_setAccount', '<?php echo($id); ?>']);
+		  _gaq.push(['_setDomainName', '<?php echo(get_option($this->pluginname."_google_analytics_domain")); ?>']);
+		  _gaq.push(['_trackPageview']);
+		  (function() {
+			var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+		  })();
+		</script>
+<?php
+	}
+}
+
+			 
+				
+
+
+			function help(){
+				?>
+				<?php echo(__("Adds google analytics snippet in footer","dagsopt")) ?>
+				
+				
+			<?php		
+			}
+	 
+	 	function Option($pre){
+			update_option ( $pre.'_id', $_POST [ $pre.'_id' ] );
+			update_option ( $pre.'_domain', $_POST [ $pre.'_domain' ] );
+ 		}
+ 
+	 	function admin_line($pre){
+		  ?>
+		  <?php echo(__("Google Analytics ID:","dagsopt")) ?><br><input type="text" name="<?php echo( $pre.'_id' ); ?>" value="<?php echo(stripcslashes(get_option($pre."_id"))); ?>" > <br>
+		  <?php echo(__("Google Analytics Domain:","dagsopt")) ?><br><input type="text" name="<?php echo( $pre.'_domain' ); ?>" value="<?php echo(stripcslashes(get_option($pre."_domain"))); ?>" >
+		  <?php  
+		}	
+		
+	 	 
+	}
+
+	global $plug_google_analytics;
+	$plug_google_analytics = new plug_google_analytics($this);		
+			$this->dagsopt['plug_google_analytics'] = $plug_google_analytics;
+			
+}
+
+
+
+
+
+

+ 63 - 0
plug_login.php

@@ -0,0 +1,63 @@
+<?php
+
+if (!class_exists("plug_login")) {
+	class plug_login {	
+		function plug_login($ns) {
+			$this->title = __("Login","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+			}
+		function start() {
+
+			add_filter('login_headerurl',array(&$this,'login_headerurl'));
+			add_filter('login_headertitle',array(&$this,'login_headertitle'));
+			add_filter('login_message',array(&$this,'login_message'));
+		}
+
+
+			function login_headerurl($t){	return "https://dags.dk/";	}
+			function login_headertitle($t){	return "Dags dk";	}
+			function login_message($t){	
+				return '<style type="text/css"> 
+							.login h1 a  {padding-bottom: 5px; width: auto; height: 65px; background-size: auto; background-image: url(/wp-content/plugins/dagsplug/login_logo.png);} 
+							.login_holder {margin: 0px 0px 20px 0px; text-align: center}
+						</style>
+							<div class="login_holder">
+									<p>'.get_option($this->pluginname."_login_support_splash").'</p>
+							</div>';	
+				}
+				
+
+
+			function help(){
+				?>
+				<?php echo(__("Adds logo to login page","dagsopt")) ?>
+ 				<a href="/wp-login.php"><?php echo(__("Login page","dagsopt")) ?></a>
+			<?php		
+			}
+	 
+	 	function Option($pre){
+			update_option ( $pre.'_support_splash', $_POST [ $pre.'_support_splash' ] );
+ 		}
+ 
+	 	function admin_line($pre){
+		  ?>
+		  <?php echo(__("Login splash html:","dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo( $pre.'_support_splash' ); ?>"><?php echo(get_option($pre."_support_splash")); ?></textarea>
+		  <?php  
+		}	
+		
+	 	 
+	}
+
+	global $plug_login;
+	$plug_login = new plug_login($this);		
+			$this->dagsopt['plug_login'] = $plug_login;
+			
+}
+
+
+
+
+
+

+ 81 - 0
plug_post_thumbs.php

@@ -0,0 +1,81 @@
+<?php
+
+if (!class_exists("plug_post_thumbs")) {
+	class plug_post_thumbs {	
+		function plug_post_thumbs($ns) {
+			$this->title = __("Admin post thumbs","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+			add_image_size( 'admin-list-thumb', get_option($this->pluginname.'_post_thumbs_width',100 ), get_option($this->pluginname.'_post_thumbs_height',100 ), false );
+
+
+			add_theme_support( 'post-thumbnails' ); 
+
+			
+		}
+		function start(){
+ 			add_filter('manage_posts_columns',  array(&$this,'tcb_add_post_thumbnail_column'), 5);
+			add_filter('manage_pages_columns',  array(&$this,'tcb_add_post_thumbnail_column'), 5);
+			add_action('manage_posts_custom_column', array(&$this,'tcb_display_post_thumbnail_column'), 5, 2);
+			add_action('manage_pages_custom_column', array(&$this,'tcb_display_post_thumbnail_column'), 5, 2);
+	
+			}
+	 
+	 
+	 
+ 
+			function tcb_add_post_thumbnail_column($cols){
+			  $cols['tcb_post_thumb'] = __('Featured','dagsopt');
+			  return $cols;
+			}
+
+ 
+
+			 function tcb_display_post_thumbnail_column($col, $id){
+			  switch($col){
+				case 'tcb_post_thumb':
+				  if( function_exists('the_post_thumbnail') )
+					echo the_post_thumbnail( 'admin-list-thumb' );
+				  else
+					echo 'Not supported in theme';
+				  break;
+			  }
+			}
+
+				 
+		function Option($pre){
+			update_option ( $pre.'_width', $_POST [ $pre.'_width' ] );
+			update_option ( $pre.'_height', $_POST [ $pre.'_height' ] );
+	
+ 		}
+ 
+	 	function admin_line($pre){
+		  ?>
+			<table>
+			<tr><td><?php echo(__("Width:","dagsopt")) ?></td><td><input type="text" name="<?php echo( $pre.'_width' ) ?>" value="<?php echo( get_option( $pre.'_width',100 ) ) ?>"></td></tr>
+			<tr><td><?php echo(__("Height:","dagsopt")) ?></td><td><input type="text" name="<?php echo( $pre.'_height' ) ?>" value="<?php echo( get_option( $pre.'_height',100 ) ) ?>"></td></tr>
+			</table>		  
+		 
+		  <?php  
+		}	
+	}
+
+/*
+function example_dashboard_widget_function() {
+	echo "Hello World, I'm a great Dashboard Widget";
+} 
+function example_add_dashboard_widgets() {
+	wp_add_dashboard_widget('example_dashboard_widget', 'Example Dashboard Widget', 'example_dashboard_widget_function');	
+} 
+add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );
+*/
+
+	global $plug_post_thumbs;
+	$plug_post_thumbs = new plug_post_thumbs($this);		
+	$this->dagsopt['plug_post_thumbs'] = $plug_post_thumbs;
+				
+}
+
+
+

+ 289 - 0
plug_shortcodes.php

@@ -0,0 +1,289 @@
+<?php
+
+if (!class_exists("plug_shortcodes")) {
+	class plug_shortcodes {	
+		function plug_shortcodes($ns) {
+			$this->title = __("Misc Shortcodes","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+		}
+		function start() {
+			add_filter('the_content', array(&$this,'CSV_Parse'));
+
+			add_filter('the_content', array(&$this,'CSV_Parse2'));
+
+			add_shortcode( 'acc-page', array(&$this,'getpage') );
+
+
+
+		}
+
+
+
+function getpage( $atts ) {
+	extract( shortcode_atts( array(
+		'id' => 0
+	), $atts ) );
+	$s = "";
+
+	if($id!==0){
+		$page = get_page( $id );
+
+		$s .= '<div class="hbox embed-page page-id-'.$id.'" >';
+		$s .= '<div class="arrow">'.$page->post_title.'</div>';
+		$s .= '<div class="box">';
+		$s .= apply_filters('the_content',$page->post_content);
+		$s .= '</div>';
+		$s .= '</div>';
+	}
+
+
+	return $s;
+}
+
+
+ 
+	function CSV_Parse2($content) {
+			$content = preg_replace_callback("/\<a href=\'(.*).csv\'(.*)\>(.*)\<\/a\>/i", array(&$this,"CSV_Render2"), $content);
+			return $content;
+		}
+		
+function CSV_Render2($matches) {
+	//0 full 1 filename 2 attributes 3 title
+	
+	$filen = explode("/",$matches[1]);
+	$class = array_pop($filen);
+	$filen[] = $class;
+	$filen = implode("/",$filen).".csv";
+	$arguments = array();
+	$arguments['filename'] = $filen;
+	$arguments['class'] = "tablesorter ".$class;
+	$arguments['id'] = "".$class;
+	$arguments['title'] = "".$matches[3];
+	return $this->CSV_Render_($arguments);
+}
+
+		
+	function CSV_Render($matches) {
+		$matches[1] = str_replace(array('&#8221;','&#8243;'), '', $matches[1]);
+		preg_match_all('/(\w*)=(.*?)" /i', $matches[1], $attributes);
+		$arguments = array();
+		foreach ( (array) $attributes[1] as $key => $value ) {
+			$arguments[$value] = str_replace('"', '', $attributes[2][$key]);
+		}
+		if(!isset($arguments['filename']) || !is_file(ABSPATH.$arguments['filename'])){
+			return "csv error: filename ".ABSPATH.$arguments['filename']." not readable";
+		}
+		return $this->CSV_Render_($arguments);
+	}
+
+
+		function CSV_Parse($content) {
+			$content = preg_replace_callback("/\[\[csv ([^]]*)\/\]\]/i", array(&$this,"CSV_Render"), $content);
+			return $content;
+		}
+		
+
+
+
+function CSV_Render_($arguments) {
+
+	if(!isset($arguments['filename']) || !is_file(ABSPATH.$arguments['filename'])){
+		return "csv error: filename ".ABSPATH.$arguments['filename']." not readable";
+	}
+
+	$maxread = isset($arguments['read']) ? $arguments['read'] : (1024*1024*5);
+	$delimiter = isset($arguments['delimiter']) ? $arguments['delimiter'] : ',';
+	$quotechar = isset($arguments['quotechar']) ? $arguments['quotechar'] : '"';
+	$headers = isset($arguments['headers']) ? $arguments['headers'] : false;
+	$fields = isset($arguments['fields']) ? explode(",",$arguments['fields']) : false;
+
+	$tid = isset($arguments['id']) ? $arguments['id'] : 'mytable';
+	$class = isset($arguments['class']) ? $arguments['class'] : 'tablesorter';
+
+	$tables = array();
+
+	$rows = array();
+	$tmp = "";
+	$tmpheaders = array();
+	$handle = fopen(ABSPATH.$arguments['filename'], "r");
+	
+ 
+	
+	
+	while (($data = fgetcsv($handle, $maxread, $delimiter,$quotechar)) !== FALSE) {
+		
+		if(substr($data[0],0,1) == "!"){
+			$tables[] = array($tmp,$tmpheaders,$rows);
+			$rows = array();
+			$tmp = substr($data[0],1);
+
+			if($fields){
+				$tmpheaders = array();
+				$num = count($fields);
+ 				for ($c=0; $c < $num; $c++) {
+					$tmpheaders[] = $data[$fields[$c]];
+				}
+			}else{
+				array_shift($data);
+				$tmpheaders = $data;
+				//print_r($tmpheaders);
+				//die();
+			}
+ 			
+		}else{
+			if($fields){
+				$num = count($fields);
+				$obj = array();
+				for ($c=0; $c < $num; $c++) {
+					$obj[] = $data[$fields[$c]];
+				}
+				$rows[] = $obj;
+			}else{
+				$num = count($data);
+				$diff = count($tmpheaders) < $num ? $num - count($tmpheaders) : 0;
+				$obj = array();
+				for ($c=0; $c < $num; $c++) {
+					$obj[] = $data[$c+$diff];
+				}
+				$rows[] = $obj;
+			}
+		}
+	}
+
+	if($headers){
+		$tmpheaders = explode(",",$headers);
+	}else{
+		if(count($tmpheaders) == 0){
+			$tmpheaders = array_shift($rows);		
+		}
+	}
+	
+
+	$tables[] = array($tmp,$tmpheaders,$rows);
+	if(count($tables)>1){
+		array_shift($tables);
+		}
+	fclose($handle);
+
+
+	$sa = "";
+	$index = 0;
+	$menu = "";
+	foreach($tables as $table){
+		$title = $table[0];
+			$tt = explode("\n",$title);
+				if(count($tt)>1){
+						$title = array_shift($tt);
+						}
+
+		$menu .= '<li><a href="#'.$title.'">'.$title.'</a></li>';
+	}
+
+		$sa .=  '<ul id="'.$tid.'_menu" class="csvelement anchormenu">'.$menu.'</ul>';
+	
+	foreach($tables as $table){
+		$index ++;
+		
+		$title = $table[0];
+		$heads = $table[1];
+		$rows = $table[2];
+		
+				$hhe = "";
+				$tt = explode("\n",$title);
+				if(count($tt)>1){
+						$title = array_shift($tt);
+						$hhe .= '<h3>'.$title.'</a></h3>';
+						$hhe .= '<p>'.implode("<br>",$tt).'</p>';
+					}else{
+						$hhe .= '<h3>'.$title.'</h3>';
+						}
+
+
+			$sa .= '<a name="'.$title.'" class="anchor">&nbsp;</a>';
+		 
+			$sa .= '<div id="'.$tid.'_'.$index.'" class="csvelement '.$tid.'">';
+			$sa .= $hhe;
+			$sa .= '<table  class="'.$class.'">';
+			$sa .= '<thead><tr>';
+			$cols = count($heads);
+			for($y=0;$y<$cols;$y++){
+				$sa .= '<th class="col'.$y.'">';
+				$sa .= $heads[$y];
+				$sa .= '</th>';
+			}		
+			$sa .= '</tr></thead><tbody>';
+			for($i=0,$n=count($rows);$i<$n;$i++){
+				$row = $rows[$i];
+				if(strlen(join("",$row))==0){
+				}else{
+					$sa .= '<tr>';		
+					for($y=0;$y<$cols;$y++){
+						$sa .= '<td class="col'.$y.'">';
+						$tt = explode("\n",$row[$y]);
+						if(count($tt)>1){
+								$sa .= '<strong>'.array_shift($tt).'</strong><br>';
+							}
+						$sa .= implode("<br>",$tt);
+						$sa .= '</td>';
+					}
+					$sa .= '</tr>';
+				}
+			}
+			$sa .= '</tbody></table><div class="totoplink"><a href="#TOP">Top</a></div></div>';
+		}
+
+	
+	/*file_put_contents($cachefn,$sa);*/
+	
+	return $sa;
+	
+	
+}
+		
+		
+		
+		
+		
+		
+		
+		function help(){
+			?>
+
+	[csv filename="" read="" delimiter="," quotechar='"' headers=false fields=false id="mytable" class="tablesorter"] <br>
+	< a href='test.csv' >Title < /a >
+
+
+			 
+			
+		<?php		
+		}
+	 
+	 
+		function admin_line(){
+			?>
+ 		  <?php  
+		}	
+	}
+
+	global $plug_shortcodes;
+	$plug_shortcodes = new plug_shortcodes($this);		
+		$this->dagsopt['plug_shortcodes'] = $plug_shortcodes;
+	
+
+ 
+	
+	
+	
+	
+	
+	
+			
+}
+
+
+
+ 
+
+ 

+ 61 - 0
plug_styled_editor.php

@@ -0,0 +1,61 @@
+<?php
+
+if (!class_exists("plug_styled_editor")) {
+	class plug_styled_editor {	
+		function plug_styled_editor($ns) {
+			$this->title = __("Styled editor","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;			
+		}
+		function start(){
+			add_action('wp_enqueue_scripts', array(&$this,'tuts_mcekit_editor_enqueue'));  
+			add_filter('mce_css', array(&$this,'tuts_mcekit_editor_style'));  
+
+			}
+
+		function tuts_mcekit_editor_enqueue() {  
+		  $StyleUrl = plugin_dir_url(__FILE__).'editor-styles.css';  
+		  wp_enqueue_style( 'myCustomStyles', $StyleUrl );  
+		}  
+		function tuts_mcekit_editor_style($url) {  
+			if ( !empty($url) )  
+				$url .= ',';  
+			// Retrieves the plugin directory URL and adds editor stylesheet  
+			// Change the path here if using different directories  
+			//$url .= trailingslashit( plugin_dir_url(__FILE__) ) . '/editor-styles.css';  
+			$url .= trailingslashit( get_stylesheet_directory_uri() )  . 'css/bootstrap.css';  
+			$url .= ",".trailingslashit( get_stylesheet_directory_uri() )  . 'style.css';  
+			$url .= ",".trailingslashit( get_stylesheet_directory_uri() )  . 'css/custom.css';  
+
+			return $url;  
+		}  
+ 
+ 
+			function help(){
+				?>
+				<?php echo(__("Adds site css style in page & post wysiwyg editor","dagsopt")) ?>
+				
+				
+			<?php		
+			}
+			
+
+		 	function admin_line(){
+		  ?>
+		  <?php  
+		}	 
+	 
+	}
+
+	global $plug_styled_editor;
+	$plug_styled_editor = new plug_styled_editor($this);		
+		$this->dagsopt['plug_styled_editor'] = $plug_styled_editor;
+			
+}
+
+
+
+
+
+

+ 103 - 0
plug_update_plugin.php

@@ -0,0 +1,103 @@
+<?php
+
+if (!class_exists("plug_update_plugin")) {
+	class plug_update_plugin {	
+		function plug_update_plugin($ns) {
+			$this->title = __("Update plugin","dagsopt");
+
+		$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($ns->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']);
+		$this->status = 'Remote version: '.$version." URL: ".$url;
+		$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' => $url
+		);
+		$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=dagsopt-options&checkforupdates"><?php echo(__("Check for updates","dagsopt")) ?></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","dagsopt").'</a>');
+				}
+		  ?>
+		  
+		  
+		  <?php  
+		}
+	}
+
+	global $plug_update_plugin;
+	$plug_update_plugin = new plug_update_plugin($this);		
+	$this->dagsopt['plug_update_plugin'] = $plug_update_plugin;
+			
+}
+
+
+
+
+
+

+ 302 - 0
plug_widgets.php

@@ -0,0 +1,302 @@
+<?php
+
+if (!class_exists("plug_widgets")) {
+	class plug_widgets {	
+		function plug_widgets($ns) {
+			$this->title = __("Fancy Widgets","dagsopt");
+			$this->pluginname = $ns->pluginname;
+			$this->file = $ns->file;
+			$this->ns = $ns;
+			}
+		function start() {
+			if(get_option($this->pluginname."_widgets") == "on"){
+
+				add_action( 'widgets_init', create_function('', 'return register_widget("DisplayPageWidget");'		));
+				add_action( 'widgets_init', create_function('', 'return register_widget("dags_subpageswidget");' 	));
+				add_action( 'widgets_init', create_function('', 'return register_widget("DisplayPageChildrenWidget");'		));
+
+
+			}
+
+		}
+
+	 
+		function help(){
+			?>
+		<?php echo(__("Adds fancy widgets","dagsopt")) ?><br>
+			Display Page Widget<br>
+			Subpages Widget<br>
+			
+		<?php		
+		}
+	 	function Option($pre){
+			//update_option ( $pre.'_data', $_POST [ $pre.'_data' ] );
+ 		}
+	 	function admin_line($pre){
+		  ?>
+
+		  <?php  
+		}	
+	}
+
+	global $plug_widgets;
+	$plug_widgets = new plug_widgets($this);		
+			$this->dagsopt['plug_widgets'] = $plug_widgets;
+			
+}
+
+
+
+class DisplayPageChildrenWidget extends WP_Widget
+{
+  function DisplayPageChildrenWidget()
+  {
+    $widget_ops = array('classname' => 'DisplayPageChildrenWidget', 'description' => 'Show Page Children Widget' );
+    $this->WP_Widget('DisplayPageChildrenWidget', 'Page Children Widget', $widget_ops);
+  }
+ 
+  function form($instance)
+  {
+    $instance = wp_parse_args( (array) $instance, array( 'title' => '','page_id'=>'' ) );
+    $title = $instance['title'];
+    $pageid = $instance['page_id'];
+
+?>
+  <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
+<p><label for="<?php echo $this->get_field_id('page_id'); ?>">
+	Page: <?php wp_dropdown_pages(array('selected'         => $pageid,'name'=>$this->get_field_name('page_id') )); ?>
+	</label></p>
+	
+  
+<?php
+  }
+ 
+  function update($new_instance, $old_instance)
+  {
+    $instance = $old_instance;
+    $instance['title'] = $new_instance['title'];
+    $instance['page_id'] = $new_instance['page_id'];
+
+    return $instance;
+  }
+ 
+  function widget($args, $instance)
+  {
+    extract($args, EXTR_SKIP);
+ 
+    echo $before_widget;
+    $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
+ 
+    if (!empty($title))
+		echo $before_title . $title . $after_title;;
+
+
+		$args = array(
+			'depth'        => 0,
+			'show_date'    => '',
+			'date_format'  => get_option('date_format'),
+			'child_of'     => $instance['page_id'],
+			'exclude'      => '',
+			'include'      => '',
+			'title_li'     => '',
+			'echo'         => 1,
+			'authors'      => '',
+			'sort_column'  => 'menu_order, post_title',
+			'link_before'  => '',
+			'link_after'   => '',
+			'walker'       => '',
+			'post_type'    => 'page',
+			'post_status'  => 'publish' 
+		);
+
+			wp_list_pages( $args );
+ 
+/*		query_posts('post_type=page&post_parent='.$instance['page_id'].'&orderby=menu_order&order=ASC');
+
+		if (have_posts()) : 
+			while (have_posts()) : the_post();
+				echo "<li><a href='".get_permalink()."'>".get_the_title();
+				echo "</a></li>";	
+			endwhile;
+		endif; 
+		wp_reset_query();
+*/
+
+ 
+    echo $after_widget;
+  }
+ 
+}
+
+
+
+
+
+
+
+class DisplayPageWidget extends WP_Widget
+{
+  function DisplayPageWidget()
+  {
+    $widget_ops = array('classname' => 'DisplayPageWidget', 'description' => 'Show Page as Widget' );
+    $this->WP_Widget('DisplayPageWidget', 'Display Page Widget', $widget_ops);
+  }
+ 
+  function form($instance)
+  {
+    $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'page_id'=>'' ) );
+    $title = $instance['title'];
+    $pageid = $instance['page_id'];
+    
+?>
+  <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
+  <p><label for="<?php echo $this->get_field_id('page_id'); ?>">
+	Page: <?php wp_dropdown_pages(array('selected'         => $pageid,'name'=>$this->get_field_name('page_id') )); ?>
+	</label></p>
+<?php
+  }
+ 
+  function update($new_instance, $old_instance)
+  {
+    $instance = $old_instance;
+    $instance['title'] = $new_instance['title'];
+    $instance['page_id'] = $new_instance['page_id'];
+    return $instance;
+  }
+ 
+  function widget($args, $instance)
+  {
+    extract($args, EXTR_SKIP);
+ 
+    echo $before_widget;
+    $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
+ 
+    if (!empty($title))
+       echo $before_title . $title . $after_title;
+		$page = get_page( $instance['page_id'] );
+
+		echo('<div class="pw'.$instance['page_id'].'">');
+		echo apply_filters('the_content',$page->post_content);
+		echo('</div>');
+    echo $after_widget;
+  }
+ 
+}
+
+
+
+	 
+class dags_subpageswidget extends WP_Widget
+{
+	public function __construct() {
+		parent::__construct(
+	 		'dags_subpageswidget', // Base ID
+			'DAGS_subpageswidget', // Name
+			array( 'description' => __( 'Widget which shows child pages', 'dagsopt' ), ) // Args
+		);
+ 	}
+	public function widget( $args, $instance ) {
+		$child_of = 0 ;
+		if ( is_page() )
+			$child_of = get_the_ID() ;
+		
+		$childs = array(
+			'title_li' => '',
+			'child_of' => $child_of,
+			'depth' => 1,
+			'echo' => 0,
+			'exclude' => $instance['exclude']
+		) ;
+		
+		
+		$brothers = array_merge( $childs, array( 'child_of' => $GLOBALS['post']->post_parent ) ) ;
+		
+			$wp_list_pages = wp_list_pages($childs);
+
+			$page = $child_of;
+			$parent = $GLOBALS['post']->post_parent;
+			$grandparent = get_post( $parent)->post_parent;
+			
+			if($grandparent === 0){
+			}else{
+				$wp_list_pages = wp_list_pages($brothers);
+			}
+
+
+
+
+
+
+		
+		extract( $args );
+		$title = apply_filters( 'widget_title', $instance['title'] );
+
+		echo $before_widget;
+		
+		
+		if ( ! empty( $title ) )
+			echo $before_title . $title . $after_title;
+		
+		echo $wp_list_pages. $after_widget;
+		
+	}
+
+	 
+	public function update( $new_instance, $old_instance ) {
+		$instance = array();
+		$instance['title'] = strip_tags( $new_instance['title'] );
+		$instance['exclude'] = implode( ',', array_unique( array_filter( array_map( 'trim', preg_split( '/(\s)*,(\s)*/', $new_instance['exclude'] ) ), 'is_numeric' ) ) ) ;
+
+		return $instance;
+	}
+
+	 
+	public function form( $instance ) {
+		
+		$title = '' ;
+		if ( isset( $instance[ 'title' ] ) )
+			$title = $instance[ 'title' ];
+		
+		$exclude = '' ;
+		if ( isset( $instance[ 'exclude' ] ) )
+			$exclude = $instance[ 'exclude' ];
+		
+		$exclude_id = $this->get_field_id( 'exclude' ) ;
+		$select_name = $this->get_field_id( 'page_id' ) ;
+		
+		?>
+		<p>
+		<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( '<strong>Title</strong>:', 'dagsopt' ); ?></label> 
+		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
+		</p>
+		<p>
+		<label for="<?= $exclude_id ?>"><?php _e( '<strong>Exclude pages</strong>. Comma separated page ID values. Write:', 'dagsopt' ); ?></label> 
+		<input class="widefat" id="<?= $exclude_id ?>" name="<?php echo $this->get_field_name( 'exclude' ); ?>" type="text" value="<?php echo esc_attr( $exclude ); ?>" />
+		<br><?= __( ' or select: ', 'dagsopt' ) ?>
+		<?php wp_dropdown_pages( array( 'show_option_none' => __('-- select --', 'dagsopt'), 'name' => $select_name ) ) ; ?>
+		<br><a href="#<?= $exclude_id ?>" rel="#<?= $select_name ?>" onclick="return false" class="exclude"><?= __( 'Exclude selected', 'dagsopt' ) ?></a>
+		
+		<?php 
+	}
+	
+ 
+
+}
+
+	
+	
+	
+	
+	
+	
+ 
+ 
+
+ 
+ 
+
+
+
+
+
+

+ 240 - 0
plugin.php

@@ -0,0 +1,240 @@
+<?php
+/*
+ Plugin Name: dagsplug
+ Plugin URI: https://github.com/iskedk/WPPLUGINS/tree/master/dagsplug
+ Description: Tools 
+ Author: iskedk
+ Version: 2.98
+ Date: Fri Jan 31 2014 13:19:21 GMT+0100 (CET)
+ Author URI: https://iske.dk/
+ */
+
+$wp_dagsopt = new dagsopt ( );
+class dagsopt {
+	var $version = "2.98";
+	var $publish_date = "Fri Jan 31 2014 13:19:21 GMT+0100 (CET)";
+	var $pluginname;
+	var $plugintitle;
+	var $db;
+	var $filename = "";
+	var $update_check_url = "https://raw.github.com/iskedk/WPPLUGINS/master/dagsplug/version.txt";
+	var $readme_url = "https://github.com/iskedk/WPPLUGINS/tree/master/dagsplug";
+
+ 	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->dagsopt = 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' ));
+
+
+ 		$path = dirname($this->file)."/";
+		foreach (glob($path."plug_*.php") as $filename) {
+			$plugfile = str_replace($path,"",$filename);
+			include_once($plugfile);
+		}
+
+
+
+	 	foreach($this->dagsopt as $plugname => $plug){
+			$short = str_replace("plug_","",$plugname);
+			$vis = get_option($this->pluginname.'_'.$short,true);
+			if($vis){
+				$plug->start();
+			}
+		}
+
+
+
+
+		if ( current_user_can( 'manage_options' ) ) {
+		add_action( 'wp_before_admin_bar_render', array(&$this, 'mytheme_admin_bar_render' )  );
+
+		}
+
+
+
+
+	}
+
+
+		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' => 'dagsopt', // 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_style( 	$this->pluginname.'backend_style' );
+		   wp_enqueue_script(	$this->pluginname.'backend_script' );
+	}
+
+
+
+
+
+
+	function plugin_admin_menu() {
+		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') );
+	}
+	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','dagsopt') . '</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->dagsopt 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);
+			}
+
+		}
+			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() {
+		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 wppluginspage() {
+	include_once("wpplugins.php");
+}
+
+
+
+function dags_extras(){
+	global $wp_dagsopt;
+	$s = implode("\n",$wp_dagsopt->extras);
+	echo($s);
+	}
+
+
+
+
+/*
+ * END
+ * */
+

+ 141 - 0
pluginoptions.php

@@ -0,0 +1,141 @@
+<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="">
+		<table class="form-table">
+		 
+ 			
+		
+	 		</table>
+
+		<table class="form-table">
+		 <?php
+		 foreach($this->dagsopt as $plugname => $plug){
+			 
+			$short = str_replace("plug_","",$plugname);
+			$vis = get_option($this->pluginname.'_'.$short,true);
+			if($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></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><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></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><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','dagsopt') ?></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','dagsopt') ?></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','dagsopt') ?></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','dagsopt') ?></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','dagsopt') ?>" />
+		</p>
+	</form>
+
+
+		<table class="form-table">
+		 <?php
+		 foreach($this->dagsopt as $plugname => $plug){
+			$short = str_replace("plug_","",$plugname);
+			$vis = get_option($this->pluginname.'_'.$short,true);
+			if($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>

+ 35 - 0
script_backend.js

@@ -0,0 +1,35 @@
+var $ = jQuery;	
+ 
+
+	
+$(document).ready(function() {
+	//$("***").ttt();
+
+
+
+
+$('.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;       
+	});
+
+
+});
+
+
+
+
+ });
+
+
+

Diff do ficheiro suprimidas por serem muito extensas
+ 32 - 0
script_frontend.js


+ 15 - 0
style_backend.css

@@ -0,0 +1,15 @@
+
+
+body {
+}
+
+
+
+
+.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;
+}

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff