Absolutely Glamorous Custom Admin - Version 1.5.1

Version Description

  • Added support for older PHP versions, starting from 5.2
Download this release

Release Info

Developer argonius
Plugin Icon 128x128 Absolutely Glamorous Custom Admin
Version 1.5.1
Comparing to
See all releases

Code changes from version 1.5 to 1.5.1

plugin.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: AG Custom Admin
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
- Author: Argonius
7
- Version: 1.5
8
- Author URI: http://www.argonius.com/
9
 
10
- Copyright 2015. Argonius (email : info@argonius.com)
11
 
12
  This program is free software: you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@ Author URI: http://www.argonius.com/
24
  */
25
 
26
  $agca = new AGCA();
27
-
28
  class AGCA{
29
  private $colorizer="";
30
  private $active_plugin;
@@ -60,7 +60,7 @@ class AGCA{
60
  /*Initialize properties*/
61
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
62
 
63
- $this->agca_version = "1.5";
64
 
65
  //TODO:upload images programmatically
66
 
@@ -1254,7 +1254,8 @@ class AGCA{
1254
 
1255
  function menu_item_cleartext($name){
1256
  if(strpos($name,' <span') !== false){
1257
- $name = explode(' <span', $name)[0];
 
1258
  }
1259
  $name = trim($name);
1260
  return $name;
@@ -1279,7 +1280,7 @@ class AGCA{
1279
 
1280
  //set default menu configuration
1281
  //and apply previously saved customizations
1282
- $m = [];
1283
  foreach($menu as $top){
1284
  $name = $top[0];
1285
  $url = $top[2];
@@ -1295,7 +1296,7 @@ class AGCA{
1295
  }
1296
 
1297
  //get submenu
1298
- $s = [];
1299
  if(isset($submenu[$url])){
1300
  $sitems = $submenu[$url];
1301
  foreach($sitems as $key=>$sub){
@@ -1303,12 +1304,12 @@ class AGCA{
1303
  $urlSub = $sub[2];
1304
  $removeSub = false;
1305
  $nameSub = $this->menu_item_cleartext($nameSub);
1306
- $s[$key]=[
1307
  'name'=>$nameSub,
1308
  'new'=>'',
1309
  'remove'=>$removeSub,
1310
  'url'=>$urlSub
1311
- ];
1312
 
1313
  if(isset($pc) && isset($pc['submenus'])){
1314
  $s[$key]['new'] = $pc['submenus'][$key]['new'];
@@ -1324,14 +1325,14 @@ class AGCA{
1324
  }
1325
  }
1326
 
1327
- $m[$url]=[
1328
  'name'=>$name,
1329
  'remove'=>$remove,
1330
  'new'=>'',
1331
  'url'=>$url,
1332
  'cls'=>$cls,
1333
  'submenus'=>$s
1334
- ];
1335
 
1336
  //apply previous top menu customizations
1337
  if($customizationsSet){
@@ -2012,27 +2013,27 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2012
  <table class="agca-clear form-table" width="500px">
2013
  <?php
2014
 
2015
- $this->print_checkbox([
2016
  'name'=>'agca_role_allbutadmin',
2017
  'label'=>'Exclude AGCA admin from customizations',
2018
  'title'=>'<h3>Applying customizations</h3><br><strong>Checked</strong> - apply to all users, except admin<br><strong>Not checked</strong> - apply to everyone</br></br><strong>Q</strong>: Who is AGCA administrator?</br><strong>A</strong>: Go to <i>Advanced</i> tab and change capability option to define administrators. Only the users with selected capability will be AGCA administrators.</br>'
2019
- ]);
2020
 
2021
  $this->print_options_h3('Pages');
2022
 
2023
- $this->print_checkbox([
2024
  'hide'=>true,
2025
  'name'=>'agca_screen_options_menu',
2026
  'label'=>'"Screen Options" menu',
2027
  'title'=>'Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)'
2028
- ]);
2029
 
2030
- $this->print_checkbox([
2031
  'hide'=>true,
2032
  'name'=>'agca_help_menu',
2033
  'label'=>'"Help" menu',
2034
  'title'=>'Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)'
2035
- ]);
2036
 
2037
  $this->print_options_h3('Security');
2038
 
@@ -2084,217 +2085,217 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2084
  <table class="form-table" width="500px">
2085
 
2086
  <?php
2087
- $this->print_checkbox([
2088
- 'attributes'=>[
2089
  'class'=>'ag_table_major_options',
2090
- ],
2091
  'hide'=>true,
2092
  'title'=>'Hides admin bar completely from the admin panel',
2093
  'name'=>'agca_header',
2094
  'label'=>'<strong>Admin bar</strong>',
2095
  'onchange'=>"if(jQuery('#agca_header').is(':checked')){jQuery('#agca_header_show_logout_content').show('slide');}else{jQuery('#agca_header_show_logout_content').hide('slide');};"
2096
- ]);
2097
 
2098
- $this->print_checkbox([
2099
- 'attributes'=>[
2100
  'class'=>'ag_table_major_options',
2101
  'id'=>'agca_header_show_logout_content',
2102
  'style'=>(get_option('agca_header')==true)?"":"display:none"
2103
- ],
2104
  'title'=>'Check this if you want to show Log Out button in top right corner of the admin page',
2105
  'name'=>'agca_header_show_logout',
2106
  'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2107
  'label'=>'<strong>(but show Log Out button)</strong>'
2108
- ]);
2109
 
2110
- $this->print_checkbox([
2111
  'title'=>'Removes admin bar customizations for authenticated users on site pages.</br>This option can be useful if you want to remove AGCA scripts (styles, JavaScript) on your website for any reason.',
2112
  'name'=>'agca_admin_bar_frontend',
2113
  'hide'=>true,
2114
  'label'=>'Site pages: Admin bar customizations'
2115
- ]);
2116
 
2117
- $this->print_checkbox([
2118
  'title'=>'Hides admin bar completely for authenticated users on site pages.',
2119
  'name'=>'agca_admin_bar_frontend_hide',
2120
  'hide'=>true,
2121
  'label'=>'Site pages: Admin bar'
2122
- ]);
2123
 
2124
  $this->print_options_h3('Left Side');
2125
 
2126
- $this->print_input([
2127
  'title'=>'Change default WordPress logo with custom image.',
2128
  'name'=>'agca_wp_logo_custom',
2129
  'label'=>'Admin bar logo',
2130
  'hint' =>'Image URL (maximum height is 28px)'
2131
- ]);
2132
 
2133
- $this->print_input([
2134
  'title'=>'Custom link on admin bar logo.</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL</br><strong>%SWITCH%</strong> - to switch betweent admin and site area',
2135
  'name'=>'agca_wp_logo_custom_link',
2136
  'label'=>'Admin bar logo link',
2137
  'hint' =>'Link'
2138
- ]);
2139
 
2140
- $this->print_input([
2141
  'title'=>'Customize WordPress title using custom title template.</br></br>Examples:</br><strong>%BLOG% -- %PAGE%</strong> (will be) <i>My Blog -- Add New Post</i></br><strong>%BLOG%</strong> (will be) <i>My Blog</i></br><strong>My Company > %BLOG% > %PAGE%</strong> (will be) <i>My Company > My Blog > Tools</i>',
2142
  'name'=>'agca_custom_title',
2143
  'label'=>'Page title template',
2144
  'hint' =>'Please use <strong>%BLOG%</strong> and <strong>%PAGE%</strong> in your title template.'
2145
- ]);
2146
 
2147
- $this->print_input([
2148
  'title'=>'Add custom image on the top of the admin content.',
2149
  'name'=>'agca_header_logo_custom',
2150
  'label'=>'Header image',
2151
  'hint' =>'Image URL'
2152
- ]);
2153
 
2154
 
2155
- $this->print_checkbox([
2156
  'hide'=>true,
2157
  'title'=>'Hides small Wordpress logo from the admin bar',
2158
  'name'=>'agca_header_logo',
2159
  'label'=>'WordPress logo'
2160
- ]);
2161
 
2162
- $this->print_checkbox([
2163
  'hide'=>true,
2164
  'title'=>'Hides WordPress context menu on WordPress logo icon from admin bar',
2165
  'name'=>'agca_remove_top_bar_dropdowns',
2166
  'label'=>'WordPress logo context menu'
2167
- ]);
2168
 
2169
- $this->print_checkbox([
2170
  'hide'=>true,
2171
  'title'=>'Hides site name link from the admin bar',
2172
  'name'=>'agca_remove_site_link',
2173
  'label'=>'Site name'
2174
- ]);
2175
 
2176
- $this->print_checkbox([
2177
  'hide'=>true,
2178
  'title'=>'Hides update notifications from admin bar',
2179
  'name'=>'agca_admin_bar_update_notifications',
2180
  'label'=>'Update notifications'
2181
- ]);
2182
 
2183
- $this->print_checkbox([
2184
  'hide'=>true,
2185
  'title'=>'Hides comments block from admin bar',
2186
  'name'=>'agca_admin_bar_comments',
2187
  'label'=>'"Comments" block'
2188
- ]);
2189
 
2190
- $this->print_checkbox([
2191
  'hide'=>true,
2192
- 'attributes'=>[
2193
  'style'=>'margin-top:20px;'
2194
- ],
2195
  'title'=>'Hides "+ New" block and its context menu from admin bar',
2196
  'name'=>'agca_admin_bar_new_content',
2197
  'label'=>'"+ New" block',
2198
  'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2199
  'input-class'=>'has-dependant dependant-opposite'
2200
- ]);
2201
 
2202
- $this->print_checkbox([
2203
  'hide'=>true,
2204
- 'attributes'=>[
2205
  'class'=>'new_content_header_submenu'
2206
- ],
2207
  'title'=>'Hides "Post" sub-menu from "+ New" block on admin bar',
2208
  'name'=>'agca_admin_bar_new_content_post',
2209
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Post sub-menu'
2210
- ]);
2211
 
2212
- $this->print_checkbox([
2213
  'hide'=>true,
2214
- 'attributes'=>[
2215
  'class'=>'new_content_header_submenu'
2216
- ],
2217
  'title'=>'Hides "Link" sub-menu from "+ New" block on admin bar',
2218
  'name'=>'agca_admin_bar_new_content_link',
2219
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Link sub-menu'
2220
- ]);
2221
 
2222
- $this->print_checkbox([
2223
  'hide'=>true,
2224
- 'attributes'=>[
2225
  'class'=>'new_content_header_submenu'
2226
- ],
2227
  'title'=>'Hides "Page" sub-menu from "+ New" block on admin bar',
2228
  'name'=>'agca_admin_bar_new_content_page',
2229
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Page sub-menu'
2230
- ]);
2231
 
2232
- $this->print_checkbox([
2233
  'hide'=>true,
2234
- 'attributes'=>[
2235
  'class'=>'new_content_header_submenu'
2236
- ],
2237
  'title'=>'Hides "User" sub-menu from "+ New" block on admin bar',
2238
  'name'=>'agca_admin_bar_new_content_user',
2239
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> User sub-menu'
2240
- ]);
2241
 
2242
- $this->print_checkbox([
2243
  'hide'=>true,
2244
- 'attributes'=>[
2245
  'class'=>'new_content_header_submenu'
2246
- ],
2247
  'title'=>'Hides "Media" sub-menu from "+ New" block on admin bar',
2248
  'name'=>'agca_admin_bar_new_content_media',
2249
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Media sub-menu'
2250
- ]);
2251
 
2252
- $this->print_checkbox([
2253
  'hide'=>true,
2254
  'title'=>'Hides "Admin themes" from admin bar',
2255
  'name'=>'agca_admin_bar_admin_themes',
2256
  'label'=>'"Admin themes"'
2257
- ]);
2258
 
2259
- $this->print_textarea([
2260
  'title'=>'Adds custom text in admin top bar.',
2261
  'name'=>'agca_custom_site_heading',
2262
  'label'=>'Custom blog heading',
2263
  'hint'=>"<strong>Tip: </strong>You can use HTML tags like &lt;h1&gt; or &lt;a&gt;"
2264
- ]);
2265
 
2266
 
2267
- $this->print_checkbox([
2268
  'hide'=>true,
2269
  'title'=>'Hides yellow bar with information about new WordPress release',
2270
  'name'=>'agca_update_bar',
2271
  'label'=>'Update WordPress notification'
2272
- ]);
2273
 
2274
  $this->print_options_h3('Right Side');
2275
 
2276
- $this->print_input([
2277
  'name'=>'agca_howdy',
2278
  'label'=>'Change Howdy text',
2279
- ]);
2280
 
2281
- $this->print_input([
2282
  'title'=>'Put \'Exit\', for example',
2283
  'name'=>'agca_logout',
2284
  'label'=>'Change Log out text',
2285
- ]);
2286
 
2287
- $this->print_checkbox([
2288
  'hide'=>true,
2289
  'name'=>'agca_remove_your_profile',
2290
  'label'=>'"Edit My Profile" option from dropdown menu'
2291
- ]);
2292
 
2293
- $this->print_checkbox([
2294
  'title'=>'If selected, hides all elements in top right corner, except Log Out button',
2295
  'name'=>'agca_logout_only',
2296
  'label'=>'Log out only'
2297
- ]);
2298
 
2299
  ?>
2300
 
@@ -2305,43 +2306,43 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2305
  <h2 class="section_title">Admin Footer Settings</h2>
2306
  <table class="form-table" width="500px">
2307
  <?php
2308
- $this->print_checkbox([
2309
  'hide'=>true,
2310
- 'attributes'=>[
2311
  'class'=>'ag_table_major_options'
2312
- ],
2313
  'title'=>'Hides footer with all elements',
2314
  'name'=>'agca_footer',
2315
  'label'=>'<strong>Footer</strong>'
2316
- ]);
2317
 
2318
  $this->print_options_h3('Footer Options');
2319
 
2320
- $this->print_checkbox([
2321
  'hide'=>true,
2322
  'title'=>'Hides default text in footer',
2323
  'name'=>'agca_footer_left_hide',
2324
  'label'=>'Footer text'
2325
- ]);
2326
 
2327
- $this->print_textarea([
2328
  'title'=>'Replaces text \'Thank you for creating with WordPress\' with custom text',
2329
  'name'=>'agca_footer_left',
2330
  'label'=>'Change footer text'
2331
- ]);
2332
 
2333
- $this->print_checkbox([
2334
  'hide'=>true,
2335
  'title'=>'Hides text \'Get Version ...\' on right',
2336
  'name'=>'agca_footer_right_hide',
2337
  'label'=>'Version text'
2338
- ]);
2339
 
2340
- $this->print_textarea([
2341
  'title'=>'Replaces text \'Get Version ...\' with custom text',
2342
  'name'=>'agca_footer_right',
2343
  'label'=>'Change version text'
2344
- ]);
2345
 
2346
  ?>
2347
 
@@ -2354,11 +2355,11 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2354
 
2355
  $this->print_options_h3('Dashboard Page Options');
2356
 
2357
- $this->print_input([
2358
  'title'=>"Main heading ('Dashboard') on Dashboard page",
2359
  'name'=>'agca_dashboard_text',
2360
  'label'=>'Change Dashboard heading text',
2361
- ]);
2362
 
2363
  ?>
2364
  <tr valign="center">
@@ -2380,47 +2381,47 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2380
  </td>
2381
  </tr>
2382
  <?php
2383
- $this->print_checkbox([
2384
  'hide'=>true,
2385
  'title'=>'Hides Welcome WordPress widget',
2386
  'name'=>'agca_dashboard_widget_welcome',
2387
  'label'=>'"Welcome" widget'
2388
- ]);
2389
 
2390
- $this->print_checkbox([
2391
  'hide'=>true,
2392
  'title'=>'Hides Activity dashboard widget',
2393
  'name'=>'agca_dashboard_widget_activity',
2394
  'label'=>'"Activity" widget'
2395
- ]);
2396
 
2397
- $this->print_checkbox([
2398
  'hide'=>true,
2399
  'title'=>'Hides Quick Draft dashboard widget',
2400
  'name'=>'agca_dashboard_widget_qp',
2401
  'label'=>'"Quick Draft" widget'
2402
- ]);
2403
 
2404
- $this->print_checkbox([
2405
  'hide'=>true,
2406
  'title'=>'Hides At a Glance dashboard widget',
2407
  'name'=>'agca_dashboard_widget_rn',
2408
  'label'=>'"At a Glance" widget'
2409
- ]);
2410
 
2411
- $this->print_checkbox([
2412
  'hide'=>true,
2413
  'name'=>'agca_dashboard_widget_primary',
2414
  'title'=>"This is 'WordPress News' or 'WordPress Development Blog' widget in older WordPress versions",
2415
  'label'=>'"WordPress News" widget'
2416
- ]);
2417
 
2418
- $this->print_checkbox([
2419
  'hide'=>true,
2420
  'name'=>'agca_dashboard_widget_secondary',
2421
  'title'=>"This is 'Other WordPress News' widget by default",
2422
  'label'=>'Secondary widget area'
2423
- ]);
2424
 
2425
  ?>
2426
  </table>
@@ -2432,86 +2433,86 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2432
 
2433
  $this->print_options_h3('Login Page Options');
2434
 
2435
- $this->print_checkbox([
2436
  'hide'=>true,
2437
  'name'=>'agca_login_banner',
2438
  'title'=>"Hide back to blog block",
2439
  'label'=>'Back to blog text'
2440
- ]);
2441
 
2442
- $this->print_textarea([
2443
  'name'=>'agca_login_banner_text',
2444
  'title'=>"Changes '<- Back to ...' text in top bar on Login page",
2445
  'label'=>'Change back to blog text',
2446
  'hint'=>'Should be wrapped with an anchor tag &lt;a&gt;&lt;/a&gt;'
2447
- ]);
2448
 
2449
- $this->print_input([
2450
  'title'=>'If this field is not empty, image from provided url will be visible on Login page',
2451
  'name'=>'agca_login_photo_url',
2452
  'label'=>'Change Login header image',
2453
  'hint'=>'Image URL'
2454
- ]);
2455
 
2456
- $this->print_input([
2457
  'title'=>'Put here custom link to a web location, that will be triggered on image click',
2458
  'name'=>'agca_login_photo_href',
2459
  'label'=>'Change link on login image',
2460
  'hint'=>'For blog URL use %BLOG%'
2461
- ]);
2462
 
2463
- $this->print_checkbox([
2464
  'hide'=>true,
2465
  'title'=>'Hides login image completely',
2466
  'name'=>'agca_login_photo_remove',
2467
  'label'=>'Login header image',
2468
- ]);
2469
 
2470
- $this->print_checkbox([
2471
  'title'=>'Rounds box on login page',
2472
  'name'=>'agca_login_round_box',
2473
  'label'=>'Round box corners',
2474
  'input-class'=>'has-dependant',
2475
  'input-attributes'=>'data-dependant="#agca_login_round_box_size_block"'
2476
- ]);
2477
 
2478
- $this->print_input([
2479
- 'attributes'=>[
2480
  'style'=> ((get_option('agca_login_round_box')=='true')?'display:none':''),
2481
  'id'=>'agca_login_round_box_size_block'
2482
- ],
2483
  'title'=>'Size of rounded box curve',
2484
  'name'=>'agca_login_round_box_size',
2485
  'label'=>'Round box corners - size',
2486
  'input-class'=>'validateNumber',
2487
  'suffix'=>'&nbsp;(px)'
2488
- ]);
2489
 
2490
- $this->print_checkbox([
2491
  'hide'=>true,
2492
  'title'=>'Hides register link on login page',
2493
  'name'=>'agca_login_register_remove',
2494
  'label'=>'Register link',
2495
  'input-class'=>'has-dependant dependant-opposite',
2496
  'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2497
- ]);
2498
 
2499
- $this->print_input([
2500
- 'attributes'=>[
2501
  'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2502
  'id'=>'agca_login_register_href_block'
2503
- ],
2504
  'title'=>'Change register link on login page to point to your custom registration page.',
2505
  'name'=>'agca_login_register_href',
2506
  'label'=>'Change register link',
2507
- ]);
2508
 
2509
- $this->print_checkbox([
2510
  'hide'=>true,
2511
  'title'=>'Hides lost password link on login page',
2512
  'name'=>'agca_login_lostpassword_remove',
2513
  'label'=>'Lost password link',
2514
- ]);
2515
  ?>
2516
  </table>
2517
  </div>
@@ -2596,66 +2597,66 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2596
  </tr>
2597
  <?php
2598
 
2599
- $this->print_checkbox([
2600
  'hide'=>true,
2601
  'title'=>'Removes empty space between some top menu items',
2602
  'name'=>'agca_admin_menu_separators',
2603
  'label'=>'Menu items separators',
2604
- ]);
2605
 
2606
- $this->print_checkbox([
2607
  'hide'=>true,
2608
  'title'=>'Removes icons from dmin menu buttons',
2609
  'name'=>'agca_admin_menu_icons',
2610
  'label'=>'Menu icons',
2611
- ]);
2612
 
2613
- $this->print_checkbox([
2614
  'hide'=>true,
2615
  'title'=>'Removes small arrow that appears on the top button hover',
2616
  'name'=>'agca_admin_menu_arrow',
2617
  'label'=>'Sub-menu arrow',
2618
- ]);
2619
 
2620
- $this->print_checkbox([
2621
  'hide'=>true,
2622
  'title'=>'Removes collapse button at the end of admin menu',
2623
  'name'=>'agca_admin_menu_collapse_button',
2624
  'label'=>'"Collapse menu" button',
2625
- ]);
2626
 
2627
- $this->print_checkbox([
2628
  'title'=>'Rounds submenu pop-up box',
2629
  'name'=>'agca_admin_menu_submenu_round',
2630
  'label'=>'Round sub-menu pop-up box',
2631
  'input-class'=>'has-dependant',
2632
- ]);
2633
 
2634
- $this->print_input([
2635
- 'attributes'=>[
2636
  'style'=> ((get_option('agca_admin_menu_submenu_round')=='true')?'display:none':''),
2637
  'id'=>'agca_admin_menu_submenu_round_block'
2638
- ],
2639
  'title'=>'Size of rounded box curve',
2640
  'name'=>'agca_admin_menu_submenu_round_size',
2641
  'label'=>'Round sub-menu pop-up box - size',
2642
  'input-class'=>'validateNumber',
2643
  'suffix'=>'&nbsp;(px)'
2644
- ]);
2645
 
2646
- $this->print_input([
2647
  'title'=>'Adds custom logo above the admin menu',
2648
  'name'=>'agca_admin_menu_brand',
2649
  'label'=>'Admin menu branding with logo',
2650
  'hint'=>'Image URL'
2651
- ]);
2652
 
2653
- $this->print_input([
2654
  'title'=>'Change branding logo link</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL',
2655
  'name'=>'agca_admin_menu_brand_link',
2656
  'label'=>'Branding logo link',
2657
  'hint'=>'Branding image URL'
2658
- ]);
2659
  ?>
2660
  </table>
2661
  </div>
3
  Plugin Name: AG Custom Admin
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
+ Author: WAP
7
+ Version: 1.5.1
8
+ Author URI: http://www.wordpressadminpanel.com/
9
 
10
+ Copyright 2015. WAP (email : info@wordpressadminpanel.com)
11
 
12
  This program is free software: you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License as published by
24
  */
25
 
26
  $agca = new AGCA();
27
+ //phpinfo();exit;
28
  class AGCA{
29
  private $colorizer="";
30
  private $active_plugin;
60
  /*Initialize properties*/
61
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
62
 
63
+ $this->agca_version = "1.5.1";
64
 
65
  //TODO:upload images programmatically
66
 
1254
 
1255
  function menu_item_cleartext($name){
1256
  if(strpos($name,' <span') !== false){
1257
+ $parts = explode(' <span', $name);
1258
+ $name = $parts[0];
1259
  }
1260
  $name = trim($name);
1261
  return $name;
1280
 
1281
  //set default menu configuration
1282
  //and apply previously saved customizations
1283
+ $m = array();
1284
  foreach($menu as $top){
1285
  $name = $top[0];
1286
  $url = $top[2];
1296
  }
1297
 
1298
  //get submenu
1299
+ $s = array();
1300
  if(isset($submenu[$url])){
1301
  $sitems = $submenu[$url];
1302
  foreach($sitems as $key=>$sub){
1304
  $urlSub = $sub[2];
1305
  $removeSub = false;
1306
  $nameSub = $this->menu_item_cleartext($nameSub);
1307
+ $s[$key]=array(
1308
  'name'=>$nameSub,
1309
  'new'=>'',
1310
  'remove'=>$removeSub,
1311
  'url'=>$urlSub
1312
+ );
1313
 
1314
  if(isset($pc) && isset($pc['submenus'])){
1315
  $s[$key]['new'] = $pc['submenus'][$key]['new'];
1325
  }
1326
  }
1327
 
1328
+ $m[$url]=array(
1329
  'name'=>$name,
1330
  'remove'=>$remove,
1331
  'new'=>'',
1332
  'url'=>$url,
1333
  'cls'=>$cls,
1334
  'submenus'=>$s
1335
+ );
1336
 
1337
  //apply previous top menu customizations
1338
  if($customizationsSet){
2013
  <table class="agca-clear form-table" width="500px">
2014
  <?php
2015
 
2016
+ $this->print_checkbox(array(
2017
  'name'=>'agca_role_allbutadmin',
2018
  'label'=>'Exclude AGCA admin from customizations',
2019
  'title'=>'<h3>Applying customizations</h3><br><strong>Checked</strong> - apply to all users, except admin<br><strong>Not checked</strong> - apply to everyone</br></br><strong>Q</strong>: Who is AGCA administrator?</br><strong>A</strong>: Go to <i>Advanced</i> tab and change capability option to define administrators. Only the users with selected capability will be AGCA administrators.</br>'
2020
+ ));
2021
 
2022
  $this->print_options_h3('Pages');
2023
 
2024
+ $this->print_checkbox(array(
2025
  'hide'=>true,
2026
  'name'=>'agca_screen_options_menu',
2027
  'label'=>'"Screen Options" menu',
2028
  'title'=>'Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)'
2029
+ ));
2030
 
2031
+ $this->print_checkbox(array(
2032
  'hide'=>true,
2033
  'name'=>'agca_help_menu',
2034
  'label'=>'"Help" menu',
2035
  'title'=>'Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)'
2036
+ ));
2037
 
2038
  $this->print_options_h3('Security');
2039
 
2085
  <table class="form-table" width="500px">
2086
 
2087
  <?php
2088
+ $this->print_checkbox(array(
2089
+ 'attributes'=>array(
2090
  'class'=>'ag_table_major_options',
2091
+ ),
2092
  'hide'=>true,
2093
  'title'=>'Hides admin bar completely from the admin panel',
2094
  'name'=>'agca_header',
2095
  'label'=>'<strong>Admin bar</strong>',
2096
  'onchange'=>"if(jQuery('#agca_header').is(':checked')){jQuery('#agca_header_show_logout_content').show('slide');}else{jQuery('#agca_header_show_logout_content').hide('slide');};"
2097
+ ));
2098
 
2099
+ $this->print_checkbox(array(
2100
+ 'attributes'=>array(
2101
  'class'=>'ag_table_major_options',
2102
  'id'=>'agca_header_show_logout_content',
2103
  'style'=>(get_option('agca_header')==true)?"":"display:none"
2104
+ ),
2105
  'title'=>'Check this if you want to show Log Out button in top right corner of the admin page',
2106
  'name'=>'agca_header_show_logout',
2107
  'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2108
  'label'=>'<strong>(but show Log Out button)</strong>'
2109
+ ));
2110
 
2111
+ $this->print_checkbox(array(
2112
  'title'=>'Removes admin bar customizations for authenticated users on site pages.</br>This option can be useful if you want to remove AGCA scripts (styles, JavaScript) on your website for any reason.',
2113
  'name'=>'agca_admin_bar_frontend',
2114
  'hide'=>true,
2115
  'label'=>'Site pages: Admin bar customizations'
2116
+ ));
2117
 
2118
+ $this->print_checkbox(array(
2119
  'title'=>'Hides admin bar completely for authenticated users on site pages.',
2120
  'name'=>'agca_admin_bar_frontend_hide',
2121
  'hide'=>true,
2122
  'label'=>'Site pages: Admin bar'
2123
+ ));
2124
 
2125
  $this->print_options_h3('Left Side');
2126
 
2127
+ $this->print_input(array(
2128
  'title'=>'Change default WordPress logo with custom image.',
2129
  'name'=>'agca_wp_logo_custom',
2130
  'label'=>'Admin bar logo',
2131
  'hint' =>'Image URL (maximum height is 28px)'
2132
+ ));
2133
 
2134
+ $this->print_input(array(
2135
  'title'=>'Custom link on admin bar logo.</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL</br><strong>%SWITCH%</strong> - to switch betweent admin and site area',
2136
  'name'=>'agca_wp_logo_custom_link',
2137
  'label'=>'Admin bar logo link',
2138
  'hint' =>'Link'
2139
+ ));
2140
 
2141
+ $this->print_input(array(
2142
  'title'=>'Customize WordPress title using custom title template.</br></br>Examples:</br><strong>%BLOG% -- %PAGE%</strong> (will be) <i>My Blog -- Add New Post</i></br><strong>%BLOG%</strong> (will be) <i>My Blog</i></br><strong>My Company > %BLOG% > %PAGE%</strong> (will be) <i>My Company > My Blog > Tools</i>',
2143
  'name'=>'agca_custom_title',
2144
  'label'=>'Page title template',
2145
  'hint' =>'Please use <strong>%BLOG%</strong> and <strong>%PAGE%</strong> in your title template.'
2146
+ ));
2147
 
2148
+ $this->print_input(array(
2149
  'title'=>'Add custom image on the top of the admin content.',
2150
  'name'=>'agca_header_logo_custom',
2151
  'label'=>'Header image',
2152
  'hint' =>'Image URL'
2153
+ ));
2154
 
2155
 
2156
+ $this->print_checkbox(array(
2157
  'hide'=>true,
2158
  'title'=>'Hides small Wordpress logo from the admin bar',
2159
  'name'=>'agca_header_logo',
2160
  'label'=>'WordPress logo'
2161
+ ));
2162
 
2163
+ $this->print_checkbox(array(
2164
  'hide'=>true,
2165
  'title'=>'Hides WordPress context menu on WordPress logo icon from admin bar',
2166
  'name'=>'agca_remove_top_bar_dropdowns',
2167
  'label'=>'WordPress logo context menu'
2168
+ ));
2169
 
2170
+ $this->print_checkbox(array(
2171
  'hide'=>true,
2172
  'title'=>'Hides site name link from the admin bar',
2173
  'name'=>'agca_remove_site_link',
2174
  'label'=>'Site name'
2175
+ ));
2176
 
2177
+ $this->print_checkbox(array(
2178
  'hide'=>true,
2179
  'title'=>'Hides update notifications from admin bar',
2180
  'name'=>'agca_admin_bar_update_notifications',
2181
  'label'=>'Update notifications'
2182
+ ));
2183
 
2184
+ $this->print_checkbox(array(
2185
  'hide'=>true,
2186
  'title'=>'Hides comments block from admin bar',
2187
  'name'=>'agca_admin_bar_comments',
2188
  'label'=>'"Comments" block'
2189
+ ));
2190
 
2191
+ $this->print_checkbox(array(
2192
  'hide'=>true,
2193
+ 'attributes'=>array(
2194
  'style'=>'margin-top:20px;'
2195
+ ),
2196
  'title'=>'Hides "+ New" block and its context menu from admin bar',
2197
  'name'=>'agca_admin_bar_new_content',
2198
  'label'=>'"+ New" block',
2199
  'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2200
  'input-class'=>'has-dependant dependant-opposite'
2201
+ ));
2202
 
2203
+ $this->print_checkbox(array(
2204
  'hide'=>true,
2205
+ 'attributes'=>array(
2206
  'class'=>'new_content_header_submenu'
2207
+ ),
2208
  'title'=>'Hides "Post" sub-menu from "+ New" block on admin bar',
2209
  'name'=>'agca_admin_bar_new_content_post',
2210
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Post sub-menu'
2211
+ ));
2212
 
2213
+ $this->print_checkbox(array(
2214
  'hide'=>true,
2215
+ 'attributes'=>array(
2216
  'class'=>'new_content_header_submenu'
2217
+ ),
2218
  'title'=>'Hides "Link" sub-menu from "+ New" block on admin bar',
2219
  'name'=>'agca_admin_bar_new_content_link',
2220
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Link sub-menu'
2221
+ ));
2222
 
2223
+ $this->print_checkbox(array(
2224
  'hide'=>true,
2225
+ 'attributes'=>array(
2226
  'class'=>'new_content_header_submenu'
2227
+ ),
2228
  'title'=>'Hides "Page" sub-menu from "+ New" block on admin bar',
2229
  'name'=>'agca_admin_bar_new_content_page',
2230
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Page sub-menu'
2231
+ ));
2232
 
2233
+ $this->print_checkbox(array(
2234
  'hide'=>true,
2235
+ 'attributes'=>array(
2236
  'class'=>'new_content_header_submenu'
2237
+ ),
2238
  'title'=>'Hides "User" sub-menu from "+ New" block on admin bar',
2239
  'name'=>'agca_admin_bar_new_content_user',
2240
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> User sub-menu'
2241
+ ));
2242
 
2243
+ $this->print_checkbox(array(
2244
  'hide'=>true,
2245
+ 'attributes'=>array(
2246
  'class'=>'new_content_header_submenu'
2247
+ ),
2248
  'title'=>'Hides "Media" sub-menu from "+ New" block on admin bar',
2249
  'name'=>'agca_admin_bar_new_content_media',
2250
  'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Media sub-menu'
2251
+ ));
2252
 
2253
+ $this->print_checkbox(array(
2254
  'hide'=>true,
2255
  'title'=>'Hides "Admin themes" from admin bar',
2256
  'name'=>'agca_admin_bar_admin_themes',
2257
  'label'=>'"Admin themes"'
2258
+ ));
2259
 
2260
+ $this->print_textarea(array(
2261
  'title'=>'Adds custom text in admin top bar.',
2262
  'name'=>'agca_custom_site_heading',
2263
  'label'=>'Custom blog heading',
2264
  'hint'=>"<strong>Tip: </strong>You can use HTML tags like &lt;h1&gt; or &lt;a&gt;"
2265
+ ));
2266
 
2267
 
2268
+ $this->print_checkbox(array(
2269
  'hide'=>true,
2270
  'title'=>'Hides yellow bar with information about new WordPress release',
2271
  'name'=>'agca_update_bar',
2272
  'label'=>'Update WordPress notification'
2273
+ ));
2274
 
2275
  $this->print_options_h3('Right Side');
2276
 
2277
+ $this->print_input(array(
2278
  'name'=>'agca_howdy',
2279
  'label'=>'Change Howdy text',
2280
+ ));
2281
 
2282
+ $this->print_input(array(
2283
  'title'=>'Put \'Exit\', for example',
2284
  'name'=>'agca_logout',
2285
  'label'=>'Change Log out text',
2286
+ ));
2287
 
2288
+ $this->print_checkbox(array(
2289
  'hide'=>true,
2290
  'name'=>'agca_remove_your_profile',
2291
  'label'=>'"Edit My Profile" option from dropdown menu'
2292
+ ));
2293
 
2294
+ $this->print_checkbox(array(
2295
  'title'=>'If selected, hides all elements in top right corner, except Log Out button',
2296
  'name'=>'agca_logout_only',
2297
  'label'=>'Log out only'
2298
+ ));
2299
 
2300
  ?>
2301
 
2306
  <h2 class="section_title">Admin Footer Settings</h2>
2307
  <table class="form-table" width="500px">
2308
  <?php
2309
+ $this->print_checkbox(array(
2310
  'hide'=>true,
2311
+ 'attributes'=>array(
2312
  'class'=>'ag_table_major_options'
2313
+ ),
2314
  'title'=>'Hides footer with all elements',
2315
  'name'=>'agca_footer',
2316
  'label'=>'<strong>Footer</strong>'
2317
+ ));
2318
 
2319
  $this->print_options_h3('Footer Options');
2320
 
2321
+ $this->print_checkbox(array(
2322
  'hide'=>true,
2323
  'title'=>'Hides default text in footer',
2324
  'name'=>'agca_footer_left_hide',
2325
  'label'=>'Footer text'
2326
+ ));
2327
 
2328
+ $this->print_textarea(array(
2329
  'title'=>'Replaces text \'Thank you for creating with WordPress\' with custom text',
2330
  'name'=>'agca_footer_left',
2331
  'label'=>'Change footer text'
2332
+ ));
2333
 
2334
+ $this->print_checkbox(array(
2335
  'hide'=>true,
2336
  'title'=>'Hides text \'Get Version ...\' on right',
2337
  'name'=>'agca_footer_right_hide',
2338
  'label'=>'Version text'
2339
+ ));
2340
 
2341
+ $this->print_textarea(array(
2342
  'title'=>'Replaces text \'Get Version ...\' with custom text',
2343
  'name'=>'agca_footer_right',
2344
  'label'=>'Change version text'
2345
+ ));
2346
 
2347
  ?>
2348
 
2355
 
2356
  $this->print_options_h3('Dashboard Page Options');
2357
 
2358
+ $this->print_input(array(
2359
  'title'=>"Main heading ('Dashboard') on Dashboard page",
2360
  'name'=>'agca_dashboard_text',
2361
  'label'=>'Change Dashboard heading text',
2362
+ ));
2363
 
2364
  ?>
2365
  <tr valign="center">
2381
  </td>
2382
  </tr>
2383
  <?php
2384
+ $this->print_checkbox(array(
2385
  'hide'=>true,
2386
  'title'=>'Hides Welcome WordPress widget',
2387
  'name'=>'agca_dashboard_widget_welcome',
2388
  'label'=>'"Welcome" widget'
2389
+ ));
2390
 
2391
+ $this->print_checkbox(array(
2392
  'hide'=>true,
2393
  'title'=>'Hides Activity dashboard widget',
2394
  'name'=>'agca_dashboard_widget_activity',
2395
  'label'=>'"Activity" widget'
2396
+ ));
2397
 
2398
+ $this->print_checkbox(array(
2399
  'hide'=>true,
2400
  'title'=>'Hides Quick Draft dashboard widget',
2401
  'name'=>'agca_dashboard_widget_qp',
2402
  'label'=>'"Quick Draft" widget'
2403
+ ));
2404
 
2405
+ $this->print_checkbox(array(
2406
  'hide'=>true,
2407
  'title'=>'Hides At a Glance dashboard widget',
2408
  'name'=>'agca_dashboard_widget_rn',
2409
  'label'=>'"At a Glance" widget'
2410
+ ));
2411
 
2412
+ $this->print_checkbox(array(
2413
  'hide'=>true,
2414
  'name'=>'agca_dashboard_widget_primary',
2415
  'title'=>"This is 'WordPress News' or 'WordPress Development Blog' widget in older WordPress versions",
2416
  'label'=>'"WordPress News" widget'
2417
+ ));
2418
 
2419
+ $this->print_checkbox(array(
2420
  'hide'=>true,
2421
  'name'=>'agca_dashboard_widget_secondary',
2422
  'title'=>"This is 'Other WordPress News' widget by default",
2423
  'label'=>'Secondary widget area'
2424
+ ));
2425
 
2426
  ?>
2427
  </table>
2433
 
2434
  $this->print_options_h3('Login Page Options');
2435
 
2436
+ $this->print_checkbox(array(
2437
  'hide'=>true,
2438
  'name'=>'agca_login_banner',
2439
  'title'=>"Hide back to blog block",
2440
  'label'=>'Back to blog text'
2441
+ ));
2442
 
2443
+ $this->print_textarea(array(
2444
  'name'=>'agca_login_banner_text',
2445
  'title'=>"Changes '<- Back to ...' text in top bar on Login page",
2446
  'label'=>'Change back to blog text',
2447
  'hint'=>'Should be wrapped with an anchor tag &lt;a&gt;&lt;/a&gt;'
2448
+ ));
2449
 
2450
+ $this->print_input(array(
2451
  'title'=>'If this field is not empty, image from provided url will be visible on Login page',
2452
  'name'=>'agca_login_photo_url',
2453
  'label'=>'Change Login header image',
2454
  'hint'=>'Image URL'
2455
+ ));
2456
 
2457
+ $this->print_input(array(
2458
  'title'=>'Put here custom link to a web location, that will be triggered on image click',
2459
  'name'=>'agca_login_photo_href',
2460
  'label'=>'Change link on login image',
2461
  'hint'=>'For blog URL use %BLOG%'
2462
+ ));
2463
 
2464
+ $this->print_checkbox(array(
2465
  'hide'=>true,
2466
  'title'=>'Hides login image completely',
2467
  'name'=>'agca_login_photo_remove',
2468
  'label'=>'Login header image',
2469
+ ));
2470
 
2471
+ $this->print_checkbox(array(
2472
  'title'=>'Rounds box on login page',
2473
  'name'=>'agca_login_round_box',
2474
  'label'=>'Round box corners',
2475
  'input-class'=>'has-dependant',
2476
  'input-attributes'=>'data-dependant="#agca_login_round_box_size_block"'
2477
+ ));
2478
 
2479
+ $this->print_input(array(
2480
+ 'attributes'=>array(
2481
  'style'=> ((get_option('agca_login_round_box')=='true')?'display:none':''),
2482
  'id'=>'agca_login_round_box_size_block'
2483
+ ),
2484
  'title'=>'Size of rounded box curve',
2485
  'name'=>'agca_login_round_box_size',
2486
  'label'=>'Round box corners - size',
2487
  'input-class'=>'validateNumber',
2488
  'suffix'=>'&nbsp;(px)'
2489
+ ));
2490
 
2491
+ $this->print_checkbox(array(
2492
  'hide'=>true,
2493
  'title'=>'Hides register link on login page',
2494
  'name'=>'agca_login_register_remove',
2495
  'label'=>'Register link',
2496
  'input-class'=>'has-dependant dependant-opposite',
2497
  'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2498
+ ));
2499
 
2500
+ $this->print_input(array(
2501
+ 'attributes'=>array(
2502
  'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2503
  'id'=>'agca_login_register_href_block'
2504
+ ),
2505
  'title'=>'Change register link on login page to point to your custom registration page.',
2506
  'name'=>'agca_login_register_href',
2507
  'label'=>'Change register link',
2508
+ ));
2509
 
2510
+ $this->print_checkbox(array(
2511
  'hide'=>true,
2512
  'title'=>'Hides lost password link on login page',
2513
  'name'=>'agca_login_lostpassword_remove',
2514
  'label'=>'Lost password link',
2515
+ ));
2516
  ?>
2517
  </table>
2518
  </div>
2597
  </tr>
2598
  <?php
2599
 
2600
+ $this->print_checkbox(array(
2601
  'hide'=>true,
2602
  'title'=>'Removes empty space between some top menu items',
2603
  'name'=>'agca_admin_menu_separators',
2604
  'label'=>'Menu items separators',
2605
+ ));
2606
 
2607
+ $this->print_checkbox(array(
2608
  'hide'=>true,
2609
  'title'=>'Removes icons from dmin menu buttons',
2610
  'name'=>'agca_admin_menu_icons',
2611
  'label'=>'Menu icons',
2612
+ ));
2613
 
2614
+ $this->print_checkbox(array(
2615
  'hide'=>true,
2616
  'title'=>'Removes small arrow that appears on the top button hover',
2617
  'name'=>'agca_admin_menu_arrow',
2618
  'label'=>'Sub-menu arrow',
2619
+ ));
2620
 
2621
+ $this->print_checkbox(array(
2622
  'hide'=>true,
2623
  'title'=>'Removes collapse button at the end of admin menu',
2624
  'name'=>'agca_admin_menu_collapse_button',
2625
  'label'=>'"Collapse menu" button',
2626
+ ));
2627
 
2628
+ $this->print_checkbox(array(
2629
  'title'=>'Rounds submenu pop-up box',
2630
  'name'=>'agca_admin_menu_submenu_round',
2631
  'label'=>'Round sub-menu pop-up box',
2632
  'input-class'=>'has-dependant',
2633
+ ));
2634
 
2635
+ $this->print_input(array(
2636
+ 'attributes'=>array(
2637
  'style'=> ((get_option('agca_admin_menu_submenu_round')=='true')?'display:none':''),
2638
  'id'=>'agca_admin_menu_submenu_round_block'
2639
+ ),
2640
  'title'=>'Size of rounded box curve',
2641
  'name'=>'agca_admin_menu_submenu_round_size',
2642
  'label'=>'Round sub-menu pop-up box - size',
2643
  'input-class'=>'validateNumber',
2644
  'suffix'=>'&nbsp;(px)'
2645
+ ));
2646
 
2647
+ $this->print_input(array(
2648
  'title'=>'Adds custom logo above the admin menu',
2649
  'name'=>'agca_admin_menu_brand',
2650
  'label'=>'Admin menu branding with logo',
2651
  'hint'=>'Image URL'
2652
+ ));
2653
 
2654
+ $this->print_input(array(
2655
  'title'=>'Change branding logo link</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL',
2656
  'name'=>'agca_admin_menu_brand_link',
2657
  'label'=>'Branding logo link',
2658
  'hint'=>'Branding image URL'
2659
+ ));
2660
  ?>
2661
  </table>
2662
  </div>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === AG Custom Admin ===
2
- Contributors: argonius
3
  Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
  Tested up to: 4.4
7
- Stable tag: 1.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -152,6 +152,9 @@ If you have found that something is not working correctly, and you have the late
152
 
153
  == Changelog ==
154
 
 
 
 
155
  = 1.5 =
156
  * Improved UX with new icons and styles
157
  * Fixed admin menu issues when menu is updated outside of AGCA
@@ -448,6 +451,9 @@ If you have found that something is not working correctly, and you have the late
448
 
449
  == Upgrade Notice ==
450
 
 
 
 
451
  = 1.5 =
452
  * Improved UX with new icons and styles
453
  * Fixed admin menu issues when menu is updated outside of AGCA
1
  === AG Custom Admin ===
2
+ Contributors: wap
3
  Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
  Tested up to: 4.4
7
+ Stable tag: 1.5.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
152
 
153
  == Changelog ==
154
 
155
+ = 1.5.1 =
156
+ * Added support for older PHP versions, starting from 5.2
157
+
158
  = 1.5 =
159
  * Improved UX with new icons and styles
160
  * Fixed admin menu issues when menu is updated outside of AGCA
451
 
452
  == Upgrade Notice ==
453
 
454
+ = 1.5.1 =
455
+ * Added support for older PHP versions, starting from 5.2
456
+
457
  = 1.5 =
458
  * Improved UX with new icons and styles
459
  * Fixed admin menu issues when menu is updated outside of AGCA
trunk/ag-custom-admin.html ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head><title>WordPress Admin Themes - AG Custom Admin Plugin</title></head>
3
+ <body>
4
+ <h1><a href="http://wordpress.org/plugins/ag-custom-admin/">What is AG Custom Admin?</a></h1>
5
+ <p>AG Custom Admin is plugin for Wordpress that can be used for WordPress admin panel customizations. There are dozens of options available for customizations:</p>
6
+ <h2>Admin Bar Options</h2>
7
+ <ul>
8
+ <li>Hide admin bar completely</li>
9
+ <li>Hide admin bar on front end</li>
10
+ <li>Change admin bar logo and link</li>
11
+ <li>Hide admin bar WordPress logo</li>
12
+ <li>Add custom image in admin header</li>
13
+ <li>Add custom admin bar logo</li>
14
+ <li>Hide admin bar dropdown menus</li>
15
+ <li>Hide "New" dropdown items</li>
16
+ <li>Hide comments from admin bar</li>
17
+ <li>Hide updates from admin bar</li>
18
+ <li>Hide WordPress update notification bar</li>
19
+ <li>Hide default blog heading in admin bar</li>
20
+ <li>Change admin bar heading text</li>
21
+ <li>Hide Screen Options menu</li>
22
+ <li>Hide Help menu</li>
23
+ <li>Hide Favorite Actions</li>
24
+ <li>Change/remove Howdy text</li>
25
+ <li>Change Log out text</li>
26
+ <li>Log out button only</li>
27
+ </ul>
28
+
29
+ <h2>Admin Footer Options</h2>
30
+ <ul>
31
+ <li>Hide footer completely</li>
32
+ <li>Change/remove footer text</li>
33
+ <li>Change/remove footer version text</li>
34
+ </ul>
35
+
36
+ <h2>Dashboard Page Options</h2>
37
+ <ul>
38
+ <li>Hide Dashboard heading icon</li>
39
+ <li>Change Dashboard heading text</li>
40
+ <li>Add custom Dashboard content</li>
41
+ <li>Hide dashboard widgets</li>
42
+ </ul>
43
+
44
+ <h2>Login Page Options</h2>
45
+ <ul>
46
+ <li>Hide back to blog completely</li>
47
+ <li>Change login image </li>
48
+ <li>Change hyperlink on login image</li>
49
+ <li>Hide login image</li>
50
+ <li>Round corners on login boxes</li>
51
+ <li>Hide register and lost password links</li>
52
+ <li>Change hyperlink on register button</li>
53
+ </ul>
54
+
55
+ <h2>Admin Menu Options</h2>
56
+ <ul>
57
+ <li>Rename menu and submenu items</li>
58
+ <li>Remove menu and submenu items</li>
59
+ <li>Add new buttons with custom links</li>
60
+ <li>Remove icons from admin menu buttons</li>
61
+ <li>Remove spaces between admin menu buttons</li>
62
+ <li>Remove admin menu arrow on rollower</li>
63
+ <li>Round admin submenu popups </li>
64
+ <li>Add custom branding image above the admin menu</li>
65
+ <li>Add custom link to branding image</li>
66
+ <li>Admin menu auto-folding options for mobile devices</li>
67
+ </ul>
68
+
69
+ <h2>Colorizer</h2>
70
+ <ul>
71
+ <li>Change background and text colors on admin and login page </li>
72
+ <li>Change admin menu colors</li>
73
+ <li>Change widget colors</li>
74
+ </ul>
75
+
76
+ <h2>Advanced</h2>
77
+ <ul>
78
+ <li>Add custom CSS</li>
79
+ <li>Add custom JavaScript</li>
80
+ <li>Export/import customization settings</li>
81
+ </ul>
82
+ </br>
83
+ <h1><a href="http://wordpressadminpanel.com/themes/home">AG Custom Admin WordPress Themes</a></h1>
84
+ <p>From AGCA version 1.3 we introduce AG Custom Admin themes. With AGCA themes you can easily change your WordPress admin panel theme in matter of seconds!</p>
85
+ <p>Please check our <a href="http://wordpressadminpanel.com/themes/home">AG Custom Admin WordPress Themes</a> page for more info.</p>
86
+ </br>
87
+ <h1><a href="http://wordpressadminpanel.com/agca-support/">Support</a></h1>
88
+ <p>Please feel free to check our <a href="http://wordpressadminpanel.com/agca-support/">support page</a> in case you have found any issues with your AGCA or AGCA themes features.</p>
89
+ <p>Happy blogging!</p>
90
+ </br>
91
+ </br>
92
+ </body>
93
+ </html>
trunk/images/btn_donate_LG.gif ADDED
Binary file
trunk/licence.txt ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
trunk/plugin.php ADDED
@@ -0,0 +1,2904 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: AG Custom Admin
4
+ Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
+ Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
+ Author: WAP
7
+ Version: 1.5.1
8
+ Author URI: http://www.wordpressadminpanel.com/
9
+
10
+ Copyright 2015. WAP (email : info@wordpressadminpanel.com)
11
+
12
+ This program is free software: you can redistribute it and/or modify
13
+ it under the terms of the GNU General Public License as published by
14
+ the Free Software Foundation, either version 3 of the License, or
15
+ (at your option) any later version.
16
+
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+
22
+ You should have received a copy of the GNU General Public License
23
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
24
+ */
25
+
26
+ $agca = new AGCA();
27
+ //phpinfo();exit;
28
+ class AGCA{
29
+ private $colorizer="";
30
+ private $active_plugin;
31
+ private $agca_version;
32
+ private $agca_debug = false;
33
+ private $admin_capabilities;
34
+ private $context = "";
35
+ private $saveAfterImport = false;
36
+ private $templateCustomizations = "";
37
+ private $templates_ep = "http://wordpressadminpanel.com/configuration.php";
38
+ public function __construct()
39
+ {
40
+ $this->reloadScript();
41
+ $this->checkPOST();
42
+ $this->checkGET();
43
+
44
+ if(function_exists("add_filter")){
45
+ add_filter('admin_title', array(&$this,'change_title'), 10, 2);
46
+ add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
47
+ }
48
+
49
+ add_action('admin_init', array(&$this,'agca_register_settings'));
50
+ add_action('admin_init', array(&$this,'agca_init_session'));
51
+ add_action('admin_head', array(&$this,'print_admin_css'));
52
+ add_action('login_head', array(&$this,'print_login_head'));
53
+ add_action('admin_menu', array(&$this,'agca_create_menu'));
54
+ add_action('wp_head', array(&$this,'print_page'));
55
+ add_action( 'wp_before_admin_bar_render', array(&$this,'admin_bar_changes') );
56
+ register_deactivation_hook(__FILE__, array(&$this,'agca_deactivate'));
57
+
58
+ add_action( 'customize_controls_enqueue_scripts', array(&$this,'agca_customizer_php') );
59
+
60
+ /*Initialize properties*/
61
+ $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
62
+
63
+ $this->agca_version = "1.5.1";
64
+
65
+ //TODO:upload images programmatically
66
+
67
+ }
68
+ // Add donate and support information
69
+ function jk_filter_plugin_links($links, $file)
70
+ {
71
+ if ( $file == plugin_basename(__FILE__) )
72
+ {
73
+ $links[] = '<a href="tools.php?page=ag-custom-admin/plugin.php">' . __('Settings') . '</a>';
74
+ $links[] = '<a href="tools.php?page=ag-custom-admin/plugin.php#ag-templates">' . __('Admin Themes') . '</a>';
75
+ $links[] = '<a href="http://wordpressadminpanel.com/agca-support/">' . __('Support') . '</a>';
76
+ $links[] = '<a href="http://wordpressadminpanel.com/agca-support/support-for-future-development">' . __('Donate') . '</a>';
77
+ }
78
+ return $links;
79
+ }
80
+
81
+ function change_admin_color(){
82
+ return 'default';
83
+ }
84
+
85
+ function agca_customizer_php(){
86
+ $this->agca_get_includes();
87
+ }
88
+
89
+ function agca_init_session(){
90
+ if (!session_id())
91
+ session_start();
92
+ }
93
+
94
+ function checkGET(){
95
+ if(isset($_GET['agca_action'])){
96
+ if($_GET['agca_action'] =="remove_templates"){
97
+ $this->delete_template_images_all();
98
+ update_option('agca_templates', "");
99
+ update_option('agca_selected_template', "");
100
+ }
101
+ }
102
+ if(isset($_GET['agca_debug'])){
103
+ if($_GET['agca_debug'] =="true"){
104
+ $this->agca_debug = true;
105
+ }else{
106
+ $this->agca_debug = false;
107
+ }
108
+ }
109
+ }
110
+
111
+ function checkPOST(){
112
+
113
+ if(isset($_POST['_agca_save_template'])){
114
+ //print_r($_POST);
115
+ $data = $_POST['templates_data'];
116
+ $parts = explode("|||",$data);
117
+
118
+ $common_data = $parts [0];
119
+ $admin_js = $parts [1];
120
+ $admin_css = $parts [2];
121
+ $login_js = $parts [3];
122
+ $login_css = $parts [4];
123
+ $settings = $parts [5];
124
+ $images = $parts [6];
125
+
126
+ $template_name = $_POST['templates_name'];
127
+
128
+ update_option('agca_selected_template', $template_name);
129
+
130
+ $templates = get_option( 'agca_templates' );
131
+ if($templates == ""){
132
+ $templates = array();
133
+ }
134
+
135
+ $templates[$template_name] = array(
136
+ 'common'=>$common_data,
137
+ 'admin'=>"",
138
+ 'adminjs'=>$admin_js,
139
+ 'admincss'=>$admin_css,
140
+ 'login'=>"",
141
+ 'loginjs'=>$login_js,
142
+ 'logincss'=>$login_css,
143
+ 'images'=>$images,
144
+ 'settings'=>$settings
145
+ );
146
+ update_option('agca_templates', $templates);
147
+
148
+ $_POST = array();
149
+
150
+ }else if(isset($_POST['_agca_templates_session'])){
151
+ $this->agcaAdminSession();
152
+ if($_POST['template'] !="")
153
+ $_SESSION["AGCA"]["Templates"][$_POST['template']] = array("license"=>$_POST['license']);
154
+
155
+ print_r($_SESSION);
156
+ echo "_agca_templates_session:OK";
157
+ exit;
158
+ }else if(isset($_POST['_agca_templates_session_remove_license'])){
159
+ $this->agcaAdminSession();
160
+ if($_POST['template'] !="")
161
+ $_SESSION["AGCA"]["Templates"][$_POST['template']] = null;
162
+ print_r($_SESSION);
163
+ echo "_agca_templates_session_remove_license:OK";
164
+ exit;
165
+ }else if(isset($_POST['_agca_get_templates'])){
166
+ $templates = get_option( 'agca_templates' );
167
+ if($templates == "") $templates = array();
168
+ $results = array();
169
+ foreach($templates as $key=>$val){
170
+ $results[]=$key;
171
+ }
172
+ echo json_encode($results);
173
+ exit;
174
+ }else if(isset($_POST['_agca_activate_template'])){
175
+ update_option('agca_selected_template', $_POST['_agca_activate_template']);
176
+ $_POST = array();
177
+ //unset($_POST);
178
+ exit;
179
+ }else if(isset($_POST['_agca_template_settings'])){
180
+ $settings = $_POST['_agca_template_settings'];
181
+
182
+ $templates = get_option( 'agca_templates' );
183
+ if($templates == ""){
184
+ $templates = array();
185
+ }
186
+ $template_name = $_POST["_agca_current_template"];
187
+
188
+ $templates[$template_name]["settings"] = $settings;
189
+ update_option('agca_templates', $templates);
190
+
191
+ $_POST = array();
192
+ //print_r($templates);
193
+ exit;
194
+ }else if(isset($_POST['_agca_upload_image'])){
195
+ function my_sideload_image() {
196
+ $remoteurl = $_POST['_agca_upload_image'];
197
+ $file = media_sideload_image( $remoteurl, 0 ,"AG Custom Admin Template Image (do not delete)");
198
+ $fileparts = explode("src='",$file);
199
+ $url=explode("'",$fileparts[1]);
200
+ echo $url[0];
201
+ exit;
202
+ }
203
+ add_action( 'admin_init', 'my_sideload_image' );
204
+
205
+ }else if(isset($_POST['_agca_remove_template_images'])){
206
+ $this->delete_template_images($_POST['_agca_remove_template_images']);
207
+ exit;
208
+ }
209
+ }
210
+
211
+ function admin_bar_changes(){
212
+ if( current_user_can( 'manage_options' )){
213
+ global $wp_admin_bar;
214
+ $wp_admin_bar->add_menu( array(
215
+ 'id' => 'agca-admin-themes',
216
+ 'title' => '<span class="ab-icon"></span>'.__( 'Admin Themes', 'agca-admin-themes' ),
217
+ 'href' => 'tools.php?page=ag-custom-admin/plugin.php#ag-templates'
218
+ ) );
219
+ }
220
+ }
221
+
222
+ function delete_template_images_all(){
223
+ $templates = get_option('agca_templates');
224
+ if($templates != null && $templates != ""){
225
+ foreach($templates as $template){
226
+ if($template != null && $template['images'] != null && $template['images'] != ""){
227
+ //print_r($template['images']);
228
+ $imgs = explode(',',$template['images']);
229
+ foreach($imgs as $imageSrc){
230
+ $this->delete_attachment_by_src($imageSrc);
231
+ }
232
+ //print_r($imgs);
233
+ }
234
+ }
235
+ }
236
+ //print_r($templates);
237
+ }
238
+
239
+ function delete_template_images($template_name){
240
+ $templates = get_option('agca_templates');
241
+ if($templates != null && $templates != ""){
242
+ $template = $templates[$template_name];
243
+ if($template != null && $template['images'] != null && $template['images'] != ""){
244
+ //print_r($template['images']); exit;
245
+ $imgs = explode(',',$template['images']);
246
+ foreach($imgs as $imageSrc){
247
+ $this->delete_attachment_by_src($imageSrc);
248
+ }
249
+ //print_r($imgs);
250
+ }
251
+ }
252
+ //print_r($templates);
253
+ }
254
+
255
+ function delete_attachment_by_src ($image_src) {
256
+ global $wpdb;
257
+ $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
258
+ $id = $wpdb->get_var($query);
259
+ wp_delete_attachment( $id, $true );
260
+ }
261
+
262
+ function get_installed_agca_templates(){
263
+ $templates = get_option( 'agca_templates' );
264
+ if($templates == "")return '[]';
265
+ $results = array();
266
+ foreach($templates as $key=>$val){
267
+ $results[]=$key;
268
+ }
269
+ return json_encode($results);
270
+ }
271
+
272
+ function isGuest(){
273
+ global $user_login;
274
+ if($user_login) {
275
+ return false;
276
+ }else{
277
+ return true;
278
+ }
279
+ }
280
+ function check_active_plugin(){
281
+
282
+ $ozh = false;
283
+
284
+ if (is_plugin_active('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')) {
285
+ $ozh = true;
286
+ }
287
+
288
+ $this->active_plugin = array(
289
+ "ozh" => $ozh
290
+ );
291
+ }
292
+ function change_title($admin_title, $title){
293
+ //return get_bloginfo('name').' - '.$title;
294
+ if(get_option('agca_custom_title')!=""){
295
+ $blog = get_bloginfo('name');
296
+ $page = $title;
297
+ $customTitle = get_option('agca_custom_title');
298
+ $customTitle = str_replace('%BLOG%',$blog,$customTitle);
299
+ $customTitle = str_replace('%PAGE%',$page,$customTitle);
300
+ return $customTitle;
301
+ }else{
302
+ return $admin_title;
303
+ }
304
+ }
305
+ function agca_get_includes() {
306
+ ?>
307
+ <script type="text/javascript">
308
+ <?php
309
+ //AGCA GLOBALS
310
+ echo "var agca_global_plugin_url = '".trailingslashit(plugins_url(basename(dirname(__FILE__))))."';";
311
+ ?>
312
+ </script>
313
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
314
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=css&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>" />
315
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
316
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=js&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>"></script>
317
+
318
+ <?php
319
+ if($this->context == "login"){
320
+ ?>
321
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/login.min.css" />
322
+ <?php
323
+ }else{
324
+ ?>
325
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/admin.min.css" />
326
+ <?php
327
+ }
328
+ ?>
329
+ <?php
330
+ echo $this->templateCustomizations;
331
+
332
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
333
+ ?>
334
+ <style type="text/css">
335
+ <?php
336
+ echo get_option('agca_custom_css');
337
+ ?>
338
+ </style>
339
+ <script type="text/javascript">
340
+ try{
341
+ eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
342
+ }catch(e){
343
+ alert('AG CUSTOM ADMIN : There is an error in your custom JS script. Please fix it: \n\n' + e + '\n\n (AG CUSTOM ADMIN -> Advanced -> Custom JavaScript)');
344
+ console.log(e);
345
+ }
346
+ </script>
347
+ <?php
348
+ }
349
+ }
350
+
351
+ function agca_enqueue_scripts() {
352
+ wp_enqueue_script('jquery');
353
+ }
354
+
355
+ function reloadScript(){
356
+ $isAdmin = false;
357
+ if(defined('WP_ADMIN') && WP_ADMIN == 1){
358
+ $isAdmin = true;
359
+ }
360
+ if(in_array((isset($GLOBALS['pagenow'])?$GLOBALS['pagenow']:""), array('wp-login.php', 'wp-register.php')) || $isAdmin){
361
+ add_action('init', array(&$this,'agca_enqueue_scripts'));
362
+ }
363
+ }
364
+
365
+ function agca_register_settings() {
366
+ register_setting( 'agca-options-group', 'agca_role_allbutadmin' );
367
+ register_setting( 'agca-options-group', 'agca_screen_options_menu' );
368
+ register_setting( 'agca-options-group', 'agca_help_menu' );
369
+ register_setting( 'agca-options-group', 'agca_logout' );
370
+ register_setting( 'agca-options-group', 'agca_remove_your_profile' );
371
+ register_setting( 'agca-options-group', 'agca_logout_only' );
372
+ register_setting( 'agca-options-group', 'agca_custom_title' );
373
+ register_setting( 'agca-options-group', 'agca_howdy' );
374
+ register_setting( 'agca-options-group', 'agca_header' );
375
+ register_setting( 'agca-options-group', 'agca_header_show_logout' );
376
+ register_setting( 'agca-options-group', 'agca_footer' );
377
+ register_setting( 'agca-options-group', 'agca_privacy_options' );
378
+ register_setting( 'agca-options-group', 'agca_header_logo' );
379
+ register_setting( 'agca-options-group', 'agca_header_logo_custom' );
380
+ register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
381
+ register_setting( 'agca-options-group', 'agca_remove_site_link' );
382
+ register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
383
+
384
+ register_setting( 'agca-options-group', 'agca_site_heading' );
385
+ register_setting( 'agca-options-group', 'agca_custom_site_heading' );
386
+ register_setting( 'agca-options-group', 'agca_update_bar' );
387
+
388
+ register_setting( 'agca-options-group', 'agca_footer_left' );
389
+ register_setting( 'agca-options-group', 'agca_footer_left_hide' );
390
+ register_setting( 'agca-options-group', 'agca_footer_right' );
391
+ register_setting( 'agca-options-group', 'agca_footer_right_hide' );
392
+
393
+ register_setting( 'agca-options-group', 'agca_login_banner' );
394
+ register_setting( 'agca-options-group', 'agca_login_banner_text' );
395
+ register_setting( 'agca-options-group', 'agca_login_photo_remove' );
396
+ register_setting( 'agca-options-group', 'agca_login_photo_url' );
397
+ register_setting( 'agca-options-group', 'agca_login_photo_href' );
398
+ register_setting( 'agca-options-group', 'agca_login_round_box' );
399
+ register_setting( 'agca-options-group', 'agca_login_round_box_size' );
400
+
401
+ register_setting( 'agca-options-group', 'agca_dashboard_icon' );
402
+ register_setting( 'agca-options-group', 'agca_dashboard_text' );
403
+ register_setting( 'agca-options-group', 'agca_dashboard_text_paragraph' );
404
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_welcome' );
405
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_activity' );
406
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_il' );
407
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_plugins' );
408
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_qp' );
409
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_rn' );
410
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_rd' );
411
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_primary' );
412
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_secondary' );
413
+
414
+ //WP3.3
415
+ register_setting( 'agca-options-group', 'agca_admin_bar_comments' );
416
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content' );
417
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_post' );
418
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_link' );
419
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_page' );
420
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_user' );
421
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_media' );
422
+ register_setting( 'agca-options-group', 'agca_admin_bar_update_notifications' );
423
+ register_setting( 'agca-options-group', 'agca_admin_bar_admin_themes' );
424
+ register_setting( 'agca-options-group', 'agca_remove_top_bar_dropdowns' );
425
+ register_setting( 'agca-options-group', 'agca_admin_bar_frontend' );
426
+ register_setting( 'agca-options-group', 'agca_admin_bar_frontend_hide' );
427
+ register_setting( 'agca-options-group', 'agca_login_register_remove' );
428
+ register_setting( 'agca-options-group', 'agca_login_register_href' );
429
+ register_setting( 'agca-options-group', 'agca_login_lostpassword_remove' );
430
+ register_setting( 'agca-options-group', 'agca_admin_capability' );
431
+ register_setting( 'agca-options-group', 'agca_disablewarning' );
432
+ register_setting( 'agca-template-group', 'agca_selected_template' );
433
+ register_setting( 'agca-template-group', 'agca_templates' );
434
+ //delete_option( 'agca_templates' );
435
+
436
+
437
+ /*Admin menu*/
438
+ register_setting( 'agca-options-group', 'agca_admin_menu_turnonoff' );
439
+ register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
440
+ register_setting( 'agca-options-group', 'agca_admin_menu_separators' );
441
+ register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
442
+ register_setting( 'agca-options-group', 'agca_admin_menu_collapse_button' );
443
+ register_setting( 'agca-options-group', 'agca_admin_menu_arrow' );
444
+ register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round' );
445
+ register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round_size' );
446
+ register_setting( 'agca-options-group', 'agca_admin_menu_brand' );
447
+ register_setting( 'agca-options-group', 'agca_admin_menu_brand_link' );
448
+ register_setting( 'agca-options-group', 'agca_admin_menu_autofold' );
449
+ register_setting( 'agca-options-group', 'ag_edit_adminmenu_json' );
450
+ register_setting( 'agca-options-group', 'ag_edit_adminmenu_json_new' );
451
+ register_setting( 'agca-options-group', 'ag_add_adminmenu_json' );
452
+ register_setting( 'agca-options-group', 'ag_colorizer_json' );
453
+ register_setting( 'agca-options-group', 'agca_colorizer_turnonoff' );
454
+
455
+ register_setting( 'agca-options-group', 'agca_custom_js' );
456
+ register_setting( 'agca-options-group', 'agca_custom_css' );
457
+
458
+
459
+ if(!empty($_POST)){
460
+ // fb($_POST);
461
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=="true"){
462
+ if(isset($_FILES) && isset($_FILES['settings_import_file']) ){
463
+ if($_FILES["settings_import_file"]["error"] > 0){
464
+ }else{
465
+ $file = $_FILES['settings_import_file'];
466
+ if($this->startsWith($file['name'],'AGCA_Settings')){
467
+ if (file_exists($file['tmp_name'])) {
468
+ $fh = fopen($file['tmp_name'], 'r');
469
+ $theData = "";
470
+ if(filesize($file['tmp_name']) > 0){
471
+ $theData = fread($fh,filesize($file['tmp_name']));
472
+ }
473
+ fclose($fh);
474
+ $this->importSettings($theData);
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }else if(isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings']=="true"){
480
+ $this->exportSettings();
481
+ }
482
+ }
483
+
484
+ if(isset($_GET['agca_action'])){
485
+ if($_GET['agca_action'] == "disablewarning"){
486
+ update_option('agca_disablewarning', true);
487
+ }
488
+ }
489
+ }
490
+
491
+ function agca_deactivate() {
492
+
493
+ }
494
+
495
+ function getOptions(){
496
+ return Array(
497
+ 'agca_role_allbutadmin',
498
+ 'agca_admin_bar_frontend',
499
+ 'agca_admin_bar_frontend_hide',
500
+ 'agca_login_register_remove',
501
+ 'agca_login_register_href',
502
+ 'agca_login_lostpassword_remove',
503
+ 'agca_admin_capability',
504
+ 'agca_screen_options_menu',
505
+ 'agca_help_menu',
506
+ 'agca_logout',
507
+ 'agca_remove_your_profile',
508
+ 'agca_logout_only',
509
+ 'agca_custom_title',
510
+ 'agca_howdy',
511
+ 'agca_header',
512
+ 'agca_header_show_logout',
513
+ 'agca_footer',
514
+ 'agca_privacy_options',
515
+ 'agca_header_logo',
516
+ 'agca_header_logo_custom',
517
+ 'agca_remove_site_link',
518
+ 'agca_wp_logo_custom',
519
+ 'agca_wp_logo_custom_link',
520
+ 'agca_site_heading',
521
+ 'agca_custom_site_heading',
522
+ 'agca_update_bar',
523
+ 'agca_footer_left',
524
+ 'agca_footer_left_hide',
525
+ 'agca_footer_right',
526
+ 'agca_footer_right_hide',
527
+ 'agca_login_banner',
528
+ 'agca_login_banner_text',
529
+ 'agca_login_photo_remove',
530
+ 'agca_login_photo_url',
531
+ 'agca_login_photo_href',
532
+ 'agca_login_round_box',
533
+ 'agca_login_round_box_size',
534
+ 'agca_dashboard_icon',
535
+ 'agca_dashboard_text',
536
+ 'agca_dashboard_text_paragraph',
537
+ 'agca_dashboard_widget_welcome',
538
+ 'agca_dashboard_widget_activity',
539
+ 'agca_dashboard_widget_il',
540
+ 'agca_dashboard_widget_plugins',
541
+ 'agca_dashboard_widget_qp',
542
+ 'agca_dashboard_widget_rn',
543
+ 'agca_dashboard_widget_rd',
544
+ 'agca_dashboard_widget_primary',
545
+ 'agca_dashboard_widget_secondary',
546
+ 'agca_admin_bar_comments',
547
+ 'agca_admin_bar_new_content',
548
+ 'agca_admin_bar_new_content_post',
549
+ 'agca_admin_bar_new_content_link',
550
+ 'agca_admin_bar_new_content_page',
551
+ 'agca_admin_bar_new_content_user',
552
+ 'agca_admin_bar_new_content_media',
553
+ 'agca_admin_bar_update_notifications',
554
+ 'agca_admin_bar_admin_themes',
555
+ 'agca_remove_top_bar_dropdowns',
556
+ 'agca_admin_menu_turnonoff',
557
+ 'agca_admin_menu_agca_button_only',
558
+ 'agca_admin_menu_separators',
559
+ 'agca_admin_menu_icons',
560
+ 'agca_admin_menu_arrow',
561
+ 'agca_admin_menu_submenu_round',
562
+ 'agca_admin_menu_submenu_round_size',
563
+ 'agca_admin_menu_brand',
564
+ 'agca_admin_menu_brand_link',
565
+ 'agca_admin_menu_autofold',
566
+ 'agca_admin_menu_collapse_button',
567
+ 'ag_edit_adminmenu_json',
568
+ 'ag_edit_adminmenu_json_new',
569
+ 'ag_add_adminmenu_json',
570
+ 'ag_colorizer_json',
571
+ 'agca_colorizer_turnonof',
572
+ 'agca_custom_js',
573
+ 'agca_custom_css',
574
+ 'agca_colorizer_turnonoff',
575
+ 'agca_disablewarning',
576
+ 'agca_selected_template',
577
+ 'agca_templates',
578
+ );
579
+ }
580
+
581
+ function getTextEditor($name){
582
+ $settings = array(
583
+ 'textarea_name' => $name,
584
+ 'media_buttons' => true,
585
+ 'tinymce' => array(
586
+ 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
587
+ 'bullist,blockquote,|,justifyleft,justifycenter' .
588
+ ',justifyright,justifyfull,|,link,unlink,|' .
589
+ ',spellchecker,wp_fullscreen,wp_adv'
590
+ )
591
+ );
592
+ wp_editor( get_option($name), $name, $settings );
593
+ }
594
+
595
+ function importSettings($settings){
596
+ $exploaded = explode("|^|^|", $settings);
597
+ // $str = "EEE: ";
598
+
599
+ $savedOptions = array();
600
+
601
+ foreach ($exploaded as $setting){
602
+
603
+ $key = current(explode(':', $setting));
604
+ $value = substr($setting, strlen($key)+1);
605
+ $cleanedValue = str_replace('|^|^|','',$value);
606
+ $savedOptions[$key] = $cleanedValue;
607
+ }
608
+
609
+ // print_r($savedOptions);
610
+
611
+ $optionNames = $this->getOptions();
612
+
613
+ foreach ($optionNames as $optionName){
614
+ $optionValue = "";
615
+ $optionValue = $savedOptions[$optionName];
616
+
617
+ if($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new"|| $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
618
+ $optionValue = str_replace("\\\"", "\"", $optionValue);
619
+ $optionValue = str_replace("\\\'", "\'", $optionValue);
620
+ }else if($optionName == "agca_custom_js" || $optionName == "agca_custom_css"){
621
+ //fb($optionValue);
622
+ $optionValue = htmlspecialchars_decode($optionValue);
623
+ $optionValue = str_replace("\'", '"', $optionValue);
624
+ $optionValue = str_replace('\"', "'", $optionValue);
625
+ //fb($optionValue);
626
+ }else{
627
+
628
+ }
629
+ update_option($optionName, $optionValue);
630
+ $str.="/".$optionName."/".$optionValue."\n";
631
+ }
632
+
633
+ //Migration from 1.2.6. to 1.2.5.1 - remove in later versions
634
+ //agca_script_css
635
+ //
636
+ // fb($savedOptions);
637
+ if($savedOptions['agca_script_css'] != null){
638
+ $optionValue = "";
639
+ $optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
640
+ $optionValue = str_replace('\"', "'", $optionValue);
641
+ update_option('agca_custom_css', $optionValue);
642
+ }
643
+ if($savedOptions['agca_script_js'] != null){
644
+ $optionValue = "";
645
+ $optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
646
+ $optionValue = str_replace('\"', "'", $optionValue);
647
+ update_option('agca_custom_js', $optionValue);
648
+ }
649
+
650
+ //echo $str;
651
+
652
+ //save imported settings
653
+ $this->saveAfterImport = true;
654
+ }
655
+
656
+ function exportSettings(){
657
+ $str = "";
658
+
659
+ $include_menu_settings = false;
660
+ if(isset($_POST['export_settings_include_admin_menu'])){
661
+ if($_POST['export_settings_include_admin_menu'] == 'on'){
662
+ $include_menu_settings = true;
663
+ }
664
+ }
665
+
666
+ foreach ($_POST as $key => $value) {
667
+ if ($this->startsWith($key,'ag')||$this->startsWith($key,'color')) {
668
+ if($this->startsWith($key,'ag_edit_adminmenu')){
669
+ if($include_menu_settings) $str .=$key. ":".$value."|^|^|";
670
+ }else{
671
+ $str .=$key. ":".$value."|^|^|";
672
+ }
673
+ }
674
+ }
675
+
676
+ $filename = 'AGCA_Settings_'.date("Y-M-d_H-i-s").'.agca';
677
+ header("Cache-Control: public");
678
+ header("Content-Description: File Transfer");
679
+ header("Content-Disposition: attachment; filename=$filename");
680
+ header("Content-Type: text/plain; ");
681
+ header("Content-Transfer-Encoding: binary");
682
+ echo $str;
683
+ die();
684
+ }
685
+
686
+ function startsWith($haystack, $needle)
687
+ {
688
+ $length = strlen($needle);
689
+ return (substr($haystack, 0, $length) === $needle);
690
+ }
691
+
692
+
693
+
694
+ function agca_create_menu() {
695
+ add_management_page( 'AG Custom Admin', 'AG Custom Admin', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
696
+ }
697
+
698
+ function agca_create_admin_button($name,$arr) {
699
+
700
+ $href = $arr["value"];
701
+ $target =$arr["target"];
702
+ $button ="<li class=\"wp-not-current-submenu menu-top menu-top-last\" id=\"menu-$name\"><a href=\"$href\" target=\"$target\" class=\"wp-not-current-submenu menu-top\"><div class=\"wp-menu-arrow\"><div></div></div><div class=\"wp-menu-image dashicons-before dashicons-admin-$name\"><br></div><div class=\"wp-menu-name\">$name</div></a></li>";
703
+
704
+ return $button;
705
+ }
706
+ function agca_decode($code){
707
+ $code = str_replace("{","",$code);
708
+ $code = str_replace("}","",$code);
709
+ $code = str_replace("\", \"","\"|||\"",$code);
710
+ $elements = explode("|||",$code);
711
+
712
+ return $elements;
713
+ }
714
+
715
+ function jsonMenuArray($json,$type){
716
+ $arr = explode("|",$json);
717
+ $elements = "";
718
+ $array ="";
719
+ $first = true;
720
+ //print_r($json);
721
+ if($type == "colorizer"){
722
+ $elements = json_decode($arr[0],true);
723
+ if($elements !=""){
724
+ return $elements;
725
+ }
726
+ }else if($type == "buttons"){
727
+ $elements = json_decode($arr[0],true);
728
+ if($elements !=""){
729
+ foreach($elements as $k => $v){
730
+ $array.=$this->agca_create_admin_button($k,$v);
731
+ }
732
+ }
733
+ }else if($type == "buttonsJq"){
734
+ $elements = json_decode($arr[0],true);
735
+ if($elements !=""){
736
+ foreach($elements as $k => $v){
737
+ $array.='<tr><td colspan="2"><button target="'.$v['target'].'" title="'.$v['value'].'" type="button">'.$k.'</button>&nbsp;<a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a>&nbsp;<a style="cursor:pointer" title="Delete" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>';
738
+ }
739
+ }
740
+ }else{
741
+ if(isset($arr[$type])){
742
+ $elements = $this->agca_decode($arr[$type]);
743
+ }
744
+
745
+ if($elements !=""){
746
+ foreach($elements as $element){
747
+ if(!$first){
748
+ $array .=",";
749
+ }
750
+ $parts = explode(" : ",$element);
751
+ if(isset($parts[0]) && isset($parts[1])){
752
+ $array.="[".$parts[0].", ".$parts[1]."]";
753
+ }
754
+ $first=false;
755
+ }
756
+ }
757
+ }
758
+
759
+ return $array;
760
+ }
761
+
762
+ function remove_dashboard_widget($widget,$side)
763
+ {
764
+ //side can be 'normal' or 'side'
765
+ global $wp_meta_boxes;
766
+ remove_meta_box($widget, 'dashboard', $side);
767
+ }
768
+
769
+ function get_wp_version(){
770
+ global $wp_version;
771
+ $array = explode('-', $wp_version);
772
+ $version = $array[0];
773
+ return $version;
774
+ }
775
+
776
+ function print_page()
777
+ {
778
+ if($this->isGuest() && get_option('agca_admin_bar_frontend_hide')){
779
+ return false;
780
+ }
781
+
782
+ if(get_option('agca_admin_bar_frontend_hide')==true){
783
+ add_filter( 'show_admin_bar', '__return_false' );
784
+ ?>
785
+ <style type="text/css">
786
+ #wpadminbar{
787
+ display: none;
788
+ }
789
+ </style>
790
+ <script type="text/javascript">
791
+ window.setTimeout(function(){document.getElementsByTagName('html')[0].setAttribute('style',"margin-top:0px !important");},50);
792
+ </script>
793
+ <?php
794
+ }
795
+ if(get_option('agca_admin_bar_frontend')!=true){
796
+
797
+ $this->context = "page";
798
+ $wpversion = $this->get_wp_version();
799
+
800
+ ?>
801
+
802
+
803
+ <script type="text/javascript">
804
+ var wpversion = "<?php echo $wpversion; ?>";
805
+ var agca_version = "<?php echo $this->agca_version; ?>";
806
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
807
+ var jQueryScriptOutputted = false;
808
+ var agca_context = "page";
809
+ var agca_orig_admin_menu = [];
810
+ function initJQuery() {
811
+ //if the jQuery object isn't available
812
+ if (typeof(jQuery) == 'undefined') {
813
+ if (! jQueryScriptOutputted) {
814
+ //only output the script once..
815
+ jQueryScriptOutputted = true;
816
+ //output the script (load it from google api)
817
+ document.write("<scr" + "ipt type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></scr" + "ipt>");
818
+ }
819
+ setTimeout("initJQuery()", 50);
820
+ } else {
821
+ jQuery(function() {
822
+ try
823
+ {
824
+ <?php if(get_option('agca_header')!=true){ ?>
825
+ jQuery('#wpadminbar').show();
826
+ <?php } ?>
827
+
828
+ <?php $this->print_admin_bar_scripts(); ?>
829
+ }catch(ex){}
830
+ });
831
+ }
832
+ }
833
+ initJQuery();
834
+ </script>
835
+ <script type="text/javascript">
836
+ <?php echo "var agca_global_plugin_url = '".trailingslashit(plugins_url(basename(dirname(__FILE__))))."';"; ?>
837
+ </script>
838
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
839
+ <script type="text/javascript">
840
+ jQuery(document).ready(function(){
841
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on' && (get_option('agca_admin_bar_frontend_hide')!=true)){
842
+ foreach($this->colorizer as $k => $v){
843
+ if(($k !="") and ($v !="")){
844
+ if(
845
+ $k == "color_header" ||
846
+ $k == "color_font_header"
847
+ ){
848
+ ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
849
+ }
850
+
851
+ }
852
+ }
853
+ ?>
854
+
855
+ <?php
856
+ }
857
+ ?>
858
+ });
859
+ </script>
860
+ <?php
861
+ }
862
+
863
+ }
864
+
865
+ function print_admin_bar_scripts(){
866
+ ?>
867
+ <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
868
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
869
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
870
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
871
+
872
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
873
+ jQuery(".new_content_header_submenu").hide();
874
+ <?php } ?>
875
+
876
+ <?php } ?>
877
+
878
+ <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
879
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
880
+ <?php } ?>
881
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
882
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
883
+ <?php } ?>
884
+ <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
885
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
886
+ <?php } ?>
887
+ <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
888
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
889
+ <?php } ?>
890
+ <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
891
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
892
+ <?php } ?>
893
+ <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
894
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
895
+ <?php } ?>
896
+ <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
897
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
898
+ <?php } ?>
899
+ <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
900
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
901
+ <?php } ?>
902
+ <?php if(get_option('agca_admin_bar_admin_themes')!=""){ ?>
903
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-agca-admin-themes").css("display","none");
904
+ <?php } ?>
905
+
906
+
907
+
908
+ <?php if(get_option('agca_header_logo')==true){ ?>
909
+ jQuery("#wphead #header-logo").css("display","none");
910
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
911
+
912
+ <?php } ?>
913
+ <?php if(get_option('agca_header_logo_custom')!=""){ ?>
914
+
915
+ var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
916
+
917
+ advanced_url = img_url;
918
+ image = jQuery("<img />").attr("src",advanced_url);
919
+ jQuery(image).load(function() {
920
+ jQuery("#wpbody-content").prepend(image);
921
+ });
922
+
923
+ <?php } ?>
924
+ <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
925
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").html("<img style=\"height:28px;margin-top:-4px\" src=\"<?php echo get_option('agca_wp_logo_custom'); ?>\" />");
926
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css('background-image','none');
927
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css('width','auto');
928
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',"<?php echo get_bloginfo('wpurl'); ?>");
929
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item:before").attr('title','');
930
+ jQuery('body #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon').attr('class','ab-icon2');
931
+ <?php }?>
932
+ <?php if(get_option('agca_remove_site_link')==true){ ?>
933
+ jQuery("#wp-admin-bar-site-name").css("display","none");
934
+
935
+ <?php } ?>
936
+ <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
937
+ var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
938
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
939
+ if(href == "%SWITCH%"){
940
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
941
+ <?php if($this->context == "page"){
942
+ ?>href+="/wp-admin";<?php
943
+ }
944
+ ?>
945
+ }
946
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
947
+
948
+ <?php }?>
949
+ <?php if(get_option('agca_site_heading')==true){ ?>
950
+ jQuery("#wphead #site-heading").css("display","none");
951
+ <?php } ?>
952
+ <?php if(get_option('agca_custom_site_heading')!=""){ ?>
953
+ jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
954
+ jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
955
+
956
+ <?php } ?>
957
+ <?php if(get_option('agca_header')==true && $this->context =='admin'){
958
+ ?>
959
+ jQuery("#wpadminbar").css("display","none");
960
+ jQuery("body.admin-bar").css("padding-top","0");
961
+ jQuery("#wphead").css("display","none");
962
+ jQuery('html.wp-toolbar').css("padding-top","0");
963
+
964
+ <?php } ?>
965
+ <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
966
+ <?php
967
+ $agca_logout_text = ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout'));
968
+ ?>
969
+ jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item agca_logout_button"><?php echo $agca_logout_text; ?></a>');
970
+
971
+
972
+ <?php } ?>
973
+ <?php if(get_option('agca_howdy')!=""){ ?>
974
+ var alltext="";
975
+ alltext="";
976
+ jQuery('li#wp-admin-bar-my-account').css('cursor','default');
977
+ alltext = jQuery('li#wp-admin-bar-my-account').html();
978
+ if(alltext!=null){
979
+ var parts = alltext.split(',');
980
+ alltext = "<?php echo get_option('agca_howdy'); ?>" + ", " + parts[1];
981
+ }
982
+ jQuery("li#wp-admin-bar-my-account").html("<a href=\"#\" class=\"ab-item\">"+alltext+"</a>");
983
+
984
+ <?php } ?>
985
+ <?php
986
+ if(get_option('agca_custom_title')!=""){
987
+ //add_filter('admin_title', '$this->change_title', 10, 2);
988
+
989
+ }
990
+ ?>
991
+ <?php if(get_option('agca_logout')!=""){ ?>
992
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
993
+ <?php } ?>
994
+ <?php if(get_option('agca_remove_your_profile')==true){ ?>
995
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
996
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
997
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
998
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
999
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
1000
+ <?php } ?>
1001
+ <?php if(get_option('agca_logout_only')==true){ ?>
1002
+ var logout_content = jQuery("li#wp-admin-bar-logout").html();
1003
+ jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout">'+ logout_content +'</li>');
1004
+
1005
+ <?php } ?>
1006
+
1007
+ <?php
1008
+
1009
+
1010
+ }
1011
+
1012
+ function updateAllColors(){
1013
+
1014
+ ?>
1015
+ function updateAllColors(){
1016
+ <?php
1017
+ foreach($this->colorizer as $k => $v){
1018
+ if(($k !="") and ($v !="")){
1019
+ ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
1020
+ }
1021
+ }
1022
+ ?>
1023
+ jQuery('.color_picker').each(function(){
1024
+ updateColor(jQuery(this).attr('id'),jQuery(this).val())
1025
+ });
1026
+ jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1027
+ jQuery('#adminmenu li.wp-menu-open').css('border','none');
1028
+ jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
1029
+ }<?php
1030
+
1031
+ }
1032
+ function admin_capabilities(){
1033
+ global $wp_roles;
1034
+ $capabs = $wp_roles->roles['administrator']['capabilities'];
1035
+ $capabilitySelector = "";
1036
+
1037
+ $selectedValue = get_option('agca_admin_capability');
1038
+ if($selectedValue == ""){
1039
+ $selectedValue = "edit_dashboard";
1040
+ }
1041
+ /*echo $selectedValue;
1042
+ die;*/
1043
+ ksort($capabs);
1044
+ foreach($capabs as $k=>$v){
1045
+ $selected = "";
1046
+ if($this->startsWith($k, 'level_')) continue;
1047
+ if($selectedValue == $k){
1048
+ $selected = " selected=\"selected\" ";
1049
+ }
1050
+ //TODO:Find out why this does not work
1051
+ //$capabilitySelector .="<option val=\"$k\" $selected >".str_replace(' ', ' ', ucwords(str_replace('_', ' ', $k))) ."</option>\n";
1052
+ $capabilitySelector .="<option val=\"$k\" $selected >".$k."</option>\n";
1053
+ }
1054
+
1055
+ $this->admin_capabilities = "<select class=\"agca-selectbox\" id=\"agca_admin_capability\" name=\"agca_admin_capability\" val=\"upload_files\">".$capabilitySelector."</select>";
1056
+ }
1057
+
1058
+ function admin_capability(){
1059
+ $selectedValue = get_option('agca_admin_capability');
1060
+ if($selectedValue == ""){
1061
+ $selectedValue = "edit_dashboard";
1062
+ }
1063
+ return $selectedValue;
1064
+ }
1065
+
1066
+ function JSPrintAGCATemplateSettingsVar($settings){
1067
+ echo "\n<script type=\"text/javascript\">\n";
1068
+ echo "var agca_template_settings = ".preg_replace('#<script(.*?)>(.*?)</script>#is', '', $settings).";\n"; //TODO: think about this
1069
+ echo "</script>";
1070
+ }
1071
+
1072
+ function appendSettingsToAGCATemplateCustomizations($customizations, $settings){
1073
+ $template_settings = json_decode($settings);
1074
+ //print_r($template_settings);
1075
+ foreach($template_settings as $sett){
1076
+ $key = $sett->code;
1077
+
1078
+ //use default value if user's value is not set
1079
+ $value="";
1080
+ if($sett->value != ""){
1081
+ $value = $sett->value;
1082
+ }else{
1083
+ $value = $sett->default_value;
1084
+ }
1085
+
1086
+ //Prepare settings
1087
+ if($sett->type == 6){
1088
+ if($value !== null && (strtolower($value) == "on" || $value == "1")){
1089
+ $value = "true";
1090
+ }else{
1091
+ $value = "false";
1092
+ }
1093
+ }
1094
+ $customizations = str_replace("%".$key."%",$value, $customizations);
1095
+ }
1096
+ return $customizations;
1097
+ }
1098
+
1099
+ function enableSpecificWPVersionCustomizations($customizations){
1100
+ /*enable special CSS for this WP version*/
1101
+ $ver = $this->get_wp_version();
1102
+ $customizations = str_replace("/*".$ver," ", $customizations);
1103
+ $customizations = str_replace($ver."*/"," ", $customizations);
1104
+ return $customizations;
1105
+ }
1106
+
1107
+ function removeCSSComments($customizations){
1108
+ $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
1109
+ return $customizations;
1110
+ }
1111
+
1112
+ function prepareAGCAAdminTemplates(){
1113
+ if(get_option( 'agca_templates' ) != ""){
1114
+ //print_r(get_option( 'agca_templates' ));
1115
+ $themes = get_option( 'agca_templates' );
1116
+ $selectedTheme = get_option('agca_selected_template');
1117
+ if(isset($themes[$selectedTheme])){
1118
+ $theme = $themes[$selectedTheme];
1119
+ add_filter('get_user_option_admin_color', array(&$this,'change_admin_color'));
1120
+
1121
+ echo (stripslashes($theme['common']));
1122
+ echo "<!--AGCAIMAGES: ".$theme['images']."-->";
1123
+
1124
+ //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1125
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
1126
+ if($theme['settings'] == "" || $theme['settings'] == " ") $theme['settings'] = "{}";
1127
+ //print_r($templdata);
1128
+
1129
+ $this->JSPrintAGCATemplateSettingsVar($theme['settings']);
1130
+
1131
+ $admindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($theme['admin']), $theme['settings']);
1132
+ $admindata = $this->enableSpecificWPVersionCustomizations($admindata);
1133
+ $admindata = $this->removeCSSComments($admindata);
1134
+
1135
+ //echo $admindata;
1136
+ //REPLACE TAGS WITH CUSTOM TEMPLATE SETTINGS
1137
+ $this->templateCustomizations = $admindata;
1138
+ }
1139
+ //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1140
+ }
1141
+ }
1142
+ }
1143
+
1144
+ function agcaAdminSession(){
1145
+ $agcaTemplatesSession = array();
1146
+
1147
+ //session_destroy();
1148
+ //session_unset();
1149
+
1150
+ /*if(!session_id()){
1151
+ session_start();
1152
+ }*/
1153
+
1154
+ if(!isset($_SESSION["AGCA"])){
1155
+ $_SESSION["AGCA"] = array();
1156
+ $_SESSION["AGCA"]["Templates"] = array();
1157
+ }
1158
+ //print_r($_SESSION);
1159
+
1160
+ if(isset($_SESSION["AGCA"])){
1161
+ if(isset($_SESSION["AGCA"]["Templates"])){
1162
+ //print_r($_SESSION["AGCA"]["Templates"]);
1163
+ $agcaTemplatesSession = json_encode($_SESSION["AGCA"]["Templates"]);
1164
+ }
1165
+ }
1166
+
1167
+
1168
+ if($agcaTemplatesSession == '""' || $agcaTemplatesSession == '"[]"'){
1169
+ $agcaTemplatesSession = array();
1170
+ }
1171
+
1172
+
1173
+ return $agcaTemplatesSession;
1174
+
1175
+ }
1176
+
1177
+ function getAGCAColor($name){
1178
+ if(isset($this->colorizer[$name])){
1179
+ echo htmlspecialchars($this->colorizer[$name]);
1180
+ }
1181
+ }
1182
+
1183
+ function prepareAGCALoginTemplates(){
1184
+ if(get_option( 'agca_templates' ) != ""){
1185
+ //print_r(get_option( 'agca_templates' ));
1186
+ $templates = get_option( 'agca_templates' );
1187
+ foreach($templates as $templname=>$templdata){
1188
+ if($templname == get_option('agca_selected_template')){
1189
+ echo (stripslashes($templdata['common']));
1190
+
1191
+ if($templdata['settings'] == "" || $templdata['settings'] == " ") $templdata['settings'] = "{}";
1192
+ $this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
1193
+
1194
+ $logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
1195
+ $logindata = $this->enableSpecificWPVersionCustomizations($logindata);
1196
+ $logindata = $this->removeCSSComments($logindata);
1197
+
1198
+ echo($logindata);
1199
+ break;
1200
+ }
1201
+ }
1202
+ }
1203
+ }
1204
+
1205
+ function agca_error_check(){
1206
+ ?>
1207
+ <script type="text/javascript">
1208
+ function AGCAErrorPage(msg, url, line){
1209
+ var agca_error_details = "___________________________________________________<br/>";
1210
+ agca_error_details += '<br/>' + msg +'<br/>source:' + url + '<br/>line:' + line + '<br/>';
1211
+ agca_error_details += "___________________________________________________<br/>";
1212
+ window.agca_error_details_text = agca_error_details + '<br/>This JavaScript error could stop AG Custom Admin plugin to work properly. If everything still works, you can ignore this notification. <br/><br/>Possible solutions:<br/><br/>1) Make sure to have everything up to date: WordPress site, plugins and themes.<br/><br/>2) Try disabling plugins one by one to see if problem can be resolved this way. If so, one of disabled plugins caused this error.<br/><br/>3) Check "source" path of this error. This could be indicator of the plugin/theme that caused the error.<br/><br/>4) If it\'s obvious that error is thrown from a particular plugin/theme, please report this error to their support. <br/><br/>5) Try activating default WordPress theme instead of your current theme.<br/><br/>6) Advanced: Try fixing this issue manually: Navigate to the link above in your browser and open the source of the page (right click -> view page source) and find the line in code where it fails. You should access this file via FTP and try to fix this error on that line.<br/><br/>7) Contact us if nothing above helps. Please do not post errors that are caused by other plugins/themes to our support page. Contact their support instead. If you think that error is somehow related to AG Custom Admin plugin, or something unexpected happens, please report that on our <a href="http://wordpressadminpanel.com/agca-support/ag_custom_admin/error-ocurred-javascript-error-caught/" target="_blank">SUPPORT PAGE</a>';
1213
+ document.getElementsByTagName('html')[0].style.visibility = "visible";
1214
+ var errorDivHtml = '<div style="background: #f08080;border-radius: 3px;color: #ffffff;height: auto; margin-right: 13px;padding: 6px 14px;width: 450px;z-index: 99999; position:absolute;">\
1215
+ AG Custom Admin caught an error on your site!&nbsp;<a target="_blank" href="#" onclick="var aedt = document.getElementById(\'agca_error_details_text\'); if(aedt.style.display !== \'block\') {aedt.style.display = \'block\';} else{aedt.style.display = \'none\';} return false;" style="color: #ffffff !important;float:right;font-weight: bold;text-decoration: none;">(show/hide more...)</a><div id="agca_error_details_text" style="display:none;margin: 10px 0;background:#ffffff;border-radius: 5px;padding:8px;color: #777;">'+agca_error_details_text+'</div></div>';
1216
+
1217
+ var ph = document.getElementById('agca_error_placeholder');
1218
+ ph.innerHTML = errorDivHtml;
1219
+ document.getElementById('agca_news').style.visibility = "hidden";
1220
+ }
1221
+ window.onerror = function(msg, url, line) {
1222
+ window.onload = function() {
1223
+ AGCAErrorPage(msg, url, line);
1224
+ }
1225
+ return true;
1226
+ };
1227
+ </script>
1228
+ <?php
1229
+ }
1230
+ function error_check(){
1231
+ ?>
1232
+ <script type="text/javascript">
1233
+ function AGCAErrorOtherPages(msg, url, line){
1234
+ var agca_error_details = "___________________________________________________\n";
1235
+ agca_error_details += '\n' + msg +'\nsource:' + url + '\nline:' + line + '\n';
1236
+
1237
+ document.getElementsByTagName('html')[0].style.visibility = "visible";
1238
+
1239
+ if(typeof window.console === "object"){
1240
+ console.log("___________________________________________________");
1241
+ console.log("AG Custom Admin caught a JavaScript on your site:");
1242
+ console.log(agca_error_details);
1243
+ }
1244
+ }
1245
+ window.onerror = function(msg, url, line) {
1246
+ window.onload = function() {
1247
+ AGCAErrorOtherPages(msg, url, line);
1248
+ }
1249
+ return true;
1250
+ };
1251
+ </script>
1252
+ <?php
1253
+ }
1254
+
1255
+ function menu_item_cleartext($name){
1256
+ if(strpos($name,' <span') !== false){
1257
+ $parts = explode(' <span', $name);
1258
+ $name = $parts[0];
1259
+ }
1260
+ $name = trim($name);
1261
+ return $name;
1262
+ }
1263
+
1264
+ /**
1265
+ * Loops through all original menu items, and creates customizations array
1266
+ * applies previous customizations if set
1267
+ * @return array|mixed|object
1268
+ */
1269
+ function get_menu_customizations(){
1270
+ global $menu;
1271
+ global $submenu;
1272
+
1273
+ //var_dump($menu); die;
1274
+ $previousCustomizations = json_decode(get_option('ag_edit_adminmenu_json_new'), true);
1275
+
1276
+ $customizationsSet = true;
1277
+ if($previousCustomizations == null){
1278
+ $customizationsSet = false;
1279
+ }
1280
+
1281
+ //set default menu configuration
1282
+ //and apply previously saved customizations
1283
+ $m = array();
1284
+ foreach($menu as $top){
1285
+ $name = $top[0];
1286
+ $url = $top[2];
1287
+ $cls = isset($top[5])?$top[5]:"";
1288
+ $remove = false;
1289
+ if($name == '') continue;
1290
+ $pc = null;
1291
+ $name = $this->menu_item_cleartext($name);
1292
+
1293
+ //apply previous submenu customizations
1294
+ if($customizationsSet){
1295
+ $pc = $previousCustomizations[$url];
1296
+ }
1297
+
1298
+ //get submenu
1299
+ $s = array();
1300
+ if(isset($submenu[$url])){
1301
+ $sitems = $submenu[$url];
1302
+ foreach($sitems as $key=>$sub){
1303
+ $nameSub = $sub[0];
1304
+ $urlSub = $sub[2];
1305
+ $removeSub = false;
1306
+ $nameSub = $this->menu_item_cleartext($nameSub);
1307
+ $s[$key]=array(
1308
+ 'name'=>$nameSub,
1309
+ 'new'=>'',
1310
+ 'remove'=>$removeSub,
1311
+ 'url'=>$urlSub
1312
+ );
1313
+
1314
+ if(isset($pc) && isset($pc['submenus'])){
1315
+ $s[$key]['new'] = $pc['submenus'][$key]['new'];
1316
+ $s[$key]['remove'] = $pc['submenus'][$key]['remove'];
1317
+
1318
+ if($s[$key]['new'] == null){
1319
+ $s[$key]['new'] = '';
1320
+ }
1321
+ if($s[$key]['remove'] == null){
1322
+ $s[$key]['remove'] = false;
1323
+ }
1324
+ }
1325
+ }
1326
+ }
1327
+
1328
+ $m[$url]=array(
1329
+ 'name'=>$name,
1330
+ 'remove'=>$remove,
1331
+ 'new'=>'',
1332
+ 'url'=>$url,
1333
+ 'cls'=>$cls,
1334
+ 'submenus'=>$s
1335
+ );
1336
+
1337
+ //apply previous top menu customizations
1338
+ if($customizationsSet){
1339
+ $pc = $previousCustomizations[$url];
1340
+ if(isset($pc)){
1341
+ $m[$url]['remove'] = $pc['remove'];
1342
+ $m[$url]['new'] = $pc['new'];
1343
+ }
1344
+ }
1345
+ }
1346
+ return $m;
1347
+ }
1348
+
1349
+ /**
1350
+ * Applies customizations to admin menu
1351
+ */
1352
+ function customized_menu(){
1353
+ $customizations = $this->get_menu_customizations();
1354
+ global $menu;
1355
+ global $submenu;
1356
+
1357
+ //print_r($submenu);die;
1358
+ //apply customizations to original admin menu
1359
+ foreach($menu as $key=>$top){
1360
+ $url = $top[2];
1361
+ if(isset($customizations[$url])){
1362
+ $topCustomized = $customizations[$url];
1363
+ if($topCustomized['new']) {
1364
+ $menu[$key][0] = $topCustomized['new'];
1365
+ }
1366
+ if($topCustomized['remove']){
1367
+ unset($menu[$key]);
1368
+ }
1369
+ }
1370
+ }
1371
+ foreach($submenu as $topkey=>$subs){
1372
+ foreach($subs as $subkey=>$sub){
1373
+ if(isset($customizations[$topkey]['submenus'][$subkey])){
1374
+ $cs = $customizations[$topkey]['submenus'][$subkey];
1375
+ if($cs['new']) {
1376
+ $submenu[$topkey][$subkey][0] = preg_replace("/".$cs['name']."/",$cs['new'], $submenu[$topkey][$subkey][0],1);
1377
+ }
1378
+ if($cs['remove']){
1379
+ unset($submenu[$topkey][$subkey]);
1380
+ }
1381
+ }
1382
+ }
1383
+ }
1384
+ }
1385
+
1386
+ /**
1387
+ * Used only for removing admin menu customizations to AGCA 1.5 version or later
1388
+ * @param $checkboxes
1389
+ * @param $textboxes
1390
+ */
1391
+ function migrate_menu_customizations($checkboxes, $textboxes){
1392
+ $customizations = $this->get_menu_customizations();
1393
+ global $menu;
1394
+ /*print_r($menu);
1395
+ print_r($customizations);
1396
+ print_r($textboxes);*/
1397
+
1398
+ $oldTopValue = "";
1399
+
1400
+
1401
+ //Migrate checkboxes
1402
+ foreach($checkboxes as $key=>$value){
1403
+ $isTop = false;
1404
+ $oldSubValue = "";
1405
+ if (strpos($key,'<-TOP->') !== false) {
1406
+ $oldTopValue = str_replace('<-TOP->','',$key);
1407
+ $isTop = true;
1408
+ }else{
1409
+ $oldSubValue = $key;
1410
+ }
1411
+ if($value == 'checked'){
1412
+ $topIndex = "";
1413
+ foreach($customizations as $k=>$c){
1414
+ if($c['cls'] == $oldTopValue){
1415
+ $topIndex = $k;
1416
+ break;
1417
+ }
1418
+ }
1419
+ if($topIndex == "") continue;
1420
+ if($isTop){
1421
+ $customizations[$topIndex]['remove'] = true;
1422
+ }else{
1423
+ if(is_array($customizations[$topIndex]['submenus'])){
1424
+ foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1425
+ if($sval['name'] == $oldSubValue){
1426
+ $customizations[$topIndex]['submenus'][$skey]['remove'] = true;
1427
+ }
1428
+ }
1429
+ }
1430
+ }
1431
+ }
1432
+ }
1433
+
1434
+ //Migrate textboxes
1435
+ foreach($textboxes as $key=>$value){
1436
+ $isTop = false;
1437
+ $oldSubValue = "";
1438
+ if (strpos($key,'<-TOP->') !== false) {
1439
+ $oldTopValue = str_replace('<-TOP->','',$key);
1440
+ $isTop = true;
1441
+ }else{
1442
+ $oldSubValue = $key;
1443
+ }
1444
+ if($value != ''){
1445
+ $topIndex = "";
1446
+ foreach($customizations as $k=>$c){
1447
+ if($c['cls'] == $oldTopValue){
1448
+ $topIndex = $k;
1449
+ break;
1450
+ }
1451
+ }
1452
+ if($topIndex == "") continue;
1453
+ if($isTop){
1454
+ $customizations[$topIndex]['new'] = $value;
1455
+ }else{
1456
+ if(is_array($customizations[$topIndex]['submenus'])){
1457
+ foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1458
+ if($sval['name'] == $oldSubValue){
1459
+ if($customizations[$topIndex]['submenus'][$skey]['name'] != $value){
1460
+ $customizations[$topIndex]['submenus'][$skey]['new'] = $value;
1461
+ }
1462
+ }
1463
+ }
1464
+ }
1465
+ }
1466
+ }
1467
+ }
1468
+ update_option('ag_edit_adminmenu_json','');//remove previous admin menu configuration
1469
+ update_option('ag_edit_adminmenu_json_new',json_encode($customizations));
1470
+ }
1471
+ function print_admin_css()
1472
+ {
1473
+ $agcaTemplateSession = $this->agcaAdminSession();
1474
+ $wpversion = $this->get_wp_version();
1475
+ $this->context = "admin";
1476
+ $this->error_check();
1477
+ ?>
1478
+ <script type="text/javascript">
1479
+ var wpversion = "<?php echo $wpversion; ?>";
1480
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
1481
+ var agca_version = "<?php echo $this->agca_version; ?>";
1482
+ var agcaTemplatesSession = <?php echo ($agcaTemplateSession==null)?"[]":$agcaTemplateSession; ?>;
1483
+ var errors = false;
1484
+ var isSettingsImport = false;
1485
+ var agca_context = "admin";
1486
+ var roundedSidberSize = 0;
1487
+ var agca_installed_templates = <?php echo $this->get_installed_agca_templates(); ?>;
1488
+ var agca_admin_menu = <?= json_encode($this->get_menu_customizations()) ?>;
1489
+ </script>
1490
+ <?php
1491
+ $this->prepareAGCAAdminTemplates();
1492
+ $this->agca_get_includes();
1493
+ $this->admin_capabilities();
1494
+ get_currentuserinfo() ;
1495
+
1496
+ ?>
1497
+ <?php
1498
+ //in case that javaScript is disabled only admin can access admin menu
1499
+ if(!current_user_can($this->admin_capability())){
1500
+ ?>
1501
+ <style type="text/css">
1502
+ #adminmenu{display:none;}
1503
+ </style>
1504
+ <?php
1505
+ }
1506
+ ?>
1507
+ <script type="text/javascript">
1508
+ document.write('<style type="text/css">html{visibility:hidden;}</style>');
1509
+ <?php
1510
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='true'){
1511
+ echo 'isSettingsImport = true;';
1512
+ }
1513
+ ?>
1514
+ </script>
1515
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1516
+ <style type="text/css">
1517
+ .wp-has-current-submenu:after{border:none !important;}
1518
+ #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border:none !important;}
1519
+ </style>
1520
+ <?php } ?>
1521
+ <script type="text/javascript">
1522
+ /* <![CDATA[ */
1523
+ jQuery(document).ready(function() {
1524
+ try
1525
+ {
1526
+
1527
+ <?php /*CHECK OTHER PLUGINS*/
1528
+ $this->check_active_plugin();
1529
+
1530
+ if($this->active_plugin["ozh"]){
1531
+ ?>
1532
+ jQuery('ul#adminmenu').css('display','none');
1533
+ jQuery('#footer-ozh-oam').css('display','none');
1534
+ jQuery('#ag_main_menu li').each(function(){
1535
+ if(jQuery(this).text() == "Admin Menu"){
1536
+ jQuery(this).hide();
1537
+ }
1538
+ });
1539
+ <?php
1540
+ }
1541
+ ?>
1542
+
1543
+
1544
+ //get saved onfigurations
1545
+
1546
+ <?php $buttons = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttons'); ?>
1547
+ var buttons = '<?php echo $buttons; ?>';
1548
+
1549
+ <?php $buttonsJq = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttonsJq'); ?>
1550
+ var buttonsJq = '<?php echo $buttonsJq; ?>';
1551
+
1552
+ createEditMenuPageNew(agca_admin_menu);
1553
+ //createEditMenuPageV32(checkboxes, textboxes);
1554
+
1555
+ <?php
1556
+ //if admin, and option to hide settings for admin is set
1557
+
1558
+ if((get_option('agca_role_allbutadmin')==true) and current_user_can($this->admin_capability())){
1559
+ ?>
1560
+ <?php } else{ ?>
1561
+ <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1562
+ additionalStyles = ' style="margin-bottom:-4px" ';
1563
+ jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
1564
+ <?php } ?>
1565
+ <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
1566
+
1567
+ var href = "<?php echo get_option('agca_admin_menu_brand_link'); ?>";
1568
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1569
+
1570
+ jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1571
+ jQuery("#sidebar_adminmenu_logo").attr('title',href);
1572
+
1573
+ <?php }else{ ?>
1574
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
1575
+ jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1576
+ jQuery("#sidebar_adminmenu_logo").attr('title',href);
1577
+ <?php } ?>
1578
+
1579
+ <?php if(get_option('agca_admin_menu_submenu_round')==true){ ?>
1580
+ jQuery("#adminmenu .wp-submenu").css("border-radius","<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
1581
+ jQuery("#adminmenu .wp-menu-open .wp-submenu").css('border-radius','');
1582
+ <?php $roundedSidebarSize = get_option('agca_admin_menu_submenu_round_size'); ?>
1583
+ roundedSidberSize = <?php echo ($roundedSidebarSize == "")?"0":$roundedSidebarSize; ?>;
1584
+
1585
+
1586
+ <?php } ?>
1587
+ <?php if(get_option('agca_admin_menu_autofold')=="force"){ ?>
1588
+ jQuery("body").addClass("auto-fold");
1589
+ <?php } else if(get_option('agca_admin_menu_autofold')=="disable"){ ?>
1590
+ jQuery("body").removeClass("auto-fold");
1591
+ <?php } ?>
1592
+
1593
+ <?php $this->print_admin_bar_scripts(); ?>
1594
+
1595
+ <?php if(get_option('agca_screen_options_menu')==true){ ?>
1596
+ jQuery("#screen-options-link-wrap").css("display","none");
1597
+ <?php } ?>
1598
+ <?php if(get_option('agca_help_menu')==true){ ?>
1599
+ jQuery("#contextual-help-link-wrap").css("display","none");
1600
+ jQuery("#contextual-help-link").css("display","none");
1601
+ <?php } ?>
1602
+ <?php if(get_option('agca_privacy_options')==true){ ?>
1603
+ jQuery("#privacy-on-link").css("display","none");
1604
+ <?php } ?>
1605
+
1606
+ <?php if(get_option('agca_update_bar')==true){ ?>
1607
+ <?php
1608
+ if ( ! function_exists( 'c2c_no_update_nag' ) ) :
1609
+ function c2c_no_update_nag() {
1610
+ remove_action( 'admin_notices', 'update_nag', 3 );
1611
+ }
1612
+ endif;
1613
+ add_action( 'admin_init', 'c2c_no_update_nag' );
1614
+ ?>
1615
+ jQuery("#update-nag").css("display","none");
1616
+ jQuery(".update-nag").css("display","none");
1617
+ <?php } ?>
1618
+
1619
+ <?php if(get_option('agca_footer')==true){ ?>
1620
+ jQuery("#footer,#wpfooter").css("display","none");
1621
+ <?php } ?>
1622
+
1623
+ <?php if(get_option('agca_footer_left')!=""){ ?>
1624
+ jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1625
+ <?php } ?>
1626
+ <?php if(get_option('agca_footer_left_hide')==true){ ?>
1627
+ jQuery("#footer-left").css("display","none");
1628
+ <?php } ?>
1629
+ <?php if(get_option('agca_footer_right')!=""){ ?>
1630
+ jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
1631
+ <?php } ?>
1632
+ <?php if(get_option('agca_footer_right_hide')==true){ ?>
1633
+ jQuery("#footer-upgrade").css("display","none");
1634
+ <?php } ?>
1635
+
1636
+ <?php if(get_option('agca_language_bar')==true){ ?>
1637
+ jQuery("#user_info p").append('<?php include("language_bar/language_bar.php"); ?>');
1638
+ <?php } ?>
1639
+ <?php if(get_option('agca_dashboard_icon')==true){ ?>
1640
+ var className = jQuery("#icon-index").attr("class");
1641
+ if(className=='icon32'){
1642
+ jQuery("#icon-index").attr("id","icon-index-removed");
1643
+ }
1644
+ <?php } ?>
1645
+ <?php if(get_option('agca_dashboard_text')!=""){ ?>
1646
+ jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1647
+ <?php } ?>
1648
+ <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1649
+ require_once(ABSPATH . 'wp-includes/formatting.php');
1650
+ ?>
1651
+ jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1652
+
1653
+ jQuery("#agca_custom_dashboard_content").html('<br /><?php echo preg_replace('/(\r\n|\r|\n)/', '\n', addslashes(wpautop(get_option('agca_dashboard_text_paragraph')))); ?>');
1654
+ <?php } ?>
1655
+
1656
+ <?php /*Remove Dashboard widgets*/ ?>
1657
+ <?php
1658
+
1659
+ if(get_option('agca_dashboard_widget_welcome')==true){
1660
+ ?>jQuery("#welcome-panel").css("display","none");<?php
1661
+ }else{
1662
+ ?>jQuery("#welcome-panel").css("display","block");<?php
1663
+ }
1664
+ if(get_option('agca_dashboard_widget_il')==true){
1665
+ $this->remove_dashboard_widget('dashboard_incoming_links','normal');
1666
+ }else{
1667
+ ?>jQuery("#dashboard_incoming_links").css("display","block");<?php
1668
+ }
1669
+ if(get_option('agca_dashboard_widget_plugins')==true){
1670
+ $this->remove_dashboard_widget('dashboard_plugins','normal');
1671
+ }else{
1672
+ ?>jQuery("#dashboard_plugins").css("display","block");<?php
1673
+ }
1674
+ if(get_option('agca_dashboard_widget_qp')==true){
1675
+ $this->remove_dashboard_widget('dashboard_quick_press','side');
1676
+ }else{
1677
+ ?>jQuery("#dashboard_quick_press").css("display","block");<?php
1678
+ }
1679
+ if(get_option('agca_dashboard_widget_rn')==true){
1680
+ $this->remove_dashboard_widget('dashboard_right_now','normal');
1681
+ }else{
1682
+ ?>jQuery("#dashboard_right_now").css("display","block");<?php
1683
+ }
1684
+ if(get_option('agca_dashboard_widget_rd')==true){
1685
+ $this->remove_dashboard_widget('dashboard_recent_drafts','side');
1686
+ }else{
1687
+ ?>jQuery("#dashboard_recent_drafts").css("display","block");<?php
1688
+ }
1689
+ if(get_option('agca_dashboard_widget_primary')==true){
1690
+ $this->remove_dashboard_widget('dashboard_primary','side');
1691
+ }else{
1692
+ ?>jQuery("#dashboard_primary").css("display","block");<?php
1693
+ }
1694
+ if(get_option('agca_dashboard_widget_secondary')==true){
1695
+ $this->remove_dashboard_widget('dashboard_secondary','side');
1696
+ }else{
1697
+ ?>jQuery("#dashboard_secondary").css("display","block");<?php
1698
+ }
1699
+ if(get_option('agca_dashboard_widget_activity')==true){
1700
+ remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
1701
+ }else{
1702
+ ?>jQuery("#dashboard_activity").css("display","block");<?php
1703
+ }
1704
+
1705
+ ?>
1706
+
1707
+ <?php /*ADMIN MENU*/ ?>
1708
+
1709
+ <?php if(get_option('agca_admin_menu_separators')==true){ ?>
1710
+ jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
1711
+ <?php } ?>
1712
+ <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1713
+ jQuery(".wp-menu-image").each(function(){
1714
+ jQuery(this).css("display","none");
1715
+ });
1716
+ jQuery('#adminmenu div.wp-menu-name').css('padding','8px');
1717
+ <?php } ?>
1718
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1719
+ jQuery("#adminmenu .wp-menu-arrow").css("visibility","hidden");
1720
+
1721
+ <?php } ?>
1722
+ <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1723
+
1724
+ <?php /*If Turned on*/ ?>
1725
+
1726
+ <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1727
+ jQuery('#adminmenu > li').each(function(){
1728
+ if(!jQuery(this).hasClass('agca_button_only')){
1729
+ jQuery(this).addClass('noclass');
1730
+ }
1731
+ });
1732
+ <?php /*Only admin see button*/
1733
+ if (current_user_can($this->admin_capability())){ ?>
1734
+ jQuery('#adminmenu').append('<?php echo $this->agca_create_admin_button('AG Custom Admin',array('value'=>'tools.php?page=ag-custom-admin/plugin.php','target'=>'_self')); ?>');
1735
+ <?php } ?>
1736
+ <?php } ?>
1737
+
1738
+
1739
+ <?php /*EDIT MENU ITEMS*/?>
1740
+ <?php if(get_option('ag_edit_adminmenu_json')!=""){
1741
+
1742
+ $arr = explode("|",get_option('ag_edit_adminmenu_json'));
1743
+
1744
+ $checkboxes = json_decode($arr[0]);
1745
+ $textboxes = json_decode($arr[1]);
1746
+
1747
+ $this->migrate_menu_customizations($checkboxes, $textboxes);
1748
+
1749
+ } ?>
1750
+
1751
+ <?php if(get_option('ag_edit_adminmenu_json_new')!=""){
1752
+ $this->customized_menu();
1753
+ } ?>
1754
+
1755
+
1756
+
1757
+
1758
+ /*Add user buttons*/
1759
+ jQuery('#adminmenu').append(buttons);
1760
+
1761
+ <?php /*END If Turned on*/ ?>
1762
+ <?php } else{ ?>
1763
+ jQuery("#adminmenu").removeClass("noclass");
1764
+ <?php } ?>
1765
+
1766
+ reloadRemoveButtonEvents();
1767
+
1768
+ <?php if(get_option('agca_admin_menu_collapse_button') == true){ ?>
1769
+ //remove collapse menu button
1770
+ jQuery('#collapse-menu').remove();
1771
+ <?php } ?>
1772
+
1773
+ <?php //COLORIZER ?>
1774
+ updateAllColors();
1775
+ <?php //COLORIZER END ?>
1776
+ <?php } //end of apply for any user except admin ?>
1777
+ /*Add user buttons*/
1778
+ jQuery('#ag_add_adminmenu').append(buttonsJq);
1779
+
1780
+
1781
+ }catch(err){
1782
+ errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
1783
+ console.log(errors);
1784
+ }finally{
1785
+ jQuery('html').css('visibility','visible');
1786
+ }
1787
+ <?php
1788
+ if($this->saveAfterImport == true){
1789
+ ?>savePluginSettings();<?php
1790
+ }
1791
+ ?>
1792
+
1793
+ });
1794
+
1795
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on'){
1796
+ $this->updateAllColors();
1797
+ }else{
1798
+ ?>function updateAllColors(){}; <?php
1799
+ } ?>
1800
+
1801
+
1802
+ /* ]]> */
1803
+ </script>
1804
+ <style type="text/css">
1805
+ .underline_text{
1806
+ text-decoration:underline;
1807
+ }
1808
+ .form-table th{
1809
+ width:300px;
1810
+ }
1811
+
1812
+ #dashboard-widgets div.empty-container{
1813
+ border:none;
1814
+ }
1815
+ </style>
1816
+ <?php
1817
+ }
1818
+
1819
+ function print_login_head(){
1820
+ $this->context = "login";
1821
+ $this->error_check();
1822
+ $wpversion = $this->get_wp_version();
1823
+
1824
+ ?>
1825
+ <script type="text/javascript">
1826
+ document.write('<style type="text/css">html{visibility:hidden;}</style>');
1827
+ var agca_version = "<?php echo $this->agca_version; ?>";
1828
+ <?php //var wpversion = "echo $wpversion; ?>
1829
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
1830
+ var isSettingsImport = false;
1831
+ var agca_context = "login";
1832
+ </script>
1833
+ <?php
1834
+ $this->prepareAGCALoginTemplates();
1835
+ $this->agca_get_includes();
1836
+
1837
+ ?>
1838
+
1839
+ <script type="text/javascript">
1840
+
1841
+
1842
+ /* <![CDATA[ */
1843
+ jQuery(document).ready(function() {
1844
+ try{
1845
+ <?php if(get_option('agca_login_round_box')==true){ ?>
1846
+ jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1847
+ jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1848
+ jQuery("#login h1 a").css("margin-bottom",'10px');
1849
+ jQuery("#login h1 a").css("padding-bottom",'0');
1850
+ jQuery("form#lostpasswordform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1851
+ <?php } ?>
1852
+ <?php if(get_option('agca_login_banner')==true){ ?>
1853
+ jQuery("#backtoblog").css("display","none");
1854
+ <?php } ?>
1855
+ <?php if(get_option('agca_login_banner_text')==true){ ?>
1856
+ jQuery("#backtoblog").html('<?php echo addslashes(get_option('agca_login_banner_text')); ?>');
1857
+ <?php } ?>
1858
+ <?php if(get_option('agca_login_photo_url')==true){ ?>
1859
+ advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
1860
+ var $url = "url(" + advanced_url + ")";
1861
+ jQuery("#login h1 a").css("background",$url+' no-repeat');
1862
+ jQuery("#login h1 a").hide();
1863
+ image = jQuery("<img />").attr("src",advanced_url);
1864
+ jQuery(image).load(function() {
1865
+ var originalWidth = 326;
1866
+ var widthDiff = this.width - originalWidth;
1867
+ jQuery("#login h1 a").height(this.height);
1868
+ jQuery("#login h1 a").width(this.width);
1869
+ jQuery("#login h1 a").css("background-size",this.width+"px "+this.height+"px");
1870
+
1871
+ var loginWidth = jQuery('#login').width();
1872
+ var originalLoginWidth = 320;
1873
+ var photoWidth = this.width;
1874
+
1875
+ if(loginWidth > photoWidth){
1876
+ jQuery("#login h1 a").css('margin','auto');
1877
+ }else{
1878
+ jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+((loginWidth-originalLoginWidth)/2)+"px");
1879
+ }
1880
+
1881
+ jQuery("#login h1 a").show();
1882
+ });
1883
+ <?php } ?>
1884
+ <?php if(get_option('agca_login_photo_href')==true){ ?>
1885
+ var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
1886
+ $href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1887
+
1888
+ jQuery("#login h1 a").attr("href",$href);
1889
+ <?php } ?>
1890
+ <?php if(get_option('agca_login_photo_remove')==true){ ?>
1891
+ jQuery("#login h1 a").css("display","none");
1892
+ <?php } ?>
1893
+
1894
+ jQuery("#login h1 a").attr("title","");
1895
+
1896
+ <?php if(get_option('agca_login_register_remove')==true){ ?>
1897
+ if(jQuery('p#nav').size() > 0){
1898
+ jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
1899
+ }
1900
+ jQuery('p#nav a').each(function(){
1901
+ if(jQuery(this).attr('href').indexOf('register') != -1){
1902
+ jQuery(this).remove();
1903
+ }
1904
+ });
1905
+
1906
+ <?php } ?>
1907
+ <?php if(get_option('agca_login_register_href')!=""){ ?>
1908
+ jQuery('p#nav a').each(function(){
1909
+ if(jQuery(this).attr('href').indexOf('register') != -1){
1910
+ jQuery(this).attr('href','<?php echo get_option('agca_login_register_href'); ?>');
1911
+ }
1912
+ });
1913
+
1914
+ <?php } ?>
1915
+
1916
+ <?php if(get_option('agca_login_lostpassword_remove')==true){ ?>
1917
+ if(jQuery('p#nav').size() > 0){
1918
+ jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
1919
+ }
1920
+ jQuery('p#nav a').each(function(){
1921
+ if(jQuery(this).attr('href').indexOf('lostpassword') != -1){
1922
+ jQuery(this).remove();
1923
+ }
1924
+ });
1925
+
1926
+ <?php } ?>
1927
+
1928
+
1929
+ <?php //COLORIZER ?>
1930
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
1931
+ jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1932
+ jQuery("body.login, html").css("background","<?php echo $this->colorizer['login_color_background'];?>");
1933
+
1934
+
1935
+ <?php
1936
+
1937
+
1938
+ } ?>
1939
+ <?php //COLORIZER END ?>
1940
+ }catch(err){
1941
+ console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
1942
+ }finally{
1943
+ jQuery('html').show();
1944
+ jQuery('html').css('visibility','visible');
1945
+ }
1946
+ });
1947
+ /* ]]> */
1948
+
1949
+ </script>
1950
+ <?php
1951
+ }
1952
+
1953
+ function agca_admin_page() {
1954
+
1955
+ $wpversion = $this->get_wp_version();
1956
+ $this->agca_error_check();
1957
+ ?>
1958
+ <?php //includes ?>
1959
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/farbtastic.css?ver=<?php echo $wpversion; ?>" />
1960
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
1961
+
1962
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/agca_farbtastic.css?ver=<?php echo $wpversion; ?>" />
1963
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
1964
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/xd.js?ver=<?php echo $wpversion; ?>"></script>
1965
+ <script type="text/javascript">
1966
+ var templates_ep = "<?php echo $this->templates_ep; ?>";
1967
+ var template_selected = '<?php echo get_option('agca_selected_template'); ?>';
1968
+ </script>
1969
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_tmpl.js?ver=<?php echo $wpversion; ?>"></script>
1970
+ <?php //includes ?>
1971
+ <div class="wrap">
1972
+ <h1 id="agca-title">AG Custom Admin Settings <span style="font-size:15px;">(v<?php echo $this->agca_version; ?>)</span></h1>
1973
+ <div id="agca_error_placeholder"></div>
1974
+ <div id="agca_news">&nbsp;</div><br />
1975
+ <form method="post" id="agca_form" action="options.php">
1976
+ <?php settings_fields( 'agca-options-group' ); ?>
1977
+ <div id="agca-your-feedback">
1978
+ <strong>
1979
+ <span style="color:#005B69">Your feedback:</span>
1980
+ </strong>
1981
+ <a class="feedback positive" target="_blank" title="POSITIVE FEEDBACK: I like this plugin!" href="http://wordpressadminpanel.com/agca-support/feedback/ag-custom-admin-positive-feedback/">
1982
+ <span class="dashicons dashicons-thumbs-up"></span>
1983
+ </a>
1984
+ <a class="feedback negative" target="_blank" title="NEGATIVE FEEDBACK: I don't like this plugin." href="http://wordpressadminpanel.com/agca-support/feedback/ag-custom-admin-negative-feedback/">
1985
+ <span class="dashicons dashicons-thumbs-down"></span>
1986
+ </a>
1987
+ </div>
1988
+ <br />
1989
+ <ul id="ag_main_menu">
1990
+ <li class="selected"><a href="#general-settings" title="General Settings" >General</a></li>
1991
+ <li class="normal"><a href="#admin-bar-settings" title="Settings for admin bar" >Admin Bar</a></li>
1992
+ <li class="normal"><a href="#admin-footer-settings" title="Settings for admin footer" >Admin Footer</a></li>
1993
+ <li class="normal"><a href="#dashboad-page-settings" title="Settings for Dashboard page">Dashboard Page</a></li>
1994
+ <li class="normal"><a href="#login-page-settings" title="Settings for Login page">Login Page</a></li>
1995
+ <li class="normal" ><a href="#admin-menu-settings" title="Settings for main admin menu">Admin Menu</a></li>
1996
+ <li class="normal"><a href="#ag-colorizer-setttings" title="AG colorizer settings">Colorizer</a></li>
1997
+ <li class="normal"><a href="#ag-advanced" title="My custom scripts">Advanced</a></li>
1998
+ <li class="normal" style=""><a style="color:#DB6014;font-weight:bolder;" href="#ag-templates" title="AG Custom Admin Themes">Admin Themes</a></li>
1999
+
2000
+ <li style="background:none;border:none;padding:0;"><a id="agca_donate_button" target="_blank" style="margin-left:8px" title="Like this plugin? You can support its future development by giving a donation by your wish " href="http://wordpressadminpanel.com/agca-support/support-for-future-development/"><img alt="Donate" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>images/btn_donate_LG.gif" /></a>
2001
+ </li>
2002
+ <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
2003
+ </ul>
2004
+ <div id="agca_advertising">
2005
+ <ul>
2006
+ <li style="min-height:105px;display: block"></li>
2007
+ </ul>
2008
+ </div>
2009
+ <div class="agca-clear"></div>
2010
+ <div id="section_general" style="display:none" class="ag_section">
2011
+ <h2 class="section_title">General Settings</h2>
2012
+ <p tabindex="0" class="agca-clear agca-tip"><i><strong>Tip: </strong>Move mouse cursor over the option label to see more information about an option</i></p>
2013
+ <table class="agca-clear form-table" width="500px">
2014
+ <?php
2015
+
2016
+ $this->print_checkbox(array(
2017
+ 'name'=>'agca_role_allbutadmin',
2018
+ 'label'=>'Exclude AGCA admin from customizations',
2019
+ 'title'=>'<h3>Applying customizations</h3><br><strong>Checked</strong> - apply to all users, except admin<br><strong>Not checked</strong> - apply to everyone</br></br><strong>Q</strong>: Who is AGCA administrator?</br><strong>A</strong>: Go to <i>Advanced</i> tab and change capability option to define administrators. Only the users with selected capability will be AGCA administrators.</br>'
2020
+ ));
2021
+
2022
+ $this->print_options_h3('Pages');
2023
+
2024
+ $this->print_checkbox(array(
2025
+ 'hide'=>true,
2026
+ 'name'=>'agca_screen_options_menu',
2027
+ 'label'=>'"Screen Options" menu',
2028
+ 'title'=>'Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)'
2029
+ ));
2030
+
2031
+ $this->print_checkbox(array(
2032
+ 'hide'=>true,
2033
+ 'name'=>'agca_help_menu',
2034
+ 'label'=>'"Help" menu',
2035
+ 'title'=>'Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)'
2036
+ ));
2037
+
2038
+ $this->print_options_h3('Security');
2039
+
2040
+ ?>
2041
+
2042
+ <tr valign="center">
2043
+ <th scope="row">
2044
+ <label title="Choose which WordPress capability will be used to distinguish AGCA admin users from other users.</br>AGCA admin users have access to AGCA settings. AGCA administrators can be excluded from customizations if that option is checked" for="agca_admin_capability">AGCA admin capability:</label>
2045
+ </th>
2046
+ <td><?php echo $this->admin_capabilities; ?>&nbsp;&nbsp;<i>(<strong>Edit Dashboard</strong> - selected by default)</i>
2047
+ <p style="margin-left:5px;"><i>Find more information about <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">WordPress capabilities</a></i></p>
2048
+ </td>
2049
+ <td>
2050
+ </td>
2051
+ </tr>
2052
+ <?php
2053
+ $this->print_options_h3('Feedback and Support');
2054
+
2055
+ ?>
2056
+ <tr valign="center">
2057
+ <td colspan="2">
2058
+ <div class="agca-feedback-and-support">
2059
+ <ul>
2060
+ <li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=feature" target="_blank"><span class="dashicons dashicons-lightbulb"></span>&nbsp;&nbsp;Idea for improvement</a> - submit your idea for improvement </li>
2061
+ </ul>
2062
+ <ul>
2063
+ <li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=bug" target="_blank"><span class="dashicons dashicons-megaphone"></span>&nbsp;&nbsp;Report an issue</a> - if plugin does not work as expected </li>
2064
+ </ul>
2065
+ <ul>
2066
+ <li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=theme" target="_blank"><span class="dashicons dashicons-art"></span>&nbsp;&nbsp;Idea for admin theme</a> - submit your idea for admin theme </li>
2067
+ </ul>
2068
+ <ul>
2069
+ <li><a href="https://wordpress.org/support/view/plugin-reviews/ag-custom-admin" target="_blank"><span class="dashicons dashicons-awards"></span>&nbsp;&nbsp;Add a review on WordPress.org</a> - add your review and rate us on WordPress.org </li>
2070
+ </ul>
2071
+ <ul>
2072
+ <li><a href="http://wordpressadminpanel.com/agca-support/" target="_blank"><span class="dashicons dashicons-shield-alt"></span>&nbsp;&nbsp;Visit our support site</a> - for any other questions, feel free to contact us </li>
2073
+ </ul>
2074
+ <ul>
2075
+ <li><a href="http://wordpressadminpanel.com/agca-support/support-for-future-development/" target="_blank"><span class="dashicons dashicons-palmtree"></span>&nbsp;&nbsp;Donate</a> - only if you find this plugin helpful for your needs </li>
2076
+ </ul>
2077
+ </div>
2078
+ </td>
2079
+ <td></td>
2080
+ </tr>
2081
+ </table>
2082
+ </div>
2083
+ <div id="section_admin_bar" class="ag_section">
2084
+ <h2 class="section_title">Admin Bar Settings</h2>
2085
+ <table class="form-table" width="500px">
2086
+
2087
+ <?php
2088
+ $this->print_checkbox(array(
2089
+ 'attributes'=>array(
2090
+ 'class'=>'ag_table_major_options',
2091
+ ),
2092
+ 'hide'=>true,
2093
+ 'title'=>'Hides admin bar completely from the admin panel',
2094
+ 'name'=>'agca_header',
2095
+ 'label'=>'<strong>Admin bar</strong>',
2096
+ 'onchange'=>"if(jQuery('#agca_header').is(':checked')){jQuery('#agca_header_show_logout_content').show('slide');}else{jQuery('#agca_header_show_logout_content').hide('slide');};"
2097
+ ));
2098
+
2099
+ $this->print_checkbox(array(
2100
+ 'attributes'=>array(
2101
+ 'class'=>'ag_table_major_options',
2102
+ 'id'=>'agca_header_show_logout_content',
2103
+ 'style'=>(get_option('agca_header')==true)?"":"display:none"
2104
+ ),
2105
+ 'title'=>'Check this if you want to show Log Out button in top right corner of the admin page',
2106
+ 'name'=>'agca_header_show_logout',
2107
+ 'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2108
+ 'label'=>'<strong>(but show Log Out button)</strong>'
2109
+ ));
2110
+
2111
+ $this->print_checkbox(array(
2112
+ 'title'=>'Removes admin bar customizations for authenticated users on site pages.</br>This option can be useful if you want to remove AGCA scripts (styles, JavaScript) on your website for any reason.',
2113
+ 'name'=>'agca_admin_bar_frontend',
2114
+ 'hide'=>true,
2115
+ 'label'=>'Site pages: Admin bar customizations'
2116
+ ));
2117
+
2118
+ $this->print_checkbox(array(
2119
+ 'title'=>'Hides admin bar completely for authenticated users on site pages.',
2120
+ 'name'=>'agca_admin_bar_frontend_hide',
2121
+ 'hide'=>true,
2122
+ 'label'=>'Site pages: Admin bar'
2123
+ ));
2124
+
2125
+ $this->print_options_h3('Left Side');
2126
+
2127
+ $this->print_input(array(
2128
+ 'title'=>'Change default WordPress logo with custom image.',
2129
+ 'name'=>'agca_wp_logo_custom',
2130
+ 'label'=>'Admin bar logo',
2131
+ 'hint' =>'Image URL (maximum height is 28px)'
2132
+ ));
2133
+
2134
+ $this->print_input(array(
2135
+ 'title'=>'Custom link on admin bar logo.</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL</br><strong>%SWITCH%</strong> - to switch betweent admin and site area',
2136
+ 'name'=>'agca_wp_logo_custom_link',
2137
+ 'label'=>'Admin bar logo link',
2138
+ 'hint' =>'Link'
2139
+ ));
2140
+
2141
+ $this->print_input(array(
2142
+ 'title'=>'Customize WordPress title using custom title template.</br></br>Examples:</br><strong>%BLOG% -- %PAGE%</strong> (will be) <i>My Blog -- Add New Post</i></br><strong>%BLOG%</strong> (will be) <i>My Blog</i></br><strong>My Company > %BLOG% > %PAGE%</strong> (will be) <i>My Company > My Blog > Tools</i>',
2143
+ 'name'=>'agca_custom_title',
2144
+ 'label'=>'Page title template',
2145
+ 'hint' =>'Please use <strong>%BLOG%</strong> and <strong>%PAGE%</strong> in your title template.'
2146
+ ));
2147
+
2148
+ $this->print_input(array(
2149
+ 'title'=>'Add custom image on the top of the admin content.',
2150
+ 'name'=>'agca_header_logo_custom',
2151
+ 'label'=>'Header image',
2152
+ 'hint' =>'Image URL'
2153
+ ));
2154
+
2155
+
2156
+ $this->print_checkbox(array(
2157
+ 'hide'=>true,
2158
+ 'title'=>'Hides small Wordpress logo from the admin bar',
2159
+ 'name'=>'agca_header_logo',
2160
+ 'label'=>'WordPress logo'
2161
+ ));
2162
+
2163
+ $this->print_checkbox(array(
2164
+ 'hide'=>true,
2165
+ 'title'=>'Hides WordPress context menu on WordPress logo icon from admin bar',
2166
+ 'name'=>'agca_remove_top_bar_dropdowns',
2167
+ 'label'=>'WordPress logo context menu'
2168
+ ));
2169
+
2170
+ $this->print_checkbox(array(
2171
+ 'hide'=>true,
2172
+ 'title'=>'Hides site name link from the admin bar',
2173
+ 'name'=>'agca_remove_site_link',
2174
+ 'label'=>'Site name'
2175
+ ));
2176
+
2177
+ $this->print_checkbox(array(
2178
+ 'hide'=>true,
2179
+ 'title'=>'Hides update notifications from admin bar',
2180
+ 'name'=>'agca_admin_bar_update_notifications',
2181
+ 'label'=>'Update notifications'
2182
+ ));
2183
+
2184
+ $this->print_checkbox(array(
2185
+ 'hide'=>true,
2186
+ 'title'=>'Hides comments block from admin bar',
2187
+ 'name'=>'agca_admin_bar_comments',
2188
+ 'label'=>'"Comments" block'
2189
+ ));
2190
+
2191
+ $this->print_checkbox(array(
2192
+ 'hide'=>true,
2193
+ 'attributes'=>array(
2194
+ 'style'=>'margin-top:20px;'
2195
+ ),
2196
+ 'title'=>'Hides "+ New" block and its context menu from admin bar',
2197
+ 'name'=>'agca_admin_bar_new_content',
2198
+ 'label'=>'"+ New" block',
2199
+ 'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2200
+ 'input-class'=>'has-dependant dependant-opposite'
2201
+ ));
2202
+
2203
+ $this->print_checkbox(array(
2204
+ 'hide'=>true,
2205
+ 'attributes'=>array(
2206
+ 'class'=>'new_content_header_submenu'
2207
+ ),
2208
+ 'title'=>'Hides "Post" sub-menu from "+ New" block on admin bar',
2209
+ 'name'=>'agca_admin_bar_new_content_post',
2210
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Post sub-menu'
2211
+ ));
2212
+
2213
+ $this->print_checkbox(array(
2214
+ 'hide'=>true,
2215
+ 'attributes'=>array(
2216
+ 'class'=>'new_content_header_submenu'
2217
+ ),
2218
+ 'title'=>'Hides "Link" sub-menu from "+ New" block on admin bar',
2219
+ 'name'=>'agca_admin_bar_new_content_link',
2220
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Link sub-menu'
2221
+ ));
2222
+
2223
+ $this->print_checkbox(array(
2224
+ 'hide'=>true,
2225
+ 'attributes'=>array(
2226
+ 'class'=>'new_content_header_submenu'
2227
+ ),
2228
+ 'title'=>'Hides "Page" sub-menu from "+ New" block on admin bar',
2229
+ 'name'=>'agca_admin_bar_new_content_page',
2230
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Page sub-menu'
2231
+ ));
2232
+
2233
+ $this->print_checkbox(array(
2234
+ 'hide'=>true,
2235
+ 'attributes'=>array(
2236
+ 'class'=>'new_content_header_submenu'
2237
+ ),
2238
+ 'title'=>'Hides "User" sub-menu from "+ New" block on admin bar',
2239
+ 'name'=>'agca_admin_bar_new_content_user',
2240
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> User sub-menu'
2241
+ ));
2242
+
2243
+ $this->print_checkbox(array(
2244
+ 'hide'=>true,
2245
+ 'attributes'=>array(
2246
+ 'class'=>'new_content_header_submenu'
2247
+ ),
2248
+ 'title'=>'Hides "Media" sub-menu from "+ New" block on admin bar',
2249
+ 'name'=>'agca_admin_bar_new_content_media',
2250
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Media sub-menu'
2251
+ ));
2252
+
2253
+ $this->print_checkbox(array(
2254
+ 'hide'=>true,
2255
+ 'title'=>'Hides "Admin themes" from admin bar',
2256
+ 'name'=>'agca_admin_bar_admin_themes',
2257
+ 'label'=>'"Admin themes"'
2258
+ ));
2259
+
2260
+ $this->print_textarea(array(
2261
+ 'title'=>'Adds custom text in admin top bar.',
2262
+ 'name'=>'agca_custom_site_heading',
2263
+ 'label'=>'Custom blog heading',
2264
+ 'hint'=>"<strong>Tip: </strong>You can use HTML tags like &lt;h1&gt; or &lt;a&gt;"
2265
+ ));
2266
+
2267
+
2268
+ $this->print_checkbox(array(
2269
+ 'hide'=>true,
2270
+ 'title'=>'Hides yellow bar with information about new WordPress release',
2271
+ 'name'=>'agca_update_bar',
2272
+ 'label'=>'Update WordPress notification'
2273
+ ));
2274
+
2275
+ $this->print_options_h3('Right Side');
2276
+
2277
+ $this->print_input(array(
2278
+ 'name'=>'agca_howdy',
2279
+ 'label'=>'Change Howdy text',
2280
+ ));
2281
+
2282
+ $this->print_input(array(
2283
+ 'title'=>'Put \'Exit\', for example',
2284
+ 'name'=>'agca_logout',
2285
+ 'label'=>'Change Log out text',
2286
+ ));
2287
+
2288
+ $this->print_checkbox(array(
2289
+ 'hide'=>true,
2290
+ 'name'=>'agca_remove_your_profile',
2291
+ 'label'=>'"Edit My Profile" option from dropdown menu'
2292
+ ));
2293
+
2294
+ $this->print_checkbox(array(
2295
+ 'title'=>'If selected, hides all elements in top right corner, except Log Out button',
2296
+ 'name'=>'agca_logout_only',
2297
+ 'label'=>'Log out only'
2298
+ ));
2299
+
2300
+ ?>
2301
+
2302
+ </table>
2303
+ </div>
2304
+
2305
+ <div id="section_admin_footer" style="display:none" class="ag_section">
2306
+ <h2 class="section_title">Admin Footer Settings</h2>
2307
+ <table class="form-table" width="500px">
2308
+ <?php
2309
+ $this->print_checkbox(array(
2310
+ 'hide'=>true,
2311
+ 'attributes'=>array(
2312
+ 'class'=>'ag_table_major_options'
2313
+ ),
2314
+ 'title'=>'Hides footer with all elements',
2315
+ 'name'=>'agca_footer',
2316
+ 'label'=>'<strong>Footer</strong>'
2317
+ ));
2318
+
2319
+ $this->print_options_h3('Footer Options');
2320
+
2321
+ $this->print_checkbox(array(
2322
+ 'hide'=>true,
2323
+ 'title'=>'Hides default text in footer',
2324
+ 'name'=>'agca_footer_left_hide',
2325
+ 'label'=>'Footer text'
2326
+ ));
2327
+
2328
+ $this->print_textarea(array(
2329
+ 'title'=>'Replaces text \'Thank you for creating with WordPress\' with custom text',
2330
+ 'name'=>'agca_footer_left',
2331
+ 'label'=>'Change footer text'
2332
+ ));
2333
+
2334
+ $this->print_checkbox(array(
2335
+ 'hide'=>true,
2336
+ 'title'=>'Hides text \'Get Version ...\' on right',
2337
+ 'name'=>'agca_footer_right_hide',
2338
+ 'label'=>'Version text'
2339
+ ));
2340
+
2341
+ $this->print_textarea(array(
2342
+ 'title'=>'Replaces text \'Get Version ...\' with custom text',
2343
+ 'name'=>'agca_footer_right',
2344
+ 'label'=>'Change version text'
2345
+ ));
2346
+
2347
+ ?>
2348
+
2349
+ </table>
2350
+ </div>
2351
+ <div id="section_dashboard_page" style="display:none" class="ag_section">
2352
+ <h2 class="section_title">Dashboard Page Settings</h2>
2353
+ <table class="form-table" width="500px">
2354
+ <?php
2355
+
2356
+ $this->print_options_h3('Dashboard Page Options');
2357
+
2358
+ $this->print_input(array(
2359
+ 'title'=>"Main heading ('Dashboard') on Dashboard page",
2360
+ 'name'=>'agca_dashboard_text',
2361
+ 'label'=>'Change Dashboard heading text',
2362
+ ));
2363
+
2364
+ ?>
2365
+ <tr valign="center">
2366
+ <th scope="row">
2367
+ <label title="Adds custom text (or HTML) between heading and widgets area on Dashboard page" for="agca_dashboard_text_paragraph">Add custom Dashboard content<br> <em>(text or HTML content)</em></label>
2368
+ </th>
2369
+ <td class="agca_editor">
2370
+ <?php $this->getTextEditor('agca_dashboard_text_paragraph'); ?>
2371
+ </td>
2372
+ </tr>
2373
+ <?php
2374
+
2375
+ $this->print_options_h3('Dashboard Widgets Options');
2376
+
2377
+ ?>
2378
+ <tr>
2379
+ <td colspan="2">
2380
+ <p tabindex="0" class="agca-tip"><i><strong>Note:</strong> These settings override settings in Screen options on Dashboard page.</i></p>
2381
+ </td>
2382
+ </tr>
2383
+ <?php
2384
+ $this->print_checkbox(array(
2385
+ 'hide'=>true,
2386
+ 'title'=>'Hides Welcome WordPress widget',
2387
+ 'name'=>'agca_dashboard_widget_welcome',
2388
+ 'label'=>'"Welcome" widget'
2389
+ ));
2390
+
2391
+ $this->print_checkbox(array(
2392
+ 'hide'=>true,
2393
+ 'title'=>'Hides Activity dashboard widget',
2394
+ 'name'=>'agca_dashboard_widget_activity',
2395
+ 'label'=>'"Activity" widget'
2396
+ ));
2397
+
2398
+ $this->print_checkbox(array(
2399
+ 'hide'=>true,
2400
+ 'title'=>'Hides Quick Draft dashboard widget',
2401
+ 'name'=>'agca_dashboard_widget_qp',
2402
+ 'label'=>'"Quick Draft" widget'
2403
+ ));
2404
+
2405
+ $this->print_checkbox(array(
2406
+ 'hide'=>true,
2407
+ 'title'=>'Hides At a Glance dashboard widget',
2408
+ 'name'=>'agca_dashboard_widget_rn',
2409
+ 'label'=>'"At a Glance" widget'
2410
+ ));
2411
+
2412
+ $this->print_checkbox(array(
2413
+ 'hide'=>true,
2414
+ 'name'=>'agca_dashboard_widget_primary',
2415
+ 'title'=>"This is 'WordPress News' or 'WordPress Development Blog' widget in older WordPress versions",
2416
+ 'label'=>'"WordPress News" widget'
2417
+ ));
2418
+
2419
+ $this->print_checkbox(array(
2420
+ 'hide'=>true,
2421
+ 'name'=>'agca_dashboard_widget_secondary',
2422
+ 'title'=>"This is 'Other WordPress News' widget by default",
2423
+ 'label'=>'Secondary widget area'
2424
+ ));
2425
+
2426
+ ?>
2427
+ </table>
2428
+ </div>
2429
+ <div id="section_login_page" style="display:none" class="ag_section">
2430
+ <h2 class="section_title">Login Page Settings</h2>
2431
+ <table class="form-table" width="500px">
2432
+ <?php
2433
+
2434
+ $this->print_options_h3('Login Page Options');
2435
+
2436
+ $this->print_checkbox(array(
2437
+ 'hide'=>true,
2438
+ 'name'=>'agca_login_banner',
2439
+ 'title'=>"Hide back to blog block",
2440
+ 'label'=>'Back to blog text'
2441
+ ));
2442
+
2443
+ $this->print_textarea(array(
2444
+ 'name'=>'agca_login_banner_text',
2445
+ 'title'=>"Changes '<- Back to ...' text in top bar on Login page",
2446
+ 'label'=>'Change back to blog text',
2447
+ 'hint'=>'Should be wrapped with an anchor tag &lt;a&gt;&lt;/a&gt;'
2448
+ ));
2449
+
2450
+ $this->print_input(array(
2451
+ 'title'=>'If this field is not empty, image from provided url will be visible on Login page',
2452
+ 'name'=>'agca_login_photo_url',
2453
+ 'label'=>'Change Login header image',
2454
+ 'hint'=>'Image URL'
2455
+ ));
2456
+
2457
+ $this->print_input(array(
2458
+ 'title'=>'Put here custom link to a web location, that will be triggered on image click',
2459
+ 'name'=>'agca_login_photo_href',
2460
+ 'label'=>'Change link on login image',
2461
+ 'hint'=>'For blog URL use %BLOG%'
2462
+ ));
2463
+
2464
+ $this->print_checkbox(array(
2465
+ 'hide'=>true,
2466
+ 'title'=>'Hides login image completely',
2467
+ 'name'=>'agca_login_photo_remove',
2468
+ 'label'=>'Login header image',
2469
+ ));
2470
+
2471
+ $this->print_checkbox(array(
2472
+ 'title'=>'Rounds box on login page',
2473
+ 'name'=>'agca_login_round_box',
2474
+ 'label'=>'Round box corners',
2475
+ 'input-class'=>'has-dependant',
2476
+ 'input-attributes'=>'data-dependant="#agca_login_round_box_size_block"'
2477
+ ));
2478
+
2479
+ $this->print_input(array(
2480
+ 'attributes'=>array(
2481
+ 'style'=> ((get_option('agca_login_round_box')=='true')?'display:none':''),
2482
+ 'id'=>'agca_login_round_box_size_block'
2483
+ ),
2484
+ 'title'=>'Size of rounded box curve',
2485
+ 'name'=>'agca_login_round_box_size',
2486
+ 'label'=>'Round box corners - size',
2487
+ 'input-class'=>'validateNumber',
2488
+ 'suffix'=>'&nbsp;(px)'
2489
+ ));
2490
+
2491
+ $this->print_checkbox(array(
2492
+ 'hide'=>true,
2493
+ 'title'=>'Hides register link on login page',
2494
+ 'name'=>'agca_login_register_remove',
2495
+ 'label'=>'Register link',
2496
+ 'input-class'=>'has-dependant dependant-opposite',
2497
+ 'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2498
+ ));
2499
+
2500
+ $this->print_input(array(
2501
+ 'attributes'=>array(
2502
+ 'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2503
+ 'id'=>'agca_login_register_href_block'
2504
+ ),
2505
+ 'title'=>'Change register link on login page to point to your custom registration page.',
2506
+ 'name'=>'agca_login_register_href',
2507
+ 'label'=>'Change register link',
2508
+ ));
2509
+
2510
+ $this->print_checkbox(array(
2511
+ 'hide'=>true,
2512
+ 'title'=>'Hides lost password link on login page',
2513
+ 'name'=>'agca_login_lostpassword_remove',
2514
+ 'label'=>'Lost password link',
2515
+ ));
2516
+ ?>
2517
+ </table>
2518
+ </div>
2519
+ <?php
2520
+ /*ADMIN MENU*/
2521
+ ?>
2522
+ <div id="section_admin_menu" style="display:none" class="ag_section">
2523
+ <h2 class="section_title">Admin Menu Settings</h2>
2524
+ <table class="form-table" width="500px">
2525
+ <tr valign="center" class="ag_table_major_options">
2526
+ <td><label for="agca_admin_menu_turnonoff"><strong>Apply admin menu customizations</strong></label></td>
2527
+ <td>
2528
+ <strong>
2529
+
2530
+ <input class="agca-radio" type="radio" id="agca_admin_menu_turnonoff_on" name="agca_admin_menu_turnonoff" title="Apply admin menu customizations" value="on" <?php if(get_option('agca_admin_menu_turnonoff') == 'on') echo 'checked="checked" '; ?> />
2531
+ <span class="agca-radio-text on">YES</span>
2532
+ &nbsp;&nbsp;&nbsp;&nbsp;
2533
+ <input class="agca-radio" type="radio" name="agca_admin_menu_turnonoff" title="Do not apply admin menu customizations" value="off" <?php if(get_option('agca_admin_menu_turnonoff') != 'on') echo 'checked="checked"'; ?> />
2534
+ <span class="agca-radio-text off">NO</span>
2535
+ </strong>
2536
+ </td>
2537
+ </tr>
2538
+ <tr valign="center" class="ag_table_major_options">
2539
+ <td><label for="agca_admin_menu_agca_button_only"><strong>Admin menu</strong></label></td>
2540
+ <td><input class="agca-checkbox visibility" type="checkbox" name="agca_admin_menu_agca_button_only" title="Hides admin menu completly (administrator can see 'AG custom admin' button)" value="true" <?php if (get_option('agca_admin_menu_agca_button_only')==true) echo 'checked="checked" '; ?> /></td>
2541
+ </tr>
2542
+ <?php
2543
+ $this->print_options_h3('Edit / Remove Menu Items');
2544
+ ?>
2545
+ <tr>
2546
+ <td colspan="2">
2547
+ <input type="button" class="agca_button" id="ag_edit_adminmenu_reset_button" title="Reset menu settings to default values" name="ag_edit_adminmenu_reset_button" value="Reset to default settings" /><br />
2548
+ <p tabindex="0"><em>(click on the top menu item to show its sub-menus)</em></p>
2549
+ <table id="ag_edit_adminmenu">
2550
+ <tr style="background-color:#999;">
2551
+ <td width="300px"><div style="float:left;color:#fff;"><h3>Item</h3></div><div style="float:right;color:#fff;"><h3>Visibility</h3></div></td><td width="300px" style="color:#fff;" ><h3>Change Text</h3>
2552
+ </td>
2553
+ </tr>
2554
+ </table>
2555
+ <input type="hidden" size="47" id="ag_edit_adminmenu_json" name="ag_edit_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_edit_adminmenu_json')); ?>" />
2556
+ <input type="hidden" size="47" id="ag_edit_adminmenu_json_new" name="ag_edit_adminmenu_json_new" value="" />
2557
+ </td>
2558
+ <td></td>
2559
+ </tr>
2560
+ <?php
2561
+ $this->print_options_h3('Add New Menu Items');
2562
+ ?>
2563
+ <tr>
2564
+ <td colspan="2">
2565
+ <table id="ag_add_adminmenu">
2566
+ <tr>
2567
+ <td colspan="2">
2568
+ name:<input type="text" size="47" title="New button visible name" id="ag_add_adminmenu_name" name="ag_add_adminmenu_name" />
2569
+ url:<input type="text" size="47" title="New button link" id="ag_add_adminmenu_url" name="ag_add_adminmenu_url" />
2570
+ open in:<select id="ag_add_adminmenu_target" class="agca-selectbox" style="width:95px">
2571
+ <option value="_self" selected>same tab</option>
2572
+ <option value="_blank" >new tab</option>
2573
+ </select>
2574
+ <input type="button" id="ag_add_adminmenu_button" class="agca_button" title="Add new item button" name="ag_add_adminmenu_button" value="Add new item" />
2575
+ </td><td></td>
2576
+ </tr>
2577
+ </table>
2578
+ <input type="hidden" size="47" id="ag_add_adminmenu_json" name="ag_add_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_add_adminmenu_json')); ?>" />
2579
+ </td>
2580
+ <td>
2581
+ </td>
2582
+ </tr>
2583
+ <?php
2584
+ $this->print_options_h3('Admin Menu Settings');
2585
+ ?>
2586
+ <tr valign="center">
2587
+ <th scope="row">
2588
+ <label title="Choose how admin menu should behave on mobile devices / small screens" for="agca_admin_menu_autofold">Admin menu auto folding</label>
2589
+ </th>
2590
+ <td>
2591
+ <select title="Choose how admin menu should behave on mobile devices / small screens" class="agca-selectbox" name="agca_admin_menu_autofold" >
2592
+ <option value="" <?php echo (get_option('agca_admin_menu_autofold') == "")?" selected ":""; ?> >Default</option>
2593
+ <option value="force" <?php echo (get_option('agca_admin_menu_autofold') == "force")?" selected ":""; ?> >Force admin menu auto-folding</option>
2594
+ <option value="disable" <?php echo (get_option('agca_admin_menu_autofold') == "disable")?" selected ":""; ?> >Disable admin menu auto-folding</option>
2595
+ </select>
2596
+ </td>
2597
+ </tr>
2598
+ <?php
2599
+
2600
+ $this->print_checkbox(array(
2601
+ 'hide'=>true,
2602
+ 'title'=>'Removes empty space between some top menu items',
2603
+ 'name'=>'agca_admin_menu_separators',
2604
+ 'label'=>'Menu items separators',
2605
+ ));
2606
+
2607
+ $this->print_checkbox(array(
2608
+ 'hide'=>true,
2609
+ 'title'=>'Removes icons from dmin menu buttons',
2610
+ 'name'=>'agca_admin_menu_icons',
2611
+ 'label'=>'Menu icons',
2612
+ ));
2613
+
2614
+ $this->print_checkbox(array(
2615
+ 'hide'=>true,
2616
+ 'title'=>'Removes small arrow that appears on the top button hover',
2617
+ 'name'=>'agca_admin_menu_arrow',
2618
+ 'label'=>'Sub-menu arrow',
2619
+ ));
2620
+
2621
+ $this->print_checkbox(array(
2622
+ 'hide'=>true,
2623
+ 'title'=>'Removes collapse button at the end of admin menu',
2624
+ 'name'=>'agca_admin_menu_collapse_button',
2625
+ 'label'=>'"Collapse menu" button',
2626
+ ));
2627
+
2628
+ $this->print_checkbox(array(
2629
+ 'title'=>'Rounds submenu pop-up box',
2630
+ 'name'=>'agca_admin_menu_submenu_round',
2631
+ 'label'=>'Round sub-menu pop-up box',
2632
+ 'input-class'=>'has-dependant',
2633
+ ));
2634
+
2635
+ $this->print_input(array(
2636
+ 'attributes'=>array(
2637
+ 'style'=> ((get_option('agca_admin_menu_submenu_round')=='true')?'display:none':''),
2638
+ 'id'=>'agca_admin_menu_submenu_round_block'
2639
+ ),
2640
+ 'title'=>'Size of rounded box curve',
2641
+ 'name'=>'agca_admin_menu_submenu_round_size',
2642
+ 'label'=>'Round sub-menu pop-up box - size',
2643
+ 'input-class'=>'validateNumber',
2644
+ 'suffix'=>'&nbsp;(px)'
2645
+ ));
2646
+
2647
+ $this->print_input(array(
2648
+ 'title'=>'Adds custom logo above the admin menu',
2649
+ 'name'=>'agca_admin_menu_brand',
2650
+ 'label'=>'Admin menu branding with logo',
2651
+ 'hint'=>'Image URL'
2652
+ ));
2653
+
2654
+ $this->print_input(array(
2655
+ 'title'=>'Change branding logo link</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL',
2656
+ 'name'=>'agca_admin_menu_brand_link',
2657
+ 'label'=>'Branding logo link',
2658
+ 'hint'=>'Branding image URL'
2659
+ ));
2660
+ ?>
2661
+ </table>
2662
+ </div>
2663
+ <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
2664
+ <h2 class="section_title">Colorizer Page</h2>
2665
+ <table class="form-table" width="500px">
2666
+ <tr valign="center" class="ag_table_major_options">
2667
+ <td><label for="agca_colorizer_turnonoff"><strong>Apply Colorizer settings</strong></label></td>
2668
+ <td><strong><input class="agca-radio" type="radio" name="agca_colorizer_turnonoff" title="Apply Colorizer customizations" value="on" <?php if(get_option('agca_colorizer_turnonoff') == 'on') echo 'checked="checked" '; ?> /><span class="agca-radio-text on">YES</span>&nbsp;&nbsp;&nbsp;&nbsp;<input class="agca-radio" type="radio" name="agca_colorizer_turnonoff" title="Do not apply Colorizer customizations" value="off" <?php if(get_option('agca_colorizer_turnonoff') != 'on') echo 'checked="checked"'; ?> /><span class="agca-radio-text off">NO</span></strong></td>
2669
+ </tr>
2670
+ <?php
2671
+ $this->print_options_h3('Global Color Options');
2672
+
2673
+ $this->print_color('color_background','Background:','Change admin page background color');
2674
+ $this->print_color('login_color_background','Login page background:','Change login page background color');
2675
+ $this->print_color('color_header','Admin bar:','Change admin bar (on top) color in admin panel');
2676
+
2677
+ $this->print_options_h3('Admin Menu Color Options');
2678
+
2679
+ $this->print_color('color_admin_menu_top_button_background','Button background:','Change button background color');
2680
+ $this->print_color('color_admin_menu_font','Button text:','Change button text color');
2681
+ $this->print_color('color_admin_menu_top_button_current_background','Selected button background:','Change button background color for current button');
2682
+ $this->print_color('color_admin_menu_top_button_hover_background','Hover button background:','Change button background color on mouseover');
2683
+ $this->print_color('color_admin_menu_submenu_background','Sub-menu button background:','Change submenu item background color');
2684
+ $this->print_color('color_admin_menu_submenu_background_hover','Sub-menu hover button background:','Change submenu item background color on mouseover');
2685
+ $this->print_color('color_admin_submenu_font','Sub-menu text:','Sub-menu text color');
2686
+ $this->print_color('color_admin_menu_behind_background','Wrapper background:','Change background color of element behind admin menu');
2687
+
2688
+ $this->print_options_h3('Font Color Options');
2689
+
2690
+ $this->print_color('color_font_content','Content text:','Change color in content text');
2691
+ $this->print_color('color_font_header','Admin bar text:','Change color of admin bar text');
2692
+ $this->print_color('color_font_footer','Footer text:','Change color in fotter text');
2693
+
2694
+ $this->print_options_h3('Widgets Color Options');
2695
+
2696
+ $this->print_color('color_widget_bar','Title bar background:','Change color in header text');
2697
+ $this->print_color('color_widget_background','Background:','Change widget background color');
2698
+
2699
+ ?>
2700
+ </table>
2701
+ <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
2702
+ <div id="picker"></div>
2703
+ </div>
2704
+ <div id="section_templates" style="display:none" class="ag_section">
2705
+ <h2 class="section_title"><span style="float:left">Admin Themes</span></h2>
2706
+ <table class="form-table" width="500px">
2707
+ <tr valign="center">
2708
+ <td>
2709
+ <div id="agca_templates"></div>
2710
+ </td>
2711
+ </tr>
2712
+ <tr>
2713
+ <td>
2714
+ <div id="advanced_template_options" style="display:none">
2715
+ <div class="agca-feedback-and-support">
2716
+ <ul>
2717
+ <li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=theme" title="If you have any ideas for theme improvements, or you have new themes requests, please feel free to send us a message" target="_blank"><span class="dashicons dashicons-art"></span>&nbsp;&nbsp;Submit your admin themes ideas</a></li>
2718
+ <li><a style="background: #f08080;color:#fff;" href="javascript:agca_removeAllTemplates();" title="WARNING: All installed themes will be removed. To activate them again, you would need to install theme and activate using valid license keys. Free themes can be installed again."><span style="color:#fff" class="dashicons dashicons-trash"></span>&nbsp;&nbsp;Uninstall all installed themes</a></li>
2719
+ </ul>
2720
+ </div>
2721
+ </div>
2722
+ </td>
2723
+ </tr>
2724
+ </table>
2725
+ </div>
2726
+ <div id="section_advanced" style="display:none" class="ag_section">
2727
+ <h2 class="section_title">Advanced</h2>
2728
+ <table class="form-table" width="500px">
2729
+ <tr valign="center">
2730
+ <td colspan="2">
2731
+ <p class="agca-tip"><i><strong>Note: </strong>These options will override existing customizations</i></p>
2732
+ </td><td></td>
2733
+ </tr>
2734
+ <tr valign="center">
2735
+ <th scope="row">
2736
+ <label title="Add custom CSS script to override existing styles" for="agca_script_css">Custom CSS script</em></label>
2737
+ </th>
2738
+ <td>
2739
+ <textarea style="width:100%;height:200px" title="Add custom CSS script to override existing styles" rows="5" id="agca_custom_css" name="agca_custom_css" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_css')); ?></textarea>
2740
+ </td>
2741
+ </tr>
2742
+ <tr valign="center">
2743
+ <th scope="row">
2744
+ <label title="Add additional custom JavaScript" for="agca_custom_js">Custom JavaScript</label>
2745
+ </th>
2746
+ <td>
2747
+ <textarea style="width:100%;height:200px" title="Add additional custom JavaScript" rows="5" name="agca_custom_js" id="agca_custom_js" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_js')); ?></textarea>
2748
+ </td>
2749
+ </tr>
2750
+ <tr valign="center">
2751
+ <th scope="row">
2752
+ <label title="Export / import settings" for="agca_export_import">Export / import settings</label>
2753
+ </th>
2754
+ <td id="import_file_area">
2755
+ <input class="agca_button" type="button" name="agca_export_settings" value="Export Settings" onclick="exportSettings();"/></br>
2756
+ <input type="file" id="settings_import_file" name="settings_import_file" style="display: none"/>
2757
+ <input type="hidden" id="_agca_import_settings" name="_agca_import_settings" value="false" />
2758
+ <input type="hidden" id="_agca_export_settings" name="_agca_export_settings" value="false" />
2759
+ <input class="agca_button" type="button" name="agca_import_settings" value="Import Settings" onclick="importSettings();"/>
2760
+ </td>
2761
+ </tr>
2762
+ </table>
2763
+ </div>
2764
+ <p class="submit">
2765
+ <input type="button" id="save_plugin_settings" style="padding:0px" title="Save AG Custom Admin configuration" class="button-primary" value="<?php _e('Save Changes') ?>" onClick="savePluginSettings()" />
2766
+ </p>
2767
+
2768
+ </form>
2769
+ <form id="agca_templates_form" name="agca_templates_form" action="<?php echo $_SERVER['PHP_SELF'];?>?page=ag-custom-admin/plugin.php" method="post">
2770
+ <input type="hidden" name="_agca_save_template" value="true" />
2771
+ <input type="hidden" id="templates_data" name="templates_data" value="" />
2772
+ <input type="hidden" id="templates_name" name="templates_name" value="" />
2773
+ </form>
2774
+ </div>
2775
+ <?php
2776
+ }
2777
+
2778
+ #region PRIVATE METHODS
2779
+ function print_checkbox($data){
2780
+ $strAttributes = '';
2781
+ $strOnchange = '';
2782
+ $strInputClass='';
2783
+ $strInputAttributes='';
2784
+ $isChecked = false;
2785
+
2786
+ if(isset($data['attributes'])){
2787
+ foreach($data['attributes'] as $key=>$val){
2788
+ $strAttributes.=' '.$key.'="'.$val.'"';
2789
+ }
2790
+ }
2791
+ if(isset($data['input-class'])){
2792
+ $strInputClass = $data['input-class'];
2793
+ }
2794
+ if(isset($data['hide'])){
2795
+ $strInputClass .= " visibility";
2796
+ }
2797
+ if(isset($data['input-attributes'])){
2798
+ $strInputAttributes = $data['input-attributes'];
2799
+ }
2800
+ if(isset($data['onchange'])){
2801
+ $strOnchange = $data['onchange'];
2802
+ }
2803
+ if(!isset($data['title'])){
2804
+ $data['title'] = $data['label'];
2805
+ }
2806
+ if(isset($data['checked'])){
2807
+ $isChecked = $data['checked'];
2808
+ }else{
2809
+ //use default check with the option
2810
+ $isChecked = get_option($data['name'])==true;
2811
+ }
2812
+ ?>
2813
+ <tr valign="center" <?= $strAttributes ?> >
2814
+ <th>
2815
+ <label tabindex="0" title='<?= $data['title'] ?>' for="<?= $data['name'] ?>" ><?= $data['label'] ?></label>
2816
+ </th>
2817
+ <td>
2818
+ <input type="checkbox" class="agca-checkbox <?= $strInputClass ?> " <?= $strOnchange ?> <?= $strInputAttributes ?> title='<?= $data['title'] ?>' name="<?= $data['name'] ?>" value="true" <?= ($isChecked)?' checked="checked"':'' ?> />
2819
+ </td>
2820
+ </tr>
2821
+ <?php
2822
+ }
2823
+ function print_input($data){
2824
+ $strHint = '';
2825
+ $suffix ='';
2826
+ if(isset($data['hint'])){
2827
+ $strHint = '&nbsp;<p><i>'.$data['hint'].'</i></p>';
2828
+ }
2829
+ if(!isset($data['title'])){
2830
+ $data['title'] = $data['label'];
2831
+ }
2832
+ if(isset($data['suffix'])){
2833
+ $suffix = $data['suffix'];
2834
+ }
2835
+ ?>
2836
+ <tr valign="center">
2837
+ <th >
2838
+ <label title="<?= $data['title'] ?>" for="<?= $data['name'] ?>"><?= $data['label'] ?></label>
2839
+ </th>
2840
+ <td>
2841
+ <input id="<?= $data['name'] ?>" title="<?= $data['title'] ?>" type="text" size="47" name="<?= $data['name'] ?>" value="<?php echo get_option($data['name']); ?>" />
2842
+ <a title="Clear" class="agca_button clear" onClick="jQuery('#<?= $data['name'] ?>').val('');"><span class="dashicons clear dashicons-no-alt"></span></a><?= $suffix ?>
2843
+ <?= $strHint ?>
2844
+ </td>
2845
+ </tr>
2846
+ <?php
2847
+ }
2848
+ function print_textarea($data){
2849
+ $strHint = '';
2850
+ if(isset($data['hint'])){
2851
+ $strHint = '&nbsp;<p><i>'.$data['hint'].'</i>.</p>';
2852
+ }
2853
+ if(!isset($data['title'])){
2854
+ $data['title'] = $data['label'];
2855
+ }
2856
+ ?>
2857
+ <tr valign="center">
2858
+ <th scope="row">
2859
+ <label title="<?= $data['title'] ?>" for="<?= $data['name'] ?>"><?= $data['label'] ?></label>
2860
+ </th>
2861
+ <td>
2862
+ <textarea title="<?= $data['title'] ?>" rows="5" name="<?= $data['name'] ?>" cols="40"><?php echo htmlspecialchars(get_option($data['name'])); ?></textarea>
2863
+ <?= $strHint ?>
2864
+ </td>
2865
+ </tr>
2866
+ <?php
2867
+ }
2868
+ function print_color($name, $label, $title){
2869
+ ?>
2870
+ <tr valign="center" class="color">
2871
+ <th><label title="<?= $title ?>" for="<?= $name ?>"><?= $label ?></label></th>
2872
+ <td><input type="text" id="<?= $name ?>" name="<?= $name ?>" class="color_picker" value="<?php echo $this->getAGCAColor($name); ?>" />
2873
+ <a title="Pick Color" alt="<?= $name ?>" class="pick_color_button agca_button"><span class="dashicons dashicons-art"></span></a>
2874
+ <a title="Clear" alt="<?= $name ?>" class="pick_color_button_clear agca_button" ><span class="dashicons clear dashicons-no-alt"></span></a>
2875
+ </td>
2876
+ </tr>
2877
+ <?php
2878
+ }
2879
+ function print_options_h3($title){
2880
+ ?>
2881
+ <tr valign="center">
2882
+ <td colspan="2">
2883
+ <div class="ag_table_heading"><h3 tabindex="0"><?= $title ?></h3></div>
2884
+ </td>
2885
+ <td></td>
2886
+ </tr>
2887
+ <?php
2888
+ }
2889
+ function print_option_tr(){
2890
+ ?>
2891
+
2892
+ <tr valign="center">
2893
+ <th><label title="Change submenu item background color" for="color_admin_menu_submenu_background">Submenu button background color:</label></th>
2894
+ <td><input type="text" id="color_admin_menu_submenu_background" name="color_admin_menu_submenu_background" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_submenu_background'); ?>" />
2895
+ <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button agca_button" value="Pick color" />
2896
+ <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button_clear agca_button" value="Clear" />
2897
+ </td>
2898
+ </tr>
2899
+ <?php
2900
+ }
2901
+ #endregion
2902
+
2903
+ }
2904
+ ?>
trunk/readme.txt ADDED
@@ -0,0 +1,622 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === AG Custom Admin ===
2
+ Contributors: wap
3
+ Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
+ Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
+ Requires at least: 3.0
6
+ Tested up to: 4.4
7
+ Stable tag: 1.5.1
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
12
+
13
+ == Description ==
14
+ With this plugin you can easily customize WordPress **admin panel**, **login page**, **admin menu**, **admin bar** etc. in tiny details and apply free responsive and commercial **admin themes**.
15
+
16
+ * **ADMIN BAR**: Hide or change admin bar items. Remove WordPress traces from admin bar. Brand it with custom colors.
17
+ * **ADMIN MENU**: Change and remove existing and add custom admin menu items. Brand it with custom colors.
18
+ * **ADMIN THEMES**: It have never been so easy to apply free and commercial responsive admin panel themes with just few clicks.
19
+ * **COLORIZER**: This tool is integrated with AG Custom Admin panel and can be used to change default WordPress admin panel colors, admin bar, admin menu, login page, backgrounds and text.
20
+ * **BRANDING**: Brand your admin panel pages with custom content, colors, images and text.
21
+ * **ADMIN PANEL OPTIONS**: There are dozens of other admin panel options used to improve WordPress UX on admin and login pages items like Dashboard widgets, Help and Screen options, WordPress logos, links, menus etc. See the full list down below.
22
+
23
+ = General Settings =
24
+ * Hide "Screen Options" menu
25
+ * Hide "Help" menu
26
+
27
+ = Admin Bar Settings =
28
+ * Hide admin bar completely
29
+ * Show Log out button only if admin bar is completely hidden
30
+ * Hide admin bar on site pages only
31
+ * Replace WordPress logo with custom branding image
32
+ * Change link on admin bar logo
33
+ * Custom page title template on admin pages (change <head> => <title> tag)
34
+ * Add custom branding image above the content in admin bar
35
+ * Hide WordPress logo
36
+ * Hide site name
37
+ * Hide admin bar logo context menu
38
+ * Hide update notifications block
39
+ * Hide "Comments" block
40
+ * Hide "New" menu block
41
+ * Hide "New" -> "Post"
42
+ * Hide "New" -> "Link"
43
+ * Hide "New" -> "Page"
44
+ * Hide "New" -> "User"
45
+ * Hide "New" -> "Media"
46
+ * Change site name to custom text
47
+ * Hide yellow WordPress update notification
48
+ * Change Howdy text
49
+ * Change Log Out text
50
+ * Remove "Edit My Profile" option from context menu
51
+ * Show "Log Out" button only on the right
52
+
53
+ = Admin Footer Options =
54
+ * Hide footer completely
55
+ * Change/remove footer text
56
+ * Change/remove footer version text
57
+
58
+ = Dashboard Page Options =
59
+ * Change Dashboard heading text
60
+ * Add custom Dashboard HTML content
61
+ * Hide dashboard widgets
62
+
63
+ = Login Page Options =
64
+ * Hide back to blog text
65
+ * Change back to blog text
66
+ * Change login image
67
+ * Change hyperlink on login image
68
+ * Hide login image
69
+ * Round corners on login boxes
70
+ * Hide register and lost password links
71
+ * Change hyperlink on register button
72
+
73
+ = Admin Menu Options =
74
+ * Rename menu and sub-menu items
75
+ * Hide menu and sub-menu items
76
+ * Add new buttons with custom links
77
+ * Remove icons from admin menu buttons
78
+ * Remove spaces between admin menu buttons
79
+ * Remove admin menu arrow on hover
80
+ * Round admin sub-menu popups
81
+ * Remove "Collapse" button
82
+ * Add custom branding image above the admin menu
83
+ * Add custom link to branding image
84
+ * Change admin menu auto-folding settings
85
+
86
+ = Colorizer =
87
+ * Change background and text colors on admin and login page
88
+ * Change admin menu colors
89
+ * Change widget colors
90
+
91
+ = Advanced =
92
+ * Add custom CSS
93
+ * Add custom JavaScript
94
+ * Export/import customization settings
95
+
96
+ = Admin Themes =
97
+ AG Custom Admin plugin contains specially created professional and responsive themes for admin panel and login page, that can be applied easily within AG Custom Admin plugin with only few clicks!
98
+ We will add more themes with better styles and theme options in future.
99
+
100
+ For more info about AG Custom Admin themes, please go to [WordPress Admin Panel Themes](http://wordpressadminpanel.com/themes/home) site.
101
+
102
+ = Additional Features =
103
+ * [Admin Panel Themes](http://wordpressadminpanel.com/themes/home)
104
+ * [Admin Menu Icons Management](http://wordpressadminpanel.com/aglcami/home)
105
+
106
+ = Contact =
107
+ If you are unable to login or you have any other problems, please check our [FAQ](http://wordpress.org/extend/plugins/ag-custom-admin/faq/) and [SUPPORT](http://wordpress.org/support/plugin/ag-custom-admin) page.
108
+
109
+ For more information about the plugin please check [PLUGIN WEBSITE](http://wordpressadminpanel.com/ag-custom-admin/) and for more information about admin themes please check [THEMES WEBSITE](http://wordpressadminpanel.com/themes/home)
110
+
111
+ **Important**: AG Custom Admin should always be updated before updating WordPress.
112
+
113
+ == Installation ==
114
+
115
+ 1. Upload `ag-custom-admin` directory to the `/wp-content/plugins/` directory
116
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
117
+ 3. Activated plugin appears in 'Tools' menu
118
+
119
+ == Frequently Asked Questions ==
120
+
121
+ = I see only blank page. What can I do? =
122
+ This is caused by JavaScript error thrown by this or some other plugin. Please open browser's console and try to find JavaScript errors. Try to find the source of the error, it is probably thrown by some plugin. If you can find the source, please try to disable that plugin or theme and post that error on their support page. You could try also disabling plugins one-by-one to see when this problem occurs. If you can't access login page, please temporary disable JavaScript in your browser and refresh the page.
123
+ If this does not work, try to find JavaScript error in browser's console and post it to our support page.
124
+
125
+ = I cannot log in to admin panel =
126
+ If you see blank page or login form is disappeared, it's most likely that you have some errors thrown in your WordPress site. This is caused by JavaScript error thrown by this or some other plugin. If you want to deactivate plugin, but you can't access admin panel, turn off JavaScript in your browser and then log in back and deactivate plugin (This works only for administrator). Try also to clear browser's cache. If this does not work, try to find JavaScript error in browser's console and post it to plugin's support page.
127
+
128
+ = Plugin does not work after upgrading to new version. What should I do? =
129
+ Try to clear browser's cache, and reload the page. Make sure to have latest plugin and WordPress versions installed. If nothing of these solutions help, please contact support.
130
+
131
+ = Something is wrong with Admin Menu buttons =
132
+ Please use 'Reset Settings' button on Admin Menu page to reset menu configuration to defaults. Make sure to use latest plugin version with latest patches.
133
+
134
+ = Errors appear on admin/login pages =
135
+ Go to browser's console and see if there are any errors. Try to locate them. If you can't fix error by yourself, post it back to plugin's support page.
136
+
137
+ = Some options are not working =
138
+ If you have found that something is not working correctly, and you have the latest WordPress and plugin versions, please contact us and report the issue.
139
+
140
+
141
+ == Screenshots ==
142
+
143
+ 1. AG Custom Admin provides most of the options for admin panel customization, and it's pretty easy to use it.
144
+ 2. Login page can be customized and styled with custom branding logo or image, rounded borders, background colors.
145
+ 3. Admin menu is completely customizable. You can rename or remove the items from them menu and submenu, or add brand new buttons with custom links.
146
+ 4. Default WP grey colors can be refreshed with any colors! There are a lot of Colorizer's options that can be used to style the text, background, login, widgets, admin menu, top bar, footer, almost everything!
147
+ 5. Free and commercial predefined WP admin panel themes.
148
+ 6. Orange - free theme - login page.
149
+ 7. Dunes - commercial theme.
150
+ 8. Wasteland - commercial theme.
151
+ 9. Army - commercial theme.
152
+
153
+ == Change Log ==
154
+
155
+ = 1.5.1 =
156
+ * Added support for older PHP versions, starting from 5.2
157
+
158
+ = 1.5 =
159
+ * Improved UX with new icons and styles
160
+ * Fixed admin menu issues when menu is updated outside of AGCA
161
+ * Code reorganizing
162
+ * Using dashboard icons instead of images
163
+ * Updated option names
164
+
165
+ = 1.4.9 =
166
+ * Issues fixed
167
+
168
+ = 1.4.8.2 =
169
+ * Added check for non existing 'pagenow' GLOBAL variable
170
+ * Using default WordPress theme when AGCA theme is activated
171
+ * Fixed unknown font theme issue
172
+ * Option to remove AGCA themes from admin bar
173
+
174
+ = 1.4.8.1 =
175
+ * Small bug fix
176
+
177
+ = 1.4.8 =
178
+ * Style improvements
179
+ * Tab navigation remembers previously used tab
180
+
181
+ = 1.4.7 =
182
+ * Removed AG Custom Admin menu top item
183
+ * Better error handling
184
+
185
+ = 1.4.6 =
186
+ * Removed obsolete Colorizer's border options
187
+ * Removed obsolete code
188
+ * Changed some options labels/descriptions
189
+ * Handling user's errors caused by mistake in Custom JS
190
+ * Removed first and second menu item separator options, replaced with remove all separators option
191
+
192
+ = 1.4.5 =
193
+ * Fixed issues
194
+
195
+ = 1.4.4 =
196
+ * Admin themes, caching support
197
+
198
+ = 1.4.3 =
199
+ * Fixes admin bar compatibility issue with BuddyPress on public pages
200
+ * Dashboard -> Updates submenu item can be hidden now
201
+ * Added address bar option for debugging
202
+
203
+ = 1.4.2 =
204
+ * Internal links changes, support for the new support site domain
205
+
206
+ = 1.4.1 =
207
+ * Support up to WordPress 4.1
208
+ * Improved branding
209
+ * Better error handling
210
+
211
+ = 1.4 =
212
+ * Fixed issue with Colorizer. Updated plugin colors.
213
+
214
+ = 1.3.9 =
215
+ * Fixed issue on Dashboard widgets page: Disabled third-party widget cannot be re-enabled
216
+
217
+ = 1.3.8 =
218
+ * Central alignment for smaller login images, and for different form widths
219
+ * Option to remove "WordPress News" dashboard widget
220
+ * Better "Error Caught" message with more useful information
221
+
222
+ = 1.3.7 =
223
+ * Fixed issues with custom dashboard content
224
+
225
+ = 1.3.6 =
226
+ * Fixed issues with special characters in admin menu editor
227
+
228
+ = 1.3.5 =
229
+ * Prepared for WordPress 3.9
230
+ * Fixed style for custom Howdy name
231
+
232
+ = 1.3.4 =
233
+ * Fixed add_filter undefined function error
234
+ * Better exception handling
235
+
236
+ = 1.3.3 =
237
+ * Fixed compatibility issues with MailPoet plugin
238
+
239
+ = 1.3.2 =
240
+ * Bug fixes
241
+
242
+ = 1.3.1 =
243
+ * First production version with AGCA Themes
244
+
245
+ = 1.3 =
246
+ * Introducing AG Custom Admin Themes
247
+
248
+ = 1.2.8 =
249
+ * Fixed PHP errors in DEBUG mode
250
+
251
+ = 1.2.7.9 =
252
+ * Fixed remove admin submenu arrow option in WordPress 3.8
253
+
254
+ = 1.2.7.8 =
255
+ * Fixed admin menu bug
256
+
257
+ = 1.2.7.7 =
258
+ * Updated options labels
259
+ * Better checkbox and radio box styles
260
+ * Some additional style improvements
261
+ * Updated option for auto folding admin menu on mobile devices
262
+ * Fixed AGCA error popup on reset password page
263
+
264
+ = 1.2.7.6 =
265
+ * Better style for close button
266
+ * Fixed bugs when adding new admin menu buttons
267
+
268
+ = 1.2.7.5 =
269
+ * Better style for close button
270
+ * Removed deprecated jQuery live function
271
+ * Including jQuery migrate plugin on Advanced tab
272
+
273
+ = 1.2.7.4 =
274
+ * Removing submenu box on mouseover, if all submenu items are hidden (Fixed empty box issue)
275
+ * Added WYSIWYG editor for Dashboard page
276
+
277
+ = 1.2.7.3 =
278
+ * Fixed single quote character escaping on several settings
279
+ * Added option for removing AGCA JS warning message
280
+ * Fixed "Illegal string offset" server error
281
+
282
+ = 1.2.7.2 =
283
+ * Escaping characters (like single quote) in footer text
284
+ * Fixed AGCA alert message issue
285
+ * Prepared for 3.6. WordPress release
286
+ * Other bug fixes.
287
+
288
+ = 1.2.7.1 =
289
+ * Removed AGCA script on site pages automatically, if user is not logged in
290
+ * Custom WordPress admin title. Using custom title templates
291
+ * Added option for removing blog title from top bar
292
+ * Fixed misaligned menu when using custom content types plugins
293
+ * Fixed bug "Save button does not work" caused by unescaped characters in footer text and custom button names
294
+ * Updated AGCA buttons styles
295
+
296
+ = 1.2.7 =
297
+ * WordPress 3.5 compatible
298
+ * Added login page background color
299
+ * Resolving jQuery script
300
+ * Added feedback buttons (positive/negative)
301
+ * Better user's experience (updated form buttons and textbooks)
302
+ * Fixed problem with Howdy renaming
303
+
304
+ = 1.2.6.5 =
305
+ * using capabilities instead of user levels
306
+ * define who is admin with choosing capability (Advanced tab)
307
+ * added option to hide admin bar on front end only
308
+ * added option to remove all AGCA customizations on front end
309
+ * added option to remove register button on login page
310
+ * added option to change hyperlink on register button on login page
311
+ * added option to remove "Lost Password" link on login page
312
+ * added support for collapse button on customized admin menu
313
+ * option to show/hide collapse button on admin menu
314
+ * added styles for collapsed menu
315
+ * added WP filter to remove admin bar on front page
316
+ * applying admin bar colors on front page
317
+ * fixed blank space in admin panel when admin bar is removed
318
+ * fixed some bugs in colorizer, better updating of input box colors, triggering colors on input box change, improved realtime color updating
319
+ * adding jQuery script on login page only if it is not already loaded
320
+ * fixed background-size issue on login page image in chrome and some other browsers
321
+ * updated important message on admin menu tab
322
+
323
+ = 1.2.6.4 =
324
+ * Removing plugin options on plugin uninstall instead of on plugin deactivation
325
+ * Refreshed some button styles
326
+ * "But show logout button" option auto-hiding
327
+ * Fixed repeat login image bug
328
+ * Fixed bug on loading news
329
+
330
+ = 1.2.6.3 =
331
+ * Included colorizer ON/OFF option to exported settings
332
+ * Automatically saving settings after importing
333
+ * Fixed issue with admin bar on site pages
334
+ * Added option for switching between admin and site pages(on WP logo, top left corner on admin bar)
335
+ * Fixed custom Howdy text for other languages than English.
336
+
337
+ = 1.2.6.2 =
338
+ * Added custom brand logo url
339
+ * Added %BLOG% variables for custom urls
340
+ * Option for removing custom admin menu settings in export
341
+
342
+ = 1.2.6.1 =
343
+ * Bug fixes
344
+ * Added +/- indicators to admin menu editor
345
+ * Custom top bar logo can be of any width. Height is expanded to 28px
346
+ * Saving custom scripts to database instead of saving to files
347
+ * Fixed error message on WordPress thick-box window
348
+ * Removed About WordPress message on top bar logo(on mouseover)
349
+ * Using %BLOG% variable as hyperlink on login page image
350
+ * Few other fixes on WordPress top bar
351
+ * Fixed color bug on admin menu hover()
352
+
353
+ = 1.2.6 =
354
+ * Fixed hiding top bar issue for site pages
355
+ * Fixed issues with custom content on Dashboard page. Any custom HTML can be used now.
356
+ * Custom CSS script support
357
+ * Custom JAvaScript support
358
+ * Exporting / importing AG Custom Admin customizations
359
+ * Added custom branding field above the admin menu for adding custom brand images
360
+ * Rounding admin menu popups and login page
361
+ * Option for removing Welcome dashboard widget
362
+ * New colorizer options for admin menu, top bar
363
+ * New AGCA info area
364
+ * Fixed caching issues on updates
365
+
366
+ = 1.2.5.4 =
367
+ * Fixed fatal error from version 1.2.5.3
368
+
369
+ = 1.2.5.3 =
370
+ * Fixed issues related to WP 3.3.1 version
371
+ * Fixed bug: Hiding/changing top admin bar WP icon
372
+ * Advanced customization of admin top bar
373
+ * Added options for hiding admin top bar elements
374
+ * Login page background same as admin background
375
+ * Added target options for custom admin buttons
376
+
377
+ = 1.2.5.2 =
378
+ * Fixed several issues with WP 3.3
379
+ * Added options for hiding "comments" and "new" from admin bar
380
+ * Support for custom admin bar images
381
+ * Support for custom Log Out text
382
+ * Hide everything except Log Out button works now
383
+ * Removed few obsolete options
384
+ * Removing "Edit My Profile"
385
+ * Fixed bug when trying to edit custom buttons in admin menu
386
+
387
+ = 1.2.5.1 =
388
+ * Plugin tested up to 3.3
389
+ * Fixed major issues with WP 3.3. version
390
+ * Fixed bug when trying to edit custom buttons in admin menu
391
+
392
+ = 1.2.5 =
393
+ * Plugin tested up to 3.2.1
394
+ * Fixed some compatibility issues with other plugins
395
+ * Tested compatibility with Ozh' Admin Drop Down Menu v3.6.1
396
+ * Tested compatibility with SexyBookmarks (by Shareaholic) v4.0.5.6
397
+ * Fixed blank screen of death if an error from outside of plugin is thrown
398
+ * Improved error handling and showing
399
+ * Improved versioning
400
+
401
+ = 1.2.4 =
402
+ * Plugin is now fully compatible with WordPress version 3.2
403
+ * Fixed update notification bar for lower WP versions
404
+ * Login image can be now of any size.
405
+ * Improved error management
406
+ * Added options in 3.2 for changing background behind admin menu
407
+ * Added option in 3.2 for removing "Your profile" from admin bar
408
+ * Added invalid characters escaping when adding new custom buttons
409
+ * Fixed few minor issues
410
+
411
+ = 1.2.3 =
412
+ * Added Colorizer options for changing widgets colors.
413
+ * Added option for changing logo image in admin bar with custom image.
414
+ * Fixed bug on add new post page: After clicking on buttons Add new image, Add new media pop-up window is blank.
415
+ * Added info bar for displaying news and information about plugin.
416
+ * Fixed few issues.
417
+
418
+ = 1.2.2 =
419
+ * Added Colorizer for changing colors in admin and login panel
420
+ * Added option for excluding admin from settings.
421
+ * Fixed bug for slow computers: Default settings are visible few moments before applying custom settings.
422
+ * Added option for removing icons from admin menu buttons
423
+
424
+ = 1.2.1 =
425
+ * Improved accessibility
426
+ * Optimization for screen readers
427
+ * Added sub-page titles
428
+ * Updated styles in edit admin menu table
429
+
430
+ = 1.2 =
431
+ * All elements are grouped into small pages for better navigation.
432
+ * Added color styles and improved user experience.
433
+ * Added settings page for fully control of main admin menu.
434
+ * Added support for hiding items from admin menu.
435
+ * Added support for changing items in admin menu.
436
+ * Added support for adding new custom items in admin menu.
437
+ * Added tool tips on option labels for better explanation of option.
438
+ * Deprecated 'Hide Dashboard button from main menu' in 'Dashboard settings'. This option can be used now in 'Admin menu settings'.
439
+ * Added settings for hiding/showing Dashboard widgets:"Recent Comments", "Incoming Links", "Plugins", "Quick Press", "Right Now", "Recent Drafts", primary widget area, secondary widget area.
440
+ * Added option "(but show 'Log Out' button)" for displaying 'Log Out' button if admin top bar is completely removed.
441
+ * Added option "Hide footer text".
442
+ * Added support for hiding new WordPress release notification.
443
+
444
+ = 1.0.1 =
445
+ * Changed text in Settings page to be more clearer.
446
+ * Updated list of options on plugin page
447
+ * Removed blank characters in text areas
448
+
449
+ = 1.0 =
450
+ * Initial version
451
+
452
+ == Upgrade Notice ==
453
+
454
+ = 1.5.1 =
455
+ * Added support for older PHP versions, starting from 5.2
456
+
457
+ = 1.5 =
458
+ * Improved UX with new icons and styles
459
+ * Fixed admin menu issues when menu is updated outside of AGCA
460
+ * Code reorganizing
461
+ * Using dashboard icons instead of images
462
+ * Updated option names
463
+
464
+ = 1.4.9 =
465
+ * Issues fixed
466
+
467
+ = 1.4.8.2 =
468
+ * Added check for non existing 'pagenow' GLOBAL variable
469
+ * Using default WordPress theme when AGCA theme is activated
470
+ * Fixed unknown font theme issue
471
+ * Option to remove AGCA themes from admin bar
472
+
473
+ = 1.4.8.1 =
474
+ * Small bug fix
475
+
476
+ = 1.4.8 =
477
+ * Style improvements
478
+ * Tab navigation remembers previously used tab
479
+
480
+ = 1.4.7 =
481
+ * Improvements
482
+
483
+ = 1.4.6 =
484
+ * Refactoring. Removed obsolete code. Fixes some issues.
485
+
486
+ = 1.4.5 =
487
+ * Fixed issues
488
+
489
+ = 1.4.4 =
490
+ * Admin themes, caching support
491
+
492
+ = 1.4.3 =
493
+ * Fixed some issues
494
+
495
+ = 1.4.2 =
496
+ * Internal links changes
497
+
498
+ = 1.4.1 =
499
+ * Improvements
500
+
501
+ = 1.4 =
502
+ * Fixed issue with Colorizer. Updated plugin colors.
503
+
504
+ = 1.3.9 =
505
+ * Fixed issue on Dashboard widgets page
506
+
507
+ = 1.3.8 =
508
+ * Bug fixes: WordPress News dashboard widget, login image center alignment
509
+
510
+ = 1.3.7 =
511
+ * Fixed issues with custom dashboard content
512
+
513
+ = 1.3.6 =
514
+ * Fixed issues with special characters in admin menu editor
515
+
516
+ = 1.3.5 =
517
+ * Prepared for WordPress 3.9
518
+ * Fixed style for custom Howdy name
519
+
520
+ = 1.3.4 =
521
+ * Bug fixes. Better error handling.
522
+
523
+ = 1.3.3 =
524
+ * Fixed compatibility issues with MailPoet plugin
525
+
526
+ = 1.3.2 =
527
+ * Bug fixes
528
+
529
+ = 1.3.1 =
530
+ * Introducing AG Custom Admin Themes
531
+
532
+ = 1.3 =
533
+ * Introducing AG Custom Admin Themes
534
+
535
+ = 1.2.8 =
536
+ * Fixed PHP errors in DEBUG mode
537
+
538
+ = 1.2.7.9 =
539
+ * Fixed remove admin submenu arrow option in WordPress 3.8
540
+
541
+ = 1.2.7.8 =
542
+ * Fixed admin menu bug
543
+
544
+ = 1.2.7.7 =
545
+ Updated admin menu auto-folding options. Fixed bug on reset password page. Updated options styles.
546
+
547
+ = 1.2.7.6 =
548
+ Bug fixes. Better close button styles.
549
+
550
+ = 1.2.7.5 =
551
+ Better style for close button. Removed deprecated jQuery live function.
552
+
553
+ = 1.2.7.4 =
554
+ Few improvements.
555
+
556
+ = 1.2.7.3 =
557
+ Bug fixes.
558
+
559
+ = 1.2.7.2 =
560
+ Bug fixes. Preparation for 3.6 WordPress
561
+
562
+ = 1.2.7.1 =
563
+ Bug fixes. Removing admin bar site title. Custom page titles in WP admin.
564
+
565
+ = 1.2.7 =
566
+ Plugin prepared for WordPress 3.5. Few additional improvements.
567
+
568
+ = 1.2.6.5 =
569
+ New features and bug fixes. Improved colorizer, fixed admin bar issues, using capabilities to define admin users, added new options for login page, options to remove AGCA scripts on front-end. Using collapsed menus.
570
+
571
+ = 1.2.6.4 =
572
+ Bug fixes. Removing plugin's option on uninstall, not on deactivation.
573
+
574
+ = 1.2.6.3 =
575
+ Fixed several bugs: Admin bar issues, not saving settings after import, changing Howdy text in other languages, colorizer ON/OFF option in settings export.
576
+
577
+ = 1.2.6.2 =
578
+ Ready for WordPress 3.4. A lot of improvements in 1.2.6 series, fixed issues with top bar, caching on updates, better styles... and new features: export/import new colorizer options, better admin menu styles, custom css, custom js, admin bar on site pages.. Fixed bugs since 1.2.6 version. Wrapped up 1.2.6 series release.
579
+
580
+ = 1.2.6.1 =
581
+ Fixing bugs from 1.2.6 version
582
+
583
+ = 1.2.6 =
584
+ A lot of improvements in 1.2.6, fixed issues with top bar, caching on updates, better styles, etc. and new features: export/import new colorizer options, better admin menu styles, custom css, custom js, admin bar on site pages etc.
585
+
586
+ = 1.2.5.4 =
587
+ Fixed fatal error from version 1.2.5.3
588
+
589
+ = 1.2.5.3 =
590
+ Fixed issues related to WordPress version 3.3.1
591
+
592
+ = 1.2.5.2 =
593
+ Full compatibility with WP 3.3. Fixed several issues with this version. Removed obsolete options for old WP versions, added new options to fit 3.3 version. Update is highly recommended for WP 3.3 users.
594
+
595
+ = 1.2.5.1 =
596
+ Plugin is ready for 3.3. WordPress version. Major issues with WP 3.3 are fixed. However, some options are not fully functional, yet. Recommended only for users with 3.3. WP version. Fixed bug with custom admin menu buttons.
597
+
598
+ = 1.2.5 =
599
+ Improved compatibility with other plugins. Tested with Ozh' Admin Drop Down Menu and SexyBookmarks. Fixed screen freezing and white screen of death. Improved error handling and showing.
600
+
601
+ = 1.2.4 =
602
+ This plugin version is ready for WordPress release 3.2, and fully compatible with it. Added few new options, and improved plugin stability.
603
+
604
+ = 1.2.3 =
605
+ Fixed 'White screen of death' bug, and few other improvements. Added colorizer options for widgets. Added support for changing admin bar logo with custom image.
606
+
607
+ = 1.2.2 =
608
+ Added demo Colorizer for adding custom colors in admin and login pages. Fixed bug for slow computers, default settings should not be visible before custom settings. Added support for excluding administrator from settings. Added option for removing icons from admin menu buttons.
609
+
610
+ = 1.2.1 =
611
+ This is minor upgrade from 1.2 to 1.2.1 version. Mostly it is based on optimization for screen readers and improving accessibility. You definitly need to upgrade this plugin if you have version older than 1.2.
612
+
613
+ = 1.2 =
614
+ This is major milestone of this plugin. All elements are grouped and organized into small pages for better navigation.
615
+ Settings are styled in better way and some attractive interactions are added to make using of this plugin very easy.
616
+ Added settings for fully customization of admin menus.
617
+
618
+ = 1.0.1 =
619
+ Better explanations in Settings page. No changes in functionality.
620
+
621
+ = 1.0 =
622
+ Initial version.
trunk/require/dynamic.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require '../../../../wp-load.php';
3
+
4
+ $themes = get_option('agca_templates');
5
+ $selectedTheme = get_option('agca_selected_template');
6
+ $type = "";
7
+ $optionName = "";
8
+ $agcaContext = "";
9
+
10
+ if(isset($_GET["type"])){
11
+ $type = $_GET["type"];
12
+ }
13
+ if(isset($_GET["context"])){
14
+ $agcaContext = $_GET["context"];
15
+ }
16
+
17
+ if ( $agcaContext != "login" && !is_user_logged_in()) {
18
+ die();
19
+ }
20
+
21
+ if($type == "css"){
22
+ header('Content-type: text/css');
23
+ $optionName = ($agcaContext == "login")? "logincss":"admincss";
24
+
25
+ }else if($type == "js"){
26
+ header('Content-type: application/javascript');
27
+ $optionName = ($agcaContext == "login")? "loginjs":"adminjs";
28
+ }
29
+ if($type == "css" || $type == "js"){
30
+ if(isset($themes[$selectedTheme])){
31
+ $theme = $themes[$selectedTheme];
32
+ $admin_capability = get_option('agca_admin_capability');
33
+ if($admin_capability == ""){
34
+ $admin_capability = "edit_dashboard";
35
+ }
36
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($admin_capability )))){
37
+ $adminscript = $theme[$optionName];
38
+ $settings = $theme['settings'];
39
+ if($settings == "" || $settings == " ") $settings = "{}";
40
+ $adminscript = agcaAppendSettingsToAGCATemplateCustomizations($adminscript, $settings);
41
+ $admindata = agcaEnableSpecificWPVersionCustomizations($admindata);
42
+ $admindata = agcaRemoveCSSComments($admindata);
43
+
44
+ echo $adminscript;
45
+ }
46
+ }
47
+ }
48
+
49
+ //print_r($themes); print_r($selectedTheme); die;
50
+ die;
51
+
52
+
53
+ function agcaEnableSpecificWPVersionCustomizations($customizations){
54
+ /*enable special CSS for this WP version*/
55
+ $ver = agcat_get_wp_version();
56
+ $customizations = str_replace("/*".$ver," ", $customizations);
57
+ $customizations = str_replace($ver."*/"," ", $customizations);
58
+ return $customizations;
59
+ }
60
+ function agcat_get_wp_version(){
61
+ global $wp_version;
62
+ $array = explode('-', $wp_version);
63
+ $version = $array[0];
64
+ return $version;
65
+ }
66
+ function agcaAppendSettingsToAGCATemplateCustomizations($customizations, $settings){
67
+ $template_settings = json_decode($settings);
68
+ //print_r($template_settings);
69
+ foreach($template_settings as $sett){
70
+ $key = $sett->code;
71
+
72
+ //use default value if user's value is not set
73
+ $value="";
74
+ if($sett->value != ""){
75
+ $value = $sett->value;
76
+ }else{
77
+ $value = $sett->default_value;
78
+ }
79
+
80
+ //Prepare settings
81
+ if($sett->type == 6){
82
+ if($value !== null && (strtolower($value) == "on" || $value == "1")){
83
+ $value = "true";
84
+ }else{
85
+ $value = "false";
86
+ }
87
+ }
88
+ $customizations = str_replace("%".$key."%",$value, $customizations);
89
+ }
90
+ return $customizations;
91
+ }
92
+ function agcaRemoveCSSComments($customizations){
93
+ $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
94
+ return $customizations;
95
+ }
trunk/script/ag_script.js ADDED
@@ -0,0 +1,965 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var afterFormClickCreateJson = true;
2
+ var editingButtonNow = false;
3
+ var agca_ajax_url = agca_global_plugin_url + "ajax.php";
4
+ function booleanToChecked(bool){
5
+ if(bool == 'true'){
6
+ return 'checked="checked"';
7
+ }else if(bool == 'checked'){
8
+ return 'checked="checked"';
9
+ }
10
+ }
11
+
12
+ function agcaLog(text){
13
+ console.log(text);
14
+ }
15
+
16
+ function agcaDebug(text){
17
+ if(agca_debug){
18
+ console.log('- '+text);
19
+ }
20
+ }
21
+
22
+ function agcaDebugObj(obj){
23
+ if(agca_debug){
24
+ console.log(obj);
25
+ }
26
+ }
27
+
28
+ /*use only on agca page*/
29
+ if(window.location.href.indexOf(encodeURIComponent('ag-custom-admin/plugin.php')) !== -1 || window.location.href.indexOf('ag-custom-admin/plugin.php') !== -1){
30
+ jQuery(function(){
31
+ var agcapage = localStorage.getItem('agca-page');
32
+ if(!agcapage){
33
+ localStorage.setItem('agca-page', window.location.hash);
34
+ agcapage = localStorage.getItem('agca-page');
35
+ }
36
+ window.location.hash = window.location.hash || agcapage;
37
+ localStorage.setItem('agca-page', window.location.hash);
38
+
39
+ });
40
+ window.onhashchange = function(){
41
+ localStorage.setItem('agca-page', window.location.hash);
42
+ if(jQuery('#ag_main_menu a.selected').attr('href') !== window.location.hash){
43
+ if(window.location.hash !== ""){
44
+ jQuery('#ag_main_menu a[href='+window.location.hash+']').trigger('click');
45
+ }
46
+ }
47
+ };
48
+ }
49
+
50
+ function hideShowSubmenus(index){
51
+ var finish = false;
52
+ var found = false;
53
+ jQuery('#ag_edit_adminmenu td').each(function(){
54
+ if(jQuery('#ag_edit_adminmenu td').index(jQuery(this)) >= index && (finish == false)){
55
+ // jQuery(this).find('.agcaMenuEditorPlusMinus').show();
56
+ var caller = jQuery('#ag_edit_adminmenu td:eq(' + index + ')');
57
+ jQuery(caller).find('.agcaMenuEditorPlusMinus .minus').toggle();
58
+ jQuery(caller).find('.agcaMenuEditorPlusMinus .plus').toggle();
59
+ if(jQuery(this).hasClass('ag_admin_menu_child')){
60
+ jQuery(this).parent().toggleClass('noclass');
61
+ found = true;
62
+ }
63
+ if((jQuery('#ag_edit_adminmenu td').index(jQuery(this)) > index) && jQuery(this).hasClass('ag_admin_menu_parent')){
64
+ finish = true;
65
+ }
66
+ }
67
+ });
68
+ /*FOCUS*/
69
+ if(!jQuery('#ag_edit_adminmenu td').eq((index+2)).parent().hasClass('noclass') && (found == true)){
70
+ jQuery('#ag_edit_adminmenu td').eq((index+2)).find('a').trigger('focus');
71
+ };
72
+ }
73
+
74
+ /*
75
+ Makes admin edit page pretty grouping items and submenus, and adding fancy interactions
76
+ */
77
+ function prettyEditMenuPage(){
78
+ jQuery('#ag_edit_adminmenu td').each(function(){
79
+ if(jQuery(this).hasClass('ag_admin_menu_child')){
80
+ jQuery(this).parent().addClass('noclass');
81
+ };
82
+ });
83
+ jQuery('#ag_edit_adminmenu td').each(function(){
84
+ if(jQuery(this).hasClass('ag_admin_menu_parent')){
85
+ jQuery(this).parent().css('background-color','#d8eAd8');
86
+ jQuery(this).bind('click',function(evt){
87
+ if(evt.target.className == 'ag_admin_menu_parent'){
88
+ hideShowSubmenus(jQuery('#ag_edit_adminmenu td').index(this));
89
+ }
90
+ });
91
+ };
92
+ });
93
+ jQuery('#ag_edit_adminmenu td > a').bind('click',function(){
94
+ jQuery(this).parent().click();
95
+ //jQuery(this).parent().focus();
96
+ });
97
+ };
98
+ function editMenuRow(url, originalName, newName, removed){
99
+ return '<tr class="top" data-url="'+url+'" style="background-color: rgb(216, 234, 216);"><td class="ag_admin_menu_parent"><br><span class=\"agcaMenuEditorPlusMinus\"><span class="dashicons plus dashicons-arrow-down-alt2"></span><span class="dashicons minus dashicons-arrow-up-alt2"></span></span><a tabindex="0" href="javascript:void(0)">'+originalName+'</a><div style="float:right"><input title="Remove Home from menu" class=" agca-checkbox visibility" type="checkbox" '+(removed?' checked=\"checked\" ':'')+' name="ag_edit_adminmenu_item_top_2" style="display: none;"><div onclick="agcaCheckBoxOnClick(jQuery(this));" class="agca-checkbox-box" title="Remove '+originalName+' from menu"><div></div></div></div></td><td class="ag_admin_menu_parent2"><input title="Rename '+originalName+' with this value" type="text" class="undefined" size="47" value="'+newName+'" name="ag_edit_adminmenu_item_top_2"></td></tr>';
100
+ }
101
+ function editMenuSubrow(index, parentName, parentIndex, url, originalName, newName, removed){
102
+ return '<tr class="sub" data-index="'+index+'" data-parent="'+parentIndex+'" data-name="'+originalName+'" data-url="'+url+'"><td class="ag_admin_menu_child"><div style="float:left"><a tabindex="-1" href="javascript:void(0)" style="font-weight:bold;" title="Dashboard submenu: '+originalName+'"><span style="font-weight:normal">sub-menu: </span>'+originalName+'</a></div><div style="float:right"><input type="checkbox" title="Remove '+parentName+' submenu: '+originalName+' from menu" class="Home agca-checkbox visibility" '+(removed?' checked=\"checked\" ':'')+' name="ag_edit_adminmenu_item_sub_1" style="display: none;"><div onclick="agcaCheckBoxOnClick(jQuery(this));" class="agca-checkbox-box" title="Remove '+parentName+' submenu: '+originalName+' from menu"><div></div></div></div></td><td class="ag_admin_menu_child2"><input type="text" title="Rename submenu item '+originalName+' with this value" class="'+originalName+'" size="47" value="'+newName+'" name="ag_edit_adminmenu_item_sub_1"></td></tr>';
103
+ }
104
+ function createEditMenuPageNew(agca_menu){
105
+ for(var url in agca_menu){
106
+ jQuery('#ag_edit_adminmenu').append(editMenuRow(url, agca_menu[url]['name'], agca_menu[url]['new'], agca_menu[url]['remove']));
107
+ //console.log(agca_menu[url]['name'],agca_menu[url]['new']);
108
+
109
+ //submenus
110
+ var subs = agca_menu[url]['submenus'];
111
+ if(subs){
112
+ for(var ind in subs){
113
+ //console.log('--- '+ subs[ind]['name'], subs[ind]['new']);
114
+ jQuery('#ag_edit_adminmenu').append(editMenuSubrow(ind, agca_menu[url]['name'],url, subs[ind]['url'], subs[ind]['name'], subs[ind]['new'], subs[ind]['remove']));
115
+ }
116
+ }
117
+ }
118
+
119
+ prettyEditMenuPage();
120
+ hideShowSubmenus();
121
+
122
+ var parent = null;
123
+ var subs = 0;
124
+ jQuery('#ag_edit_adminmenu tr').each(function(){
125
+ if(jQuery(this).find('td').hasClass('ag_admin_menu_parent')){
126
+ //jQuery(this).css('color','#ffffff');
127
+ if(parent != null){
128
+ if(subs == 0){
129
+ jQuery(parent).find('.agcaMenuEditorPlusMinus').html('<span>&nbsp;&nbsp;&nbsp;</span>');
130
+ }
131
+ }
132
+ subs = 0;
133
+ parent = jQuery(this);
134
+ }else{
135
+ subs++;
136
+ }
137
+
138
+ });
139
+ agcaChangeCheckBoxStyles();
140
+ }
141
+
142
+ function applyAdminMenuCustomizations(){
143
+ jQuery('ul#adminmenu > li').each(function() {
144
+ var $o = jQuery(this);
145
+ if (!$o.hasClass("wp-menu-separator") && !$o.hasClass("wp-menu-separator-last") && $o.attr('id') !== 'collapse-menu') {
146
+ var topUrl = $o.find('a:first').attr('href');
147
+ var t = agca_admin_menu[topUrl];
148
+ if(t){
149
+ if(t.remove){
150
+ $o.remove();
151
+ } else if(c.new){
152
+ $o.find('a:first .wp-menu-name').text(c.new);
153
+ }
154
+ var s = t.submenu;
155
+ if(s){
156
+ for(var ind in s){
157
+ var cs = s[ind];
158
+ var subUrl = cs.url;
159
+ var $s = $o.find('.wp-submenu a[href="'+subUrl+'"]:first');
160
+ if(cs.remove){
161
+ $s.remove();
162
+ } else if(cs.new){
163
+ $s.text(cs.new);
164
+ }
165
+ }
166
+ }
167
+
168
+ }
169
+ console.log(topUrl);
170
+ }
171
+ });
172
+ }
173
+
174
+ function showHideSection(text) {
175
+ switch(text)
176
+ {
177
+ case 'General':
178
+ jQuery('#section_general').show();
179
+ jQuery('#section_general .section_title').trigger('focus');
180
+ break;
181
+ case 'Admin Bar':
182
+ jQuery('#section_admin_bar').show();
183
+ jQuery('#section_admin_bar .section_title').trigger('focus');
184
+ break;
185
+ case 'Admin Footer':
186
+ jQuery('#section_admin_footer').show();
187
+ jQuery('#section_admin_footer .section_title').trigger('focus');
188
+ break;
189
+ case 'Dashboard Page':
190
+ jQuery('#section_dashboard_page').show();
191
+ jQuery('#section_dashboard_page .section_title').trigger('focus');
192
+ break;
193
+ case 'Login Page':
194
+ jQuery('#section_login_page').show();
195
+ jQuery('#section_login_page .section_title').trigger('focus');
196
+ break;
197
+ case 'Admin Menu':
198
+ jQuery('#section_admin_menu').show();
199
+ jQuery('#section_admin_menu .section_title').trigger('focus');
200
+ break;
201
+ case 'Colorizer':
202
+ jQuery('#section_ag_colorizer_settings').show();
203
+ jQuery('#section_ag_colorizer_settings .section_title').trigger('focus');
204
+ break;
205
+ case 'Admin Themes':
206
+ if(!jQuery('#section_templates').hasClass("loaded")){
207
+ jQuery('#section_templates').addClass('loaded');
208
+ agca_client_init();
209
+ }
210
+ jQuery('#section_templates').show();
211
+ jQuery('#section_templates .section_title').trigger('focus');
212
+ break;
213
+ case 'Advanced':
214
+ jQuery('#section_advanced').show();
215
+ jQuery('#section_advanced .section_title').trigger('focus');
216
+ break;
217
+ default:
218
+ jQuery('#section_admin_bar').show();
219
+ jQuery('#section_admin_bar .section_title').trigger('focus');
220
+ }
221
+ }
222
+
223
+ function hideAllSections(){
224
+ jQuery('#ag_main_menu li').each(function(){
225
+ jQuery(this).attr("class","normal");
226
+ });
227
+ jQuery('.ag_section').each(function(){
228
+ jQuery(this).hide();
229
+ });
230
+ }
231
+ function reloadRemoveButtonEvents(){
232
+ }
233
+ function createTargetCombo(target,clas){
234
+
235
+ var combo = ""
236
+
237
+ combo+= "&nbsp;open&nbsp;in:<select";
238
+ if( clas != null){
239
+ combo+=" class=\"editTarget\" ";
240
+ }
241
+ combo+= ">";
242
+ combo+= "<option value=\"_self\"";
243
+ if(target === "_self"){
244
+ combo+= " selected ";
245
+ }
246
+ combo+= ">same tab</option>";
247
+ combo+= "<option value=\"_blank\"";
248
+ if(target === "_blank"){
249
+ combo+= " selected ";
250
+ }
251
+ combo+= ">new tab</option>";
252
+ combo+= "</select>";
253
+ return combo;
254
+ }
255
+
256
+ function exportSettings(){
257
+ jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
258
+ jQuery('#agca_form #_agca_import_settings').val("false");
259
+ jQuery('#agca_form #_agca_export_settings').val("true");
260
+
261
+
262
+ jQuery('#ag_add_adminmenu_json').val('');
263
+ jQuery('#ag_edit_adminmenu_json').val('');
264
+ jQuery('#ag_edit_adminmenu_json_new').val('');
265
+
266
+
267
+ jQuery('#agca_form').submit();
268
+ }
269
+
270
+ function importSettings(){
271
+ if(jQuery('#settings_import_file').css("display") == "none"){
272
+ jQuery('#settings_import_file').show("slide");
273
+ }else{
274
+ jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
275
+ if(jQuery('#settings_import_file').val() !=""){
276
+ jQuery('#agca_form #_agca_import_settings').val("true");
277
+ jQuery('#agca_form #_agca_export_settings').val("false");
278
+ jQuery('#agca_form').attr('enctype','multipart/form-data');
279
+ jQuery('#agca_form').submit();
280
+ }else{
281
+ alert("File for import is not selected!");
282
+ }
283
+ }
284
+
285
+ }
286
+
287
+ function savePluginSettings(){
288
+ jQuery('#import_file_area').remove();
289
+ jQuery('#agca_form').submit();
290
+ }
291
+
292
+ jQuery(document).ready(function(){
293
+ jQuery('#ag_add_adminmenu').on("click", 'a.button_remove', function(){
294
+ jQuery(this).parent().parent().remove();
295
+ });
296
+ jQuery('#ag_add_adminmenu').on('click', 'a.button_edit', function(){
297
+ if(editingButtonNow == false){
298
+ var name = jQuery(this).parent().find('button').text();
299
+ var url = jQuery(this).parent().find('button').attr('title');
300
+ var target = jQuery(this).parent().find('button').attr('target');
301
+ //console.log(target);
302
+ editingButtonNow = name;
303
+ jQuery(this).parent().append('<div id="temporary_button_edit">name:<input type="text" size="47" value="'+name+'" id="ag_add_adminmenu_name_edit" name="ag_add_adminmenu_name_edit" />url:<input type="text" size="47" value="'+url+'" id="ag_add_adminmenu_url_edit" name="ag_add_adminmenu_url_edit" />' + createTargetCombo(target,"edit")+ '<input type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit" value="Save changes" /></div>');
304
+ reloadRemoveButtonEvents();
305
+ }
306
+ });/*Save editing changes*/
307
+ jQuery('#ag_add_adminmenu').on("click", '#ag_add_adminmenu_button_edit', function(){
308
+ //alert(jQuery(this).parent().html());
309
+ var name = jQuery('#ag_add_adminmenu_name_edit').val();
310
+ var url = jQuery('#ag_add_adminmenu_url_edit').val();
311
+ var target = jQuery('select.editTarget').val();
312
+ //var target = jQuery(this).parent().find('button').attr('target');
313
+ name = name.replace(/["']{1}/gi,"");
314
+ url = url.replace(/["']{1}/gi,"");
315
+ jQuery('#temporary_button_edit').remove();
316
+
317
+ var element = 0;
318
+ jQuery('#ag_add_adminmenu :button').each(function(){
319
+ //dont use first button for adding new buttons
320
+ if(element > 0){
321
+ if(jQuery(this).html() == editingButtonNow){
322
+ jQuery(this).attr('title',url);
323
+ jQuery(this).attr('target',target);
324
+ jQuery(this).html(name);
325
+ }
326
+ }
327
+ element++;
328
+ });
329
+ editingButtonNow = false;
330
+ });
331
+
332
+ setTimeout(function(){
333
+ jQuery('#agca_advertising').show(),700
334
+ });
335
+ });
336
+ /*ToolTip*/
337
+ function agcaApplyTooltip(){
338
+ if(jQuery(this).attr('title') != ""){
339
+ jQuery(this).hover(function(e) {
340
+ if(jQuery(this).hasClass('feedback')){
341
+ jQuery(this).mousemove(function(e) {
342
+ var tipY = e.pageY + 16;
343
+ var tipX = e.pageX - 236;
344
+ var type = '#f08080';
345
+ if(jQuery(this).hasClass('positive')) {
346
+ type = '#ACC491';
347
+ }
348
+ jQuery("#AGToolTipDiv").css({
349
+ 'top': tipY,
350
+ 'left': tipX,
351
+ 'background': type,
352
+ 'border': 'none',
353
+ 'padding': '10px',
354
+ 'color':'#fff',
355
+ 'font-weight':'bold',
356
+ 'border-radius': '5px'
357
+ });
358
+ });
359
+ }else{
360
+ jQuery(this).mousemove(function(e) {
361
+ var tipY = e.pageY + 16;
362
+ var tipX = e.pageX + 16;
363
+ jQuery("#AGToolTipDiv").css({
364
+ 'top': tipY,
365
+ 'left': tipX,
366
+ 'background': '#FFFFD4',
367
+ 'border': '1px solid #FFFF00'
368
+ });
369
+ });
370
+ }
371
+ jQuery("#AGToolTipDiv")
372
+ .html(jQuery(this).attr('title'))
373
+ .stop(true,true)
374
+ .fadeIn("fast");
375
+ jQuery(this).removeAttr('title');
376
+ }, function() {
377
+ jQuery("#AGToolTipDiv")
378
+ .stop(true,true)
379
+ .fadeOut("fast");
380
+ jQuery(this).attr('title', jQuery("#AGToolTipDiv").html());
381
+ });
382
+ }
383
+ }
384
+
385
+ jQuery(document).ready(function(){
386
+ /*Add click handler on main buttons*/
387
+ jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(e){
388
+ if(jQuery(e.target).is('li')){
389
+ var hash = jQuery(this).find('a:first').attr('href');
390
+ document.location.hash = hash;
391
+ };
392
+ hideAllSections();
393
+ var text = jQuery(this).text();
394
+ jQuery(this).attr("class","selected");
395
+ showHideSection(text);
396
+
397
+ });
398
+
399
+ /*Admin Menu Reset all setings button*/
400
+ jQuery('#ag_edit_adminmenu_reset_button').click(function(){
401
+ afterFormClickCreateJson = false;
402
+ jQuery('#agca_form').submit();
403
+ });
404
+
405
+ /*Add new menu item button - creates new HTMl button elements*/
406
+ jQuery('#ag_add_adminmenu_button').click(function(){
407
+ var name = jQuery('#ag_add_adminmenu_name').val();
408
+ var url = jQuery('#ag_add_adminmenu_url').val();
409
+ var target = jQuery('#ag_add_adminmenu_target').val();
410
+ name = name.replace(/["']{1}/gi,"");
411
+ url = url.replace(/["']{1}/gi,"");
412
+ jQuery('#ag_add_adminmenu_name').val("");
413
+ jQuery('#ag_add_adminmenu_url').val("");
414
+ jQuery('#ag_add_adminmenu_target').val("_self");
415
+ jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button target="'+target+'" title="'+url+'" type="button">'+name+'</button>&nbsp;<a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a>&nbsp;<a style="cursor:pointer" title="Delete" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>');
416
+ reloadRemoveButtonEvents();
417
+ });
418
+
419
+ /*Add tooltip box*/
420
+ jQuery("body").append("<div id='AGToolTipDiv'></div>");
421
+
422
+ /*ToolTip*/
423
+ jQuery("label[title],#agca_donate_button, a.feedback").each(agcaApplyTooltip);
424
+
425
+ /*SECTION FOCUS*/
426
+ jQuery('.section_title').focus(function(){
427
+ });
428
+
429
+
430
+ //check hashtag
431
+ if(document.location.hash !== ""){
432
+ jQuery('#ag_main_menu a[href='+document.location.hash+']').trigger('click');
433
+ };
434
+
435
+ });
436
+
437
+ jQuery(function($){
438
+ /*Admin menu*/
439
+ jQuery('#adminmenu').css('display','block');
440
+
441
+ /*FORM SUBMITTED*/
442
+ jQuery('#agca_form').submit(function(){
443
+ processData();
444
+ return true;
445
+ });
446
+
447
+ //on radio button text click
448
+ jQuery('.agca-radio-text').on('click', function(){
449
+ var $o = jQuery(this);
450
+ var type = 'off';
451
+ if($o.hasClass('on')){
452
+ type='on';
453
+ }
454
+ $o.parent().find('.agca-radiobox[value='+type+']').trigger('click');
455
+ });
456
+
457
+ //Colorizer update input text colors
458
+ colorizerColorizeTextboxes();
459
+ });
460
+
461
+
462
+ function processEditAdminMenu(){
463
+ var array = {};
464
+
465
+ //top menus
466
+ jQuery('#ag_edit_adminmenu tr.top').each(function(){
467
+ var $tr = jQuery(this);
468
+ var originalText = $tr.find('.ag_admin_menu_parent a').text();
469
+ var newText = $tr.find('.ag_admin_menu_parent2 input').val();
470
+ var remove = $tr.find('.agca-checkbox').is(':checked');
471
+ var url = $tr.data('url');
472
+ array[url]={
473
+ 'name': originalText,
474
+ 'new': newText || "",
475
+ 'remove':remove,
476
+ 'url':url,
477
+ 'submenus':{}
478
+ };
479
+ });
480
+
481
+ //submenus
482
+ jQuery('#ag_edit_adminmenu tr.sub').each(function(){
483
+ var $tr = jQuery(this);
484
+ var newText = $tr.find('.ag_admin_menu_child2 input').val();
485
+ var remove = $tr.find('.agca-checkbox').is(':checked');
486
+ var url = $tr.data('url');
487
+ var index = $tr.data('index');
488
+ var parentIndex = $tr.data('parent');
489
+ var originalName = $tr.data('name');
490
+ array[parentIndex]['submenus'][index]={
491
+ 'name': originalName,
492
+ 'new': newText || "",
493
+ 'remove':remove,
494
+ 'url':url
495
+ };
496
+ });
497
+ return array;
498
+ }
499
+
500
+ function processData(){
501
+
502
+ //serialize admin menu edit configuration
503
+ var array = processEditAdminMenu();
504
+ if(afterFormClickCreateJson == true){
505
+ jQuery('#ag_edit_adminmenu_json_new').val(JSON.stringify(array));
506
+ }else{
507
+ jQuery('#ag_edit_adminmenu_json_new').val('');
508
+ }
509
+
510
+ //serialize buttons
511
+ array = "{";
512
+ var element = 0;
513
+ jQuery('#ag_add_adminmenu :button').each(function(){
514
+ //console.log(jQuery(this).html()+jQuery(this).attr('title'));
515
+ if(element > 0){
516
+ if(element > 1){
517
+ array += ", ";
518
+ }
519
+ array += "\"" + jQuery(this).html() + "\" : {";
520
+ array += " \"value\" : ";
521
+ array += "\"" + jQuery(this).attr('title') + "\"";
522
+ array += ", \"target\" : ";
523
+ array += "\"" + jQuery(this).attr('target') + "\"}";
524
+ }
525
+ element++;
526
+ });
527
+ array += "}";
528
+ if(element == 1){
529
+ array="";
530
+ }
531
+ jQuery('#ag_add_adminmenu_json').val(array);
532
+
533
+
534
+
535
+ /*Serialize colors*/
536
+ var array = "{";
537
+ var firstElement = true;
538
+ var topMarker = "";
539
+ jQuery('input.color_picker').each(function(){
540
+ if(firstElement != true){
541
+ array += ", ";
542
+ }
543
+ array += "\"" + jQuery(this).attr('id') + "\" : ";
544
+ array += "\"" + jQuery(this).val() + "\"";
545
+ firstElement = false;
546
+ });
547
+ array += "}";
548
+
549
+ if(!isSettingsImport){
550
+ jQuery('#ag_colorizer_json').val(array);
551
+ }
552
+ }
553
+
554
+ function agca_escapeHTMLChars(str){
555
+ return str
556
+ .replace(/&/g, '&amp;')
557
+ .replace(/'/g, '&#39;')
558
+ .replace(/"/g, '&quot;');
559
+ }
560
+
561
+ function agca_escapeChars(str){
562
+ return str.replace(/[\/\\\"\']/g, "\\$&");
563
+ //return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
564
+ }
565
+
566
+ /*C O L O R I Z E R*/
567
+ function updateTargetColor(id, color){
568
+ switch(id)
569
+ {
570
+ case 'color_background':
571
+ jQuery('html, .wp-dialog').css({
572
+ 'background-color':color
573
+ });
574
+ break;
575
+ case 'login_color_background':
576
+ jQuery('body.login').css({
577
+ 'background-color':color
578
+ });
579
+ break;
580
+
581
+ case 'color_header':
582
+ jQuery('#wphead').css({
583
+ 'background':color
584
+ });
585
+
586
+ //wp > 3.3
587
+ jQuery('#wpadminbar').css({'background':color});
588
+ jQuery('#wpadminbar .ab-top-menu').css({'background':color});
589
+
590
+ if(wpversion >= 3.2){
591
+ jQuery('#wphead').css({
592
+ 'margin':'0',
593
+ 'margin-left':'-14px',
594
+ 'padding-left':'15px'
595
+ });
596
+ jQuery("#backtoblog").attr("style","");
597
+ }
598
+ break;
599
+ case 'color_admin_menu_top_button_background':
600
+ jQuery('#adminmenu a.menu-top').css({
601
+ 'background':color
602
+ });
603
+ jQuery('#adminmenu li.menu-top').css({
604
+ 'background':color
605
+ });
606
+ break;
607
+ case 'color_admin_menu_top_button_current_background':
608
+ jQuery('#adminmenu li.menu-top.wp-menu-open a.menu-top').css({
609
+ 'background':color
610
+
611
+ });
612
+ jQuery('#adminmenu li.menu-top.current a.menu-top').css({
613
+ 'background':color
614
+ });
615
+ jQuery('body.folded #adminmenu li.menu-top.wp-menu-open').css({
616
+ 'background':color
617
+ });
618
+ break;
619
+ case 'color_admin_menu_top_button_hover_background':
620
+ if(color == "")break;
621
+ var selector = '#adminmenu a.menu-top';
622
+ if(jQuery('body').hasClass('folded')){
623
+ selector = '#adminmenu li.menu-top';
624
+ }
625
+ var originalBackground = jQuery(selector).css('background-color');
626
+
627
+ //if first is selected, use second
628
+ if((jQuery(selector+":eq(0)").hasClass('current') || jQuery(selector+":eq(0)").hasClass('wp-has-current-submenu'))){
629
+ originalBackground = jQuery(selector+':eq(1)').css('background-color');
630
+ }
631
+ jQuery(selector).mouseover(function(){
632
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
633
+ jQuery(this).css({'background':color});
634
+ }
635
+ }).mouseout(function(){
636
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
637
+ jQuery(this).css('background',originalBackground);
638
+ }
639
+ });
640
+
641
+ //for folded menu
642
+
643
+
644
+ break;
645
+ case 'color_admin_menu_submenu_background':
646
+ // jQuery("#adminmenu li.wp-has-current-submenu").removeClass("wp-has-current-submenu");
647
+ jQuery('#adminmenu .wp-submenu.sub-open').remove();
648
+ jQuery('#adminmenu .wp-submenu a, #adminmenu li.wp-has-current-submenu .wp-submenu a').each(function(){
649
+ jQuery(this).css({
650
+ 'background':color
651
+ });
652
+ });
653
+ jQuery('#adminmenu .wp-submenu').css({'background':color,'margin-left':'0',"padding-top":roundedSidberSize+"px","padding-bottom":roundedSidberSize+"px"});
654
+ jQuery('#adminmenu .wp-has-current-submenu .wp-submenu').css("padding","0");
655
+ //jQuery('#adminmenu .wp-submenu').css('border','3px solid red');
656
+ jQuery('#adminmenu .wp-submenu ul').css({'background':'none'});
657
+ jQuery('#adminmenu .wp-submenu ul').css('border','none');
658
+ jQuery('#adminmenu .wp-submenu .wp-submenu-wrap').css('border','none');
659
+
660
+ break;
661
+ case 'color_admin_submenu_font':
662
+ jQuery('#adminmenu .wp-submenu li a').css('color',color);
663
+ break;
664
+ case 'color_admin_menu_font':
665
+ jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
666
+ 'color':color
667
+ });
668
+ break;
669
+ case 'color_admin_menu_behind_background':
670
+ jQuery('#adminmenuback, #adminmenuwrap').css({
671
+ 'background-color':color
672
+ });
673
+ break;
674
+ case 'color_admin_menu_submenu_background_hover':
675
+ var submenuSelector = '#adminmenu .wp-submenu a';
676
+ var originalSubBackground = jQuery(submenuSelector).css('background-color');
677
+ jQuery(submenuSelector).mouseover(function(){
678
+ jQuery(this).css({
679
+ 'background':color
680
+ });
681
+ }).mouseout(function(){
682
+ jQuery(this).css('background',originalSubBackground);
683
+ });
684
+ //jQuery('#adminmenu .wp-submenu a:hover').css({'background':color});
685
+ break;
686
+ case 'color_font_content':
687
+ jQuery('#wpbody-content, #wpbody-content label, #wpbody-content p,#wpbody-content .form-table th, #wpbody-content .form-wrap label').css({
688
+ 'color':color
689
+ });
690
+ break;
691
+ case 'color_font_header':
692
+ jQuery('#wphead, #wphead a, #wpadminbar a, #wpadminbar span').css({
693
+ 'color':color
694
+ });
695
+ break;
696
+ case 'color_font_footer':
697
+ jQuery('#wpfooter, #wpfooter a').css({
698
+ 'color':color
699
+ });
700
+ break;
701
+ case 'color_widget_bar':
702
+ jQuery(".widget .widget-top, .postbox h3, .stuffbox h3").css({
703
+ 'background' : color,
704
+ 'text-shadow' :'none'
705
+ });
706
+ break;
707
+ case 'color_widget_background':
708
+ jQuery(".widget, .postbox").css('background',color);
709
+ //jQuery(".widget, #widget-list .widget-top, .postbox, .menu-item-settings").css('background',color); remove if <3.2 work
710
+ break;
711
+ default:
712
+ }
713
+ }
714
+ function updateColor(id,color){
715
+ jQuery("#"+id).css({
716
+ 'background-color':color
717
+ });
718
+ jQuery("#"+id).val(color);
719
+ if(isDarker(color) == true){
720
+ jQuery("#"+id).css('color','#ffffff');
721
+ }else{
722
+ jQuery("#"+id).css('color','#000000');
723
+ }
724
+ updateTargetColor(id,color);
725
+ }
726
+ /*First load apply colours from fields*/
727
+
728
+ /*C O L O R I Z E R E N D*/
729
+
730
+ /*A J A X*/
731
+ jQuery(document).ready(function(){
732
+
733
+ //Ams
734
+ if(typeof isAGCAPage !== 'undefined'){
735
+ if(isAGCAPage == true){
736
+ //alert('admin page');
737
+ var url="http://wordpressadminpanel.com/ads/ep/ads/ads?jsoncallback=?";
738
+ jQuery.getJSON(
739
+ url,{
740
+ wp_ver: wpversion,
741
+ agca_ver: agca_version,
742
+ format: "json"
743
+ },
744
+ function(json){
745
+ jQuery.each(json,function(i,post){
746
+ jQuery('#agca_advertising ul').append('<li><a target="_blank" href="http://wordpressadminpanel.com/ads/ep/ads/ad?id=' + post.id + '" ><img height=\"100px\" src=\"'+post.src+'\" title=\"'+post.title+'\" /></a></li>');
747
+ });
748
+ jQuery('#agca_advertising').show();
749
+
750
+ });
751
+ }
752
+ }
753
+
754
+
755
+ //News
756
+ jQuery(document).ready(function(){
757
+ if(typeof isAGCAPage !== 'undefined'){
758
+ if(isAGCAPage == true){
759
+ var url="http://wordpressadminpanel.com/info/info?jsoncallback=?";
760
+ jQuery.getJSON(
761
+ url,{
762
+ wp_ver: wpversion,
763
+ agca_ver: agca_version,
764
+ format: "json"
765
+ },
766
+ function(json){
767
+ jQuery.each(json.posts,function(i,post){
768
+ jQuery('#agca_news').append('<p><strong>Info: </strong>'+post.news+'</p>');
769
+ });
770
+ jQuery('#agca_news p').each(function(){
771
+ jQuery(this).hide();
772
+ });
773
+
774
+ });
775
+
776
+ setInterval(function() {
777
+ if(jQuery('#agca_news p.news_online').size() == 0){
778
+ jQuery('#agca_news p:first').addClass('news_online');
779
+ jQuery('#agca_news p:first').show();
780
+ }else{
781
+ var changed = false;
782
+ var finish = false;
783
+ jQuery('#agca_news p').each(function(){
784
+ if(finish != true){
785
+ if(changed == true){
786
+ jQuery(this).addClass('news_online');
787
+ jQuery(this).show();
788
+ finish = true;
789
+ }
790
+ else if(jQuery(this).hasClass('news_online')){
791
+ jQuery(this).hide();
792
+ jQuery(this).removeClass('news_online');
793
+ changed = true;
794
+ };
795
+ }
796
+ });
797
+ if(jQuery('#agca_news p.news_online').size() == 0){
798
+ jQuery('#agca_news p:first').addClass('news_online');
799
+ jQuery('#agca_news p:first').show();
800
+ }
801
+ }
802
+ }, 5000);
803
+ }
804
+ }
805
+
806
+ });
807
+
808
+
809
+ });
810
+ /*A J A X*/
811
+
812
+ /*AGCA CHECKBOX RADIOBOX*/
813
+ function agcaCheckBoxOnClick(obj){
814
+ var isNowChecked = false;
815
+ var $input = jQuery(obj).prev();
816
+ if($input.is(':checked')){
817
+ $input.removeAttr('checked');
818
+ }else{
819
+ isNowChecked = true;
820
+ $input.attr('checked','checked');
821
+ }
822
+
823
+ if($input.hasClass('has-dependant')){
824
+ var dependantSel = $input.data('dependant');
825
+ var isOppositeToggle = $input.hasClass('dependant-opposite');
826
+
827
+ if(isNowChecked && !isOppositeToggle || !isNowChecked && isOppositeToggle){
828
+ jQuery(dependantSel).show("slide");
829
+ }else{
830
+ jQuery(dependantSel).hide("slideDown");
831
+ }
832
+ }
833
+
834
+ //console.log(obj.prev());
835
+ if($input.is(':checked')){
836
+ jQuery(obj).addClass('agca-checkbox-box-checked');
837
+ jQuery(obj).removeClass('agca-checkbox-box');
838
+ }else{
839
+ jQuery(obj).addClass('agca-checkbox-box');
840
+ jQuery(obj).removeClass('agca-checkbox-box-checked');
841
+ }
842
+ }
843
+ function agcaRadioBoxOnClick(obj){
844
+ obj.prev().trigger('click');
845
+ //console.log(obj.prev());
846
+ obj.parent().find('.agca-radiobox').removeClass('checked');
847
+ if(jQuery(obj).prev().is(':checked')){
848
+ jQuery(obj).addClass('checked');
849
+ }else{
850
+ jQuery(obj).removeClass('checked');
851
+ }
852
+ }
853
+ function agcaChangeCheckBoxStyles(){
854
+ /*checkbox*/
855
+ jQuery('.agca-checkbox-box-checked').remove();
856
+ jQuery('.agca-checkbox-box').remove();
857
+ jQuery('.agca-checkbox').each(function(){
858
+ jQuery(this).hide();
859
+ var cls = "agca-checkbox-box";
860
+ if(jQuery(this).is(':checked')){
861
+ cls = "agca-checkbox-box-checked";
862
+ }
863
+ if(jQuery(this).hasClass('visibility')){
864
+ cls +=' visibility';
865
+ }
866
+ jQuery(this).after('<div onClick="agcaCheckBoxOnClick(jQuery(this));" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
867
+ });
868
+
869
+ /*radio*/
870
+ jQuery('.agca-radiobox').remove();
871
+ jQuery('.agca-radio').each(function(){
872
+ jQuery(this).hide();
873
+ var cls = "agca-radiobox";
874
+ if(jQuery(this).is(':checked')){
875
+ cls = "agca-radiobox checked";
876
+ }
877
+
878
+ jQuery(this).after('<div onClick="agcaRadioBoxOnClick(jQuery(this));" value="'+jQuery(this).attr('value')+'" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
879
+ });
880
+ }
881
+
882
+ function isWPHigherOrEqualThan(targetVersion){
883
+ //remove sufixes, beta RC etc
884
+ if (wpversion.indexOf("-")!=-1){
885
+ var parts = wpversion.split("-");
886
+ wpversion = parts[0];
887
+ }
888
+ var currentVersion = parseFloat(wpversion);
889
+ targetVersion = parseFloat(targetVersion);
890
+
891
+ return (wpversion >= targetVersion);
892
+ }
893
+
894
+ function colorizerColorizeTextboxes(){
895
+ jQuery('#section_ag_colorizer_settings .color_picker').each(function(){
896
+ var $o = jQuery(this);
897
+ $o.css('background-color', $o.val());
898
+ $o.lightOrDark();
899
+ if($o.hasClass('dark')){
900
+ $o.css('color','#fff');
901
+ }else{
902
+ $o.css('color','#000');
903
+ }
904
+ });
905
+ }
906
+
907
+
908
+ //VALIDATION
909
+ jQuery(document).ready(function() {
910
+ jQuery(".validateNumber").on('keydown',function(event) {
911
+ // Allow only backspace and delete
912
+ var limit = jQuery(this).attr('limit');
913
+ var value = jQuery(this).val();
914
+
915
+ if ( event.keyCode == 46 || event.keyCode == 8 ) {
916
+ } else {
917
+ if((typeof(limit) != undefined) && value.length >= limit){
918
+ return false;
919
+ }
920
+ if (event.keyCode < 95) {
921
+ if (event.keyCode < 48 || event.keyCode > 57 ) {
922
+ event.preventDefault();
923
+ }
924
+ } else {
925
+ if (event.keyCode < 96 || event.keyCode > 105 ) {
926
+ event.preventDefault();
927
+ }
928
+ }
929
+ }
930
+ });
931
+ });
932
+
933
+ (function($){
934
+
935
+ $.fn.lightOrDark = function(){
936
+ var r,b,g,hsp
937
+ , a = this.css('background-color');
938
+
939
+ if (a.match(/^rgb/)) {
940
+ a = a.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
941
+ r = a[1];
942
+ g = a[2];
943
+ b = a[3];
944
+ } else {
945
+ a = +("0x" + a.slice(1).replace( // thanks to jed : http://gist.github.com/983661
946
+ a.length < 5 && /./g, '$&$&'
947
+ )
948
+ );
949
+ r = a >> 16;
950
+ b = a >> 8 & 255;
951
+ g = a & 255;
952
+ }
953
+ hsp = Math.sqrt( // HSP equation from http://alienryderflex.com/hsp.html
954
+ 0.299 * (r * r) +
955
+ 0.587 * (g * g) +
956
+ 0.114 * (b * b)
957
+ );
958
+ if (hsp>127.5) {
959
+ this.addClass('light');
960
+ } else {
961
+ this.addClass('dark');
962
+ }
963
+ }
964
+
965
+ })(jQuery);
trunk/script/agca_farbtastic.js ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function isDarker(rgb){
2
+ var r=parseInt(rgb.substring(1,3));
3
+ var g=parseInt(rgb.substring(3,5));
4
+ var b=parseInt(rgb.substring(5));
5
+
6
+ r = r/255, g = g/255, b = b/255;
7
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
8
+ var h, s, v = max;
9
+
10
+ var d = max - min;
11
+ s = max == 0 ? 0 : d / max;
12
+
13
+ if(max == min){
14
+ h = 0; // achromatic
15
+ }else{
16
+ switch(max){
17
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
18
+ case g: h = (b - r) / d + 2; break;
19
+ case b: h = (r - g) / d + 4; break;
20
+ }
21
+ h /= 6;
22
+ }
23
+ //return [h, s, v];
24
+ if(v < 0.5){
25
+ return true;
26
+ }else{
27
+ return false;
28
+ }
29
+ }
30
+
31
+ jQuery(document).ready(function() {
32
+
33
+ jQuery('.pick_color_button').click(function(e){
34
+ jQuery('#'+jQuery(this).attr('alt')).focus();
35
+ jQuery('#picker').css("left",e.pageX-100);
36
+ jQuery('#picker').css("top",e.pageY-100);
37
+ jQuery('#picker').show();
38
+
39
+ });
40
+ jQuery('.color_picker').click(function(){
41
+ jQuery('#picker').farbtastic('#'+jQuery(this).attr('id'));
42
+ });
43
+ jQuery('.color_picker').bind('keydown',function(){
44
+ updateColor(jQuery(this).attr('id'),jQuery(this).val())
45
+ updateAllColors();
46
+ });
47
+ jQuery('#picker').mouseleave(function(){
48
+ jQuery(this).hide();
49
+ });
50
+ jQuery('#picker').hide();
51
+ jQuery('.pick_color_button_clear').click(function(){
52
+ jQuery('#'+jQuery(this).attr('alt')).val("");
53
+ jQuery('#'+jQuery(this).attr('alt')).attr("style","");
54
+ });
55
+ });
56
+
57
+ jQuery(document).ready(function() {
58
+ jQuery('#picker').farbtastic(function(color){
59
+ if(document.activeElement.id !=""){
60
+ updateColor(document.activeElement.id,color);
61
+ updateAllColors();
62
+ }
63
+ });
64
+ jQuery(".color_picker").bind('keydown',function(){
65
+ updateColor(jQuery(this).attr('id'),jQuery(this).val());
66
+ updateAllColors();
67
+ });
68
+ });
trunk/script/agca_tmpl.js ADDED
@@ -0,0 +1,738 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var isAGCAPage = true;
2
+ var template_name = "";
3
+ var templates_installed = [];
4
+ var xhr =null;
5
+ var agcaLoadingTimeOut = null;
6
+
7
+ function agca_getTemplateCallback(data){
8
+ agcaDebug('FN:agca_getTemplateCallback()');
9
+ agcaDebug(JSON.stringify(data));
10
+ if(data.success == 0){
11
+ //alert(data.data);
12
+ agcaInfoMessage("Error",data.data);
13
+ jQuery('#agca_template_popup').hide();
14
+ }else{
15
+ jQuery("#templates_name").val(template_name);
16
+ var parts = data.data.split("||||");
17
+ jQuery("#templates_data").val(parts[1]);
18
+ //console.log(jQuery("#templates_data").val());
19
+ jQuery("body").append(parts[0]);
20
+
21
+ //load settings
22
+ agca_loadTemplateSettingsInitial(template_name);
23
+ }
24
+ }
25
+
26
+ function agca_getTemplateByLicenseKeyCallback(data){
27
+ agcaDebug('FN:agca_getTemplateByLicenseKeyCallback()');
28
+ agcaDebug(JSON.stringify(data));
29
+ if(data.success == 0){
30
+ agcaInfoMessage("Error",data.data);
31
+ }else{
32
+ if(data.data.length < 100){
33
+ template_selected = data.data;
34
+ var key = agcaTemplatesSessionGetLicenseKey(template_selected);
35
+ agcaProgress('Loading theme... Please wait...');
36
+ agca_getTemplate(template_selected,key);
37
+ }else{
38
+ agcaDebug("Uknown theme name" + data.data);
39
+ }
40
+
41
+ }
42
+ }
43
+
44
+ function agca_getTemplatesCallback(data){
45
+ agcaDebug('FN:agca_getTemplatesCallback()');
46
+ if(data.data == "CDbException"){
47
+ data.data = "Service is temporary to busy. Please reload the page or try again later.";
48
+ agcaDebugObj(data);
49
+ }else if(data.data == "PHP Error"){
50
+ data.data = "Error occurred on the server.";
51
+ agcaDebugObj(data);
52
+ }
53
+ jQuery('#agca_templates').html(data.data);
54
+ jQuery('#advanced_template_options').show();
55
+ jQuery("#agca_installed_templates .template img").each(agcaApplyTooltip);
56
+ jQuery("#agca_loaded_templates .template img").each(agcaApplyTooltip);
57
+ jQuery('#advanced_template_options a').each(agcaApplyTooltip);
58
+ }
59
+ function agca_client_init(){
60
+ agcaDebug('FN:agca_client_init()');
61
+ agca_getLocalTemplates();
62
+ checkIfTemplatesAreLoaded(1);
63
+ jQuery('#agca_templates').html('<p class="initialLoader" style="font-size:18px;color:gray;font-style:italic">Loading themes...</p>');
64
+ }
65
+
66
+ function agca_setupXHR(){
67
+ agcaDebug('FN:agca_setupXHR()');
68
+ if(xhr != null) return false;
69
+ xhr = new easyXDM.Rpc({
70
+ remote:templates_ep
71
+ //onReady: function () { alert('ready'); }
72
+ }, {
73
+ remote: {
74
+ request: {
75
+ }
76
+ },
77
+ handle: function(data, send){
78
+ if(data.success){
79
+ var callbackFname = data.url.split('callback=')[1];
80
+ var fn = window[callbackFname];
81
+ if(fn != undefined){
82
+ fn(data);
83
+ }
84
+ }else{ console.log('errr');
85
+ console.log(data.url);
86
+ var url = data.url;
87
+ if(url !== undefined && url != ""){
88
+ var cb = url.split('callback=')[1];
89
+ if(cb != ""){
90
+ var fn = window[cb];
91
+ if(fn != undefined){
92
+ fn(data);
93
+ }
94
+ }
95
+ }else{
96
+ printInitialAGCAError("Please update your browser in order to view AG Custom Admin themes.");
97
+ }
98
+ }
99
+ }
100
+ });
101
+ }
102
+
103
+ function agca_getTemplates(){
104
+ agcaDebug('FN:agca_getTemplates()');
105
+ //agca_uploadRemoteImage('http://www.neowing.co.jp/idol_site2/image/FDGD-21/fdgd-21-top.jpg');
106
+ agca_setupXHR();
107
+ if(typeof agca_active_template_version === 'undefined'){
108
+ agca_active_template_version = "";
109
+ }
110
+
111
+ xhr.request({
112
+ url: templates_ep + "service/client" + "&callback=agca_getTemplatesCallback",
113
+ method: "POST",
114
+ callBack: agca_getTemplatesCallback,
115
+ data: {isPost:true, wpv:wpversion, agcav:agca_version,selected:template_selected,installed:agca_installed_templates,template_version:agca_active_template_version}
116
+ });
117
+ }
118
+
119
+ function agca_getConfiguration(){
120
+ agcaDebug('FN:agca_getConfiguration()');
121
+ /*xhr.request({
122
+ url: templates_ep + "/configuration" + "?callback=agca_getConfigurationCallback",
123
+ method: "POST",
124
+ callBack: agca_getConfigurationCallback,
125
+ data: {isPost:true}
126
+ });*/
127
+ jQuery.getJSON(templates_ep + "?callback=?",
128
+ function(data){
129
+ console.log("EP:"+data.ep);
130
+ templates_ep = data.ep;
131
+ if(data.error !=""){
132
+ printInitialAGCAError(data.error);
133
+ }else{
134
+ agca_getTemplates();
135
+ }
136
+ }
137
+ ).error(function(jqXHR, textStatus, errorThrown) {
138
+ agca_error({url:templates_ep,data:textStatus + " " + jqXHR.responseText});
139
+ /*console.log("error " + textStatus);
140
+ console.log("incoming Text " + jqXHR.responseText);*/
141
+ });
142
+ }
143
+
144
+ function printInitialAGCAError(err){
145
+ jQuery('#agca_templates p.initialLoader').html(err);
146
+ jQuery('#agca_templates p').removeClass('initialLoader');
147
+ clearTimeout(agcaLoadingTimeOut);
148
+ }
149
+
150
+ function agca_getTemplate(template, key){
151
+ agcaDebug('FN:agca_getTemplate()');
152
+ template_name = template;
153
+ if(!agcaTemplatesSessionIsLicenseSet(template)){
154
+ agcaTemplatesSessionAdd(template, key);
155
+ }
156
+ xhr.request({
157
+ url: templates_ep + "service/gettemplate"+"&tmpl="+template+"&key="+key+"&callback=agca_getTemplateCallback",
158
+ method: "POST",
159
+ callBack: agca_getTemplateCallback,
160
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
161
+ });
162
+ }
163
+
164
+ function agca_getTemplateByLicenseKey(key){
165
+ agcaDebug('FN:agca_getTemplateByLicenseKey('+key+')');
166
+ //template_name = template;
167
+ xhr.request({
168
+ url: templates_ep + "service/gettemplatebylk"+"&tmpl=&key="+key+"&callback=agca_getTemplateByLicenseKeyCallback",
169
+ method: "POST",
170
+ callBack: agca_getTemplateByLicenseKeyCallback,
171
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
172
+ });
173
+ }
174
+
175
+ function agca_loadTemplateSettingsInitial(template){
176
+ agcaDebug('FN:agca_loadTemplateSettingsInitial()');
177
+ agca_loadTemplateSettingsCore(template, true);
178
+ }
179
+
180
+ function agca_loadTemplateSettings(template){
181
+ agcaDebug('FN:agca_loadTemplateSettings()');
182
+ agca_loadTemplateSettingsCore(template, false);
183
+ }
184
+
185
+ function agca_loadTemplateSettingsCore(template, isInitial){
186
+ agcaDebug('FN:agca_loadTemplateSettingsCore()');
187
+ template_name = template;
188
+ template_selected = template;
189
+
190
+ var licenseKey = "";
191
+ if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]['license'] != null){
192
+ licenseKey = agcaTemplatesSession[template]['license'];
193
+ }
194
+
195
+ var calb = agca_getTemplateSettingsCallback;
196
+ var calbName = "agca_getTemplateSettingsCallback";
197
+
198
+ if(isInitial){
199
+ agcaProgress("Loading theme settings...");
200
+ calb = agca_getTemplateSettingsInitialCallback;
201
+ calbName = "agca_getTemplateSettingsInitialCallback";
202
+ }
203
+ xhr.request({
204
+ url: templates_ep + "service/gettemplatesettings"+"&tmpl="+template+"&key="+licenseKey+"&callback="+calbName,
205
+ method: "POST",
206
+ callBack: calb,
207
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
208
+ });
209
+ //alert('saving template settings for template:' + template_name);
210
+ }
211
+
212
+ function agca_getTemplateSettingsInitialCallback(data){
213
+ agcaDebug('FN:agca_getTemplateSettingsInitialCallback()');
214
+ agcaDebug(JSON.stringify(data));
215
+ if(data.success == 0){
216
+ agcaInfoMessage("Error",data.data);
217
+ //TODO - what if template is loaded, but settings are not?
218
+ console.log('ERR:theme settings are not loaded');
219
+ }else{
220
+ var settings = "";
221
+ var filteredSettings = {};
222
+ try{
223
+ settings = JSON.parse(data.data);
224
+ if(settings.length == 0){
225
+ }else{
226
+ for(var ind in settings){
227
+ var type = settings[ind].type;
228
+ var text = "";
229
+ var defaultValue = "";
230
+ var newItem = {};
231
+ newItem.code = settings[ind].name;
232
+ newItem.type = settings[ind].type;
233
+ newItem.value = settings[ind].value;
234
+ newItem.default_value = settings[ind].default_value;
235
+ filteredSettings[ind] = newItem;
236
+ }
237
+ agcaDebug("Selected theme:" + template_selected);
238
+ console.log(filteredSettings);
239
+
240
+ }
241
+ }catch(e){
242
+ console.log('Error while loading settings');
243
+ console.log(e);
244
+ }
245
+ agca_saveTemplateSettingsInitial(template_selected, filteredSettings);
246
+ }
247
+ }
248
+ /*template settings - load them to UI popup window*/
249
+ function agca_getTemplateSettingsCallback(data){
250
+ agcaDebug('FN:agca_getTemplateSettingsCallback()');
251
+ //console.log(data.data);
252
+
253
+ if(data.success == 0){
254
+ agcaTemplatesSessionRemove(template_selected);
255
+ //alert(data.data);
256
+ jQuery('#agca_template_settings .agca_loader').html(data.data);
257
+ }else{
258
+
259
+ var settings = "";
260
+ try{
261
+ if(data.data.substring(0, "Exception:".length) === "Exception:"){
262
+ var errr= data.data.substr(10);
263
+ jQuery('#agca_template_settings .agca_loader').html(errr);
264
+ return false;
265
+ }
266
+ settings = JSON.parse(data.data);
267
+ if(settings.length == 0){
268
+ jQuery('#agca_template_settings .agca_loader').html("Additional settings are not available for this theme");
269
+ }else{
270
+ jQuery('#agca_template_settings .agca_loader').hide();
271
+ jQuery('#agca_save_template_settings').show();
272
+
273
+ var currentSettings = (agca_template_settings != null && agca_template_settings != undefined)?agca_template_settings:{};
274
+
275
+ //TODO: Change to use object name code object[code], instead of number object[i]
276
+ for(var ind in settings){
277
+ var type = settings[ind].type;
278
+ var text = "";
279
+ //console.log(settings[ind]);
280
+ var currentValue = "";
281
+
282
+ //get previously saved value
283
+ for(var ind2 in currentSettings){
284
+ if(currentSettings[ind2]!= null && currentSettings[ind2].code == settings[ind].name){
285
+ currentValue = currentSettings[ind2].value;
286
+ }
287
+ }
288
+
289
+ //if current value is still not defined, use default value
290
+ if(currentValue == ""){
291
+ currentValue = settings[ind].default_value;
292
+ }
293
+ /*text*/
294
+ if(type==1){
295
+ text = "<p>"+settings[ind].title+"</p><input type=\"text\" name=\"agcats_"+settings[ind].name+"\" value=\""+currentValue+"\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" class=\"setting\" stype=\"1\" /></br>";
296
+ }else if(type==2){
297
+ text = "<p>"+settings[ind].title+"</p><textarea name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"2\" >"+currentValue+"</textarea></br>";
298
+ }else if(type==3){
299
+ text = "<p>"+settings[ind].title+"</p><select name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"3\" >";
300
+ var options = settings[ind].default_value.split(',');
301
+ for(var indopt in options){
302
+ var sel = "";
303
+ if(currentValue == options[indopt]){
304
+ sel = " selected=\"selected\" ";
305
+ }
306
+ text+="<option value="+options[indopt]+" "+sel+">"+options[indopt]+"</option>";
307
+ }
308
+ text+="</select>";
309
+ }else if(type==4){
310
+ text = "<p>"+settings[ind].title+"</p><div class=\"agca_form_0100_div\"><input value=\""+currentValue+"\" type=\"text\" name=\"agcats_"+settings[ind].name+"\" class=\"setting agca_form_0100\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"4\" /><input type=\"button\" name=\"agca_form_decr\" class=\"agca_form_decr\" value=\"-\"/><input type=\"button\" name=\"agca_form_incr\" class=\"agca_form_incr\" value=\"+\"/>&nbsp;(0-100)</div></br>";
311
+ }else if(type==6){
312
+ if(currentValue == true){
313
+ currentValue =" checked=\"checked\" ";
314
+ }else{
315
+ currentValue="";
316
+ }
317
+ text = "<p>"+settings[ind].title+"</p><input type=\"checkbox\" name=\"agcats_"+settings[ind].name+"\" class=\"setting\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" stype=\"6\" "+currentValue+" /></br>";
318
+ }else if(type==7){
319
+ text = "<p>"+settings[ind].title+"</p><div name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"7\" style=\"padding-left: 10px;color:white;\">";
320
+ var options = settings[ind].default_value.split(',');
321
+ for(var indopt in options){
322
+ var sel = "";
323
+ if(currentValue == options[indopt]){
324
+ sel = " checked ";
325
+ }
326
+ text+="<input name=\"agcats_"+settings[ind].name+"_val\" style=\"margin-right:6px;\" type=\"radio\" value="+options[indopt]+" "+sel+" name=\"sd\"/>"+options[indopt]+"</br>";
327
+ }
328
+ text+="</div>";
329
+ }
330
+ jQuery('#agca_template_settings').append(text);
331
+
332
+ //TODO: do similar to options above, clean a code up a litle bit, add them dinamicaly all attributes instead of inline adding
333
+ jQuery('.agca_form_0100_div .agca_form_decr').click(function(){
334
+ var val =jQuery(this).parent().find('.agca_form_0100').val();
335
+ val = parseInt(val.replace(/\D/g,''));//leave only numbers
336
+ if(isNaN(val)) val =0;
337
+ val--;
338
+ if(val < 0)val =0;
339
+ if(val > 100)val=100;
340
+ jQuery(this).parent().find('.agca_form_0100').val(val);
341
+ });
342
+ jQuery('.agca_form_0100_div .agca_form_incr').click(function(){
343
+ var val =jQuery(this).parent().find('.agca_form_0100').val();
344
+ val = parseInt(val.replace(/\D/g,''));//leave only numbers
345
+ if(isNaN(val)) val =0;
346
+ val++;
347
+ if(val < 0)val =0;
348
+ if(val > 100)val=100;
349
+ jQuery(this).parent().find('.agca_form_0100').val(val);
350
+ });
351
+ jQuery('.agca_form_0100').keyup(function(){
352
+
353
+ var val =jQuery(this).val();
354
+ val = parseInt(val.replace(/\D/g,''));//leave only numbers
355
+ if(val < 0 || isNaN(val))val =0;
356
+ if(val > 100)val=100;
357
+
358
+ jQuery(this).val(val);
359
+
360
+ });
361
+ }
362
+ }
363
+ }catch(e){
364
+ console.log(e);
365
+ }
366
+ }
367
+ //alert('callb');
368
+ }
369
+
370
+ function agca_saveTemplateSettingsInitial(template, settings){
371
+ agcaDebug('FN:agca_saveTemplateSettingsInitial()');
372
+ var originalText = jQuery("#templates_data").val();
373
+ jQuery("#templates_data").val(originalText+"|||"+JSON.stringify(settings));
374
+ agca_removeTemplateImages(template, agca_startUploadingRemoteImages);
375
+ }
376
+
377
+ function agca_saveTemplateSettingsFromForm(template){
378
+ agcaDebug('FN:agca_saveTemplateSettingsFromForm()');
379
+ template_name = template;
380
+
381
+ //get settings from the form
382
+ var settings = {};
383
+
384
+ jQuery('#agca_template_settings .setting').each(function(ind){
385
+ var setting_typ = jQuery(this).attr('stype');
386
+ var setting_val = jQuery(this).val();
387
+ var setting_cod = jQuery(this).attr('code');
388
+ var setting_def = jQuery(this).attr('default_value');
389
+
390
+ if(jQuery(this).attr('type')=="checkbox"){
391
+ setting_val = jQuery(this).is(':checked');
392
+ }
393
+
394
+ //radio
395
+ if(setting_typ == "7"){
396
+ setting_val = jQuery('input[name="agcats_'+setting_cod+'_val"]:checked').val();
397
+ }
398
+
399
+ settings[ind] = {
400
+ type: setting_typ,
401
+ value: setting_val,
402
+ code: setting_cod,
403
+ default_value: setting_def
404
+ };
405
+
406
+ });
407
+
408
+ jQuery('#agca_template_settings').html("<p>Applying theme settings...</p>");
409
+ agca_saveTemplateSettingsCore(template, settings, function(data){
410
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
411
+ });
412
+ }
413
+
414
+
415
+ function agca_saveTemplateSettingsCore(template, settings, callback){
416
+ agcaDebug('FN:agca_saveTemplateSettingsCore()');
417
+ var url = window.location;
418
+ jQuery.post(url,{"_agca_template_settings": JSON.stringify(settings),"_agca_current_template":template},
419
+ callback
420
+ )
421
+ .fail(
422
+ function(){
423
+ console.log('AGCA Error: agca_saveTemplateSettingsCore()');
424
+ });
425
+ }
426
+
427
+ /*function agca_saveTemplateSettingsCore(template, settings){
428
+ var settings = {};
429
+ var url = window.location;
430
+ jQuery.post(url,{"_agca_template_settings":settings,"_agca_current_template":template},
431
+ function(data){
432
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
433
+ //console.log('reload');
434
+ })
435
+ .fail(
436
+ function(){
437
+ console.log('AGCA Error: agca_saveTemplateSettingsCore()');
438
+ });
439
+ }*/
440
+
441
+ function agca_activateTemplate(template){
442
+ /*if(template_selected == ""){
443
+ alert('There are no active templates to deactivate.');
444
+ return false;
445
+ };*/
446
+ if(template == ""){
447
+ agcaProgress('Deactivating theme... Please wait...');
448
+ }else{
449
+ agcaProgress('Activating theme... Please wait...');
450
+ }
451
+
452
+ agcaDebug('FN:agca_activateTemplate('+template+')');
453
+ jQuery('input[name=agca_colorizer_turnonoff]').val("off");
454
+
455
+ //ajax submit form
456
+ var frm = jQuery('#agca_form');
457
+ jQuery.ajax({
458
+ type: frm.attr('method'),
459
+ url: frm.attr('action'),
460
+ data: frm.serialize(),
461
+ success: function (data) {
462
+ var url = window.location;
463
+ jQuery.post(url,{"_agca_activate_template":template},
464
+ function(data){
465
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
466
+ })
467
+ .fail(
468
+ function(){
469
+ console.log('AGCA Error: agca_activateTemplate()');
470
+ });
471
+ }
472
+ });
473
+ }
474
+
475
+ function agca_removeAllTemplates(){
476
+ agcaDebug('FN:agca_removeAllTemplates()');
477
+ yesnoPopup("Confirm","All installed themes will be uninstalled completely. You would need to re-activate your purchased themes with valid license keys in order to install them again. Are you sure?",agca_removeAllTemplatesConfirmed);
478
+ }
479
+
480
+ function agca_removeAllTemplatesConfirmed(){
481
+ agcaDebug('FN:agca_removeAllTemplatesConfirmed()');
482
+ agcaProgress('Removing all themes... Please wait...');
483
+ window.setTimeout(function(){
484
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php&agca_action=remove_templates';
485
+ },2000);
486
+ }
487
+
488
+ function handleLocalyStoredImages(){
489
+ agcaDebug('FN:handleLocalyStoredImages()');
490
+ agcaDebug(jQuery("#templates_data").val());
491
+ var originalText = jQuery("#templates_data").val();
492
+ var serializedImages = "";
493
+ for(var tag in agca_local_images){
494
+ if(tag != ""){
495
+ if(serializedImages !=""){
496
+ serializedImages+=",";
497
+ }
498
+ serializedImages+=agca_local_images[tag];
499
+ originalText = originalText.replace(new RegExp(tag, 'g'), agca_local_images[tag]);
500
+ }
501
+ }
502
+ jQuery("#templates_data").val(originalText+"|||"+serializedImages);
503
+ //console.log(jQuery("#templates_data").val());
504
+
505
+ //SAVE FINALY
506
+ jQuery("#agca_templates_form").submit();
507
+ }
508
+
509
+ function agca_updateInstallProgress(){
510
+ agcaDebug('FN:agca_updateInstallProgress()');
511
+ agca_local_images_count++;
512
+ var current = agca_remote_images_count - agca_local_images_count;
513
+ var proc= (agca_local_images_count / (parseInt(agca_remote_images_count)-1)).toFixed(2) * 100;
514
+
515
+ agcaProgress('Installing ('+proc+'%) ...');
516
+ }
517
+ function agca_removeTemplateImages(template_name, callBack){
518
+ agcaDebug('FN:agca_removeTemplateImages()');
519
+ var url = window.location;
520
+ jQuery.post(url,{"_agca_remove_template_images":template_name},
521
+ function(data){
522
+ console.log(data);
523
+ if(callBack != null){
524
+ callBack();
525
+ }
526
+ })
527
+ .fail(
528
+ function(e){
529
+ console.log('AGCA Error: agca_removeTemplateImages()');
530
+ console.log(e);
531
+ if(callBack != null){
532
+ callBack();
533
+ }
534
+ });
535
+ }
536
+ function agca_startUploadingRemoteImages(){
537
+ agcaDebug('FN:agca_startUploadingRemoteImages()');
538
+
539
+ //agcaDebug('templates data');
540
+ //agcaDebug(jQuery("#templates_data").val());
541
+ //upload remote images on callback
542
+ if(typeof agca_remote_images != 'undefined'){
543
+ agca_uploadRemoteImages();
544
+ }else{
545
+ jQuery("#templates_data").val(jQuery("#templates_data").val()+"|||");
546
+
547
+ //SAVE FINALY PAYED
548
+ jQuery("#agca_templates_form").submit();
549
+ }
550
+ }
551
+
552
+ function agca_uploadRemoteImages(){
553
+ agcaDebug('FN:agca_uploadRemoteImages()');
554
+ var found = false;
555
+ for(var tag in agca_remote_images){
556
+ found = true;
557
+ agca_updateInstallProgress();
558
+ agca_uploadRemoteImage(agca_remote_images[tag], tag);
559
+ break;
560
+ }
561
+ if(!found){
562
+ //jQuery('.agca_content #activating').text('Installation successful. Reloading...');
563
+ agcaProgress('Installation successful. Reloading...');
564
+ window.setTimeout(handleLocalyStoredImages,2000);
565
+ }
566
+ }
567
+
568
+ function agca_uploadRemoteImage(remoteUrl, tag){
569
+ agcaDebug('FN:agca_uploadRemoteImage('+remoteUrl+', '+tag+')');
570
+ var url = window.location;
571
+ jQuery.post(url,{"_agca_upload_image":remoteUrl},
572
+ function(data){
573
+ console.log(data);
574
+ agca_local_images[tag] = data;
575
+ delete agca_remote_images[tag];
576
+ agca_uploadRemoteImages();
577
+ //window.location = 'tools.php?page=ag-custom-admin/plugin.php';
578
+ })
579
+ .fail(
580
+ function(){
581
+ console.log('AGCA Error: agca_activateTemplate()');
582
+ });
583
+ }
584
+
585
+ function agca_getLocalTemplates(){
586
+ agcaDebug("FN:agca_getLocalTemplates()");
587
+ var url = window.location;
588
+ jQuery.post(url,{"_agca_get_templates":true},
589
+ function(data){
590
+ //console.log(data);
591
+ templates_installed = JSON.parse(data);
592
+ //agca_getTemplates();
593
+ agca_getConfiguration();
594
+
595
+ })
596
+ .fail(
597
+ function(){
598
+ console.log('AGCA Error: agca_getLocalTemplates()');
599
+ });
600
+ }
601
+ function agca_error(data){
602
+ agcaDebug("FN:agca_error()");
603
+ clearTimeout(agcaLoadingTimeOut);
604
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
605
+ jQuery('#agca_templates p:first').text('Unable to load themes. Please submit this error to AGCA support. Thank you!');
606
+ }
607
+ alert('AG CUSTOM ADMIN TEMPLATE - ERROR\n\nError occured while loading configuration:\n'+data.url+'\n\n'+data.data);
608
+ }
609
+
610
+ //check if templates loaded
611
+ function checkIfTemplatesAreLoaded(pass){
612
+ agcaDebug('FN:checkIfTemplatesAreLoaded('+pass+')');
613
+ if(pass == 1){
614
+ agcaLoadingTimeOut = window.setTimeout(function(){
615
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
616
+ jQuery('#agca_templates p:first').text('Loading, please wait...');
617
+ checkIfTemplatesAreLoaded(2);
618
+ }
619
+ },6000);
620
+
621
+ }else if(pass == 2){
622
+ agcaLoadingTimeOut = window.setTimeout(function(){
623
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
624
+ jQuery('#agca_templates p:first').text('Ready in a few moments...');
625
+ checkIfTemplatesAreLoaded(3);
626
+ }
627
+ },6000);
628
+
629
+ }
630
+ else if(pass == 3){
631
+ agcaLoadingTimeOut = window.setTimeout(function(){
632
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
633
+ jQuery('#agca_templates p:first').text('This takes a bit longer than usual, please wait...');
634
+ checkIfTemplatesAreLoaded(4);
635
+ }
636
+ },7000);
637
+ }
638
+ else if(pass == 4){
639
+ agcaLoadingTimeOut = window.setTimeout(function(){
640
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
641
+ jQuery('#agca_templates p:first').html('Sorry, unable to load themes right now. Please try again later.');
642
+ agcaDebug('ERR:Unable to load themes');
643
+ }
644
+ },10000);
645
+ }
646
+ }
647
+
648
+ function agcaTemplatesSessionIsLicenseSet(template){
649
+ agcaDebug("FN:agcaTemplatesSessionIsLicenseSet(" + template + ")");
650
+ if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]["license"] != null){
651
+ return true;
652
+ }
653
+ return false;
654
+ }
655
+
656
+ function agcaTemplatesSessionGetLicenseKey(template){
657
+ agcaDebug("FN:agcaTemplatesSessionGetLicenseKey(" + template + ")");
658
+ if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]["license"] != null){
659
+ return agcaTemplatesSession[template]["license"];
660
+ }
661
+ return "";
662
+ }
663
+
664
+ function agcaTemplatesSessionAdd(template, license, callback){
665
+ agcaDebug("FN:agcaTemplatesSessionAdd(" + template + ", " + license + ", callback)");
666
+ if(callback == null){
667
+ callback = function(){};
668
+ }
669
+ agcaTemplatesSession[template] = {};
670
+ agcaTemplatesSession[template]["license"] = license;
671
+ jQuery.ajax({
672
+ type: "POST",
673
+ url: window.location,
674
+ data: {
675
+ "_agca_templates_session" : "true",
676
+ "template":template,
677
+ "license":license
678
+ },
679
+ success: callback
680
+ });
681
+ }
682
+
683
+ function agcaTemplatesSessionRemove(template, callback){
684
+ agcaDebug("FN:agcaTemplatesSessionRemove(" + template + ", callback)");
685
+ if(callback == null){
686
+ callback = function(){};
687
+ }
688
+ agcaTemplatesSession[template]["license"] = null;
689
+ jQuery.ajax({
690
+ type: "POST",
691
+ url: window.location,
692
+ data: {
693
+ "_agca_templates_session_remove_license" : "true",
694
+ "template":template
695
+ },
696
+ success: callback
697
+ });
698
+ }
699
+
700
+
701
+ /*FAQ: Invalid template license key: reopen browser and add key again,
702
+ Wrong or expired license key. You can still use your template, but updates are not available any more.(1): reopen broeser
703
+ */
704
+
705
+ /*countdown*/
706
+ function agcaCountDownTimer(now, expire, id)
707
+ {
708
+ var _second = 1;
709
+ var _minute = _second * 60;
710
+ var _hour = _minute * 60;
711
+ var _day = _hour * 24;
712
+ var _year = _day * 365;
713
+
714
+ var nowParts = now.split('-');
715
+ var expireParts = expire.split('-');
716
+ var timer;
717
+ var diff = expire - now;
718
+
719
+ function showRemaining(df) {
720
+ diff = diff-1;
721
+ //console.log(diff);
722
+
723
+ var days = Math.floor((diff % _year) / _day);
724
+ var hours = Math.floor((diff % _day) / _hour);
725
+ var minutes = Math.floor((diff % _hour) / _minute);
726
+ var seconds = Math.floor((diff % _minute) / _second);
727
+ var str = days +"d " + hours +"h "+ minutes +"min "+ seconds+"sec";
728
+ jQuery(id+" .countdown").html("Available only for:</br>" + str);
729
+ if (diff < 0) {
730
+ clearInterval(timer);
731
+ jQuery(id+" .countdown").html("</br>About to expire...");
732
+ return;
733
+ }
734
+ }
735
+ timer = setInterval(function(){
736
+ showRemaining(diff);
737
+ }, 1000);
738
+ }
trunk/script/farbtastic.js ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Farbtastic Color Picker 1.2
3
+ * © 2008 Steven Wittens
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+ jQuery.fn.farbtastic = function (callback) {
21
+ jQuery.farbtastic(this, callback);
22
+ return this;
23
+ };
24
+
25
+ jQuery.farbtastic = function (container, callback) {
26
+ var container = jQuery(container).get(0);
27
+ return container.farbtastic || (container.farbtastic = new jQuery._farbtastic(container, callback));
28
+ }
29
+
30
+ jQuery._farbtastic = function (container, callback) {
31
+ // Store farbtastic object
32
+ var fb = this;
33
+
34
+ // Insert markup
35
+ jQuery(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');
36
+ var e = jQuery('.farbtastic', container);
37
+ fb.wheel = jQuery('.wheel', container).get(0);
38
+ // Dimensions
39
+ fb.radius = 84;
40
+ fb.square = 100;
41
+ fb.width = 194;
42
+
43
+ // Fix background PNGs in IE6
44
+ if (navigator.appVersion.match(/MSIE [0-6]\./)) {
45
+ jQuery('*', e).each(function () {
46
+ if (this.currentStyle.backgroundImage != 'none') {
47
+ var image = this.currentStyle.backgroundImage;
48
+ image = this.currentStyle.backgroundImage.substring(5, image.length - 2);
49
+ jQuery(this).css({
50
+ 'backgroundImage': 'none',
51
+ 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
52
+ });
53
+ }
54
+ });
55
+ }
56
+
57
+ /**
58
+ * Link to the given element(s) or callback.
59
+ */
60
+ fb.linkTo = function (callback) {
61
+ // Unbind previous nodes
62
+ if (typeof fb.callback == 'object') {
63
+ jQuery(fb.callback).unbind('keyup', fb.updateValue);
64
+ }
65
+
66
+ // Reset color
67
+ fb.color = null;
68
+
69
+ // Bind callback or elements
70
+ if (typeof callback == 'function') {
71
+ fb.callback = callback;
72
+ }
73
+ else if (typeof callback == 'object' || typeof callback == 'string') {
74
+ fb.callback = jQuery(callback);
75
+ fb.callback.bind('keyup', fb.updateValue);
76
+ if (fb.callback.get(0).value) {
77
+ fb.setColor(fb.callback.get(0).value);
78
+ }
79
+ }
80
+ return this;
81
+ }
82
+ fb.updateValue = function (event) {
83
+ if (this.value && this.value != fb.color) {
84
+ fb.setColor(this.value);
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Change color with HTML syntax #123456
90
+ */
91
+ fb.setColor = function (color) {
92
+ var unpack = fb.unpack(color);
93
+ if (fb.color != color && unpack) {
94
+ fb.color = color;
95
+ fb.rgb = unpack;
96
+ fb.hsl = fb.RGBToHSL(fb.rgb);
97
+ fb.updateDisplay();
98
+ }
99
+ return this;
100
+ }
101
+
102
+ /**
103
+ * Change color with HSL triplet [0..1, 0..1, 0..1]
104
+ */
105
+ fb.setHSL = function (hsl) {
106
+ fb.hsl = hsl;
107
+ fb.rgb = fb.HSLToRGB(hsl);
108
+ fb.color = fb.pack(fb.rgb);
109
+ fb.updateDisplay();
110
+ return this;
111
+ }
112
+
113
+ /////////////////////////////////////////////////////
114
+
115
+ /**
116
+ * Retrieve the coordinates of the given event relative to the center
117
+ * of the widget.
118
+ */
119
+ fb.widgetCoords = function (event) {
120
+ var x, y;
121
+ var el = event.target || event.srcElement;
122
+ var reference = fb.wheel;
123
+
124
+ if (typeof event.offsetX != 'undefined') {
125
+ // Use offset coordinates and find common offsetParent
126
+ var pos = { x: event.offsetX, y: event.offsetY };
127
+
128
+ // Send the coordinates upwards through the offsetParent chain.
129
+ var e = el;
130
+ while (e) {
131
+ e.mouseX = pos.x;
132
+ e.mouseY = pos.y;
133
+ pos.x += e.offsetLeft;
134
+ pos.y += e.offsetTop;
135
+ e = e.offsetParent;
136
+ }
137
+
138
+ // Look for the coordinates starting from the wheel widget.
139
+ var e = reference;
140
+ var offset = { x: 0, y: 0 }
141
+ while (e) {
142
+ if (typeof e.mouseX != 'undefined') {
143
+ x = e.mouseX - offset.x;
144
+ y = e.mouseY - offset.y;
145
+ break;
146
+ }
147
+ offset.x += e.offsetLeft;
148
+ offset.y += e.offsetTop;
149
+ e = e.offsetParent;
150
+ }
151
+
152
+ // Reset stored coordinates
153
+ e = el;
154
+ while (e) {
155
+ e.mouseX = undefined;
156
+ e.mouseY = undefined;
157
+ e = e.offsetParent;
158
+ }
159
+ }
160
+ else {
161
+ // Use absolute coordinates
162
+ var pos = fb.absolutePosition(reference);
163
+ x = (event.pageX || 0*(event.clientX + jQuery('html').get(0).scrollLeft)) - pos.x;
164
+ y = (event.pageY || 0*(event.clientY + jQuery('html').get(0).scrollTop)) - pos.y;
165
+ }
166
+ // Subtract distance to middle
167
+ return { x: x - fb.width / 2, y: y - fb.width / 2 };
168
+ }
169
+
170
+ /**
171
+ * Mousedown handler
172
+ */
173
+ fb.mousedown = function (event) {
174
+ // Capture mouse
175
+ if (!document.dragging) {
176
+ jQuery(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
177
+ document.dragging = true;
178
+ }
179
+
180
+ // Check which area is being dragged
181
+ var pos = fb.widgetCoords(event);
182
+ fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square;
183
+
184
+ // Process
185
+ fb.mousemove(event);
186
+ return false;
187
+ }
188
+
189
+ /**
190
+ * Mousemove handler
191
+ */
192
+ fb.mousemove = function (event) {
193
+ // Get coordinates relative to color picker center
194
+ var pos = fb.widgetCoords(event);
195
+
196
+ // Set new HSL parameters
197
+ if (fb.circleDrag) {
198
+ var hue = Math.atan2(pos.x, -pos.y) / 6.28;
199
+ if (hue < 0) hue += 1;
200
+ fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]);
201
+ }
202
+ else {
203
+ var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5));
204
+ var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5));
205
+ fb.setHSL([fb.hsl[0], sat, lum]);
206
+ }
207
+ return false;
208
+ }
209
+
210
+ /**
211
+ * Mouseup handler
212
+ */
213
+ fb.mouseup = function () {
214
+ // Uncapture mouse
215
+ jQuery(document).unbind('mousemove', fb.mousemove);
216
+ jQuery(document).unbind('mouseup', fb.mouseup);
217
+ document.dragging = false;
218
+ }
219
+
220
+ /**
221
+ * Update the markers and styles
222
+ */
223
+ fb.updateDisplay = function () {
224
+ // Markers
225
+ var angle = fb.hsl[0] * 6.28;
226
+ jQuery('.h-marker', e).css({
227
+ left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px',
228
+ top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px'
229
+ });
230
+
231
+ jQuery('.sl-marker', e).css({
232
+ left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px',
233
+ top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px'
234
+ });
235
+
236
+ // Saturation/Luminance gradient
237
+ jQuery('.color', e).css('backgroundColor', fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5])));
238
+
239
+ // Linked elements or callback
240
+ if (typeof fb.callback == 'object') {
241
+ // Set background/foreground color
242
+ jQuery(fb.callback).css({
243
+ backgroundColor: fb.color,
244
+ color: fb.hsl[2] > 0.5 ? '#000' : '#fff'
245
+ });
246
+
247
+ // Change linked value
248
+ jQuery(fb.callback).each(function() {
249
+ if (this.value && this.value != fb.color) {
250
+ this.value = fb.color;
251
+ }
252
+ });
253
+ }
254
+ else if (typeof fb.callback == 'function') {
255
+ fb.callback.call(fb, fb.color);
256
+ }
257
+ //farbasticCallback(callback);
258
+ }
259
+
260
+ /**
261
+ * Get absolute position of element
262
+ */
263
+ fb.absolutePosition = function (el) {
264
+ var r = { x: el.offsetLeft, y: el.offsetTop };
265
+ // Resolve relative to offsetParent
266
+ if (el.offsetParent) {
267
+ var tmp = fb.absolutePosition(el.offsetParent);
268
+ r.x += tmp.x;
269
+ r.y += tmp.y;
270
+ }
271
+ return r;
272
+ };
273
+
274
+ /* Various color utility functions */
275
+ fb.pack = function (rgb) {
276
+ var r = Math.round(rgb[0] * 255);
277
+ var g = Math.round(rgb[1] * 255);
278
+ var b = Math.round(rgb[2] * 255);
279
+ return '#' + (r < 16 ? '0' : '') + r.toString(16) +
280
+ (g < 16 ? '0' : '') + g.toString(16) +
281
+ (b < 16 ? '0' : '') + b.toString(16);
282
+ }
283
+
284
+ fb.unpack = function (color) {
285
+ if (color.length == 7) {
286
+ return [parseInt('0x' + color.substring(1, 3)) / 255,
287
+ parseInt('0x' + color.substring(3, 5)) / 255,
288
+ parseInt('0x' + color.substring(5, 7)) / 255];
289
+ }
290
+ else if (color.length == 4) {
291
+ return [parseInt('0x' + color.substring(1, 2)) / 15,
292
+ parseInt('0x' + color.substring(2, 3)) / 15,
293
+ parseInt('0x' + color.substring(3, 4)) / 15];
294
+ }
295
+ }
296
+
297
+ fb.HSLToRGB = function (hsl) {
298
+ var m1, m2, r, g, b;
299
+ var h = hsl[0], s = hsl[1], l = hsl[2];
300
+ m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s;
301
+ m1 = l * 2 - m2;
302
+ return [this.hueToRGB(m1, m2, h+0.33333),
303
+ this.hueToRGB(m1, m2, h),
304
+ this.hueToRGB(m1, m2, h-0.33333)];
305
+ }
306
+
307
+ fb.hueToRGB = function (m1, m2, h) {
308
+ h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
309
+ if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
310
+ if (h * 2 < 1) return m2;
311
+ if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
312
+ return m1;
313
+ }
314
+
315
+ fb.RGBToHSL = function (rgb) {
316
+ var min, max, delta, h, s, l;
317
+ var r = rgb[0], g = rgb[1], b = rgb[2];
318
+ min = Math.min(r, Math.min(g, b));
319
+ max = Math.max(r, Math.max(g, b));
320
+ delta = max - min;
321
+ l = (min + max) / 2;
322
+ s = 0;
323
+ if (l > 0 && l < 1) {
324
+ s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
325
+ }
326
+ h = 0;
327
+ if (delta > 0) {
328
+ if (max == r && max != g) h += (g - b) / delta;
329
+ if (max == g && max != b) h += (2 + (b - r) / delta);
330
+ if (max == b && max != r) h += (4 + (r - g) / delta);
331
+ h /= 6;
332
+ }
333
+ return [h, s, l];
334
+ }
335
+
336
+ // Install mousedown handler (the others are set on the document on-demand)
337
+ jQuery('*', e).mousedown(fb.mousedown);
338
+
339
+ // Init color
340
+ fb.setColor('#000000');
341
+
342
+ // Set linked elements/callback
343
+ if (callback) {
344
+ fb.linkTo(callback);
345
+ }
346
+ }
trunk/script/xd.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(N,d,p,K,k,H){var b=this;var n=Math.floor(Math.random()*10000);var q=Function.prototype;var Q=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/;var R=/[\-\w]+\/\.\.\//;var F=/([^:])\/\//g;var I="";var o={};var M=N.easyXDM;var U="easyXDM_";var E;var y=false;var i;var h;function C(X,Z){var Y=typeof X[Z];return Y=="function"||(!!(Y=="object"&&X[Z]))||Y=="unknown"}function u(X,Y){return !!(typeof(X[Y])=="object"&&X[Y])}function r(X){return Object.prototype.toString.call(X)==="[object Array]"}function c(){try{var X=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");i=Array.prototype.slice.call(X.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/),1);h=parseInt(i[0],10)>9&&parseInt(i[1],10)>0;X=null;return true}catch(Y){return false}}var v,x;if(C(N,"addEventListener")){v=function(Z,X,Y){Z.addEventListener(X,Y,false)};x=function(Z,X,Y){Z.removeEventListener(X,Y,false)}}else{if(C(N,"attachEvent")){v=function(X,Z,Y){X.attachEvent("on"+Z,Y)};x=function(X,Z,Y){X.detachEvent("on"+Z,Y)}}else{throw new Error("Browser not supported")}}var W=false,J=[],L;if("readyState" in d){L=d.readyState;W=L=="complete"||(~navigator.userAgent.indexOf("AppleWebKit/")&&(L=="loaded"||L=="interactive"))}else{W=!!d.body}function s(){if(W){return}W=true;for(var X=0;X<J.length;X++){J[X]()}J.length=0}if(!W){if(C(N,"addEventListener")){v(d,"DOMContentLoaded",s)}else{v(d,"readystatechange",function(){if(d.readyState=="complete"){s()}});if(d.documentElement.doScroll&&N===top){var g=function(){if(W){return}try{d.documentElement.doScroll("left")}catch(X){K(g,1);return}s()};g()}}v(N,"load",s)}function G(Y,X){if(W){Y.call(X);return}J.push(function(){Y.call(X)})}function m(){var Z=parent;if(I!==""){for(var X=0,Y=I.split(".");X<Y.length;X++){Z=Z[Y[X]]}}return Z.easyXDM}function e(X){N.easyXDM=M;I=X;if(I){U="easyXDM_"+I.replace(".","_")+"_"}return o}function z(X){return X.match(Q)[3]}function f(X){return X.match(Q)[4]||""}function j(Z){Z=Z.replace('htttp','http');var X=Z.toLowerCase().match(Q);var aa=X[2],ab=X[3],Y=X[4]||"";if((aa=="http:"&&Y==":80")||(aa=="https:"&&Y==":443")){Y=""}return aa+"//"+ab+Y}function B(X){X=X.replace(F,"$1/");if(!X.match(/^(http||https):\/\//)){var Y=(X.substring(0,1)==="/")?"":p.pathname;if(Y.substring(Y.length-1)!=="/"){Y=Y.substring(0,Y.lastIndexOf("/")+1)}X=p.protocol+"//"+p.host+Y+X}while(R.test(X)){X=X.replace(R,"")}return X}function P(X,aa){var ac="",Z=X.indexOf("#");if(Z!==-1){ac=X.substring(Z);X=X.substring(0,Z)}var ab=[];for(var Y in aa){if(aa.hasOwnProperty(Y)){ab.push(Y+"="+H(aa[Y]))}}return X+(y?"#":(X.indexOf("?")==-1?"?":"&"))+ab.join("&")+ac}var S=(function(X){X=X.substring(1).split("&");var Z={},aa,Y=X.length;while(Y--){aa=X[Y].split("=");Z[aa[0]]=k(aa[1])}return Z}(/xdm_e=/.test(p.search)?p.search:p.hash));function t(X){return typeof X==="undefined"}var O=function(){var Y={};var Z={a:[1,2,3]},X='{"a":[1,2,3]}';if(typeof JSON!="undefined"&&typeof JSON.stringify==="function"&&JSON.stringify(Z).replace((/\s/g),"")===X){return JSON}if(Object.toJSON){if(Object.toJSON(Z).replace((/\s/g),"")===X){Y.stringify=Object.toJSON}}if(typeof String.prototype.evalJSON==="function"){Z=X.evalJSON();if(Z.a&&Z.a.length===3&&Z.a[2]===3){Y.parse=function(aa){return aa.evalJSON()}}}if(Y.stringify&&Y.parse){O=function(){return Y};return Y}return null};function T(X,Y,Z){var ab;for(var aa in Y){if(Y.hasOwnProperty(aa)){if(aa in X){ab=Y[aa];if(typeof ab==="object"){T(X[aa],ab,Z)}else{if(!Z){X[aa]=Y[aa]}}}else{X[aa]=Y[aa]}}}return X}function a(){var Y=d.body.appendChild(d.createElement("form")),X=Y.appendChild(d.createElement("input"));X.name=U+"TEST"+n;E=X!==Y.elements[X.name];d.body.removeChild(Y)}function A(X){X.props.src=X.props.src.replace("xdm_e=http","xdm_e=htttp");if(t(E)){a()}var Z;if(E){Z=d.createElement('<iframe name="'+X.props.name+'"/>')}else{Z=d.createElement("IFRAME");Z.name=X.props.name}Z.id=Z.name=X.props.name;delete X.props.name;if(X.onLoad){v(Z,"load",X.onLoad)}if(typeof X.container=="string"){X.container=d.getElementById(X.container)}if(!X.container){T(Z.style,{position:"absolute",top:"-2000px"});X.container=d.body}var Y=X.props.src;delete X.props.src;T(Z,X.props);Z.border=Z.frameBorder=0;Z.allowTransparency=true;X.container.appendChild(Z);Z.src=Y;X.props.src=Y;return Z}function V(aa,Z){if(typeof aa=="string"){aa=[aa]}var Y,X=aa.length;while(X--){Y=aa[X];Y=new RegExp(Y.substr(0,1)=="^"?Y:("^"+Y.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$"));if(Y.test(Z)){return true}}return false}function l(Z){var ae=Z.protocol,Y;Z.isHost=Z.isHost||t(S.xdm_p);y=Z.hash||false;if(!Z.props){Z.props={}}if(!Z.isHost){Z.channel=S.xdm_c;Z.secret=S.xdm_s;Z.remote=S.xdm_e;ae=S.xdm_p;if(Z.acl&&!V(Z.acl,Z.remote)){throw new Error("Access denied for "+Z.remote)}}else{Z.remote=B(Z.remote);Z.channel=Z.channel||"default"+n++;Z.secret=Math.random().toString(16).substring(2);if(t(ae)){if(j(p.href)==j(Z.remote)){ae="4"}else{if(C(N,"postMessage")||C(d,"postMessage")){ae="1"}else{if(Z.swf&&C(N,"ActiveXObject")&&c()){ae="6"}else{if(navigator.product==="Gecko"&&"frameElement" in N&&navigator.userAgent.indexOf("WebKit")==-1){ae="5"}else{if(Z.remoteHelper){Z.remoteHelper=B(Z.remoteHelper);ae="2"}else{ae="0"}}}}}}}Z.protocol=ae;switch(ae){case"0":T(Z,{interval:100,delay:2000,useResize:true,useParent:false,usePolling:false},true);if(Z.isHost){if(!Z.local){var ac=p.protocol+"//"+p.host,X=d.body.getElementsByTagName("img"),ad;var aa=X.length;while(aa--){ad=X[aa];if(ad.src.substring(0,ac.length)===ac){Z.local=ad.src;break}}if(!Z.local){Z.local=N}}var ab={xdm_c:Z.channel,xdm_p:0};if(Z.local===N){Z.usePolling=true;Z.useParent=true;Z.local=p.protocol+"//"+p.host+p.pathname+p.search;ab.xdm_e=Z.local;ab.xdm_pa=1}else{ab.xdm_e=B(Z.local)}if(Z.container){Z.useResize=false;ab.xdm_po=1}Z.remote=P(Z.remote,ab)}else{T(Z,{channel:S.xdm_c,remote:S.xdm_e,useParent:!t(S.xdm_pa),usePolling:!t(S.xdm_po),useResize:Z.useParent?false:Z.useResize})}Y=[new o.stack.HashTransport(Z),new o.stack.ReliableBehavior({}),new o.stack.QueueBehavior({encode:true,maxLength:4000-Z.remote.length}),new o.stack.VerifyBehavior({initiate:Z.isHost})];break;case"1":Y=[new o.stack.PostMessageTransport(Z)];break;case"2":Y=[new o.stack.NameTransport(Z),new o.stack.QueueBehavior(),new o.stack.VerifyBehavior({initiate:Z.isHost})];break;case"3":Y=[new o.stack.NixTransport(Z)];break;case"4":Y=[new o.stack.SameOriginTransport(Z)];break;case"5":Y=[new o.stack.FrameElementTransport(Z)];break;case"6":if(!i){c()}Y=[new o.stack.FlashTransport(Z)];break}Y.push(new o.stack.QueueBehavior({lazy:Z.lazy,remove:true}));return Y}function D(aa){var ab,Z={incoming:function(ad,ac){this.up.incoming(ad,ac)},outgoing:function(ac,ad){this.down.outgoing(ac,ad)},callback:function(ac){this.up.callback(ac)},init:function(){this.down.init()},destroy:function(){this.down.destroy()}};for(var Y=0,X=aa.length;Y<X;Y++){ab=aa[Y];T(ab,Z,true);if(Y!==0){ab.down=aa[Y-1]}if(Y!==X-1){ab.up=aa[Y+1]}}return ab}function w(X){X.up.down=X.down;X.down.up=X.up;X.up=X.down=null}T(o,{version:"2.4.15.118",query:S,stack:{},apply:T,getJSONObject:O,whenReady:G,noConflict:e});o.DomHelper={on:v,un:x,requiresJSON:function(X){if(!u(N,"JSON")){d.write('<script type="text/javascript" src="'+X+'"><\/script>')}}};(function(){var X={};o.Fn={set:function(Y,Z){X[Y]=Z},get:function(Z,Y){var aa=X[Z];if(Y){delete X[Z]}return aa}}}());o.Socket=function(Y){var X=D(l(Y).concat([{incoming:function(ab,aa){Y.onMessage(ab,aa)},callback:function(aa){if(Y.onReady){Y.onReady(aa)}}}])),Z=j(Y.remote);this.origin=j(Y.remote);this.destroy=function(){X.destroy()};this.postMessage=function(aa){X.outgoing(aa,Z)};X.init()};o.Rpc=function(Z,Y){if(Y.local){for(var ab in Y.local){if(Y.local.hasOwnProperty(ab)){var aa=Y.local[ab];if(typeof aa==="function"){Y.local[ab]={method:aa}}}}}var X=D(l(Z).concat([new o.stack.RpcBehavior(this,Y),{callback:function(ac){if(Z.onReady){Z.onReady(ac)}}}]));this.origin=j(Z.remote);this.destroy=function(){X.destroy()};X.init()};o.stack.SameOriginTransport=function(Y){var Z,ab,aa,X;return(Z={outgoing:function(ad,ae,ac){aa(ad);if(ac){ac()}},destroy:function(){if(ab){ab.parentNode.removeChild(ab);ab=null}},onDOMReady:function(){X=j(Y.remote);if(Y.isHost){T(Y.props,{src:P(Y.remote,{xdm_e:p.protocol+"//"+p.host+p.pathname,xdm_c:Y.channel,xdm_p:4}),name:U+Y.channel+"_provider"});ab=A(Y);o.Fn.set(Y.channel,function(ac){aa=ac;K(function(){Z.up.callback(true)},0);return function(ad){Z.up.incoming(ad,X)}})}else{aa=m().Fn.get(Y.channel,true)(function(ac){Z.up.incoming(ac,X)});K(function(){Z.up.callback(true)},0)}},init:function(){G(Z.onDOMReady,Z)}})};o.stack.FlashTransport=function(aa){var ac,X,ab,ad,Y,ae;function af(ah,ag){K(function(){ac.up.incoming(ah,ad)},0)}function Z(ah){var ag=aa.swf+"?host="+aa.isHost;var aj="easyXDM_swf_"+Math.floor(Math.random()*10000);o.Fn.set("flash_loaded"+ah.replace(/[\-.]/g,"_"),function(){o.stack.FlashTransport[ah].swf=Y=ae.firstChild;var ak=o.stack.FlashTransport[ah].queue;for(var al=0;al<ak.length;al++){ak[al]()}ak.length=0});if(aa.swfContainer){ae=(typeof aa.swfContainer=="string")?d.getElementById(aa.swfContainer):aa.swfContainer}else{ae=d.createElement("div");T(ae.style,h&&aa.swfNoThrottle?{height:"20px",width:"20px",position:"fixed",right:0,top:0}:{height:"1px",width:"1px",position:"absolute",overflow:"hidden",right:0,top:0});d.body.appendChild(ae)}var ai="callback=flash_loaded"+ah.replace(/[\-.]/g,"_")+"&proto="+b.location.protocol+"&domain="+z(b.location.href)+"&port="+f(b.location.href)+"&ns="+I;ae.innerHTML="<object height='20' width='20' type='application/x-shockwave-flash' id='"+aj+"' data='"+ag+"'><param name='allowScriptAccess' value='always'></param><param name='wmode' value='transparent'><param name='movie' value='"+ag+"'></param><param name='flashvars' value='"+ai+"'></param><embed type='application/x-shockwave-flash' FlashVars='"+ai+"' allowScriptAccess='always' wmode='transparent' src='"+ag+"' height='1' width='1'></embed></object>"}return(ac={outgoing:function(ah,ai,ag){Y.postMessage(aa.channel,ah.toString());if(ag){ag()}},destroy:function(){try{Y.destroyChannel(aa.channel)}catch(ag){}Y=null;if(X){X.parentNode.removeChild(X);X=null}},onDOMReady:function(){ad=aa.remote;o.Fn.set("flash_"+aa.channel+"_init",function(){K(function(){ac.up.callback(true)})});o.Fn.set("flash_"+aa.channel+"_onMessage",af);aa.swf=B(aa.swf);var ah=z(aa.swf);var ag=function(){o.stack.FlashTransport[ah].init=true;Y=o.stack.FlashTransport[ah].swf;Y.createChannel(aa.channel,aa.secret,j(aa.remote),aa.isHost);if(aa.isHost){if(h&&aa.swfNoThrottle){T(aa.props,{position:"fixed",right:0,top:0,height:"20px",width:"20px"})}T(aa.props,{src:P(aa.remote,{xdm_e:j(p.href),xdm_c:aa.channel,xdm_p:6,xdm_s:aa.secret}),name:U+aa.channel+"_provider"});X=A(aa)}};if(o.stack.FlashTransport[ah]&&o.stack.FlashTransport[ah].init){ag()}else{if(!o.stack.FlashTransport[ah]){o.stack.FlashTransport[ah]={queue:[ag]};Z(ah)}else{o.stack.FlashTransport[ah].queue.push(ag)}}},init:function(){G(ac.onDOMReady,ac)}})};o.stack.PostMessageTransport=function(aa){var ac,ad,Y,Z;function X(ae){if(ae.origin){return j(ae.origin)}if(ae.uri){return j(ae.uri)}if(ae.domain){return p.protocol+"//"+ae.domain}throw"Unable to retrieve the origin of the event"}function ab(af){var ae=X(af);if(ae==Z&&af.data.substring(0,aa.channel.length+1)==aa.channel+" "){ac.up.incoming(af.data.substring(aa.channel.length+1),ae)}}return(ac={outgoing:function(af,ag,ae){Y.postMessage(aa.channel+" "+af,ag||Z);if(ae){ae()}},destroy:function(){x(N,"message",ab);if(ad){Y=null;ad.parentNode.removeChild(ad);ad=null}},onDOMReady:function(){Z=j(aa.remote);if(aa.isHost){var ae=function(af){if(af.data==aa.channel+"-ready"){Y=("postMessage" in ad.contentWindow)?ad.contentWindow:ad.contentWindow.document;x(N,"message",ae);v(N,"message",ab);K(function(){ac.up.callback(true)},0)}};v(N,"message",ae);T(aa.props,{src:P(aa.remote,{xdm_e:j(p.href),xdm_c:aa.channel,xdm_p:1}),name:U+aa.channel+"_provider"});ad=A(aa)}else{v(N,"message",ab);Y=("postMessage" in N.parent)?N.parent:N.parent.document;Y.postMessage(aa.channel+"-ready",Z);K(function(){ac.up.callback(true)},0)}},init:function(){G(ac.onDOMReady,ac)}})};o.stack.FrameElementTransport=function(Y){var Z,ab,aa,X;return(Z={outgoing:function(ad,ae,ac){aa.call(this,ad);if(ac){ac()}},destroy:function(){if(ab){ab.parentNode.removeChild(ab);ab=null}},onDOMReady:function(){X=j(Y.remote);if(Y.isHost){T(Y.props,{src:P(Y.remote,{xdm_e:j(p.href),xdm_c:Y.channel,xdm_p:5}),name:U+Y.channel+"_provider"});ab=A(Y);ab.fn=function(ac){delete ab.fn;aa=ac;K(function(){Z.up.callback(true)},0);return function(ad){Z.up.incoming(ad,X)}}}else{if(d.referrer&&j(d.referrer)!=S.xdm_e){N.top.location=S.xdm_e}aa=N.frameElement.fn(function(ac){Z.up.incoming(ac,X)});Z.up.callback(true)}},init:function(){G(Z.onDOMReady,Z)}})};o.stack.NameTransport=function(ab){var ac;var ae,ai,aa,ag,ah,Y,X;function af(al){var ak=ab.remoteHelper+(ae?"#_3":"#_2")+ab.channel;ai.contentWindow.sendMessage(al,ak)}function ad(){if(ae){if(++ag===2||!ae){ac.up.callback(true)}}else{af("ready");ac.up.callback(true)}}function aj(ak){ac.up.incoming(ak,Y)}function Z(){if(ah){K(function(){ah(true)},0)}}return(ac={outgoing:function(al,am,ak){ah=ak;af(al)},destroy:function(){ai.parentNode.removeChild(ai);ai=null;if(ae){aa.parentNode.removeChild(aa);aa=null}},onDOMReady:function(){ae=ab.isHost;ag=0;Y=j(ab.remote);ab.local=B(ab.local);if(ae){o.Fn.set(ab.channel,function(al){if(ae&&al==="ready"){o.Fn.set(ab.channel,aj);ad()}});X=P(ab.remote,{xdm_e:ab.local,xdm_c:ab.channel,xdm_p:2});T(ab.props,{src:X+"#"+ab.channel,name:U+ab.channel+"_provider"});aa=A(ab)}else{ab.remoteHelper=ab.remote;o.Fn.set(ab.channel,aj)}ai=A({props:{src:ab.local+"#_4"+ab.channel},onLoad:function ak(){var al=ai||this;x(al,"load",ak);o.Fn.set(ab.channel+"_load",Z);(function am(){if(typeof al.contentWindow.sendMessage=="function"){ad()}else{K(am,50)}}())}})},init:function(){G(ac.onDOMReady,ac)}})};o.stack.HashTransport=function(Z){var ac;var ah=this,af,aa,X,ad,am,ab,al;var ag,Y;function ak(ao){if(!al){return}var an=Z.remote+"#"+(am++)+"_"+ao;((af||!ag)?al.contentWindow:al).location=an}function ae(an){ad=an;ac.up.incoming(ad.substring(ad.indexOf("_")+1),Y)}function aj(){if(!ab){return}var an=ab.location.href,ap="",ao=an.indexOf("#");if(ao!=-1){ap=an.substring(ao)}if(ap&&ap!=ad){ae(ap)}}function ai(){aa=setInterval(aj,X)}return(ac={outgoing:function(an,ao){ak(an)},destroy:function(){N.clearInterval(aa);if(af||!ag){al.parentNode.removeChild(al)}al=null},onDOMReady:function(){af=Z.isHost;X=Z.interval;ad="#"+Z.channel;am=0;ag=Z.useParent;Y=j(Z.remote);if(af){Z.props={src:Z.remote,name:U+Z.channel+"_provider"};if(ag){Z.onLoad=function(){ab=N;ai();ac.up.callback(true)}}else{var ap=0,an=Z.delay/50;(function ao(){if(++ap>an){throw new Error("Unable to reference listenerwindow")}try{ab=al.contentWindow.frames[U+Z.channel+"_consumer"]}catch(aq){}if(ab){ai();ac.up.callback(true)}else{K(ao,50)}}())}al=A(Z)}else{ab=N;ai();if(ag){al=parent;ac.up.callback(true)}else{T(Z,{props:{src:Z.remote+"#"+Z.channel+new Date(),name:U+Z.channel+"_consumer"},onLoad:function(){ac.up.callback(true)}});al=A(Z)}}},init:function(){G(ac.onDOMReady,ac)}})};o.stack.ReliableBehavior=function(Y){var aa,ac;var ab=0,X=0,Z="";return(aa={incoming:function(af,ad){var ae=af.indexOf("_"),ag=af.substring(0,ae).split(",");af=af.substring(ae+1);if(ag[0]==ab){Z="";if(ac){ac(true)}}if(af.length>0){aa.down.outgoing(ag[1]+","+ab+"_"+Z,ad);if(X!=ag[1]){X=ag[1];aa.up.incoming(af,ad)}}},outgoing:function(af,ad,ae){Z=af;ac=ae;aa.down.outgoing(X+","+(++ab)+"_"+af,ad)}})};o.stack.QueueBehavior=function(Z){var ac,ad=[],ag=true,aa="",af,X=0,Y=false,ab=false;function ae(){if(Z.remove&&ad.length===0){w(ac);return}if(ag||ad.length===0||af){return}ag=true;var ah=ad.shift();ac.down.outgoing(ah.data,ah.origin,function(ai){ag=false;if(ah.callback){K(function(){ah.callback(ai)},0)}ae()})}return(ac={init:function(){if(t(Z)){Z={}}if(Z.maxLength){X=Z.maxLength;ab=true}if(Z.lazy){Y=true}else{ac.down.init()}},callback:function(ai){ag=false;var ah=ac.up;ae();ah.callback(ai)},incoming:function(ak,ai){if(ab){var aj=ak.indexOf("_"),ah=parseInt(ak.substring(0,aj),10);aa+=ak.substring(aj+1);if(ah===0){if(Z.encode){aa=k(aa)}ac.up.incoming(aa,ai);aa=""}}else{ac.up.incoming(ak,ai)}},outgoing:function(al,ai,ak){if(Z.encode){al=H(al)}var ah=[],aj;if(ab){while(al.length!==0){aj=al.substring(0,X);al=al.substring(aj.length);ah.push(aj)}while((aj=ah.shift())){ad.push({data:ah.length+"_"+aj,origin:ai,callback:ah.length===0?ak:null})}}else{ad.push({data:al,origin:ai,callback:ak})}if(Y){ac.down.init()}else{ae()}},destroy:function(){af=true;ac.down.destroy()}})};o.stack.VerifyBehavior=function(ab){var ac,aa,Y,Z=false;function X(){aa=Math.random().toString(16).substring(2);ac.down.outgoing(aa)}return(ac={incoming:function(af,ad){var ae=af.indexOf("_");if(ae===-1){if(af===aa){ac.up.callback(true)}else{if(!Y){Y=af;if(!ab.initiate){X()}ac.down.outgoing(af)}}}else{if(af.substring(0,ae)===Y){ac.up.incoming(af.substring(ae+1),ad)}}},outgoing:function(af,ad,ae){ac.down.outgoing(aa+"_"+af,ad,ae)},callback:function(ad){if(ab.initiate){X()}}})};o.stack.RpcBehavior=function(ad,Y){var aa,af=Y.serializer||O();var ae=0,ac={};function X(ag){ag.jsonrpc="2.0";aa.down.outgoing(af.stringify(ag))}function ab(ag,ai){var ah=Array.prototype.slice;return function(){var aj=arguments.length,al,ak={method:ai};if(aj>0&&typeof arguments[aj-1]==="function"){if(aj>1&&typeof arguments[aj-2]==="function"){al={success:arguments[aj-2],error:arguments[aj-1]};ak.params=ah.call(arguments,0,aj-2)}else{al={success:arguments[aj-1]};ak.params=ah.call(arguments,0,aj-1)}ac[""+(++ae)]=al;ak.id=ae}else{ak.params=ah.call(arguments,0)}if(ag.namedParams&&ak.params.length===1){ak.params=ak.params[0]}X(ak)}}function Z(an,am,ai,al){if(!ai){if(am){X({id:am,error:{code:-32601,message:"Procedure not found."}})}return}var ak,ah;if(am){ak=function(ao){ak=q;X({id:am,result:ao})};ah=function(ao,ap){ah=q;var aq={id:am,error:{code:-32099,message:ao}};if(ap){aq.error.data=ap}X(aq)}}else{ak=ah=q}if(!r(al)){al=[al]}try{var ag=ai.method.apply(ai.scope,al.concat([ak,ah]));if(!t(ag)){ak(ag)}}catch(aj){ah(aj.message)}}return(aa={incoming:function(ah,ag){var ai=af.parse(ah);if(ai.method){if(Y.handle){Y.handle(ai,X)}else{Z(ai.method,ai.id,Y.local[ai.method],ai.params)}}else{var aj=ac[ai.id];if(ai.error){if(aj.error){aj.error(ai.error)}}else{if(aj.success){aj.success(ai.result)}}delete ac[ai.id]}},init:function(){if(Y.remote){for(var ag in Y.remote){if(Y.remote.hasOwnProperty(ag)){ad[ag]=ab(Y.remote[ag],ag)}}}aa.down.init()},destroy:function(){for(var ag in Y.remote){if(Y.remote.hasOwnProperty(ag)&&ad.hasOwnProperty(ag)){delete ad[ag]}}aa.down.destroy()}})};b.easyXDM=o})(window,document,location,window.setTimeout,decodeURIComponent,encodeURIComponent);
trunk/style/admin.css ADDED
File without changes
trunk/style/admin.min.css ADDED
File without changes
trunk/style/ag_style.css ADDED
@@ -0,0 +1,590 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*color scheme*/
2
+ /*
3
+ -main
4
+ #ACC491
5
+ #DEF7C3
6
+
7
+ -lighter
8
+ #eef9d5
9
+
10
+ -blue
11
+ #005B69
12
+ */
13
+ .agca-clear{
14
+ clear:both;
15
+ }
16
+ .agca-tip{
17
+ padding-left:20px;
18
+ }
19
+ h1#agca-title{
20
+ color: #005B69;
21
+ font-weight: bold;
22
+ font-size: 30px;
23
+ }
24
+ table .agca-tip{
25
+ padding-left: 10px;
26
+ }
27
+ #ag_main_menu {
28
+ display: block;
29
+ height: 34px;
30
+ border-bottom: 3px solid #ACC491;
31
+ margin-top: 2px;
32
+ }
33
+ .ag_section{
34
+ background: #fff;
35
+ }
36
+ .ag_section h2{
37
+ color:#005B69;
38
+ }
39
+ #ag_main_menu li{
40
+ display:block;
41
+ background-color:#DEF7C3;
42
+ float:left;
43
+ color:#0B6138;
44
+ padding:15px;
45
+ padding-top:8px;
46
+ padding-bottom:8px;
47
+ font-weight:bold;
48
+ border-bottom:3px solid #ACC491;
49
+ }
50
+ #ag_main_menu li.selected{
51
+ background-color:#F9F9F9;
52
+ cursor:default;
53
+ }
54
+ #ag_main_menu li.normal:hover{
55
+ background-color:#eef9d5;
56
+ cursor:pointer;
57
+ }
58
+ #ag_main_menu a:focus{
59
+ outline: none;
60
+ border:0;
61
+ }
62
+ #ag_main_menu li a{
63
+ text-decoration:none;
64
+ color: #888888;
65
+ outline: none;
66
+ border:0;
67
+ }
68
+ .ag_table_heading{
69
+ background:none;
70
+ display:block;
71
+ height:25px;
72
+ padding:5px;
73
+ padding-top:0px;
74
+ padding-bottom:1px;
75
+ margin-top:50px;
76
+ margin-left:-10px;
77
+ margin-right:-10px;
78
+ }
79
+ .ag_table_heading h3{
80
+ color: #fff;
81
+ background: gray;
82
+ margin-left: -15px;
83
+ padding: 3px 9px;
84
+ border: none;
85
+ border-radius: 6px;
86
+ }
87
+ .ag_table_major_options{
88
+ background-color:#f8f8f8;
89
+ width: 500px;
90
+ margin-bottom: 2px;
91
+ }
92
+ #agca_form .form-table .ag_table_major_options td{
93
+ padding-left:20px;
94
+ }
95
+
96
+ div#AGToolTipDiv {
97
+ position: absolute;
98
+ top: 100px;
99
+ left: 200px;
100
+ height: auto;
101
+ border: 1px solid #FFFF00;
102
+ background-color: #FFFFD4;
103
+ display: none;
104
+ padding: 3px;
105
+ padding-top: 7px;
106
+ padding-bottom: 5px;
107
+ }
108
+ td.ag_admin_menu_parent{
109
+ font-size:16px;
110
+ font-weight:bold;
111
+ }
112
+ td.ag_admin_menu_parent:hover{
113
+ background-color:#ddd;
114
+ }
115
+ #ag_edit_adminmenu h3{
116
+ color: #ffffff;
117
+ }
118
+ #ag_edit_adminmenu tr{
119
+ margin:0;
120
+ padding:0;
121
+ background-color:#E8FAE8;
122
+ }
123
+ #ag_edit_adminmenu td.ag_admin_menu_child {
124
+ margin:0;
125
+ padding:15px;
126
+ padding-top:0;
127
+ padding-bottom:0;
128
+ }
129
+ #ag_edit_adminmenu th h2{
130
+ color:#fff;
131
+ }
132
+ #ag_edit_adminmenu a{
133
+ text-decoration:none;
134
+ color:#444;
135
+ }
136
+ #ag_edit_adminmenu input[name=ag_edit_adminmenu_item_top_2]:hover{
137
+ background-color: grey !important;
138
+ }
139
+ .noclass{
140
+ display:none;
141
+ }
142
+ #agca_footer_support_info{
143
+ font-size:12px;
144
+ font-weight:bold;
145
+ background:#acc491;
146
+ color:#ffffff;
147
+ border:none;
148
+ padding:20px;
149
+ }
150
+ #agca_footer_support_info a{
151
+ color:#005b69;
152
+ text-decoration:none;
153
+ font-size:18px;
154
+ }
155
+ #agca_news{
156
+ height:50px;
157
+ margin-top:-35px;
158
+ color:#005B69;
159
+ }
160
+ #agca_news a{
161
+ color:#005B69;
162
+ }
163
+ #agca_advertising{
164
+ display:block;
165
+ width:900px;
166
+ height: 100px;
167
+ /*background-color: #cccccc;*/
168
+ padding: 0;
169
+ margin: 0;
170
+ }
171
+ #agca_advertising ul{
172
+ padding: 0;
173
+ margin: 0;
174
+ padding-right:5px;
175
+ }
176
+ #agca_advertising > ul > li{
177
+ float:left;
178
+ margin-right: 6px;
179
+ cursor: pointer;
180
+ }
181
+ #agca_form{
182
+ min-width: 835px;/*used for agca menu lineup*/
183
+ }
184
+ #agca_form .section_title{
185
+ font-weight:bold;
186
+ background: #def7c3;
187
+ border-bottom-right-radius: 15px;
188
+ color: #acc491;
189
+ float: left;
190
+ font-size: 40px;
191
+ padding: 20px 11px;
192
+ position: relative;
193
+ text-decoration: none;
194
+ text-shadow: none;
195
+ width: 50%;
196
+ display:block;
197
+ margin-top:0;
198
+ }
199
+ #agca_form h2.section_title{
200
+
201
+ }
202
+ #agca_form h2.section_title{
203
+ font-family: Helvetica, Arial, sans-serif;
204
+ font-weight: bold;
205
+ font-size: 45px;
206
+ line-height: 1em;
207
+ }
208
+ #agca_form h2.section_title {
209
+ /* Shadows are visible under slightly transparent text color */
210
+ color: rgba(189, 193, 172, 0.71);
211
+ text-shadow: 1px 4px 6px #def7c3, 0 0 0 #000, 1px 4px 6px #def7c3;
212
+ }
213
+ /* Don't show shadows when selecting text */
214
+ #agca_form h2.section_title::-moz-selection { background: #5af; color: #fff; text-shadow: none; }
215
+ #agca_form h2.section_title::selection { background: #5af; color: #fff; text-shadow: none; }
216
+
217
+
218
+ #agca_form #templates_head_buttons input[type=button]{
219
+ background:#174F69;
220
+ color:white;
221
+ font-weight:bold;
222
+ }
223
+ #agca_form #templates_head_buttons input[type=button]:hover{
224
+ background:white;
225
+ color:#174F69;
226
+ }
227
+
228
+ .ag-custom-button{
229
+
230
+ /* margin-bottom:-4px !important;*/
231
+ }
232
+ #sidebar_adminmenu_logo{
233
+ margin-bottom: -33px;
234
+ min-height: 28px;
235
+ cursor: pointer;
236
+ }
237
+
238
+ .agcaMenuEditorPlusMinus .plus{
239
+ padding-right: 4px;
240
+ display: inline;
241
+ }
242
+ .agcaMenuEditorPlusMinus .minus{
243
+ padding-right: 4px;
244
+ display: none;
245
+ }
246
+ .agcaMenuEditorPlusMinus .dashicons:before{
247
+ font-size: 25px;
248
+ line-height: 22px;
249
+ display: inline-block;
250
+ }
251
+
252
+ .agcaMenuEditorPlusMinus{
253
+ float: left;
254
+ margin-right: 18px;
255
+ cursor: default;
256
+ width:10px;
257
+ }
258
+ /*#agca_form input.agca_button,#agca_form #ag_add_adminmenu button{
259
+ padding: 3px 10px;
260
+ background-color:#ffffff;
261
+ } */
262
+ #agca_form .agca_button.clear span:before{
263
+ color: #f08080;
264
+ cursor:pointer;
265
+ font-size: 30px;
266
+ }
267
+ #agca_form .agca_button.clear span:hover:before{
268
+ color: red;
269
+ }
270
+ #agca_form input[type=button],button{
271
+ background-color: #ACC491;
272
+ border: 1px solid #ACC491;
273
+ border-radius: 3px;
274
+ color: #FFFFFF;
275
+ padding: 5px 10px;
276
+ }
277
+ #agca_form input[type=button]:hover{
278
+ background-color:#DEF7C3;
279
+ border: 1px solid #DEF7C3;
280
+ color:#444;
281
+ cursor:pointer;
282
+ }
283
+ #agca_form input[type=text]{
284
+ height:28px;
285
+ width:400px;
286
+ }
287
+ #agca_form input.color_picker{
288
+ width:77px;
289
+ }
290
+ #agca_form input[type=text]:hover{
291
+ background-color: #efffef;
292
+ }
293
+ #agca_form textarea{
294
+ width:400px;
295
+ }
296
+ #agca_form textarea.wp-editor-area{
297
+ width:100%;
298
+ }
299
+ #agca_form textarea:hover{
300
+ background-color: #efffef;
301
+ }
302
+ #agca_form #ag_edit_adminmenu input[type=text]:hover{
303
+ background-color: #444444;
304
+ color:#ffffff;
305
+ }
306
+ #agca_form #ag_add_adminmenu input[type=text]{
307
+ width:300px;
308
+ }
309
+ #agca_form #ag_add_adminmenu .button_edit span,
310
+ #agca_form #ag_add_adminmenu .button_remove span{
311
+ font-size: 25px;
312
+ color: #7A8A67;
313
+ }
314
+ #agca_form #ag_add_adminmenu .button_remove span{
315
+ color: red;
316
+ }
317
+ #agca_form input#save_plugin_settings{
318
+ background: none repeat scroll 0 0 #acc491;
319
+ font-weight: bold;
320
+ height: 39px;
321
+ padding: 4px;
322
+ width: 130px;
323
+ border:1px solid #acc491 !important;
324
+ text-shadow: none !important;
325
+ box-shadow: none !important;
326
+ font-size:16px;
327
+ }
328
+ #agca_form input#save_plugin_settings:hover{
329
+ background-color:#DEF7C3 !important;
330
+ color:#005B69 !important;
331
+ }
332
+ #agca_form input#save_plugin_settings[type="button"]:hover{
333
+ background-color:#ffffff;
334
+ color:#ffffff;
335
+ }
336
+
337
+ /*editor style fix*/
338
+ #agca_form .agca_editor input[type="button"], button{
339
+ color: black;
340
+ }
341
+
342
+ #agca_form .agca_editor textarea{
343
+ width: 100%;
344
+ }
345
+ .agca_editor{
346
+ width:600px;
347
+ }
348
+
349
+ /*templates*/
350
+ #agca_templates .error{
351
+ padding:8px;
352
+ font-size: 14px;
353
+ }
354
+
355
+ .agca_template{
356
+ display:block;
357
+ float:left;
358
+ border:3px solid #aaa;
359
+ margin:10px;
360
+ margin-top:15px;
361
+ cursor:pointer;
362
+ }
363
+ .agca_template:hover{
364
+ border:3px solid green;
365
+ }
366
+ .agca_template h3{
367
+ text-align: center;
368
+ color:green;
369
+ }
370
+ .agca_template h3 span{
371
+ color:#555;
372
+ font-size:16px;
373
+ }
374
+ .agca_template img{
375
+ width:250px;
376
+ }
377
+
378
+ .agca_logout_button{
379
+ background: none repeat scroll 0 0 #dddddd;
380
+ float: right;
381
+ font-size: 15px;
382
+ font-weight: bold;
383
+ margin-right: 20px;
384
+ padding: 10px;
385
+ text-decoration: none;
386
+ border-radius: 0 0 3px 3px;
387
+ border: 1px solid #BBBBBB;
388
+ border-top: none;
389
+ margin-left: 6px;
390
+ margin-right: 20px;
391
+ padding: 6px 10px;
392
+ }
393
+ #ag_add_adminmenu button{
394
+ border: medium none;
395
+ border-radius: 4px;
396
+ color: #FFFFFF;
397
+ padding: 6px 9px;
398
+ min-width: 150px;
399
+ }
400
+ .wp-admin.folded #sidebar_adminmenu_logo{
401
+ display:none;
402
+ }
403
+ .agca-selectbox{
404
+ width:405px;
405
+ padding:4px !important;
406
+ height:28px !important;
407
+ }
408
+ .agca-selectbox:hover{
409
+ background-color:#efffef;
410
+ }
411
+
412
+ #agca_form .agca-checkbox-box{
413
+ cursor:pointer;
414
+ display: block;
415
+ width: 28px;
416
+ height: 28px;
417
+ position:relative;
418
+ float:left;
419
+ }
420
+ #agca_form .agca-checkbox-box:before{
421
+ content: "\f159";
422
+ font-size: 35px;
423
+ line-height: 35px;
424
+ color: #ACC491;
425
+ font-family: Dashicons;
426
+ }
427
+ #agca_form .agca-checkbox-box.visibility:before{
428
+ content: "\f177";
429
+ }
430
+ #agca_form .agca-checkbox-box-checked{
431
+ cursor:pointer;
432
+ display: block;
433
+ width: 28px;
434
+ height: 28px;
435
+ position:relative;
436
+ float:left;
437
+ }
438
+ #agca_form .agca-checkbox-box-checked:before{
439
+ content: "\f502";
440
+ font-size: 35px;
441
+ line-height: 35px;
442
+ color: #659957;
443
+ font-family: Dashicons;
444
+ }
445
+ #agca_form .agca-checkbox-box-checked.visibility:before{
446
+ content: "\f530";
447
+ color: #f08080;
448
+ }
449
+ #agca_form .agca-checkbox-box-checked:hover:before,
450
+ #agca_form .agca-checkbox-box:hover:before{
451
+ color: #999;
452
+ }
453
+
454
+ #agca_form label{
455
+ font-size:15px;
456
+ color:#777777;
457
+ }
458
+ #agca_form .form-table th{
459
+ width:350px;
460
+ padding-left: 20px;
461
+ }
462
+ .ag_admin_menu_parent .agca-checkbox-box-checked, .ag_admin_menu_parent .agca-checkbox-box{
463
+ margin-top:-15px;
464
+ }
465
+ #agca_form input[type=radio]{
466
+ display:block;
467
+ float:left;
468
+ }
469
+ #agca_form .agca-radiobox{
470
+ cursor:pointer;
471
+ display: block;
472
+ width: 28px;
473
+ height: 28px;
474
+ position:relative;
475
+ float:left;
476
+ }
477
+ #agca_form .agca-radio-text{
478
+ display: block;
479
+ float: left;
480
+ font-size: 17px;
481
+ font-weight: bold;
482
+ margin: 4px 25px 4px 4px;
483
+ cursor:pointer;
484
+ }
485
+ #agca_form .agca-radio-text.on{
486
+ color: #ACC491;
487
+ }
488
+ #agca_form .agca-radio-text.off{
489
+ color: #f08080;
490
+ }
491
+ #agca_form .agca-radiobox:before{
492
+ font-family: Dashicons;
493
+ content: "\f159";
494
+ font-size: 30px;
495
+ line-height:30px;
496
+ }
497
+ #agca_form .agca-radiobox.checked:before{
498
+ content: "\f502";
499
+ }
500
+ #agca_form .agca-radiobox.checked[value=off]:before{
501
+ content: "\f153";
502
+ }
503
+ #agca_form .agca-radiobox[value=on]:before{
504
+ color: #ACC491;
505
+ }
506
+ #agca_form .agca-radiobox[value=off]:before{
507
+ color: #f08080;
508
+ }
509
+
510
+ #agca_form #section_templates{
511
+ background: rgba(255, 255, 255, 0.95)
512
+ }
513
+ #wp-admin-bar-agca-admin-themes a{
514
+ color: #def7c3 !important;
515
+ }
516
+ #wp-admin-bar-agca-admin-themes .ab-icon:before {
517
+ font-family: "dashicons";
518
+ content: "\f100";
519
+ margin-top: 2px;
520
+ display: block;
521
+ color: #eef9d5 !important;
522
+ }
523
+ .agca-feedback-and-support a{
524
+ border: medium none;
525
+ border-radius: 4px;
526
+ color: #FFFFFF;
527
+ padding: 6px 9px;
528
+ min-width: 240px;
529
+ background: rgb(216, 234, 216);
530
+ display: inline-block;
531
+ text-decoration: none;
532
+ color: gray;
533
+ }
534
+ .agca-feedback-and-support a:hover{
535
+ background-color:#ACC491;
536
+ color:#fff;
537
+ }
538
+ #agca-your-feedback{
539
+ float:right;
540
+ width:160px;
541
+ margin-top: -25px;
542
+ }
543
+ #agca-your-feedback .dashicons{
544
+ font-size: 24px;
545
+ padding: 0 3px;
546
+ line-height: 18px;
547
+ }
548
+ #agca-your-feedback a{
549
+ text-decoration: none;
550
+ }
551
+ #agca-your-feedback a{
552
+ text-decoration: none;
553
+ }
554
+ #agca-your-feedback .feedback.negative{
555
+ color: #f08080;
556
+ }
557
+ #agca-your-feedback .feedback.negative:hover{
558
+ color: red;
559
+ }
560
+ #agca-your-feedback .feedback.positive{
561
+ color: #ACC491;
562
+ }
563
+ #agca-your-feedback .feedback.positive:hover{
564
+ color: green;
565
+ }
566
+ #agca_donate_button{
567
+ margin-left: 5px;
568
+ margin-top: 3px;
569
+ display: inline-block;
570
+ }
571
+ #section_ag_colorizer_settings .color input{
572
+ border-radius: 5px;
573
+ }
574
+ #section_ag_colorizer_settings .color .agca_button{
575
+ cursor:pointer;
576
+ }
577
+ #section_ag_colorizer_settings .color .agca_button span{
578
+ font-size: 35px;
579
+ padding: 0 6px;
580
+ color: #ACC491;
581
+ }
582
+ #section_ag_colorizer_settings .color .agca_button span:hover{
583
+ color: #659957;
584
+ }
585
+ #section_ag_colorizer_settings .color .agca_button span.clear{
586
+ color: #f08080;
587
+ }
588
+ #section_ag_colorizer_settings .color .agca_button span.clear:hover{
589
+ color: red;
590
+ }
trunk/style/agca_farbtastic.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ #picker{
2
+ width:195px;
3
+ position:absolute;
4
+ }
trunk/style/farbtastic.css ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Farbtastic Color Picker 1.2
3
+ * © 2008 Steven Wittens
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+ .farbtastic {
20
+ position: relative;
21
+ }
22
+ .farbtastic * {
23
+ position: absolute;
24
+ cursor: crosshair;
25
+ }
26
+ .farbtastic, .farbtastic .wheel {
27
+ width: 195px;
28
+ height: 195px;
29
+ }
30
+ .farbtastic .color, .farbtastic .overlay {
31
+ top: 47px;
32
+ left: 47px;
33
+ width: 101px;
34
+ height: 101px;
35
+ }
36
+ .farbtastic .wheel {
37
+ background: url(wheel.png) no-repeat;
38
+ width: 195px;
39
+ height: 195px;
40
+ }
41
+ .farbtastic .overlay {
42
+ background: url(mask.png) no-repeat;
43
+ }
44
+ .farbtastic .marker {
45
+ width: 17px;
46
+ height: 17px;
47
+ margin: -8px 0 0 -8px;
48
+ overflow: hidden;
49
+ background: url(marker.png) no-repeat;
50
+ }
51
+
trunk/style/login.css ADDED
File without changes
trunk/style/login.min.css ADDED
File without changes
trunk/style/marker.png ADDED
Binary file
trunk/style/mask.png ADDED
Binary file
trunk/style/wheel.png ADDED
Binary file
trunk/uninstall.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // die if not uninstalling
3
+ if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
+ exit ();
5
+
6
+ delete_option( 'agca_role_allbutadmin' );
7
+ delete_option( 'agca_screen_options_menu' );
8
+ delete_option( 'agca_help_menu' );
9
+ delete_option( 'agca_logout' );
10
+ delete_option( 'agca_remove_your_profile' );
11
+ delete_option( 'agca_logout_only' );
12
+ delete_option( 'agca_options_menu' ); //obsolete from 1.5
13
+ delete_option( 'agca_howdy' );
14
+ delete_option( 'agca_header' );
15
+ delete_option( 'agca_header_show_logout' );
16
+ delete_option( 'agca_footer' );
17
+ delete_option( 'agca_privacy_options' );
18
+ delete_option( 'agca_header_logo' );
19
+ delete_option( 'agca_header_logo_custom' );
20
+ delete_option( 'agca_wp_logo_custom' );
21
+ delete_option( 'agca_wp_logo_custom_link' );
22
+ delete_option( 'agca_site_heading' );
23
+ delete_option( 'agca_custom_site_heading' );
24
+ delete_option( 'agca_update_bar' );
25
+
26
+ delete_option( 'agca_footer_left' );
27
+ delete_option( 'agca_footer_left_hide' );
28
+ delete_option( 'agca_footer_right' );
29
+ delete_option( 'agca_footer_right_hide' );
30
+
31
+ delete_option( 'agca_login_banner' );
32
+ delete_option( 'agca_login_banner_text' );
33
+ delete_option( 'agca_login_photo_remove' );
34
+ delete_option( 'agca_login_photo_url' );
35
+ delete_option( 'agca_login_photo_href' );
36
+ delete_option( 'agca_login_round_box' );
37
+ delete_option( 'agca_login_round_box_size' );
38
+
39
+ delete_option( 'agca_dashboard_icon' );
40
+ delete_option( 'agca_dashboard_text' );
41
+ delete_option( 'agca_dashboard_text_paragraph' );
42
+ delete_option( 'agca_dashboard_widget_welcome' );
43
+ delete_option( 'agca_dashboard_widget_il' );
44
+ delete_option( 'agca_dashboard_widget_plugins' );
45
+ delete_option( 'agca_dashboard_widget_qp' );
46
+ delete_option( 'agca_dashboard_widget_rn' );
47
+ delete_option( 'agca_dashboard_widget_rd' );
48
+ delete_option( 'agca_dashboard_widget_primary' );
49
+ delete_option( 'agca_dashboard_widget_secondary' );
50
+ delete_option( 'agca_dashboard_widget_activity' );
51
+
52
+ //WP3.3
53
+ delete_option( 'agca_admin_bar_comments' );
54
+ delete_option( 'agca_admin_bar_new_content' );
55
+ delete_option( 'agca_admin_bar_new_content_post' );
56
+ delete_option( 'agca_admin_bar_new_content_link' );
57
+ delete_option( 'agca_admin_bar_new_content_page' );
58
+ delete_option( 'agca_admin_bar_new_content_user' );
59
+ delete_option( 'agca_admin_bar_new_content_media' );
60
+ delete_option( 'agca_admin_bar_update_notifications' );
61
+ delete_option( 'agca_admin_bar_admin_themes' );
62
+ delete_option( 'agca_remove_top_bar_dropdowns' );
63
+
64
+ /*Admin menu*/
65
+ delete_option( 'agca_admin_menu_turnonoff' );
66
+ delete_option( 'agca_admin_menu_agca_button_only' );
67
+ delete_option( 'agca_admin_menu_separator_first' );
68
+ delete_option( 'agca_admin_menu_separator_second' );
69
+ delete_option( 'agca_admin_menu_icons' );
70
+ delete_option( 'agca_admin_menu_arrow' );
71
+ delete_option( 'agca_admin_menu_submenu_round' );
72
+ delete_option( 'agca_admin_menu_submenu_round_size' );
73
+ delete_option( 'agca_admin_menu_brand' );
74
+ delete_option( 'agca_admin_menu_brand_link' );
75
+ delete_option( 'agca_admin_menu_autofold' );
76
+ delete_option( 'ag_edit_adminmenu_json' );
77
+ delete_option( 'ag_edit_adminmenu_json_new' );
78
+ delete_option( 'ag_add_adminmenu_json' );
79
+ delete_option( 'ag_colorizer_json' );
80
+ delete_option( 'agca_colorizer_turnonoff' );
81
+
82
+ delete_option( 'agca_custom_js' );
83
+ delete_option( 'agca_custom_css' );
84
+
85
+ delete_option( 'agca_selected_template' );
86
+ delete_option( 'agca_templates' );
87
+ delete_option( 'agca_disablewarning' );
88
+
89
+ ?>