403Webshell
Server IP : 172.67.158.161  /  Your IP : 18.227.46.76
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/thietke365.net/wp-content/plugins/loco-translate/src/admin/list/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/thietke365.net/wp-content/plugins/loco-translate/src/admin/list/BaseController.php
<?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','default') => $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'),
            'theme'  => __('Themes','loco-translate'),
            'plugin' => __('Plugins','loco-translate'),
        );
        $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',  [
            'bundles' => $this->bundles,
            'breadcrumb' => $here,
        ] );
    }

    
}

Youez - 2016 - github.com/yon3zu
LinuXploit