diff options
-rw-r--r-- | browse.php | 17 | ||||
-rw-r--r-- | images/icon_admin.png | bin | 0 -> 530 bytes | |||
-rw-r--r-- | images/icon_browse.png | bin | 0 -> 622 bytes | |||
-rw-r--r-- | images/icon_home.png | bin | 0 -> 806 bytes | |||
-rw-r--r-- | images/icon_logout.png | bin | 0 -> 508 bytes | |||
-rw-r--r-- | lib/class/update.class.php | 77 | ||||
-rw-r--r-- | templates/show_browse.inc.php | 21 | ||||
-rw-r--r-- | templates/sidebar.inc.php | 25 | ||||
-rw-r--r-- | templates/sidebar_home.inc.php | 39 | ||||
-rw-r--r-- | themes/classic/templates/default.css | 18 |
10 files changed, 146 insertions, 51 deletions
@@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All Rights Reserved This program is free software; you can redistribute it and/or @@ -33,15 +33,12 @@ */ /* Base Require */ -require_once('lib/init.php'); - -/* Clean up incomming variables */ -$action = scrub_in($_REQUEST['action']); +require_once 'lib/init.php'; /* Display the headers and menus */ -show_template('header'); +require_once Config::get('prefix') . '/templates/header.inc.php'; -switch($action) { +switch($_REQUEST['action']) { case 'file': case 'album': show_alphabet_list('albums','albums.php',$match); @@ -105,7 +102,6 @@ switch($action) { } break; - default: case 'song_title': /* Create the Needed Object */ $song = new Song(); @@ -145,6 +141,11 @@ switch($action) { case 'catalog': break; + default: + + + + break; } // end Switch $action /* Show the Footer */ diff --git a/images/icon_admin.png b/images/icon_admin.png Binary files differnew file mode 100644 index 00000000..720a237c --- /dev/null +++ b/images/icon_admin.png diff --git a/images/icon_browse.png b/images/icon_browse.png Binary files differnew file mode 100644 index 00000000..7d863f94 --- /dev/null +++ b/images/icon_browse.png diff --git a/images/icon_home.png b/images/icon_home.png Binary files differnew file mode 100644 index 00000000..fed62219 --- /dev/null +++ b/images/icon_home.png diff --git a/images/icon_logout.png b/images/icon_logout.png Binary files differnew file mode 100644 index 00000000..64bab57d --- /dev/null +++ b/images/icon_logout.png diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 8c7ebe1e..8456dd17 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -41,45 +41,42 @@ class Update { public $value; public static $versions; // array containing version information - /*! - @function Update - @discussion Constructor, pulls out information about - the desired key - */ + /** + * Update + * Constructor, pulls out information about the desired key + */ function Update ( $key=0 ) { - if ($key) { - $info = $this->get_info(); - $this->key = $key; - $this->value = $info->value; - $this->versions = $this->populate_version(); - } + if (!$key) { return false; } + + $this->key = intval($key); + $info = $this->_get_info(); + $this->value = $info['value']; + $this->versions = $this->populate_version(); } // constructor - /*! - @function get_info - @discussion gets the information for the zone - */ - function get_info() { - global $conf; + /** + * get_info + * gets the information for the zone + */ + private function _get_info() { $sql = "SELECT * FROM update_info WHERE key='$this->key'"; - $db_results = mysql_query($sql, dbh()); + $db_results = Dba::query($sql); - return mysql_fetch_object($db_results); + return Dba::fetch_assoc($db_results); - } //get_info + } // _get_info - /*! - @function get_version - @discussion this checks to see what version you are currently running - because we may not have the update_info table we have to check - for it's existance first. - */ + /** + * get_version + * this checks to see what version you are currently running + * because we may not have the update_info table we have to check + * for it's existance first. + */ public static function get_version() { - /* Make sure that update_info exits */ $sql = "SHOW TABLES LIKE 'update_info'"; $db_results = Dba::query($sql); @@ -94,7 +91,7 @@ class Update { else { // If we've found the update_info table, let's get the version from it - $sql = "SELECT * FROM update_info WHERE `key`='db_version'"; + $sql = "SELECT * FROM `update_info` WHERE `key`='db_version'"; $db_results = Dba::query($sql); $results = Dba::fetch_assoc($db_results); $version = $results['value']; @@ -104,11 +101,11 @@ class Update { } // get_version - /*! - @function format_version - @discussion make the version number pretty - */ - function format_version($data) { + /** + * format_version + * make the version number pretty + */ + public static function format_version($data) { $new_version = substr($data,0,strlen($data) - 5) . "." . substr($data,strlen($data)-5,1) . " Build:" . substr($data,strlen($data)-4,strlen($data)); @@ -170,11 +167,11 @@ class Update { } // plugins_installed - /*! - @function populate_version - @discussion just sets an array the current differences - that require an update - */ + /** + * populate_version + * just sets an array the current differences + * that require an update + */ public static function populate_version() { /* Define the array */ @@ -380,7 +377,7 @@ class Update { if ($version['version'] > $current_version) { $updated = true; - echo "<li><b>Version: " . $this->format_version($version['version']) . "</b><br />"; + echo "<li><b>Version: " . self::format_version($version['version']) . "</b><br />"; echo $version['description'] . "<br /></li>\n"; } // if newer diff --git a/templates/show_browse.inc.php b/templates/show_browse.inc.php new file mode 100644 index 00000000..531f903a --- /dev/null +++ b/templates/show_browse.inc.php @@ -0,0 +1,21 @@ +<?php +/* + + Copyright (c) 2001 - 2007 Ampache.org + All rights reserved. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php index f219945b..e5c59616 100644 --- a/templates/sidebar.inc.php +++ b/templates/sidebar.inc.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -36,9 +36,29 @@ $browse_items[] = array('title'=>_("Artists"),'url'=>'artists.php','active'=>$lo $browse_items[] = array('title'=>_("Genre"),'url'=>'browse.php?action=genre','active'=>$location['page'], 'cssclass'=>'sidebar_browse_genre'); $browse_items[] = array('title'=>_('Song Title'),'url'=>'browse.php?action=song_title','active'=>$location['page'], 'cssclass'=>'sidebar_browse_song_title'); + +if (!$_SESSION['state']['sidebar_tab']) { $_SESSION['state']['sidebar_tab'] = 'home'; } +$_SESSION['state']['sidebar_tab'] = 'home'; +$class_name = 'sidebar_' . $_SESSION['state']['sidebar_tab']; +${$class_name} = ' class="active" '; + $web_path = Config::get('web_path'); ?> +<ul id="sidebar-tabs"> +<li <?php echo $sidebar_home; ?>><?php echo get_user_icon('home'); ?></li> +<li <?php echo $sidebar_browse; ?>><?php echo get_user_icon('browse'); ?></li> +<li <?php echo $sidebar_view; ?>><?php echo get_user_icon('view'); ?></li> +<li <?php echo $sidebar_edit; ?>><?php echo get_user_icon('edit'); ?></li> +<?php if ($GLOBALS['user']->has_access('100')) { ?> +<li <?php echo $sidebar_admin; ?>><?php echo get_user_icon('admin'); ?></li> +<?php } ?> +<li <?php echo $sidebar_all; ?>><?php echo get_user_icon('all'); ?></li> +</ul> +<div id="sidebar-page"> +<?php require_once Config::get('prefix') . '/templates/sidebar_' . $_SESSION['state']['sidebar_tab'] . '.inc.php'; ?> +</div> +<!-- <h3> </h3> <ul id="navlist"> <li id="sidebar_home"<?php @@ -178,7 +198,7 @@ $web_path = Config::get('web_path'); $required_info = Config::get('ajax_info'); $ajax_url = Config::get('ajax_url'); ?> - <?php require_once(Config::get('prefix') . '/templates/show_playtype_switch.inc.php'); ?> + <?php //require_once(Config::get('prefix') . '/templates/show_playtype_switch.inc.php'); ?> </li> <?php if (Config::get('allow_democratic_playback')) { ?> <li> @@ -189,3 +209,4 @@ $web_path = Config::get('web_path'); <li id="sidebar_logout"><a href="<?php echo $web_path; ?>/logout.php"><?php echo _('Logout'); ?></a></li> <?php } // end (Config::get('use_auth'))?> </ul> +--> diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php new file mode 100644 index 00000000..dfdf0ee8 --- /dev/null +++ b/templates/sidebar_home.inc.php @@ -0,0 +1,39 @@ +<h4><?php echo _('Search'); ?></h4> +<div id="sidebar_subsearch"> + <form name="sub_search" method="post" action="<?php echo $web_path; ?>/search.php" enctype="multipart/form-data" style="Display:inline"> + <input type="text" name="search_string" value="" size="5" /> +<br /> + <input class="smallbutton" type="submit" value="<?php echo _('Search'); ?>" /> + <input type="hidden" name="action" value="quick_search" /> + <input type="hidden" name="method" value="fuzzy" /> + <input type="hidden" name="object_type" value="song" /> + </form> +</div> +<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> + diff --git a/themes/classic/templates/default.css b/themes/classic/templates/default.css index e156acd7..7ebce74f 100644 --- a/themes/classic/templates/default.css +++ b/themes/classic/templates/default.css @@ -1,6 +1,6 @@ /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -237,6 +237,22 @@ h3#content_title span { .horizontal_menu #sidebar li { clear: none; border:1px solid #8b8b8b; } .horizontal_menu #sidebar ul.subnavside { left: 0; top: 2em; } +/* For sidebar tabs */ +#sidebar-tabs li { + clear: none; + width: auto; + padding:2px; + border: 1px solid #ffffff; +} +#sidebar-tabs li.active { + background-color:#c0c0c0; + border:1px solid #c0c0c0; +} +#sidebar-page { + clear: left; + background-color:#c0c0c0; +} + /* Menu Elements Display (icons, visibility...) */ #sidebar_home a { } |