diff options
-rw-r--r-- | admin/catalog.php | 11 | ||||
-rw-r--r-- | admin/index.php | 9 | ||||
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | favicon.ico | bin | 1150 -> 1150 bytes | |||
-rw-r--r-- | lib/class/browse.class.php | 6 | ||||
-rw-r--r-- | lib/class/catalog.class.php | 24 | ||||
-rw-r--r--[-rwxr-xr-x] | lib/class/vainfo.class.php | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | modules/kajax/ajax.js | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | modules/xmlrpc/xmlrpc.inc | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | modules/xmlrpc/xmlrpcs.inc | 0 | ||||
-rw-r--r-- | templates/show_catalog_row.inc.php | 30 | ||||
-rw-r--r-- | templates/show_catalogs.inc.php | 49 | ||||
-rw-r--r-- | templates/sidebar_admin.inc.php | 21 | ||||
-rwxr-xr-x | themes/classic/images/ampache-dark-bg.gif | bin | 138 -> 0 bytes | |||
-rwxr-xr-x | themes/classic/images/ampache-light-bg.gif | bin | 138 -> 0 bytes | |||
-rwxr-xr-x | themes/classic/images/ampache-mid.gif | bin | 268 -> 0 bytes |
16 files changed, 124 insertions, 28 deletions
diff --git a/admin/catalog.php b/admin/catalog.php index bf66e884..64097bc0 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -26,10 +26,7 @@ if (!$GLOBALS['user']->has_access(100)) { exit; } -// We'll need this -$catalog = new Catalog($_REQUEST['catalog_id']); - -require_once Config::get('prefix') . '/templates/header.inc.php'; +show_header(); /* Big switch statement to handle various actions */ switch ($_REQUEST['action']) { @@ -207,6 +204,11 @@ switch ($_REQUEST['action']) { $body = ''; show_confirmation($title,$body,$url); break; + case 'show_catalogs': + $catalog_ids = Catalog::get_catalogs(); + Browse::set_type('catalog'); + Browse::show_objects($catalog_ids); + break; case 'show_add_catalog': require Config::get('prefix') . '/templates/show_add_catalog.inc.php'; break; @@ -235,6 +237,7 @@ switch ($_REQUEST['action']) { show_confirmation(_('Delete Catalog'),_('Do you really want to delete this catalog?') . " -- $catalog->name ($catalog->path)",$nexturl,1); break; case 'show_customize_catalog': + $catalog = new Catalog($_REQUEST['catalog_id']); require_once Config::get('prefix') . '/templates/show_edit_catalog.inc.php'; break; case 'gather_album_art': diff --git a/admin/index.php b/admin/index.php index 2e4d957e..ea2d7e14 100644 --- a/admin/index.php +++ b/admin/index.php @@ -28,6 +28,13 @@ if (!$GLOBALS['user']->has_access(100)) { show_header(); - +switch ($_REQUEST['action']) { + default: + // Show Catalogs + $catalog_ids = Catalog::get_catalogs(); + Browse::set_type('catalog'); + Browse::show_objects($catalog_ids); + break; +} show_footer(); diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 9f4f0303..87cbe272 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.4-Alpha3 + - Moved Catalog functions out of sidebar, back into the content + area - Fixed a problem with batch downloads and tmpplaylists - Fixed missing set_timeout_limit(0); on add to catalog functions diff --git a/favicon.ico b/favicon.ico Binary files differindex 39b8f4d5..b90e362b 100644 --- a/favicon.ico +++ b/favicon.ico diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index 0cc75d31..b7a54757 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -101,6 +101,7 @@ class Browse { case 'user': case 'playlist': case 'song': + case 'catalog': case 'album': case 'artist': case 'genre': @@ -474,6 +475,11 @@ class Browse { require_once Config::get('prefix') . '/templates/show_playlists.inc.php'; show_box_bottom(); break; + case 'catalog': + show_box_top(_('Catalogs')); + require_once Config::get('prefix') . '/templates/show_catalogs.inc.php'; + show_box_bottom(); + break; default: // Rien a faire break; diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 6f03e296..e4aa43a2 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -82,16 +82,34 @@ class Catalog { } // _get_info /** + * format + * This makes the object human readable + */ + public function format() { + + $this->f_name = truncate_with_ellipsis($this->name,Config::get('ellipse_threshold_title')); + $this->f_name_link = '<a href="' . Config::get('web_path') . '/admin/catalog.php?action=show_customize_catalog&catalog_id=' . $this->id . '" title="' . scrub_out($this->name) . '">' . scrub_out($this->f_name) . '</a>'; + $this->f_path = truncate_with_ellipsis($this->path,Config::get('ellipse_threshold_title')); + $this->f_update = date('d/m/Y h:i',$this->last_update); + $this->f_add = date('d/m/Y h:i',$this->last_add); + + + } // format + + /** * get_catalogs - *Pull all the current catalogs + * Pull all the current catalogs and return an array of ids + * of what you find */ public static function get_catalogs() { $sql = "SELECT `id` FROM `catalog`"; $db_results = Dba::query($sql); - while ($r = Dba::fetch_assoc($db_results)) { - $results[] = new Catalog($r['id']); + $results = array(); + + while ($row = Dba::fetch_assoc($db_results)) { + $results[] = $row['id']; } return $results; diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php index 34447277..34447277 100755..100644 --- a/lib/class/vainfo.class.php +++ b/lib/class/vainfo.class.php diff --git a/modules/kajax/ajax.js b/modules/kajax/ajax.js index 1d6b57e8..1d6b57e8 100755..100644 --- a/modules/kajax/ajax.js +++ b/modules/kajax/ajax.js diff --git a/modules/xmlrpc/xmlrpc.inc b/modules/xmlrpc/xmlrpc.inc index 0c3702e9..0c3702e9 100755..100644 --- a/modules/xmlrpc/xmlrpc.inc +++ b/modules/xmlrpc/xmlrpc.inc diff --git a/modules/xmlrpc/xmlrpcs.inc b/modules/xmlrpc/xmlrpcs.inc index 661a1b4b..661a1b4b 100755..100644 --- a/modules/xmlrpc/xmlrpcs.inc +++ b/modules/xmlrpc/xmlrpcs.inc diff --git a/templates/show_catalog_row.inc.php b/templates/show_catalog_row.inc.php new file mode 100644 index 00000000..91310418 --- /dev/null +++ b/templates/show_catalog_row.inc.php @@ -0,0 +1,30 @@ +<?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. + +*/ +?> +<td><?php echo $catalog->f_name_link; ?></td> +<td><?php echo scrub_out($catalog->f_path); ?></td> +<td><?php echo scrub_out($catalog->f_update); ?></td> +<td><?php echo scrub_out($catalog->f_add); ?></td> +<td> + <a href="<?php echo $web_path; ?>/admin/catalog.php?action=add_to_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Add'); ?></a> + | <a href="<?php echo $web_path; ?>/admin/catalog.php?action=update_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Verify'); ?></a> + | <a href="<?php echo $web_path; ?>/admin/catalog.php?action=clean_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Clean'); ?></a> +</td> diff --git a/templates/show_catalogs.inc.php b/templates/show_catalogs.inc.php new file mode 100644 index 00000000..2df65eda --- /dev/null +++ b/templates/show_catalogs.inc.php @@ -0,0 +1,49 @@ +<?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. + +*/ +?> +<table class="tabledata" cellspacing="0" cellpadding="0"> +<tr> + <td colspan="5"> + <?php require Config::get('prefix') . '/templates/list_header.inc.php'; ?> + </td> +</tr> +<tr class="table-header"> + <th><?php echo _('Name'); ?></th> + <th><?php echo _('Path'); ?></th> + <th><?php echo _('Last Update'); ?></th> + <th><?php echo _('Last Add'); ?></th> + <th><?php echo _('Actions'); ?></th> +</tr> +<?php + foreach ($object_ids as $catalog_id) { + $catalog = new Catalog($catalog_id); + $catalog->format(); +?> +<tr class="<?php echo flip_class(); ?>" id="catalog_<?php echo $catalog->id; ?>"> + <?php require Config::get('prefix') . '/templates/show_catalog_row.inc.php'; ?> +</tr> +<?php } ?> +<tr> + <td colspan="5"> + <?php require Config::get('prefix') . '/templates/list_header.inc.php'; ?> + </td> +</tr> +</table> diff --git a/templates/sidebar_admin.inc.php b/templates/sidebar_admin.inc.php index e18260ad..4f952e0f 100644 --- a/templates/sidebar_admin.inc.php +++ b/templates/sidebar_admin.inc.php @@ -1,26 +1,7 @@ <ul class="sb2" id="sb_admin"> <li><h4><?php echo _('Catalogs'); ?></h4> <div class="sb3"><a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_add_catalog"><?php echo _('Add a Catalog'); ?></a></div> - </li> - <li> - <ul class="sb3" id="sb_admin_catalogs"> - <?php - $catalogs = Catalog::get_catalog_ids(); - foreach ($catalogs as $catalog_id) { - $catalog = new Catalog($catalog_id); - ?> - <li class="sb_admin_catalogs_ctrls"> - <strong><a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_customize_catalog"><?php echo $catalog->name; ?></a></strong> - <a href="<?php echo Config::get('web_path'); ?>/admin/catalog.php?action=show_delete_catalog&catalog_id=<?php echo $catalog->id; ?>"> - <?php echo get_user_icon('delete',_('Delete Catalog')); ?> - </a> - <br /> - <a href="<?php echo $web_path; ?>/admin/catalog.php?action=add_to_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Add'); ?></a> - | <a href="<?php echo $web_path; ?>/admin/catalog.php?action=update_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Verify'); ?></a> - | <a href="<?php echo $web_path; ?>/admin/catalog.php?action=clean_catalog&catalogs[]=<?php echo $catalog->id; ?>"><?php echo _('Clean'); ?></a> - </li> - <?php } // end foreach catalogs ?> - </ul> + <div class="sb3"><a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_catalogs"><?php echo _('Show Catalogs'); ?></a></div> </li> <li><h4><?php echo _('User Tools'); ?></h4> diff --git a/themes/classic/images/ampache-dark-bg.gif b/themes/classic/images/ampache-dark-bg.gif Binary files differdeleted file mode 100755 index e9fc72c9..00000000 --- a/themes/classic/images/ampache-dark-bg.gif +++ /dev/null diff --git a/themes/classic/images/ampache-light-bg.gif b/themes/classic/images/ampache-light-bg.gif Binary files differdeleted file mode 100755 index 262430b8..00000000 --- a/themes/classic/images/ampache-light-bg.gif +++ /dev/null diff --git a/themes/classic/images/ampache-mid.gif b/themes/classic/images/ampache-mid.gif Binary files differdeleted file mode 100755 index 57376ea4..00000000 --- a/themes/classic/images/ampache-mid.gif +++ /dev/null |