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


PHP Template函数代码示例

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


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

示例1: Msg

 function Msg($msg)
 {
     $smarty = Template();
     $smarty->assign('msg', $msg);
     $smarty->display('msg.tpl');
     die;
 }
开发者ID:BackupTheBerlios,项目名称:phpwordtrain-svn,代码行数:7,代码来源:common.php

示例2: display

 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     ## Include functions for Bootstrap: (template choice)
     include_once 'components/com_ticketmaster/assets/functions.php';
     $filter_order = $mainframe->getUserStateFromRequest('filter_ordering', 'filter_ordering_t', 'a.ticketdate', 'cmd');
     ## Model is defined in the controller
     $model = $this->getModel();
     ## Getting the items into a variable
     $items = $this->get('list');
     $data = $this->get('data');
     $pagination = $this->get('pagination');
     $config = $this->get('config');
     $javascript = 'onchange="document.adminForm.submit();"';
     ## Filling the Array() for doors and make a select list for it.
     $ordering = array('a.price' => array('value' => 'a.ticketprice', 'text' => JText::_('COM_TICKETMASTER_ORDER_PRICE')), 'a.ticketdate' => array('value' => 'a.ticketdate', 'text' => JText::_('COM_TICKETMASTER_ORDER_DATE')), 'a.totaltickets' => array('value' => 'a.totaltickets', 'text' => JText::_('COM_TICKETMASTER_AVAILEBILLITY')));
     $lists['ordering'] = JHTML::_('select.genericList', $ordering, 'filter_ordering_t', ' class="inputbox" ' . $javascript, 'value', 'text', $filter_order);
     ## Showing default template or bootstrap?
     $tpl = Template($config->load_bootstrap);
     $uri = JFactory::getURI();
     $this->assignRef('items', $items);
     $this->assignRef('config', $config);
     $this->assignRef('lists', $lists);
     $this->assignRef('data', $data);
     $this->assignRef('pagination', $pagination);
     $this->assign('action', $uri->toString());
     $this->assign('ordering', $filter_order);
     parent::display($tpl);
 }
开发者ID:novalnetuser,项目名称:Jeremiah-s-Ranch,代码行数:29,代码来源:view.html.php

示例3: actionPage

function actionPage(&$request, $action)
{
    global $WikiTheme;
    $pagename = $request->getArg('pagename');
    $version = $request->getArg('version');
    $page = $request->getPage();
    $revision = $page->getCurrentRevision();
    $dbi = $request->getDbh();
    $actionpage = $dbi->getPage($action);
    $actionrev = $actionpage->getCurrentRevision();
    $pagetitle = HTML(fmt("%s: %s", $actionpage->getName(), $WikiTheme->linkExistingWikiWord($pagename, false, $version)));
    $validators = new HTTP_ValidatorSet(array('pageversion' => $revision->getVersion(), '%mtime' => $revision->get('mtime')));
    $request->appendValidators(array('pagerev' => $revision->getVersion(), '%mtime' => $revision->get('mtime')));
    $request->appendValidators(array('actionpagerev' => $actionrev->getVersion(), '%mtime' => $actionrev->get('mtime')));
    $transformedContent = $actionrev->getTransformedContent();
    $template = Template('browse', array('CONTENT' => $transformedContent));
    /*
        if (!headers_sent()) {
            //FIXME: does not work yet. document.write not supported (signout button)
            // http://www.w3.org/People/mimasa/test/xhtml/media-types/results
            if (ENABLE_XHTML_XML 
                and (!isBrowserIE() and
                     strstr($request->get('HTTP_ACCEPT'),'application/xhtml+xml')))
                header("Content-Type: application/xhtml+xml; charset=" . $GLOBALS['charset']);
            else
                header("Content-Type: text/html; charset=" . $GLOBALS['charset']);
        }
    */
    GeneratePage($template, $pagetitle, $revision);
    $request->checkValidators();
    flush();
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:32,代码来源:display.php

示例4: header

 function header()
 {
     global $HTML, $group_id, $group_public_name, $request, $project;
     $pagename = $request->getArg('pagename');
     $submenu = Template('navbar');
     //group is private
     if (!$project->isPublic()) {
         //if it's a private group, you must be a member of that group
         session_require_perm('project_read', $group_id);
     }
     //for dead projects must be member of admin project
     if (!$project->isActive()) {
         //only SF group can view non-active, non-holding groups
         session_require_global_perm('forge_admin');
     }
     $HTML->header(array('title' => $group_public_name . ': ' . htmlspecialchars($pagename), 'group' => $group_id, 'toptab' => 'wiki', 'submenu' => $submenu->asXML()));
     // Display a warning banner for internal users when the wiki is opened
     // to external users.
     if ($project->getIsExternal()) {
         $external_user = false;
         if (session_loggedin()) {
             $user = session_get_user();
             $external_user = $user->getIsExternal();
         }
         if (!$external_user) {
             $page = $request->getPage();
             if ($page->get('external')) {
                 $external_msg = _("This page is external.");
             }
             echo $HTML->warning_msg(_("This project is shared with third-party users (non Alcatel-Lucent users).") . (isset($external_msg) ? ' ' . $external_msg : ''));
         }
     }
 }
开发者ID:hugcoday,项目名称:wiki,代码行数:33,代码来源:themeinfo.php

示例5: flashPlayer

/**
 * Function used to display flash player for ClipBucket video
 */
function flashPlayer($param)
{
    global $Cbucket, $swfobj;
    $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer';
    $key = $param['key'];
    $flv = $param['flv'] . '.flv';
    $code = $param['code'];
    $flv_url = $file;
    $embed = $param['embed'];
    $code = $param['code'];
    $height = $param['height'] ? $param['height'] : config('player_height');
    $width = $param['width'] ? $param['width'] : config('player_width');
    $param['height'] = $height;
    $param['width'] = $width;
    $param['enlarge_button'] = config('enlarge_button');
    $param['player_logo_url'] = config('player_logo_url');
    //dump($code);
    if (!$param['autoplay']) {
        $param['autoplay'] = config('autoplay_video');
    }
    assign('player_params', $param);
    if (count($Cbucket->actions_play_video) > 0) {
        foreach ($Cbucket->actions_play_video as $funcs) {
            if (function_exists($funcs)) {
                $func_data = $funcs($param);
            }
            if ($func_data) {
                $player_code = $func_data;
                $show_player = true;
                break;
            }
        }
    }
    if (function_exists('cbplayer') && empty($player_code)) {
        $player_code = cbplayer($param, true);
    } elseif (function_exists('cbplayer')) {
        return $player_code;
    }
    global $pak_player;
    if ($player_code) {
        if (!$pak_player && $show_player && !is_bool($player_code)) {
            assign("player_js_code", $player_code);
            Template(PLAYER_DIR . '/player.html', false);
            return false;
        } else {
            return false;
        }
    }
    return blank_screen($param);
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:53,代码来源:functions_player.php

示例6: cb_player

 function cb_player($in)
 {
     global $cb_player;
     $cb_player = true;
     $vdetails = $in['vdetails'];
     $vid_file = get_video_file($vdetails, true, true);
     //Checking for YT Referal
     if (function_exists('get_refer_url_from_embed_code')) {
         $ref_details = get_refer_url_from_embed_code(unhtmlentities(stripslashes($vdetails['embed_code'])));
         $ytcode = $ref_details['ytcode'];
     }
     if ($vid_file || $ytcode) {
         $hd = $data['hq'];
         if ($hd == 'yes') {
             $file = get_hq_video_file($vdetails);
         } else {
             $file = get_video_file($vdetails, true, true);
         }
         $hd_file = get_hq_video_file($vdetails);
         if ($ytcode) {
             assign('youtube', true);
             assign('ytcode', $ytcode);
         }
         if (!strstr($in['width'], "%")) {
             $in['width'] = $in['width'] . 'px';
         }
         if (!strstr($in['height'], "%")) {
             $in['height'] = $in['height'] . 'px';
         }
         if ($in['autoplay'] == 'yes' || $in['autoplay'] === true || $_COOKIE['auto_play_playlist'] && ($_GET['play_list'] || $_GET['playlist'])) {
             $in['autoplay'] = true;
         } else {
             $in['autoplay'] = false;
         }
         //Logo Placement
         assign('logo_placement', cb_player_logo_position());
         assign('logo_margin', config('logo_padding'));
         //Setting Skin
         assign('cb_skin', 'glow/glow.xml');
         assign('player_data', $in);
         assign('player_logo', website_logo());
         assign('normal_vid_file', $vid_file);
         assign("hq_vid_file", $hd_file);
         assign('vdata', $vdetails);
         Template(CB_PLAYER_DIR . '/cbplayer.html', false);
         return true;
     }
 }
开发者ID:Coding110,项目名称:cbvideo,代码行数:48,代码来源:cbplayer.php

示例7: StartLoadDump

function StartLoadDump(&$request, $title, $html = '')
{
    // MockRequest is from the unit testsuite, a faked request. (may be cmd-line)
    // We are silent on unittests.
    if (isa($request, 'MockRequest')) {
        return;
    }
    // FIXME: This is a hack. This really is the worst overall hack in phpwiki.
    if ($html) {
        $html->pushContent('%BODY%');
    }
    $tmpl = Template('html', array('TITLE' => $title, 'HEADER' => $title, 'CONTENT' => $html ? $html : '%BODY%'));
    echo ereg_replace('%BODY%.*', '', $tmpl->getExpansion($html));
    $request->chunkOutput();
    // set marker for sendPageChangeNotification()
    $request->_deferredPageChangeNotification = array();
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:17,代码来源:loadsave.php

示例8: cb_video_player

/**
 * Loads ClipBucket players...
 * 
 * @global type $Cbucket
 * @global type $swfobj
 * @param type $param
 * @return boolean
 * 
 * @todo Write documentation on this function..
 */
function cb_video_player($param)
{
    global $Cbucket, $swfobj;
    $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer';
    $key = $param['key'];
    $code = $param['code'];
    $flv_url = $file;
    $embed = $param['embed'];
    $code = $param['code'];
    $height = $param['height'] ? $param['height'] : config('player_height');
    $width = $param['width'] ? $param['width'] : config('player_width');
    $param['height'] = $height;
    $param['width'] = $width;
    if (!$param['autoplay']) {
        $param['autoplay'] = config('autoplay_video');
    }
    if (!$param['files']) {
        global $cbvid;
        $files = $cbvid->get_video_files($param['video']);
        $param['files'] = $files;
    }
    assign('player_params', $param);
    $param = apply_filters($param, 'play_video');
    //Calling actions for play_video
    $output = call_actions('play_video', $param);
    if ($output) {
        $player_code = $output;
        return $output;
    }
    if (function_exists('cbplayer') && empty($player_code)) {
        $player_code = cbplayer($param, true);
    }
    if ($player_code) {
        if (!$pak_player && $show_player) {
            assign("player_js_code", $player_code);
            Template(PLAYER_DIR . '/player.html', false);
            return false;
        } else {
            return false;
        }
    }
    return blank_screen($param);
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:53,代码来源:functions_players.php

示例9: cb_video_js

 function cb_video_js($in)
 {
     global $cb_video_js;
     $cb_video_js = true;
     $vdetails = $in['vdetails'];
     $video_play = get_video_files($vdetails, true, true);
     if (!strstr($in['width'], "%")) {
         $in['width'] = $in['width'] . 'px';
     }
     if (!strstr($in['height'], "%")) {
         $in['height'] = $in['height'] . 'px';
     }
     assign('height', $in['height']);
     assign('width', $in['width']);
     assign('player_config', $in);
     assign('vdata', $vdetails);
     assign('cb_logo', cb_logo());
     assign('video_files', $video_play);
     Template(CB_VJS_PLAYER_DIR . '/cb_video_js.html', false);
     return true;
 }
开发者ID:reactvideos,项目名称:Website,代码行数:21,代码来源:cb_video_js.php

示例10: compile

 /**
  * Compiles code for the {extends} tag
  *
  * @param array $args     array with attributes from parser
  * @param object $compiler compiler object
  * @return string compiled code
  */
 public function compile($args, $compiler)
 {
     // check and get attributes
     $_attr = $this->getAttributes($compiler, $args);
     if (strpos($_attr['file'], '$_tmp') !== false) {
         $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno);
     }
     $_smarty_tpl = $compiler->template;
     $name = $_attr['file'];
     if ($name[0] === "'" && $name[strlen($name) - 1] === "'") {
         $name = '"' . substr($name, 1, -1) . '"';
     }
     $tpl_name = json_decode($name);
     // create template object
     $_template = Template($tpl_name, $compiler->smarty, $compiler->template);
     // check for recursion
     $uid = $_template->source->uid;
     if (isset($compiler->extends_uid[$uid])) {
         $compiler->trigger_template_error("illegal recursive call of \"{$name}\"", $this->lex->line - 1);
     }
     $compiler->extends_uid[$uid] = true;
     if (empty($_template->source->components)) {
         array_unshift($compiler->sources, $_template->source);
     } else {
         foreach ($_template->source->components as $source) {
             array_unshift($compiler->sources, $source);
             $uid = $source->uid;
             if (isset($compiler->extends_uid[$uid])) {
                 $compiler->trigger_template_error("illegal recursive call of \"{$source->filepath}\"", $this->lex->line - 1);
             }
             $compiler->extends_uid[$uid] = true;
         }
     }
     unset($_template);
     $compiler->inheritance_child = true;
     $compiler->lex->yypushstate(\Box\Brainy\Compiler\Lexer::CHILDBODY);
     return '';
 }
开发者ID:xiaobudongzhang,项目名称:brainy,代码行数:45,代码来源:smarty_internal_compile_extends.php

示例11: load_remote_upload_form

function load_remote_upload_form($params = NULL)
{
    global $file_name;
    assign('params', $params);
    Template(STYLES_DIR . '/global/remote_upload_form.html', false);
    return false;
    echo '<div class="alert alert-info marginTop">
			' . lang('upload_remote_video_msg') . '
			</div>';
    echo '<div class="upload_form_div clearfix form-group' . $class . '" id="remoteUploadFormDiv">
        <label for="remote_file_url" class="label">' . lang('please_enter_remote_file_url') . '</label>
        <input name="remote_file_url" type="textfield"  class="remoteUrlInput form-control" 
        id="remote_file_url" value="' . lang('remote_upload_example') . '"
        onclick="if($(this).val()==\'' . lang('remote_upload_example') . '\') $(this).val(\'\')"/>
        <input name="submit_upload" type="hidden" value="' . lang('upload_data_now') . '">
        
        <div id="remote_upload_result_cont"></div>
        <div class="remote_main_bar" id="main_bar">
            <div id="prog_bar" class="remote_prog_bar"></div>
        </div>
        <div align="center" id="loading" style="margin:5px 0px"></div>
        <div>
            ' . lang('remoteDownloadStatusDiv') . '
        </div>                
        <div align="right">
		
			<input type="button" name="ytUploadBttn" id="ytUploadBttn" 
			value="' . lang('grab_from_youtube') . '" onClick="youtube_upload()" class="cbSubmitUpload">
            <input type="button" name="remoteUploadBttn" id="remoteUploadBttn" value="' . lang('upload') . '" 
			onClick="_cb.' . get_remote_url_function() . '" class="cbSubmitUpload">
            <input type="button" name="remoteUploadBttnStop" id="remoteUploadBttnStop" value="' . lang('cancel') . '"   
			class="cbSubmitUpload" style="display:none"/>
        </div>
   	 	</div>
   	 	<div id="remoteForm"></div> ';
}
开发者ID:reactvideos,项目名称:Website,代码行数:36,代码来源:upload_forms.php

示例12: mysql_fetch_array

    $Record2 = mysql_fetch_array($DataSet2);
    $gcp_nb = $Record2["gcp_nb"];
    $nb_max_product = pow(10, 12 - $length);
    $perc_num = $nb_rc_0 / $nb_num * 100;
    $perc = number_format($perc_num, 2, '.', ' ');
    $nb = number_format($nb_num, 0, '.', ' ');
    $nb_rc_0 = number_format($nb_rc_0, 0, '.', ' ');
    $nb_max_product = number_format($nb_max_product, 0, '.', ' ');
    if ($gcp_nb == $nb_num) {
        // if all gcp have been checked, green background
        $style_nb = 'background-color:rgb(190, 247, 190);';
    } else {
        if ($length > 7) {
            $style_nb = 'background-color:rgb(213, 211, 211);';
        } else {
            $style_nb = '';
        }
    }
    if ($perc_num > 2) {
        $style_perc = '';
    } else {
        $style_perc = 'color:red;';
    }
    $Corps .= Template("template-stats-gcp-length", 2, $Params = array("VALUE_PREFIX" => $prefix, "VALUE_LENGTH" => $length, "VALUE_NB_NUM" => $nb_num, "VALUE_NB" => $nb, "VALUE_NB_RC_0" => $nb_rc_0, "VALUE_PREFIX_NM" => $prefix_nm, "VALUE_COUNTRY" => $country, "VALUE_GCP_NB" => $gcp_nb, "VALUE_NB_MAX_PRODUCT" => $nb_max_product, "VALUE_PERC_NUM" => $perc_num, "VALUE_PERC" => $perc, "VALUE_STYLE_NB" => $style_nb, "VALUE_STYLE_PERC" => $style_perc, "VALUE_IMG_COUNTRY" => DOSSIER_IMG_COUNTRY . strtolower($country)));
}
$Corps .= Template("template-stats-gcp-length", 3, $Params = array());
$FileName = $DataFolder . "stats-gcp-length.html";
$file = fopen($FileName, 'w');
fputs($file, $Corps);
fclose($file);
echo "File generated<hr/>";
开发者ID:nagyistoce,项目名称:product-browser-web,代码行数:31,代码来源:generator-stats-gcp-length.php

示例13: while

        $data['work'] = '<font color="#990000">Kein Style angelegt.</font>';
    } else {
        $data['work'] .= '<a href="style.php?action=publicStyle&styleid=all">Alle als &ouml;ffendlich makieren</a> |
          <a href="style.php?action=publicStyle&styleid=no">Alle als nicht &ouml;ffendlich makieren</a><br /><br />
          <table cellpadding="3" cellspacing="0" border="0">';
        while ($list = db_result($r_list)) {
            $data['work'] .= '<tr>
              <td>' . $list['stylename'] . '</td>
              <td>&nbsp;</td>
              <td><font color="#FF0000">' . ($list['styleisdefault'] == 1 ? '*' : '&nbsp;') . '</font></td>
              <td><font color="#0000FF">' . ($list['styleispublic'] == 1 ? '*' : '&nbsp;') . '</font></td>
              <td>&nbsp;</td>
              <td>
               <a href="style.php?action=editStyle&styleid=' . $list['styleid'] . '">Editieren</a> |
               <a href="style.php?action=deleStyle&styleid=' . $list['styleid'] . '">L&ouml;schen</a> |
               <a href="style.php?action=defaultStyle&styleid=' . $list['styleid'] . '">Als global makieren</a> |
               <a href="style.php?action=exStyle&styleid=' . $list['styleid'] . '">Exportieren</a>
              </td>
             </tr>';
        }
        $data['work'] .= '</table><br /><br />
          <font color="#FF0000">*</font> Globaler Style. Dieser Wird auf der Indexseite und in allen Foren genutzt, es sei denn
          f&uuml;r ein Forum<br />&nbsp;&nbsp; ist ein anderer Style makiert.<br /><br />
          <font color="#0000FF">*</font> &Ouml;ffendlicher Style. Diese Styles k&ouml;nnen vom User im Profil ausgew&auml;hlt werden.<br />
          &nbsp;&nbsp; Dann wird f&uuml;r ihn das gesammte Board mit diesem Style angezeigt.
         ';
    }
}
$data['javascript'] = '';
echo Template(Get_Template('templates/admin.html'));
tb_footer();
开发者ID:BackupTheBerlios,项目名称:thwc,代码行数:31,代码来源:style.php

示例14: handleAction

 function handleAction()
 {
     $action = $this->getArg('action');
     if ($this->isPost() and !$this->_user->isAdmin() and $action != 'browse') {
         $page = $this->getPage();
         if ($page->get('moderation')) {
             require_once "lib/WikiPlugin.php";
             $loader = new WikiPluginLoader();
             $plugin = $loader->getPlugin("ModeratedPage");
             if ($plugin->handler($this, $page)) {
                 $CONTENT = HTML::div(array('class' => 'wiki-edithelp'), fmt("%s: action forwarded to a moderator.", $action), HTML::br(), _("This action requires moderator approval. Please be patient."));
                 if (!empty($plugin->_tokens['CONTENT'])) {
                     $plugin->_tokens['CONTENT']->pushContent(HTML::br(), _("You must wait for moderator approval."));
                 } else {
                     $plugin->_tokens['CONTENT'] = $CONTENT;
                 }
                 require_once "lib/Template.php";
                 $title = WikiLink($page->getName());
                 $title->pushContent(' : ', WikiLink(_("ModeratedPage")));
                 GeneratePage(Template('browse', $plugin->_tokens), $title, $page->getCurrentRevision());
                 $this->finish();
             }
         }
     }
     $method = "action_{$action}";
     if (method_exists($this, $method)) {
         $this->{$method}();
     } elseif ($page = $this->findActionPage($action)) {
         $this->actionpage($page);
     } else {
         $this->finish(fmt("%s: Bad action", $action));
     }
 }
开发者ID:neymanna,项目名称:fusionforge,代码行数:33,代码来源:main.php

示例15: display_user_custom_background

/**
 * This function includes the file containing user custom background
 * if uploaded. This code should run after opening html <body> tag.
 * This will spread the background cross the window.
 * 
 * @global OBJECT $userquery
 * @param MIX $uid
 * @return custom_background.html Template
 */
function display_user_custom_background($uid = null)
{
    global $userquery;
    if (is_null($uid)) {
        return false;
    }
    if (is_numeric($uid)) {
        $user = $userquery->get_user_details($uid);
    } else {
        $user = $uid;
    }
    if (empty($user)) {
        return false;
    }
    assign('u', $user);
    Template(STYLES_DIR . '/global/blocks/view_channel/custom_background.html', false);
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:26,代码来源:functions_users.php


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