Esempio n. 1
0
 /**
  * update_360020
  *
  * Catalog types are plugins now
  */
 public static function update_360020()
 {
     $retval = true;
     $sql = "SELECT `id`, `catalog_type`, `path`, `remote_username`, `remote_password` FROM `catalog`";
     $db_results = Dba::read($sql);
     $c = Catalog::create_catalog_type('local');
     $c->install();
     $c = Catalog::create_catalog_type('remote');
     $c->install();
     while ($results = Dba::fetch_assoc($db_results)) {
         if ($results['catalog_type'] == 'local') {
             $sql = "INSERT INTO `catalog_local` (`path`, `catalog_id`) VALUES (?, ?)";
             $retval &= Dba::write($sql, array($results['path'], $results['id']));
         } elseif ($results['catalog_type'] == 'remote') {
             $sql = "INSERT INTO `catalog_remote` (`uri`, `username`, `password`, `catalog_id`) VALUES (?, ?, ?, ?)";
             $retval &= Dba::write($sql, array($results['path'], $results['remote_username'], $results['remote_password'], $results['id']));
         }
     }
     $sql = "ALTER TABLE `catalog` DROP `path`, DROP `remote_username`, DROP `remote_password`";
     $retval &= Dba::write($sql);
     $sql = "ALTER TABLE `catalog` MODIFY COLUMN `catalog_type` varchar(128)";
     $retval &= Dba::write($sql);
     $sql = "UPDATE `artist` SET `mbid` = null WHERE `mbid` = ''";
     $retval &= Dba::write($sql);
     $sql = "UPDATE `album` SET `mbid` = null WHERE `mbid` = ''";
     $retval &= Dba::write($sql);
     $sql = "UPDATE `song` SET `mbid` = null WHERE `mbid` = ''";
     $retval &= Dba::write($sql);
     return $retval;
 }
Esempio n. 2
0
?>
</th>
            <th class="cel_version"><?php 
echo T_('Version');
?>
</th>
            <th class="cel_action"><?php 
echo T_('Action');
?>
</th>
        </tr>
    </thead>
    <tbody>
        <?php 
foreach ($catalogs as $type) {
    $catalog = Catalog::create_catalog_type($type);
    if ($catalog == null) {
        continue;
    }
    $catalog->format();
    if ($catalog->is_installed()) {
        $action = 'confirm_uninstall_catalog_type';
        $action_txt = T_('Disable');
    } else {
        $action = 'install_catalog_type';
        $action_txt = T_('Activate');
    }
    ?>
        <tr class="<?php 
    echo UI::flip_class();
    ?>