public function load_page($action) { $this->file = new File(format_page_name($action->page, true)); $this->markdown = Markdown($this->file->data); $this->action = $action->action; $this->page = $action->page; }
public function action_docs() { $page = $this->request->param('page'); if (!$page) { // Redirect to the default page $this->request->redirect($this->guide->uri(array('page' => 'about.kohana'))); } $file = $this->file($page); if (!$file) { throw new Kohana_Exception('User guide page not found: :page', array(':page' => $page)); } // Set the page title $this->template->title = $this->title($page); // Parse the page contents into the template $this->template->content = Markdown(file_get_contents($file)); // Attach the menu to the template $this->template->menu = Markdown(file_get_contents($this->file('menu'))); // Bind module menu items $this->template->bind('module_menus', $module_menus); // Attach module-specific menu items $module_menus = array(); foreach (Kohana::modules() as $module => $path) { if ($file = $this->file('menu.' . $module)) { $module_menus[$module] = Markdown(file_get_contents($file)); } } // Bind the breadcrumb $this->template->bind('breadcrumb', $breadcrumb); // Add the breadcrumb $breadcrumb = array(); $breadcrumb[$this->guide->uri()] = __('User Guide'); $breadcrumb[] = $this->section($page); $breadcrumb[] = $this->template->title; }
function diaspora2bb($s) { $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); // Remove CR to avoid problems with following code $s = str_replace("\r", "", $s); $s = str_replace("\n", " \n", $s); // The parser cannot handle paragraphs correctly $s = str_replace(array("</p>", "<p>", '<p dir="ltr">'), array("<br>", "<br>", "<br>"), $s); // Escaping the hash tags $s = preg_replace('/\\#([^\\s\\#])/', '#$1', $s); $s = Markdown($s); $s = preg_replace('/\\@\\{(.+?)\\; (.+?)\\@(.+?)\\}/', '@[url=https://$3/u/$2]$1[/url]', $s); $s = str_replace('#', '#', $s); $s = html2bbcode($s); // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands $s = str_replace('♲', html_entity_decode('♲', ENT_QUOTES, 'UTF-8'), $s); // Convert everything that looks like a link to a link $s = preg_replace("/([^\\]\\=]|^)(https?\\:\\/\\/)([a-zA-Z0-9\\:\\/\\-\\?\\&\\;\\.\\=\\_\\~\\#\\%\$\\!\\+\\,]+)/ism", '$1[url=$2$3]$2$3[/url]', $s); //$s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2$3$4]$2$3$4[/url]',$s); $s = bb_tag_preg_replace("/\\[url\\=?(.*?)\\]https?:\\/\\/www.youtube.com\\/watch\\?v\\=(.*?)\\[\\/url\\]/ism", '[youtube]$2[/youtube]', 'url', $s); $s = bb_tag_preg_replace("/\\[url\\=https?:\\/\\/www.youtube.com\\/watch\\?v\\=(.*?)\\].*?\\[\\/url\\]/ism", '[youtube]$1[/youtube]', 'url', $s); $s = bb_tag_preg_replace("/\\[url\\=?(.*?)\\]https?:\\/\\/vimeo.com\\/([0-9]+)(.*?)\\[\\/url\\]/ism", '[vimeo]$2[/vimeo]', 'url', $s); $s = bb_tag_preg_replace("/\\[url\\=https?:\\/\\/vimeo.com\\/([0-9]+)\\](.*?)\\[\\/url\\]/ism", '[vimeo]$1[/vimeo]', 'url', $s); // remove duplicate adjacent code tags $s = preg_replace("/(\\[code\\])+(.*?)(\\[\\/code\\])+/ism", "[code]\$2[/code]", $s); // Don't show link to full picture (until it is fixed) $s = scale_external_images($s, false); return $s; }
function newCmtFormHlr($author = false, $email = false, $author_id = false, $article_id = false, $content = false, $date = false) { if ($content == false) { $content = $_REQUEST['comment_text']; } if ($article_id == false) { $article_id = $_REQUEST['id']; } $reg = Registry::instance(); $_hinfo = $reg->get('hamster_info'); $login_status = $reg->get('login_status'); if ($login_status == 3) { $author = mysql_escape_string(htmlspecialchars($_hinfo['name'])); $email = ''; $author_id = intval($_hinfo['id']); if ($_REQUEST['comment_text'] == '') { return array(); } require_once 'lib/markdown/markdown.php'; $content = Markdown(strip_tags($content)); } else { $content = '<p>' . htmlspecialchars($content) . '</p>'; $email = mysql_escape_string(htmlspecialchars($_REQUEST['comment_email'])); if ($_REQUEST['comment_name'] != '' && $name == false) { $author = mysql_escape_string(htmlspecialchars($_REQUEST['comment_name'])); } else { $author = 'НЛО'; } if (strpos($_REQUEST['comment_text'], 'http://') !== false || $_REQUEST['comment_text'] == '' || $_REQUEST['comment_sid'] != $_SESSION['comment_sid'] || !isset($_SESSION['comment_sid']) || time() - $_SESSION['comment_stamp'] < 2) { return array(); } } $prs = array('author' => $author, 'email' => $email, 'author_id' => $author_id, 'article_id' => intval($article_id), 'content' => mysql_escape_string($content), 'date' => local2gm()); return $prs; }
function help_content(&$a) { nav_set_selected('help'); global $lang; $text = ''; if ($a->argc > 1) { $text = load_doc_file('doc/' . $a->argv[1] . '.md'); $a->page['title'] = t('Help:') . ' ' . str_replace('-', ' ', notags($a->argv[1])); } $home = load_doc_file('doc/Home.md'); if (!$text) { $text = $home; $a->page['title'] = t('Help'); } else { $a->page['aside'] = Markdown($home); } if (!strlen($text)) { header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found')); $tpl = get_markup_template("404.tpl"); return replace_macros($tpl, array('$message' => t('Page not found.'))); } $html = Markdown($text); $html = "<style>.md_warning { padding: 1em; border: #ff0000 solid 2px; background-color: #f9a3a3; color: #ffffff;</style>" . $html; return $html; }
/** * return a parsed version of the Markdown file * @static * @throws King23_Exception * @param string $filename * @return string */ public static function MarkdownFile($filename) { if (!file_exists($filename)) { throw new King23_Exception("could not find {$filename} for Markdown"); } return Markdown(file_get_contents($filename)); }
public function action_docs() { // Get the path for this page $file = $this->file($page = $this->request->param('page')); if (!$file) { throw new Kohana_Exception('User guide page not found: :page', array(':page' => $page)); } // Set the page title $this->template->title = $this->title($page); // Parse the page contents into the template $this->template->content = Markdown(file_get_contents($file)); // Attach the menu to the template $this->template->menu = Markdown(file_get_contents($this->file('menu'))); // Bind the breadcrumb $this->template->bind('breadcrumb', $breadcrumb); // Get the docs URI $guide = Route::get('docs/guide'); // Add the breadcrumb $breadcrumb = array(); $breadcrumb[$guide->uri(array('page' => NULL))] = __('User Guide'); if (strpos($page, '.')) { list($section) = explode('.', $page); $breadcrumb[$guide->uri(array('page' => $section))] = $this->title($section); } $breadcrumb[] = $this->template->title; }
static function markdownify($text) { if (strpos($text, '<nomarkdown />') !== FALSE) { return $text; } return Markdown($text); }
function run($string) { if (!function_exists('Markdown')) { include_once EXTENSIONS . '/markdown/lib/markdown.php'; } return stripslashes(Markdown($string)); }
/** * Executes index action * * @param sfRequest $request A request object */ public function executeIndex(sfWebRequest $request) { require_once sfConfig::get('sf_lib_dir') . '/vendor/markdown.php'; $d = file_get_contents(sfConfig::get('sf_root_dir') . '/doc/user_doc_' . $this->getUser()->getCulture() . '.markdown'); $d = htmlentities($d, ENT_QUOTES, 'UTF-8'); $this->body = Markdown($d); }
function help_display($helpname = FALSE) { include_once 'plan_read.php'; include_once 'markdown.php'; include_once 'smartypants.php'; if ($helpname) { if (file_exists("{$_SERVER['HELP_ROOT']}/{$helpname}.help")) { include_once "{$_SERVER['HELP_ROOT']}/{$helpname}.help"; } else { $filelist = files_list("{$_SERVER['HELP_ROOT']}/", "*{$helpname}*.help"); if ($filelist) { include_once "{$_SERVER['HELP_ROOT']}/{$filelist['0']}"; $helpname = str_replace('.help', '', $filelist[0]); } else { return FALSE; } } } if (user_is_valid($_SERVER['USERINFO_ARRAY']['username'], $_SERVER['USERINFO_ARRAY']['userpass'])) { $editlink = "<a style='font-size: 9pt; font-family: sans-serif; background: #eec; padding: 2px; border: thin solid #eee;' href='{$_SERVER['WEB_ROOT']}/help/edit/{$helpname}'>edit</a>"; } else { $editlink = ''; } $content = Smartypants(Markdown(plan_process_directives(plan_add_user_links(plan_process_smileys("<h1><a href='/help'><img src='{$GLOBALS['helpicon']}' /></a> {$title} {$editlink}</h1>\n\n{$body}"))))); if ($title || $body) { return $content; } else { return FALSE; } }
function getBio() { error_log("getBio ", 0); //Define the bio image header file. $this->image = "./.." . BIO_DIR . BIO_HEADER; if (!file_exists($this->image)) { $this->image = "./" . BIO_DIR . BIO_HEADER; } //Define the bio foto header file. $this->foto = "./.." . BIO_DIR . BIO_FOTO; if (!file_exists($this->foto)) { $this->foto = "./" . BIO_DIR . BIO_FOTO; } // Define the bio file. //$fcontents = file("./..".BIO_DIR.BIO_TXT); if (file_exists("./.." . BIO_DIR . BIO_TXT)) { $fcontents = file("./.." . BIO_DIR . BIO_TXT); } else { $fcontents = file("./" . BIO_DIR . BIO_TXT); } // Define the post title. $this->title = str_replace(array("\n", '#'), '', $fcontents[0]); // Define the post content $this->content = Markdown($fcontents[1]); return $this; }
public function create_object($data) { try { $mc = new \Core\Backend\MemcachedContainer(); $m = $mc->get_backend(); $m_enable = True; } catch (\Core\Backend\MemcachedNotLoadedError $e) { } $data = \Core\Dict::create($data); if (strlen($data->custom_url) > 0) { $data->seo_title = $data->custom_url; } else { $data->seo_title = strtolower(str_replace(' ', '-', $data->title)); } if (extension_loaded('discount')) { $md = \MarkdownDocument::createFromString($data['body']); $md->compile(); $data['body_html'] = $md->getHtml(); } else { import('3rdparty.markdown'); $data['body_html'] = Markdown($data['body']); } $data->preview = substr(strip_tags($data['body_html']), 0, 440); $a = Article::create($data)->form_values(); return $a; }
function diaspora2bb($s) { // for testing purposes: Collect raw markdown articles // $file = tempnam("/tmp/friendica/", "markdown"); // file_put_contents($file, $s); $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); // Too many new lines. So deactivated the following line // $s = str_replace("\r","\n",$s); // Simply remove cr. $s = str_replace("\r", "", $s); // <br/> is invalid. Replace it with the valid expression $s = str_replace("<br/>", "<br />", $s); $s = preg_replace('/\\@\\{(.+?)\\; (.+?)\\@(.+?)\\}/', '@[url=https://$3/u/$2]$1[/url]', $s); // Escaping the hash tags - doesn't always seem to work // $s = preg_replace('/\#([^\s\#])/','\\#$1',$s); // This seems to work $s = preg_replace('/\\#([^\\s\\#])/', '#$1', $s); $s = Markdown($s); $s = str_replace('#', '#', $s); $s = str_replace("\n", '<br />', $s); $s = html2bbcode($s); // $s = str_replace('*','*',$s); // Convert everything that looks like a link to a link $s = preg_replace("/([^\\]\\=]|^)(https?\\:\\/\\/)([a-zA-Z0-9\\:\\/\\-\\?\\&\\;\\.\\=\\_\\~\\#\\%\$\\!\\+\\,]+)/ism", '$1[url=$2$3]$2$3[/url]', $s); //$s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2$3$4]$2$3$4[/url]',$s); $s = preg_replace("/\\[url\\=?(.*?)\\]https?:\\/\\/www.youtube.com\\/watch\\?v\\=(.*?)\\[\\/url\\]/ism", '[youtube]$2[/youtube]', $s); $s = preg_replace("/\\[url\\=https?:\\/\\/www.youtube.com\\/watch\\?v\\=(.*?)\\].*?\\[\\/url\\]/ism", '[youtube]$1[/youtube]', $s); $s = preg_replace("/\\[url\\=?(.*?)\\]https?:\\/\\/vimeo.com\\/([0-9]+)(.*?)\\[\\/url\\]/ism", '[vimeo]$2[/vimeo]', $s); $s = preg_replace("/\\[url\\=https?:\\/\\/vimeo.com\\/([0-9]+)\\](.*?)\\[\\/url\\]/ism", '[vimeo]$1[/vimeo]', $s); // remove duplicate adjacent code tags $s = preg_replace("/(\\[code\\])+(.*?)(\\[\\/code\\])+/ism", "[code]\$2[/code]", $s); // Don't show link to full picture (until it is fixed) $s = scale_external_images($s, false); return $s; }
/** * Loads a class and uses [reflection](http://php.net/reflection) to parse * the class. Reads the class modifiers, constants and comment. Parses the * comment to find the description and tags. * * @param string class name * @return void */ public function __construct($class) { $this->class = new ReflectionClass($class); if ($modifiers = $this->class->getModifiers()) { $this->modifiers = '<small>' . implode(' ', Reflection::getModifierNames($modifiers)) . '</small> '; } if ($constants = $this->class->getConstants()) { foreach ($constants as $name => $value) { $this->constants[$name] = Kohana::debug($value); } } $parent = $this->class; do { if ($comment = $parent->getDocComment()) { // Found a description for this class break; } } while ($parent = $parent->getParentClass()); list($this->description, $this->tags) = Kodoc::parse($comment); // If this class extends Kodoc_Missing, add a warning about possible // incomplete documentation $parent = $this->class; while ($parent = $parent->getParentClass()) { if ($parent->name == 'Kodoc_Missing') { $warning = "[!!] **This class, or a class parent, could not be\n\t\t\t\t found or loaded. This could be caused by a missing\n\t\t\t\t\t\t module or other dependancy. The documentation for\n\t\t\t\t\t\t class may not be complete!**"; $this->description = Markdown($warning) . $this->description; } } }
public function action_docs() { $page = $this->request->param('page'); if (!$page) { // Redirect to the default page $this->request->redirect($this->guide->uri(array('page' => 'about.kohanut'))); } $file = $this->file($page); if (!$file) { throw new Kohana_Exception('User guide page not found: :page', array(':page' => $page)); } // Set the page title $this->template->title = $this->title($page); // Parse the page contents into the template $this->template->content = Markdown(file_get_contents($file)); // Attach the menu to the template $this->template->menu = Markdown(file_get_contents($this->file('menu'))); // Bind the breadcrumb $this->template->bind('breadcrumb', $breadcrumb); // Add the breadcrumb $breadcrumb = array(); $breadcrumb[$this->guide->uri()] = __('Kohanut Docs'); $breadcrumb[] = $this->section($page); $breadcrumb[] = $this->template->title; }
public static function convertToHtml($markdown) { if ($markdown) { sfContext::getInstance()->getResponse()->addStylesheet(sfSympalConfig::getAssetPath('/sfSympalRenderingPlugin/css/markdown.css')); return '<div class="sympal_markdown">' . self::enhanceHtml(Markdown($markdown), $markdown) . '</div>'; } }
public function action_docs() { // Reset the base URL for links with new routes Kodoc_Markdown::$base_url = URL::site($this->guide->uri()) . '/'; $page = $this->request->param('page'); if (!$page) { // Redirect to the default page $this->request->redirect($this->guide->uri(array('page' => 'jelly.getting-started'))); } $file = $this->file($page); if (!$file) { throw new Kohana_Exception('User guide page not found: :page', array(':page' => $page)); } // Set the page title $this->template->title = $this->title($page); // Parse the page contents into the template $this->template->content = Markdown(file_get_contents($file)); // Attach the menu to the template $this->template->menu = Markdown(file_get_contents($this->file('menu.jelly'))); // Add manual link to API docs $this->template->menu .= HTML::anchor($this->api->uri(), 'API Reference', array('class' => 'jelly-api-link')); // Bind the breadcrumb $this->template->bind('breadcrumb', $breadcrumb); // Add the breadcrumb $breadcrumb = array(); $breadcrumb['/'] = __('Jelly Home'); $breadcrumb[$this->guide->uri()] = __('User Guide'); $breadcrumb[] = $this->section($page); $breadcrumb[] = $this->template->title; }
public function __construct($class, $property) { $property = new ReflectionProperty($class, $property); list($description, $tags) = Kodoc::parse($property->getDocComment()); $this->description = $description; if ($modifiers = $property->getModifiers()) { $this->modifiers = '<small>' . implode(' ', Reflection::getModifierNames($modifiers)) . '</small> '; } if (isset($tags['var'])) { if (preg_match('/^(\\S*)(?:\\s*(.+?))?$/', $tags['var'][0], $matches)) { $this->type = $matches[1]; if (isset($matches[2])) { $this->description = Markdown($matches[2]); } } } $this->property = $property; // Show the value of static properties, but only if they are public or we are php 5.3 or higher and can force them to be accessible if ($property->isStatic() and ($property->isPublic() or version_compare(PHP_VERSION, '5.3', '>='))) { // Force the property to be accessible if (version_compare(PHP_VERSION, '5.3', '>=')) { $property->setAccessible(TRUE); } // Don't debug the entire object, just say what kind of object it is if (is_object($property->getValue($class))) { $this->value = '<pre>object ' . get_class($property->getValue($class)) . '()</pre>'; } else { $this->value = Kohana::debug($property->getValue($class)); } } }
function print_comment_item($tag, $id, $author, $date, $comment) { global $domain; $output = ""; $output .= " <item>\n"; $output .= " <title>#"; $output .= $id; $output .= " on tag "; $output .= $tag; $output .= " by "; $output .= htmlentities($author); $output .= "</title>\n"; $output .= " <link>"; $output .= $domain . href('tag/' . $tag . '#comment-' . $id); $output .= "</link>\n"; $output .= " <description>A new comment by "; $output .= $author; $output .= " on tag "; $output .= $tag; $output .= "."; $output .= "</description>\n"; $output .= " <content:encoded><![CDATA["; $output .= Markdown(htmlspecialchars($comment)); $output .= "]]></content:encoded>\n"; $output .= " <dc:creator>"; $output .= $author; $output .= "</dc:creator>\n"; $output .= " <pubDate>"; $output .= date_format(date_create($date, timezone_open('GMT')), DATE_RFC2822); $output .= "</pubDate>\n"; $output .= " </item>\n"; return $output; }
function rhcontent() { date_default_timezone_set("Europe/London"); $stuff = "Submitted " . date('l dS \\of F Y h:i:s A') . "\n"; ob_start(); print_r($_POST); $stuff .= ob_get_contents(); ob_end_clean(); $ouremail = "*****@*****.**"; mail($ouremail, "Swaledale booking", $stuff, "From: {$ouremail}"); extract($_POST); $balance = $cost - 25; $message = <<<EOT _Thanks for your booking request._ We can confirm your place on the Swaledale Squeeze once we have received your deposit of £25 payable to Swaledale Squeeze at: Steven Bradley Annfield House Front Street Langley Park Durham DH7 9XE If you wish you can pay the full amount of £{$cost} now or pay the deposit now and the balance of £{$balance} by 1st May 2016. Once I receive your deposit I'll let you know. Thanks from Steven EOT; box(Markdown($message)); mail($_POST['email'], "Swaledale Squeeze: thanks for booking", $message, "From: {$ouremail}"); box("We've also sent these instructions to your email address. Thanks again."); }
function TextToHTML($string, $stringLanguage = false) { global $_JAM; // Look for Markdown preference if ($_JAM->projectConfig['useMarkdown']) { require_once 'engine/libraries/smartypants.php'; require_once 'engine/libraries/markdown.php'; return SmartyPants(Markdown($string)); } // First find backticked portions and store them for later use $backtickmatch = '{`([^`]*)`}u'; preg_match_all($backtickmatch, $string, $metaFillOutArray, PREG_PATTERN_ORDER); // Only index 1 is suitable for use $fillOutArray = $metaFillOutArray[1]; // Replace matches with placeholders $string = preg_replace($backtickmatch, '%PLACEHOLDER', $string); $match = array('{\\r}u', '{^([^\\n]+)$}mu', '{<p>-(=)+-</p>}u', '{<p>([^\\n]+)</p>[\\n\\s]*<p>-*</p>}u', '{<p>[-·•]\\s?([^\\n]+)</p>(\\n{1}|$)}u', '{</ul>\\n<ul>}u', '{<p>(\\d)\\. ([^\\n]+)</p>(\\n{1}|$)}u', '{</ol>\\n<ol type="1" start="\\d">}u', '{</p>\\n<p>([^\\t])}u', "{(/?)>\\[([^\\s=>\\]]*)=([^\\s>\\]]*)\\]}u", '{<p>%PLACEHOLDER</p>}u'); $replace = array('', e('p', '$1'), e('hr'), e('h2', '$1'), e('ul', e('li', '$1')) . "\n", "\n", e('ol', array('type' => 1, 'start' => '$1'), e('li', '$2')) . "\n", "\n", e('br') . "\n\$1", ' $2="$3"$1>', '%PLACEHOLDER'); $smartizedString = TextRenderer::SmartizeText($string, $language); $HTMLString = preg_replace($match, $replace, $smartizedString); // Reinsert backticked portions while ($fillout = array_shift($fillOutArray)) { $HTMLString = preg_replace('{%PLACEHOLDER}u', $fillout, $HTMLString, 1); } return $HTMLString; }
function PrintComment($site, $row, $session = false) { if ($row['VerifiedDate'] === null) { echo '<li id="comment' . $row['CommentID'] . '" class="unverified">'; } else { echo '<li id="comment' . $row['CommentID'] . '">'; } echo '<div class="commentAuthor"><img src="https://secure.gravatar.com/avatar/' . md5(strtolower(trim($row['CommentEmail']))) . '?s=40&d=identicon">'; if (isset($row['Page'])) { //$url=htmlentities($site['SiteUrl'].$row['Page']); //echo '<div><a href="'.$url.'">'.$url.'</a></div>'; } echo '<span>' . date('Y-m-d H:i', strtotime($row['CommentDate'])) . '</span> '; if ($session && ($session['Email'] === $site['AdminEmail'] || $session['Email'] === $row['CommentEmail'])) { if ($row['CommentEmail'] === "") { echo '<strong>Anonymous</strong>'; } elseif ($session['Email'] != $row['CommentEmail']) { echo htmlentities($row['CommentEmail']); } if ($row['VerifiedDate'] === null) { echo ' <em>(' . htmlentities($row['CommentIP']) . ')</em>'; echo ' <strong>(unverified)</strong>'; echo ' <a href="' . service_url . '/update.php?cid=' . $row['CommentID'] . '&action=verify">verify</a>'; echo ' <a href="' . service_url . '/update.php?cid=' . $row['CommentID'] . '&action=delete">delete</a>'; } elseif ($session['Email'] === $site['AdminEmail']) { echo ' <a href="' . service_url . '/update.php?cid=' . $row['CommentID'] . '&action=delete">delete</a>'; } } echo '</div>'; echo Markdown($row['CommentText']); echo '</li>'; }
function cms_block($name) { include_once ROOT . '/inc/markitup/parsers/inc.markdown.php'; $name = addslashes($name); $getContent = mysql_fetch_array(mysql_query("SELECT * FROM `cms_blocks` WHERE `name` = '{$name}'")); return Markdown(stripslashes($getContent['body'])); }
public function getData() { $show_secure_content = false; //$this->element_data['browserid_js'] = CASHSystem::getBrowserIdJS($this->element_id); if ($this->status_uid == 'people_signintolist_200') { $show_secure_content = true; } elseif ($this->status_uid == 'people_signintolist_400') { // sign-in failed, try element-specific password and check that the // address is for realy realz on the list if (trim($this->original_request['password']) == trim($this->options['alternate_password']) && trim($this->options['alternate_password']) != '') { $status_request = new CASHRequest(array('cash_request_type' => 'people', 'cash_action' => 'getaddresslistinfo', 'address' => $this->original_request['address'], 'list_id' => $this->options['email_list_id'])); if ($status_request->response['payload']) { $show_secure_content = true; } } } if ($show_secure_content) { if (file_exists(CASH_PLATFORM_ROOT . '/lib/markdown/markdown.php')) { include_once CASH_PLATFORM_ROOT . '/lib/markdown/markdown.php'; } $this->element_data['secure_content'] = Markdown($this->element_data['secure_content']); $this->setTemplate('success'); } return $this->element_data; }
public function documentationSchemas($api) { $documentationFile = sprintf('%s/external/openphoto-frontend/documentation/schemas/%s.markdown', dirname(dirname(__FILE__)), $api); $params = array('name' => $api, 'schema' => Markdown(file_get_contents($documentationFile))); $content = getTemplate()->get('schema.php', $params); return $this->envelope($content, 'documentation'); }
function renderStep($step, $app) { $app['session']->set('step', $step); $content = file_get_contents($app['tutorial_dir'] . "step{$step}.md"); $tutorial = Markdown($content); return $tutorial; }
/** * Smarty {markdown}{/markdown} block plugin * * @param string $content contents of the block * @param object $template template object * @param boolean &$repeat repeat flag * @return string content re-formatted */ function smarty_block_markdown($params, $content, $template, &$repeat) { global $htmlwarrior; $code_path = $htmlwarrior->config['code_path']; require_once $code_path . '/externals/php_markdown/php_markdown.php'; return Markdown($content); }
function __construct(&$lines, $level) { $res = array(); $body = array(); while (count($lines)) { $line = array_shift($lines); // Blank lines just get a carriage return added (for markdown) and otherwise ignored if (!trim($line)) { $body[] = "\n"; continue; } // Get the indent preg_match('/^(\\s*)/', $line, $match); $indent = $match[1]; // Check to make sure we're still indented if (strlen($indent) <= $level) { array_unshift($lines, $line); break; } // Check for tag if (preg_match('/^@([^\\s]+)(.*)$/', trim($line), $match)) { $tag = $match[1]; $sub = new RESTDocblockParser($lines, strlen($indent)); $sub['details'] = trim($match[2]); if (!isset($res[$tag])) { $res[$tag] = new RESTDocblockParser_Sequence(); } $res[$tag][] = $sub; } else { $body[] = substr($line, $level > 0 ? $level : 0); } } $res['body'] = Markdown(implode("", $body)); $this->res = $res; }
function markdownApplier($text) { global $pathToIndex; require_once $pathToIndex . '/plugins/markdown/markdown.php'; return str_replace("><", ">\n<", str_replace("\n\n", "\n", str_replace('<p><hr /></p>', '<hr />', Markdown(str_replace('\\', '\', $text))))); //return str_replace('\n', '', Markdown(str_replace('\\', '\', $text))); }