|
@@ -77,7 +77,17 @@ if (!class_exists("plug_admin_bar")) {
|
|
|
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'))));
|
|
|
+ $imageurl = get_option($this->pluginname . "_admin_bar_image", true);
|
|
|
+ if (!$imageurl) {
|
|
|
+ $imageurl = "/wp-content/plugins/dagsplug/logo.png";
|
|
|
+ }
|
|
|
+ if (is_admin()) {
|
|
|
+ $wp_admin_bar->add_menu(array('id' => 'dags-logo', 'title' => '<img src="' . $imageurl . '" style="margin-top: 4px; height: 24px; background-color: #ffff00;">', 'href' => '/', 'meta' => array('title' => __('Home', 'dagsopt'))));
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $wp_admin_bar->add_menu(array('id' => 'dags-logo', 'title' => '<img src="' . $imageurl . '" style="margin-top: 4px; height: 24px; background-color: #ffffff;">', 'href' => '/wp-admin/', 'meta' => array('title' => __('Home', 'dagsopt'))));
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
function bu_admin_link_remove_comments() {
|
|
@@ -87,8 +97,11 @@ if (!class_exists("plug_admin_bar")) {
|
|
|
|
|
|
function bu_admin_link_last() {
|
|
|
global $wp_admin_bar;
|
|
|
+
|
|
|
+ $wp_admin_bar->remove_node("wp-logo");
|
|
|
+
|
|
|
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')));
|
|
@@ -146,6 +159,8 @@ if (!class_exists("plug_admin_bar")) {
|
|
|
update_option($pre . '_local_title', $_POST[$pre . '_local_title']);
|
|
|
}
|
|
|
|
|
|
+ update_option($pre . '_image', $_POST[$pre . '_image']);
|
|
|
+
|
|
|
update_option($pre . '_dags_logo', $_POST[$pre . '_dags_logo']);
|
|
|
update_option($pre . '_show_ip', $_POST[$pre . '_show_ip']);
|
|
|
|
|
@@ -165,6 +180,7 @@ if (!class_exists("plug_admin_bar")) {
|
|
|
|
|
|
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';
|
|
@@ -190,7 +206,23 @@ if (!class_exists("plug_admin_bar")) {
|
|
|
<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>
|
|
|
+ ?> />
|
|
|
+
|
|
|
+
|
|
|
+ <div >
|
|
|
+ <div style="width: 300px; height: 100px; overflow: hidden">
|
|
|
+ <img height="100" src="<?php echo (stripslashes(get_option($pre . "_image"))); ?>">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <?php echo (__("Login image:", "dagsopt")) ?><br>
|
|
|
+ <input type="text" name="<?php echo ($pre . '_image'); ?>" class="valuereciever" value="<?php echo (stripslashes(get_option($pre . "_image"))); ?>" />
|
|
|
+
|
|
|
+ <button class="button uploadbutton">Upload</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </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)) {
|