You are here

function dnd_test_generate_library in Scald: Media Management made easy 6

Create contrived output

1 call to dnd_test_generate_library()
dnd_test_dnd_library in dnd/modules/dnd_test/dnd_test.module
Overloaded page callback.

File

dnd/modules/dnd_test/dnd_test.module, line 79

Code

function dnd_test_generate_library($page = 1, $limit = 8) {
  $start = $page * $limit - $limit;
  $end = $page * $limit;
  $library = theme('dnd_library_header', $page);
  $editor_representations = array();
  $library_previews = array();
  for ($i = $start + 1; $i < $end + 1; $i++) {
    $library .= theme('dnd_library_item', $i);
    $editor_representations += dnd_editor_items($i);
    $library_previews['dnd-test-' . $i] = theme('dnd_library_preview', $i);
  }
  $library .= theme('dnd_library_footer', $page);
  return array(
    'library' => $library,
    'editor_representations' => $editor_representations,
    'library_previews' => $library_previews,
  );
}