public function getcontent()
 {
     $plugin = tblackip::i();
     $lang = tplugins::getlangabout('black-ip');
     $args = new targs();
     $args->ip = implode("\n", $plugin->ip);
     $args->words = implode("\n", $plugin->words);
     $args->ipstatus = tadminhtml::array2combo(tlocal::i()->ini['commentstatus'], $plugin->ipstatus);
     $args->wordstatus = tadminhtml::array2combo(tlocal::i()->ini['commentstatus'], $plugin->wordstatus);
     $tabs = new tuitabs();
     $tabs->add($lang->wordtitle, '[combo=wordstatus] [editor=words]');
     $tabs->add('IP', '[combo=ipstatus] [editor=ip]');
     $args->formtitle = $lang->formtitle;
     $html = tadminhtml::i();
     return tuitabs::gethead() . $html->adminform($tabs->get(), $args);
 }
 public function getcontent()
 {
     $plugin = tmlstorage::i();
     $args = new targs();
     $args->formtitle = 'Template storage';
     $html = tadminhtml::i();
     $tabs = new tuitabs();
     foreach ($plugin->items as $classname) {
         if (is_array($obj->data['tml'])) {
             $tab = new tuitabs();
             $obj = getinstance($classname);
             foreach ($obj->data['tml'] as $key => $value) {
                 $tab->add($key, $html->getinput('editor', $classname . '_text_' . $key, tadminhtml::specchars($value), $key));
             }
             $tabs->add($classname, $tab->get());
         } else {
             $tabs->add($classname, $html->getinput('editor', $classname . '_text', tadminhtml::specchars($obj->data['tml']), $classname));
         }
     }
     return tuitabs::gethead() . $html->adminform($tabs->get(), $args);
 }
 public function gethead()
 {
     return parent::gethead() . tuitabs::gethead();
 }
 public function getcontent()
 {
     $result = '';
     $views = tviews::i();
     $html = $this->html;
     $lang = tlocal::i('views');
     $args = new targs();
     switch ($this->name) {
         case 'views':
             $html->addsearch('views');
             $lang->addsearch('views');
             $id = tadminhtml::getparam('idview', 0);
             if (!$id || !$views->itemexists($id)) {
                 $adminurl = $this->adminurl . 'view';
                 return $html->h4($html->getlink($this->url . '/addview/', $lang->add)) . $html->buildtable($views->items, array(array('left', $lang->name, "<a href=\"{$adminurl}=\$id\">\$name</a>"), array('center', $lang->delete, "<a href=\"{$adminurl}=\$id&action=delete\" class=\"confirm-delete-link\">{$lang->delete}</a>")));
             }
             $result = self::getviewform($this->url);
             $tabs = new tuitabs();
             $menuitems = array();
             foreach ($views->items as $itemview) {
                 $class = $itemview['menuclass'];
                 $menuitems[$class] = $class == 'tmenus' ? $lang->stdmenu : ($class == 'tadminmenus' ? $lang->adminmenu : $class);
             }
             $itemview = $views->items[$id];
             $args->add($itemview);
             $tabs->add($lang->widgets, $this->get_view_sidebars($id, $html, $lang, $args));
             $args->menu = tadminhtml::array2combo($menuitems, $itemview['menuclass']);
             $tabs->add($lang->name, '[text=name]' . ($id == 1 ? '' : '[checkbox=customsidebar] [checkbox=disableajax]') . '[checkbox=hovermenu] [combo=menu]');
             $view = tview::i($id);
             $lang->firstsearch('themes');
             $tabs->add($lang->theme, tadminthemes::getlist($html->radiotheme, $view->theme->name));
             if (count($view->custom)) {
                 $tabs->add($lang->custom, $this->get_custom($view));
             }
             $result .= $html->h4->help;
             $form = new adminform($args);
             $form->id = 'admin-view-form';
             $form->title = $lang->edit;
             $form->items = $tabs->get();
             $result .= $form->get();
             $result .= ttemplate::i()->getjavascript(ttemplate::i()->jsmerger_adminviews);
             break;
         case 'addview':
             $args->formtitle = $lang->addview;
             $result .= $html->adminform('[text=name]', $args);
             break;
         case 'spec':
             $tabs = new tuitabs();
             $inputs = '';
             foreach (self::getspecclasses() as $classname) {
                 $obj = getinstance($classname);
                 $args->classname = $classname;
                 $name = substr($classname, 1);
                 $args->title = $lang->{$name};
                 $inputs = self::getcomboview($obj->idview, "idview-{$classname}");
                 if (isset($obj->data['keywords'])) {
                     $inputs .= $html->getedit("keywords-{$classname}", $obj->data['keywords'], $lang->keywords);
                 }
                 if (isset($obj->data['description'])) {
                     $inputs .= $html->getedit("description-{$classname}", $obj->data['description'], $lang->description);
                 }
                 if (isset($obj->data['head'])) {
                     $inputs .= $html->getinput('editor', "head-{$classname}", tadminhtml::specchars($obj->data['head']), $lang->head);
                 }
                 $tabs->add($lang->{$name}, $inputs);
             }
             $args->formtitle = $lang->defaults;
             $result .= tuitabs::gethead() . $html->adminform($tabs->get(), $args);
             break;
         case 'group':
             $args->formtitle = $lang->viewposts;
             $result .= $html->adminform(self::getcomboview($views->defaults['post'], 'postview') . '<input type="hidden" name="action" value="posts" />', $args);
             $args->formtitle = $lang->viewmenus;
             $result .= $html->adminform(self::getcomboview($views->defaults['menu'], 'menuview') . '<input type="hidden" name="action" value="menus" />', $args);
             $args->formtitle = $lang->themeviews;
             $view = tview::i();
             $list = tfiler::getdir(litepublisher::$paths->themes);
             sort($list);
             $themes = array_combine($list, $list);
             $result .= $html->adminform($html->getcombo('themeview', tadminhtml::array2combo($themes, $view->themename), $lang->themename) . '<input type="hidden" name="action" value="themes" />', $args);
             break;
         case 'defaults':
             $items = '';
             $theme = ttheme::i();
             $tml = $theme->templates['content.admin.combo'];
             foreach ($views->defaults as $name => $id) {
                 $args->name = $name;
                 $args->value = self::getcombo($id);
                 $args->data['$lang.$name'] = $lang->{$name};
                 $items .= $theme->parsearg($tml, $args);
             }
             $args->items = $items;
             $args->formtitle = $lang->defaultsform;
             $result .= $theme->parsearg($theme->content->admin->form, $args);
             break;
         case 'headers':
             $tabs = new tuitabs();
             $args->heads = ttemplate::i()->heads;
             $tabs->add($lang->headstitle, '[editor=heads]');
             $args->adminheads = tadminmenus::i()->heads;
             $tabs->add($lang->admin, '[editor=adminheads]');
             $ajax = tajaxposteditor::i();
             $args->ajaxvisual = $ajax->ajaxvisual;
             $args->visual = $ajax->visual;
             $args->show_file_perm = litepublisher::$options->show_file_perm;
             $tabs->add($lang->posteditor, '[checkbox=show_file_perm] [checkbox=ajaxvisual] [text=visual]');
             $args->formtitle = $lang->headstitle;
             $result = $html->adminform($tabs->get(), $args);
             $result .= tuitabs::gethead();
             break;
         case 'admin':
             return $this->adminoptionsform->getform();
     }
     return $html->fixquote($result);
 }
 public function getcontent()
 {
     $result = '';
     $istags = $this->name == 'tags' || $this->name == 'addtag';
     $tags = $istags ? litepublisher::$classes->tags : litepublisher::$classes->categories;
     if (dbversion) {
         $tags->loadall();
     }
     $parents = array(0 => '-----');
     foreach ($tags->items as $id => $item) {
         $parents[$id] = $item['title'];
     }
     $this->basename = 'tags';
     $html = $this->html;
     $lang = tlocal::i('tags');
     $id = $this->idget();
     $args = new targs();
     $args->id = $id;
     $args->adminurl = $this->adminurl;
     $ajax = tadminhtml::getadminlink('/admin/ajaxtageditor.htm', sprintf('id=%d&type=%s&get', $id, $istags ? 'tags' : 'categories'));
     $args->ajax = $ajax;
     if (isset($_GET['action']) && $_GET['action'] == 'delete' && $tags->itemexists($id)) {
         if ($this->confirmed) {
             $tags->delete($id);
             $result .= $html->h4->successdeleted;
         } else {
             return $html->confirmdelete($id, $this->adminurl, $lang->confirmdelete);
         }
     }
     $result .= $html->h4(tadminhtml::getlink('/admin/posts/' . ($istags ? 'addtag' : 'addcat') . '/', $lang->add));
     $item = false;
     if ($id && $tags->itemexists($id)) {
         $item = $tags->getitem($id);
         $args->formtitle = $lang->edit;
     } elseif ($this->name == 'addcat' || $this->name == 'addtag') {
         $id = 0;
         $item = array('id' => 0, 'title' => '', 'parent' => 0, 'customorder' => 0);
         $args->formtitle = $lang->add;
     }
     if ($item) {
         $args->add($item);
         $args->parent = tadminhtml::array2combo($parents, $item['parent']);
         $args->order = tadminhtml::array2combo(array_combine(range(0, 9), range(1, 10)), $item['customorder']);
         $tabs = new tuitabs();
         $tabs->add($lang->title, '
   [text=title]
   [combo=parent]
   [combo=order]
   [hidden=id]' . $html->p->ordernote);
         $tabs->ajax($lang->text, "{$ajax}=text");
         $tabs->ajax($lang->view, "{$ajax}=view");
         $tabs->ajax('SEO', "{$ajax}=seo");
         $form = new adminform($args);
         $result .= $html->adminform($tabs->get(), $args) . tuitabs::gethead();
     }
     //table
     $perpage = 20;
     $count = $tags->count;
     $from = $this->getfrom($perpage, $count);
     if ($tags->dbversion) {
         $iditems = $tags->db->idselect("id > 0 order by parent asc, title asc limit {$from}, {$perpage}");
     } else {
         $iditems = array_slice(array_keys($tags->items), $from, $perpage);
     }
     $items = array();
     foreach ($iditems as $id) {
         $item = $tags->items[$id];
         $item['parentname'] = $parents[$item['parent']];
         $items[] = $item;
     }
     $result .= $html->buildtable($items, array(array('right', $lang->count2, '$itemscount'), array('left', $lang->title, '<a href="$link" title="$title">$title</a>'), array('left', $lang->parent, '$parentname'), array('center', $lang->edit, "<a href=\"{$this->adminurl}=\$id\">{$lang->edit}</a>"), array('center', $lang->delete, "<a class=\"confirm-delete-link\" href=\"{$this->adminurl}=\$id&action=delete\">{$lang->delete}</a>")));
     $result = $html->fixquote($result);
     $theme = ttheme::i();
     $result .= $theme->getpages($this->url, litepublisher::$urlmap->page, ceil($count / $perpage));
     return $result;
 }
 public function gethead()
 {
     return tuitabs::gethead();
 }
 public function getcontent()
 {
     if ($form = $this->getautoform($this->name)) {
         return $form->getform();
     }
     $options = litepublisher::$options;
     $template = ttemplate::i();
     ttheme::$vars['template'] = $template;
     $result = '';
     $args = new targs();
     $lang = tlocal::admin('options');
     $html = $this->html;
     switch ($this->name) {
         case 'options':
             $site = litepublisher::$site;
             $args->fixedurl = $site->fixedurl;
             $args->redirdom = litepublisher::$urlmap->redirdom;
             $args->url = $site->url;
             $args->name = $site->name;
             $args->description = $site->description;
             $args->keywords = $site->keywords;
             $args->author = $site->author;
             $args->footer = $template->footer;
             $args->formtitle = $lang->options;
             return $html->adminform('
   [checkbox=fixedurl]
   [checkbox=redirdom]
   [text=url]
   [text=name]
   [text=description]
   [text=keywords]
   [text=author]
   [editor=footer]
   ', $args);
         case 'home':
             $home = thomepage::i();
             $tabs = new tuitabs();
             $args->image = $home->image;
             $args->parsetags = $home->parsetags;
             $args->showmidle = $home->showmidle;
             $args->midlecat = tposteditor::getcombocategories(array(), $home->midlecat);
             $args->showposts = $home->showposts;
             $args->invertorder = $home->invertorder;
             $args->showpagenator = $home->showpagenator;
             $args->idhome = $home->id;
             $menus = tmenus::i();
             $args->homemenu = $menus->home;
             $tabs->add($lang->options, '
   [checkbox=homemenu]
   [text=image]
   [checkbox=parsetags]
   [checkbox=showmidle]
   [combo=midlecat]
   [checkbox=showposts]
   [checkbox=invertorder]
   [checkbox=showpagenator]
   ');
             $tabs->add($lang->includecats, $html->h4->includehome . tposteditor::getcategories($home->includecats));
             $tabs->add($lang->excludecats, $html->h4->excludehome . str_replace('category-', 'exclude_category-', tposteditor::getcategories($home->excludecats)));
             $args->formtitle = $lang->homeform;
             return tuitabs::gethead() . $html->adminform('<h4><a href="$site.url/admin/menu/edit/{$site.q}id=$idhome">$lang.hometext</a></h4>' . $tabs->get(), $args);
         case 'mail':
             $args->adminemail = $options->email;
             $args->fromemail = $options->fromemail;
             $args->mailer = $options->mailer == 'smtp';
             $subscribers = tsubscribers::i();
             $args->subscribeemail = $subscribers->fromemail;
             $mailer = TSMTPMailer::i();
             $args->host = $mailer->host;
             $args->smtplogin = $mailer->login;
             $args->password = $mailer->password;
             $args->port = $mailer->port;
             $args->formtitle = $lang->mailoptions;
             return $html->adminform('
   [text=adminemail]
   [text=fromemail]
   [text=subscribeemail]
   [checkbox=mailer]
   [text=host]
   [text=smtplogin]
   [password=password]
   [text=port]
   ', $args);
         case 'view':
             $args->perpage = $options->perpage;
             $filter = tcontentfilter::i();
             $args->usefilter = $filter->usefilter;
             $args->automore = $filter->automore;
             $args->automorelength = $filter->automorelength;
             $args->autolinks = $filter->autolinks;
             $args->commentautolinks = $filter->commentautolinks;
             $args->icondisabled = $options->icondisabled;
             $args->hidefilesonpage = $options->hidefilesonpage;
             $themeparser = tthemeparser::i();
             $args->replacelang = $themeparser->replacelang;
             $args->stylebefore = $themeparser->stylebefore;
             $args->formtitle = $lang->viewoptions;
             return $html->adminform('
   [text=perpage]
   [checkbox=usefilter]
   [checkbox=automore]
   [text=automorelength]
   [checkbox=autolinks]
   [checkbox=commentautolinks]
   [checkbox=hidefilesonpage]
   [checkbox=icondisabled]
   [checkbox=replacelang]
   [checkbox=stylebefore]
   ', $args);
             break;
         case 'files':
             $parser = tmediaparser::i();
             $args->enablepreview = $parser->enablepreview;
             $args->ratio = $parser->ratio;
             $args->clipbounds = $parser->clipbounds;
             $args->previewwidth = $parser->previewwidth;
             $args->previewheight = $parser->previewheight;
             $args->maxwidth = $parser->maxwidth;
             $args->maxheight = $parser->maxheight;
             $args->alwaysresize = $parser->alwaysresize;
             $args->quality_original = $parser->quality_original;
             $args->quality_snapshot = $parser->quality_snapshot;
             $args->audioext = $parser->audioext;
             $args->videoext = $parser->videoext;
             $args->video_width = litepublisher::$site->video_width;
             $args->video_height = litepublisher::$site->video_height;
             $args->formtitle = $lang->files;
             return $html->adminform('
   <h4>$lang.imagesize</h4>
   [checkbox=alwaysresize]
   [text=maxwidth]
   [text=maxheight]
   [text=quality_original]
   
   <h4>$lang.previewsize</h4>
   [checkbox=enablepreview]
   [checkbox=ratio]
   [checkbox=clipbounds]
   [text=previewwidth]
   [text=previewheight]
   [text=quality_snapshot]
   
   <h4>$lang.extfile</h4>
   [text=audioext]
   [text=videoext]
   
   [text=video_width]
   [text=video_height]
   ', $args);
             break;
         case 'links':
             $linkgen = tlinkgenerator::i();
             $args->urlencode = $linkgen->urlencode;
             $args->post = $linkgen->post;
             $args->menu = $linkgen->menu;
             $args->category = $linkgen->category;
             $args->tag = $linkgen->tag;
             $args->archive = $linkgen->archive;
             $args->formtitle = $lang->schemalinks;
             return $html->adminform('
   <p>$lang.taglinks</p>
   [checkbox=urlencode]
   [text=post]
   [text=menu]
   [text=category]
   [text=tag]
   [text=archive]
   ', $args);
         case 'cache':
             $args->enabledcache = $options->cache;
             $args->expiredcache = $options->expiredcache;
             $args->admincache = $options->admincache;
             $args->ob_cache = $options->ob_cache;
             $args->compress = $options->compress;
             $args->commentspull = $options->commentspull;
             $args->memcache_classes = litepublisher::$classes->memcache;
             $args->formtitle = $lang->optionscache;
             $result = $html->adminform('
   [checkbox=enabledcache]
   [text=expiredcache]
   [checkbox=ob_cache]
   [checkbox=admincache]
   [checkbox=commentspull]
   [checkbox=memcache_classes]
   ', $args);
             $form = new adminform($args);
             $form->submit = 'clearcache';
             $result .= $form->get();
             return $result;
         case 'catstags':
         case 'lite':
             //old version suports
             $args->litearch = litepublisher::$classes->archives->lite;
             $cats = litepublisher::$classes->categories;
             $args->litecats = $cats->lite;
             $args->parentcats = $cats->includeparents;
             $args->childcats = $cats->includechilds;
             $tags = litepublisher::$classes->tags;
             $args->litetags = $tags->lite;
             $args->parenttags = $tags->includeparents;
             $args->childtags = $tags->includechilds;
             $lang = tlocal::admin('options');
             $args->formtitle = $lang->catstags;
             $html = $this->html;
             return $html->adminform('[checkbox=litearch]
   [checkbox=litecats] [checkbox=parentcats] [checkbox=childcats]
   [checkbox=litetags] [checkbox=parenttags] [checkbox=childtags]', $args) . $html->p->notecatstags;
         case 'robots':
             $html = $this->html;
             $args->formtitle = 'robots.txt';
             $args->robots = trobotstxt::i()->text;
             $args->appcache = appcache_manifest::i()->text;
             $tabs = new tuitabs();
             $tabs->add('robots.txt', '[editor=robots]');
             $tabs->add('manifest.appcache', '[editor=appcache]');
             return tuitabs::gethead() . $html->adminform($tabs->get(), $args);
             break;
         case 'secure':
             $args->echoexception = $options->echoexception;
             $args->usersenabled = $options->usersenabled;
             $args->reguser = $options->reguser;
             $args->parsepost = $options->parsepost;
             $args->show_draft_post = $options->show_draft_post;
             $args->xxxcheck = $options->xxxcheck;
             $filter = tcontentfilter::i();
             $args->phpcode = $filter->phpcode;
             $args->removephp = tthemeparser::i()->removephp;
             $args->useshell = tupdater::i()->useshell;
             $backuper = tbackuper::i();
             $args->filertype = tadminhtml::array2combo(array('auto' => 'auto', 'file' => 'file', 'ftp' => 'ftp', 'ftpsocket' => 'ftpsocket'), $backuper->filertype);
             $args->formtitle = $lang->securehead;
             $result = $html->adminform('
   [checkbox=echoexception]
   [checkbox=xxxcheck]
   [checkbox=usersenabled]
   [checkbox=reguser]
   [checkbox=removephp]
   [checkbox=phpcode]
   [checkbox=parsepost]
   [checkbox=show_draft_post]
   [combo=filertype]
   [checkbox=useshell]
   ', $args);
             $form = new adminform($args);
             $form->title = $lang->changepassword;
             $args->oldpassword = '';
             $args->newpassword = '';
             $args->repassword = '';
             $form->items = '[password=oldpassword]
   [password=newpassword]
   [password=repassword]';
             $form->submit = 'changepassword';
             $result .= $form->get();
             return $result;
     }
     $result = $this->html->{$this->name}($args);
     return $this->html->fixquote($result);
 }
 public function getcontent()
 {
     $result = '';
     switch ($this->name) {
         case 'menu':
             if (isset($_GET['action']) && in_array($_GET['action'], array('delete', 'setdraft', 'publish'))) {
                 $result .= $this->doaction($this->idget(), $_GET['action']);
             }
             $result .= $this->getmenulist();
             return $result;
         case 'edit':
         case 'editfake':
             $id = tadminhtml::idparam();
             $menus = tmenus::i();
             $parents = array(0 => '-----');
             foreach ($menus->items as $item) {
                 $parents[$item['id']] = $item['title'];
             }
             $html = $this->html;
             $lang = tlocal::i('menu');
             $args = new targs();
             $args->adminurl = $this->adminurl;
             $args->ajax = tadminhtml::getadminlink('/admin/ajaxmenueditor.htm', "id={$id}&get");
             $args->editurl = tadminhtml::getadminlink('/admin/menu/edit', 'id');
             if ($id == 0) {
                 $args->id = 0;
                 $args->title = '';
                 $args->parent = tadminhtml::array2combo($parents, 0);
                 $args->order = tadminhtml::array2combo(range(0, 10), 0);
                 $status = 'published';
             } else {
                 if (!$menus->itemexists($id)) {
                     return $this->notfound;
                 }
                 $menuitem = tmenu::i($id);
                 $args->id = $id;
                 $args->title = $menuitem->getownerprop('title');
                 $args->parent = tadminhtml::array2combo($parents, $menuitem->parent);
                 $args->order = tadminhtml::array2combo(range(0, 10), $menuitem->order);
                 $status = $menuitem->status;
             }
             $args->status = tadminhtml::array2combo(array('draft' => $lang->draft, 'published' => $lang->published), $status);
             if ($this->name == 'editfake' || $id > 0 && $menuitem instanceof tfakemenu) {
                 $args->url = $id == 0 ? '' : $menuitem->url;
                 $args->type = 'fake';
                 $args->formtitle = $lang->faketitle;
                 return $html->adminform('[text=title]
     [text=url]
     [combo=parent]
     [combo=order]
     [combo=status]
     [hidden=type]
     [hidden=id]', $args);
             }
             $tabs = new tuitabs();
             $tabs->add($lang->title, '
   [text=title]
   [combo=parent]
   [combo=order]
   [combo=status]
   [hidden=id]
   ');
             $ajaxurl = tadminhtml::getadminlink('/admin/ajaxmenueditor.htm', "id={$id}&get");
             $tabs->ajax($lang->view, "{$ajaxurl}=view");
             $tabs->ajax('SEO', "{$ajaxurl}=seo");
             $ajaxeditor = tajaxmenueditor::i();
             $args->formtitle = $lang->edit;
             return tuitabs::gethead() . $html->adminform($tabs->get() . sprintf('<div>%s</div>', $ajaxeditor->geteditor('raw', $id == 0 ? '' : $menuitem->rawcontent, true)), $args);
     }
 }