} // Complete the crumb addition for this bit function getCrumbString($href, $thisname) { $thisname = insertName($thisname); return "{$href}{$thisname}</a>"; } // fancy name and parent script for the thing being called here $scriptPair = getNameAndParent($script); $parent = $scriptPair[1]; //$back1 = $parent; // Start out the crumb where we are - no link $crumb = insertName($scriptPair[0]); // If there is no parent, we're done if ($parent != '') { // Loop until we reach home or nothing do { // Go back 1 $cur = $parent; $thisPair = getNameAndParent($cur); $parent = $thisPair[1]; /* if ($parent == $back1) { */ /* $thisScript = "<a href=\"#\" onclick=\"history.back(-1);return false\">"; */ /* } else { */ $thisScript = getHref($cur); /* } */ // Crumb is link to script with right name $crumb = getCrumbString($thisScript, $thisPair[0]) . " → " . $crumb; } while ($cur != "home.php" && $cur != ''); } print "<div id='breadcrumb'>" . $crumb . "</div>\n";
/** * Adds the array of relationships to the collection. * * @param array $relationships * @param StateTransitionOption $option,... * * @return RelationshipState * @throws GedcomxApplicationException */ public function addRelationships(array $relationships, StateTransitionOption $option = null) { $link = $this->getLink(Rel::RELATIONSHIPS); if (link == null || link . getHref() == null) { throw new GedcomxApplicationException(String . format("Collection at %s doesn't support adding relationships.", getUri())); } $entity = new Gedcomx(); $entity->setRelationships($relationships); $request = $this->createAuthenticatedGedcomxRequest('POST', $link->getHref()); return $this->stateFactory->createState('RelationshipsState', $this->client, $request, $this->passOptionsTo('invoke', array($request), func_get_args()), $this->accessToken); }
function parse($markup) { $content = ""; $code = false; foreach (explode("\n", $markup) as $line) { if (strlen(trim($line)) > 0 || $code) { $newLine = true; $line = preg_replace("/\\[([^\\>]+)>([^\\]]+)\\]/", "<a href='\\2'>\\1</a>", $line); $line = preg_replace("/\\[inline\\-code\\|([a-z]+)\\|([^\\]]+)\\]/", "<code class='inline language-\\1'>\\2</code>", $line); if (strpos($line, "[/code]") === 0) { $content .= "</code></pre>"; $code = false; } else { if ($code) { $content .= $line; } else { if (strpos($line, "---") === 0) { $content .= "<h3>" . trim(substr($line, 3)) . "</h3>"; } else { if (strpos($line, "--") === 0) { $content .= "<h2>" . trim(substr($line, 2)) . "</h2>"; } else { if (strpos($line, "-") === 0) { $content .= "<h1>" . trim(substr($line, 1)) . "</h1>"; } else { if (strpos($line, " -") === 0) { $content .= "<span class='bullet'>• " . trim(substr($line, 5)) . "</span>"; } else { if (strpos($line, "#") === 0) { $content .= "<!-- raw -->" . trim(substr($line, 1)); } else { if (strpos($line, ">>>") === 0) { $content .= "<p class='subtle'>" . trim(substr($line, 3)) . "</p>"; } else { if (strpos($line, ">>") === 0) { $content .= "<p class='subtitle'>" . trim(substr($line, 2)) . "</p>"; } else { if (strpos($line, ">") === 0) { $content .= "<p class='quote'>" . trim(substr($line, 1)) . "</p>"; } else { if (strpos($line, "[banner ") === 0) { $content .= "<img class='banner' src='" . getHref($line) . "' />"; } else { if (strpos($line, "[portrait ") === 0) { $content .= "<img class='portrait' src='" . getHref($line) . "' />"; } else { if (strpos($line, "[video ") === 0) { $content .= "<iframe class='youtubeVideo' src='http://www.youtube.com/embed/"; $content .= getHref($line); $content .= "' frameborder='0' allowfullscreen></iframe>"; } else { if (strpos($line, "[block]") === 0) { $content .= "<div class='contentBlock'>"; } else { if (strpos($line, "[/block]") === 0) { $content .= "</div><!-- end block -->"; } else { if (strpos($line, "[code ") === 0) { $content .= "<pre><code class='language-" . getHref($line) . "'>"; $code = true; $newLine = false; } else { $content .= "<p>" . trim($line) . "</p>"; } } } } } } } } } } } } } } } } if ($newLine) { $content .= "\n"; } } } if ($code) { $content .= "</code></pre>"; } return $content; }