/** Creates a web site citation */ function website() { //Add the contributors $ret = $this->formatAuthors($work->contributors); //Add the article title (if provided) if ($work->articleTitle) { //Uppercase all words in article title, lowercase all art., prep., & conj., append a period, and encapsulate in double quotes $articleTitle = ucwords($work->articleTitle); $articleTitle = Utility::lowerArticles($articleTitle); $articleTitle = Utility::addPeriod($articleTitle); $ret .= '"' . $articleTitle . '" '; } //Add the web site title (if provided) if ($work->webTitle) { $ret .= '<i>' . ucwords($work->webTitle) . '</i>' . '. '; } //Add the web site publisher/sponsor (if provided) if ($work->publisherSponsor) { $ret .= ucwords($work->publisherSponsor) . ', '; } else { $ret .= 'N.p., '; } //Add the electronically published date (if provided) $ret .= $this->formatPublishDate($work->electronicPublishDay, $work->electronicPublishMonth, $work->electronicPublishYear); //Add a period $ret .= '. '; //Add the medium $ret .= 'Web. '; //Add the access date (if provided) if ($work->webAccessDay || $work->webAccessMonth || $work->webAccessYear) { $ret .= $this->formatAccessDate($work->webAccessDay, $work->webAccessMonth, $work->webAccessYear) . '. '; } //Add the URL (if provided) if ($work->webUrl) { $ret .= '<'; $ret .= Utility::checkUrlPrepend($work->webUrl); $ret .= '>'; $ret .= '. '; } return $ret; }
/** * Format a book title (APA) * * @param $title * * @return string */ function formatBookTitle($title) { //Uppercase the first word in article title $ret = ucfirst(strtolower($title)); //If the article title contains a subtitle, capitalize the first word after the colon $ret = Utility::uppercaseSubtitle($ret); //Punctuate after the book title, if necessary $ret = Utility::addPeriod($ret); $ret = '<i>' . $ret . '</i>'; return $ret; }