PK Ny\x/| | CoreController.phpnu W+A loco-core-view */ class Loco_admin_list_CoreController extends Loco_admin_RedirectController { /** * {@inheritdoc} */ public function getLocation(){ return Loco_mvc_AdminRouter::generate('core-view'); } }PK Ny\؞. . ThemesController.phpnu W+A set('type', 'theme' ); $this->set('title', __( 'Translate themes', 'loco' ) ); /* @var $theme WP_Theme */ foreach( wp_get_themes() as $theme ){ $bundle = Loco_package_Theme::create( $theme->get_stylesheet() ); $this->addBundle( $bundle ); } return parent::render(); } }PK Ny\fs> > PluginsController.phpnu W+A set( 'type', 'plugin' ); $this->set( 'title', __( 'Translate plugins', 'loco' ) ); foreach( Loco_package_Plugin::get_plugins() as $handle => $data ){ try { $bundle = Loco_package_Plugin::create( $handle ); $this->addBundle($bundle); } // @codeCoverageIgnoreStart catch( Exception $e ){ $bundle = new Loco_package_Plugin( $handle, $handle ); $this->addBundle( $bundle ); } // @codeCoverageIgnoreEnd } return parent::render(); } }PK Ny\rݠ BaseController.phpnu W+A getHandle(); // compatibility will be 'ok', 'warn' or 'error' depending on severity if( $default = $bundle->getDefaultProject() ){ $compat = $default->getPot() instanceof Loco_fs_File; } else { $compat = false; } //$info = $bundle->getHeaderInfo(); return new Loco_mvc_ViewParams( array ( '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', array( 'bundle' => $handle ) ), 'time' => $bundle->getLastUpdated(), ) ); } /** * Add bundle to enabled or disabled list, depending on whether it is configured */ protected function addBundle( Loco_package_Bundle $bundle ){ $this->bundles[] = $this->bundleParam($bundle); } /** * {@inheritdoc} */ public function getHelpTabs(){ return array ( __('Overview','default') => $this->view('tab-list-bundles'), ); } /** * {@inheritdoc} */ public function render(){ // breadcrumb is just the root $here = new Loco_admin_Navigation( array ( new Loco_mvc_ViewParams( array( 'name' => $this->get('title') ) ), ) ); /*/ tab between the types of bundles $types = array ( '' => __('Home','loco'), 'theme' => __('Themes','loco'), 'plugin' => __('Plugins','loco'), ); $current = $this->get('_route'); $tabs = new Loco_admin_Navigation; foreach( $types as $type => $name ){ $href = Loco_mvc_AdminRouter::generate($type); $tabs->add( $name, $href, $type === $current ); } */ return $this->view( 'admin/list/bundles', array ( 'bundles' => $this->bundles, 'breadcrumb' => $here, ) ); } }PK Wy\rhv| | inc-table.phpnu W+A
| e('name')?> | e('dflt')?> | time ? $bundle->date('time') : print '--'?> | n('size')?> |