Esempio n. 1
0
/**
 * Sub-Ajax page, requires AJAX_INCLUDE
 */
if (!defined('AJAX_INCLUDE')) {
    exit;
}
$results = array();
switch ($_REQUEST['action']) {
    case 'show_add_tag':
        break;
    case 'get_tag_map':
        $tags = Tag::get_display(Tag::get_tags());
        $results['tags'] = $tags;
        break;
    case 'get_labels':
        $labels = Label::get_display(Label::get_all_labels());
        $results['labels'] = $labels;
        break;
    case 'add_tag':
        debug_event('tag.ajax', 'Adding new tag...', '5');
        Tag::add_tag_map($_GET['type'], $_GET['object_id'], $_GET['tag_id']);
        break;
    case 'add_tag_by_name':
        debug_event('tag.ajax', 'Adding new tag by name...', '5');
        Tag::add($_GET['type'], $_GET['object_id'], $_GET['tag_name'], false);
        break;
    case 'delete':
        debug_event('tag.ajax', 'Deleting tag...', '5');
        $tag = new Tag($_GET['tag_id']);
        $tag->delete();
        header('Location: ' . AmpConfig::get('web_path') . '/browse.php?action=tag');
Esempio n. 2
0
</td>
                <td><input type="text" name="edit_tags" id="edit_tags" value="<?php 
echo Tag::get_display($libitem->tags);
?>
" /></td>
            </tr>
            <?php 
if (AmpConfig::get('label')) {
    ?>
            <tr>
                <td class="edit_dialog_content_header"><?php 
    echo T_('Labels');
    ?>
</td>
                <td><input type="text" name="edit_labels" id="edit_labels" value="<?php 
    echo Label::get_display($libitem->labels);
    ?>
" /></td>
            </tr>
            <?php 
}
?>
            <tr>
                <td class="edit_dialog_content_header"></td>
                <td><input type="checkbox" name="overwrite_childs" value="checked" />&nbsp;<?php 
echo T_('Overwrite tags of sub albums and sub songs');
?>
</td>
            </tr>
            <tr>
                <td class="edit_dialog_content_header"></td>
Esempio n. 3
0
 /**
  * format
  * this function takes an array of artist
  * information and reformats the relevent values
  * so they can be displayed in a table for example
  * it changes the title into a full link.
  * @return boolean
  */
 public function format($details = true, $limit_threshold = '')
 {
     /* Combine prefix and name, trim then add ... if needed */
     $name = trim($this->prefix . " " . $this->name);
     $this->f_name = $name;
     $this->f_full_name = trim(trim($this->prefix) . ' ' . trim($this->name));
     // If this is a memory-only object, we're done here
     if (!$this->id) {
         return true;
     }
     if ($this->catalog_id) {
         $this->link = AmpConfig::get('web_path') . '/artists.php?action=show&catalog=' . $this->catalog_id . '&artist=' . $this->id;
         $this->f_link = "<a href=\"" . $this->link . "\" title=\"" . $this->f_full_name . "\">" . $name . "</a>";
     } else {
         $this->link = AmpConfig::get('web_path') . '/artists.php?action=show&artist=' . $this->id;
         $this->f_link = "<a href=\"" . $this->link . "\" title=\"" . $this->f_full_name . "\">" . $name . "</a>";
     }
     if ($details) {
         // Get the counts
         $extra_info = $this->_get_extra_info($this->catalog_id, $limit_threshold);
         //Format the new time thingy that we just got
         $min = sprintf("%02d", floor($extra_info['time'] / 60) % 60);
         $sec = sprintf("%02d", $extra_info['time'] % 60);
         $hours = floor($extra_info['time'] / 3600);
         $this->f_time = ltrim($hours . ':' . $min . ':' . $sec, '0:');
         $this->tags = Tag::get_top_tags('artist', $this->id);
         $this->f_tags = Tag::get_display($this->tags, true, 'artist');
         if (AmpConfig::get('label')) {
             $this->labels = Label::get_labels($this->id);
             $this->f_labels = Label::get_display($this->labels, true);
         }
         $this->object_cnt = $extra_info['object_cnt'];
     }
     return true;
 }