/**
  * @copydoc SetupListbuilderHandler::initialize()
  */
 function initialize($request)
 {
     parent::initialize($request);
     $context = $request->getContext();
     $this->setTitle('plugins.generic.translator.localeFileContents');
     $this->setInstructions('plugins.generic.translator.localeFileContentsDescription');
     // Get and validate the locale and filename parameters
     $this->locale = $request->getUserVar('locale');
     if (!AppLocale::isLocaleValid($this->locale)) {
         fatalError('Invalid locale.');
     }
     $this->filename = $request->getUserVar('filename');
     if (!in_array($this->filename, TranslatorAction::getLocaleFiles($this->locale))) {
         fatalError('Invalid locale file specified!');
     }
     // Basic configuration
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_TEXT);
     $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL);
     $this->setSaveFieldName('localeKeys');
     self::$plugin->import('controllers.listbuilder.LocaleFileListbuilderGridCellProvider');
     $cellProvider = new LocaleFileListbuilderGridCellProvider($this->locale);
     // Key column
     $this->addColumn(new ListbuilderGridColumn($this, 'key', 'plugins.generic.translator.localeKey', null, self::$plugin->getTemplatePath() . 'localeFileKeyGridCell.tpl', $cellProvider, array('tabIndex' => 1)));
     // Value column (custom template displays English text)
     $this->addColumn(new ListbuilderGridColumn($this, 'value', 'plugins.generic.translator.localeKeyValue', null, self::$plugin->getTemplatePath() . 'localeFileValueGridCell.tpl', $cellProvider, array('tabIndex' => 2, 'width' => 70, 'alignment' => COLUMN_ALIGNMENT_LEFT)));
 }
 function initialize($request)
 {
     parent::initialize($request);
     // Add locale keys
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION);
     // Basic configuration
     $this->setTitle('submission.submit.addAuthor');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL);
     $this->setSaveFieldName('authors');
     // Fetch and authorize chapter
     $chapterDao = DAORegistry::getDAO('ChapterDAO');
     $monograph = $this->getMonograph();
     $chapter = $chapterDao->getChapter($request->getUserVar('chapterId'), $monograph->getId());
     if ($chapter) {
         // This is an existing chapter
         $this->setChapterId($chapter->getId());
     } else {
         // This is a new chapter
         $this->setChapterId(null);
     }
     // Name column
     $nameColumn = new ListbuilderGridColumn($this, 'name', 'common.name');
     // We can reuse the User cell provider because getFullName
     import('lib.pkp.controllers.listbuilder.users.UserListbuilderGridCellProvider');
     $nameColumn->setCellProvider(new UserListbuilderGridCellProvider());
     $this->addColumn($nameColumn);
 }
 function initialize(&$request)
 {
     parent::initialize($request);
     // Basic configuration
     $this->setSourceTitle('user.role.reviewers');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     // Drop-down select
     $this->setListTitle('user.role.reviewers');
     $this->loadList($request);
     $this->addColumn(new GridColumn('item', 'common.name'));
 }
 function initialize(&$request)
 {
     parent::initialize($request);
     // Basic configuration
     $this->setTitle('submission.files');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     // Free text input
     $this->setListTitle('editor.monograph.copyediting.currentFiles');
     $this->loadList($request);
     $this->loadPossibleItemList($request);
     $this->addColumn(new GridColumn('item', 'common.name'));
 }
 /**
  * @see PKPHandler::initialize()
  */
 function initialize(&$request)
 {
     parent::initialize($request);
     // Basic configuration.
     $this->setSourceTitle('common.name');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     $this->setListTitle('submission.submit.currentParticipants');
     // Load possible items.
     $this->_loadPossibleItemList($request);
     // Configure listbuilder column.
     $this->addColumn(new GridColumn('item', 'common.name'));
 }
 /**
  * Configure the grid
  * @param PKPRequest $request
  */
 function initialize($request)
 {
     parent::initialize($request);
     // Basic configuration
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL);
     $this->setSaveFieldName('files');
     // Add the file column
     $itemColumn = new ListbuilderGridColumn($this, 'name', 'common.name', null, null, null, array('anyhtml' => true));
     import('lib.pkp.controllers.listbuilder.files.FileListbuilderGridCellProvider');
     $itemColumn->setCellProvider(new FileListbuilderGridCellProvider());
     $this->addColumn($itemColumn);
 }
 function initialize(&$request)
 {
     parent::initialize($request);
     // Basic configuration
     $this->setTitle('listbuilder.contributors.addContributor');
     $this->setSourceTitle('common.name');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     // Free text input
     $this->setListTitle('submission.submit.currentContributors');
     $this->loadList($request);
     $this->loadPossibleItemList($request);
     $this->addColumn(new GridColumn('item', 'common.name'));
 }
 /**
  * @copydoc ListbuilderHandler::initialize()
  */
 function initialize($request)
 {
     parent::initialize($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_ADMIN);
     // Basic configuration
     $this->setTitle('admin.categories');
     $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL);
     $this->setSaveFieldName('categories');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_TEXT);
     // Title column
     $titleColumn = new MultilingualListbuilderGridColumn($this, 'name', 'common.name', null, null, null, null, array('tabIndex' => 1));
     import('controllers.listbuilder.admin.categories.CategoryListbuilderGridCellProvider');
     $titleColumn->setCellProvider(new CategoryListbuilderGridCellProvider());
     $this->addColumn($titleColumn);
 }
 /**
  * @see PKPHandler::initialize()
  */
 function initialize(&$request)
 {
     parent::initialize($request);
     $userId = (int) $request->getUserVar('userId');
     $this->setUserId($userId);
     // Basic configuration
     $this->setTitle($request->getUserVar('title'));
     $this->setSourceTitle('manager.users.availableRoles');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     $this->setListTitle('manager.users.currentRoles');
     $this->setAdditionalData(array('userId' => $userId));
     $this->_loadPossibleItemList($request);
     $this->_loadList($request);
     $this->addColumn(new GridColumn('item', 'common.name'));
     $this->addColumn(new GridColumn('attribute', 'common.designation'));
 }
Esempio n. 10
0
 /**
  * @copydoc PKPHandler::initialize()
  */
 function initialize($request)
 {
     parent::initialize($request);
     // Load submission-specific translations
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION);
     import('lib.pkp.classes.linkAction.request.NullAction');
     $this->addAction(new LinkAction('addItem', new NullAction(), __('grid.action.addUser'), 'add_user'));
     // Basic configuration.
     $this->setTitle('editor.submission.stageParticipants');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL);
     $this->setSaveFieldName('users');
     // Name column
     $nameColumn = new ListbuilderGridColumn($this, 'name', 'common.name');
     import('lib.pkp.controllers.listbuilder.users.UserListbuilderGridCellProvider');
     $cellProvider = new UserListbuilderGridCellProvider();
     $nameColumn->setCellProvider($cellProvider);
     $this->addColumn($nameColumn);
 }
 /**
  * @copydoc PKPHandler::initialize()
  */
 function initialize($request)
 {
     // FIXME Validate user ID?
     // Load user-related translations.
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER);
     $this->setUserId((int) $request->getUserVar('userId'));
     $this->setContext($request->getContext());
     parent::initialize($request);
     // Basic configuration
     $this->setTitle($request->getUserVar('title'));
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL);
     $this->setSaveFieldName('roles');
     import('lib.pkp.controllers.listbuilder.users.UserGroupListbuilderGridCellProvider');
     $cellProvider = new UserGroupListbuilderGridCellProvider();
     // Name column
     $nameColumn = new ListbuilderGridColumn($this, 'name', 'common.name', null, null, $cellProvider, array('width' => 75, 'alignment' => COLUMN_ALIGNMENT_LEFT));
     $this->addColumn($nameColumn);
     // Designation column
     $designationColumn = new ListbuilderGridColumn($this, 'designation', 'common.designation', null, 'controllers/listbuilder/listbuilderNonEditGridCell.tpl', $cellProvider, array('width' => 25, 'alignment' => COLUMN_ALIGNMENT_LEFT));
     $this->addColumn($designationColumn);
 }
 /**
  * Configure the grid
  * @param PKPRequest $request
  */
 function initialize($request)
 {
     parent::initialize($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_APP_SUBMISSION);
     // Basic configuration
     $this->setPress($request->getPress());
     $this->setTitle('submission.submit.placement.categories');
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT);
     $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL);
     $this->setSaveFieldName('categories');
     $this->setSubmissionId($request->getUserVar('submissionId'));
     // Name column
     $nameColumn = new ListbuilderGridColumn($this, 'name', 'common.name');
     import('controllers.listbuilder.categories.CategoryListbuilderGridCellProvider');
     $nameColumn->setCellProvider(new CategoryListbuilderGridCellProvider());
     $this->addColumn($nameColumn);
 }
 /**
  * @see ListbuilderHandler::initialize()
  */
 function initialize($request)
 {
     // Basic configuration.
     // Currently this component only works with
     // these configurations, but, if needed, it's
     // easy to adapt this class to work with the other
     // listbuilders configuration.
     parent::initialize($request, false);
     $this->setSourceType(LISTBUILDER_SOURCE_TYPE_NONE);
     $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL);
 }
 /**
  * @copydoc ListbuilderHandler::initialize()
  */
 function initialize($request)
 {
     $this->setContext($request->getContext());
     return parent::initialize($request);
 }