Пример #1
0
 /**
  * Construct a new error report view
  * @param zibo\error\report\form\ReportForm $form
  * @param string $report
  * @return null
  */
 public function __construct(ReportForm $form, $report)
 {
     parent::__construct('error/report');
     $this->set('form', $form);
     $this->set('report', $report);
     $this->addStyle('web/styles/error/report.css');
 }
 /**
  * Constructs a new connection form view
  * @param zibo\database\admin\form\ConnectionForm $form
  * @param string $title
  * @return null
  */
 public function __construct(ConnectionForm $form, $title)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->set('title', $title);
     $this->setPageTitle($title, true);
 }
Пример #3
0
 /**
  * Constructs the queue overview
  * @param zibo\queue\table\QueueTable $table The table with the overview
  * @return null
  */
 public function __construct(QueueTable $table)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('table', $table);
     $this->addJavascript(self::SCRIPT_TABLE);
     $this->addStyle(self::STYLE);
 }
Пример #4
0
 /**
  * Renders this view
  * @param boolean $return True to return the rendered view, false to send it to the output
  * @return null|string
  */
 public function render($return = true)
 {
     $this->set('title', $this->title);
     $this->set('headers', $this->headers);
     $this->set('rows', $this->rows);
     return parent::render($return);
 }
Пример #5
0
 public function render($return = true)
 {
     $views = $this->dashboard->getDispatchedViews();
     if (!$views) {
         $this->set('columns', array());
         return parent::render();
     }
     $columns = array();
     foreach ($views as $columnNumber => $widgetViews) {
         $columns[$columnNumber] = array();
         foreach ($widgetViews as $widgetId => $widgetView) {
             if (!$widgetView) {
                 continue;
             }
             $widget = $this->dashboard->getWidget($widgetId);
             $title = $widget->getTitle();
             $content = $this->renderView($widgetView);
             $propertiesAction = null;
             if ($this->propertiesAction && $widget->hasProperties()) {
                 $propertiesAction = $this->propertiesAction . $widgetId;
             }
             $widgetView = new WidgetView($widgetId, $title, $content, $propertiesAction, $widget->isMinimized());
             $columns[$columnNumber][$widgetId] = $this->renderView($widgetView);
         }
     }
     $this->set('columns', $columns);
     return parent::render($return);
 }
Пример #6
0
 public function __construct($url, array $methods)
 {
     parent::__construct('xmlrpc/server');
     $this->set('serverUrl', $url);
     $this->set('serverMethods', $methods);
     $this->addStyle('web/styles/xmlrpc/server.css');
 }
Пример #7
0
 /**
  * Constructs a model detail view
  * @param zibo\library\orm\model\Model $model
  * @return null
  */
 public function __construct(Model $model, ModelFieldTable $fieldTable, ModelFieldOrderForm $orderForm = null, $editModelAction = null, $addFieldsAction = null, $editFormatAction = null, $editIndexAction = null)
 {
     parent::__construct(self::TEMPLATE);
     $meta = $model->getMeta();
     $modelTable = $meta->getModelTable();
     $modelClass = get_class($model);
     $dataClass = $meta->getDataClassName();
     $indexTable = new SimpleModelIndexTable($modelTable);
     $formatTable = new SimpleDataFormatTable($modelTable);
     $this->set('modelTable', $modelTable);
     $this->set('modelClass', $modelClass);
     $this->set('dataClass', $dataClass);
     $this->set('fieldTable', $fieldTable);
     $this->set('formatTable', $formatTable);
     $this->set('indexTable', $indexTable);
     $this->set('orderForm', $orderForm);
     $this->set('editModelAction', $editModelAction);
     $this->set('addFieldsAction', $addFieldsAction);
     $this->set('editFormatAction', $editFormatAction);
     $this->set('editIndexAction', $editIndexAction);
     $this->addJavascript(JQueryModule::SCRIPT_JQUERY_UI);
     $this->addJavascript(self::SCRIPT_TABLE);
     $this->addJavascript(self::SCRIPT_BUILDER);
     $this->addInlineJavascript('ziboOrmInitializeModelDetail();');
     $this->addStyle(self::STYLE_BUILDER);
 }
Пример #8
0
 /**
  * Constructs a new XML-RPC client view
  * @param zibo\xmlrpc\form\ClientForm $form The form of the client
  * @param zibo\library\xmlrpc\Request $request
  * @param zibo\library\xmlrpc\Response $response
  * @param string $responseString
  * @param float $time Time spent on the request in seconds
  * @return null
  */
 public function __construct(ClientForm $form, Request $request = null, Response $response = null, $responseString = null, $time = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->set('time', $time);
     $this->set('requestString', null);
     $this->set('responseString', null);
     if ($request) {
         $this->set('requestString', String::addLineNumbers(trim($request->getXmlString())));
     }
     if ($responseString && !$response) {
         $this->set('responseString', String::addLineNumbers(trim($responseString)));
     } elseif ($response) {
         $this->set('responseString', String::addLineNumbers(trim($response->getXmlString())));
         $errorCode = $response->getErrorCode();
         if ($errorCode) {
             $this->set('error', $errorCode . ': ' . $response->getErrorMessage());
         } else {
             $parser = new ParameterParser();
             $result = $parser->unparse($response->getValue(), true);
             $this->set('result', $result);
         }
     }
     $this->addStyle(self::STYLE);
 }
Пример #9
0
 public function __construct(ModelTable $table)
 {
     parent::__construct('orm/builder/index');
     $this->set('table', $table);
     $this->addJavascript(self::SCRIPT_TABLE);
     $this->addStyle(self::STYLE_BUILDER);
 }
Пример #10
0
 /**
  * Constructs the queue detail view
  * @param zibo\queue\model\data\QueueData $data
  * @param string $statusUrl
  * @return null
  */
 public function __construct(QueueData $data, $backUrl, $statusUrl)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('data', $data);
     $this->set('backUrl', $backUrl);
     $this->addJavascript(self::SCRIPT_TABLE);
     $this->addStyle(self::STYLE);
 }
Пример #11
0
 /**
  * Constructs a new security view
  * @param zibo\admin\table\SecurityTable $table
  * @return null
  */
 public function __construct(SecurityTable $table)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('table', $table);
     $this->addStyle(self::STYLE_SECURITY);
     $this->addJavascript(self::SCRIPT_SECURITY);
     $this->addInlineJavascript('ziboAdminInitializeSecurity();');
 }
Пример #12
0
 /**
  * Construct a new base view
  * @param zibo\core\View $managerView
  * @param string $managerName
  * @return null
  */
 public function __construct(View $managerView = null, $managerName = null)
 {
     parent::__construct(self::TEMPLATE);
     $sidebar = $this->getSidebar();
     $sidebar->addPanel(new SidebarView($managerName));
     if ($managerView) {
         $this->setSubview('manager', $managerView);
     }
 }
Пример #13
0
 /**
  * Constructs a new locales view
  * @param string $sortAction URL where the dnd of the locales will point to
  * @param array $locales Array with Locale objects
  * @return null
  */
 public function __construct($sortAction, array $locales)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('locales', $locales);
     $this->addStyle(self::STYLE_LOCALES);
     $this->addJavascript(self::SCRIPT_LOCALES);
     $this->addJavascript(Module::SCRIPT_JQUERY_UI);
     $this->addInlineJavascript('ziboAdminInitializeLocales("' . $sortAction . '");');
 }
Пример #14
0
 /**
  * Constructs a new terminal view
  * @param zibo\terminal\form\TerminalForm $form The form of the terminal
  * @param string $path The current path
  * @return null
  */
 public function __construct(TerminalForm $form, $path)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->set('path', $path);
     $this->addStyle(self::STYLE);
     $this->addJavascript(self::SCRIPT);
     $this->addInlineJavascript('zibo.terminal.init();');
 }
Пример #15
0
 /**
  * Constructs a new view for the model wizard
  * @param zibo\core\View $wizardView
  * @return null
  */
 public function __construct(View $wizardView = null)
 {
     parent::__construct(self::TEMPLATE);
     if ($wizardView) {
         $this->setSubview('wizard', $wizardView);
     }
     $this->addStyle(self::STYLE_WIZARD);
     $this->addJavascript(self::SCRIPT_WIZARD);
 }
Пример #16
0
 /**
  * Constructs a new log view
  * @return null
  */
 public function __construct($log, $urlBack)
 {
     parent::__construct(self::TEMPLATE);
     $table = new LogChangeTable($log->changes);
     $this->set('log', $log);
     $this->set('table', $table);
     $this->set('urlBack', $urlBack);
     $this->addStyle(ScaffoldLogView::STYLE);
 }
Пример #17
0
 /**
  * Constructs a new cron view
  * @param zibo\cron\table\CronJobTable $table Table with an overview of the cron jobs
  * @param zibo\cron\form\CronProcessForm $form Form to start or stop the cron process
  * @param string $command Command to start the cron process manually
  * @param boolean $isRunning Flag to see if the cron is currently running
  * @return null
  */
 public function __construct(CronJobTable $table, CronProcessForm $form, $command, $isRunning)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('table', $table);
     $this->set('form', $form);
     $this->set('command', $command);
     $this->set('isRunning', $isRunning);
     $this->setPageTitle(Module::TRANSLATION_CRON, true);
     $this->addJavascript(self::SCRIPT_TABLE);
 }
Пример #18
0
 /**
  * Constructs a new modules view
  * @param zibo\admin\form\ModuleInstallForm $form
  * @param zibo\admin\table\ModulesTable $table
  * @return null
  */
 public function __construct(ModuleInstallForm $form, ModulesTable $table)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('table', $table);
     $this->sidebar->addPanel(new FormView($form));
     $this->addStyle(self::STYLE_MODULES);
     $this->addJavascript(self::SCRIPT_MODULES);
     $this->addJavascript(self::SCRIPT_TABLE);
     $this->addInlineJavascript('ziboAdminInitializeModules();');
 }
Пример #19
0
 public function __construct(SpiderForm $form, $statusUrl = null, $reportUrl = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->addStyle(Module::STYLE_JQUERY_UI);
     $this->addStyle('web/styles/spider/spider.css');
     $this->addJavascript(Module::SCRIPT_JQUERY_UI);
     $this->addJavascript('web/scripts/spider/spider.js');
     $this->addInlineJavascript('ziboSpiderInitialize("' . $statusUrl . '", "' . $reportUrl . '");');
 }
Пример #20
0
 /**
  * Constructs a new connections view
  * @param zibo\database\admin\table\ConnectionTable $table
  * @param array $protocols
  * @param string $urlAdd
  * @param zibo\database\admin\form\ConnectionDefaultForm $defaultConnectionForm
  * @return null
  */
 public function __construct(ConnectionTable $table, array $protocols, $urlAdd = null, ConnectionDefaultForm $defaultConnectionForm = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('table', $table);
     $this->set('formDefault', $defaultConnectionForm);
     $this->set('protocols', $protocols);
     $this->set('urlAdd', $urlAdd);
     $this->addStyle(self::STYLE);
     $this->addJavascript(self::SCRIPT_TABLE);
 }
Пример #21
0
 /**
  * Construct the main dashboard view
  * @param array $widgets
  * @param string $returnAction
  * @param string $saveAction
  * @return null
  */
 public function __construct(array $widgets, $returnAction, $saveAction)
 {
     parent::__construct('dashboard/widget.add');
     $translator = I18n::getInstance()->getTranslator();
     $saveMessage = $translator->translate('dashboard.message.added');
     $this->set('returnAction', $returnAction);
     $this->set('widgets', $widgets);
     $this->addStyle(Module::STYLE_DASHBOARD);
     $this->addJavascript(Module::SCRIPT_DASHBOARD);
     $this->addInlineJavascript('dashboardSaveAction = "' . $saveAction . '";');
     $this->addInlineJavascript('dashboardSaveMessage = "' . $saveMessage . '";');
 }
Пример #22
0
 /**
  * Constructs a new security view
  * @param zibo\admin\table\SecurityTable $table
  * @return null
  */
 public function __construct(ProfileForm $form)
 {
     parent::__construct(self::TEMPLATE);
     $subviewNames = array();
     $subviews = $form->getHookViews();
     foreach ($subviews as $index => $subview) {
         $subviewName = 'profileHook' . $index;
         $subviewNames[] = $subviewName;
         $this->setSubview($subviewName, $subview);
     }
     $this->set('form', $form);
     $this->set('subviewNames', $subviewNames);
 }
Пример #23
0
 /**
  * Construct the base API view
  * @param string $template template for the engine
  * @param zibo\api\form\SearchForm $form the search form
  * @param array $namespaces array with the current namespaces
  * @param string $namespaceAction URL to the detail of a namespace
  * @param array $classes array with the current classes
  * @param string $classAction URL to the detail of a class
  * @param string $currentNamespace name of the current namespace
  * @param string $currentClass name of the current class
  * @return null
  */
 public function __construct($template, SearchForm $searchForm, array $namespaces, $namespaceAction, array $classes = null, $classAction = null, $currentNamespace = null, $currentClass = null)
 {
     parent::__construct($template);
     $sidebarView = new SidebarView($searchForm, $namespaces, $namespaceAction, $classes, $classAction, $currentNamespace, $currentClass);
     $this->sidebar->addPanel($sidebarView);
     $this->set('namespaces', $namespaces);
     $this->set('namespaceAction', $namespaceAction);
     $this->set('currentNamespace', $currentNamespace);
     $this->set('classes', $classes);
     $this->set('classAction', $classAction);
     $this->set('currentClass', $currentClass);
     $this->addStyle(self::STYLE_API);
 }
Пример #24
0
 /**
  * Prepares the taskbar and adds the taskbar to the view
  * @return null
  */
 protected function addTaskbar()
 {
     $hasLocalizePanel = false;
     $panels = $this->taskbar->getNotificationPanels();
     foreach ($panels as $panel) {
         if ($panel instanceof LocalizePanelView) {
             $hasLocalizePanel = true;
             break;
         }
     }
     if (!$hasLocalizePanel) {
         $localizePanelView = new LocalizePanelView($this->isLocalized);
         $this->taskbar->addNotificationPanel($localizePanelView);
     }
     parent::addTaskbar();
 }
Пример #25
0
 /**
  * Constructs a new system view
  * @param array $ziboConfiguration The complete Zibo configuration
  * @param array $baseUrl The base URL of the installation
  * @param array $routes Array with Route objects
  * @param zibo\library\SoftwareDetector $softwareDetector Instance of a software detector
  * @param integer $numVistors Number of visitors
  * @param integer $numUsers Number of users
  * @param integer $numGuests Number of guests
  * @param array $currentUsers The names of the current users
  * @return null
  */
 public function __construct(array $ziboConfiguration, $baseUrl, array $routes, SoftwareDetector $softwareDetector, $numVisitors, $numUsers, $numGuests, $currentUsers)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('ziboConfiguration', $ziboConfiguration);
     $this->set('ziboVersion', Zibo::VERSION);
     $this->set('phpVersion', phpversion());
     $this->set('baseUrl', $baseUrl);
     $this->set('routes', $routes);
     $this->set('osName', $softwareDetector->getOperatingSystemName());
     $this->set('osVersion', $softwareDetector->getOperatingSystemVersion());
     $this->set('browserName', $softwareDetector->getBrowserName());
     $this->set('browserVersion', $softwareDetector->getBrowserVersion());
     $this->set('userAgent', $softwareDetector->getUserAgent());
     $this->set('ip', $_SERVER['REMOTE_ADDR']);
     $this->set('numVisitors', $numVisitors);
     $this->set('numUsers', $numUsers);
     $this->set('numGuests', $numGuests);
     $this->set('currentUsers', $currentUsers);
     $this->addStyle(self::STYLE_SYSTEM);
     $this->addJavascript(self::SCRIPT_SYSTEM);
     $this->addInlineJavascript('ziboAdminInitializeSystem();');
 }
Пример #26
0
 /**
  * Constructs a new authentication view
  * @param zibo\admin\form\AuthenticationForm $form
  * @return null
  */
 public function __construct(AuthenticationForm $form)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->addInlineJavascript('$("#formAuthenticateUsername").focus();');
 }
Пример #27
0
 /**
  * Populates the sidebar and sets the provided view to the response
  * @param zibo\admin\view\BaseView $view System view to render
  * @param array $actions Array with the URL of the action as key and the label as value
  * @return null
  */
 private function setView(BaseView $view, array $actions)
 {
     $translator = $this->getTranslator();
     $actions[$this->request->getBasePath() . '/clearCache'] = self::TRANSLATION_CLEAR_CACHE;
     $actions[$this->request->getBasePath() . '/reindexFileBrowser'] = self::TRANSLATION_REINDEX_FILE_BROWSER;
     $view->setPageTitle($translator->translate(self::TRANSLATION_TITLE));
     $sidebar = $view->getSidebar();
     $sidebar->setInformation($translator->translate(self::TRANSLATION_DESCRIPTION));
     foreach ($actions as $url => $label) {
         $sidebar->addAction($url, $translator->translate($label));
     }
     $this->response->setView($view);
 }
Пример #28
0
 /**
  * Constructs a new switch user view
  * @param zibo\user\form\UserSwitchForm $form
  * @return null
  */
 public function __construct(UserSwitchForm $form)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->addInlineJavascript('$("#formUserSwitchUsername").focus();');
 }
 /**
  * Constructs a new abstract repository view
  * @param string $template The template for the view
  * @return null
  */
 public function __construct($template)
 {
     parent::__construct($template);
     $this->addStyle(self::STYLE);
     $this->addJavascript(self::SCRIPT_TABLE);
 }
Пример #30
0
 /**
  * Construct this exception view
  * @param Exception $e the exception to display as an error
  * @return null
  */
 public function __construct(Exception $e)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('exception', $this->getExceptionArray($e));
     $this->addStyle(self::STYLE_EXCEPTION);
 }