diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-04-08 05:58:05 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-04-08 05:58:05 +0000 |
commit | 2b55e30467f5ccdf9324b0377c419c5681f4c215 (patch) | |
tree | 16c2f63178ff762a673face6abb7fe584b680b36 /templates | |
parent | 941afedab85ffd77a83188ca09a888e0603fae72 (diff) | |
download | ampache-2b55e30467f5ccdf9324b0377c419c5681f4c215.tar.gz ampache-2b55e30467f5ccdf9324b0377c419c5681f4c215.tar.bz2 ampache-2b55e30467f5ccdf9324b0377c419c5681f4c215.zip |
This update includes a full rewrite of the Localplay code, only update
to this version if you don't care about losing a lot of functionality
while I am still finishing it up. Also the only working localplay
method is currently MPD. UPDATE AT YOUR OWN RISK!
Diffstat (limited to 'templates')
-rw-r--r-- | templates/footer.inc | 2 | ||||
-rw-r--r-- | templates/header.inc | 6 | ||||
-rw-r--r-- | templates/show_localplay_control.inc.php | 63 | ||||
-rw-r--r-- | templates/show_modules.inc.php | 55 | ||||
-rw-r--r-- | templates/show_preference_box.inc.php | 6 | ||||
-rw-r--r-- | templates/show_preferences.inc | 4 | ||||
-rw-r--r-- | templates/sidebar.inc.php | 24 |
7 files changed, 144 insertions, 16 deletions
diff --git a/templates/footer.inc b/templates/footer.inc index 91332b3f..fc9752cb 100644 --- a/templates/footer.inc +++ b/templates/footer.inc @@ -20,6 +20,8 @@ */ ?> +<!-- I really hate IE --> +</td></tr></table> </div> <!-- end id="content"--> </div> <!-- end id="maincontainer"--> </body> diff --git a/templates/header.inc b/templates/header.inc index 1277c4bc..b2839fec 100644 --- a/templates/header.inc +++ b/templates/header.inc @@ -38,6 +38,7 @@ if (conf('use_rss')) { ?> </head> <body> <script src="<?php echo $web_path; ?>/lib/general.js" language="javascript" type="text/javascript"></script> +<script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> <div id="maincontainer"> <div id="topbar"><!-- This is the topbar row --> <div id="topbarleft"> @@ -58,5 +59,10 @@ if (conf('use_rss')) { ?> </div><!-- End topbar --> <div id="sidebar"><!-- This is the sidebar --> <?php require_once(conf('prefix') . '/templates/sidebar.inc.php'); ?> + <?php if ($localplay = init_localplay()) { ?> + <?php require_once(conf('prefix') . '/templates/show_localplay_control.inc.php'); ?> + <?php } ?> </div><!-- End sidebar --> <div id="content"> +<!-- I hate IE... --> +<table><tr><td> diff --git a/templates/show_localplay_control.inc.php b/templates/show_localplay_control.inc.php new file mode 100644 index 00000000..db771110 --- /dev/null +++ b/templates/show_localplay_control.inc.php @@ -0,0 +1,63 @@ +<?php +/* + + Copyright (c) 2001 - 2006 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 + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + 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. + +*/ + +$web_path = conf('web_path'); +$data = $localplay->status(); + +$required_info = "&user_id=" . $GLOBALS['user']->id . "&sessid=" . session_id(); +$ajax_url = $web_path . '/server/ajax.server.php'; + +?> +<?php if ($localplay->has_function('prev')) { ?> +<span id="prev_button" onclick="ajaxPut('<?php echo $ajax_url; ?>','action=localplay&cmd=prev<?php echo $required_info; ?>','localplay_state');return true;"> + <img src="<?php echo $web_path; ?>/images/localplay/prev.gif"> +</span> +<?php } ?> +<span id="stop_button" onclick="ajaxPut('<?php echo $ajax_url; ?>','action=localplay&cmd=stop<?php echo $required_info; ?>','localplay_state');return true;"> + <img src="<?php echo $web_path; ?>/images/localplay/stop.gif"> +</span> +<?php if ($localplay->has_function('pause')) { ?> +<span id="pause_button" onclick="ajaxPut('<?php echo $ajax_url; ?>','action=localplay&cmd=pause<?php echo $requird_info; ?>','localplay_state');return true;"> + <img src="<?Php echo $web_path; ?>/images/localplay/pause.gif"> +</span> +<?php } ?> +<span id="play_button" onclick="ajaxPut('<?php echo $ajax_url; ?>','action=localplay&cmd=play<?php echo $required_info; ?>','localplay_state');return true;"> + <img src="<?php echo $web_path; ?>/images/localplay/play.gif"> +</span> +<?php if ($localplay->has_function('next')) { ?> +<span id="next_button" onclick="ajaxPut('<?php echo $ajax_url; ?>','action=localplay&cmd=next<?php echo $required_info; ?>','localplay_state');return true;"> + <img src="<?php echo $web_path; ?>/images/localplay/next.gif"> +</span> +<?php } ?> +<br /> +Current State:<span id="localplay_state"><?php echo $data['state']; ?></span><br /> +<span id="play_type"> +<?php if (conf('play_type') == 'localplay' AND strlen($_SESSION['data']['old_play_type'])) { ?> +<span style="text-decoration:underline;cursor:pointer;" onclick="ajaxPut('<?php echo $ajax_url; ?>','action=change_play_type&type=<?php echo $_SESSION['data']['old_play_type'] . $required_info; ?>','play_type');return true;"> + <?php echo ucfirst($_SESSION['data']['old_play_type']) . ' ' . _('Mode'); ?> +</span> +<?php } else { ?> +<span style="text-decoration:underline;cursor:pointer;" onclick="ajaxPut('<?php echo $ajax_url; ?>','action=change_play_type&type=localplay<?php echo $required_info; ?>','play_type');return true;"> + <?php echo _('Localplay Mode'); ?> +</span> +<?php } ?> +</span><br /> diff --git a/templates/show_modules.inc.php b/templates/show_modules.inc.php new file mode 100644 index 00000000..23c1d593 --- /dev/null +++ b/templates/show_modules.inc.php @@ -0,0 +1,55 @@ +<?php +/* + + Copyright (c) 2001 - 2006 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 + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + 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. + +*/ + +/** + * for now we only have the localplay modules so this is going to be centered on them + * however the idea would be as module support is added more and more are put on this + * same page + */ + +/* Get Localplay Modules */ +$localplay_modules = get_localplay_controllers(); +$web_path = conf('web_path'); +?> +<table class="text-box"> +<tr class="table-header"> + <th><?php echo _('Module Name'); ?></th> + <th><?php echo _('Action'); ?></th> +</tr> +<?php +foreach ($localplay_modules as $module) { + $action = _('Active'); + if (!verify_localplay_preferences($module)) { + $action = "<a href=\"" . $web_path . "/admin/modules.php?action=insert_localplay_preferences&type=" . $module . "\">" . + _('Activate') . "</a>"; + } +?> +<tr> + <td><?php echo scrub_out($module); ?></td> + <td><?php echo $action; ?></td> +</tr> +<?php } if (!count($localplay_modules)) { ?> +<tr> + <td colspan="2"><span class="error"><?php echo _('No Records Found'); ?></span></td> +</tr> +<?php } ?> +</table> diff --git a/templates/show_preference_box.inc.php b/templates/show_preference_box.inc.php index 4d2ffa67..f7298b05 100644 --- a/templates/show_preference_box.inc.php +++ b/templates/show_preference_box.inc.php @@ -40,10 +40,10 @@ if ($GLOBALS['user']->has_access(100) AND conf('use_auth')) { <th colspan="3" class="header2" align="left"><?php echo $preferences['title']; ?></th> </tr> <tr class="table-header"> - <th><?php echo _("Preference"); ?></th> - <th><?php echo _("Value"); ?></th> + <th><?php echo _('Preference'); ?></th> + <th><?php echo _('Value'); ?></th> <?php if ($show_apply_to_all) { ?> - <th><?php echo _("Apply to All"); ?></th> + <th><?php echo _('Apply to All'); ?></th> <?php } ?> </tr> <?php diff --git a/templates/show_preferences.inc b/templates/show_preferences.inc index 9a96248a..701cb488 100644 --- a/templates/show_preferences.inc +++ b/templates/show_preferences.inc @@ -48,7 +48,7 @@ if (($GLOBALS['user']->has_access(100)) AND ($user_id == '-1' AND conf('use_auth } ?> <span class="header1"> -<?php echo _("Editing"); ?> <?php echo $fullname; ?> <?php echo _("preferences"); ?> +<?php echo _("Editing"); ?> <?php echo $fullname; ?> <?php echo _('preferences'); ?> <?php if ($GLOBALS['user']->has_access(100)) { ?> [<a href="<?php echo conf('web_path'); ?>/admin/preferences.php?action=fix_preferences&user_id=<?php echo $user_id; ?>"><?php echo _("Rebuild Preferences"); ?></a>] <?php } ?> @@ -79,7 +79,7 @@ if (($GLOBALS['user']->has_access(100)) AND ($user_id == '-1' AND conf('use_auth <?php } ?> </ul> </div> -<div class="text-box" style="width:35em;"> +<div class="text-box" style="width:45em;"> <form method="post" name="preferences" action="<?php echo conf('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data"> <?php if ($current_tab != 'account') { diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php index e3117e4a..4d17dd31 100644 --- a/templates/sidebar.inc.php +++ b/templates/sidebar.inc.php @@ -26,11 +26,12 @@ * that have ['title'] ['url'] and ['active'] url assumes no conf('web_path') */ -$admin_items[] = array('title'=>_("Users"),'url'=>'admin/users.php','active'=>$location['page']); -$admin_items[] = array('title'=>_("Mail Users"),'url'=>'admin/mail.php','active'=>$location['page']); -$admin_items[] = array('title'=>_("Catalog"),'url'=>'admin/index.php','active'=>$location['page']); -$admin_items[] = array('title'=>_("Site Preferences"),'url'=>'admin/preferences.php','active'=>$location['page']); -$admin_items[] = array('title'=>_("Access List"),'url'=>'admin/access.php','active'=>$location['page']); +$admin_items[] = array('title'=>_('Users'),'url'=>'admin/users.php','active'=>$location['page']); +$admin_items[] = array('title'=>_('Mail Users'),'url'=>'admin/mail.php','active'=>$location['page']); +$admin_items[] = array('title'=>_('Catalog'),'url'=>'admin/index.php','active'=>$location['page']); +$admin_items[] = array('title'=>_('Site Preferences'),'url'=>'admin/preferences.php','active'=>$location['page']); +$admin_items[] = array('title'=>_('Access List'),'url'=>'admin/access.php','active'=>$location['page']); +$admin_items[] = array('title'=>_('Modules'),'url'=>'admin/modules.php','active'=>$location['page']); $browse_items[] = array('title'=>_("Albums"),'url'=>'albums.php','active'=>$location['page']); $browse_items[] = array('title'=>_("Artists"),'url'=>'artists.php','active'=>$location['page']); @@ -49,12 +50,13 @@ $web_path = conf('web_path'); </li> <?php if ($GLOBALS['user']->has_access(100)) { ?> <li<?php - if ($location['page'] == "admin/index.php" || - $location['page'] == "admin/users.php" || - $location['page'] == "admin/mail.php" || - $location['page'] == "admin/catalog.php" || - $location['page'] == "admin/preferences.php" || - $location['page'] == "admin/access.php" ){ + if ($location['page'] == 'admin/index.php' || + $location['page'] == 'admin/users.php' || + $location['page'] == 'admin/mail.php' || + $location['page'] == 'admin/catalog.php' || + $location['page'] == 'admin/preferences.php' || + $location['page'] == 'admin/modules.php' || + $location['page'] == 'admin/access.php' ){ echo " id=\"activetopmenu\" "; }?>> <a href="<?php echo $web_path; ?>/admin/index.php"><?php echo _("Admin"); ?></a> |