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 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); }
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 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); }
public function getcontent() { $widget = tpostcatwidget::i(); $about = tplugins::getabout(tplugins::getname(__FILE__)); $args = targs::i(); $id = (int) tadminhtml::getparam('idwidget', 0); if (isset($widget->items[$id])) { $item = $widget->items[$id]; $args->mode = 'edit'; $args->idwidget = $id; } else { $item = array('title' => '', 'content' => '', 'template' => 'widget', 'cats' => array()); $args->mode = 'add'; $args->idwidget = 0; } $cats = tposteditor::getcategories($item['cats']); $html = $this->html; $html->section = 'widgets'; $args->add($item); $args->widgettitle = $item['title']; $args->template = tadminhtml::array2combo(self::gettemplates(), $item['template']); $args->formtitle = $item['title'] == '' ? $this->lang->widget : $item['title']; $result = $html->adminform(' [text=widgettitle] [editor=content] [combo=template] [hidden=idwidget] [hidden=mode]' . sprintf('<h4>%s</h4>', $about['cats']) . $cats, $args); $result .= $this->getlist($widget); return $result; }
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() { $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() { $plugin = catbread::i(); $lang = tplugins::getnamelang('catbread'); $html = tadminhtml::i(); $args = new targs(); $args->add($plugin->tml); $args->showhome = $plugin->showhome; $args->showchilds = $plugin->showchilds; $args->showsimilar = $plugin->showsimilar; $lang->addsearch('sortnametags'); $sort = array('title' => $lang->title, 'itemscount' => $lang->count, 'customorder' => $lang->customorder); $args->sort = tadminhtml::array2combo($sort, $plugin->childsortname); $pos = array('top' => $lang->top, 'before' => $lang->before, 'after' => $lang->after); $args->breadpos = tadminhtml::array2combo($pos, $plugin->breadpos); $args->similarpos = tadminhtml::array2combo($pos, $plugin->similarpos); $args->formtitle = $lang->formtitle; return $html->adminform(' [checkbox=showhome] [combo=breadpos] [text=item] [text=active] [text=child] [editor=items] [editor=container] [checkbox=showchilds] [combo=sort] [text=childitem] [text=childsubitems] [editor=childitems] [checkbox=showsimilar] [combo=similarpos] [text=similaritem] [text=similaritems] ', $args); }
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 = ''; $polls = tpolls::i(); $html = tadminhtml::i(); $lang = tlocal::admin('polls'); $args = new targs(); $adminurl = $this->adminurl; if ($action = $this->action) { $id = $this->idget(); switch ($action) { case 'delete': if ($this->confirmed) { $polls->delete($id); $result .= $html->h4->deleted; } else { $result .= $html->confirmdelete($id, $adminurl, $lang->confirmdelete); } break; case 'edit': if (!$polls->itemexists($id)) { $result .= $this->notfound(); } else { $result .= sprintf($html->h4->shorttag, $id); $item = $polls->getitem($id); $args->status = $this->getcombostatus($item['status']); $args->id_tml = $this->getcombotml($item['id_tml']); $args->id = $id; $args->formtitle = $lang->editpoll; $result .= $html->adminform('[combo=status] [combo=id_tml] ', $args); } break; case 'add': $args->status = $this->getcombostatus('opened'); $args->id_tml = $this->getcombotml(tpollsman::i()->pollpost); $args->formtitle = $lang->addpoll; $result .= $html->adminform('[combo=status] [combo=id_tml] ', $args); break; case 'create': $args->status = $this->getcombostatus('opened'); $args->status = ''; $args->title = ''; $types = array_keys(tpolltypes::i()->items); $args->type = tadminhtml::array2combo(array_combine($types, $types), $types[0]); $args->newitems = ''; $args->formtitle = $lang->createpoll; $result .= $html->adminform('[combo=status] [text=name] [text=title] [combo=type] [editor=newitems] ', $args); break; } } $result .= "<ul>\n <li><a href='{$adminurl}=0&action=add'>{$lang->addpoll}</a></li>\n <li><a href='{$adminurl}=0&action=create'>{$lang->createpoll}</a></li>\n </ul>"; $args->adminurl = $adminurl; $table = ''; $tr = '<tr> <td><a href="$adminurl=$id&action=edit">$name</a></td> <td><a href=$adminurl=$id&action=delete">$lang.delete</a></td> </tr>'; $perpage = 20; $count = $polls->db->getcount(); $from = $this->getfrom($perpage, $count); $items = $polls->select('', " order by id desc limit {$from}, {$perpage}"); $result .= sprintf($html->h4->count, $from, $from + count($items), $count); foreach ($items as $id) { $item = $polls->getitem($id); $args->id = $id; $args->add($item); $tml = $polls->get_tml($item['id_tml']); $args->name = $tml['name']; $args->title = $tml['title']; $table .= $html->parsearg($tr, $args); } $head = "<tr>\n <th>{$lang->edit}</th>\n <th>{$lang->delete}</th>\n </tr>"; $result .= $html->gettable($head, $table); $theme = ttheme::i(); $result .= $theme->getpages($this->url, litepublisher::$urlmap->page, ceil($count / $perpage)); return $result; }
public function getcontent() { $widget = $this->widget; $args = new targs(); $id = (int) tadminhtml::getparam('idwidget', 0); if (isset($widget->items[$id])) { $item = $widget->items[$id]; $args->mode = 'edit'; $viewcombo = ''; } else { $id = 0; $viewcombo = tadminviews::getcomboview(1); $args->mode = 'add'; $item = array('title' => '', 'content' => '', 'template' => 'widget'); } $args->idwidget = $id; $html = $this->html; $args->text = $item['content']; $args->template = tadminhtml::array2combo(self::gettemplates(), $item['template']); $result = $this->optionsform($item['title'], $viewcombo . $html->parsearg('[editor=text] [combo=template] [hidden=mode] [hidden=idwidget]', $args)); $lang = tlocal::i(); $args->formtitle = $lang->widgets; $args->table = $html->buildtable($widget->items, array($html->get_table_checkbox('widgetcheck'), array('left', $lang->widgettitle, "<a href=\"{$this->adminurl}\$id\" title=\"\$title\">\$title</a>"))); $result .= $html->deletetable($args); return $result; }
public function getcontent() { $result = ''; $cm = tcommentmanager::i(); $options = litepublisher::$options; $html = $this->gethtml('comments'); $lang = tlocal::admin('commentmanager'); $args = new targs(); $tabs = new tuitabs(); $args->comstatus = tadminhtml::array2combo(array('closed' => $lang->closed, 'reg' => $lang->reg, 'guest' => $lang->guest, 'comuser' => $lang->comuser), $options->comstatus); $args->filterstatus = $cm->filterstatus; $args->commentsapproved = $cm->defstatus == 'approved'; $args->checkduplicate = $cm->checkduplicate; $args->commentsdisabled = $options->commentsdisabled; $args->pingenabled = $options->pingenabled; $tabs->add($lang->options, ' [combo=comstatus] [checkbox=filterstatus] [checkbox=commentsapproved] [checkbox=checkduplicate] [checkbox=commentsdisabled] [checkbox=pingenabled] '); $args->commentpages = $options->commentpages; $args->commentsperpage = $options->commentsperpage; $args->comments_invert_order = $options->comments_invert_order; $args->hidelink = $cm->hidelink; $args->redir = $cm->redir; $args->nofollow = $cm->nofollow; $tabs->add($lang->templates, ' [checkbox=commentpages] [text=commentsperpage] [checkbox=comments_invert_order] [checkbox=hidelink] [checkbox=redir] [checkbox=nofollow] '); $rss = trssholdcomments::i(); $args->rsscount = $rss->count; $args->rsstemplate = $rss->template; $tabs->add($lang->holdrss, ' <h4><a href="$site.url/rss/holdcomments.xml">$lang.holdrss</a></h4> [text=rsscount] [editor=rsstemplate] '); $args->canedit = $cm->canedit; $args->candelete = $cm->candelete; $args->confirmlogged = $cm->confirmlogged; $args->confirmguest = $cm->confirmguest; $args->confirmcomuser = $cm->confirmcomuser; $args->confirmemail = $cm->confirmemail; $tabs->add($lang->perms, ' [checkbox=canedit] [checkbox=candelete] [checkbox=confirmlogged] [checkbox=confirmguest] [checkbox=confirmcomuser] [checkbox=confirmemail] '); $args->sendnotification = $cm->sendnotification; $args->comuser_subscribe = $cm->comuser_subscribe; $useroptions = tuseroptions::i(); $args->defaultsubscribe = $useroptions->defvalues['subscribe'] == 'enabled'; $args->authorpost_subscribe = $useroptions->defvalues['authorpost_subscribe'] == 'enabled'; $subscribe = tsubscribers::i(); $args->locklist = $subscribe->locklist; $args->subscribe_enabled = $subscribe->enabled; $tab = new tuitabs(); $tab->add($lang->options, ' [checkbox=sendnotification] [checkbox=defaultsubscribe] [checkbox=subscribe_enabled] [checkbox=authorpost_subscribe] [checkbox=comuser_subscribe] '); $tab->add($lang->locklist, '[editor=locklist]'); $tabs->add($lang->subscribe, $tab->get()); $mesgtabs = new tuitabs(); $tc = ttemplatecomments::i(); foreach (array('logged', 'reqlogin', 'regaccount', 'guest', 'comuser', 'loadhold') as $name) { $args->{$name} = $tc->{$name}; $mesgtabs->add($lang->{$name}, "[editor={$name}]"); } $tabs->add($lang->mesgtabs, $mesgtabs->get()); $args->formtitle = $lang->title; return $html->adminform($tabs->get(), $args); }
public function getcontent() { $theme = tview::i(tviews::i()->defaults['admin'])->theme; $html = tadminhtml::i(); $html->section = 'editor'; $lang = tlocal::i('editor'); $post = tpost::i($this->idpost); ttheme::$vars['post'] = $post; switch ($_GET['get']) { case 'tags': $result = $html->getedit('tags', $post->tagnames, $lang->tags); $lang->section = 'editor'; $result .= $html->h4->addtags; $items = array(); $tags = $post->factory->tags; $list = $tags->getsorted(-1, 'name', 0); foreach ($list as $id) { $items[] = '<a href="" class="posteditor-tag">' . $tags->items[$id]['title'] . "</a>"; } $result .= sprintf('<p>%s</p>', implode(', ', $items)); break; case 'status': $args = new targs(); $args->comstatus = tadminhtml::array2combo(array('closed' => $lang->closed, 'reg' => $lang->reg, 'guest' => $lang->guest, 'comuser' => $lang->comuser), $post->comstatus); $args->pingenabled = $post->pingenabled; $args->status = tadminhtml::array2combo(array('published' => $lang->published, 'draft' => $lang->draft), $post->status); $args->perms = tadminperms::getcombo($post->idperm); $args->password = $post->password; $result = $html->parsearg('[combo=comstatus] [checkbox=pingenabled] [combo=status] $perms [password=password] <p>$lang.notepassword</p>', $args); break; case 'view': $result = $this->getviewicon($post->idview, $post->icon); break; default: $result = var_export($_GET, true); } //tfiler::log($result); return turlmap::htmlheader(false) . $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 getcontent() { $result = ''; $lang = tlocal::i(); $theme = ttheme::i(); foreach ($this->props as $prop) { $value = $prop['obj']->{$prop['propname']}; switch ($prop['type']) { case 'text': case 'editor': $value = tadminhtml::specchars($value); break; case 'checkbox': $value = $value ? 'checked="checked"' : ''; break; case 'combo': $value = tadminhtml::array2combo($prop['items'], $value); break; } $result .= strtr($theme->templates['content.admin.' . $prop['type']], array('$lang.$name' => empty($prop['title']) ? $lang->{$prop['propname']} : $prop['title'], '$name' => $prop['propname'], '$value' => $value)); } return $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); } }
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 = ''; $users = tusers::i(); $groups = tusergroups::i(); $html = $this->html; $lang = tlocal::i('users'); $args = targs::i(); $id = $this->idget(); switch ($this->action) { case 'edit': if (!$users->itemexists($id)) { $result .= $this->notfound(); } else { $statuses = array(); foreach (array('approved', 'hold', 'comuser') as $name) { $statuses[$name] = $lang->{$name}; } $item = $users->getitem($id); $args->add($item); $args->registered = tuserpages::i()->getvalue($id, 'registered'); $args->formtitle = $item['name']; $args->status = tadminhtml::array2combo($statuses, $item['status']); $tabs = new tuitabs(); $tabs->add($lang->login, '[text=email] [password=password]'); $tabs->add($lang->groups, '[combo=status]' . tadmingroups::getgroups($item['idgroups'])); $tabs->add('Cookie', '[text=cookie] [text=expired] [text=registered] [text=trust]'); $args->password = ''; $result .= $html->adminform($tabs->get(), $args); } break; case 'delete': $result .= $html->confirm_delete($users, $this->adminurl); break; default: $args->formtitle = $lang->newuser; $args->email = ''; $args->action = 'add'; $tabs = new tuitabs(); $tabs->add($lang->login, '[text=email] [password=password] [text=name] [hidden=action]'); $tabs->add($lang->groups, tadmingroups::getgroups(array())); $result .= $html->adminform($tabs->get(), $args); } $args->search = ''; //table $perpage = 20; $count = $users->count; $from = $this->getfrom($perpage, $count); $where = ''; $params = ''; if (!empty($_GET['idgroup'])) { $idgroup = (int) tadminhtml::getparam('idgroup', 0); if ($groups->itemexists($idgroup)) { $grouptable = litepublisher::$db->prefix . $users->grouptable; $where = "{$users->thistable}.id in (select iduser from {$grouptable} where idgroup = {$idgroup})"; $params = "idgroup={$idgroup}"; } } elseif ($search = trim(tadminhtml::getparam('search', ''))) { $params = 'search=' . urlencode($search); $args->search = $search; $search = litepublisher::$db->escape($search); $search = strtr($search, array('%' => '\\%', '_' => '\\_')); $where = "email like '%{$search}%' or name like '%{$search}%' "; $count = $users->db->getcount($where); $from = $this->getfrom($perpage, $count); } $items = $users->select($where, " order by id desc limit {$from}, {$perpage}"); if (!$items) { $items = array(); } $args->adminurl = $this->adminurl; $args->formtitle = $lang->userstable; $args->table = $html->items2table($users, $items, array($html->get_table_checkbox('user'), array('left', $lang->edit, sprintf('<a href="%s=$id&action=edit">$name</a>', $this->adminurl)), $html->get_table_item('status'), array('left', $lang->comments, sprintf('<a href="%s">%s</a>', tadminhtml::getadminlink('/admin/comments/', 'iduser=$id'), $lang->comments)), array('left', $lang->page, sprintf('<a href="%s">%s</a>', tadminhtml::getadminlink('/admin/users/pages/', 'id=$id'), $lang->page)), $html->get_table_link('delete', $this->adminurl))); $result .= $html->deletetable($args); $result = $html->fixquote($result); $theme = ttheme::i(); $result .= $theme->getpages($this->url, litepublisher::$urlmap->page, ceil($count / $perpage), $params); $form = new adminform($args); $form->method = 'get'; $form->inline = true; $form->items = '[text=search]'; $form->submit = 'find'; $result .= $form->get(); return $result; }
public function getcontent() { $result = ''; $polls = tpolls::i(); $html = tadminhtml::i(); $lang = tlocal::admin('polls'); $args = new targs(); $dir = litepublisher::$paths->data . 'polls'; $adminurl = $this->adminurl; if ($action = $this->action) { $id = $this->idget(); switch ($action) { case 'delete': $man = tpollsman::i(); if ($id == $man->pollpost) { return $html->h4->deletepullpost; } if ($this->confirmed) { tfilestorage::delete($dir . DIRECTORY_SEPARATOR . "{$id}.php"); tfilestorage::delete($dir . DIRECTORY_SEPARATOR . "{$id}.bak.php"); unset($polls->tml_items[$id]); $polls->db->update('id_tml = ' . $man->pollpost, "id_tml = {$id}"); $result .= $html->h4->deleted; } else { $result .= $html->confirmdelete($id, $adminurl, $lang->confirmdelete); } break; case 'edit': if ($tml = $polls->get_tml($id)) { $args->add($tml); $args->id = $id; $args->name = tcontentfilter::unescape($tml['name']); $args->title = tcontentfilter::unescape($tml['title']); //$args->items = implode("\n", $tml['items']); $tabs = new tuitabs(); //$tabs->add($lang->pollitems, "[editor=items]"); $tabs->add($lang->opened, "[editor=opened]"); $tabs->add($lang->closed, "[editor=closed]"); $args->formtitle = $lang->edittemplate; $result .= $html->adminform(' [text=name] [text=title]' . $tabs->get(), $args); } break; case 'add': $types = array_keys(tpolltypes::i()->items); $args->type = tadminhtml::array2combo(array_combine($types, $types), $types[0]); $args->name = ''; $args->title = ''; $args->newitems = ''; $args->formtitle = $lang->newtemplate; $result .= $html->adminform('[text=name] [text=title] [combo=type] [editor=newitems]', $args); break; } } $result .= $html->h3("<a href='{$adminurl}=0&action=add'>{$lang->addtemplate}</a>"); $result .= $html->h4->alltemplates; $args->adminurl = $adminurl; $table = ''; $tr = '<tr> <td><a href="$adminurl=$id&action=edit">$name</a></td> <td><a href="$adminurl=$id&action=delete">$lang.delete</a></td> </tr>'; $polls->loadall_tml(); foreach ($polls->tml_items as $id => $tml) { $args->id = $id; $args->name = $tml['name']; $args->title = $tml['title']; $table .= $html->parsearg($tr, $args); } $head = "<tr>\n <th>{$lang->edit}</th>\n <th>{$lang->delete}</th>\n </tr>"; $result .= $html->gettable($head, $table); return $result; }