本文整理汇总了PHP中tlocal::admin方法的典型用法代码示例。如果您正苦于以下问题:PHP tlocal::admin方法的具体用法?PHP tlocal::admin怎么用?PHP tlocal::admin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tlocal
的用法示例。
在下文中一共展示了tlocal::admin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例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: getcontent
public function getcontent()
{
$result = '';
$this->basename = 'downloaditems';
$html = $this->inihtml();
$lang = tlocal::admin('downloaditems');
$lang->ini['downloaditems'] = $lang->ini['downloaditem'] + $lang->ini['downloaditems'];
$html->push_section('editor');
$downloaditem = tdownloaditem::i($this->idpost);
ttheme::$vars['downloaditem'] = $downloaditem;
$args = new targs();
$this->getpostargs($downloaditem, $args);
$html->pop_section();
$args->downloadurl = $downloaditem->downloadurl;
$args->authorname = $downloaditem->authorname;
$args->authorurl = $downloaditem->authorurl;
$args->version = $downloaditem->version;
$types = array('theme' => tlocal::get('downloaditem', 'theme'), 'plugin' => tlocal::get('downloaditem', 'plugin'));
$args->type = tadminhtml::array2combo($types, $downloaditem->type);
if ($downloaditem->id > 0) {
$result .= $html->headeditor();
}
$result .= $html->form($args);
$result = $html->fixquote($result);
unset(ttheme::$vars['downloaditem']);
return $result;
}
示例4: 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;
}
示例5: 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);
}
示例6: getcontent
public function getcontent()
{
if (!($id = $this->getidfile())) {
return $this->notfound;
}
$result = '';
$files = tfiles::i();
$html = $this->html;
$lang = tlocal::admin();
$args = new targs();
$item = $files->getitem($id);
$idpreview = $item['preview'];
if ($idpreview > 0) {
$args->add($files->getitem($idpreview));
$form = new adminform($args);
$form->action = "{$this->adminurl}={$id}";
$form->inline = true;
$form->items = $html->p('<img src="$site.files/files/$filename" alt="thumbnail" />' . $lang->wantdelete);
$form->submit = 'delete';
$result .= $form->get();
}
$form = new adminform($args);
$form->upload = true;
$form->action = "{$this->adminurl}={$id}";
$form->title = $lang->changethumb;
$form->items = '[upload=filename]
[checkbox=noresize]';
$result .= $form->get();
return $result;
}
示例7: 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;
}
示例8: createpoll
public function createpoll()
{
$lang = tlocal::admin('downloaditems');
$items = explode(',', $lang->pollitems);
$polls = tpolls::i();
return $polls->add('', 'opened', 'button', $items);
}
示例9: 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;
}
示例10: 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;
}
示例11: gethtml
public function gethtml()
{
$result = tadminhtml::i();
$result->section = $this->section;
$lang = tlocal::admin($this->section);
return $result;
}
示例12: getnamelang
public static function getnamelang($name)
{
$about = self::getabout($name);
$lang = tlocal::admin();
$lang->ini[$name] = $about;
$lang->section = $name;
return $lang;
}
示例13: getcontent
public function getcontent()
{
$lang = tlocal::admin('tickets');
$args = new targs();
$args->formtitle = $lang->admincats;
$tickets = ttickets::i();
return $this->html->adminform(tposteditor::getcategories($tickets->cats), $args);
}
示例14: getcombo
public static function getcombo($idperm, $name = 'idperm')
{
$lang = tlocal::admin();
$section = $lang->section;
$lang->section = 'perms';
$theme = ttheme::i();
$result = strtr($theme->templates['content.admin.combo'], array('$lang.$name' => $lang->perm, '$name' => $name, '$value' => self::getcomboitems($idperm)));
$lang->section = $section;
return $result;
}
示例15: email_reg
public function email_reg(array $args)
{
if (!litepublisher::$options->usersenabled || !litepublisher::$options->reguser) {
return array('error' => tlocal::admin('users')->regdisabled);
}
try {
return tadminreguser::i()->reguser($args['email'], $args['name']);
} catch (Exception $e) {
return array('error' => $e->getMessage());
}
}