当前位置: 首页>>代码示例>>PHP>>正文


PHP p_render函数代码示例

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


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

示例1: render

 function render($mode, Doku_Renderer $renderer, $data)
 {
     if (empty($data)) {
         return false;
     }
     if ($mode == 'xhtml') {
         /** @var Doku_Renderer_xhtml $renderer */
         list($state, $content, $classes, $attributes) = $data;
         switch ($state) {
             case DOKU_LEXER_ENTER:
                 $type = $attributes['type'] ? $attributes['type'] : 'info';
                 $icon = $attributes['icon'] ? $attributes['icon'] : null;
                 $markup = sprintf('<div class="label label-%s">', $type);
                 if ($icon) {
                     $markup .= sprintf('<i class="%s"></i> ', $icon);
                 }
                 $renderer->doc .= $markup;
                 return true;
             case DOKU_LEXER_UNMATCHED:
                 $renderer->doc .= sprintf($this->template_content, str_replace(array('<p>', '</p>'), '', p_render("xhtml", p_get_instructions($content), $info)));
                 return true;
             case DOKU_LEXER_EXIT:
                 $renderer->doc .= '</div>';
                 return true;
         }
         return true;
     }
     return false;
 }
开发者ID:sawachan,项目名称:dokuwiki-plugin-bootswrapper,代码行数:29,代码来源:label.php

示例2: render

 function render($mode, Doku_Renderer $renderer, $data)
 {
     if (empty($data)) {
         return false;
     }
     if ($mode == 'xhtml') {
         /** @var Doku_Renderer_xhtml $renderer */
         list($state, $content, $classes, $attributes) = $data;
         switch ($state) {
             case DOKU_LEXER_ENTER:
                 $location = $attributes['location'] ? $attributes['location'] : 'top';
                 $title = $attributes['title'] ? $attributes['title'] : null;
                 $markup = sprintf('<span data-toggle="tooltip" data-html="true" data-placement="%s" title="%s" style="border-bottom:1px dotted">', $location, $title);
                 $renderer->doc .= $markup;
                 return true;
             case DOKU_LEXER_UNMATCHED:
                 $renderer->doc .= sprintf($this->template_content, str_replace(array('<p>', '</p>'), '', p_render("xhtml", p_get_instructions($content), $info)));
                 return true;
             case DOKU_LEXER_EXIT:
                 $renderer->doc .= '</span>';
                 return true;
         }
         return true;
     }
     return false;
 }
开发者ID:sawachan,项目名称:dokuwiki-plugin-bootswrapper,代码行数:26,代码来源:tooltip.php

示例3: handle

 function handle($match, $state, $pos, &$handler)
 {
     $data = array('task' => array(), 'state' => $state);
     switch ($state) {
         case DOKU_LEXER_ENTER:
             $match = trim(substr($match, 3, -1));
             if (preg_match('/\\b(\\d\\d\\d\\d-\\d\\d-\\d\\d)\\b/', $match, $grep)) {
                 $data['task']['date'] = $grep[1];
                 $match = trim(str_replace($data['task']['date'], '', $match));
             }
             if ($match !== '') {
                 //FIXME call $auth->cleanUser()
                 $data['task']['user'] = $match;
             }
             $ReWriter = new Doku_Handler_Nest($handler->CallWriter, 'plugin_do_do');
             $handler->CallWriter =& $ReWriter;
             $handler->addPluginCall('do_do', $data, $state, $pos, $match);
             break;
         case DOKU_LEXER_UNMATCHED:
             $handler->_addCall('cdata', array($match), $pos);
             break;
         case DOKU_LEXER_EXIT:
             global $ID;
             $data['task']['text'] = trim(strip_tags(p_render('xhtml', array_slice($handler->CallWriter->calls, 1), $ignoreme)));
             $data['task']['md5'] = md5(utf8_strtolower(preg_replace('/\\s/', '', $data['task']['text'])) . $ID);
             // Add missing data from ENTER and EXIT to the other
             $handler->CallWriter->calls[0][1][1]['task'] += $data['task'];
             $data['task'] += $handler->CallWriter->calls[0][1][1]['task'];
             $handler->addPluginCall('do_do', $data, $state, $pos, $match);
             $handler->CallWriter->process();
             $ReWriter =& $handler->CallWriter;
             $handler->CallWriter =& $ReWriter->CallWriter;
     }
     return false;
 }
开发者ID:rauschen,项目名称:do,代码行数:35,代码来源:do.php

示例4: render

 function render($mode, Doku_Renderer $renderer, $data)
 {
     if (empty($data)) {
         return false;
     }
     if ($mode == 'xhtml') {
         /** @var Doku_Renderer_xhtml $renderer */
         list($state, $content, $classes, $attributes) = $data;
         switch ($state) {
             case DOKU_LEXER_ENTER:
                 $type = $attributes['type'] ? $attributes['type'] : 'info';
                 $icon = $attributes['icon'] ? $attributes['icon'] : null;
                 $dismiss = $attributes['dismiss'] ? $attributes['dismiss'] : false;
                 $markup = sprintf('<div class="alert alert-%s %s" role="alert">', $type, $dismiss ? 'alert-dismissible' : '');
                 if ($dismiss) {
                     $markup .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>';
                 }
                 if ($icon) {
                     $markup .= sprintf('<i class="%s"></i> ', $icon);
                 }
                 $renderer->doc .= $markup;
                 return true;
             case DOKU_LEXER_UNMATCHED:
                 $renderer->doc .= sprintf($this->template_content, str_replace(array('<p>', '</p>'), '', p_render("xhtml", p_get_instructions($content), $info)));
                 return true;
             case DOKU_LEXER_EXIT:
                 $renderer->doc .= '</div>';
                 return true;
         }
         return true;
     }
     return false;
 }
开发者ID:sawachan,项目名称:dokuwiki-plugin-bootswrapper,代码行数:33,代码来源:alert.php

示例5: render

 /**
  * Create output
  */
 public function render($format, Doku_Renderer $renderer, $indata)
 {
     if (empty($indata)) {
         return false;
     }
     list($state, $data) = $indata;
     if ($format != 'xhtml') {
         return false;
     }
     switch ($state) {
         case DOKU_LEXER_ENTER:
             list($class, $title) = $data;
             if ($title) {
                 //$html = '<div class="plugin_codeprettify">'.hsc($title).'</div>';
                 $html = p_render($format, p_get_instructions($title), $info);
                 $html = '<div class="plugin_codeprettify">' . $html . '</div>';
                 $renderer->doc .= $html;
             }
             $class = implode(' ', $class);
             $renderer->doc .= '<pre class="' . $class . '">';
             break;
         case DOKU_LEXER_UNMATCHED:
             $renderer->doc .= $renderer->_xmlEntities($data);
             break;
         case DOKU_LEXER_EXIT:
             $renderer->doc .= '</pre>';
             break;
     }
     return true;
 }
开发者ID:EricFromCanada,项目名称:dw-plugin-codeprettify,代码行数:33,代码来源:code.php

示例6: renderValue

 /**
  * @param int|string $value
  * @param \Doku_Renderer $R
  * @param string $mode
  * @return bool
  */
 public function renderValue($value, \Doku_Renderer $R, $mode)
 {
     $doc = p_render($mode, p_get_instructions($value), $info);
     $R->doc .= $doc;
     // FIXME this probably does not work for all renderers
     return true;
 }
开发者ID:cosmocode,项目名称:dokuwiki-plugin-struct,代码行数:13,代码来源:Wiki.php

示例7: render

 function render($mode, Doku_Renderer $renderer, $data)
 {
     if (empty($data)) {
         return false;
     }
     if ($mode == 'xhtml') {
         /** @var Doku_Renderer_xhtml $renderer */
         list($state, $match, $attributes) = $data;
         switch ($state) {
             case DOKU_LEXER_ENTER:
                 $placement = $attributes['placement'];
                 $title = $attributes['title'];
                 $html = $attributes['html'];
                 if ($html) {
                     $title = hsc(p_render('xhtml', p_get_instructions($title), $info));
                 }
                 $markup = sprintf('<span class="bs-wrap bs-wrap-tooltip" data-toggle="tooltip" data-html="%s" data-placement="%s" title="%s" style="border-bottom:1px dotted">', $html, $placement, $title);
                 $renderer->doc .= $markup;
                 return true;
             case DOKU_LEXER_EXIT:
                 $renderer->doc .= '</span>';
                 return true;
         }
         return true;
     }
     return false;
 }
开发者ID:Juergen-aus-Koeln,项目名称:dokuwiki-plugin-bootswrapper,代码行数:27,代码来源:tooltip.php

示例8: test_HTMLinclusion

 public function test_HTMLinclusion()
 {
     $input = file_get_contents(dirname(__FILE__) . '/input.txt');
     $xhtml = p_render('xhtml', p_get_instructions($input), $info);
     $doc = phpQuery::newDocument($xhtml);
     // HTML Check - there should be no bold tag anywhere
     $this->assertEquals(0, pq('bold', $doc)->length);
 }
开发者ID:elaratain,项目名称:dokuwiki-plugin-bureaucracy,代码行数:8,代码来源:syntax.test.php

示例9: parse

 function parse($string)
 {
     $info = array();
     $rendered = p_render('xhtml', p_get_instructions($string), $info);
     dbglog($string, 'alphalist helper::parse before');
     dbglog($rendered, 'alphalist helper::parse after');
     return $rendered;
 }
开发者ID:johanvanl,项目名称:dokuwiki-plugin-alphalist,代码行数:8,代码来源:helper.php

示例10: main

 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @throws DokuCLI_Exception
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $renderer = $options->getOpt('renderer', 'xhtml');
     // do the action
     $source = stream_get_contents(STDIN);
     $info = array();
     $result = p_render($renderer, p_get_instructions($source), $info);
     if (is_null($result)) {
         throw new DokuCLI_Exception("No such renderer {$renderer}");
     }
     echo $result;
 }
开发者ID:jotttt,项目名称:ttu-wiki,代码行数:21,代码来源:render.php

示例11: test_parser

 function test_parser()
 {
     global $ID;
     $ID = 'foo:bar:start';
     $parser_response = p_get_instructions('~~PDFNS>.:|Foo~~');
     $expected_parser_response = array('plugin', array('dw2pdf_exportlink', array('link' => '?do=export_pdfns&book_ns=foo:bar&book_title=Foo', 'title' => 'Export namespace "foo:bar:" to file Foo.pdf', 5, 1), 5, '~~PDFNS>.:|Foo~~'), 1);
     $this->assertEquals($expected_parser_response, $parser_response[2]);
     $renderer_response = p_render('xhtml', $parser_response, $info);
     $expected_renderer_response = 'doku.php?id=foo:bar:start&amp;do=export_pdfns&amp;book_ns=foo:bar&amp;book_title=Foo" class="wikilink2" title="foo:bar:start" rel="nofollow">Export namespace &quot;foo:bar:&quot; to file Foo.pdf</a>';
     $trimmed_renderer_response = substr($renderer_response, strpos($renderer_response, 'doku.php'), -5);
     $trimmed_renderer_response = trim($trimmed_renderer_response);
     $this->assertEquals($expected_renderer_response, $trimmed_renderer_response);
 }
开发者ID:a-gundy,项目名称:dokuwiki-plugin-dw2pdf,代码行数:13,代码来源:syntax_exportlink.test.php

示例12: override_cached_output

 protected function override_cached_output($file, $format = 'xhtml', $id = '')
 {
     // we are not caching this page because it interferes with language switching
     $parsed = p_render($format, $this->override_cached_instructions($file, false, $id), $info);
     // if there is a user logged in, insert the translate button
     if ($GLOBALS['USERINFO'] != null && !empty($GLOBALS['USERINFO']['grps'])) {
         $ns = $this->getNamespace();
         if (!empty($ns) && $ns != 'en') {
             $parsed .= PHP_EOL . $this->getButton();
         }
     }
     return $parsed;
 }
开发者ID:kbuildsyourdotcom,项目名称:Door43,代码行数:13,代码来源:RegisterOverride.php

示例13: _render

    function _render(&$event, $param)
    {
        ### _render : displays the upload form in the pages according to authorized action
        # INPUT : it's a dokuwiki event function
        # OUTPUT : void
        # DISPLAY : upload form
        global $ID, $lang;
        // Check if the current action is in the action allow table
        if (strpos($this->getConf('formDisplayRule'), $event->data) === false) {
            return;
        }
        // Check if the page exists
        if (page_exists($ID) && $event->data != "odt2dw") {
            return;
        }
        if (page_exists($ID)) {
            echo p_render('xhtml', p_get_instructions($this->getLang('formPageExistMessage')), $info);
        }
        // Check auth user can edit this page
        if (auth_quickaclcheck($ID) < AUTH_EDIT) {
            return;
        }
        // If all check is ok, display the form
        $message = $this->getConf('formIntroMessage');
        if ($message == 'default') {
            $message = $this->getLang('formIntroMessage');
        }
        if ($message) {
            echo p_render('xhtml', p_get_instructions($message), $info);
        }
        // FIXME create the form with dokuwiki method ?
        echo '<form method="post" action="" enctype="multipart/form-data">
<fieldset>
<legend>' . $this->getLang('formLegend') . '</legend>
<input type="hidden" name="MAX_FILE_SIZE" value="' . $this->getConf('formMaxFileSize') . '"/>
<input type="hidden" name="do" value="odt2dw"/>
<input type="hidden" name="id" value="' . $ID . '"/>
<input type="file" name="odtFile"/>
<input type="submit" value="' . $lang['btn_upload'] . '"/>
</fieldset>
</form>';
        if ($event->data == 'odt2dw') {
            $event->preventDefault();
        }
    }
开发者ID:rotdrop,项目名称:dokuwiki-plugin-odt2dw,代码行数:45,代码来源:action.php

示例14: handle

 /**
  * Handle matches of the newsticker syntax
  *
  * @param string $match The match of the syntax
  * @param int    $state The state of the handler
  * @param int    $pos The position in the document
  * @param Doku_Handler    $handler The handler
  * @return array Data for the renderer
  */
 public function handle($match, $state, $pos, Doku_Handler &$handler)
 {
     if ($state !== 3) {
         return array();
     }
     $data = array();
     $lines = explode("\n", $match);
     $lines = $this->cleanData($lines);
     foreach ($lines as $newsItem) {
         $instructions = p_get_instructions($newsItem);
         $render = p_render('xhtml', $instructions, $info);
         $render = trim($render);
         $render = ltrim($render, '<p>');
         $render = rtrim($render, '</p>');
         $data[] = $render;
     }
     return $data;
 }
开发者ID:Klap-in,项目名称:dokuwiki-plugin-newsticker,代码行数:27,代码来源:ticker.php

示例15: tpl_navigation

/**
 * Prints the navigation
 *
 * @author Michael Klier <chi@chimeric.de>
 */
function tpl_navigation()
{
    global $ID;
    global $conf;
    $navpage = tpl_getConf('navigation_page');
    print '<div class="navigation">' . DOKU_LF;
    if (!page_exists($navpage)) {
        if (@file_exists(DOKU_TPLINC . 'lang/' . $conf['lang'] . '/nonavigation.txt')) {
            $out = p_render('xhtml', p_get_instructions(io_readFile(DOKU_TPLINC . 'lang/' . $conf['lang'] . '/nonavigation.txt')), $info);
        } else {
            $out = p_render('xhtml', p_get_instructions(io_readFile(DOKU_TPLINC . 'lang/en/nonavigation.txt')), $info);
        }
        $link = '<a href="' . wl($navpage) . '" class="wikilink2">' . $navpage . '</a>' . DOKU_LF;
        print str_replace('LINK', $link, $out);
    } else {
        print p_wiki_xhtml($navpage);
    }
    print '</div>';
}
开发者ID:adri,项目名称:Dokuwiki-OS-X-Template,代码行数:24,代码来源:tpl_functions.php


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