Beispiel #1
0
 private function _getListRandom()
 {
     $data = array();
     $iconPath = pm_Context::getBaseUrl() . 'images/icon_16.gif';
     for ($i = 0; $i < 150; $i++) {
         $data[] = array('column-1' => '<a href="#">' . (string) rand() . '</a>', 'column-2' => '<img src="' . $iconPath . '" /> ' . (string) rand());
     }
     $list = new pm_View_List_Simple($this->view, $this->_request);
     $list->setData($data);
     $list->setColumns(array('column-1' => array('title' => 'Random with link', 'noEscape' => true), 'column-2' => array('title' => 'Random with image', 'noEscape' => true)));
     // Take into account listDataAction corresponds to the URL /list-data/
     $list->setDataUrl(array('action' => 'list-data'));
     return $list;
 }
 public function __construct(Zend_View $view, Zend_Controller_Request_Abstract $request)
 {
     parent::__construct($view, $request);
     $data = array();
     foreach (Modules_SlaveDnsManager_Slave::getList() as $slave) {
         try {
             $rndc = new Modules_SlaveDnsManager_Rndc();
             $details = $rndc->checkStatus($slave);
             $icon = 'ok';
         } catch (Exception $e) {
             $details = $e->getMessage();
             $icon = 'warning';
         }
         $ip = $view->escape((string) $slave->getIp());
         $config = $view->escape((string) $slave->getConfig());
         $data[] = array('select' => '<input type="checkbox" class="checkbox" name="listCheckbox[]" value="' . $config . '"/>', 'status' => '<img class="slave-status" src="/theme/icons/16/plesk/' . $icon . '.png" title="' . $view->escape($details) . '"/>', 'config' => '<a href="' . $view->getHelper('baseUrl')->moduleUrl(array('action' => 'view')) . '?config=' . $config . '">' . $ip . '</a>');
     }
     $this->setData($data);
     $this->setColumns(array('select' => array('title' => '<input type="checkbox" class="checkbox" name="listGlobalCheckbox"/>', 'sortable' => false, 'noEscape' => true), 'status' => array('title' => $this->lmsg('statusColumnTitle'), 'noEscape' => true), 'config' => array('title' => $this->lmsg('configColumnTitle'), 'noEscape' => true)));
     $this->setTools(array(array('title' => $this->lmsg('addToolTitle'), 'description' => $this->lmsg('addToolDescription'), 'class' => 'sb-add-new', 'link' => $view->getHelper('baseUrl')->moduleUrl(array('action' => 'add'))), array('title' => $this->lmsg('refreshToolTitle'), 'description' => $this->lmsg('refreshToolDescription'), 'class' => 'sb-refresh', 'link' => pm_Context::getBaseUrl()), array('title' => $this->lmsg('removeToolTitle'), 'description' => $this->lmsg('removeToolDescription'), 'class' => 'sb-remove-selected', 'link' => 'javascript:removeSlaves()')));
     $this->setDataUrl(array('action' => 'list-data'));
 }