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


PHP Haanga::Load方法代码示例

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


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

示例1: print_edit_form

function print_edit_form()
{
    global $link, $comment, $current_user, $site_key, $globals;
    if ($current_user->user_level != 'god' && time() - $comment->date > $globals['comment_edit_time']) {
        die;
    }
    // $rows = min(40, max(substr_count($comment->content, "\n") * 2, 8));
    echo '<div class="commentform">' . "\n";
    //echo '<form action="'.htmlspecialchars($_SERVER['PHP_SELF']).'" class="comment" method="post" enctype="multipart/form-data">'."\n";
    echo '<form action="' . htmlspecialchars($_SERVER['REQUEST_URI']) . '" class="comment" method="post" enctype="multipart/form-data">' . "\n";
    echo '<input type="hidden" name="process" value="editcomment" />' . "\n";
    echo '<input type="hidden" name="key" value="' . md5($comment->randkey . $site_key) . '" />' . "\n";
    echo '<input type="hidden" name="id" value="' . $comment->id . '" />' . "\n";
    echo '<fieldset><legend>' . _('editar comentario') . '</legend>' . "\n";
    print_simpleformat_buttons('edit-comment-' . $comment->id);
    echo '<div style="clear: right"><textarea name="comment_content" class="droparea" id="edit-comment-' . $comment->id . '" rows="5">' . $comment->content . '</textarea></div>' . "\n";
    echo '<input class="button" type="submit" name="submit" value="' . _('modificar comentario') . '" />' . "\n";
    // Allow gods to put "admin" comments which does not allow votes
    if ($current_user->user_level == 'god') {
        if ($comment->type == 'admin') {
            $checked = 'checked="true"';
        }
        echo '&nbsp;&nbsp;&nbsp;&nbsp;<label><strong>' . _('admin') . ' </strong><input name="type" type="checkbox" value="admin" ' . $checked . '/></label>' . "\n";
    }
    $vars = compact('link', 'comment');
    Haanga::Load('comment_edit.html', $vars);
    echo '</fieldset>' . "\n";
    echo '</form>' . "\n";
    echo "</div>\n";
}
开发者ID:manelio,项目名称:woolr,代码行数:30,代码来源:comment_edit.php

示例2: create_form

function create_form($view, $title, $data = array())
{
    global $site_key, $current_user;
    $time = microtime(true) * 1000;
    $form = array('title' => $title, 'hash' => sha1($site_key . $time . $current_user->user_id), 'time' => $time);
    Haanga::Load("league/form.{$view}.tpl", compact('form', 'data'));
}
开发者ID:GallardoAlba,项目名称:Meneame,代码行数:7,代码来源:common.php

示例3: display

 public function display($template, $page_title = '', $meta_description = '', array $css_files = array(), array $js_files = array())
 {
     $this->vars['page_title'] = $page_title ? $page_title : DEFAULT_PAGE_TITLE;
     $this->vars['meta_description'] = $meta_description ? $meta_description : DEFAULT_META_DESCRIPTION;
     // Add CSS files from arguments
     if ($css_files) {
         foreach ($css_files as $css_file) {
             $this->css_files[] = $css_file;
         }
     }
     $this->vars['css_files'] = $this->css_files;
     // Add JS files from arguments
     if ($js_files) {
         foreach ($js_files as $js_file) {
             $this->js_files[] = $js_file;
         }
     }
     $this->vars['js_files'] = $this->js_files;
     // Add preloaded CSS files
     foreach ($this->preloaded_css_files as $css_file) {
         $this->vars['css_files'][] = $css_file;
     }
     // Add preloaded JS files
     foreach ($this->preloaded_js_files as $js_file) {
         $this->vars['js_files'][] = $js_file;
     }
     $this->vars['js_vars'] = $this->js_vars;
     $this->vars['breadcrumb'] = $this->breadcrumb;
     Haanga::Load($template, $this->vars);
 }
开发者ID:kyrst,项目名称:base,代码行数:30,代码来源:skinner.php

示例4: haanga_464bf9fc69ec3d748e58e59c7b427e138da5ab9b

function haanga_464bf9fc69ec3d748e58e59c7b427e138da5ab9b($vars, $return = FALSE, $blocks = array())
{
    global $test_global, $global1;
    extract($vars);
    if ($return == TRUE) {
        ob_start();
    }
    $buffer1 = '
';
    $buffer2 = '
this is inner1
';
    $blocks['inner1'] = isset($blocks['inner1']) ? strpos($blocks['inner1'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['inner1'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer2, $blocks['inner1']) : $buffer2;
    $buffer1 .= $blocks['inner1'] . '
';
    $buffer2 = '
this is inner2
';
    $blocks['inner2'] = isset($blocks['inner2']) ? strpos($blocks['inner2'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['inner2'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer2, $blocks['inner2']) : $buffer2;
    $buffer1 .= $blocks['inner2'] . '
';
    $blocks['outer'] = isset($blocks['outer']) ? strpos($blocks['outer'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['outer'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer1, $blocks['outer']) : $buffer1;
    echo Haanga::Load('assert_templates/empty_block_base.tpl', $vars, TRUE, $blocks);
    if ($return == TRUE) {
        return ob_get_clean();
    }
}
开发者ID:narock,项目名称:lodspeakr,代码行数:27,代码来源:empty_block.tpl.php

示例5: testIsCached

 /** 
  * @dataProvider tplProvider
  */
 public function testIsCached($test_file, $data, $expected)
 {
     /* same as above, but we ensure that the file wasn't compiled */
     $this->init($test_file, $expected);
     $output = Haanga::Load($test_file, $data, TRUE);
     $this->assertEquals($output, $expected);
     $this->assertFalse(Haanga::$has_compiled);
 }
开发者ID:crodas,项目名称:haanga,代码行数:11,代码来源:templateTest.php

示例6: view

 function view($name, $base = null)
 {
     $this->set('controller', router::$controller);
     $this->set('route', router::$route);
     $this->set('session', $this->session);
     if ($base == null) {
         $base = router::$views_path;
     }
     Haanga::Load($base . '/' . $name, kernel::$haanga_var);
 }
开发者ID:sebastian37,项目名称:eMvc,代码行数:10,代码来源:kernel.php

示例7: testInvalidTemplates

 /** 
  * @dataProvider tplProvider
  *  
  */
 public function testInvalidTemplates($tpl)
 {
     Haanga_Compiler::setOption('allow_exec', FALSE);
     try {
         Haanga::Load($tpl);
         $this->assertTrue(FALSE);
     } catch (Haanga_Compiler_Exception $e) {
         $i = preg_match("/in.*:[0-9]+/", $e->getMessage());
         $this->assertEquals(1, $i);
     }
 }
开发者ID:crodas,项目名称:haanga,代码行数:15,代码来源:errorTest.php

示例8: print_summary

 function print_summary($type = 'full', $karma_best_comment = 0, $show_tags = true)
 {
     global $current_user, $current_user, $globals, $db;
     if (!$this->read) {
         return;
     }
     $this->is_votable();
     switch ($this->status) {
         case 'queued':
             // another color box for not-published
             $box_class = 'mnm-queued';
             break;
         case 'abuse':
             // another color box for discarded
         // another color box for discarded
         case 'autodiscard':
             // another color box for discarded
         // another color box for discarded
         case 'discard':
             // another color box for discarded
             $box_class = 'mnm-discarded';
             break;
         case 'published':
             // default for published
         // default for published
         default:
             $box_class = 'mnm-published';
             break;
     }
     $this->has_warning = !(!$this->check_warn() || $this->is_discarded());
     $this->is_editable = $this->author == $current_user->user_id && $this->is_editable();
     $this->total_votes = $this->votes + $this->anonymous;
     $this->rpermalink = $this->get_relative_permalink();
     $this->author_html = '<a href="' . get_user_uri($this->username, 'history') . '">' . $this->username . '</a>';
     $this->normal_link = preg_replace('/\\/mobile\\//', '/', $this->get_relative_permalink());
     $this->show_shakebox = $type != 'preview' && $this->votes > 0;
     $this->thumb_url = $this->has_thumb();
     if ($this->status == 'abuse' || $this->has_warning) {
         $this->negative_text = FALSE;
         $negatives = $db->get_row("select SQL_CACHE vote_value, count(vote_value) as count from votes where vote_type='links' and vote_link_id={$this->id} and vote_value < 0 group by vote_value order by count desc limit 1");
         if ($negatives->count > 2 && $negatives->count >= $this->negatives / 2 && ($negatives->vote_value == -6 || $negatives->vote_value == -8)) {
             $this->negative_text = get_negative_vote($negatives->vote_value);
         }
     }
     $text = $this->content;
     $my_domain = get_server_name();
     $parent_domain = preg_replace('/m\\./', '', $my_domain);
     if ($parent_domain != $my_domain && preg_match('#[^\\.]' . preg_quote($parent_domain) . '/#', $text)) {
         $text = preg_replace('#([^\\.])' . preg_quote($parent_domain) . '/#', "\$1{$my_domain}/", $text);
     }
     $vars = compact('type', 'karma_best_comment', 'show_tags', 'box_class', 'nofollow', 'url', 'text');
     $vars['self'] = $this;
     return Haanga::Load('mobile/link_summary.html', $vars);
 }
开发者ID:GallardoAlba,项目名称:Meneame,代码行数:54,代码来源:linkmobile.php

示例9: render

 public function render()
 {
     $config = array('template_dir' => $this->getTemplateDir(), 'cache_dir' => $this->getCacheDir(), 'debug' => $this->debug, 'compiler' => array('allow_exec' => true));
     if ($this->cache && is_callable('xcache_isset')) {
         /* don't check for changes in the template for the next 5 min */
         $config['check_ttl'] = 300;
         $config['check_get'] = 'xcache_get';
         $config['check_set'] = 'xcache_set';
     }
     \Haanga::configure($config);
     \Haanga::Load($this->getTpl(), $this->data);
 }
开发者ID:phpalchemy,项目名称:phpalchemy,代码行数:12,代码来源:HaangaView.php

示例10: haanga_d905488f199a96b638d52d62c0fc424fd291ed39

function haanga_d905488f199a96b638d52d62c0fc424fd291ed39($vars, $return = FALSE, $blocks = array())
{
    global $test_global, $global1;
    extract($vars);
    if ($return == TRUE) {
        ob_start();
    }
    $buffer1 = '
    2.1-overrided
';
    $blocks['inner2_1'] = isset($blocks['inner2_1']) ? strpos($blocks['inner2_1'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['inner2_1'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer1, $blocks['inner2_1']) : $buffer1;
    echo Haanga::Load('assert_templates/nested_block_second_parent.tpl', $vars, TRUE, $blocks);
    if ($return == TRUE) {
        return ob_get_clean();
    }
}
开发者ID:narock,项目名称:lodspeakr,代码行数:16,代码来源:nested_block_second_parent_override.tpl.php

示例11: haanga_a2c536c1d9b6f09d66feff81ca9b1e993d15d32e

function haanga_a2c536c1d9b6f09d66feff81ca9b1e993d15d32e($vars, $return = FALSE, $blocks = array())
{
    global $test_global, $global1;
    extract($vars);
    if ($return == TRUE) {
        ob_start();
    }
    $buffer1 = '
{{block.1b3231655cebb7a1f783eddf27d254ca}}
new stuff
';
    $blocks['outer'] = isset($blocks['outer']) ? strpos($blocks['outer'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['outer'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer1, $blocks['outer']) : $buffer1;
    echo Haanga::Load('assert_templates/nested_block.tpl', $vars, TRUE, $blocks);
    if ($return == TRUE) {
        return ob_get_clean();
    }
}
开发者ID:narock,项目名称:lodspeakr,代码行数:17,代码来源:inheritence_nested_block.tpl.php

示例12: haanga_8012978a44e77332b744185d044350c7eb89603f

function haanga_8012978a44e77332b744185d044350c7eb89603f($vars, $return = FALSE, $blocks = array())
{
    global $test_global, $global1;
    extract($vars);
    if ($return == TRUE) {
        ob_start();
    }
    $buffer1 = 'My Title - {{block.1b3231655cebb7a1f783eddf27d254ca}}';
    $blocks['title'] = isset($blocks['title']) ? strpos($blocks['title'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['title'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer1, $blocks['title']) : $buffer1;
    $buffer1 = '
    {{block.1b3231655cebb7a1f783eddf27d254ca}}

    :-)
';
    $blocks['main.menu'] = isset($blocks['main.menu']) ? strpos($blocks['main.menu'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['main.menu'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer1, $blocks['main.menu']) : $buffer1;
    echo Haanga::Load('assert_templates/base.tpl', $vars, TRUE, $blocks);
    if ($return == TRUE) {
        return ob_get_clean();
    }
}
开发者ID:narock,项目名称:lodspeakr,代码行数:20,代码来源:subtemplate.tpl.php

示例13: print_edit_form

function print_edit_form($comment, $link)
{
    global $current_user, $site_key, $globals, $reply_to;
    $data = array();
    $html = '';
    if ($comment->id == 0) {
        $comment->randkey = rand(1000000, 100000000);
    }
    $html .= '<div class="commentform">';
    $html .= '<form action="' . $globals['base_url'] . "comment_ajax?reply_to={$reply_to}&amp;link={$link->id}&amp;id={$comment->id}&amp;user={$current_user->user_id}" . '" class="comment" method="post" enctype="multipart/form-data" id="c_edit_form">';
    $html .= '<input type="hidden" name="randkey" value="' . $comment->randkey . '" />';
    $html .= '<input type="hidden" name="process" value="editcomment" />';
    $html .= '<input type="hidden" name="key" value="' . md5($comment->randkey . $site_key) . '" />';
    $html .= '<input type="hidden" name="id" value="' . $comment->id . '" />';
    $vars = compact('link', 'comment');
    $html .= Haanga::Load('comment_edit.html', $vars, true);
    $html .= '</form></div>';
    $data['html'] = $html;
    $data['error'] = '';
    echo json_encode($data);
}
开发者ID:GallardoAlba,项目名称:Meneame,代码行数:21,代码来源:comment_ajax.php

示例14: haanga_f5ad40d56c2438ea6bb3882d3b5e5ebf18352938

function haanga_f5ad40d56c2438ea6bb3882d3b5e5ebf18352938($vars, $return = FALSE, $blocks = array())
{
    global $test_global, $global1;
    extract($vars);
    if ($return == TRUE) {
        ob_start();
    }
    $foo = 5 + 1;
    $vars['foo'] = $foo;
    echo '
';
    $bar = 'testing';
    $vars['bar'] = $bar;
    echo '
' . htmlspecialchars($foo) . '
' . Haanga::Load('assert_templates/sub_set.tpl', $vars, TRUE, $blocks) . '
';
    if ($return == TRUE) {
        return ob_get_clean();
    }
}
开发者ID:narock,项目名称:lodspeakr,代码行数:21,代码来源:set.tpl.php

示例15: haanga_93071c9c441d1680a63883802200fe559306006e

function haanga_93071c9c441d1680a63883802200fe559306006e($vars, $return = FALSE, $blocks = array())
{
    global $test_global, $global1;
    extract($vars);
    if ($return == TRUE) {
        ob_start();
    }
    $buffer1 = '
    inner2\'s new value
    ';
    $buffer2 = '
        2.1
    ';
    $blocks['inner2_1'] = isset($blocks['inner2_1']) ? strpos($blocks['inner2_1'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['inner2_1'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer2, $blocks['inner2_1']) : $buffer2;
    $buffer1 .= $blocks['inner2_1'] . '
';
    $blocks['inner2'] = isset($blocks['inner2']) ? strpos($blocks['inner2'], '{{block.1b3231655cebb7a1f783eddf27d254ca}}') === FALSE ? $blocks['inner2'] : str_replace('{{block.1b3231655cebb7a1f783eddf27d254ca}}', $buffer1, $blocks['inner2']) : $buffer1;
    echo Haanga::Load('assert_templates/nested_block.tpl', $vars, TRUE, $blocks);
    if ($return == TRUE) {
        return ob_get_clean();
    }
}
开发者ID:narock,项目名称:lodspeakr,代码行数:22,代码来源:nested_block_second_parent.tpl.php


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