本文整理汇总了PHP中Textile::TextileRestricted方法的典型用法代码示例。如果您正苦于以下问题:PHP Textile::TextileRestricted方法的具体用法?PHP Textile::TextileRestricted怎么用?PHP Textile::TextileRestricted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Textile
的用法示例。
在下文中一共展示了Textile::TextileRestricted方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter
/**
* Filter.
*
* @param string $thing
* @param array $options
*/
public function filter($thing, $options)
{
parent::filter($thing, $options);
if ($this->options['restricted']) {
return $this->textile->TextileRestricted($thing, $this->options['lite'], $this->options['noimage'], $this->options['rel']);
} else {
return $this->textile->TextileThis($thing, $this->options['lite'], '', $this->options['noimage'], '', $this->options['rel']);
}
}
示例2: do_textile
/**
* Just textile the text and return
*
* @param string $text Input text
* @return string
*/
function do_textile($text)
{
Env::useLibrary('textile');
$textile = new Textile();
$text = $textile->TextileRestricted($text, false, false);
return add_links($text);
}
示例3: do_textile
function do_textile($text)
{
$textile = new Textile();
$text = $textile->TextileRestricted($text, false, false);
//return $text;
return add_links($text);
}
示例4: smarty_modifier_textile
function smarty_modifier_textile($string, $lite = false, $restricted = false)
{
if (!isset($string) || $string === '') {
return $string;
} else {
Globe::Load('Textile/library/Vendor/Textile', 'package');
$textile = new Textile();
return $restricted ? $textile->TextileRestricted($string, $lite) : $textile->TextileThis($string, $lite);
}
}
示例5: getComments
function getComments($num)
{
$comments = glob("data/{$num}/comment*");
natsort($comments);
$comments = array_values($comments);
$body = "<p> <strong>Comments:</strong> </p>";
$textile = new Textile();
foreach ($comments as $com) {
$comarr = file($com);
preg_match('/^.*[^0-9](\\d+)$/', $com, $matches);
$text = join("\n", array_slice($comarr, 1));
$body .= " <p class='comment'>#{$matches['1']} From: {$comarr['0']} <br />\n\t\t" . $textile->TextileRestricted($text) . "</p>\n\t\t<hr />";
}
return $body;
}
示例6: uds_billboard_description
function uds_billboard_description($atts, $content = null)
{
global $uds_description_mode, $uds_billboard_text_evaluation;
extract(shortcode_atts(array('top' => '20px', 'left' => '20px', 'width' => '200px', 'height' => '80%', 'skin' => ''), $atts));
if (isset($uds_description_mode) && $uds_description_mode == 'editor') {
$out = "<div class='editable-box' data-skin='{$skin}' style='top:{$top};left:{$left};width:{$width};height:{$height};'><textarea>{$content}</textarea></div>";
} else {
if ($uds_billboard_text_evaluation == 'textile') {
$textile = new Textile();
$content = $textile->TextileRestricted($content, '');
}
if (!empty($skin)) {
$skin = 'uds-' . $skin;
}
$out = "<div class='uds-bb-description {$skin}' style='top:{$top};left:{$left};width:{$width};height:{$height};'><div class='uds-bb-description-inside'>{$content}</div></div>";
}
return $out;
}
示例7: markup_comment
function markup_comment($msg)
{
global $prefs;
$disallow_images = !empty($prefs['comments_disallow_images']);
$lite = empty($prefs['comments_use_fat_textile']);
$rel = !empty($prefs['comment_nofollow']) ? 'nofollow' : '';
include_once txpath . '/lib/classTextile.php';
$textile = new Textile();
return $textile->TextileRestricted($msg, $lite, $disallow_images, $rel);
}
示例8: plugin_install
function plugin_install()
{
$plugin = ps('plugin64');
if (strpos($plugin, '$plugin=\'') !== false) {
@ini_set('pcre.backtrack_limit', '1000000');
$plugin = preg_replace('@.*\\$plugin=\'([\\w=+/]+)\'.*@s', '$1', $plugin);
}
$plugin = preg_replace('/^#.*$/m', '', $plugin);
if (trim($plugin)) {
$plugin = base64_decode($plugin);
if (strncmp($plugin, "‹", 2) === 0) {
$plugin = gzinflate(substr($plugin, 10));
}
if ($plugin = unserialize($plugin)) {
if (is_array($plugin)) {
extract($plugin);
$type = empty($type) ? 0 : min(max(intval($type), 0), 3);
$order = empty($order) ? 5 : min(max(intval($order), 1), 9);
$flags = empty($flags) ? 0 : intval($flags);
$exists = fetch('name', 'txp_plugin', 'name', $name);
if (isset($help_raw) && empty($plugin['allow_html_help'])) {
// default: help is in Textile format
include_once txpath . '/lib/classTextile.php';
$textile = new Textile();
$help = $textile->TextileRestricted($help_raw, 0, 0);
}
if ($exists) {
$rs = safe_update("txp_plugin", "status = 0,\n\t\t\t\t\t\t\ttype = {$type},\n\t\t\t\t\t\t\tauthor = '" . doSlash($author) . "',\n\t\t\t\t\t\t\tauthor_uri = '" . doSlash($author_uri) . "',\n\t\t\t\t\t\t\tversion = '" . doSlash($version) . "',\n\t\t\t\t\t\t\tdescription = '" . doSlash($description) . "',\n\t\t\t\t\t\t\thelp = '" . doSlash($help) . "',\n\t\t\t\t\t\t\tcode = '" . doSlash($code) . "',\n\t\t\t\t\t\t\tcode_restore = '" . doSlash($code) . "',\n\t\t\t\t\t\t\tcode_md5 = '" . doSlash($md5) . "',\n\t\t\t\t\t\t\tflags \t = {$flags}", "name = '" . doSlash($name) . "'");
} else {
$rs = safe_insert("txp_plugin", "name = '" . doSlash($name) . "',\n\t\t\t\t\t\t\tstatus = 0,\n\t\t\t\t\t\t\ttype = {$type},\n\t\t\t\t\t\t\tauthor = '" . doSlash($author) . "',\n\t\t\t\t\t\t\tauthor_uri = '" . doSlash($author_uri) . "',\n\t\t\t\t\t\t\tversion = '" . doSlash($version) . "',\n\t\t\t\t\t\t\tdescription = '" . doSlash($description) . "',\n\t\t\t\t\t\t\thelp = '" . doSlash($help) . "',\n\t\t\t\t\t\t\tcode = '" . doSlash($code) . "',\n\t\t\t\t\t\t\tcode_restore = '" . doSlash($code) . "',\n\t\t\t\t\t\t\tcode_md5 = '" . doSlash($md5) . "',\n\t\t\t\t\t\t\tload_order = '" . $order . "',\n\t\t\t\t\t\t\tflags \t = {$flags}");
}
if ($rs and $code) {
if (!empty($textpack)) {
install_textpack($textpack, false);
// TODO: How do we get rid of stale Textpacks once a plugin is uninstalled?
}
if ($flags & PLUGIN_LIFECYCLE_NOTIFY) {
load_plugin($name, true);
$message = callback_event("plugin_lifecycle.{$name}", 'installed');
}
if (empty($message)) {
$message = gTxt('plugin_installed', array('{name}' => $name));
}
plugin_list($message);
return;
} else {
$message = array(gTxt('plugin_install_failed', array('{name}' => $name)), E_ERROR);
plugin_list($message);
return;
}
}
}
}
plugin_list(array(gTxt('bad_plugin_code'), E_ERROR));
}
示例9: plugin_install
function plugin_install()
{
$plugin = ps('plugin64');
$plugin = preg_replace('@.*\\$plugin=\'([\\w=+/]+)\'.*@s', '$1', $plugin);
$plugin = preg_replace('/^#.*$/m', '', $plugin);
if (trim($plugin)) {
$plugin = base64_decode($plugin);
if (strncmp($plugin, "‹", 2) === 0) {
$plugin = gzinflate(substr($plugin, 10));
}
if ($plugin = unserialize($plugin)) {
if (is_array($plugin)) {
extract($plugin);
$type = empty($type) ? 0 : min(max(intval($type), 0), 3);
$order = empty($order) ? 5 : min(max(intval($order), 1), 9);
$exists = fetch('name', 'txp_plugin', 'name', $name);
if (isset($help_raw) && empty($plugin['allow_html_help'])) {
// default: help is in Textile format
include_once txpath . '/lib/classTextile.php';
$textile = new Textile();
$help = $textile->TextileRestricted($help_raw, 0, 0);
}
if ($exists) {
$rs = safe_update("txp_plugin", "status = 0,\n\t\t\t\t\t\t\ttype = {$type},\n\t\t\t\t\t\t\tauthor = '" . doSlash($author) . "',\n\t\t\t\t\t\t\tauthor_uri = '" . doSlash($author_uri) . "',\n\t\t\t\t\t\t\tversion = '" . doSlash($version) . "',\n\t\t\t\t\t\t\tdescription = '" . doSlash($description) . "',\n\t\t\t\t\t\t\thelp = '" . doSlash($help) . "',\n\t\t\t\t\t\t\tcode = '" . doSlash($code) . "',\n\t\t\t\t\t\t\tcode_restore = '" . doSlash($code) . "',\n\t\t\t\t\t\t\tcode_md5 = '" . doSlash($md5) . "'", "name = '" . doSlash($name) . "'");
} else {
$rs = safe_insert("txp_plugin", "name = '" . doSlash($name) . "',\n\t\t\t\t\t\t\tstatus = 0,\n\t\t\t\t\t\t\ttype = {$type},\n\t\t\t\t\t\t\tauthor = '" . doSlash($author) . "',\n\t\t\t\t\t\t\tauthor_uri = '" . doSlash($author_uri) . "',\n\t\t\t\t\t\t\tversion = '" . doSlash($version) . "',\n\t\t\t\t\t\t\tdescription = '" . doSlash($description) . "',\n\t\t\t\t\t\t\thelp = '" . doSlash($help) . "',\n\t\t\t\t\t\t\tcode = '" . doSlash($code) . "',\n\t\t\t\t\t\t\tcode_restore = '" . doSlash($code) . "',\n\t\t\t\t\t\t\tcode_md5 = '" . doSlash($md5) . "',\n\t\t\t\t\t\t\tload_order = '" . $order . "'");
}
if ($rs and $code) {
$message = gTxt('plugin_installed', array('{name}' => htmlspecialchars($name)));
plugin_list($message);
} else {
$message = gTxt('plugin_install_failed', array('{name}' => htmlspecialchars($name)));
plugin_list($message);
}
}
} else {
plugin_list(gTxt('bad_plugin_code'));
}
}
}
示例10: action_summary
private static function action_summary(&$pattern, $blob_location)
{
global $txpcfg;
include_once $txpcfg['txpath'] . DS . 'lib' . DS . 'classTextile.php';
$txt = new Textile();
echo $txt->TextileRestricted($pattern['info']['help.textile'], 0, 0);
# TODO genarate a log report of all the items added and their initial values...
echo '<h2>' . self::t('h2.summary') . '</h2>' . '<p>' . self::t('summary', array('{pattern}' => $pattern['info']['name'])) . '</p>';
}
示例11: format
function format($string)
{
$textile = new Textile();
return $textile->TextileRestricted($string);
}
示例12: getHelpText
/**
* getHelpText()
*
* Get the custom help text entered for/by a certain NREN
*
* @param Person $person the current person (for tag-replacement)
* @return String $help_text the parsed, replaced and textile-replaced text
*/
public function getHelpText($person)
{
$query = "SELECT help FROM nrens WHERE nren_id = ? AND help IS NOT NULL";
$res = array();
try {
$res = MDB2Wrapper::execute($query, array('text'), array($this->getID()));
} catch (DBStatementException $dbse) {
Logger::log_event(LOG_INFO, "[norm] Could not retrieve the help " . "text of NREN {$nren} due to an error with the " . "statement. Server said " . $dbse->getMessage());
return "";
} catch (DBQueryException $dbqe) {
Logger::log_event(LOG_INFO, "[norm] Could not retrieve the help " . "text of NREN {$nren} due to an error in the " . "query. Server said " . $dbqe->getMessage());
return "";
}
if (count($res) > 0) {
$help_text = $res[0]['help'];
$help_text = Input::br2nl($help_text);
$help_text = stripslashes($help_text);
$textile = new Textile();
$help_text = $textile->TextileRestricted($help_text, 0);
return $this->replaceTags($help_text, $person);
}
return null;
}
示例13: markup_comment
function markup_comment($msg)
{
global $prefs, $txpcfg;
include_once txpath . '/lib/classTextile.php';
$textile = new Textile();
extract($prefs);
$im = !empty($comments_disallow_images) ? 1 : '';
$msg = $textile->TextileRestricted($msg, 1, $im);
return $msg;
}