本文整理汇总了PHP中tlocal::usefile方法的典型用法代码示例。如果您正苦于以下问题:PHP tlocal::usefile方法的具体用法?PHP tlocal::usefile怎么用?PHP tlocal::usefile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlocal
的用法示例。
在下文中一共展示了tlocal::usefile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getcontent
public function getcontent()
{
$result = '';
$files = tfiles::i();
$icons = ticons::i();
$html = $this->html;
$lang = tlocal::admin('files');
$args = targs::i();
$a = array();
//добавить 0 для отсутствия иконки
$a[0] = $lang->noicon;
$allicons = self::getallicons();
foreach ($allicons as $id) {
$args->id = $id;
$item = $files->getitem($id);
$args->add($item);
$a[$id] = $html->comboitem($args);
}
$list = '';
foreach ($icons->items as $name => $id) {
$args->name = $name;
$title = $lang->{$name};
if ($title == '') {
$title = tlocal::usefile('install')->{$name};
}
$args->title = $title;
$args->combo = $html->array2combo($a, $id);
$list .= $html->iconitem($args);
}
$args->formtitle = $lang->iconheader;
$result .= $html->adminform($list, $args);
return $html->fixquote($result);
}
示例2: 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);
}
示例3: 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));
}
示例4: request
public function request($arg)
{
$this->cache = false;
tlocal::usefile('admin');
$this->formresult = '';
if (tguard::post()) {
$this->formresult = $this->processform();
}
}
示例5: 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);
}
示例6: 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);
}
示例7: checkattack
public static function checkattack()
{
if (litepublisher::$options->xxxcheck && self::is_xxx()) {
tlocal::usefile('admin');
if ($_POST) {
die(tlocal::get('login', 'xxxattack'));
}
if ($_GET) {
die(tlocal::get('login', 'confirmxxxattack') . sprintf(' <a href="%1$s">%1$s</a>', $_SERVER['REQUEST_URI']));
}
}
return false;
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
示例11: request
public function request($id)
{
if ($s = tguard::checkattack()) {
return $s;
}
if (!litepublisher::$options->user) {
return litepublisher::$urlmap->redir('/admin/login/' . litepublisher::$site->q . 'backurl=' . urlencode(litepublisher::$urlmap->url));
}
if (!litepublisher::$options->hasgroup('editor')) {
$url = tusergroups::i()->gethome(litepublisher::$options->group);
return litepublisher::$urlmap->redir($url);
}
tlocal::usefile('admin');
}
示例12: 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);
}
示例13: tcontactformInstall
/**
* 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 tcontactformInstall($self)
{
$html = tadminhtml::i();
$html->section = 'contactform';
tlocal::usefile('install');
$lang = tlocal::i('contactform');
$self->title = $lang->title;
$self->subject = $lang->subject;
$self->success = $html->success();
$self->errmesg = $html->errmesg();
$self->content = $html->form();
$self->order = 10;
$menus = tmenus::i();
$menus->add($self);
}
示例14: tpermsInstall
/**
* 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 tpermsInstall($self)
{
tlocal::usefile('install');
$lang = tlocal::i('initgroups');
$self->lock();
$single = new tsinglepassword();
$single->name = $lang->single;
$self->add($single);
$self->addclass($single);
$pwd = new tpermpassword();
$pwd->name = $lang->pwd;
$self->add($pwd);
$self->addclass($pwd);
$groups = new tpermgroups();
$groups->name = $lang->groups;
$self->add($groups);
$self->addclass($groups);
$self->unlock();
}
示例15: sendmail
private function sendmail($id)
{
$item = $this->getitem($id);
$args = targs::i();
$args->add($item);
$args->id = $id;
$status = dbversion ? $item['status'] : ($item['approved'] ? 'approved' : 'hold');
$args->localstatus = tlocal::get('commentstatus', $status);
$args->adminurl = litepublisher::$site->url . '/admin/comments/pingback/' . litepublisher::$site->q . "id={$id}&post={$item['post']}&action";
$post = tpost::i($item['post']);
$args->posttitle = $post->title;
$args->postlink = $post->link;
tlocal::usefile('mail');
$lang = tlocal::i('mailcomments');
$theme = ttheme::i();
$subject = $theme->parsearg($lang->pingbacksubj, $args);
$body = $theme->parsearg($lang->pingbackbody, $args);
tmailer::sendmail(litepublisher::$site->name, litepublisher::$options->fromemail, 'admin', litepublisher::$options->email, $subject, $body);
}