本文整理汇总了PHP中tlocal类的典型用法代码示例。如果您正苦于以下问题:PHP tlocal类的具体用法?PHP tlocal怎么用?PHP tlocal使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了tlocal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gettable
public function gettable($posts, $where)
{
$perpage = 20;
if ($this->isauthor) {
$where .= ' and author = ' . litepublisher::$options->user;
}
$count = $posts->db->getcount($where);
$from = $this->getfrom($perpage, $count);
$items = $posts->select($where, " order by posted desc limit {$from}, {$perpage}");
if (!$items) {
$items = array();
}
$html = $this->html;
$lang = tlocal::admin();
$form = new adminform(new targs());
$form->items = $html->getitemscount($from, $from + count($items), $count);
$form->items .= $html->tableposts($items, array(array('center', $lang->date, '$post.date'), array('left', $lang->posttitle, '$post.bookmark'), array('left', $lang->category, '$post.category'), array('left', $lang->status, '$poststatus.status'), array('center', $lang->edit, '<a href="' . tadminhtml::getadminlink('/admin/posts/editor/', 'id') . '=$post.id">' . $lang->edit . '</a>'), array('center', $lang->delete, "<a class=\"confirm-delete-link\" href=\"{$this->adminurl}=\$post.id&action=delete\">{$lang->delete}</a>")));
$form->items .= $html->div('[button=publish]
[button=setdraft]
[button=delete]');
$form->submit = false;
$result = $form->get();
$result = $html->fixquote($result);
$theme = ttheme::i();
$result .= $theme->getpages('/admin/posts/', litepublisher::$urlmap->page, ceil($count / $perpage));
return $result;
}
示例2: tpolltypesInstall
/**
* 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 tpolltypesInstall($self)
{
$lang = tlocal::admin('polls');
$theme = ttheme::i();
$res = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'resource' . DIRECTORY_SEPARATOR;
$self->data['closed'] = $theme->replacelang(file_get_contents($res . 'microformat.tml'), $lang);
$self->data['itemclosed'] = '';
$ini = parse_ini_file($res . 'types.ini', true);
foreach ($ini as $type => $item) {
foreach ($item as $k => $v) {
$item[$k] = str_replace("'", '"', $v);
}
$item['type'] = $type;
$item['item'] = $theme->replacelang($item['item'], $lang);
$item['opened'] = $theme->replacelang($item['opened'], $lang);
if (isset($item['closed'])) {
$item['closed'] = $theme->replacelang($item['closed'], $lang);
}
if (isset($item['itemclosed'])) {
$item['itemclosed'] = $theme->replacelang($item['itemclosed'], $lang);
}
$self->add($item);
}
$self->save();
}
示例3: createtable
public function createtable()
{
$lang = tlocal::admin('comments');
$table = new ttablecolumns();
$table->index = 1;
$table->checkboxes[] = $this->html->tablecolumns();
$table->add('$id', 'ID', 'right', $this->showcolumn($table->index + 1, true));
$table->add('$comment.date', $lang->date, 'left', $this->showcolumn($table->index + 1, false));
$table->add('$comment.localstatus', $lang->status, 'left', $this->showcolumn($table->index + 1, false));
$table->add('<a href="$site.url/admin/users/{$site.q}id=$comment.author&action=edit">$comment.name</a>', $lang->author, 'left', $this->showcolumn($table->index + 1, true));
$table->add('$email', 'E-Mail', 'left', $this->showcolumn($table->index + 1, true));
$table->add('$website', $lang->website, 'left', $this->showcolumn($table->index + 1, false));
$table->checkboxes[] = "<br />{$lang->content}: ";
$table->add('<a href="$comment.url">$comment.posttitle</a>', $lang->post, 'left', $this->showcolumn($table->index + 1, false));
$table->add('$excerpt', $lang->content, 'left', $this->showcolumn($table->index + 1, true));
$table->add('$comment.ip', 'IP', 'left', $this->showcolumn($table->index + 1, false));
$table->checkboxes[] = "<br />{$lang->moderate}: ";
$table->add('<a href="$adminurl=$comment.id&action=reply">$lang.reply</a>', $lang->reply, 'left', $this->showcolumn($table->index + 1, false));
$table->add('<a href="$adminurl=$comment.id&action=approve">$lang.approve</a>', $lang->approve, 'left', $this->showcolumn($table->index + 1, false));
$table->add('<a href="$adminurl=$comment.id&action=hold">$lang.hold</a>', $lang->hold, 'left', $this->showcolumn($table->index + 1, false));
$table->add('<a class="confirm-delete-link" href="$adminurl=$comment.id&action=delete">$lang.delete</a>', $lang->delete, 'left', $this->showcolumn($table->index + 1, false));
$table->add('<a href="$adminurl=$comment.id&action=edit">$lang.edit</a>', $lang->edit, 'left', $this->showcolumn($table->index + 1, false));
$table->body = '<tr>
<td align ="center"><input type="checkbox" name="checkbox-item-$id" id="checkbox-item-$id" value="$id" $onhold /></td>' . $table->body . '</tr>';
$table->checkboxes[] = '</p>-->';
return $table;
}
示例4: getcontent
public function getcontent()
{
$html = tadminhtml::i();
$lang = tlocal::admin('polls');
$args = new targs();
//note to open admin menus
$result = $html->h3->noteoptions;
$polls = tpolls::i();
$man = tpollsman::i();
$args->addtopost = $man->addtopost;
$items = array();
$polls->loadall_tml();
foreach ($polls->tml_items as $id => $tml) {
$items[$id] = $tml['name'];
}
$args->pollpost = tadminhtml::array2combo($items, $man->pollpost);
$args->lifetime = $man->lifetime;
$args->formtitle = $lang->Options;
$result .= $html->adminform('
[checkbox=addtopost]
[combo=pollpost]
[text=lifetime]
', $args);
return $result;
}
示例5: 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);
}
示例6: processform
public function processform()
{
if (!isset($_POST['contactvalue'])) {
return '';
}
$time = substr($_POST['contactvalue'], strlen('_contactform'));
if (time() > $time) {
return $this->errmesg;
}
$email = trim($_POST['email']);
if (!tcontentfilter::ValidateEmail($email)) {
return sprintf('<p><strong>%s</strong></p>', tlocal::get('comment', 'invalidemail'));
}
$url = trim($_POST['site']);
if (empty($url) || strbegin($url, litepublisher::$site->url)) {
return $this->errmesg;
}
if ($s = http::get($url)) {
if (!strpos($s, '<meta name="generator" content="Lite Publisher')) {
return $this->errmesg;
}
} else {
return $this->errmesg;
}
$content = trim($_POST['content']);
if (strlen($content) <= 15) {
return sprintf('<p><strong>%s</strong></p>', tlocal::get('comment', 'emptycontent'));
}
$content = "{$url}\n" . $_POST['sitetitle'] . "\n\n" . $content;
tmailer::sendmail('', $email, '', litepublisher::$options->email, $this->subject, $content);
return $this->success;
}
示例7: tlocalmergerInstall
/**
* 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 tlocalmergerInstall($self)
{
$dir = litepublisher::$paths->data . 'languages';
if (!is_dir($dir)) {
@mkdir($dir, 0777);
}
@chmod($dir, 0777);
$lang = litepublisher::$options->language;
$self->lock();
$self->add('default', "lib/languages/{$lang}/default.ini");
$self->add('admin', "lib/languages/{$lang}/admin.ini");
$self->add('mail', "lib/languages/{$lang}/mail.ini");
if (litepublisher::$options->language != 'en') {
$self->add('translit', "lib/languages/{$lang}/translit.ini");
} else {
$self->items['translit'] = array('files' => array(), 'texts' => array());
}
$self->add('install', "lib/languages/{$lang}/install.ini");
$self->addhtml('lib/languages/adminhtml.ini');
$self->addhtml('lib/languages/posteditor.ini');
$self->unlock();
//after install
litepublisher::$options->timezone = tlocal::get('installation', 'timezone');
date_default_timezone_set(tlocal::get('installation', 'timezone'));
$html = tadminhtml::i();
$html->loadinstall();
}
示例8: 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));
}
示例9: 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;
}
示例10: processform
public function processform()
{
if (!isset($_POST['contactvalue'])) {
return '';
}
$time = substr($_POST['contactvalue'], strlen('_contactform'));
if (time() > $time) {
return $this->errmesg;
}
$email = trim($_POST['email']);
if (!tcontentfilter::ValidateEmail($email)) {
return sprintf('<p><strong>%s</strong></p>', tlocal::get('comment', 'invalidemail'));
}
$content = trim($_POST['content']);
if (strlen($content) <= 10) {
return sprintf('<p><strong>%s</strong></p>', tlocal::get('comment', 'emptycontent'));
}
if (false !== strpos($content, '<a href')) {
return $this->errmesg;
}
foreach ($this->data['extra'] as $name => $title) {
if (isset($_POST[$name])) {
$content .= sprintf("\n\n%s:\n%s", $title, trim($_POST[$name]));
}
}
tmailer::sendmail('', $email, '', litepublisher::$options->email, $this->subject, $content);
return $this->success;
}
示例11: 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);
}
示例12: getcontent
public function getcontent()
{
$result = '';
$types = tpolltypes::i();
$html = tadminhtml::i();
$lang = tlocal::admin('polls');
$args = new targs();
$type = isset($_GET['type']) ? $_GET['type'] : '';
if (isset($types->items[$type])) {
$args->type = $type;
$tabs = new tuitabs();
foreach ($types->items[$type] as $name => $value) {
$args->{$name} = $value;
$tabs->add($lang->{$name}, "[editor={$name}]");
}
$args->formtitle = $lang->edittype;
$result .= $html->adminform($tabs->get(), $args);
}
$result .= $html->h4->alltypes;
$result .= '<ul>';
$adminurl = $html->getadminlink($this->url, 'type=');
foreach ($types->items as $type => $item) {
$result .= sprintf('<li><a href="%s%2$s" title="%2$s">%2$s</a></li>', $adminurl, $type);
}
$result .= '</ul>';
return $result;
}
示例13: createpoll
public function createpoll()
{
$lang = tlocal::admin('downloaditems');
$items = explode(',', $lang->pollitems);
$polls = tpolls::i();
return $polls->add('', 'opened', 'button', $items);
}
示例14: getcontent
public function getcontent()
{
$widget = tsubcatwidget::i();
$about = tplugins::getabout(tplugins::getname(__FILE__));
$html = $this->html;
$args = targs::i();
$id = (int) tadminhtml::getparam('idwidget', 0);
if (isset($widget->items[$id])) {
$args->add($widget->items[$id]);
$args->sort = tadminhtml::array2combo(tlocal::admin()->ini['sortnametags'], $widget->items[$id]['sortname']);
$args->idwidget = $id;
$args->data['$lang.invertorder'] = $about['invertorder'];
$args->formtitle = $widget->gettitle($id);
return $html->adminform('
[combo=sort]
[checkbox=showsubitems]
[checkbox=showcount]
[text=maxcount]
[hidden=idwidget]', $args);
}
$tags = array();
foreach ($widget->items as $id => $item) {
$tags[] = $item['idtag'];
}
$args->formtitle = $about['formtitle'];
return $html->adminform(tposteditor::getcategories($tags), $args);
}
示例15: gethtml
public function gethtml()
{
$result = tadminhtml::i();
$result->section = $this->section;
$lang = tlocal::admin($this->section);
return $result;
}