/**
  * format
  * This takes the current playlist object and gussies it up a little
  * bit so it is presentable to the users
  */
 public function format()
 {
     $this->f_name = $this->name;
     $this->f_type = $this->type == 'private' ? UI::get_icon('lock', T_('Private')) : '';
     $client = new User($this->user);
     $this->f_user = $client->fullname;
 }
 /**
  * format
  * This takes the current playlist object and gussies it up a little
  * bit so it is presentable to the users
  */
 public function format($details = true)
 {
     $this->f_name = $this->name;
     $this->f_type = $this->type == 'private' ? UI::get_icon('lock', T_('Private')) : '';
     if ($details) {
         $client = new User($this->user);
         $client->format();
         $this->f_user = $client->f_name;
     }
 }
Exemple #3
0
 /**
  * get_display
  * This dumps out some html and an icon for the type of rss that we specify
  * @param string $type
  * @param string $title
  * @param array|null $params
  * @return string
  */
 public static function get_display($type = 'now_playing', $title = '', $params = null)
 {
     // Default to now playing
     $type = self::validate_type($type);
     $strparams = "";
     if ($params != null && is_array($params)) {
         foreach ($params as $key => $value) {
             $strparams .= "&" . scrub_out($key) . "=" . scrub_out($value);
         }
     }
     $string = '<a rel="nohtml" href="' . AmpConfig::get('web_path') . '/rss.php?type=' . $type . $strparams . '">' . UI::get_icon('feed', T_('RSS Feed'));
     if (!empty($title)) {
         $string .= ' &nbsp;' . $title;
     }
     $string .= '</a>';
     return $string;
 }
            ?>
        <div id="equalizerbtn" class="action_button">
            <a href="javascript:ShowEqualizer();"><?php 
            echo UI::get_icon('equalizer', T_('Equalizer'));
            ?>
</a>
        </div>
        <div class="action_button">
            <a href="javascript:ShowVisualizer();"><?php 
            echo UI::get_icon('visualizer', T_('Visualizer'));
            ?>
</a>
        </div>
        <div class="action_button">
            <a onClick="ShowVisualizerFullScreen();" href="#"><?php 
            echo UI::get_icon('fullscreen', T_('Visualizer Full-Screen'));
            ?>
</a>
        </div>
<?php 
        }
    }
    ?>
      </div>
<?php 
}
?>
      <div class="jp-playlist" style="position: absolute;">
          <ul>
              <li></li>
          </ul>
Exemple #5
0
    ?>
">
        <?php 
    echo $client->f_useage;
    ?>
        <?php 
    if (AmpConfig::get('statistical_graphs')) {
        ?>
            <a href="<?php 
        echo AmpConfig::get('web_path');
        ?>
/stats.php?action=graph&user_id=<?php 
        echo $client->id;
        ?>
"><?php 
        echo UI::get_icon('statistics', T_('Graphs'));
        ?>
</a>
        <?php 
    }
    ?>
    </dd>
    <?php 
}
?>
    <?php 
$rowparity = UI::flip_class();
?>
    <dt class="<?php 
echo $rowparity;
?>
Exemple #6
0
 public function show_action_buttons()
 {
     if ($this->id) {
         if ($GLOBALS['user']->has_access('75')) {
             echo Ajax::button('?page=index&action=start_channel&id=' . $this->id, 'run', T_('Start Channel'), 'channel_start_' . $this->id);
             echo " " . Ajax::button('?page=index&action=stop_channel&id=' . $this->id, 'stop', T_('Stop Channel'), 'channel_stop_' . $this->id);
             echo " <a id=\"edit_channel_ " . $this->id . "\" onclick=\"showEditDialog('channel_row', '" . $this->id . "', 'edit_channel_" . $this->id . "', '" . T_('Channel edit') . "', 'channel_row_', 'refresh_channel')\">" . UI::get_icon('edit', T_('Edit')) . "</a>";
             echo " <a href=\"" . AmpConfig::get('web_path') . "/channel.php?action=show_delete&id=" . $this->id . "\">" . UI::get_icon('delete', T_('Delete')) . "</a>";
         }
     }
 }
Exemple #7
0
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
$thcount = 5;
?>
<div id="information_actions">
    <ul>
        <?php 
if (Access::check('interface', 75)) {
    ?>
        <li>
            <a href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/podcast.php?action=show_create"><?php 
    echo UI::get_icon('add', T_('Add'));
    ?>
 <?php 
    echo T_('Subscribe Podcast');
    ?>
</a>
        </li>
        <?php 
}
?>
    </ul>
</div>
<?php 
if ($browse->get_show_header()) {
    require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php');
}
Exemple #8
0
if ($logic_operator == 'or') {
    echo 'selected="selected"';
}
?>
><?php 
echo T_('any rule');
?>
</option>
                </select>
        </td>
        </tr>
    <tr id="rules_addrowbutton">
    <td>
        <a id="addrowbutton" href="javascript:void(0)">
            <?php 
echo UI::get_icon('add');
?>
        <?php 
echo T_('Add Another Rule');
?>
        </a>
        <script type="text/javascript">$('#addrowbutton').on('click', SearchRow.add);</script>
    </td>
    </tr>
</tbody>
</table>
<?php 
UI::show_box_bottom();
?>

<?php 
Exemple #9
0
" />
            </td>
        </tr>
        <tr>
            <td>
                <?php 
echo T_('API Key');
?>
                <a href="<?php 
echo AmpConfig::get('web_path');
?>
/admin/users.php?action=show_generate_apikey&user_id=<?php 
echo $client->id;
?>
"><?php 
echo UI::get_icon('random', T_('Generate new API Key'));
?>
</a>
            </td>
            <td>
                <span>
                    <?php 
if ($client->apikey) {
    $urlinfo = parse_url(AmpConfig::get('web_path'));
    $apikey_qrcode = "ampache://" . $client->apikey . "@" . $urlinfo['host'];
    if ($urlinfo['port'] && $urlinfo['port'] != 80) {
        $apikey_qrcode .= ":" . $urlinfo['port'];
    }
    $apikey_qrcode .= $urlinfo['path'];
    if ($urlinfo['scheme'] == "https" || AmpConfig::get('force_ssl')) {
        $apikey_qrcode .= "#ssl=true";
_id=<?php 
        echo $libitem->id;
        ?>
">
        <?php 
        echo UI::get_icon('download', T_('Download'));
        ?>
    </a>
    <?php 
    }
    if (Access::check('interface', '25')) {
        if (AmpConfig::get('share')) {
            Share::display_ui($object_type, $libitem->id, false);
        }
    }
    if (get_class($playlist) == "Playlist" && $playlist->has_access()) {
        echo Ajax::button('?page=playlist&action=delete_track&playlist_id=' . $playlist->id . '&track_id=' . $object['track_id'], 'delete', T_('Delete'), 'track_del_' . $object['track_id']);
    }
    ?>
</td>
<?php 
    if (Access::check('interface', '50') && get_class($playlist) == "Playlist") {
        ?>
<td class="cel_drag">
    <?php 
        echo UI::get_icon('drag', T_('Reorder'));
        ?>
        </td>
    <?php 
    }
}
    echo T_('Cooldown');
    ?>
:<?php 
    echo $democratic->f_cooldown;
    ?>
</li>
<?php 
}
if (Access::check('interface', '75')) {
    ?>
<li>
    <a href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/democratic.php?action=manage"><?php 
    echo UI::get_icon('server_lightning', T_('Configure Democratic Playlist'));
    ?>
    &nbsp;
    <?php 
    echo T_('Configure Democratic Playlist');
    ?>
</a>
</li>
<?php 
    if ($democratic->is_enabled()) {
        ?>
<li>
    <?php 
        echo Ajax::button('?page=democratic&action=send_playlist&democratic_id=' . $democratic->id, 'all', T_('Play'), 'play_democratic');
        ?>
    <?php 
Exemple #12
0
 /**
  * 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 = '', $class = '', $confirm = '')
 {
     // Get the correct action
     $ajax_string = self::action($action, $source, $post);
     // If they passed a span class
     if ($class) {
         $class = ' class="' . $class . '"';
     }
     $string = UI::get_icon($icon, $alt);
     // Generate an <a> so that it's more compliant with older
     // browsers (ie :hover actions) and also to unify linkbuttons
     // (w/o ajax) display
     $string = "<a href=\"javascript:void(0);\" id=\"{$source}\" {$class}>" . $string . "</a>\n";
     $string .= self::observe($source, 'click', $ajax_string, $confirm);
     return $string;
 }
Exemple #13
0
:</h3>

    <ul>
        <li>
            <a id="<?php 
echo 'reply_pvmsg_' . $label->id;
?>
" href="<?php 
echo AmpConfig::get('web_path');
?>
/pvmsg.php?action=show_add_message&reply_to=<?php 
echo $pvmsg->id;
?>
">
                <?php 
echo UI::get_icon('mail', T_('Reply'));
?>
 <?php 
echo T_('Reply');
?>
            </a>
        </li>
    </ul>
</div>

<hr />
<div>
    <?php 
echo nl2br($pvmsg->f_message);
?>
</div>
    foreach ($fields as $key => $field) {
        ?>
    <td><?php 
        echo $instance[$key];
        ?>
</td>
    <?php 
    }
    ?>
    <td>
        <a href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/localplay.php?action=edit_instance&instance=<?php 
    echo $uid;
    ?>
"><?php 
    echo UI::get_icon('edit', T_('Edit Instance'));
    ?>
</a>
        <?php 
    echo Ajax::button('?page=localplay&action=delete_instance&instance=' . $uid, 'delete', T_('Delete'), 'delete_instance_' . $uid);
    ?>
    </td>
</tr>
<?php 
}
?>
</table>
<?php 
UI::show_box_bottom();
Exemple #15
0
 * 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.
 *
 */
$embed = $_REQUEST['embed'];
$is_share = true;
$playlist = $share->create_fake_playlist();
require AmpConfig::get('prefix') . '/templates/show_web_player.inc.php';
if (empty($embed)) {
    echo "<a href='" . $share->public_url . "'>" . T_('Shared by') . ' ' . $share->f_user . "</a><br />";
    if ($share->allow_download) {
        echo "<a href=\"" . AmpConfig::get('web_path') . "/share.php?action=download&id=" . $share->id . "&secret=" . $share->secret . "\">" . UI::get_icon('download', T_('Download')) . "</a> ";
        echo "<a href=\"" . AmpConfig::get('web_path') . "/share.php?action=download&id=" . $share->id . "&secret=" . $share->secret . "\">" . T_('Download') . "</a>";
    }
}
if (!empty($embed)) {
    UI::show_box_bottom();
} else {
    ?>
</body>
</html>
<?php 
}
Exemple #16
0
/**
 * create_preference_input
 * takes the key and then creates the correct type of input for updating it
 */
function create_preference_input($name, $value)
{
    if (!Preference::has_access($name)) {
        if ($value == '1') {
            echo "Enabled";
        } elseif ($value == '0') {
            echo "Disabled";
        } else {
            if (preg_match('/_pass$/', $name) || preg_match('/_api_key$/', $name)) {
                echo "******";
            } else {
                echo $value;
            }
        }
        return;
    }
    // if we don't have access to it
    switch ($name) {
        case 'display_menu':
        case 'download':
        case 'quarantine':
        case 'upload':
        case 'access_list':
        case 'lock_songs':
        case 'xml_rpc':
        case 'force_http_play':
        case 'no_symlinks':
        case 'use_auth':
        case 'access_control':
        case 'allow_stream_playback':
        case 'allow_democratic_playback':
        case 'allow_localplay_playback':
        case 'demo_mode':
        case 'condPL':
        case 'rio_track_stats':
        case 'rio_global_stats':
        case 'direct_link':
        case 'ajax_load':
        case 'now_playing_per_user':
        case 'show_played_times':
        case 'song_page_title':
        case 'subsonic_backend':
        case 'plex_backend':
        case 'webplayer_flash':
        case 'webplayer_html5':
        case 'allow_personal_info_now':
        case 'allow_personal_info_recent':
        case 'allow_personal_info_time':
        case 'allow_personal_info_agent':
        case 'ui_fixed':
        case 'autoupdate':
        case 'webplayer_confirmclose':
        case 'webplayer_pausetabs':
        case 'stream_beautiful_url':
        case 'share':
        case 'share_social':
        case 'broadcast_by_default':
        case 'album_group':
        case 'topmenu':
        case 'demo_clear_sessions':
        case 'show_donate':
        case 'allow_upload':
        case 'upload_subdir':
        case 'upload_user_artist':
        case 'upload_allow_edit':
        case 'daap_backend':
        case 'upnp_backend':
        case 'album_release_type':
        case 'home_moment_albums':
        case 'home_moment_videos':
        case 'home_recently_played':
        case 'home_now_playing':
        case 'browser_notify':
        case 'allow_video':
        case 'geolocation':
        case 'webplayer_aurora':
        case 'upload_allow_remove':
        case 'webdav_backend':
        case 'notify_email':
            $is_true = '';
            $is_false = '';
            if ($value == '1') {
                $is_true = "selected=\"selected\"";
            } else {
                $is_false = "selected=\"selected\"";
            }
            echo "<select name=\"{$name}\">\n";
            echo "\t<option value=\"1\" {$is_true}>" . T_("Enable") . "</option>\n";
            echo "\t<option value=\"0\" {$is_false}>" . T_("Disable") . "</option>\n";
            echo "</select>\n";
            break;
        case 'upload_catalog':
            show_catalog_select('upload_catalog', $value, '', true);
            break;
        case 'play_type':
            $is_localplay = '';
            $is_democratic = '';
            $is_web_player = '';
            $is_stream = '';
            if ($value == 'localplay') {
                $is_localplay = 'selected="selected"';
            } elseif ($value == 'democratic') {
                $is_democratic = 'selected="selected"';
            } elseif ($value == 'web_player') {
                $is_web_player = 'selected="selected"';
            } else {
                $is_stream = "selected=\"selected\"";
            }
            echo "<select name=\"{$name}\">\n";
            echo "\t<option value=\"\">" . T_('None') . "</option>\n";
            if (AmpConfig::get('allow_stream_playback')) {
                echo "\t<option value=\"stream\" {$is_stream}>" . T_('Stream') . "</option>\n";
            }
            if (AmpConfig::get('allow_democratic_playback')) {
                echo "\t<option value=\"democratic\" {$is_democratic}>" . T_('Democratic') . "</option>\n";
            }
            if (AmpConfig::get('allow_localplay_playback')) {
                echo "\t<option value=\"localplay\" {$is_localplay}>" . T_('Localplay') . "</option>\n";
            }
            echo "\t<option value=\"web_player\" {$is_web_player}>" . _('Web Player') . "</option>\n";
            echo "</select>\n";
            break;
        case 'playlist_type':
            $var_name = $value . "_type";
            ${$var_name} = "selected=\"selected\"";
            echo "<select name=\"{$name}\">\n";
            echo "\t<option value=\"m3u\" {$m3u_type}>" . T_('M3U') . "</option>\n";
            echo "\t<option value=\"simple_m3u\" {$simple_m3u_type}>" . T_('Simple M3U') . "</option>\n";
            echo "\t<option value=\"pls\" {$pls_type}>" . T_('PLS') . "</option>\n";
            echo "\t<option value=\"asx\" {$asx_type}>" . T_('Asx') . "</option>\n";
            echo "\t<option value=\"ram\" {$ram_type}>" . T_('RAM') . "</option>\n";
            echo "\t<option value=\"xspf\" {$xspf_type}>" . T_('XSPF') . "</option>\n";
            echo "</select>\n";
            break;
        case 'lang':
            $languages = get_languages();
            echo '<select name="' . $name . '">' . "\n";
            foreach ($languages as $lang => $name) {
                $selected = $lang == $value ? 'selected="selected"' : '';
                echo "\t<option value=\"{$lang}\" " . $selected . ">{$name}</option>\n";
            }
            // end foreach
            echo "</select>\n";
            break;
        case 'localplay_controller':
            $controllers = Localplay::get_controllers();
            echo "<select name=\"{$name}\">\n";
            echo "\t<option value=\"\">" . T_('None') . "</option>\n";
            foreach ($controllers as $controller) {
                if (!Localplay::is_enabled($controller)) {
                    continue;
                }
                $is_selected = '';
                if ($value == $controller) {
                    $is_selected = 'selected="selected"';
                }
                echo "\t<option value=\"" . $controller . "\" {$is_selected}>" . ucfirst($controller) . "</option>\n";
            }
            // end foreach
            echo "</select>\n";
            break;
        case 'localplay_level':
            $is_user = '';
            $is_admin = '';
            $is_manager = '';
            if ($value == '25') {
                $is_user = '******';
            } elseif ($value == '100') {
                $is_admin = 'selected="selected"';
            } elseif ($value == '50') {
                $is_manager = 'selected="selected"';
            }
            echo "<select name=\"{$name}\">\n";
            echo "<option value=\"0\">" . T_('Disabled') . "</option>\n";
            echo "<option value=\"25\" {$is_user}>" . T_('User') . "</option>\n";
            echo "<option value=\"50\" {$is_manager}>" . T_('Manager') . "</option>\n";
            echo "<option value=\"100\" {$is_admin}>" . T_('Admin') . "</option>\n";
            echo "</select>\n";
            break;
        case 'theme_name':
            $themes = get_themes();
            echo "<select name=\"{$name}\">\n";
            foreach ($themes as $theme) {
                $is_selected = "";
                if ($value == $theme['path']) {
                    $is_selected = "selected=\"selected\"";
                }
                echo "\t<option value=\"" . $theme['path'] . "\" {$is_selected}>" . $theme['name'] . "</option>\n";
            }
            // foreach themes
            echo "</select>\n";
            break;
        case 'theme_color':
            // This include a two-step configuration (first change theme and save, then change theme color and save)
            $theme_cfg = get_theme(AmpConfig::get('theme_name'));
            if ($theme_cfg !== null) {
                echo "<select name=\"{$name}\">\n";
                foreach ($theme_cfg['colors'] as $color) {
                    $is_selected = "";
                    if ($value == strtolower($color)) {
                        $is_selected = "selected=\"selected\"";
                    }
                    echo "\t<option value=\"" . strtolower($color) . "\" {$is_selected}>" . $color . "</option>\n";
                }
                // foreach themes
                echo "</select>\n";
            }
            break;
        case 'playlist_method':
            ${$value} = ' selected="selected"';
            echo "<select name=\"{$name}\">\n";
            echo "\t<option value=\"send\"{$send}>" . T_('Send on Add') . "</option>\n";
            echo "\t<option value=\"send_clear\"{$send_clear}>" . T_('Send and Clear on Add') . "</option>\n";
            echo "\t<option value=\"clear\"{$clear}>" . T_('Clear on Send') . "</option>\n";
            echo "\t<option value=\"default\"{$default}>" . T_('Default') . "</option>\n";
            echo "</select>\n";
            break;
        case 'transcode':
            ${$value} = ' selected="selected"';
            echo "<select name=\"{$name}\">\n";
            echo "\t<option value=\"never\"{$never}>" . T_('Never') . "</option>\n";
            echo "\t<option value=\"default\"{$default}>" . T_('Default') . "</option>\n";
            echo "\t<option value=\"always\"{$always}>" . T_('Always') . "</option>\n";
            echo "</select>\n";
            break;
        case 'show_lyrics':
            $is_true = '';
            $is_false = '';
            if ($value == '1') {
                $is_true = "selected=\"selected\"";
            } else {
                $is_false = "selected=\"selected\"";
            }
            echo "<select name=\"{$name}\">\n";
            echo "\t<option value=\"1\" {$is_true}>" . T_("Enable") . "</option>\n";
            echo "\t<option value=\"0\" {$is_false}>" . T_("Disable") . "</option>\n";
            echo "</select>\n";
            break;
        case 'album_sort':
            $is_sort_year_asc = '';
            $is_sort_year_desc = '';
            $is_sort_name_asc = '';
            $is_sort_name_desc = '';
            $is_sort_default = '';
            if ($value == 'year_asc') {
                $is_sort_year_asc = 'selected="selected"';
            } elseif ($value == 'year_desc') {
                $is_sort_year_desc = 'selected="selected"';
            } elseif ($value == 'name_asc') {
                $is_sort_name_asc = 'selected="selected"';
            } elseif ($value == 'name_desc') {
                $is_sort_name_desc = 'selected="selected"';
            } else {
                $is_sort_default = 'selected="selected"';
            }
            echo "<select name=\"{$name}\">\n";
            echo "\t<option value=\"default\" {$is_sort_default}>" . T_('Default') . "</option>\n";
            echo "\t<option value=\"year_asc\" {$is_sort_year_asc}>" . T_('Year ascending') . "</option>\n";
            echo "\t<option value=\"year_desc\" {$is_sort_year_desc}>" . T_('Year descending') . "</option>\n";
            echo "\t<option value=\"name_asc\" {$is_sort_name_asc}>" . T_('Name ascending') . "</option>\n";
            echo "\t<option value=\"name_desc\" {$is_sort_name_desc}>" . T_('Name descending') . "</option>\n";
            echo "</select>\n";
            break;
        case 'disabled_custom_metadata_fields':
            $ids = explode(',', $value);
            $options = array();
            $fieldRepository = new \Lib\Metadata\Repository\MetadataField();
            foreach ($fieldRepository->findAll() as $field) {
                $selected = in_array($field->getId(), $ids) ? ' selected="selected"' : '';
                $options[] = '<option value="' . $field->getId() . '"' . $selected . '>' . $field->getName() . '</option>';
            }
            echo '<select multiple size="5" name="' . $name . '[]">' . implode("\n", $options) . '</select>';
            break;
        case 'lastfm_grant_link':
        case 'librefm_grant_link':
            // construct links for granting access Ampache application to Last.fm and Libre.fm
            $plugin_name = ucfirst(str_replace('_grant_link', '', $name));
            $plugin = new Plugin($plugin_name);
            $url = $plugin->_plugin->url;
            $api_key = rawurlencode(AmpConfig::get('lastfm_api_key'));
            $callback = rawurlencode(AmpConfig::get('web_path') . '/preferences.php?tab=plugins&action=grant&plugin=' . $plugin_name);
            echo "<a href='{$url}/api/auth/?api_key={$api_key}&cb={$callback}'>" . UI::get_icon('plugin', T_("Click for grant Ampache to ") . $plugin_name) . '</a>';
            break;
        default:
            if (preg_match('/_pass$/', $name)) {
                echo '<input type="password" name="' . $name . '" value="******" />';
            } else {
                echo '<input type="text" name="' . $name . '" value="' . $value . '" />';
            }
            break;
    }
}
        </div>
        <div class="action_button">
            <a href="javascript:ShowVisualizer();"><?php 
            echo UI::get_icon('visualizer', T_('Visualizer'));
            ?>
</a>
        </div>
        <div class="action_button">
            <a onClick="ShowVisualizerFullScreen();" href="#"><?php 
            echo UI::get_icon('fullscreen', T_('Visualizer Full-Screen'));
            ?>
</a>
        </div>
        <div id="replaygainbtn" class="action_button">
            <a href="javascript:ToggleReplayGain();"><?php 
            echo UI::get_icon('replaygain', T_('ReplayGain'));
            ?>
</a>
        </div>
<?php 
        }
    }
    ?>
      </div>
<?php 
}
?>
      <div class="jp-playlist" style="position: absolute;">
          <ul>
              <li></li>
          </ul>
Exemple #18
0
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
require_once '../init.php';
function arrayToJSON($array)
{
    $json = '{ ';
    foreach ($array as $key => $value) {
        $json .= '"' . $key . '" : ';
        if (is_array($value)) {
            $json .= arrayToJSON($value);
        } else {
            // Make sure to strip backslashes and convert things to
            // entities in our output
            $json .= '"' . scrub_out(str_replace('\\', '', $value)) . '"';
        }
        $json .= ' , ';
    }
    $json = rtrim($json, ', ');
    return $json . ' }';
}
Header('content-type: application/x-javascript');
$search = new Search(null, $_REQUEST['type']);
echo 'var types = ';
echo arrayToJSON($search->types) . ";\n";
echo 'var basetypes = ';
echo arrayToJSON($search->basetypes) . ";\n";
echo 'removeIcon = \'<a href="javascript: void(0)">' . UI::get_icon('disable', T_('Remove')) . '</a>\';';
Exemple #19
0
 public function get_display($details = true, $jsbuttons = false)
 {
     $object = Shoutbox::get_object($this->object_type, $this->object_id);
     $object->format();
     $img = $this->get_image();
     $html = "<div class='shoutbox-item'>";
     $html .= "<div class='shoutbox-data'>";
     if ($details && $img) {
         $html .= "<div class='shoutbox-img'>" . $img . "</div>";
     }
     $html .= "<div class='shoutbox-info'>";
     if ($details) {
         $html .= "<div class='shoutbox-object'>" . $object->f_link . "</div>";
         $html .= "<div class='shoutbox-date'>" . date("Y/m/d H:i:s", $this->date) . "</div>";
     }
     $html .= "<div class='shoutbox-text'>" . $this->f_text . "</div>";
     $html .= "</div>";
     $html .= "</div>";
     $html .= "<div class='shoutbox-footer'>";
     if ($details) {
         $html .= "<div class='shoutbox-actions'>";
         if ($jsbuttons) {
             $html .= Ajax::button('?page=stream&action=directplay&playtype=' . $this->object_type . '&' . $this->object_type . '_id=' . $this->object_id, 'play', T_('Play'), 'play_' . $this->object_type . '_' . $this->object_id);
             $html .= Ajax::button('?action=basket&type=' . $this->object_type . '&id=' . $this->object_id, 'add', T_('Add'), 'add_' . $this->object_type . '_' . $this->object_id);
         }
         if (Access::check('interface', '25')) {
             $html .= "<a href=\"" . AmpConfig::get('web_path') . "/shout.php?action=show_add_shout&type=" . $this->object_type . "&id=" . $this->object_id . "\">" . UI::get_icon('comment', T_('Post Shout')) . "</a>";
         }
         $html .= "</div>";
     }
     $html .= "<div class='shoutbox-user'>" . T_('by') . " ";
     if ($this->user > 0) {
         $user = new User($this->user);
         $user->format();
         if ($details) {
             $html .= $user->f_link;
         } else {
             $html .= $user->username;
         }
     } else {
         $html .= T_('Guest');
     }
     $html .= "</div>";
     $html .= "</div>";
     $html .= "</div>";
     return $html;
 }
            <?php 
    echo scrub_out($row_user->fullname);
    ?>
            </a>
        </td>
        <td class="cel_lastplayed"><?php 
    echo $time_string;
    ?>
</td>
        <?php 
    if (Access::check('interface', 50)) {
        ?>
        <td class="cel_agent">
            <?php 
        if (!empty($agent)) {
            echo UI::get_icon('info', $agent);
        }
        ?>
        </td>
        <?php 
    }
    ?>
    </tr>
<?php 
    ++$nb;
}
if (!count($data)) {
    ?>
    <tr>
        <td colspan="8"><span class="nodata"><?php 
    echo T_('No recently item found');
Exemple #21
0
 /**
  * Get broadcast link.
  * @return string
  */
 public static function get_broadcast_link()
 {
     $link = "<div class=\"broadcast-action\">";
     $link .= "<a href=\"#\" onclick=\"showBroadcastsDialog(event);\">" . UI::get_icon('broadcast', T_('Broadcast')) . "</a>";
     $link .= "</div>";
     return $link;
 }
', '<?php 
    echo T_('Season edit');
    ?>
', 'tvshow_season_')">
        <?php 
    echo UI::get_icon('edit', T_('Edit'));
    ?>
    </a>
    <?php 
}
if (Catalog::can_remove($libitem)) {
    ?>
    <a id="<?php 
    echo 'delete_tvshow_season_' . $libitem->id;
    ?>
" href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/tvshow_seasons.php?action=delete&tvshow_season_id=<?php 
    echo $libitem->id;
    ?>
">
        <?php 
    echo UI::get_icon('delete', T_('Delete'));
    ?>
    </a>
    <?php 
}
?>
</td>
Exemple #23
0
echo AmpConfig::get('web_path');
?>
/admin/system.php?action=generate_config"><?php 
echo UI::get_icon('cog', T_('Generate Configuration'));
?>
</a>
    <?php 
echo T_('Generate Configuration');
?>
</li>
<li>
    <a href="<?php 
echo AmpConfig::get('web_path');
?>
/admin/system.php?action=reset_db_charset"><?php 
echo UI::get_icon('server_lightning', T_('Set Database Charset'));
?>
</a>
    <?php 
echo T_('Set Database Charset');
?>
</li>
</ul>
</div>
<?php 
UI::show_box_bottom();
UI::show_box_top(T_('PHP Settings'), 'box box_php_settings');
?>
<table class="tabledata" cellpadding="0" cellspacing="0">
<colgroup>
    <col id="col_php_setting">
Exemple #24
0
        echo Ajax::button("?page=index&action=sidebar&button=" . $item['id'], $item['icon'], $item['title'], 'sidebar_' . $item['id']);
        if ($item['id'] == $_SESSION['state']['sidebar_tab']) {
            ?>
        <div id="sidebar-page" class="sidebar-page-<?php 
            echo AmpConfig::get('ui_fixed') ? 'fixed' : 'float';
            ?>
">
            <?php 
            require_once AmpConfig::get('prefix') . '/templates/sidebar_' . $_SESSION['state']['sidebar_tab'] . '.inc.php';
            ?>
        </div>
<?php 
        }
        ?>
    </li>
<?php 
    }
}
?>
    <li id="sb_tab_logout" class="sb1">
        <a target="_top" href="<?php 
echo AmpConfig::get('web_path');
?>
/logout.php" id="sidebar_logout" >
        <?php 
echo UI::get_icon('logout', T_('Logout'));
?>
        </a>
    </li>
</ul>
<td class="cel_startdate"><?php 
echo date("c", $libitem->start_date);
?>
</td>
<td class="cel_listeners"><?php 
echo $libitem->listeners;
?>
</td>
<td class="cel_streamurl">
    <?php 
echo $libitem->get_stream_url();
?>
<br />
    <?php 
if ($libitem->is_private) {
    echo UI::get_icon('lock', T_('Authentication Required'));
}
?>
    <?php 
echo $libitem->get_stream_proxy_url();
?>
</td>
<td class="cel_state"><div id="channel_state_<?php 
echo $libitem->id;
?>
"><?php 
echo $libitem->get_channel_state();
?>
</div></td>
<td class="cel_action"><?php 
$libitem->show_action_buttons();
Exemple #26
0
    <?php 
if ($playlist->has_access()) {
    ?>
        <li>
            <a href="javascript:NavigateTo('<?php 
    echo AmpConfig::get('web_path');
    ?>
/playlist.php?action=delete_playlist&playlist_id=<?php 
    echo $playlist->id;
    ?>
');" onclick="return confirm('<?php 
    echo T_('Do you really want to delete the playlist?');
    ?>
');">
                <?php 
    echo UI::get_icon('delete');
    ?>
                &nbsp;&nbsp;<?php 
    echo T_('Delete');
    ?>
            </a>
        </li>
    <?php 
}
?>
    </ul>
</div>
<?php 
UI::show_box_bottom();
?>
<div id='reordered_list_<?php 
Exemple #27
0
 /**
  * Display an item art.
  * @param string $object_type
  * @param int $object_id
  * @param string $name
  * @param int $thumb
  * @param string $link
  * @param boolean $show_default
  * @param string $kind
  * @return boolean
  */
 public static function display($object_type, $object_id, $name, $thumb, $link = null, $show_default = true, $kind = 'default')
 {
     if (!Core::is_library_item($object_type)) {
         return false;
     }
     if (!$show_default) {
         // Don't show any image if not available
         if (!self::has_db($object_id, $object_type, $kind)) {
             return false;
         }
     }
     $size = self::get_thumb_size($thumb);
     $prettyPhoto = $link == null;
     if ($link == null) {
         $link = AmpConfig::get('web_path') . "/image.php?object_id=" . $object_id . "&object_type=" . $object_type;
         if (AmpConfig::get('use_auth') && AmpConfig::get('require_session')) {
             $link .= "&auth=" . session_id();
         }
         if ($kind != 'default') {
             $link .= '&kind=' . $kind;
         }
     }
     echo "<div class=\"item_art\">";
     echo "<a href=\"" . $link . "\" title=\"" . $name . "\"";
     if ($prettyPhoto) {
         echo " rel=\"prettyPhoto\"";
     }
     echo ">";
     $imgurl = AmpConfig::get('web_path') . "/image.php?object_id=" . $object_id . "&object_type=" . $object_type . "&thumb=" . $thumb;
     if ($kind != 'default') {
         $imgurl .= '&kind=' . $kind;
     }
     echo "<img src=\"" . $imgurl . "\" alt=\"" . $name . "\" height=\"" . $size['height'] . "\" width=\"" . $size['width'] . "\" />";
     if ($prettyPhoto) {
         if ($size['width'] >= 150) {
             echo "<div class=\"item_art_play\">";
             echo Ajax::text('?page=stream&action=directplay&object_type=' . $object_type . '&object_id=' . $object_id . '\' + getPagePlaySettings() + \'', '<span class="item_art_play_icon" title="' . T_('Play') . '" />', 'directplay_art_' . $object_type . '_' . $object_id);
             echo "</div>";
         }
         $libitem = new $object_type($object_id);
         echo "<div class=\"item_art_actions\">";
         if ($GLOBALS['user']->has_access(50) || $GLOBALS['user']->has_access(25) && $GLOBALS['user']->id == $libitem->get_user_owner()) {
             echo "<a href=\"javascript:NavigateTo('" . AmpConfig::get('web_path') . "/arts.php?action=find_art&object_type=" . $object_type . "&object_id=" . $object_id . "&burl=' + getCurrentPage());\">";
             echo UI::get_icon('edit', T_('Edit/Find Art'));
             echo "</a>";
             echo "<a href=\"javascript:NavigateTo('" . AmpConfig::get('web_path') . "/arts.php?action=clear_art&object_type=" . $object_type . "&object_id=" . $object_id . "&burl=' + getCurrentPage());\" onclick=\"return confirm('" . T_('Do you really want to reset art?') . "');\">";
             echo UI::get_icon('delete', T_('Reset Art'));
             echo "</a>";
         }
         echo "</div>";
     }
     echo "</a>\n";
     echo "</div>";
     return true;
 }
Exemple #28
0
 * 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
UI::show_box_top(T_('Share'));
?>
<div id="information_actions">
    <ul>
        <li>
            <a href="<?php 
echo AmpConfig::get('web_path');
?>
/share.php?action=clean"><?php 
echo UI::get_icon('clean', T_('Clean'));
?>
 <?php 
echo T_('Clean expired shared objects');
?>
</a>
        </li>
    </ul>
</div>

<?php 
require_once AmpConfig::get('prefix') . UI::find_template('show_stats_share.inc.php');
UI::show_box_bottom();
">
            <?php 
    echo UI::get_icon('batch_download', '', T_('Batch Download'));
    ?>
        </a>
<?php 
}
if (Access::check('interface', '50')) {
    ?>
    <a id="<?php 
    echo 'edit_artist_' . $artist->id;
    ?>
" onclick="showEditDialog('artist_row', '<?php 
    echo $artist->id;
    ?>
', '<?php 
    echo 'edit_artist_' . $artist->id;
    ?>
', '<?php 
    echo T_('Artist edit');
    ?>
', 'artist_', 'refresh_artist')">
        <?php 
    echo UI::get_icon('edit', T_('Edit'));
    ?>
    </a>
<?php 
}
?>
</td>
Exemple #30
0
 public static function display_ui_links($object_type, $object_id)
 {
     echo "<ul>";
     echo "<li><a onclick=\"handleShareAction('" . AmpConfig::get('web_path') . "/share.php?action=show_create&type=" . $object_type . "&id=" . $object_id . "')\">" . UI::get_icon('share', T_('Advanced Share')) . " &nbsp;" . T_('Advanced Share') . "</a></li>";
     if (AmpConfig::get('download')) {
         $dllink = "";
         if ($object_type == "song" || $object_type == "video") {
             $dllink = AmpConfig::get('web_path') . "/play/index.php?action=download&type=" . $object_type . "&oid=" . $object_id . "&uid=-1";
         } else {
             if (Access::check_function('batch_download') && check_can_zip($object_type)) {
                 $dllink = AmpConfig::get('web_path') . "/batch.php?action=" . $object_type . "&id=" . $object_id;
             }
         }
         if (!empty($dllink)) {
             if (AmpConfig::get('require_session')) {
                 // Add session information to the link to avoid authentication
                 $dllink .= "&ssid=" . Stream::get_session();
             }
             echo "<li><a rel=\"nohtml\" href=\"" . $dllink . "\">" . UI::get_icon('download', T_('Temporary direct link')) . " &nbsp;" . T_('Temporary direct link') . "</a></li>";
         }
     }
     echo "<li style='padding-top: 8px; text-align: right;'>";
     $plugins = Plugin::get_plugins('external_share');
     foreach ($plugins as $plugin_name) {
         echo "<a onclick=\"handleShareAction('" . AmpConfig::get('web_path') . "/share.php?action=external_share&plugin=" . $plugin_name . "&type=" . $object_type . "&id=" . $object_id . "')\" target=\"_blank\">" . UI::get_icon('share_' . strtolower($plugin_name), $plugin_name) . "</a>&nbsp;";
     }
     echo "</li>";
     echo "</ul>";
 }