/**
  * Construct this view
  * @param zibo\library\widget\controller\Widget $widget
  */
 public function __construct(Widget $widget, $widgetId, $baseUrl)
 {
     parent::__construct('joppa/backend/widget.content');
     $this->set('baseUrl', $baseUrl);
     $this->set('widget', $widget);
     $this->set('widgetId', $widgetId);
 }
 /**
  * Constructs a new step view
  * @param zibo\orm\builder\wizard\BuilderWizard $wizard
  */
 public function __construct(BuilderWizard $wizard, SimpleModelIndexTable $indexTable)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('wizard', $wizard);
     $this->set('indexTable', $indexTable);
     $this->addInlineJavascript('ziboOrmInitializeBuilderWizardIndex();');
 }
 /**
  * Construct this view
  * @param joppa\form\backend\SiteSelectForm $siteSelectForm form to select another site
  * @param joppa\model\Site $site the current site (optional)
  * @param joppa\model\Node $node the current node (optional)
  * @return null
  */
 public function __construct(SiteSelectForm $siteSelectForm, Site $site = null, Node $node = null)
 {
     parent::__construct('joppa/backend/sidebar');
     $createActions = array();
     $baseUrl = $this->get('_baseUrl') . '/';
     $nodeTypeFacade = NodeTypeFacade::getInstance();
     $nodeTreeHtml = null;
     if ($site) {
         $this->setSubview('tree', new TreeView($site, $node));
         $toggleAction = $baseUrl . Module::ROUTE_AJAX_TREE;
         $orderAction = $baseUrl . Module::ROUTE_JOPPA . '/node/order/';
         $translator = I18n::getInstance()->getTranslator();
         $deleteConfirmMessage = $translator->translate(self::TRANSLATION_DELETE_NODE_CONFIRM);
         $this->addJavascript(self::SCRIPT_TREE);
         $this->addInlineJavascript("joppaInitializeNodeTree('{$toggleAction}', '{$orderAction}', '{$deleteConfirmMessage}');");
         $labels = $nodeTypeFacade->getLabels();
         foreach ($labels as $type => $label) {
             $action = array('type' => $type, 'label' => $label, 'url' => $baseUrl . Module::ROUTE_JOPPA . '/' . $type . '/add');
             $createActions[] = $action;
         }
     } else {
         $createActions[] = array('type' => SiteModel::NODE_TYPE, 'label' => $nodeTypeFacade->getLabel(SiteModel::NODE_TYPE), 'url' => $baseUrl . Module::ROUTE_JOPPA . '/' . SiteModel::NODE_TYPE . '/add');
     }
     $this->set('formSiteSelect', $siteSelectForm);
     $this->set('createActions', $createActions);
 }
 /**
  * Constructs a new properties view
  * @param string $template Path to the template
  * @return null
  */
 public function __construct($template)
 {
     parent::__construct($template);
     $this->addStyle(self::STYLE);
     $this->addJavascript(JQuery::SCRIPT_JQUERY_UI);
     $this->addJavascript(self::SCRIPT);
 }
 /**
  * Construct this view
  * @param array $tree Array with node instances and their children
  * @param joppa\model\Node $currentNode The current node
  * @param string $title optional title
  * @return null
  */
 public function __construct(array $tree, Node $currentNode, $title = null)
 {
     parent::__construct('joppa/widget/menu/menu');
     $this->set('items', $tree);
     $this->set('currentNode', $currentNode);
     $this->set('title', $title);
 }
 /**
  * Render this taskbar view
  * @param boolean $return true to return the rendered view, false to send it to the client
  * @return mixed null when provided $return is set to true; the rendered output when the provided $return is set to false
  */
 public function render($return = true)
 {
     $request = Zibo::getInstance()->getRequest();
     if (!$request) {
         return;
     }
     $baseUrl = $request->getBaseUrl() . Request::QUERY_SEPARATOR;
     $renderedPanels = array();
     $notificationPanels = $this->taskbar->getNotificationPanels();
     foreach ($notificationPanels as $panel) {
         $renderedPanels[] = $this->renderView($panel);
     }
     $applicationsMenu = $this->taskbar->getApplicationsMenu();
     $applicationsMenu->setBaseUrl($baseUrl);
     $settingsMenu = $this->taskbar->getSettingsMenu();
     $settingsMenu->setBaseUrl($baseUrl);
     $settingsMenu->orderItems();
     $this->set('applicationsMenu', $applicationsMenu);
     $this->set('settingsMenu', $settingsMenu);
     $this->set('notificationPanels', array_reverse($renderedPanels));
     $this->set('title', $this->taskbar->getTitle());
     $this->addStyle(self::STYLE_TASKBAR);
     $this->addJavascript(self::SCRIPT_CLICKMENU);
     $this->addInlineJavascript("\$('#taskbarApplications').clickMenu({start: 'left'}); \n \t\t\t\t" . "\$('#taskbarSettings').clickMenu({start: 'right'});");
     return parent::render($return);
 }
 /**
  * Constructs a new view for the account profile hook
  * @return null
  */
 public function __construct(ProfileForm $form)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('user', $form->getUser());
     $this->set('form', $form);
     $this->addInlineJavascript('$("#formProfileEmail").focus();');
 }
 /**
  * Constructs a new step view
  * @param zibo\orm\builder\wizard\BuilderWizard $wizard
  * @param zibo\orm\builder\table\SimpleDateFormatTable $formatTable
  * @return null
  */
 public function __construct(BuilderWizard $wizard, SimpleDataFormatTable $formatTable)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('wizard', $wizard);
     $this->set('formatTable', $formatTable);
     $this->addInlineJavascript('ziboOrmInitializeBuilderWizardFormat();');
 }
 /**
  * Constructs a new localize view
  * @param $meta
  * @param $id
  * @param $action
  * @param $field
  * @return null
  */
 public function __construct(ModelMeta $meta, $data, $action = null)
 {
     parent::__construct(self::TEMPLATE);
     $localizedModel = $meta->getLocalizedModel();
     $localizedFields = $meta->getLocalizedFields();
     $currentLocale = LocalizeController::getLocale();
     $allLocales = I18n::getInstance()->getAllLocales();
     unset($allLocales[$currentLocale]);
     $locales = array();
     foreach ($allLocales as $locale) {
         $locale = $locale->getCode();
         $localizedId = $localizedModel->getLocalizedId($data->id, $locale);
         if ($localizedId === null) {
             $locales[$locale] = null;
             continue;
         }
         $localesData = clone $data;
         $localizedData = $localizedModel->findById($localizedId);
         foreach ($localizedFields as $fieldName => $localizedField) {
             $localesData->{$fieldName} = $localizedData->{$fieldName};
         }
         $localesData->localizedLabel = $meta->formatData($localesData);
         $locales[$locale] = $localesData;
     }
     $this->set('locales', $locales);
     $this->set('action', $action);
 }
 /**
  * Construct this view
  * @param string $query the search query
  * @param joppa\search\model\SearchResult $result for the search query
  * @param string $urlMore base url for more results
  * @return null
  */
 public function __construct($query, SearchResult $result = null, $urlMore = null)
 {
     parent::__construct('joppa/search/result');
     $this->set('query', $query);
     $this->set('result', $result);
     $this->set('urlMore', $urlMore);
 }
 /**
  * Constructs a new advertisement view
  * @param joppa\advertising\model\Advertisement $advertisement
  * @param int $width
  * @param int $height
  * @return null
  */
 public function __construct(Advertisement $advertisement, $width, $height)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('advertisement', $advertisement);
     $this->set('width', $width);
     $this->set('height', $height);
 }
 /**
  * Constructs a new form view
  * @param zibo\orm\scaffold\form\ScaffoldForm $form
  * @param string $title
  * @param joppa\advertising\model\data\AdvertisementData $advertisement
  * @return null
  */
 public function __construct(ScaffoldForm $form, $title, AdvertisementData $advertisement = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->set('title', $title);
     $this->set('advertisement', $advertisement);
 }
Beispiel #13
0
 /**
  * Constructs a new sidebar view
  * @param string $managerName name of the current manager
  * @return null
  */
 public function __construct($managerName = null)
 {
     parent::__construct(self::TEMPLATE);
     $managers = ManagerModel::getInstance()->getManagers();
     $managers = $this->getViewManagers($managers, $managerName);
     $this->set('managers', $managers);
     $this->addStyle('web/styles/manager.css');
 }
 /**
  * Construct this view
  * @param string $title
  * @param integer $level
  * @param string $styleClass
  * @param string $styleId
  * @return null
  */
 public function __construct($title, $level = 1, $styleClass = null, $styleId = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('title', $title);
     $this->set('level', $level);
     $this->set('styleClass', $styleClass);
     $this->set('styleId', $styleId);
 }
Beispiel #15
0
 /**
  * Constructs a new podcast index view
  * @param array $podcasts Array with PodcastData objects
  * @param integer $page Number of the current page
  * @param integer $pages Total number of pages
  * @param string $pageUrl URL for the pagination
  */
 public function __construct(array $podcasts, $page = null, $pages = null, $pageUrl = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('podcasts', $podcasts);
     $this->set('pageUrl', $pageUrl);
     $this->set('page', $page);
     $this->set('pages', $pages);
 }
Beispiel #16
0
 /**
  * Constructs a new upload view
  * @param zibo\library\html\form\Form $form
  * @return null
  */
 public function __construct(UploadForm $form)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $fileField = $form->getField(UploadForm::FIELD_FILE);
     $fileField->setAttribute('onChange', 'updateUploadForm(this)');
     $this->addJavascript(BaseView::SCRIPT_BROWSER);
 }
Beispiel #17
0
 public function __construct($widgetId, $title, $content, $propertiesAction = null, $minimized = false)
 {
     parent::__construct('dashboard/widget');
     $this->set('widgetId', $widgetId);
     $this->set('propertiesAction', $propertiesAction);
     $this->set('minimized', $minimized);
     $this->set('title', $title);
     $this->set('content', $content);
 }
Beispiel #18
0
 public function __construct(array $reports)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('translator', I18n::getInstance()->getTranslator());
     $this->set('reports', $reports);
     foreach ($reports as $index => $report) {
         $this->setSubview('report' . $index, $report->getView());
     }
 }
Beispiel #19
0
 /**
  * Constructs a new podcast detail view
  * @param joppa\podcast\model\data\PodcastData $podcast The podcast to display
  * @param string $audioUrl URL to the audio of this podcast
  * @param string $downloadUrl URL to the download of this podcast
  */
 public function __construct(PodcastData $podcast, $audioUrl, $downloadUrl = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('podcast', $podcast);
     $this->set('audioUrl', $audioUrl);
     $this->set('downloadUrl', $downloadUrl);
     $jplayer = new JPlayerView($audioUrl);
     $this->setSubview('player', $jplayer);
 }
Beispiel #20
0
 /**
  * Renders the notify container
  * @param boolean $return Flag to see if the output should be printed or returned
  * @return null|string
  */
 public function render($return = true)
 {
     $renderedNotificationViews = array();
     foreach ($this->notifications as $notificationView) {
         $renderedNotificationViews[] = $this->renderView($notificationView);
     }
     $this->set('notifications', $renderedNotificationViews);
     return parent::render($return);
 }
 /**
  * Constructs a new text properties view
  * @param joppa\text\form\TextPropertiesForm $form The form to edit the text
  * @param array $history Array with LogData containing the history of the text
  * @param string $historyUrl Action to view a text from the history
  * @param string $currentVersion The current version of the text
  * @return null
  */
 public function __construct(TextPropertiesForm $form, array $history, $historyUrl, $currentVersion)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->set('history', $history);
     $this->set('historyUrl', $historyUrl);
     $this->set('currentVersion', $currentVersion);
     $this->addStyle(self::STYLE);
     $this->addInlineJavascript('$("#textHistoryMore").click(function() { $("ul.historyMore").slideToggle("fast"); return false; });');
 }
 /**
  * Constructs a new forum post form view
  * @param ForumPostForm $form
  * @param unknown_type $title
  * @param unknown_type $preview
  * @return null
  */
 public function __construct(ForumPostForm $form, $title = null, $preview = null)
 {
     $messageField = $form->getField(ForumPostForm::FIELD_MESSAGE);
     $emoticonParser = $messageField->getEmoticonParser();
     parent::__construct(self::TEMPLATE);
     $this->set('form', $form);
     $this->set('title', $title);
     $this->set('preview', $preview);
     $this->set('emoticonParser', $emoticonParser);
 }
 /**
  * Constructs a new step view
  * @param zibo\orm\builder\wizard\BuilderWizard $wizard
  */
 public function __construct(BuilderWizard $wizard, $fieldsAction)
 {
     parent::__construct(self::TEMPLATE);
     $modelTable = $wizard->getVariable(BuilderWizard::VARIABLE_MODEL_TABLE);
     $fields = $modelTable->getFields();
     $isFieldNameRequired = count($fields) <= 1;
     $this->set('wizard', $wizard);
     $this->set('isFieldNameRequired', $isFieldNameRequired);
     $this->addInlineJavascript('ziboOrmInitializeBuilderWizardField(' . ($isFieldNameRequired ? 'true' : 'false') . ', "' . $fieldsAction . '");');
 }
 /**
  * Construct this view
  * @param string $query the search query
  * @param joppa\search\model\ContentResult $result for the search query
  * @param string $urlPage base url for pagination
  * @param int $page the current page
  * @return null
  */
 public function __construct($contentName, $query, ContentResult $result, $urlPage, $page, $pages)
 {
     parent::__construct('joppa/search/result.more');
     $this->set('contentName', $contentName);
     $this->set('query', $query);
     $this->set('result', $result);
     $this->set('urlPage', $urlPage);
     $this->set('page', $page);
     $this->set('pages', $pages);
 }
Beispiel #25
0
 /**
  * Constructs a new log data view
  * @param string $modelName Name of the model
  * @param int $id Primary key of the data
  * @return null
  */
 public function __construct(array $modelLogs)
 {
     parent::__construct(self::TEMPLATE);
     $logs = array();
     foreach ($modelLogs as $id => $modelLog) {
         $table = new LogChangeTable($modelLog->changes);
         $log = array('log' => $modelLog, 'table' => $table);
         $logs[] = $log;
     }
     $this->set('logs', $logs);
 }
Beispiel #26
0
 public function __construct($step, View $contentView = null)
 {
     $tempDirectory = Module::getTempDirectory();
     parent::__construct(self::TEMPLATE, $tempDirectory);
     $this->set('step', $step);
     $this->set('locale', I18n::getInstance()->getLocale()->getCode());
     if ($contentView) {
         $this->setSubview('content', $contentView);
     }
     $this->addStyle(self::STYLE);
 }
Beispiel #27
0
 /**
  * Constructs a new wizard view
  * @param zibo\library\wizard\Wizard $wizard The wizard
  * @param zibo\core\View $stepView View of the current step
  * @param
  * @return null
  */
 public function __construct(Wizard $wizard, View $stepView = null, $template = null)
 {
     if (!$template) {
         $template = self::TEMPLATE;
     }
     parent::__construct($template);
     $this->set('wizard', $wizard);
     if ($stepView) {
         $this->setSubview('wizardStep', $stepView);
     }
 }
 /**
  * Constructs a new view
  * @param zibo\library\html\table\ExtendedTable $table
  * @param string $urlAdd
  * @return null
  */
 public function __construct(ExtendedTable $categoriesTable, OrderForm $orderForm = null, $addAction = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('categoriesTable', $categoriesTable);
     $this->set('orderForm', $orderForm);
     $this->set('addAction', $addAction);
     $this->addJavascript(BaseView::SCRIPT_TABLE);
     $this->addJavascript(JQuery::SCRIPT_JQUERY_UI);
     $this->addJavascript(ForumManager::SCRIPT_MANAGER);
     $this->addInlineJavascript('joppaForumInitializeOrder("' . $categoriesTable->getId() . '");');
 }
Beispiel #29
0
 /**
  * Construct the sidebar view
  * @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(SearchForm $searchForm, array $namespaces, $namespaceAction, array $classes = null, $classAction = null, $currentNamespace = null, $currentClass = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->set('searchForm', $searchForm);
     $this->set('namespaces', $namespaces);
     $this->set('namespaceAction', $namespaceAction);
     $this->set('currentNamespace', $currentNamespace);
     $this->set('classes', $classes);
     $this->set('classAction', $classAction);
     $this->set('currentClass', $currentClass);
 }
 /**
  * Constructs a new authentication status panel
  * @return null
  */
 public function __construct()
 {
     parent::__construct(self::TEMPLATE);
     $user = SecurityManager::getInstance()->getUser();
     $request = Zibo::getInstance()->getRequest();
     $baseUrl = $request->getBaseUrl() . Request::QUERY_SEPARATOR;
     $basePath = $baseUrl . Module::ROUTE_AUTHENTICATION . Request::QUERY_SEPARATOR;
     $this->set('user', $user);
     $this->set('urlLogin', $basePath . AuthenticationController::ACTION_LOGIN);
     $this->set('urlLogout', $basePath . AuthenticationController::ACTION_LOGOUT);
     $this->set('urlProfile', $baseUrl . Module::ROUTE_PROFILE);
 }