本文整理汇总了PHP中Format::getPrevious方法的典型用法代码示例。如果您正苦于以下问题:PHP Format::getPrevious方法的具体用法?PHP Format::getPrevious怎么用?PHP Format::getPrevious使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format::getPrevious方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
public function header($id)
{
$title = Format::getLongDescription($id);
static $cssLinks = null;
if ($cssLinks === null) {
$cssLinks = $this->createCSSLinks();
}
$header = <<<HEADER
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>{$title}</title>
{$cssLinks}
</head>
<body class="docs">
HEADER;
$next = $prev = $up = array("href" => null, "desc" => null);
$nextLink = $prevLink = $upLink = '';
if ($prevId = Format::getPrevious($id)) {
$prev = array("href" => $this->getFilename($prevId) . $this->getExt(), "desc" => $this->getShortDescription($prevId));
$prevLink = "<li style=\"float: left;\"><a href=\"{$prev["href"]}\">« {$prev["desc"]}</a></li>";
}
if ($nextId = Format::getNext($id)) {
$next = array("href" => $this->getFilename($nextId) . $this->getExt(), "desc" => $this->getShortDescription($nextId));
$nextLink = "<li style=\"float: right;\"><a href=\"{$next["href"]}\">{$next["desc"]} »</a></li>";
}
if ($parentId = Format::getParent($id)) {
$up = array("href" => $this->getFilename($parentId) . $this->getExt(), "desc" => $this->getShortDescription($parentId));
if ($up['href'] != 'index.html') {
$upLink = "<li><a href=\"{$up["href"]}\">{$up["desc"]}</a></li>";
}
}
$nav = <<<NAV
<div class="navbar navbar-fixed-top">
<div class="navbar-inner clearfix">
<ul class="nav" style="width: 100%">
{$prevLink}
{$nextLink}
</ul>
</div>
</div>
<div id="breadcrumbs" class="clearfix">
<ul class="breadcrumbs-container">
<li><a href="index.html">PHP Manual</a></li>
{$upLink}
<li>{$title}</li>
</ul>
</div>
<div id="layout">
<div id="layout-content">
NAV;
$header .= $nav;
return $header;
}
示例2: header
/**
* Add the header to this file.
*
* @param string $id The id of this chunk
*
* @return string
*/
public function header($id)
{
$ext = $this->ext;
$parent = Format::getParent($id);
//we link toc feeds if there are children
if (count($this->getChildren($id)) > 0) {
$extraHeader = <<<XML
<link rel="alternate" type="application/atom+xml" title="Live Bookmarks" href="feeds/{$id}.atom" />
XML;
} else {
$extraHeader = '';
}
if (!$parent || $parent == 'ROOT') {
return '<?php
sendManualHeaders("UTF-8","en");
setupNavigation(array(
"home" => array("index.php", "' . addslashes($this->title) . '"),
"prev" => array("#", ""),
"next" => array("#", ""),
"up" => array("#", ""),
"toc" => array(
array("#", ""))));
manualHeader("index.php"' . ', ' . var_export($this->title, true) . ', ' . var_export($extraHeader, true) . ');
?>
';
}
$toc = array();
$siblingIDs = Format::getChildren($parent);
foreach ($siblingIDs as $sid) {
$sdesc = Format::getShortDescription($sid);
$ldesc = Format::getLongDescription($sid);
$toc[] = array($sid . $ext, empty($sdesc) ? $ldesc : $sdesc);
}
$prev = $next = array(null, null);
if ($prevID = Format::getPrevious($id)) {
$prev = array(Format::getFilename($prevID) . $ext, Format::getLongDescription($prevID));
}
if ($nextID = Format::getNext($id)) {
$next = array(Format::getFilename($nextID) . $ext, Format::getLongDescription($nextID));
}
// Build the PEAR navigation table
$nav = array('home' => array('index' . $ext, $this->title), 'prev' => $prev, 'next' => $next, 'up' => array($this->getFilename($parent) . $ext, Format::getLongDescription($parent)), 'toc' => $toc);
return "<?php \n" . "sendManualHeaders(\"UTF-8\", \"{$this->lang}\");\n" . "setupNavigation(" . var_export($nav, true) . ");\n" . 'manualHeader("' . $this->getFilename($id) . $ext . '"' . ', ' . var_export(Format::getLongDescription($id), true) . ', ' . var_export($extraHeader, true) . ');' . "\n" . "?>\n";
}
示例3: header
public function header($id)
{
$title = Format::getLongDescription($id);
static $cssLinks = null;
if ($cssLinks === null) {
$cssLinks = $this->createCSSLinks();
}
$header = <<<HEADER
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>{$title}</title>
{$cssLinks}
</head>
<body>
HEADER;
$parent = Format::getParent($id);
$next = $prev = $up = array("href" => null, "desc" => null);
if ($parent && $parent != "ROOT") {
if ($prevId = Format::getPrevious($id)) {
$prev = array("href" => $this->getFilename($prevId) . $this->getExt(), "desc" => $this->getShortDescription($prevId));
}
if ($nextId = Format::getNext($id)) {
$next = array("href" => $this->getFilename($nextId) . $this->getExt(), "desc" => $this->getShortDescription($nextId));
}
if ($parentId = Format::getParent($id)) {
$up = array("href" => $this->getFilename($parentId) . $this->getExt(), "desc" => $this->getShortDescription($parentId));
}
}
$nav = <<<NAV
<div class="manualnavbar" style="text-align: center;">
<div class="prev" style="text-align: left; float: left;"><a href="{$prev["href"]}">{$prev["desc"]}</a></div>
<div class="next" style="text-align: right; float: right;"><a href="{$next["href"]}">{$next["desc"]}</a></div>
<div class="up"><a href="{$up["href"]}">{$up["desc"]}</a></div>
<div class="home"><a href="index.html">PHP Manual</a></div>
</div>
NAV;
$header .= $nav . "<hr />";
$this->nav = $nav;
return $header;
}
示例4: header
public function header($id)
{
$title = Format::getShortDescription($id);
$parent = Format::getParent($id);
$next = $prev = $up = array(null, null);
if ($parent && $parent != "ROOT") {
$siblings = Format::getChildren($parent);
if ($nextId = Format::getNext($id)) {
$next = array(Format::getFilename($nextId) . $this->getExt(), Format::getShortDescription($nextId));
}
if ($prevId = Format::getPrevious($id)) {
$prev = array(Format::getFilename($prevId) . $this->getExt(), Format::getShortDescription($prevId));
}
$up = array($parent . $this->getExt(), Format::getShortDescription($parent));
}
$this->nav = <<<NAV
<div style="text-align: center;">
<div class="prev" style="text-align: left; float: left;"><a href="{$prev[0]}">{$prev[1]}</a></div>
<div class="next" style="text-align: right; float: right;"><a href="{$next[0]}">{$next[1]}</a></div>
<div class="up"><a href="{$up[0]}">{$up[1]}</a></div>
</div>
NAV;
return "<?php include_once '../include/init.inc.php'; echo site_header('{$title}');?>\n" . $this->nav . "<hr />\n";
}
示例5: header
public function header($id)
{
static $written_toc = array();
$ext = $this->getExt();
$parent = Format::getParent($id);
$filename = "toc" . DIRECTORY_SEPARATOR . $parent . ".inc";
$up = array(0 => null, 1 => null);
$incl = '';
$next = $prev = array(null, null);
if ($parent && $parent != "ROOT") {
$siblings = Format::getChildren($parent);
if (!isset($written_toc[$filename])) {
$written_toc[$filename] = true;
$toc = $toc_deprecated = array();
foreach ($siblings as $sid) {
$sibling_short_desc = Format::getShortDescription($sid);
$entry = array(Format::getFilename($sid) . $ext, $sibling_short_desc);
if (isset($this->deprecated[$sibling_short_desc])) {
$toc_deprecated[] = $entry;
} else {
$toc[] = $entry;
}
}
$parents = array();
$p = $parent;
while (($p = Format::getParent($p)) && $p != "ROOT") {
$parents[] = array(Format::getFilename($p) . $ext, Format::getShortDescription($p));
}
$content = '<?php
$TOC = ' . var_export($toc, true) . ';
$TOC_DEPRECATED = ' . var_export($toc_deprecated, true) . ';
$PARENTS = ' . var_export($parents, true) . ';';
file_put_contents($this->getOutputDir() . $filename, $content);
v("Wrote TOC (%s)", $this->getOutputDir() . $filename, VERBOSE_TOC_WRITING);
}
$incl = 'include_once dirname(__FILE__) ."/toc/' . $parent . '.inc";';
$up = array(Format::getFilename($parent) . $ext, Format::getShortDescription($parent));
if ($prevId = Format::getPrevious($id)) {
$prev = array(Format::getFilename($prevId) . $ext, Format::getShortDescription($prevId));
}
if ($nextId = Format::getNext($id)) {
$next = array(Format::getFilename($nextId) . $ext, Format::getShortDescription($nextId));
}
}
$setup = array("home" => array('index' . $ext, $this->getTitle()), "head" => array("UTF-8", $this->lang), "this" => array($id . $ext, Format::getShortDescription($id)), "up" => $up, "prev" => $prev, "next" => $next, "alternatives" => $this->cchunk["alternatives"]);
if ($this->getChildren($id)) {
$lang = Config::language();
$setup["extra_header_links"] = array("rel" => "alternate", "href" => "/manual/{$lang}/feeds/{$id}.atom", "type" => "application/atom+xml");
}
$var = var_export($setup, true);
return '<?php
include_once $_SERVER[\'DOCUMENT_ROOT\'] . \'/include/shared-manual.inc\';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
' . $incl . '
$setup = ' . $var . ';
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
';
}
示例6: header
public function header($id)
{
$title = $this->getLongDescription($id);
$lang = Config::language();
$root = Format::getRootIndex();
static $cssLinks = null;
if ($cssLinks === null) {
$cssLinks = $this->createCSSLinks();
}
$prev = $next = $parent = array("href" => null, "desc" => null);
if ($parentId = $this->getParent($id)) {
$parent = array("href" => $this->getFilename($parentId) . $this->getExt(), "desc" => $this->getShortDescription($parentId));
}
if ($prevId = Format::getPrevious($id)) {
$prev = array("href" => Format::getFilename($prevId) . $this->getExt(), "desc" => $this->getShortDescription($prevId));
}
if ($nextId = Format::getNext($id)) {
$next = array("href" => Format::getFilename($nextId) . $this->getExt(), "desc" => $this->getShortDescription($nextId));
}
$navBar = $this->createNavBar($id);
return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $lang . '" lang="' . $lang . '">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>' . ($title != $root["ldesc"] ? $root["ldesc"] . ': ' : "") . $title . '</title>
' . $cssLinks . '
</head>
<body>
<table width="100%">
<tr valign="top">
<td style="font-size: smaller;" width="15%">
' . $navBar . '
</td>
<td width="85%">
<div style="text-align: center;">
' . ($prevId ? '<div class="prev" style="text-align: left; float: left;"><a href="' . $prev["href"] . '">' . $prev["desc"] . '</a></div>' : '') . '
' . ($nextId ? '<div class="next" style="text-align: right; float: right;"><a href="' . $next["href"] . '">' . $next["desc"] . '</a></div>' : '') . '
' . ($parentId ? '<div class="up"><a href="' . $parent["href"] . '">' . $parent["desc"] . '</a></div>' : '') . '
<div class="home"><a href="' . $root["filename"] . $this->getExt() . '">' . $root["ldesc"] . '</a></div>
</div><hr/>
';
}