本文整理汇总了PHP中ListbuilderHandler::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP ListbuilderHandler::initialize方法的具体用法?PHP ListbuilderHandler::initialize怎么用?PHP ListbuilderHandler::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListbuilderHandler
的用法示例。
在下文中一共展示了ListbuilderHandler::initialize方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* @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)));
}
示例2: initialize
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);
}
示例3: initialize
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'));
}
示例4: initialize
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'));
}
示例5: initialize
/**
* @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'));
}
示例6: initialize
/**
* 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);
}
示例7: initialize
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'));
}
示例8: initialize
/**
* @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);
}
示例9: initialize
/**
* @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'));
}
示例10: initialize
/**
* @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);
}
示例11: initialize
/**
* @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);
}
示例12: initialize
/**
* 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);
}
示例13: initialize
/**
* @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);
}
示例14: initialize
/**
* @copydoc ListbuilderHandler::initialize()
*/
function initialize($request)
{
$this->setContext($request->getContext());
return parent::initialize($request);
}