本文整理匯總了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();