本文整理汇总了PHP中ReferenceManager::createAuthor方法的典型用法代码示例。如果您正苦于以下问题:PHP ReferenceManager::createAuthor方法的具体用法?PHP ReferenceManager::createAuthor怎么用?PHP ReferenceManager::createAuthor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReferenceManager
的用法示例。
在下文中一共展示了ReferenceManager::createAuthor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if ($authArr) {
$listHtml .= '<ul>';
foreach ($authArr as $k => $v) {
$listHtml .= '<li>';
$listHtml .= '<a href="authoreditor.php?authid=' . $k . '" target="_blank">' . $v . '</a>';
$listHtml .= ' <input type="image" style="margin-left:5px;" src="../images/del.png" onclick="deleteRefAuthor(' . $k . ');" title="Delete author">';
$listHtml .= '</li>';
}
$listHtml .= '</ul>';
} else {
$listHtml .= '<div><b>There are currently no authors connected with this reference.</b></div>';
}
echo $listHtml;
}
if ($action == "createauthor") {
$refManager->createAuthor($firstName, $middleName, $lastName);
$refAuthId = $refManager->getRefAuthId();
$refManager->addAuthor($refId, $refAuthId);
$authArr = $refManager->getRefAuthArr($refId);
$listHtml = '';
if ($authArr) {
$listHtml .= '<ul>';
foreach ($authArr as $k => $v) {
$listHtml .= '<li>';
$listHtml .= '<a href="authoreditor.php?authid=' . $k . '" target="_blank">' . $v . '</a>';
$listHtml .= ' <input type="image" style="margin-left:5px;" src="../images/del.png" onclick="deleteRefAuthor(' . $k . ');" title="Delete author">';
$listHtml .= '</li>';
}
$listHtml .= '</ul>';
} else {
$listHtml .= '<div><b>There are currently no authors connected with this reference.</b></div>';
示例2: ReferenceManager
<?php
include_once '../config/symbini.php';
include_once $serverRoot . '/classes/ReferenceManager.php';
$refId = array_key_exists('refid', $_REQUEST) ? $_REQUEST['refid'] : 0;
$authId = array_key_exists('authid', $_REQUEST) ? $_REQUEST['authid'] : 0;
$addAuth = array_key_exists('addauth', $_REQUEST) ? $_REQUEST['addauth'] : 0;
$formSubmit = array_key_exists('formsubmit', $_POST) ? $_POST['formsubmit'] : '';
$refManager = new ReferenceManager();
$authArr = '';
$authExist = false;
$statusStr = '';
if ($formSubmit) {
if ($formSubmit == 'Add Author') {
$refManager->createAuthor($_POST['firstname'], $_POST['middlename'], $_POST['lastname']);
$authId = $refManager->getRefAuthId();
}
if ($formSubmit == 'Edit Author') {
$statusStr = $refManager->editAuthor($_POST);
}
if ($formSubmit == 'Delete Author') {
$statusStr = $refManager->deleteAuthor($authId);
$authId = 0;
}
}
if (!$addAuth) {
if ($authId) {
$authInfoArr = $refManager->getAuthInfo($authId);
$authPubArr = $refManager->getAuthPubList($authId);
} else {
$authArr = $refManager->getAuthList();