本文整理汇总了PHP中Author::getFullName方法的典型用法代码示例。如果您正苦于以下问题:PHP Author::getFullName方法的具体用法?PHP Author::getFullName怎么用?PHP Author::getFullName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Author
的用法示例。
在下文中一共展示了Author::getFullName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleAuthorNode
function handleAuthorNode(&$journal, &$authorNode, &$issue, &$section, &$article, &$errors)
{
$errors = array();
$journalSupportedLocales = array_keys($journal->getSupportedLocaleNames());
// => journal locales must be set up before
$journalPrimaryLocale = $journal->getPrimaryLocale();
$author = new Author();
if ($node = $authorNode->getChildByName('firstname')) {
$author->setFirstName($node->getValue());
}
if ($node = $authorNode->getChildByName('middlename')) {
$author->setMiddleName($node->getValue());
}
if ($node = $authorNode->getChildByName('lastname')) {
$author->setLastName($node->getValue());
}
for ($index = 0; $node = $authorNode->getChildByName('affiliation', $index); $index++) {
$locale = $node->getAttribute('locale');
if ($locale == '') {
$locale = $journalPrimaryLocale;
} elseif (!in_array($locale, $journalSupportedLocales)) {
$errors[] = array('plugins.importexport.native.import.error.articleAuthorAffiliationLocaleUnsupported', array('authorFullName' => $author->getFullName(), 'articleTitle' => $article->getLocalizedTitle(), 'issueTitle' => $issue->getIssueIdentification(), 'locale' => $locale));
return false;
}
$author->setAffiliation($node->getValue(), $locale);
}
if ($node = $authorNode->getChildByName('country')) {
$author->setCountry($node->getValue());
}
if ($node = $authorNode->getChildByName('email')) {
$author->setEmail($node->getValue());
}
if ($node = $authorNode->getChildByName('url')) {
$author->setUrl($node->getValue());
}
for ($index = 0; $node = $authorNode->getChildByName('competing_interests', $index); $index++) {
$locale = $node->getAttribute('locale');
if ($locale == '') {
$locale = $journalPrimaryLocale;
} elseif (!in_array($locale, $journalSupportedLocales)) {
$errors[] = array('plugins.importexport.native.import.error.articleAuthorCompetingInterestsLocaleUnsupported', array('authorFullName' => $author->getFullName(), 'articleTitle' => $article->getLocalizedTitle(), 'issueTitle' => $issue->getIssueIdentification(), 'locale' => $locale));
return false;
}
$author->setCompetingInterests($node->getValue(), $locale);
}
for ($index = 0; $node = $authorNode->getChildByName('biography', $index); $index++) {
$locale = $node->getAttribute('locale');
if ($locale == '') {
$locale = $journalPrimaryLocale;
} elseif (!in_array($locale, $journalSupportedLocales)) {
$errors[] = array('plugins.importexport.native.import.error.articleAuthorBiographyLocaleUnsupported', array('authorFullName' => $author->getFullName(), 'articleTitle' => $article->getLocalizedTitle(), 'issueTitle' => $issue->getIssueIdentification(), 'locale' => $locale));
return false;
}
$author->setBiography($node->getValue(), $locale);
}
$author->setPrimaryContact($authorNode->getAttribute('primary_contact') === 'true' ? 1 : 0);
$article->addAuthor($author);
// instead of $author->setSequence($index+1);
return true;
}
示例2: handleAuthorNode
function handleAuthorNode(&$conference, &$schedConf, &$authorNode, &$track, &$paper, &$errors)
{
$errors = array();
$conferenceSupportedLocales = array_keys($conference->getSupportedLocaleNames());
// => conference locales must be set up before
$conferencePrimaryLocale = $conference->getPrimaryLocale();
$author = new Author();
if ($node = $authorNode->getChildByName('firstname')) {
$author->setFirstName($node->getValue());
}
if ($node = $authorNode->getChildByName('middlename')) {
$author->setMiddleName($node->getValue());
}
if ($node = $authorNode->getChildByName('lastname')) {
$author->setLastName($node->getValue());
}
if ($node = $authorNode->getChildByName('affiliation')) {
$author->setAffiliation($node->getValue());
}
if ($node = $authorNode->getChildByName('country')) {
$author->setCountry($node->getValue());
}
if ($node = $authorNode->getChildByName('email')) {
$author->setEmail($node->getValue());
}
if ($node = $authorNode->getChildByName('url')) {
$author->setUrl($node->getValue());
}
for ($index = 0; $node = $authorNode->getChildByName('biography', $index); $index++) {
$locale = $node->getAttribute('locale');
if ($locale == '') {
$locale = $conferencePrimaryLocale;
} elseif (!in_array($locale, $conferenceSupportedLocales)) {
$errors[] = array('plugins.importexport.native.import.error.paperAuthorBiographyLocaleUnsupported', array('authorFullName' => $author->getFullName(), 'paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale));
return false;
}
$author->setBiography($node->getValue(), $locale);
}
$author->setPrimaryContact($authorNode->getAttribute('primary_contact') === 'true' ? 1 : 0);
$paper->addAuthor($author);
// instead of $author->setSequence($index+1);
return true;
}
示例3: appendFormattedElement
public function appendFormattedElement(&$wrapper, $data, $encode = false)
{
if (!is_array($data['author_id'])) {
$data['author_id'] = array($data['author_id']);
}
$list = new XMLElement($this->get('element_name'));
foreach ($data['author_id'] as $author_id) {
$author = new Author($author_id);
$list->appendChild(new XMLElement('item', $author->getFullName(), array('id' => (string) $author->get('id'), 'username' => General::sanitize($author->get('username')))));
}
$wrapper->appendChild($list);
}
示例4: __form
public function __form()
{
require_once TOOLKIT . '/class.field.php';
// Handle unknown context
if (!in_array($this->_context[0], array('new', 'edit'))) {
Administration::instance()->errorPageNotFound();
}
if ($this->_context[0] == 'new' && !Administration::instance()->Author->isDeveloper()) {
Administration::instance()->customError(__('Access Denied'), __('You are not authorised to access this page.'));
}
if (isset($this->_context[2])) {
switch ($this->_context[2]) {
case 'saved':
$this->pageAlert(__('Author updated at %s.', array(DateTimeObj::getTimeAgo())) . ' <a href="' . SYMPHONY_URL . '/system/authors/new/" accesskey="c">' . __('Create another?') . '</a> <a href="' . SYMPHONY_URL . '/system/authors/" accesskey="a">' . __('View all Authors') . '</a>', Alert::SUCCESS);
break;
case 'created':
$this->pageAlert(__('Author created at %s.', array(DateTimeObj::getTimeAgo())) . ' <a href="' . SYMPHONY_URL . '/system/authors/new/" accesskey="c">' . __('Create another?') . '</a> <a href="' . SYMPHONY_URL . '/system/authors/" accesskey="a">' . __('View all Authors') . '</a>', Alert::SUCCESS);
break;
}
}
$this->setPageType('form');
$isOwner = false;
if (isset($_POST['fields'])) {
$author = $this->_Author;
} else {
if ($this->_context[0] == 'edit') {
if (!($author_id = $this->_context[1])) {
redirect(SYMPHONY_URL . '/system/authors/');
}
if (!($author = AuthorManager::fetchByID($author_id))) {
Administration::instance()->customError(__('Author not found'), __('The author profile you requested does not exist.'));
}
} else {
$author = new Author();
}
}
if ($this->_context[0] == 'edit' && $author->get('id') == Administration::instance()->Author->get('id')) {
$isOwner = true;
}
if ($this->_context[0] == 'edit' && !$isOwner && !Administration::instance()->Author->isDeveloper()) {
Administration::instance()->customError(__('Access Denied'), __('You are not authorised to edit other authors.'));
}
$this->setTitle(__($this->_context[0] == 'new' ? '%2$s – %3$s' : '%1$s – %2$s – %3$s', array($author->getFullName(), __('Authors'), __('Symphony'))));
$this->appendSubheading($this->_context[0] == 'new' ? __('Untitled') : $author->getFullName());
$this->insertBreadcrumbs(array(Widget::Anchor(__('Authors'), SYMPHONY_URL . '/system/authors/')));
// Essentials
$group = new XMLElement('fieldset');
$group->setAttribute('class', 'settings');
$group->appendChild(new XMLElement('legend', __('Essentials')));
$div = new XMLElement('div');
$div->setAttribute('class', 'two columns');
$label = Widget::Label(__('First Name'), NULL, 'column');
$label->appendChild(Widget::Input('fields[first_name]', $author->get('first_name')));
$div->appendChild(isset($this->_errors['first_name']) ? Widget::Error($label, $this->_errors['first_name']) : $label);
$label = Widget::Label(__('Last Name'), NULL, 'column');
$label->appendChild(Widget::Input('fields[last_name]', $author->get('last_name')));
$div->appendChild(isset($this->_errors['last_name']) ? Widget::Error($label, $this->_errors['last_name']) : $label);
$group->appendChild($div);
$label = Widget::Label(__('Email Address'));
$label->appendChild(Widget::Input('fields[email]', $author->get('email')));
$group->appendChild(isset($this->_errors['email']) ? Widget::Error($label, $this->_errors['email']) : $label);
$this->Form->appendChild($group);
// Login Details
$group = new XMLElement('fieldset');
$group->setAttribute('class', 'settings');
$group->appendChild(new XMLElement('legend', __('Login Details')));
$div = new XMLElement('div');
$label = Widget::Label(__('Username'));
$label->appendChild(Widget::Input('fields[username]', $author->get('username')));
$div->appendChild(isset($this->_errors['username']) ? Widget::Error($label, $this->_errors['username']) : $label);
// Only developers can change the user type. Primary account should NOT be able to change this
if (Administration::instance()->Author->isDeveloper() && !$author->isPrimaryAccount()) {
// Create columns
$div->setAttribute('class', 'two columns');
$label->setAttribute('class', 'column');
// User type
$label = Widget::Label(__('User Type'), NULL, 'column');
$options = array(array('author', false, __('Author')), array('developer', $author->isDeveloper(), __('Developer')));
$label->appendChild(Widget::Select('fields[user_type]', $options));
$div->appendChild($label);
}
$group->appendChild($div);
// Password
$fieldset = new XMLElement('fieldset', NULL, array('class' => 'two columns', 'id' => 'password'));
$legend = new XMLElement('legend', __('Password'));
$help = new XMLElement('i', __('Leave password fields blank to keep the current password'));
$fieldset->appendChild($legend);
$fieldset->appendChild($help);
// Password reset
if ($this->_context[0] == 'edit' && (!Administration::instance()->Author->isDeveloper() || $isOwner === true)) {
$fieldset->setAttribute('class', 'three columns');
$label = Widget::Label(NULL, NULL, 'column');
$label->appendChild(Widget::Input('fields[old-password]', NULL, 'password', array('placeholder' => __('Old Password'))));
$fieldset->appendChild(isset($this->_errors['old-password']) ? Widget::Error($label, $this->_errors['password']) : $label);
}
// New password
$callback = Administration::instance()->getPageCallback();
$placeholder = $callback['context'][0] == 'edit' ? __('New Password') : __('Password');
$label = Widget::Label(NULL, NULL, 'column');
$label->appendChild(Widget::Input('fields[password]', NULL, 'password', array('placeholder' => $placeholder)));
//.........这里部分代码省略.........
示例5: switch
function __form()
{
require_once TOOLKIT . '/class.field.php';
## Handle unknow context
if (!in_array($this->_context[0], array('new', 'edit'))) {
$this->_Parent->errorPageNotFound();
}
if ($this->_context[0] == 'new' && !Administration::instance()->Author->isDeveloper()) {
$this->_Parent->customError(E_USER_ERROR, 'Access Denied', 'You are not authorised to access this page.');
}
if (isset($this->_context[2])) {
switch ($this->_context[2]) {
case 'saved':
$this->pageAlert(__('Author updated at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all Authors</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), URL . '/symphony/system/authors/new/', URL . '/symphony/system/authors/')), Alert::SUCCESS);
break;
case 'created':
$this->pageAlert(__('Author created at %1$s. <a href="%2$s">Create another?</a> <a href="%3$s">View all Authors</a>', array(DateTimeObj::getTimeAgo(__SYM_TIME_FORMAT__), URL . '/symphony/system/authors/new/', URL . '/symphony/system/authors/')), Alert::SUCCESS);
break;
}
}
$this->setPageType('form');
$isOwner = false;
if (isset($_POST['fields'])) {
$author = $this->_Author;
} elseif ($this->_context[0] == 'edit') {
if (!($author_id = $this->_context[1])) {
redirect(URL . '/symphony/system/authors/');
}
if (!($author = AuthorManager::fetchByID($author_id))) {
$this->_Parent->customError(E_USER_ERROR, 'Author not found', 'The author profile you requested does not exist.');
}
} else {
$author = new Author();
}
if ($this->_context[0] == 'edit' && $author->get('id') == Administration::instance()->Author->get('id')) {
$isOwner = true;
}
if ($this->_context[0] == 'edit' && !$isOwner && !Administration::instance()->Author->isDeveloper()) {
$this->_Parent->customError(E_USER_ERROR, 'Access Denied', 'You are not authorised to edit other authors.');
}
$this->setTitle(__($this->_context[0] == 'new' ? '%1$s – %2$s – %3$s' : '%1$s – %2$s', array(__('Symphony'), __('Authors'), $author->getFullName())));
$this->appendSubheading($this->_context[0] == 'new' ? __('Untitled') : $author->getFullName());
### Essentials ###
$group = new XMLElement('fieldset');
$group->setAttribute('class', 'settings');
$group->appendChild(new XMLElement('legend', __('Essentials')));
$div = new XMLElement('div');
$div->setAttribute('class', 'group');
$label = Widget::Label(__('First Name'));
$label->appendChild(Widget::Input('fields[first_name]', $author->get('first_name')));
$div->appendChild(isset($this->_errors['first_name']) ? $this->wrapFormElementWithError($label, $this->_errors['first_name']) : $label);
$label = Widget::Label(__('Last Name'));
$label->appendChild(Widget::Input('fields[last_name]', $author->get('last_name')));
$div->appendChild(isset($this->_errors['last_name']) ? $this->wrapFormElementWithError($label, $this->_errors['last_name']) : $label);
$group->appendChild($div);
$label = Widget::Label(__('Email Address'));
$label->appendChild(Widget::Input('fields[email]', $author->get('email')));
$group->appendChild(isset($this->_errors['email']) ? $this->wrapFormElementWithError($label, $this->_errors['email']) : $label);
$this->Form->appendChild($group);
###
### Login Details ###
$group = new XMLElement('fieldset');
$group->setAttribute('class', 'settings');
$group->appendChild(new XMLElement('legend', __('Login Details')));
$div = new XMLElement('div');
$div->setAttribute('class', 'group');
$label = Widget::Label(__('Username'));
$label->appendChild(Widget::Input('fields[username]', $author->get('username'), NULL));
$div->appendChild(isset($this->_errors['username']) ? $this->wrapFormElementWithError($label, $this->_errors['username']) : $label);
// Only developers can change the user type. Primary account should NOT be able to change this
if (Administration::instance()->Author->isDeveloper() && !$author->isPrimaryAccount()) {
$label = Widget::Label(__('User Type'));
$options = array(array('author', false, __('Author')), array('developer', $author->isDeveloper(), __('Developer')));
$label->appendChild(Widget::Select('fields[user_type]', $options));
$div->appendChild($label);
}
$group->appendChild($div);
$div = new XMLElement('div', NULL, array('class' => 'group'));
if ($this->_context[0] == 'edit') {
$div->setAttribute('id', 'change-password');
if (!Administration::instance()->Author->isDeveloper() || $isOwner === true) {
$div->setAttribute('class', 'triple group');
$label = Widget::Label(__('Old Password'));
if (isset($this->_errors['old-password'])) {
$label->setAttributeArray(array('class' => 'contains-error', 'title' => $this->_errors['old-password']));
}
$label->appendChild(Widget::Input('fields[old-password]', NULL, 'password'));
$div->appendChild(isset($this->_errors['old-password']) ? $this->wrapFormElementWithError($label, $this->_errors['old-password']) : $label);
}
}
$label = Widget::Label($this->_context[0] == 'edit' ? __('New Password') : __('Password'));
$label->appendChild(Widget::Input('fields[password]', NULL, 'password'));
$div->appendChild(isset($this->_errors['password']) ? $this->wrapFormElementWithError($label, $this->_errors['password']) : $label);
$label = Widget::Label($this->_context[0] == 'edit' ? __('Confirm New Password') : __('Confirm Password'));
if (isset($this->_errors['password-confirmation'])) {
$label->setAttributeArray(array('class' => 'contains-error', 'title' => $this->_errors['password-confirmation']));
}
$label->appendChild(Widget::Input('fields[password-confirmation]', NULL, 'password'));
$div->appendChild($label);
$group->appendChild($div);
//.........这里部分代码省略.........