diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-08-04 05:25:25 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-08-04 05:25:25 +0000 |
commit | 2ebfdf4c29ac9e33b8070243856b48ef665e61a9 (patch) | |
tree | 706831ca65800d8469cba2f4855d13246c78f206 | |
parent | b909c08509458f4a76ba0ba7922316cd7e55b0d4 (diff) | |
download | ampache-2ebfdf4c29ac9e33b8070243856b48ef665e61a9.tar.gz ampache-2ebfdf4c29ac9e33b8070243856b48ef665e61a9.tar.bz2 ampache-2ebfdf4c29ac9e33b8070243856b48ef665e61a9.zip |
fixed potential issue with kajax, and added advanced search button to top, right bar
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/ajax.class.php | 42 | ||||
-rwxr-xr-x | modules/kajax/ajax.js | 6 | ||||
-rw-r--r-- | templates/show_search_bar.inc.php | 1 | ||||
-rw-r--r-- | templates/sidebar_home.inc.php | 31 | ||||
-rw-r--r-- | themes/classic/templates/default.css | 9 |
6 files changed, 42 insertions, 49 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 59af7e3d..3fba94cc 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.4-Alpha2 + - Fixed a potential issue with the kajax.js and checkboxes + - Added 'Advanced Search' link to top rightbar - Added Paging to bottom of all views - Fixed get_location() (Thx ichneumon) - Moved Quick search to the top, right appears on every page diff --git a/lib/class/ajax.class.php b/lib/class/ajax.class.php index b3d35f07..441d9a47 100644 --- a/lib/class/ajax.class.php +++ b/lib/class/ajax.class.php @@ -51,21 +51,34 @@ class Ajax { } // observe /** + * action + * This takes the action, the source and the post (if passed) and generated the full + * ajax link + */ + public static function action($action,$source,$post='') { + + $url = Config::get('ajax_url') . $action; + + if ($post) { + $ajax_string = "ajaxPost('$url','$post','$source')"; + } + else { + $ajax_string = "ajaxPut('$url','$source')"; + } + + return $ajax_string; + + } // action + + /** * button * This prints out an img of the specified icon with the specified alt text * and then sets up the required ajax for it */ public static function button($action,$icon,$alt,$source='',$post='') { - $url = Config::get('ajax_url') . $action; - - // Define the Action that is going to be performed - if ($post) { - $ajax_string = "ajaxPost('$url','$post','$source')"; - } - else { - $ajax_string = "ajaxPut('$url','$source')"; - } + // Get the correct action + $ajax_string = self::action($action,$source,$post); $string = get_user_icon($icon,$alt,$source); @@ -82,15 +95,8 @@ class Ajax { */ public static function text($action,$text,$source,$post='',$span_class='') { - $url = Config::get('ajax_url') . $action; - - // Use ajaxPost() if we are doing a post - if ($post) { - $ajax_string = "ajaxPost('$url','$post','$source')"; - } - else { - $ajax_string = "ajaxPut('$url','$source')"; - } + // Format the string we wanna use + $ajax_string = self::action($action,$source,$post); // If they passed a span class if ($span_class) { diff --git a/modules/kajax/ajax.js b/modules/kajax/ajax.js index 1e1f288c..976808ce 100755 --- a/modules/kajax/ajax.js +++ b/modules/kajax/ajax.js @@ -58,8 +58,14 @@ var post_data = 'a=0';
var data = document.getElementById(input).elements;
+ // For the post data we recieved
for(i=0;i<data.length;i++) {
var frm_field = data[i];
+
+ // This makes the value of the checkbox the checked status, more usefull
+ if (frm_field.type == 'checkbox') {
+ frm_field.value = frm_field.checked;
+ }
post_data = post_data +'&' + frm_field.name + '=' + encodeURI(frm_field.value);
}
diff --git a/templates/show_search_bar.inc.php b/templates/show_search_bar.inc.php index b9b2c94c..f62cbf0d 100644 --- a/templates/show_search_bar.inc.php +++ b/templates/show_search_bar.inc.php @@ -27,6 +27,7 @@ <input type="hidden" name="action" value="quick_search" /> <input type="hidden" name="method" value="fuzzy" /> <input type="hidden" name="object_type" value="song" /> + <a href="<?php echo $web_path; ?>/search.php" class="smallbutton"><?php echo _('Advanced Search'); ?></a> </form> </div> diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php index a79bda37..ca14c5ea 100644 --- a/templates/sidebar_home.inc.php +++ b/templates/sidebar_home.inc.php @@ -5,37 +5,6 @@ <li id="sb_Info_AddStationRadio"><a href="<?php echo $web_path; ?>/radio.php?action=show_create"><?php echo _('Add Radio Station'); ?></a></li> </ul> <hr /> -<?php /* -<!-- RANDOM, Hidden for now cause its broken -<h4><?php echo _('Random'); ?></h4> - <form name="sub_random" method="post" enctype="multipart/form-data" action="<?php echo $web_path; ?>/song.php?action=random&method=stream" style="Display:inline"> - <select name="random" style="width:80px;"> - <option value="1">1</option> - <option value="5" selected="selected">5</option> - <option value="10">10</option> - <option value="20">20</option> - <option value="30">30</option> - <option value="50">50</option> - <option value="100">100</option> - <option value="500">500</option> - <option value="1000">1000</option> - <option value="-1"><?php echo _('All'); ?></option> - </select> -<!- GENRE PULLDOWN -> -<br /> - <select name="random_type" style="width:80px;"> - <option value="Songs"><?php echo _('Songs'); ?></option> - <option value="length"><?php echo _('Minutes'); ?></option> - <option value="full_artist"><?php echo _('Artists'); ?></option> - <option value="full_album"><?php echo _('Albums'); ?></option> - <option value="unplayed"><?php echo _('Less Played'); ?></option> - </select> - <br /> -<!- CATALOG PULLDOWN -> - <input class="smallbutton" type="submit" value="<?php echo _('Enqueue'); ?>" /> - </form> -<hr /> ---> */ ?> <h4><?php echo _('Playlists'); ?></h4> <a id="sb_ViewAll" href="<?php echo $web_path; ?>/playlist.php?action=show_all"><?php echo _('View All'); ?></a> <hr /> diff --git a/themes/classic/templates/default.css b/themes/classic/templates/default.css index b3f074d9..bfb9e594 100644 --- a/themes/classic/templates/default.css +++ b/themes/classic/templates/default.css @@ -118,6 +118,15 @@ input { font-size: 11px; cursor: pointer; } +a.smallbutton { + border:0; + font-size: 11px; + cursor: pointer; + padding: 2px; + font-weight:bold; + background: #d0d0d0; + text-decoration:none; +} /************************************************/ |