diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-04-06 09:28:37 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-04-06 09:28:37 +0200 |
commit | f7466e184a4a408d9237947b1fe15323d9c59348 (patch) | |
tree | 22d4bdf86d9f1f788e603c51b657912c21ad1346 | |
parent | 1c4207622ee0deb83aa759206fe56739b1c19918 (diff) | |
parent | 01189b0c2f9ae31de0702e87bd4c1cb30266a6c2 (diff) | |
download | gigologadmin-f7466e184a4a408d9237947b1fe15323d9c59348.tar.gz gigologadmin-f7466e184a4a408d9237947b1fe15323d9c59348.tar.bz2 gigologadmin-f7466e184a4a408d9237947b1fe15323d9c59348.zip |
Merge branch 'andreaschanges' into dev
-rw-r--r-- | giglogadmin.php | 3 | ||||
-rw-r--r-- | includes/css/main.css | 55 | ||||
-rw-r--r-- | includes/public/shortcodes/giglog_photographers.php | 18 |
3 files changed, 70 insertions, 6 deletions
diff --git a/giglogadmin.php b/giglogadmin.php index 8c040aa..37b9c49 100644 --- a/giglogadmin.php +++ b/giglogadmin.php @@ -125,6 +125,9 @@ if ( !class_exists( 'GiglogAdmin_Plugin' ) ) { register_activation_hook( __FILE__, array( 'GiglogAdmin_Plugin', 'activate' )); register_deactivation_hook( __FILE__, array( 'GiglogAdmin_Plugin', 'deactivate' )); + wp_register_style ( 'css_style', plugins_url ( '/includes/css/main.css', __FILE__ ) ); + wp_enqueue_style('css_style'); + GiglogAdmin_Plugin::init(); } diff --git a/includes/css/main.css b/includes/css/main.css new file mode 100644 index 0000000..5df024a --- /dev/null +++ b/includes/css/main.css @@ -0,0 +1,55 @@ +div.takenby { + background-color: #FFFFE0; + padding: 20px; + display: none; +} + +span.takenby:hover + div.takenby { + display: block; +} + +span.takenby +{ + color:red; +} + +.assignit input +{ + background:red; + font-size: small; + padding: none; + background: url('http://andreutza.biz/wordpress/wp-content/uploads/2021/01/checkedbox.png') no-repeat; + background-size: 20px 20px; + vertical-align: center; +} +.assignit +{ + padding: none !important; + font-size: small; + vertical-align: center; +} + +.unassignit input +{ + background:red; + font-size: small; + padding: none; + background: url('http://andreutza.biz/wordpress/wp-content/uploads/2021/01/redicon.png') no-repeat; + background-size: 20px 20px; + vertical-align: center; +} +.adminbuttons form +{ + display: flex; /* 2. display flex to the rescue */ + flex-direction: row; +} +.adminbuttons input +{ width: 80px; + background-image: none !important; + display: block;alignment-baseline +} +.adminbuttons +{ + padding: unset; + width: 80px; +}
\ No newline at end of file diff --git a/includes/public/shortcodes/giglog_photographers.php b/includes/public/shortcodes/giglog_photographers.php index cedfd13..efedc84 100644 --- a/includes/public/shortcodes/giglog_photographers.php +++ b/includes/public/shortcodes/giglog_photographers.php @@ -96,7 +96,7 @@ function giglogadmin_returnuser($p1, $c) $vquery0 = "select wpgcl_photo1 from wpg_concertlogs where wpgcl_concertid=".$c ; $results = $wpdb->get_results($vquery0); foreach ( $results AS $row ) $x= $row -> wpgcl_photo1; - if ($x !='' and $x!=$hf_username) { return ('Taken by '.$x); } + if ($x !='' and $x!=$hf_username) { return ('<span class="takenby">Taken</span><div class="takenby">Taken by '.$x.'</div>'); } else if ($x==$hf_username) //if current user return ('<form class="unassignit" method="POST" action=""> <input type="hidden" name="cid" value="' . $c. '" /><input type="hidden" name="pid" value="' . $p1. '" /><input type="submit" name="unassignitem" value=""/> @@ -111,7 +111,7 @@ function giglogadmin_returnuser($p1, $c) $vquery0 = "select wpgcl_photo2 from wpg_concertlogs where wpgcl_concertid=".$c ; $results = $wpdb->get_results($vquery0); foreach ( $results AS $row ) $x= $row -> wpgcl_photo2; - if ($x !='' and $x!=$hf_username) { return ('Taken by '.$x); } + if ($x !='' and $x!=$hf_username) { return ('<span class="takenby">Taken</span><div class="takenby">Taken by '.$x.'</div>'); } else if ($x==$hf_username) //if current user return ('<form class="unassignit" method="POST" action=""> <input type="hidden" name="cid" value="' . $c. '" /><input type="hidden" name="pid" value="' . $p1. '" /><input type="submit" name="unassignitem" value=""/> @@ -128,7 +128,7 @@ function giglogadmin_returnuser($p1, $c) $vquery0 = "select wpgcl_rev1 from wpg_concertlogs where wpgcl_concertid=".$c ; $results = $wpdb->get_results($vquery0); foreach ( $results AS $row ) $x= $row -> wpgcl_rev1; - if ($x !='' and $x!=$hf_username) { return ('Taken by '.$x); } + if ($x !='' and $x!=$hf_username) { ('<span class="takenby">Taken</span><div class="takenby">Taken by '.$x.'</div>'); } else if ($x==$hf_username) //if current user return ('<form class="unassignit" method="POST" action=""> <input type="hidden" name="cid" value="' . $c. '" /><input type="hidden" name="pid" value="' . $p1. '" /><input type="submit" name="unassignitem" value=""/> @@ -144,7 +144,7 @@ function giglogadmin_returnuser($p1, $c) $vquery0 = "select wpgcl_rev2 from wpg_concertlogs where wpgcl_concertid=".$c ; $results = $wpdb->get_results($vquery0); foreach ( $results AS $row ) $x= $row -> wpgcl_rev2; - if ($x !='' and $x!=$hf_username) { return ('Taken by '.$x); } + if ($x !='' and $x!=$hf_username) { ('<span class="takenby">Taken</span><div class="takenby">Taken by '.$x.'</div>'); } else if ($x==$hf_username) //if current user return ('<form class="unassignit" method="POST" action=""> <input type="hidden" name="cid" value="' . $c. '" /><input type="hidden" name="pid" value="' . $p1. '" /><input type="submit" name="unassignitem" value=""/> @@ -233,7 +233,10 @@ function giglogadmin_getconcertsphotog ( ) { $content .= '<tr class="assignithrow"> <th>CITY</th><th>BAND</th><th>VENUE</th><th>DATE</th><th> </th> <th>PHOTO1</th><th>PHOTO2</th><th>TEXT1</th><th>TEXT2</th> - <th>STATUS</th></tr>'; + <th>STATUS</th>' + if (current_user_can('administrator')) //($hf_username == 'etadmin') + $content .= '<th>AdminButtons</th>'; + $content .= '</tr>'; // Use the submitted "city" if any. Otherwise, use the default/static value. $cty= filter_input( INPUT_POST, 'selectcity' ); @@ -286,10 +289,13 @@ function giglogadmin_getconcertsphotog ( ) { $content .= '<td>'.giglogadmin_returnuser('rev1', $row->id ).'</td>'; $content .= '<td>'.giglogadmin_returnuser('rev2', $row->id ).'</td>'; $content .= '<td class="adminbuttons">'.$row -> wpgs_name; + $content .= '</td>'; if (current_user_can('administrator')) //($hf_username == 'etadmin') + { $content .= '<td class="adminbuttons">'; $content .= '<span><form method="POST" action=""> <input type="hidden" name="cid" value="' . $row->id. '" /><input type="submit" name="reqsent" value="REQSENT"/><input type="submit" name="phok" value="PHOK"/><input type="submit" name="txtok" value="TXOK"/><input type="submit" name="allok" value="ALLOK"/><input type="submit" name="rej" value="REJ"/> </form></span>'; - $content .= '</td>'; + $content .= '</td>'; + } $content .= '</tr>'; $lastType = $row->wpgvenue_city; } |