asset_wizard_browse

Versions
5 – 6
asset_wizard_browse($asset = NULL)

Step 1: Display a browsable list of assets

Code

contributions/asset/asset_wizard.module, line 420

<?php
function asset_wizard_browse($asset = NULL){
  $config = asset_wizard_get_config();
  
  if(!$asset){
    $asset = asset_load(0);
  }     
  $items = array();
  if($asset->aid){
    $parent = asset_load($asset->pid);
    $parent->link_title = '..';
    $items[] = $parent;
  }
  $types = array();
  $query = 'SELECT aid FROM {asset} WHERE pid=%d';
  $args[] = $asset->aid;
  
  if($config['allowed_types']){
    foreach($config['allowed_types'] as $type){
      if($type){
        $types[] = $type;
      }
    }
    if($types){
      $query .= ' AND type IN ("%s")';
      $args[] = implode('","', $types);
    }
  }
  $result = db_query($query, $args);
  while($row = db_fetch_object($result)){
    //$items[$row->aid] = $row->title;
    $items[] = asset_load($row->aid);
  }
  $content = theme('asset_wizard_browse', $items);
  return theme('asset_wizard_page', $content);     
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.