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


PHP Haanga类代码示例

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


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

示例1: 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

示例2: do_banner_story

function do_banner_story()
{
    global $globals, $current_user;
    if ($globals['ads']) {
        Haanga::Safe_Load('private/ad-middle.html');
    }
}
开发者ID:brainsqueezer,项目名称:fffff,代码行数:7,代码来源:ads-credits-functions.php

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: haanga_2918f6e9aedbd5d32e8a5d091ed1985fcf7008e3

function haanga_2918f6e9aedbd5d32e8a5d091ed1985fcf7008e3($vars, $return = FALSE, $blocks = array())
{
    global $test_global, $global1;
    extract($vars);
    if ($return == TRUE) {
        ob_start();
    }
    echo Haanga::Safe_Load('foobar-tpl.tpl', $vars, TRUE, array()) . '
' . Haanga::Safe_Load('assert_templates/partial.tpl', $vars, TRUE, array()) . '
';
    if ($return == TRUE) {
        return ob_get_clean();
    }
}
开发者ID:narock,项目名称:lodspeakr,代码行数:14,代码来源:try_include.tpl.php

示例12: 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

示例13: 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

示例14: match

 public function match($uri)
 {
     global $conf;
     global $localUri;
     global $uri;
     global $acceptContentType;
     global $endpoints;
     global $lodspk;
     global $results;
     global $firstResults;
     require_once $conf['home'] . 'classes/MetaDb.php';
     $metaDb = new MetaDb($conf['metadata']['db']['location']);
     $pair = Queries::getMetadata($localUri, $acceptContentType, $metaDb);
     if ($pair == NULL) {
         // Original URI is not in metadata
         if (Queries::uriExist($uri, $endpoints['local'])) {
             $page = Queries::createPage($uri, $localUri, $acceptContentType, $metaDb);
             if ($page == NULL) {
                 HTTPStatus::send500("Can't write sqlite database.");
             }
             HTTPStatus::send303($page, $acceptContentType);
             exit(0);
         } else {
             return false;
         }
     }
     list($res, $page, $format) = $pair;
     $uri = $res;
     $queries = $this->getQueries();
     $e = $endpoints['local'];
     require_once $conf['home'] . 'lib/Haanga/lib/Haanga.php';
     Haanga::configure(array('cache_dir' => $conf['home'] . 'cache/', 'autoescape' => FALSE));
     $vars = compact('uri', 'lodspk', 'models', 'first');
     foreach ($queries as $l => $v) {
         $q = Utils::addPrefixes(file_get_contents($v));
         $fnc = Haanga::compile($q);
         $query = $fnc($vars, TRUE);
         $aux = $e->query($query, Utils::getResultsType($query));
         if ($aux["boolean"] === true) {
             $pair[] = $l;
             return $pair;
         }
     }
     return false;
 }
开发者ID:narock,项目名称:lodspeakr,代码行数:45,代码来源:sparqlFilterModule.php

示例15: generator

 public static function generator($cmp, $args, $redirected)
 {
     if (count($args) != 1) {
         $cmp->Error("inline needs one argument");
     }
     if ($redirected) {
         $cmp->Error("inline can't be redirected to one variable");
     }
     if (!Haanga_AST::is_str($args[0])) {
         $cmp->Error("The argument to inline must be an string");
     }
     $file = $args[0]['string'];
     if (class_exists('Haanga')) {
         $file = Haanga::getTemplatePath($file);
     }
     if (!is_file($file)) {
         $cmp->Error("{$file} is not a template");
     }
     return $cmp->getOpCodes(file_get_contents($file), $file);
 }
开发者ID:crodas,项目名称:haanga,代码行数:20,代码来源:Inline.php


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