Forum

Thread tagged as: Problem, Gallery

Perch Gallery reorder not showing all items, and app not showing on Dashboard sc...

A client reported a quirk with Perch Gallery (version 2.8.9, up to date at time of writing) where the reorder screen only showed the first 10 items. Changing line 23 in perch_gallery/modes/album.reorder.pre.php from

$albums = $GalleryAlbums->all($Paging);

to

$albums = $GalleryAlbums->all();

shows all the items as expected.

Also realized the dashboard.php module isn't showing in the Admin Dashboard. Looks like the code hasn't been updated to Perch 3 yet. Just FYI.

Kirk Roberts

Kirk Roberts 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm aware, thanks!

For anyone who wants a patch until the official update is released, here is what I have in perch_gallery/dashboard.php to produce a text list of albums:

<?php

    return function() {

    $API   = new PerchAPI(1.0, 'perch_gallery');
    $Lang  = $API->get('Lang');
    $Albums = new PerchGallery_Albums($API);
    $albums = $Albums->return_all();

?>
<div class="widget">
    <div class="dash-content">
      <header>
        <h2><?php echo $Lang->get('Gallery'); ?></h2>
        <a href="<?php echo PerchUtil::html(PERCH_LOGINPATH.'/addons/apps/perch_gallery/edit/'); ?>" class="button button-small button-icon icon-left action-info"><div><?php echo PerchUI::icon('core/plus', 8).'<span>'. $Lang->get('Add Album'); ?></span></div></a>
      </header>

        <div class="body">
            <?php

                if (PerchUtil::count($albums)) {
                    echo '<ul class="dash-list">';
                    foreach($albums as $Album) {
                        echo '<li>';
                            echo '<a href="'.PerchUtil::html(PERCH_LOGINPATH.'/addons/apps/perch_gallery/images/?id='.$Album->id()).'">';
                                echo PerchUtil::html($Album->albumTitle());
                            echo '</a>';
                        echo '</li>';
                    }
                    echo '</ul>';
                }

            ?>
        </div>
    </div>
</div>
<?php

}