/**
  * 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);
 }
Exemplo n.º 2
0
 /**
  * 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();');
 }
Exemplo n.º 3
0
 /**
  * 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);
 }
Exemplo n.º 4
0
 /**
  * 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 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 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);
 }
 /**
  * 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();');
 }
Exemplo n.º 8
0
 /**
  * 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);
 }
Exemplo n.º 9
0
 /**
  * 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);
 }
Exemplo n.º 11
0
 /**
  * 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);
 }
Exemplo n.º 12
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');
 }
Exemplo n.º 13
0
 /**
  * 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);
 }
Exemplo n.º 14
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);
 }
Exemplo n.º 15
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);
 }
Exemplo n.º 16
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);
 }
Exemplo n.º 17
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());
     }
 }
Exemplo n.º 18
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);
 }
 /**
  * Construct a new scaffold index view
  * @param boolean $isLocalized Flag to set whether the data is localized
  * @param zibo\library\html\table\Table $table Table with the model data
  * @param string $title Title for the page
  * @param array $actions Array with the URL for the action as key and the label as value
  * @return null
  */
 public function __construct(ModelMeta $meta, Table $table, $title, array $actions = null)
 {
     parent::__construct(self::TEMPLATE);
     $this->isLocalized = $meta->isLocalized();
     $this->set('table', $table);
     $this->set('title', $title);
     $this->set('actions', $actions);
     $this->addJavascript(BaseView::SCRIPT_TABLE);
 }
Exemplo n.º 20
0
 /**
  * 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; });');
 }
Exemplo n.º 21
0
 /**
  * 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);
 }
Exemplo n.º 22
0
 /**
  * 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);
 }
Exemplo n.º 24
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);
 }
Exemplo n.º 25
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);
 }
Exemplo n.º 26
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);
     }
 }
Exemplo n.º 27
0
 /**
  * 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() . '");');
 }
Exemplo n.º 28
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);
 }
Exemplo n.º 29
0
 /**
  * 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);
 }
Exemplo n.º 30
0
 /**
  * Constructs a new localize panel view
  * @param boolean $enabled True to enable the localize form, false to disable it
  * @return null
  */
 public function __construct($enabled = true)
 {
     parent::__construct(self::TEMPLATE);
     $form = new LocalizePanelForm();
     if ($enabled) {
         $this->addJavascript(self::SCRIPT_LOCALIZE);
         $this->addInlineJavascript('ziboAdminInitializeLocalizePanel();');
     } else {
         $form->setIsDisabled(true);
     }
     $this->set('form', $form);
 }