本文整理汇总了PHP中tlocal::i方法的典型用法代码示例。如果您正苦于以下问题:PHP tlocal::i方法的具体用法?PHP tlocal::i怎么用?PHP tlocal::i使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlocal
的用法示例。
在下文中一共展示了tlocal::i方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getcont
public function getcont()
{
$result = '';
$theme = ttheme::i();
if (litepublisher::$urlmap->page == 1 && $this->content != '') {
$result .= $theme->simple($theme->parse($this->rawcontent));
}
$perpage = litepublisher::$options->perpage;
$downloaditems = tdownloaditems::i();
$d = litepublisher::$db->prefix . $downloaditems->childtable;
$p = litepublisher::$db->posts;
$where = $this->type == '' ? '' : " and {$d}.type = '{$this->type}'";
$count = $downloaditems->getchildscount($where);
$from = (litepublisher::$urlmap->page - 1) * $perpage;
if ($from <= $count) {
$items = $downloaditems->select("{$p}.status = 'published' {$where}", " order by {$p}.posted desc limit {$from}, {$perpage}");
ttheme::$vars['lang'] = tlocal::i('downloaditem');
$tml = $theme->templates['custom']['downloadexcerpt'];
if (count($items) > 0) {
$result .= $theme->templates['custom']['siteform'];
foreach ($items as $id) {
ttheme::$vars['post'] = tdownloaditem::i($id);
$result .= $theme->parse($tml);
}
}
}
$result .= $theme->getpages($this->url, litepublisher::$urlmap->page, ceil($count / $perpage));
return $result;
}
示例2: processform
public function processform()
{
/*
echo "<pre>\n";
var_dump($_POST);
echo "</pre>\n";
return;
*/
extract($_POST, EXTR_SKIP);
$this->basename = 'downloaditems';
$html = $this->html;
$lang = tlocal::i('editor');
if (empty($_POST['title'])) {
return $html->h2->emptytitle;
}
$downloaditem = tdownloaditem::i((int) $id);
$this->set_post($downloaditem);
$downloaditem->version = $version;
$downloaditem->type = $type;
$downloaditem->downloadurl = $downloadurl;
$downloaditem->authorname = $authorname;
$downloaditem->authorurl = $authorurl;
$downloaditems = tdownloaditems::i();
if ($downloaditem->id == 0) {
$id = $downloaditems->add($downloaditem);
$_GET['id'] = $id;
$_POST['id'] = $id;
} else {
$downloaditems->edit($downloaditem);
}
$lang = tlocal::i('downloaditems');
return $html->h2->successedit;
}
示例3: get_themegen_content
/**
* Lite Publisher
* Copyright (C) 2010 - 2013 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/
* Dual licensed under the MIT (mit.txt)
* and GPL (gpl.txt) licenses.
**/
function get_themegen_content($self)
{
$result = '';
tlocal::usefile('themegenerator');
$lang = tlocal::i('themegenerator');
$self->colors = $lang->ini['themecolors'];
$tml = '<p>
<input type="button" name="colorbutton-$name" id="colorbutton-$name" rel="$name" value="' . $lang->selectcolor . '" />
<input type="hidden" name="color_$name" id="text-color-$name" value="$value" />
<strong>$label</strong></p>';
$theme = tview::i($self->idview)->theme;
$args = new targs();
$a = new targs();
foreach ($self->colors as $name => $value) {
$args->name = $name;
$args->value = $value;
$args->label = $lang->{$name};
$a->{$name} = $theme->parsearg($tml, $args);
}
$a->headerurl = $self->colors['headerurl'];
$a->logourl = $self->colors['logourl'];
$form = file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'res' . DIRECTORY_SEPARATOR . 'form.tml');
$result .= $theme->parsearg($form, $a);
return sprintf('[html]%s[/html]', $result);
}
示例4: getcontent
public function getcontent()
{
$merger = tlocalmerger::i();
$tabs = new tuitabs();
$html = $this->html;
$lang = tlocal::i('options');
$args = targs::i();
foreach ($merger->items as $section => $items) {
$tab = new tuitabs();
$tab->add($lang->files, $html->getinput('editor', $section . '_files', tadminhtml::specchars(implode("\n", $items['files'])), $lang->files));
$tabtext = new tuitabs();
foreach ($items['texts'] as $key => $text) {
$tabtext->add($key, $html->getinput('editor', $section . '_text_' . $key, tadminhtml::specchars($text), $key));
}
$tab->add($lang->text, $tabtext->get());
$tabs->add($section, $tab->get());
}
$tabs->add('HTML', $html->getinput('editor', 'adminhtml_files', tadminhtml::specchars(implode("\n", $merger->html)), $lang->files));
$args->formtitle = $lang->optionslocal;
$args->dateformat = litepublisher::$options->dateformat;
$dirs = tfiler::getdir(litepublisher::$paths->languages);
$args->language = tadminhtml::array2combo(array_combine($dirs, $dirs), litepublisher::$options->language);
$zones = timezone_identifiers_list();
$args->timezone = tadminhtml::array2combo(array_combine($zones, $zones), litepublisher::$options->timezone);
return $html->adminform('[text=dateformat]
[combo=language]
[combo=timezone]' . $tabs->get(), $args);
}
示例5: tpasswordpageInstall
/**
* Lite Publisher
* Copyright (C) 2010 - 2015 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/
* Dual licensed under the MIT (mit.txt)
* and GPL (gpl.txt) licenses.
**/
function tpasswordpageInstall($self)
{
litepublisher::$urlmap->delete('/check-password.php');
tlocal::usefile('install');
$lang = tlocal::i('passwordpage');
$form = '<h3>$lang.formtitle</h3>
<form name="form" action="" method="post" >
<p><input type="password" name="password" id="password-password" value="" size="22" />
<label for="password-password"><strong>$lang.password</strong></label></p>
<p><input type="checkbox" name="remember" id="checkbox-remember" $remember />
<label for="checkbox-remember"><strong>$lang.remember</strong></label></p>
<p>
<input type="hidden" name="antispam" id="hidden-antispam" value="$antispam" />
<input type="submit" name="submitbutton" id="submitbutton" value="$lang.send" />
</p>
</form>';
$self->data['form'] = ttheme::i()->parse($form);
$self->data['title'] = $lang->reqpassword;
$self->data['invalidpassword'] = $lang->invalidpassword;
$self->save();
trobotstxt::i()->AddDisallow('/check-password.php');
litepublisher::$urlmap->addget('/check-password.php', get_class($self));
}
示例6: getdownloadcontent
public function getdownloadcontent()
{
ttheme::$vars['lang'] = tlocal::i('downloaditem');
ttheme::$vars['post'] = $this;
$theme = $this->theme;
return $theme->parse($theme->templates['custom']['downloaditem']);
}
示例7: getcontent
public function getcontent()
{
$type = tadminhtml::getparam('type', 'tags') == 'tags' ? 'tags' : 'categories';
$tags = $type == 'tags' ? ttags::i() : tcategories::i();
if ($err = self::auth()) {
return $err;
}
$id = tadminhtml::idparam();
if ($id > 0 && !$tags->itemexists($id)) {
return self::error403();
}
$theme = tview::i(tviews::i()->defaults['admin'])->theme;
$html = tadminhtml::i();
$html->section = 'tags';
$lang = tlocal::i('tags');
if ($id == 0) {
$views = tviews::i();
$name = $type == 'tags' ? 'tag' : 'category';
$item = array('title' => '', 'idview' => isset($views->defaults[$name]) ? $views->defaults[$name] : 1, 'idperm' => 0, 'icon' => 0, 'includechilds' => $tags->includechilds, 'includeparents' => $tags->includeparents, 'invertorder' => false, 'lite' => $tags->lite, 'liteperpage' => 1000, 'url' => '', 'keywords' => '', 'description' => '', 'head' => '');
} else {
$item = $tags->getitem($id);
}
switch ($_GET['get']) {
case 'view':
if ($id > 0) {
foreach (array('includechilds', 'includeparents', 'invertorder', 'lite') as $prop) {
$item[$prop] = (int) $item[$prop] > 0;
}
}
$args = new targs();
$args->add($item);
$result = $html->parsearg('[checkbox=includechilds] [checkbox=includeparents] [checkbox=invertorder] [checkbox=lite] [text=liteperpage]', $args);
$result .= $this->getviewicon($item['idview'], $item['icon']);
$result .= tadminperms::getcombo($item['idperm']);
break;
case 'seo':
$args = targs::i();
if ($id == 0) {
$args->url = '';
$args->keywords = '';
$args->description = '';
$args->head = '';
} else {
$args->add($tags->contents->getitem($id));
$args->url = $tags->items[$id]['url'];
}
$result = $html->parsearg('[text=url] [text=description] [text=keywords] [editor=head]', $args);
break;
case 'text':
$result = $this->geteditor('raw', $id == 0 ? '' : $tags->contents->getcontent($id), true);
$result .= $this->gethead();
break;
default:
$result = var_export($_GET, true);
}
return turlmap::htmlheader(false) . $result;
}
示例8: editpingback
private function editpingback($id)
{
$pingbacks = tpingbacks::i();
$args = targs::i();
$args->add($pingbacks->getitem($id));
$args->formtitle = tlocal::i()->edit;
return $this->html->adminform('
[text=title]
[text=url]
', $args);
}
示例9: sendmail
private function sendmail()
{
$args = new targs();
$args->url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$args->ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
tlocal::usefile('mail');
$lang = tlocal::i('notfound');
$theme = ttheme::i();
$subject = $theme->parsearg($lang->subject, $args);
$body = $theme->parsearg($lang->body, $args);
tmailer::sendtoadmin($subject, $body, true);
}
示例10: notify
private function notify(tticket $ticket)
{
ttheme::$vars['ticket'] = $ticket;
$args = new targs();
$args->adminurl = litepublisher::$site->url . '/admin/tickets/editor/' . litepublisher::$site->q . 'id=' . $ticket->id;
tlocal::usefile('mail');
$lang = tlocal::i('mailticket');
$lang->addsearch('ticket');
$theme = ttheme::i();
$subject = $theme->parsearg($lang->subject, $args);
$body = $theme->parsearg($lang->body, $args);
tmailer::sendtoadmin($subject, $body);
}
示例11: tlinkswidgetInstall
/**
* Lite Publisher
* Copyright (C) 2010 - 2015 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/
* Dual licensed under the MIT (mit.txt)
* and GPL (gpl.txt) licenses.
**/
function tlinkswidgetInstall($self)
{
if (get_class($self) != 'tlinkswidget') {
return;
}
tlocal::usefile('admin');
$lang = tlocal::i('installation');
$self->add($lang->homeurl, $lang->homedescription, $lang->homename);
$urlmap = turlmap::i();
$urlmap->add($self->redirlink, get_class($self), null, 'get');
$robots = trobotstxt::i();
$robots->AddDisallow($self->redirlink);
$robots->save();
}
示例12: ttemplatecommentsInstall
/**
* Lite Publisher
* Copyright (C) 2010 - 2015 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/
* Dual licensed under the MIT (mit.txt)
* and GPL (gpl.txt) licenses.
**/
function ttemplatecommentsInstall($self)
{
tlocal::usefile('install');
$lang = tlocal::i('beforecommentsform');
$login = '<a class="log-in" href="$site.url/admin/login/{$site.q}backurl=">' . $lang->log_in . '</a>';
$self->data['logged'] = sprintf($lang->logged, '<?php echo litepublisher::$site->getuserlink(); ?>', ' <a class="logout" href="$site.url/admin/logout/{$site.q}backurl=">' . $lang->logout . '</a> ');
$self->data['adminpanel'] = sprintf($lang->adminpanel, '<a class="admin-panel" href="$site.url/admin/comments/">' . $lang->controlpanel . '</a>');
$self->data['reqlogin'] = sprintf($lang->reqlogin, $login);
$self->data['guest'] = sprintf($lang->guest, $login);
$self->data['regaccount'] = sprintf($lang->regaccount, '<a class="registration" href="$site.url/admin/reguser/{$site.q}backurl=">' . $lang->signup . '</a>');
$self->data['comuser'] = sprintf($lang->comuser, $login);
$self->data['loadhold'] = sprintf('<h4>%s</h4>', sprintf($lang->loadhold, '<a class="loadhold " href="$site.url/admin/comments/hold/">' . $lang->loadhold . '</a>'));
$self->save();
}
示例13: processform
public function processform()
{
// return dumpvar($_POST);
extract($_POST, EXTR_SKIP);
$posts = tposts::i();
$this->basename = 'posts';
$html = $this->html;
if ($id == 0) {
$forum = tforum::i();
if (!$forum->moderate || litepublisher::$options->ingroup('editor')) {
$status = 'published';
} else {
$status = 'draft';
// if too many drafts then reject
$hold = $posts->db->getcount('status = \'draft\' and author = ' . litepublisher::$options->user);
if ($hold >= 3) {
return $html->manydrafts;
}
}
if (empty($title)) {
$lang = tlocal::i('editor');
return $html->h4->emptytitle;
}
}
$post = tpost::i((int) $id);
$post->title = $title;
$post->categories = array((int) $category);
if ($post->author == 0) {
$post->author = litepublisher::$options->user;
}
if (isset($files)) {
$files = trim($files);
$post->files = $files == '' ? array() : explode(',', $files);
}
$post->content = tcontentfilter::remove_scripts($raw);
if ($id == 0) {
$post->status = $status;
$post->comstatus = $forum->comstatus;
$post->idview = $forum->idview;
$post->idperm = $forum->idperm;
$post->url = tlinkgenerator::i()->addurl($post, 'forum');
$id = $posts->add($post);
$_GET['id'] = $id;
$_POST['id'] = $id;
$this->idpost = $id;
} else {
$posts->edit($post);
}
return $html->h4->successedit;
}
示例14: tusergroupsInstall
/**
* Lite Publisher
* Copyright (C) 2010 - 2015 Vladimir Yushko http://litepublisher.ru/ http://litepublisher.com/
* Dual licensed under the MIT (mit.txt)
* and GPL (gpl.txt) licenses.
**/
function tusergroupsInstall($self)
{
tlocal::usefile('install');
$lang = tlocal::i('initgroups');
$self->lock();
$admin = $self->add('admin', $lang->admin, '/admin/');
$editor = $self->add('editor', $lang->editor, '/admin/posts/');
$author = $self->add('author', $lang->author, '/admin/posts/');
$moder = $self->add('moderator', $lang->moderator, '/admin/comments/');
$commentator = $self->add('commentator', $lang->commentator, '/admin/comments/');
$self->items[$author]['parents'] = array($editor);
$self->items[$commentator]['parents'] = array($moder, $author);
$self->unlock();
}
示例15: getwidget
public function getwidget($id, $sidebar)
{
$links = '';
$theme = ttheme::i();
$tml = $theme->getwidgetitem('widget', $sidebar);
tlocal::usefile('admin');
if (litepublisher::$urlmap->context instanceof tpost) {
$post = litepublisher::$urlmap->context;
$lang = tlocal::i('posts');
$title = $lang->adminpost;
$action = tadminhtml::getadminlink('/admin/posts/', "id={$post->id}&action");
$links = $this->getitem($tml, tadminhtml::getadminlink('/admin/posts/editor/', 'id=' . $post->id), $lang->edit);
$links .= $this->getitem($tml, "{$action}=delete", $lang->delete);
} else {
switch (get_class(litepublisher::$urlmap->context)) {
case 'tcategories':
case 'ttags':
$tags = litepublisher::$urlmap->context;
$name = $tags instanceof ttags ? 'tags' : 'categories';
$adminurl = litepublisher::$site->url . "/admin/posts/{$name}/";
$lang = tlocal::i('tags');
$title = $lang->{$name};
$links = $this->getitem($tml, $adminurl, $lang->add);
$adminurl .= litepublisher::$site->q . "id={$tags->id}";
$links .= $this->getitem($tml, $adminurl, $lang->edit);
$links .= $this->getitem($tml, "{$adminurl}&action=delete", $lang->delete);
$links .= $this->getitem($tml, "{$adminurl}&full=1", $lang->fulledit);
break;
case 'thomepage':
$lang = tlocal::i('options');
$title = $lang->home;
$links .= $this->getitem($tml, "/admin/options/home/", $lang->title);
break;
}
if (litepublisher::$urlmap->context instanceof tmenu && !litepublisher::$urlmap->context instanceof tadminmenu) {
$menu = litepublisher::$urlmap->context;
$lang = tlocal::i('menu');
$title = $lang->title;
$adminurl = litepublisher::$site->url . "/admin/menu/edit/";
$links .= $this->getitem($tml, $adminurl, $lang->addmenu);
$links .= $this->getitem($tml, $adminurl . litepublisher::$site->q . "id={$menu->id}", $lang->edit);
}
}
if ($links == '') {
return '';
}
$links .= $this->getitem($tml, '/admin/logout/', tlocal::get('login', 'logout'));
$links = $theme->getwidgetcontent($links, 'widget', $sidebar);
return $theme->getwidget($this->gettitle($id), $links, 'widget', $sidebar);
}