Beispiel #1
1
 public function action_history()
 {
     $data = array('content' => $this->executeCommand(), 'currentdb' => Request::factory()->getDb(), 'cmd' => Request::factory()->getCmd(), 'dbkeys' => Helper_Info::getCountKeysInDb(), 'history' => History::getLast($_SESSION['login']));
     if (Request::factory()->getAjax()) {
         header('Content-Type: application/json');
         echo json_encode($data);
     } else {
         echo View::factory('layout', $data);
     }
 }
Beispiel #2
0
 public function testPositioning()
 {
     $other_file = tempnam(sys_get_temp_dir() . 'tmp', 'history');
     $el1 = $this->_history->append($other_file);
     $el2 = $this->_history->append($other_file);
     $el3 = $this->_history->append($other_file);
     $this->assertEquals(3, $this->_history->getCount());
     $this->assertEquals($el3, $this->_history->getFirst());
     $this->assertEquals($el1, $this->_history->getLast());
     $this->assertEquals($el2, $this->_history->getNth(1));
     $this->assertEquals($el1, $this->_history->getNext());
     $this->assertFalse($this->_history->getNext());
     unlink($other_file);
 }
Beispiel #3
0
 function preview()
 {
     global $mod_strings;
     if (!isset($_REQUEST['sid'])) {
         die('SID Required');
     }
     $sid = $_REQUEST['sid'];
     $subpanel = '';
     if (!empty($_REQUEST['subpanel'])) {
         $subpanel = ',"' . $_REQUEST['subpanel'] . '"';
     }
     $isDefault = $sid == $this->history->getLast();
     echo "<input type='button' name='close{$sid}' value='" . translate('LBL_BTN_CLOSE') . "' " . "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>" . "<input type='button' name='restore{$sid}' value='" . translate('LBL_MB_RESTORE') . "' " . "class='button' onclick='ModuleBuilder.history.revert(\"{$this->module}\",\"{$this->layout}\",\"{$sid}\",\"{$subpanel}\",\"{$isDefault}\");' style='margin:5px;'>";
     $this->history->restoreByTimestamp($sid);
     if ($this->layout == 'listview') {
         require_once "modules/ModuleBuilder/views/view.listview.php";
         $view = new ViewListView();
     } else {
         if ($this->layout == 'basic_search' || $this->layout == 'advanced_search') {
             require_once "modules/ModuleBuilder/views/view.searchview.php";
             $view = new ViewSearchView();
         } else {
             if ($this->layout == 'dashlet' || $this->layout == 'dashletsearch') {
                 require_once "modules/ModuleBuilder/views/view.dashlet.php";
                 $view = new ViewDashlet();
             } else {
                 if ($this->layout == 'popuplist' || $this->layout == 'popupsearch' || $this->layout == 'selection-list') {
                     require_once "modules/ModuleBuilder/views/view.popupview.php";
                     $view = new ViewPopupview();
                 } else {
                     require_once "modules/ModuleBuilder/views/view.layoutview.php";
                     $view = new ViewLayoutView();
                 }
             }
         }
     }
     $view->display(true);
     $this->history->undoRestore();
 }