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()
 {
     $result = '';
     $plugin = titemsreplacer::i();
     $views = tviews::i();
     $html = tadminhtml::i();
     $args = targs::i();
     $lang = tplugins::getlangabout(__FILE__);
     $adminurl = tadminhtml::getadminlink('/admin/plugins/', 'plugin=' . basename(dirname(__FILE__)));
     if (!empty($_GET['id'])) {
         $id = (int) $_GET['id'];
         if (isset($plugin->items[$id])) {
             $args->formtitle = sprintf($lang->formtitle, $views->items[$id]['name']);
             $tabs = new tuitabs();
             $tabs->add($lang->add, $html->getinput('text', 'addtag', '', $lang->addtag) . $html->getinput('editor', 'addreplace', '', $lang->replace));
             $i = 0;
             foreach ($plugin->items[$id] as $tag => $replace) {
                 $tabs->add($tag, $html->getinput('editor', "replace-{$i}", tadminhtml::specchars($replace), $lang->replace));
                 $i++;
             }
             $result .= $html->adminform($tabs->get(), $args);
         }
     }
     $result .= "<h4>{$lang->viewlist}</h4><ul>";
     foreach (array_keys($plugin->items) as $id) {
         $name = $views->items[$id]['name'];
         $result .= "<li><a href='{$adminurl}&id={$id}'>{$name}</a></li>";
     }
     $result .= '</ul>';
     $form = "<h3>{$lang->addview}</h3>\n    <form name='form' action='{$adminurl}&action=add' method='post' >\n    " . $html->getinput('text', 'viewname', '', $lang->viewname) . "\n    <p><input type='submit' name='submitbutton' id='idsubmitbutton' value='{$lang->add}' /></p>\n    </form>";
     $result .= $form;
     return $result;
 }
 public function gettab($html, $args, $lang)
 {
     $a = $this->getadmininfo($lang);
     $result = $html->p(sprintf($lang->odnoklass_reg, 'http://dev.odnoklassniki.ru/wiki/display/ok/How+to+add+application+on+site'));
     $result .= $html->getinput('text', "client_id_{$this->name}", tadminhtml::specchars($this->client_id), $a['client_id']);
     $result .= $html->getinput('text', "client_secret_{$this->name}", tadminhtml::specchars($this->client_secret), $a['client_secret']);
     $result .= $html->getinput('text', "public_key_{$this->name}", tadminhtml::specchars($this->public_key), $lang->odnoklass_public_key);
     return $result;
 }
 public static function getcombocategories(array $items, $idselected)
 {
     $result = '';
     $categories = tcategories::i();
     $categories->loadall();
     if (count($items) == 0) {
         $items = array_keys($categories->items);
     }
     foreach ($items as $id) {
         $result .= sprintf('<option value="%s" %s>%s</option>', $id, $id == $idselected ? 'selected' : '', tadminhtml::specchars($categories->getvalue($id, 'title')));
     }
     return $result;
 }
 public function getcontent()
 {
     $plugin = ttagreplacer::i();
     $html = tadminhtml::i();
     $tabs = new tuitabs();
     $args = targs::i();
     $about = tplugins::getabout('tagreplacer');
     $args->formtitle = $about['name'];
     $tabs->add($about['new'], $html->getinput('text', 'where-add', '', $about['where']) . $html->getinput('text', 'search-add', '', $about['search']) . $html->getinput('editor', 'replace-add', '', $about['replace']));
     foreach ($plugin->items as $i => $item) {
         $tabs->add($item['where'], $html->getinput('text', "where-{$i}", tadminhtml::specchars($item['where']), $about['where']) . $html->getinput('text', "search-{$i}", tadminhtml::specchars($item['search']), $about['search']) . $html->getinput('editor', "replace-{$i}", tadminhtml::specchars($item['replace']), $about['replace']));
     }
     return $html->adminform($tabs->get(), $args);
 }
 public function getcontent()
 {
     $merger = $this->getmerger();
     $tabs = new tuitabs();
     $html = $this->html;
     $lang = tlocal::i('views');
     $args = targs::i();
     $args->formtitle = $this->title;
     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());
     }
     return $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 getcontent()
 {
     $result = '';
     $this->basename = 'tickets';
     $ticket = tticket::i($this->idpost);
     ttheme::$vars['ticket'] = $ticket;
     ttheme::$vars['post'] = $ticket;
     $args = new targs();
     $args->id = $this->idpost;
     $args->title = tcontentfilter::unescape($ticket->title);
     $args->ajax = tadminhtml::getadminlink('/admin/ajaxposteditor.htm', "id={$ticket->id}&get");
     $ajaxeditor = tajaxposteditor::i();
     $args->raw = $ajaxeditor->geteditor('raw', $ticket->rawcontent, true);
     $html = $this->inihtml('tickets');
     $lang = tlocal::admin('tickets');
     $lang->ini['tickets'] = $lang->ini['ticket'] + $lang->ini['tickets'];
     $args->code = $html->getinput('editor', 'code', tadminhtml::specchars($ticket->code), $lang->codetext);
     $args->fixed = $ticket->state == 'fixed';
     $tickets = ttickets::i();
     $args->catcombo = tposteditor::getcombocategories($tickets->cats, count($ticket->categories) ? $ticket->categories[0] : $tickets->cats[0]);
     $states = array();
     foreach (array('fixed', 'opened', 'wontfix', 'invalid', 'duplicate', 'reassign') as $state) {
         $states[$state] = $lang->{$state};
     }
     $args->statecombo = $html->array2combo($states, $ticket->state);
     $prio = array();
     foreach (array('trivial', 'minor', 'major', 'critical', 'blocker') as $p) {
         $prio[$p] = $lang->{$p};
     }
     $args->priocombo = $html->array2combo($prio, $ticket->prio);
     if ($ticket->id > 0) {
         $result .= $html->headeditor();
     }
     $result .= $html->form($args);
     $result = $html->fixquote($result);
     return $result;
 }
 private function getlist($kind)
 {
     $result = '';
     $comments = tcomments::i(0);
     $perpage = 20;
     // get total count
     $status = $kind == 'hold' ? 'hold' : 'approved';
     $where = "{$comments->thistable}.status = '{$status}'";
     if ($this->iduser) {
         $where .= " and {$comments->thistable}.author = {$this->iduser}";
     }
     $total = $comments->db->getcount($where);
     $from = $this->getfrom($perpage, $total);
     $list = $comments->select($where, "order by {$comments->thistable}.posted desc limit {$from}, {$perpage}");
     $html = $this->html;
     $result .= sprintf($html->h4->listhead, $from, $from + count($list), $total);
     $table = $this->createtable();
     $args = targs::i();
     $args->adminurl = $this->adminurl;
     $comment = new tcomment(0);
     ttheme::$vars['comment'] = $comment;
     $body = '';
     foreach ($list as $id) {
         $comment->id = $id;
         $args->id = $id;
         $args->excerpt = tadminhtml::specchars(tcontentfilter::getexcerpt($comment->content, 120));
         $args->onhold = $comment->status == 'hold';
         $args->email = $comment->email == '' ? '' : "<a href='mailto:{$comment->email}'>{$comment->email}</a>";
         $args->website = $comment->website == '' ? '' : "<a href='{$comment->website}'>{$comment->website}</a>";
         $body .= $html->parsearg($table->body, $args);
     }
     $result .= $table->build($body, $html->div($html->getsubmit('approve') . $html->getsubmit('hold') . $html->getsubmit('delete')));
     $theme = ttheme::i();
     $result .= $theme->getpages($this->url, litepublisher::$urlmap->page, ceil($total / $perpage), $this->iduser ? "iduser={$this->iduser}" : '');
     return $result;
 }
 public function getcontent()
 {
     $datadir = litepublisher::$paths->data . 'keywords' . DIRECTORY_SEPARATOR;
     $selfdir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
     $tml = parse_ini_file($selfdir . 'keywords.templates.ini', false);
     $about = tplugins::getabout(tplugins::getname(__FILE__));
     $html = $this->html;
     $lang = $this->lang;
     $args = targs::i();
     if (isset($_GET['filename'])) {
         $filename = $_GET['filename'];
         if (!@file_exists($datadir . $filename)) {
             return $html->h3->notfound;
         }
         $args->filename = $filename;
         $args->content = file_get_contents($datadir . $filename);
         $args->formtitle = $about['edithead'];
         return $html->adminform('[editor=content]', $args);
     }
     $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
     $result = '';
     if ($page == 1) {
         $widget = tkeywordswidget::i();
         $widgets = twidgets::i();
         $idwidget = $widgets->find($widget);
         $args->count = $widget->count;
         $args->trace = $widget->trace;
         $args->notify = $widget->notify;
         $args->optionsform = 1;
         $args->title = $widget->gettitle($idwidget);
         $args->blackwords = tadminhtml::specchars(implode("\n", tkeywordsplugin::i()->blackwords));
         $lang = tplugins::getlangabout(__FILE__);
         $args->formtitle = $about['name'];
         $result .= $html->adminform('[text=title]
   [text=count]
   [checkbox=trace]
   [checkbox=notify]
   [editor=blackwords]
   [hidden=optionsform]', $args);
     }
     $from = 100 * ($page - 1);
     $filelist = tfiler::getfiles($datadir);
     sort($filelist);
     $count = ceil(count($filelist) / 100);
     $links = $this->getlinkpages($page, $count);
     $result .= $links;
     $filelist = array_slice($filelist, $from, 100, true);
     $list = '';
     $args->url = litepublisher::$site->url . '/admin/plugins/' . litepublisher::$site->q . 'plugin=' . basename(dirname(__FILE__));
     foreach ($filelist as $filename) {
         if (!preg_match('/^\\d+?\\.\\d+?\\.php$/', $filename)) {
             continue;
         }
         $args->filename = $filename;
         $args->content = file_get_contents($datadir . $filename);
         $list .= $html->parsearg($tml['item'], $args);
     }
     $args->list = $list;
     $result .= $html->parsearg($tml['form'], $args);
     $result .= $links;
     return $result;
 }
 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 geteditor($name, $value, $visual)
 {
     $html = tadminhtml::i();
     $hsect = $html->section;
     $html->section = 'editor';
     $lang = tlocal::i();
     $lsect = $lang->section;
     $lang->section = 'editor';
     $title = $lang->{$name};
     if ($visual && $this->ajaxvisual && $this->visual) {
         $title .= $html->loadvisual();
     }
     $result = $html->getinput('editor', $name, tadminhtml::specchars($value), $title);
     $lang->section = $lsect;
     $html->section = $hsect;
     return $result;
 }
 public function gettab($html, $args, $lang)
 {
     $a = $this->getadmininfo($lang);
     $result = $html->p(sprintf($lang->reg, $a['regurl'], litepublisher::$site->url . $this->url));
     $result .= $html->getinput('text', "client_id_{$this->name}", tadminhtml::specchars($this->client_id), $a['client_id']);
     $result .= $html->getinput('text', "client_secret_{$this->name}", tadminhtml::specchars($this->client_secret), $a['client_secret']);
     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;
 }