山に住む一家は千個の巣から蜂蜜を収穫し、幼い子供たちは新しい畑で5エーカーの野菜を栽培している。<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
/**
 * Common controller for listing of all bundle types
 */
abstract class Loco_admin_list_BaseController extends Loco_mvc_AdminController {
    
    private $bundles = [];


    /**
     * Build renderable bundle variables
     * @param Loco_package_Bundle
     * @return Loco_mvc_ViewParams
     */
    protected function bundleParam( Loco_package_Bundle $bundle ){
        $handle = $bundle->getHandle();
        $default = $bundle->getDefaultProject();
        return new Loco_mvc_ViewParams(  [
            'id'   => $bundle->getId(),
            'name' => $bundle->getName(),
            'dflt' => $default ? $default->getDomain() : '--',
            'size' => count( $bundle ),
            'save' => $bundle->isConfigured(),
            'type' => $type = strtolower( $bundle->getType() ),
            'view' => Loco_mvc_AdminRouter::generate( $type.'-view', [ 'bundle' => $handle ] ),
            'time' => $bundle->getLastUpdated(),
        ] );
    }
    

    /**
     * Add bundle to enabled or disabled list, depending on whether it is configured
     * @param Loco_package_Bundle
     */
    protected function addBundle( Loco_package_Bundle $bundle ){
        $this->bundles[] = $this->bundleParam($bundle);
    }
    

    /**
     * {@inheritdoc}
     */
    public function getHelpTabs(){
        return  [
            __('Overview','loco-translate') => $this->viewSnippet('tab-list-bundles'),
        ];
    }


    /**
     * {@inheritdoc}
     */
    public function render(){

        // breadcrumb is just the root
        $here = new Loco_admin_Navigation(  [
            new Loco_mvc_ViewParams( [ 'name' => $this->get('title') ] ),
        ] );
        
        /*/ tab between the types of bundles
        $types = array (
            '' => __('Home','loco-translate'),
            'them