• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Textile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Textile的典型用法代码示例。如果您正苦于以下问题:PHP Textile类的具体用法?PHP Textile怎么用?PHP Textile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Textile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: 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);
}
开发者ID:469306621,项目名称:Languages,代码行数:13,代码来源:textile.php


示例2: handleOutput

 public function handleOutput(FileInterface $scribbleFile, $output)
 {
     // https://github.com/netcarver/textile
     // Make sure this class is require'd and available
     $textile = new \Textile('html5');
     return $textile->TextileThis($output);
 }
开发者ID:sirprize,项目名称:scribble,代码行数:7,代码来源:HtmlConverterFilter.php


示例3: beforeSave

 /**
  * beforeSave callback
  * 
  * Used to process the text in textile format.
  * 
  * @access public
  * @return Always true so it doesnt avoid saving
  */
 function beforeSave()
 {
     App::import('Vendor', 'Textile');
     $Textile = new Textile();
     $this->data[$this->alias]['processed_text'] = $Textile->textileThis($this->data[$this->alias]['text']);
     return true;
 }
开发者ID:rcaravita,项目名称:jodeljodel,代码行数:15,代码来源:pie_text.php


示例4: view_help

function view_help($message = '')
{
    pagetop(gTxt('edit_plugins'), $message);
    $filename = gps('filename');
    $plugin = array();
    if (!empty($filename)) {
        $content = file($filename);
        $source_lines = count($content);
        $format = 'none';
        for ($i = 0; $i < $source_lines; $i++) {
            $content[$i] = rtrim($content[$i]);
        }
        $format = 'unknown';
        //	Check for ZEM plugin...
        $plugin['help'] = _zem_extract_section($content, 'HELP');
        if ('' != $plugin['help']) {
            $format = 'zem_help';
        } else {
            //	check for ied style help section...
            $plugin['help'] = _ied_extract_section($content, 'HELP');
            if ('' != $plugin['help']) {
                $format = 'ied_help';
            }
        }
        echo startTable('edit');
        switch ($format) {
            case 'zem_help':
                echo tr(tda('<p>Plugin is in zem template format.</p>', ' width="600"'));
                if (!isset($plugin['allow_html_help']) or 0 === $plugin['allow_html_help']) {
                    #	Textile...
                    $plugin['css'] = _zem_extract_section($content, 'CSS');
                    include_once txpath . '/lib/classTextile.php';
                    if (class_exists('Textile')) {
                        $textile = new Textile();
                        $plugin['help'] = $plugin['css'] . n . $textile->TextileThis($plugin['help']);
                        echo tr(tda('<p>Extracted and Textile processed help section follows&#8230;</p><hr>', ' width="600"'));
                    } else {
                        echo tr(tda('<p>Extracted help section follows, <strong>Textile Processing Failed</strong>&#8230;</p><hr>', ' width="600"'));
                    }
                } else {
                    # (x)html...
                    $plugin['css'] = _zem_extract_section($content, 'CSS');
                    $plugin['help'] = $plugin['css'] . n . $plugin['help_raw'];
                }
                echo tr(tda($plugin['help'], ' width="600"'));
                break;
            case 'ied_help':
                echo tr(tda('<p>Plugin is in ied template format.</p>', ' width="600"'));
                echo tr(tda('<p>Extracted raw help section follows&#8230;</p><hr>', ' width="600"'));
                echo tr(tda($plugin['help'], ' width="600"'));
                break;
            default:
                echo tr(tda('<p><strong>Unknown plugin file format or empty help section.</strong></p><hr>', ' width="600"'));
                break;
        }
        echo endTable();
    } else {
        echo 'Help not accessible from that file.';
    }
}
开发者ID:netcarver,项目名称:sed_plugin_help_viewer,代码行数:60,代码来源:sed_plugin_help_viewer.php


示例5: do_textile

function do_textile($text)
{
    $textile = new Textile();
    $text = $textile->TextileRestricted($text, false, false);
    //return $text;
    return add_links($text);
}
开发者ID:bahmany,项目名称:PythonPurePaperless,代码行数:7,代码来源:wwww.php


示例6: indexAction

 public function indexAction()
 {
     #vynulovani rozpadu stromu
     $_SESSION['katalog']['pars']['u1'] = 0;
     $_SESSION['katalog']['rozpad'] = 0;
     $this->view->strom = stromek(0, $this->_getAllParams());
     $pom_txt = zpracujTexty(readData('texty', array('jazyk' => $_SESSION['jazyk'], 'kody' => "'uvod_top'")));
     $vysl = readData('index', array());
     $this->view->kategorie = array();
     foreach ($vysl->k->row as $r) {
         $this->view->kategorie[(string) $r->idk] = (string) $r->kat;
     }
     //definice stylu pro kategorie
     $css = '';
     $index = 1;
     foreach ($this->view->kategorie as $id => $kat) {
         $css .= '#rozcestnik li#kat-' . trim($id) . ' a, #rozcestnik li#kat-' . trim($id) . ' a:visited {' . "\n";
         $css .= 'background: #162983 url("/grafika/kat_' . trim($id) . '.jpg");' . "\n";
         if ($index == $index) {
             $css .= "height: 41px;\n";
             $css .= "padding-top: 37px;\n";
         }
         $css .= "}\n";
         $css .= '#rozcestnik li#kat-' . trim($id) . ' a:hover, #rozcestnik li#kat-' . trim($id) . ' a:focus, #rozcestnik li#kat-' . trim($id) . ' a:active {' . "\n";
         $css .= 'background: #5da6dc url("/grafika/kat_' . trim($id) . '_ho.jpg");' . "\n";
         $css .= "}\n";
         if ($index >= 3) {
             $index = 0;
         }
         $index++;
     }
     //$this->view->css_defs = array(0 => $css);
     $textile = new Textile();
     $this->view->txt = array('uvod_top' => $textile->TextileThis($pom_txt['uvod_top']));
 }
开发者ID:robertblaha,项目名称:hardcore,代码行数:35,代码来源:IndexController.php


示例7: section_save

function section_save()
{
    global $txpcfg;
    $in = psa(array('name', 'title', 'page', 'css', 'is_default', 'on_frontpage', 'in_rss', 'searchable', 'old_name'));
    extract(doSlash($in));
    if (empty($title)) {
        $title = $name;
    }
    //Prevent non url chars on section names
    include_once $txpcfg['txpath'] . '/lib/classTextile.php';
    $textile = new Textile();
    $title = $textile->TextileThis($title, 1);
    $name = dumbDown($textile->TextileThis($name, 1));
    $name = preg_replace("/[^[:alnum:]\\-_]/", "", str_replace(" ", "-", $name));
    if ($name == 'default') {
        safe_update("txp_section", "page='{$page}',css='{$css}'", "name='default'");
    } else {
        if ($is_default) {
            // note this means 'selected by default' not 'default page'
            safe_update("txp_section", "is_default=0", "name!='{$old_name}'");
        }
        safe_update("txp_section", "name         = '{$name}',\n\t\t\t\ttitle        = '{$title}',\n\t\t\t\tpage         = '{$page}',\n\t\t\t\tcss          = '{$css}',\n\t\t\t\tis_default   = '{$is_default}',\n\t\t\t\ton_frontpage = '{$on_frontpage}',\n\t\t\t\tin_rss       = '{$in_rss}',\n\t\t\t\tsearchable   = '{$searchable}'", "name = '{$old_name}'");
        safe_update("textpattern", "Section='{$name}'", "Section='{$old_name}'");
    }
    sec_section_list(messenger('section', $name, 'updated'));
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:26,代码来源:txp_section.php


示例8: make_content

function make_content($row)
{
    global $tp;
    $contents = utf8_decode(stripslashes($tp->toHTML($row['page_content'], true, 'body')));
    include_once "Textile.php";
    $textile = new Textile();
    $contents = $textile->process($contents);
    return $contents . "<p><small>" . LAN_W_8 . " <a href='" . e_HTTP . "user.php?id." . $row['page_author'] . "'>" . get_username($row['page_author']) . "</a></small></p>";
}
开发者ID:alcides,项目名称:e107wiki,代码行数:9,代码来源:templates.php


示例9: execute_textile

function execute_textile($data)
{
    static $textile;
    if (!$textile) {
        require IXG_PATH_PREFIX . "pipes/engines/textile/textile.php";
        $textile = new Textile();
    }
    return $textile->TextileThis($data);
}
开发者ID:serverboy,项目名称:Interchange,代码行数:9,代码来源:textile.php


示例10: 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);
    }
}
开发者ID:nemoDreamer,项目名称:endo,代码行数:10,代码来源:modifier.textile.php


示例11: section_save

function section_save()
{
    global $txpcfg, $app_mode;
    extract(doSlash(psa(array('page', 'css', 'old_name'))));
    extract(psa(array('name', 'title')));
    $prequel = '';
    $sequel = '';
    if (empty($title)) {
        $title = $name;
    }
    // Prevent non url chars on section names
    include_once txpath . '/lib/classTextile.php';
    $textile = new Textile();
    $title = doSlash($textile->TextileThis($title, 1));
    $name = doSlash(sanitizeForUrl($name));
    if ($old_name && strtolower($name) != strtolower($old_name)) {
        if (safe_field('name', 'txp_section', "name='{$name}'")) {
            $message = array(gTxt('section_name_already_exists', array('{name}' => $name)), E_ERROR);
            if ($app_mode == 'async') {
                // TODO: Better/themeable popup
                send_script_response('window.alert("' . escape_js(strip_tags(gTxt('section_name_already_exists', array('{name}' => $name)))) . '")');
            } else {
                sec_section_list($message);
                return;
            }
        }
    }
    if ($name == 'default') {
        safe_update('txp_section', "page = '{$page}', css = '{$css}'", "name = 'default'");
        update_lastmod();
    } else {
        extract(array_map('assert_int', psa(array('is_default', 'on_frontpage', 'in_rss', 'searchable'))));
        // note this means 'selected by default' not 'default page'
        if ($is_default) {
            safe_update("txp_section", "is_default = 0", "name != '{$old_name}'");
            // switch off $is_default for all sections in async app_mode
            if ($app_mode == 'async') {
                $prequel = '$("input[name=\\"is_default\\"][value=\\"1\\"]").attr("checked", false);' . '$("input[name=\\"is_default\\"][value=\\"0\\"]").attr("checked", true);';
            }
        }
        safe_update('txp_section', "\n\t\t\t\tname         = '{$name}',\n\t\t\t\ttitle        = '{$title}',\n\t\t\t\tpage         = '{$page}',\n\t\t\t\tcss          = '{$css}',\n\t\t\t\tis_default   = {$is_default},\n\t\t\t\ton_frontpage = {$on_frontpage},\n\t\t\t\tin_rss       = {$in_rss},\n\t\t\t\tsearchable   = {$searchable}\n\t\t\t", "name = '{$old_name}'");
        safe_update('textpattern', "Section = '{$name}'", "Section = '{$old_name}'");
        update_lastmod();
    }
    $message = gTxt('section_updated', array('{name}' => $name));
    if ($app_mode == 'async') {
        // Caveat: Use unslashed params for DTO
        $s = psa(array('name', 'title', 'page', 'css')) + compact('is_default', 'on_frontpage', 'in_rss', 'searchable');
        $s = section_detail_partial($s);
        send_script_response($prequel . '$("#section-form-' . $name . '").replaceWith("' . escape_js($s) . '");' . $sequel);
    } else {
        sec_section_list($message);
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:54,代码来源:txp_section.php


示例12: processPage

function processPage($page)
{
    $textile = new Textile();
    $handle = @fopen($page, "r");
    if ($handle == False) {
        return __("<center><h1>Error:This item is not documented!</h1></center>");
    }
    $contents = fread($handle, filesize($page));
    fclose($handle);
    return "<div class = 'textile'>{$textile->TextileThis($contents)}</div>";
}
开发者ID:nandor,项目名称:myGreenTown,代码行数:11,代码来源:textile.php


示例13: run

 function run($string)
 {
     if (!function_exists('typogrify')) {
         include_once EXTENSIONS . '/typogrify/lib/php-typogrify.php';
     }
     if (!class_exists('Textile')) {
         include_once EXTENSIONS . '/textile/lib/textile.php';
     }
     $textile = new Textile();
     return stripslashes(typogrify($textile->TextileThis($string)));
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:11,代码来源:formatter.ta_typogrifytextile.php


示例14: compile_plugin

function compile_plugin($file='') {
	global $plugin;

	if (empty($file))
		$file = $_SERVER['SCRIPT_FILENAME'];
    
	if (!isset($plugin['name'])) {
		$plugin['name'] = basename($file, '.php');
	}

	# Read the contents of this file, and strip line ends
    $content = read_file($file);

    $plugin['help'] = trim(extract_section($content, 'HELP'));
    $plugin['code'] = extract_section($content, 'CODE');

    if (isset($plugin['help_file'])) {
        $plugin_content =  read_file($plugin['help_file']);
        $plugin['help'] = trim(extract_section($plugin_content, 'HELP'));
    }

    // textpattern will textile it, and encode html
    $plugin['help_raw'] = $plugin['help'];

	@include('classTextile.php');
	if (class_exists('Textile')) {
		$textile = new Textile();
		$plugin['help'] = $textile->TextileThis($plugin['help']);
	}

	$plugin['md5'] = md5( $plugin['code'] );

	// to produce a copy of the plugin for distribution, load this file in a browser. 

	header('Content-type: text/plain');
	$header = <<<EOF
# {$plugin['name']} v{$plugin['version']}
# {$plugin['description']}
# {$plugin['author']}
# {$plugin['author_uri']}

# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................
EOF;

	return $header . "\n\n" . trim(chunk_split(base64_encode(serialize($plugin)), 72)). "\n";

}
开发者ID:rwetzlmayr,项目名称:hak_tinymce,代码行数:51,代码来源:zem_tpl.php


示例15: search_wiki

function search_wiki($row)
{
    require_once e_PLUGIN . 'wiki/preferences.php';
    // Populate as many of the $res array keys as is sensible for the plugin
    $res['link'] = e_PLUGIN . "wiki/?page=" . urlencode($row['page_title']);
    $res['pre_title'] = "";
    $res['title'] = $row["page_title"] . "";
    $res['pre_summary'] = "";
    include_once e_PLUGIN . "wiki/Textile.php";
    $textile = new Textile();
    $res['summary'] = stripslashes($textile->process(stripslashes($row['page_content'])));
    $res['detail'] = "";
    return $res;
}
开发者ID:alcides,项目名称:e107wiki,代码行数:14,代码来源:search.php


示例16: import_mt_item

function import_mt_item($item, $section, $status, $invite)
{
    # Untested import code follows
    if (empty($item)) {
        return;
    }
    include_once txpath . '/lib/classTextile.php';
    $textile = new Textile();
    $title = $textile->TextileThis($item['TITLE'], 1);
    //nice non-english permlinks
    $url_title = stripSpace(dumbDown($title));
    $body = $item['BODY'][0]['content'] . (isset($item['EXTENDED_BODY']) ? "\n<!--more-->\n" . $item['EXTENDED_BODY'][0]['content'] : '');
    $body_html = $textile->textileThis($body);
    $excerpt = @$item['EXCERPT'][0]['content'];
    $excerpt_html = $textile->textileThis($excerpt);
    $date = strtotime($item['DATE']);
    $date = date('Y-m-d H:i:s', $date);
    if (isset($item['STATUS'])) {
        $post_status = $item['STATUS'] == 'Draft' ? 1 : 4;
    } else {
        $post_status = $status;
    }
    $category1 = @$item['PRIMARY CATEGORY'];
    if ($category1 and !safe_field("name", "txp_category", "name = '{$category1}'")) {
        safe_insert('txp_category', "name='" . doSlash($category1) . "', type='article', parent='root'");
    }
    $keywords = @$item['KEYWORDS'][0]['content'];
    $authorid = safe_field('user_id', 'txp_users', "name = '" . doSlash($item['AUTHOR']) . "'");
    if (!$authorid) {
        //		$authorid = safe_field('user_id', 'txp_users', 'order by user_id asc limit 1');
        //Add new authors
        safe_insert('txp_users', "name='" . doSlash($item['AUTHOR']) . "'");
    }
    if (!safe_field("ID", "textpattern", "Title = '" . doSlash($title) . "' AND Posted = '" . doSlash($date) . "'")) {
        safe_insert('textpattern', "Posted='" . doSlash($date) . "'," . "LastMod='" . doSlash($date) . "'," . "AuthorID='" . doSlash($item['AUTHOR']) . "'," . "LastModID='" . doSlash($item['AUTHOR']) . "'," . "Title='" . doSlash($title) . "'," . "Body='" . doSlash($body) . "'," . "Body_html='" . doSlash($body_html) . "'," . "Excerpt='" . doSlash($excerpt) . "'," . "Excerpt_html='" . doSlash($excerpt_html) . "'," . "Category1='" . doSlash($category1) . "'," . "AnnotateInvite='" . doSlash($invite) . "'," . "Status='" . doSlash($post_status) . "'," . "Section='" . doSlash($section) . "'," . "Keywords='" . doSlash($keywords) . "'," . "uid='" . md5(uniqid(rand(), true)) . "'," . "feed_time='" . substr($date, 0, 10) . "'," . "url_title='" . doSlash($url_title) . "'");
        $parentid = mysql_insert_id();
        if (!empty($item['COMMENT'])) {
            foreach ($item['COMMENT'] as $comment) {
                $comment_date = date('Y-m-d H:i:s', strtotime(@$comment['DATE']));
                $comment_content = $textile->TextileThis(nl2br(@$comment['content']), 1);
                if (!safe_field("discussid", "txp_discuss", "posted = '" . doSlash($comment_date) . "' AND message = '" . doSlash($comment_content) . "'")) {
                    safe_insert('txp_discuss', "parentid='" . doSlash($parentid) . "'," . "name='" . doSlash(@$comment['AUTHOR']) . "'," . "email='" . doSlash(@$comment['EMAIL']) . "'," . "web='" . doSlash(@$comment['URL']) . "'," . "ip='" . doSlash(@$comment['IP']) . "'," . "posted='" . doSlash($comment_date) . "'," . "message='" . doSlash($comment_content) . "'," . "visible='1'");
                }
            }
        }
        return $title;
    }
    return $title . ' already imported';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:49,代码来源:import_mt.php


示例17: FM_Textile_format

function FM_Textile_format($blogid, $id, $content, $keywords = array(), $useAbsolutePath = true, $bRssMode = false)
{
    global $service;
    $textile = new Textile();
    $path = __TEXTCUBE_ATTACH_DIR__ . "/{$blogid}";
    $url = "{$service['path']}/attach/{$blogid}";
    if (!function_exists('FM_TTML_bindAttachments')) {
        // To reduce the amount of loading code!
        require_once 'ttml.php';
    }
    $view = FM_TTML_bindAttachments($id, $path, $url, $content, $useAbsolutePath, $bRssMode);
    $view = $textile->TextileThis($view);
    $view = FM_TTML_bindTags($id, $view);
    return $view;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:15,代码来源:index.php


示例18: process

 public function process($content, $lite = '', $encode = '', $noimage = '', $strict = '', $rel = '')
 {
     // Convert the raw content to wiki content
     switch ($this->syntax) {
         case 'markdown':
             require_once PHPGW_API_INC . '/wiki2html/markdown/markdown.php';
             $html = Markdown($content);
             break;
         default:
             require_once PHPGW_API_INC . '/wiki2html/textile/Textile.php';
             $textile = new Textile();
             $html = $textile->TextileThis($content);
     }
     return $html;
 }
开发者ID:HaakonME,项目名称:porticoestate,代码行数:15,代码来源:class.wiki2html.inc.php


示例19: 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;
}
开发者ID:Voker57,项目名称:gshare,代码行数:15,代码来源:gshare.php


示例20: get_rendered_text

 public static function get_rendered_text($text)
 {
     $style = Kohana::config('filebrowser.text_rendering');
     if ($style == "textile") {
         $textile = new Textile();
         //return $textile->TextileThis(text::auto_link_urls($text, '_blank'));
         return $textile->TextileThis($text);
     } else {
         if ($style == "markdown") {
             //return Markdown(text::auto_link_urls($text, '_blank'));
             return Markdown($text);
         } else {
             return $text;
         }
     }
 }
开发者ID:romyilano,项目名称:subfolio,代码行数:16,代码来源:MY_format.php



注:本文中的Textile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Texy类代码示例发布时间:2022-05-23
下一篇:
PHP TextareaField类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap