Admin_ThemesController::indexAction PHP Метод

indexAction() публичный Метод

public indexAction ( )
    public function indexAction()
    {
        $translator = \Zend_Registry::get('container')->getService('translator');
        $datatableAdapter = new Theme($this->getThemeService());
        // really wierd way to bind some filtering logic right here
        // basically this is the column index we are going to look for filtering requests
        $datatableAdapter->setPublicationFilterColumn(0);
        $datatable = $this->_helper->genericDatatable;
        /* @var $datatable Action_Helper_GenericDatatable */
        $datatable->setAdapter($datatableAdapter)->setOutputObject($this->view);
        $view = $this->view;
        $datatable->setCols(array('image' => '', 'name' => $translator->trans('Theme name / version', array(), 'themes'), 'description' => $translator->trans('Compatibility', array(), 'themes'), 'actions' => ''))->buildColumnDefs()->setOptions(array('sAjaxSource' => $this->view->url(array('action' => 'index', 'format' => 'json')), 'sPaginationType' => 'full_numbers', 'bServerSide' => true, 'bJQueryUI' => true, 'bAutoWidth' => false, 'sDom' => 'tiprl', 'iDisplayLength' => 25, 'bLengthChange' => false, 'fnRowCallback' => "newscoopDatatables.callbackRow", 'fnDrawCallback' => "newscoopDatatables.callbackDraw", 'fnServerData' => "newscoopDatatables.callbackServerData", 'oLanguage' => array('oPaginate' => array('sNext' => $translator->trans('Next'), 'sLast' => $translator->trans('Last', array(), 'api'), 'sPrevious' => $translator->trans('Previous'), 'sFirst' => $translator->trans('First', array(), 'api')), 'sZeroRecords' => $translator->trans('No records found.', array(), 'users'), 'sSearch' => $translator->trans('Search'), 'sInfo' => $translator->trans('Showing _START_ to _END_ of _TOTAL_ entries', array(), 'users'), 'sEmpty' => $translator->trans('No entries to show', array(), 'users'), 'sInfoFiltered' => $translator->trans(' - filtering from _MAX_ records', array(), 'users'), 'sLengthMenu' => $translator->trans('Display _MENU_ records', array(), 'users'), 'sInfoEmpty' => '')))->setWidths(array('image' => 215, 'name' => 370, 'description' => 280, 'actions' => 315))->setRowHandler(function ($theme, $index = null) {
            return array("id" => $theme['id'], "images" => $theme['images'], "title" => htmlspecialchars($theme['title']), "designer" => htmlspecialchars($theme['designer']), "version" => htmlspecialchars($theme['version']), "compat" => htmlspecialchars($theme['subTitle']), "text" => htmlspecialchars($theme['description']), "pubId" => $theme['pubId']);
        })->setParams($this->_request->getParams());
        if ($this->view->mytable = $datatable->dispatch()) {
            $this->view->publications = $this->getPublicationService()->getEntities();
            $this->view->themesPath = $this->view->baseUrl('/themes');
            $uploadForm = new Admin_Form_Theme_Upload();
            $uploadForm->setAction($this->view->url(array('action' => 'upload')))->addElement('hidden', 'format', array('value' => 'json', 'decorators' => array('ViewHelper')))->getElement('submit-button')->clearDecorators()->addDecorator('ViewHelper')->setAttrib('style', 'display:none');
            $this->view->uploadForm = $uploadForm;
            $this->view->headScript()->appendFile($this->view->baseUrl("/js/jquery/doT.js"));
            $this->view->headLink(array('type' => 'text/css', 'href' => $this->view->baseUrl('/admin-style/themes_list.css'), 'media' => 'screen', 'rel' => 'stylesheet'));
            $this->view->headLink(array('type' => 'text/css', 'href' => $this->view->baseUrl('/admin-style/action_buttons.css'), 'media' => 'screen', 'rel' => 'stylesheet'));
            $this->view->headTitle($translator->trans('Theme management', array(), 'themes') . ' - Newscoop Admin', 'SET');
        }
    }