本文整理汇总了PHP中assign_to_template函数的典型用法代码示例。如果您正苦于以下问题:PHP assign_to_template函数的具体用法?PHP assign_to_template怎么用?PHP assign_to_template使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assign_to_template函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showlogin
/**
* Display a login view
*/
function showlogin()
{
global $db, $user, $order;
$oicount = $order ? $order->item_count : 0;
// FIGURE OUT IF WE"RE IN PREVIEW MODE OR NOT
$level = 99;
if (expSession::is_set('uilevel')) {
$level = expSession::get('uilevel');
}
$previewtext = $level == UILEVEL_PREVIEW ? gt('Turn Preview Mode off') : gt('Turn Preview Mode on');
$previewclass = $level == UILEVEL_PREVIEW ? 'preview_on' : 'preview_off';
//eDebug($order);
if (expSession::loggedIn() && $user->username != "anonymous") {
$loggedin = 1;
// Generate display name as username if the first and last name fields are blank.
$display_name = $user->firstname . ' ' . $user->lastname;
if (trim($display_name) == '') {
$display_name = $user->username;
}
// Need to check for groups and whatnot
if ($db->countObjects('groupmembership', 'member_id=' . $user->id . ' AND is_admin=1')) {
$is_group_admin = 1;
} else {
$is_group_admin = 0;
}
assign_to_template(array('oicount' => $oicount, 'previewtext' => $previewtext, 'previewclass' => $previewclass, 'loggedin' => $loggedin, 'user' => $user, 'displayname' => $display_name, 'is_group_admin' => $is_group_admin));
} else {
//$template->assign('isecom',in_array('storeController',listActiveControllers()));
$loggedin = 0;
assign_to_template(array('oicount' => $oicount, 'previewtext' => $previewtext, 'previewclass' => $previewclass, 'loggedin' => $loggedin, 'user' => $user));
}
}
示例2: edit_message
public function edit_message()
{
$id = isset($this->params['id']) ? $this->params['id'] : null;
$msg = new order_status_messages($id);
assign_to_template(array('record' => $msg));
//$msg->update($this->params);
}
示例3: showall
function showall()
{
expHistory::set('viewable', $this->params);
$causes = $this->donation->find('all');
//eDebug($causes);
assign_to_template(array('causes' => $causes));
}
示例4: edit_vendor
function edit_vendor()
{
$vendor = new vendor();
if (isset($this->params['id'])) {
$vendor = $vendor->find('first', 'id =' . $this->params['id']);
assign_to_template(array('vendor' => $vendor));
}
}
示例5: show
public function show()
{
$where = "location_data='" . serialize($this->loc) . "'";
$db_headline = $this->headline->find('first', $where);
$this->metainfo = expTheme::pageMetaInfo();
$title = !empty($db_headline) ? $db_headline->title : $this->metainfo['title'];
assign_to_template(array('headline' => $title, 'record' => $db_headline));
}
示例6: showall
function showall()
{
expHistory::set('viewable', $this->params);
$modelname = $this->basemodel_name;
$where = $this->aggregateWhereClause();
$limit = isset($this->params['limit']) ? $this->params['limit'] : null;
$order = "rank";
$page = new expPaginator(array('model' => $modelname, 'where' => $where, 'limit' => $limit, 'order' => $order, 'controller' => $this->baseclassname, 'action' => $this->params['action'], 'columns' => array('ID#' => 'id', 'Title' => 'title', 'Body' => 'body')));
assign_to_template(array('page' => $page, 'items' => $page->records));
}
示例7: showall
function showall()
{
expHistory::set('viewable', $this->params);
$modelname = $this->basemodel_name;
$where = $this->hasSources() ? $this->aggregateWhereClause() : null;
$limit = isset($this->config['limit']) ? $this->config['limit'] : null;
$order = isset($this->config['order']) ? $this->config['order'] : "rank";
$links = $this->{$modelname}->find('all', $where, $order, $limit);
assign_to_template(array('items' => $links, 'rank' => $order === 'rank' ? 1 : 0));
}
示例8: showall_highlight
public function showall_highlight()
{
expHistory::set('viewable', $this->params);
$where = $this->aggregateWhereClause();
$order = 'rank ASC';
// $items = $this->text->find('all', $where, $order);
$items = $this->snippet->find('all', $where, $order);
foreach ($items as $item) {
$item->body = highlight_string($item->body, true);
}
assign_to_template(array('items' => $items));
}
示例9: page_not_found
public function page_not_found()
{
global $router;
$params = $router->params;
unset($params['controller']);
unset($params['action']);
$terms = empty($params[0]) ? '' : $params[0];
expCSS::pushToHead(array("unique" => "search-results", "link" => $this->asset_path . "css/results.css"));
$search = new search();
$page = new expPaginator(array('model' => 'search', 'controller' => $this->params['controller'], 'action' => $this->params['action'], 'records' => $search->getSearchResults(implode(' ', $params)), 'order' => 'score', 'dir' => 'DESC'));
assign_to_template(array('page' => $page, 'terms' => $terms));
}
示例10: editor
function editor()
{
global $user;
$file = new expFile($this->params['id']);
$canSaveOg = $user->id == $file->poster || $user->is_admin ? 1 : 0;
if (file_exists(BASE . $file->directory . $file->filename)) {
$file->copyToDirectory(BASE . $this->cacheDir);
assign_to_template(array('image' => $file, 'update' => $_GET['update'], 'saveog' => $canSaveOg));
} else {
flash('error', gt('The file') . ' "' . BASE . $file->directory . $file->filename . '" ' . gt('does not exist on the server.'));
redirect_to(array("controller" => 'file', "action" => 'picker', "ajax_action" => 1, "update" => $this->params['update'], "fck" => $this->params['fck']));
}
}
示例11: show
public function show()
{
global $db, $template;
$orig_template = $template;
//instantiate an expRecord for the module in question
//$mod = new $this->params['recymod']();
define('SOURCE_SELECTOR', 1);
define('PREVIEW_READONLY', 1);
// for mods
//initialize a new recycle bin and grab the previously trashed items
$bin = new recyclebin();
$orphans = $bin->moduleOrphans($this->params['recymod']);
$template = $orig_template;
assign_to_template(array('items' => $orphans, 'module' => $this->params['recymod']));
}
示例12: view_registrants
function view_registrants()
{
expHistory::set('viewable', $this->params);
$event = new eventregistration($this->params['id']);
//eDebug($event);
//eDebug("a:" . isset($event->registrants));
//eDebug("b:" . is_array($event->registrants));
if (isset($event->registrants)) {
$registrants = expUnserialize($event->registrants);
} else {
$registrants = null;
}
//eDebug($registrants);
assign_to_template(array('event' => $event, 'registrants' => $registrants));
}
示例13: showall
function showall()
{
$yt = new $this->basemodel_name();
$vids = $yt->find('all', $this->aggregateWhereClause());
if (!empty($this->config['width']) && !empty($this->config['height'])) {
foreach ($vids as $key => $val) {
$val->embed_code = preg_replace("/height=\"\\d+\"/", 'height=' . $this->config['height'], $val->embed_code);
$val->embed_code = preg_replace("/width=\"\\d+\"/", 'width=' . $this->config['width'], $val->embed_code);
}
}
// force fix for menus appearing BEHIND the video in IE
foreach ($vids as $key => $val) {
$val->embed_code = preg_replace("/\" frameborder=\"/", '?wmode=opaque" frameborder="', $val->embed_code);
}
assign_to_template(array('items' => $vids));
}
示例14: manage
/**
* manage tags
*/
function manage()
{
global $db;
expHistory::set('manageable', $this->params);
$modelname = $this->basemodel_name;
$where = $this->hasSources() ? $this->aggregateWhereClause() : null;
$order = "title";
$page = new expPaginator(array('model' => $modelname, 'where' => $where, 'limit' => 50, 'order' => $order, 'controller' => $this->baseclassname, 'action' => $this->params['action'], 'src' => $this->hasSources() == true ? $this->loc->src : null, 'columns' => array('ID#' => 'id', 'Title' => 'title', 'Body' => 'body')));
foreach ($db->selectColumn('content_expTags', 'content_type', null, null, true) as $contenttype) {
foreach ($page->records as $key => $value) {
$attatchedat = $page->records[$key]->findWhereAttachedTo($contenttype);
if (!empty($attatchedat)) {
$page->records[$key]->attachedcount = @$page->records[$key]->attachedcount + count($attatchedat);
$page->records[$key]->attached[$contenttype] = $attatchedat;
}
}
}
assign_to_template(array('page' => $page));
}
示例15: configureTheme
function configureTheme()
{
//THEME COLORS
$theme_colors = array("orange" => 'Orange', "blue" => 'Blue', "red" => 'Red', "green" => 'Green', "purple" => 'Purple', "black" => 'Black', "yellow" => 'Yellow', "pink" => 'Pink', "grey" => 'Grey', "magenta" => 'Magenta');
//THEME WIDTHS
$button_sizes = array("small" => 'Small', "medium" => 'Medium', "large" => 'Large');
//THEME WIDTHS
$theme_widths = array("" => '980px', "w1200px" => '1200px', "w760px" => '760px', "w600px" => '600px');
//THEME FONTS
$theme_fonts = array("" => 'Tahoma', "georgia" => 'Georga', "times" => 'Times', "helvetica" => 'Helvetica', "verdana" => 'Verdana', "arial" => 'Arial', "courier" => 'Courier');
$settings = expSettings::parseFile(BASE . "themes/" . $_GET['theme'] . "/config.php");
$form = new form();
$form->meta('controller', 'administration');
$form->meta('action', 'update_theme');
$form->meta('theme', $_GET['theme']);
$form->register('multi_size', gt('Theme Width') . ': ', new dropdowncontrol($settings['MULTI_SIZE'], $theme_widths));
$form->register('multi_font', gt('Theme Font') . ': ', new dropdowncontrol($settings['MULTI_FONT'], $theme_fonts));
$form->register('multi_color', gt('Theme Color') . ': ', new dropdowncontrol($settings['MULTI_COLOR'], $theme_colors));
$form->register('btn_color', gt('Button Color') . ': ', new dropdowncontrol($settings['BTN_COLOR'], $theme_colors));
$form->register('btn_size', gt('Button Size') . ': ', new dropdowncontrol($settings['BTN_SIZE'], $button_sizes));
$form->register(null, '', new htmlcontrol('<br>'));
$form->register('submit', '', new buttongroupcontrol(gt('Save'), '', gt('Cancel')));
assign_to_template(array('name' => self::name(), 'form_html' => $form->tohtml()));
}