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);
 }
/**
* 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();
}
 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;
 }
 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;
 }
 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);
 }
 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;
 }
 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;
 }
 public function createpoll()
 {
     $lang = tlocal::admin('downloaditems');
     $items = explode(',', $lang->pollitems);
     $polls = tpolls::i();
     return $polls->add('', 'opened', 'button', $items);
 }
 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;
 }
 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
0
 public function gethtml()
 {
     $result = tadminhtml::i();
     $result->section = $this->section;
     $lang = tlocal::admin($this->section);
     return $result;
 }
示例#12
0
 public static function getnamelang($name)
 {
     $about = self::getabout($name);
     $lang = tlocal::admin();
     $lang->ini[$name] = $about;
     $lang->section = $name;
     return $lang;
 }
 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);
 }
 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
0
 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());
     }
 }
/**
* 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 tpollsInstall($self)
{
    $name = basename(dirname(__FILE__));
    $res = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'resource' . DIRECTORY_SEPARATOR;
    $dir = litepublisher::$paths->data . 'polls';
    @mkdir($dir, 0777);
    @chmod($dir, 0777);
    $manager = tdbmanager::i();
    $manager->createtable($self->table, file_get_contents($res . 'polls.sql'));
    $manager->createtable($self->users1, file_get_contents($res . 'users.sql'));
    $manager->createtable($self->users2, file_get_contents($res . 'users.sql'));
    $manager->createtable($self->votes, file_get_contents($res . 'votes.sql'));
    tlocalmerger::i()->addplugin($name);
    $lang = tlocal::admin('poll');
    tjsonserver::i()->addevent('polls_sendvote', get_class($self), 'polls_sendvote');
    $jsmerger = tjsmerger::i();
    $jsmerger->lock();
    $jsmerger->add('default', '/plugins/polls/polls.client.min.js');
    $jsmerger->addtext('default', 'poll', sprintf('var lang = $.extend(true, lang, {poll: %s});', json_encode(array('voted' => $lang->voted))));
    $jsmerger->unlock();
    tcssmerger::i()->addstyle(dirname(__FILE__) . '/stars.min.css');
    $lang = tlocal::admin('polls');
    litepublisher::$classes->add('tpolltypes', 'poll.types.php', $name);
    litepublisher::$classes->add('tpollsman', 'polls.man.php', $name);
    litepublisher::$classes->add('tpullpolls', 'pullpolls.class.php', $name);
    litepublisher::$classes->add('tadminpolltemplates', 'admin.poll.templates.php', $name);
    litepublisher::$classes->add('tadminpolltypes', 'admin.poll.types.php', $name);
    litepublisher::$classes->add('tadminpolloptions', 'admin.polloptions.class.php', $name);
    litepublisher::$classes->add('tadminpolls', 'admin.polls.class.php', $name);
    $adminmenus = tadminmenus::i();
    $adminmenus->lock();
    $parent = $adminmenus->createitem($adminmenus->url2id('/admin/plugins/'), 'polls', 'editor', 'tadminpolls');
    $adminmenus->items[$parent]['title'] = $lang->polls;
    $idmenu = $adminmenus->createitem($parent, 'templates', 'editor', 'tadminpolltemplates');
    $adminmenus->items[$idmenu]['title'] = $lang->templates;
    $idmenu = $adminmenus->createitem($parent, 'prototypes', 'editor', 'tadminpolltypes');
    $adminmenus->items[$idmenu]['title'] = $lang->prototypes;
    $idmenu = $adminmenus->createitem($parent, 'options', 'admin', 'tadminpolloptions');
    $adminmenus->items[$idmenu]['title'] = $lang->options;
    $adminmenus->unlock();
    //add sample templates
    $man = tpollsman::i();
    $man->lock();
    $man->fivestars = $self->add_tml('star', $lang->fivestars, $lang->poll, array(1, 2, 3, 4, 5));
    $man->pollpost = $man->fivestars;
    $btn = $self->add_tml('bigbutton', $lang->likepoll, $lang->poll, array($lang->like, $lang->unlike));
    if (litepublisher::$classes->exists('ttickets')) {
        $man->pollpost = $btn;
    }
    $man->unlock();
}
示例#17
0
 public function getposteditor($post, $args)
 {
     $args->data['$lang.sourceurl'] = tlocal::admin()->get('usernews', 'sourceurl');
     if ($this->insertsource) {
         $args->sourceurl = isset($post->meta->sourceurl) ? $post->meta->sourceurl : '';
     }
     $form = tfilestorage::getfile(litepublisher::$paths->plugins . $this->dir . DIRECTORY_SEPARATOR . $this->editorfile);
     $args->raw = $post->rawcontent;
     $html = tadminhtml::i();
     $result = $post->id == 0 ? '' : $html->h2->formhead . $post->bookmark;
     $result .= $html->parsearg($form, $args);
     unset(ttheme::$vars['post']);
     return $html->fixquote($result);
 }
示例#18
0
 public static function getviewform($url)
 {
     $html = tadminhtml::i();
     $lang = tlocal::admin();
     $args = new targs();
     $args->idview = self::getcombo(tadminhtml::getparam('idview', 1));
     $form = new adminform($args);
     $form->action = litepublisher::$site->url . $url;
     $form->inline = true;
     $form->method = 'get';
     $form->items = '[combo=idview]';
     $form->submit = 'select';
     return $form->get();
 }
 public function getcontent()
 {
     $result = '';
     $html = $this->inihtml();
     $lang = tlocal::admin('downloaditems');
     $lang->ini['downloaditems'] = $lang->ini['downloaditem'] + $lang->ini['downloaditems'];
     $args = new targs();
     $args->adminurl = $this->adminurl;
     $editurl = tadminhtml::getadminlink('/admin/downloaditems/editor/', 'id');
     $args->editurl = $editurl;
     $downloaditems = tdownloaditems::i();
     $perpage = 20;
     $where = litepublisher::$options->group == 'downloaditem' ? ' and author = ' . litepublisher::$options->user : '';
     switch ($this->name) {
         case 'addurl':
             $args->formtitle = $lang->addurl;
             $args->url = tadminhtml::getparam('url', '');
             return $html->adminform('[text=url]', $args);
         case 'theme':
             $where .= " and type = 'theme' ";
             break;
         case 'plugin':
             $where .= " and type = 'plugin' ";
             break;
     }
     $count = $downloaditems->getchildscount($where);
     $from = $this->getfrom($perpage, $count);
     if ($count > 0) {
         $items = $downloaditems->select("status <> 'deleted' {$where}", " order by posted desc limit {$from}, {$perpage}");
         if (!$items) {
             $items = array();
         }
     } else {
         $items = array();
     }
     $result .= $html->editlink();
     $form = new adminform(new targs());
     $form->items = $html->getitemscount($from, $from + count($items), $count);
     $form->items .= $html->tableposts($items, array(array('right', $lang->downloads, '$post.downloads'), array('left', $lang->posttitle, '$post.bookmark'), array('left', $lang->status, '$ticket_status.status'), array('left', $lang->tags, '$post.tagnames'), array('center', $lang->edit, '<a href="' . $editurl . '=$post.id">' . $lang->edit . '</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($this->url, litepublisher::$urlmap->page, ceil($count / $perpage));
     return $result;
 }
/**
* 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 tforumInstall($self)
{
    litepublisher::$options->reguser = true;
    tadminoptions::i()->usersenabled = true;
    $name = basename(dirname(__FILE__));
    tlocalmerger::i()->addplugin($name);
    $lang = tlocal::admin('forum');
    //prevent double create view
    $idview = 0;
    $views = tviews::i();
    foreach ($views->items as $id => $item) {
        if ('forum' == $item['themename']) {
            $idview = $id;
            break;
        }
    }
    if (!$idview) {
        $view = new tview();
        $view->name = $lang->forum;
        $view->themename = 'forum';
        $idview = $views->addview($view);
    }
    $lang->section = 'forum';
    $cats = tcategories::i();
    $idcat = $cats->add(0, $lang->forum);
    $cats->setvalue($idcat, 'includechilds', 1);
    $cats->setvalue($idcat, 'idview', $idview);
    $cats->contents->setcontent($idcat, $lang->intro . sprintf(' <a href="%s/admin/plugins/forum/">%s</a>', litepublisher::$site->url, tlocal::get('names', 'adminpanel')));
    $self->rootcat = $idcat;
    $self->idview = $idview;
    $self->categories_changed();
    $self->save();
    $cat = $cats->getitem($idcat);
    tmenus::i()->addfake($cat['url'], $cat['title']);
    tjsmerger::i()->add('default', '/plugins/forum/forum.min.js');
    $linkgen = tlinkgenerator::i();
    $linkgen->data['forum'] = '/forum/[title].htm';
    $linkgen->save();
    $cats = tcategories::i();
    $cats->lock();
    $cats->changed = $self->categories_changed;
    $cats->added = $self->catadded;
    $cats->unlock();
    tthemeparser::i()->parsed = $self->themeparsed;
    ttheme::clearcache();
    litepublisher::$classes->add('tforumeditor', 'admin.forumeditor.class.php', $name);
    $adminmenus = tadminmenus::i();
    $adminmenus->createitem($adminmenus->url2id('/admin/plugins/'), 'forum', 'author', 'tforumeditor');
}
/**
* 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 tviewsInstall($self)
{
    $widgets = twidgets::i();
    $widgets->deleted = $self->widgetdeleted;
    $self->lock();
    $lang = tlocal::admin('names');
    $default = $self->add($lang->default);
    $def = tview::i($default);
    $def->sidebars = array(array(), array(), array());
    $idadmin = $self->add($lang->adminpanel);
    $admin = tview::i($idadmin);
    $admin->menuclass = 'tadminmenus';
    $self->defaults = array('post' => $default, 'menu' => $default, 'category' => $default, 'tag' => $default, 'admin' => $idadmin);
    $self->unlock();
}
 public function getcontent()
 {
     $result = '';
     $html = $this->html;
     $lang = tlocal::admin('users');
     if ($this->logged) {
         return $html->h4red($lang->logged . ' ' . $html->getlink('/admin/', $lang->adminpanel));
     }
     $args = new targs();
     if ($this->regstatus) {
         switch ($this->regstatus) {
             case 'ok':
                 $backurl = $this->backurl;
                 if (!$backurl) {
                     $backurl = tusergroups::i()->gethome(litepublisher::$options->group);
                 }
                 if (!strbegin($backurl, 'http://')) {
                     $backurl = litepublisher::$site->url . $backurl;
                 }
                 return $html->h4($lang->successreg . ' ' . $html->getlink($backurl, $lang->continue));
             case 'mail':
                 return $html->h4->waitconfirm;
             case 'error':
                 $result .= $html->h4->invalidregdata;
         }
     }
     $form = '';
     foreach (array('email', 'name') as $name) {
         $args->{$name} = isset($_POST[$name]) ? $_POST[$name] : '';
         $form .= "[text={$name}]";
     }
     $lang = tlocal::i('users');
     $args->formtitle = $lang->regform;
     $args->data['$lang.email'] = 'email';
     $result .= $this->widget;
     if (isset($_GET['backurl'])) {
         //normalize
         $result = str_replace('&amp;backurl=', '&backurl=', $result);
         $result = str_replace('backurl=', 'backurl=' . urlencode($_GET['backurl']), $result);
         $result = str_replace('backurl%3D', 'backurl%3D' . urlencode(urlencode($_GET['backurl'])), $result);
     }
     $result .= $html->adminform($form, $args);
     $result = str_replace(' action=""', ' action="' . litepublisher::$site->url . '/admin/reguser/"', $result);
     $this->callevent('oncontent', array(&$result));
     return $result;
 }
 public function getcontent()
 {
     $plugin = tbackup2dropbox::i();
     $html = tadminhtml::i();
     $args = targs::i();
     $about = tplugins::getabout(tplugins::getname(__FILE__));
     tlocal::admin()->ini['dropbox'] = $about;
     $lang = tlocal::i('dropbox');
     $args->add($plugin->data);
     $args->formtitle = $about['head'];
     $form = $html->adminform('[text=email] [password=password] [text=dir] [checkbox=uploadfiles] [checkbox=onlychanged]] [checkbox=useshell]', $args);
     $form .= '<form name="createnowform" action="" method="post" >
 <input type="hidden" name="createnow" value="1" />
 <p><input type="submit" name="create_now" value="' . $lang->createnow . '"/></p>
 </form>';
     return $form;
 }
 public function getcontent()
 {
     $result = '';
     $tickets = ttickets::i();
     $perpage = 20;
     $where = litepublisher::$options->group == 'ticket' ? ' and author = ' . litepublisher::$options->user : '';
     switch ($this->name) {
         case 'opened':
             $where .= " and state = 'opened' ";
             break;
         case 'fixed':
             $where .= " and state = 'fixed' ";
             break;
     }
     $count = $tickets->getchildscount($where);
     $from = $this->getfrom($perpage, $count);
     if ($count > 0) {
         $items = $tickets->select("status <> 'deleted' {$where}", " order by posted desc limit {$from}, {$perpage}");
         if (!$items) {
             $items = array();
         }
     } else {
         $items = array();
     }
     $html = $this->inihtml();
     $lang = tlocal::admin('tickets');
     $lang->addsearch('ticket');
     $result .= $html->editlink();
     $result .= $html->getitemscount($from, $from + count($items), $count);
     ttheme::$vars['poststatus'] = new poststatus();
     $table = $html->tableposts($items, array(array('center', $lang->date, '$post.date'), array('left', $lang->posttitle, '$post.bookmark'), array('left', $lang->author, '$post.authorlink'), array('left', $lang->status, '$poststatus.status'), array('left', $lang->category, '$post.category'), array('left', $lang->state, '$poststatus.state'), array('center', $lang->edit, '<a href="' . tadminhtml::getadminlink('/admin/tickets/editor/', 'id') . '=$post.id">' . $lang->edit . '</a>')));
     unset(ttheme::$vars['poststatus']);
     //wrap form
     if (litepublisher::$options->group != 'ticket') {
         $args = new targs();
         $args->table = $table;
         $result .= $html->tableform($args);
     } else {
         $result .= $table;
     }
     $result = $html->fixquote($result);
     $theme = ttheme::i();
     $result .= $theme->getpages($this->url, litepublisher::$urlmap->page, ceil($count / $perpage));
     return $result;
 }
示例#25
0
 public function getcontent()
 {
     $forum = tforum::i();
     $html = tadminhtml::i();
     $args = new targs();
     $html->section = 'editor';
     $lang = tlocal::i('editor');
     $args->comstatus = tadminhtml::array2combo(array('closed' => $lang->closed, 'reg' => $lang->reg, 'guest' => $lang->guest, 'comuser' => $lang->comuser), $forum->comstatus);
     $lang = tlocal::admin('forum');
     $args->rootcat = tposteditor::getcombocategories(array(), $forum->rootcat);
     $args->moderate = $forum->moderate;
     $args->formtitle = $lang->options;
     return $html->adminform('
 [combo=rootcat]
 [combo=comstatus]
 [checkbox=moderate]
 ' . tadminviews::getcomboview($forum->idview) . tadminperms::getcombo(0), $args);
 }
 public function getcontent()
 {
     $groups = tusergroups::i();
     $html = $this->html;
     $lang = tlocal::admin('users');
     $args = targs::i();
     $adminurl = $this->adminurl;
     $result = "<h4><a href='{$adminurl}=0&action=add'>{$lang->addgroup}</a></h4>";
     $id = $this->idget();
     switch ($this->action) {
         case 'add':
             $result .= $html->p->notegroup;
             $args->name = '';
             $args->title = '';
             $args->home = '';
             $args->action = 'add';
             $args->formtitle = $lang->editgroup;
             $result .= $html->adminform('
   [text=title]
   [text=name]
   [text=home]
   [hidden=action]' . $html->h4->parentgroups . self::getgroups(array()), $args);
             break;
         case 'edit':
             $result .= $html->p->notegroup;
             $args->add($groups->items[$id]);
             $args->id = $id;
             $args->action = 'edit';
             $args->formtitle = $lang->editgroup;
             $result .= $html->adminform('
   [text=title]
   [text=name]
   [text=home]
   [hidden=id]
   [hidden=action]' . $html->h4->parentgroups . self::getgroups($groups->items[$id]['parents']), $args);
             break;
         case 'delete':
             $result .= $html->confirm_delete($groups, $this->adminurl);
             break;
     }
     $result .= $html->h4->grouptable;
     $result .= $html->buildtable($groups->items, array(array('left', $lang->name, '<a href="' . $adminurl . '=$id&action=edit" title="$title">$title</a>'), array('left', $lang->users, sprintf('<a href="%s">%s</a>', tadminhtml::getadminlink('/admin/users/', 'idgroup=$id'), $lang->users)), $html->get_table_link('delete', $adminurl)));
     return $result;
 }
示例#27
0
 public static function getcontent($holder, $menu)
 {
     $result = '';
     $html = $menu->html;
     $lang = tlocal::admin();
     $id = (int) tadminhtml::getparam('id', 0);
     $args = new targs();
     $args->id = $id;
     $args->adminurl = $menu->adminurl;
     if (isset($_GET['action']) && $_GET['action'] == 'delete' && $tags->itemexists($id)) {
         if (isset($_REQUEST['confirm']) && $_REQUEST['confirm'] == 1) {
             $holder->delete($id);
             $result .= $html->h4->deleted;
         } else {
             return $html->confirmdelete($id, $menu->adminurl, $lang->confirmdelete);
         }
     }
     if ($id == 0) {
         $item = $menu->defaultitem;
     } elseif ($holder->itemexists($id)) {
         $item = $holder->getitem($id);
     } else {
         $item = false;
     }
     if ($item) {
         $args->add($item);
         $menu->editargs($item, $args);
         $result .= $html->adminform($menu->editform, $args);
     }
     //table
     $perpage = 20;
     $count = $holder->count;
     $from = $menu->getfrom($perpage, $count);
     $items = $holder->select($menu->where, " order by id desc limit {$from}, {$perpage}");
     if (!$items) {
         $items = array();
     }
     $result .= $html->buildtable($items, $menu->table);
     $result = $html->fixquote($result);
     $theme = ttheme::i();
     $result .= $theme->getpages($menu->url, litepublisher::$urlmap->page, ceil($count / $perpage));
     return $result;
 }
 public function restore($email)
 {
     $lang = tlocal::admin('password');
     $email = strtolower(trim($email));
     if (empty($email)) {
         return $this->error($lang->error);
     }
     $id = $this->getiduser($email);
     if (!$id) {
         return $this->error($lang->error);
     }
     $args = new targs();
     tsession::start('password-restore-' . md5(litepublisher::$options->hash($email)));
     if (!isset($_SESSION['count'])) {
         $_SESSION['count'] = 1;
     } else {
         if ($_SESSION['count']++ > 3) {
             return $this->error($lang->outofcount);
         }
     }
     $_SESSION['email'] = $email;
     $password = md5uniq();
     $_SESSION['password'] = $password;
     $_SESSION['confirm'] = md5rand();
     $args->confirm = $_SESSION['confirm'];
     session_write_close();
     $args->email = urlencode($email);
     if ($id == 1) {
         $name = litepublisher::$site->author;
     } else {
         $item = tusers::i()->getitem($id);
         $args->add($item);
         $name = $item['name'];
     }
     $args->password = $password;
     tlocal::usefile('mail');
     $lang = tlocal::i('mailpassword');
     $theme = ttheme::i();
     $subject = $theme->parsearg($lang->subject, $args);
     $body = $theme->parsearg($lang->body, $args);
     tmailer::sendmail(litepublisher::$site->name, litepublisher::$options->fromemail, $name, $email, $subject, $body);
     return true;
 }
 public function getcontent()
 {
     $result = '';
     $html = $this->html;
     $lang = tlocal::admin();
     $args = new targs();
     if ($this->newreg) {
         $result .= $html->h4->newreg;
     }
     $subscribers = tsubscribers::i();
     $items = $subscribers->getposts($this->iduser);
     if (count($items) == 0) {
         return $html->h4->nosubscribtions;
     }
     tposts::i()->loaditems($items);
     $args->default_subscribe = tuseroptions::i()->getvalue($this->iduser, 'subscribe') == 'enabled';
     $args->formtitle = tusers::i()->getvalue($this->iduser, 'email') . ' ' . $lang->formhead;
     $result .= $html->adminform('[checkbox=default_subscribe]' . ($table = $html->tableposts($items, array(array('left', $lang->post, '<a href="$site.url$post.url" title="$post.title">$post.title</a>')))), $args);
     return $html->fixquote($result);
 }
 public function getcontent()
 {
     $plugin = tusernews::i();
     $lang = tlocal::admin('usernews');
     $args = new targs();
     $form = '';
     foreach (array('_changeposts', '_canupload', '_candeletefile', 'checkspam', 'insertsource') as $name) {
         $args->{$name} = $plugin->data[$name];
         //$args->data["\$lang.$name"] = $about[$name];
         $form .= "[checkbox={$name}]";
     }
     foreach (array('sourcetml', 'editorfile') as $name) {
         $args->{$name} = $plugin->data[$name];
         //$args->data["\$lang.$name"] = $about[$name . 'label'];
         $form .= "[text={$name}]";
     }
     $args->formtitle = $lang->formtitle;
     $html = tadminhtml::i();
     return $html->adminform($form, $args);
 }